|
|
@@ -31,7 +31,7 @@ import com.sckw.transport.model.*;
|
|
|
import com.sckw.transport.model.param.LogisticsOrderQuery;
|
|
|
import com.sckw.transport.model.param.ManagementLogisticsOrderQuery;
|
|
|
import com.sckw.transport.model.vo.CarWaybillVO;
|
|
|
-import com.sckw.transport.model.vo.ManagementLogsiticsOrderVO;
|
|
|
+import com.sckw.transport.model.vo.ManagementLogisticsOrderVO;
|
|
|
import com.sckw.transport.model.vo.OrderDetailVO;
|
|
|
import com.sckw.transport.model.vo.execlVo.ManagementLogisticsOrderExcelVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
@@ -98,6 +98,10 @@ public class ManagementLogisticsOrderService {
|
|
|
* @return
|
|
|
*/
|
|
|
public PageRes selectLogisticsOrder(ManagementLogisticsOrderQuery query) {
|
|
|
+ List<Long> idsList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(query.getIds())) {
|
|
|
+ idsList = StringUtils.splitStrToList(query.getIds(), Long.class);
|
|
|
+ }
|
|
|
Long entId = LoginUserHolder.getEntId();
|
|
|
PageHelper.startPage(query.getPage(), query.getPageSize());
|
|
|
List<Integer> orderList = new ArrayList<>();
|
|
|
@@ -134,8 +138,8 @@ public class ManagementLogisticsOrderService {
|
|
|
longs.add(LoginUserHolder.getUserId());
|
|
|
List<Long> longList = longs.stream().distinct().collect(Collectors.toList());
|
|
|
// LoginUserHolder.getIsMain()
|
|
|
- List<ManagementLogsiticsOrderVO> list = logisticsOrderMapper.selectManagementLogisticsOrderList(query, orderList, entId, longList, longList);
|
|
|
- PageInfo<ManagementLogsiticsOrderVO> pageInfo = new PageInfo<>(list);
|
|
|
+ List<ManagementLogisticsOrderVO> list = logisticsOrderMapper.selectManagementLogisticsOrderList(query, orderList, entId, longList, longList, idsList);
|
|
|
+ PageInfo<ManagementLogisticsOrderVO> pageInfo = new PageInfo<>(list);
|
|
|
if (CollectionUtils.isEmpty(list)) {
|
|
|
return PageRes.build(pageInfo, list);
|
|
|
}
|
|
|
@@ -154,12 +158,12 @@ public class ManagementLogisticsOrderService {
|
|
|
// Map<String, String> taxRateTypeDictData = getDictData(DictTypeEnum.TAX_RATE_TYPE.getType());
|
|
|
Map<Long, UserCacheResDto> longUserMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
- List<Long> collect = list.stream().map(ManagementLogsiticsOrderVO::getCreateBy).collect(Collectors.toList());
|
|
|
+ List<Long> collect = list.stream().map(ManagementLogisticsOrderVO::getCreateBy).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isNotEmpty(collect)) {
|
|
|
longUserMap = remoteSystemService.queryUserCacheMapByIds(collect);
|
|
|
}
|
|
|
}
|
|
|
- for (ManagementLogsiticsOrderVO vo : list) {
|
|
|
+ for (ManagementLogisticsOrderVO vo : list) {
|
|
|
vo.setAccountsCycleLabel(settlementDictData.get(vo.getAccountsCycle()));
|
|
|
vo.setAppointor(longUserMap.get(vo.getCreateBy()) == null ? null : longUserMap.get(vo.getCreateBy()).getName());
|
|
|
vo.setBillingModeLabel(chargingDictData.get(vo.getBillingMode()));
|
|
|
@@ -244,6 +248,10 @@ public class ManagementLogisticsOrderService {
|
|
|
}
|
|
|
|
|
|
public List<ManagementLogisticsOrderExcelVo> exportLogisticsOrder(ManagementLogisticsOrderQuery query) {
|
|
|
+ List<Long> idsList = new ArrayList<>();
|
|
|
+ if (StringUtils.isNotBlank(query.getIds())) {
|
|
|
+ idsList = StringUtils.splitStrToList(query.getIds(), Long.class);
|
|
|
+ }
|
|
|
Long entId = LoginUserHolder.getEntId();
|
|
|
// PageHelper.startPage(query.getPage(), query.getPageSize());
|
|
|
List<Integer> orderList = new ArrayList<>();
|
|
|
@@ -279,7 +287,7 @@ public class ManagementLogisticsOrderService {
|
|
|
List<Long> longs = LoginUserHolder.getAuthUserIdList();
|
|
|
longs.add(LoginUserHolder.getUserId());
|
|
|
List<Long> longList = longs.stream().distinct().collect(Collectors.toList());
|
|
|
- List<ManagementLogsiticsOrderVO> list = logisticsOrderMapper.selectManagementLogisticsOrderList(query, orderList, entId, longList, longList);
|
|
|
+ List<ManagementLogisticsOrderVO> list = logisticsOrderMapper.selectManagementLogisticsOrderList(query, orderList, entId, longList, longList, idsList);
|
|
|
/**计费方式*/
|
|
|
Map<String, String> chargingDictData = commonService.getDictData(DictTypeEnum.CHARGING_TYPE.getType());
|
|
|
/**结算周期*/
|
|
|
@@ -292,15 +300,16 @@ public class ManagementLogisticsOrderService {
|
|
|
Map<String, String> priceType = commonService.getDictData(DictTypeEnum.PRICE_TYPE.getType());
|
|
|
Map<Long, UserCacheResDto> longUserMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
- List<Long> collect = list.stream().map(ManagementLogsiticsOrderVO::getCreateBy).collect(Collectors.toList());
|
|
|
+ List<Long> collect = list.stream().map(ManagementLogisticsOrderVO::getCreateBy).collect(Collectors.toList());
|
|
|
if (CollectionUtils.isNotEmpty(collect)) {
|
|
|
longUserMap = remoteSystemService.queryUserCacheMapByIds(collect);
|
|
|
}
|
|
|
}
|
|
|
List<ManagementLogisticsOrderExcelVo> exportList = new ArrayList<>();
|
|
|
- for (ManagementLogsiticsOrderVO vo : list) {
|
|
|
+ for (ManagementLogisticsOrderVO vo : list) {
|
|
|
ManagementLogisticsOrderExcelVo managementLogisticsOrderExcelVo = new ManagementLogisticsOrderExcelVo();
|
|
|
BeanUtils.copyProperties(vo, managementLogisticsOrderExcelVo);
|
|
|
+// managementLogisticsOrderExcelVo.setStatus(vo.getStatus().toString());
|
|
|
managementLogisticsOrderExcelVo.setPriceLabel(vo.getPrice() == null ? null : vo.getPrice().toString() + priceType.get(vo.getPriceType()));
|
|
|
managementLogisticsOrderExcelVo.setLossUnitLabel(vo.getLoss() == null ? null : vo.getLoss().toString() + taxRate.get(vo.getLossUnit()));
|
|
|
managementLogisticsOrderExcelVo.setGoodsPriceLabel(vo.getGoodsPrice() == null ? null : vo.getGoodsPrice().toString() + priceType.get(vo.getGoodsPriceUnit()));
|
|
|
@@ -311,37 +320,28 @@ public class ManagementLogisticsOrderService {
|
|
|
managementLogisticsOrderExcelVo.setStatusLabel(LogisticsOrderEnum.getName(vo.getStatus()));
|
|
|
managementLogisticsOrderExcelVo.setLoadAddress(vo.getLoadCityName() + vo.getLoadAddress());
|
|
|
managementLogisticsOrderExcelVo.setUnloadAddress(vo.getUnloadCityName() + vo.getUnloadAddress());
|
|
|
- if (vo.getTOrderId() != null) {
|
|
|
- OrderDetailRes orderDetailRes = tradeOrderInfoService.getOrderDetailById(Long.valueOf(vo.getTOrderId()));
|
|
|
- if (orderDetailRes != null) {
|
|
|
- List<UnitInfoDetailRes> unitInfo = orderDetailRes.getUnitInfo();
|
|
|
- for (UnitInfoDetailRes detailRes : unitInfo) {
|
|
|
- if (String.valueOf(NumberConstant.ONE).equals(detailRes.getUnitType())) {
|
|
|
- managementLogisticsOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
|
|
|
- } else {
|
|
|
- managementLogisticsOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
BigDecimal subtract = vo.getCarryingCapacity().subtract(vo.getSubcontractAmount()).subtract(vo.getEntrustAmount());
|
|
|
DecimalFormat df = new DecimalFormat("0.00");
|
|
|
managementLogisticsOrderExcelVo.setWaitDistributionAmount(subtract == null ? null : df.format(subtract));
|
|
|
String tOrderId = vo.getTOrderId();
|
|
|
if (StringUtils.isNotBlank(tOrderId)) {
|
|
|
- OrderDetailRes orderDetailById = tradeOrderInfoService.getOrderDetailById(Long.parseLong(tOrderId));
|
|
|
- if (orderDetailById != null) {
|
|
|
- List<UnitInfoDetailRes> unitInfo = orderDetailById.getUnitInfo();
|
|
|
- if (CollectionUtils.isNotEmpty(unitInfo)) {
|
|
|
- for (UnitInfoDetailRes detailRes : unitInfo) {
|
|
|
- if ("1".equals(detailRes.getUnitType())) {
|
|
|
- managementLogisticsOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
|
|
|
- }
|
|
|
- if ("2".equals(detailRes.getUnitType())) {
|
|
|
- managementLogisticsOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
|
|
|
+ try {
|
|
|
+ OrderDetailRes orderDetailById = tradeOrderInfoService.getOrderDetailById(Long.parseLong(tOrderId));
|
|
|
+ if (orderDetailById != null) {
|
|
|
+ List<UnitInfoDetailRes> unitInfo = orderDetailById.getUnitInfo();
|
|
|
+ if (CollectionUtils.isNotEmpty(unitInfo)) {
|
|
|
+ for (UnitInfoDetailRes detailRes : unitInfo) {
|
|
|
+ if ("1".equals(detailRes.getUnitType())) {
|
|
|
+ managementLogisticsOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
|
|
|
+ }
|
|
|
+ if ("2".equals(detailRes.getUnitType())) {
|
|
|
+ managementLogisticsOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ } catch (Exception e) {
|
|
|
+ log.info("获取收发货单位异常:torderId{},错误信息:{}", tOrderId, e.getMessage(), e);
|
|
|
}
|
|
|
}
|
|
|
managementLogisticsOrderExcelVo.setSubcontractAmount(Objects.isNull(vo.getSubcontractAmount()) ? null : df.format(vo.getSubcontractAmount()) + priceType.get(vo.getPriceType()));
|