Преглед изворни кода

Merge remote-tracking branch 'origin/dev' into dev

xucaiqin пре 2 година
родитељ
комит
7b42790d9f

+ 10 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/OrderDetailVO.java

@@ -69,6 +69,16 @@ public class OrderDetailVO {
      */
     private String deductLabel;
 
+    /**
+     * 订单状态
+     */
+    private Integer status;
+
+    /**
+     * 订单状态label
+     */
+    private String statusLabel;
+
     /**
      * 商品名称
      */

+ 31 - 23
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java

@@ -2592,37 +2592,45 @@ public class AcceptCarriageOrderService {
             carriageOrderExcelVo.setStatusLabel(LogisticsOrderEnum.getName(vo.getStatus()));
             carriageOrderExcelVo.setLoadAddress(vo.getLoadCityName() + vo.getLoadAddress());
             carriageOrderExcelVo.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())) {
-                            carriageOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
-                        } else {
-                            carriageOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
-                        }
-                    }
-                }
-            }
+//            if (vo.getTOrderId() != null) {
+//                try {
+//                    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())) {
+//                                carriageOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
+//                            } else {
+//                                carriageOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
+//                            }
+//                        }
+//                    }
+//                } catch (Exception e) {
+//                    log.error("tradeOrderInfoService.getOrderDetailById error id:{}.errorMessage:{}",vo.getTOrderId(),e.getMessage(),e);
+//                }
+//            }
             BigDecimal subtract = vo.getCarryingCapacity().subtract(vo.getSubcontractAmount()).subtract(vo.getEntrustAmount());
             DecimalFormat df = new DecimalFormat("0.00");
             carriageOrderExcelVo.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())) {
-                                carriageOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
-                            }
-                            if ("2".equals(detailRes.getUnitType())) {
-                                carriageOrderExcelVo.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())) {
+                                    carriageOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
+                                }
+                                if ("2".equals(detailRes.getUnitType())) {
+                                    carriageOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
+                                }
                             }
                         }
                     }
+                } catch (Exception e) {
+                    log.error("tradeOrderInfoService.getOrderDetailById error id:{}.errorMessage:{}",vo.getTOrderId(),e.getMessage(),e);
                 }
             }
             carriageOrderExcelVo.setSubcontractAmount(Objects.isNull(vo.getSubcontractAmount()) ? null : df.format(vo.getSubcontractAmount()) + priceType.get(vo.getPriceType()));

+ 27 - 23
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/ConsignOrderService.java

@@ -1898,37 +1898,41 @@ public class ConsignOrderService {
             consignOrderExcelVo.setStatusLabel(LogisticsOrderEnum.getName(vo.getStatus()));
             consignOrderExcelVo.setLoadAddress(vo.getLoadCityName() + vo.getLoadAddress());
             consignOrderExcelVo.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())) {
-                            consignOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
-                        } else {
-                            consignOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
-                        }
-                    }
-                }
-            }
+//            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())) {
+//                            consignOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
+//                        } else {
+//                            consignOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
+//                        }
+//                    }
+//                }
+//            }
             BigDecimal subtract = vo.getCarryingCapacity().subtract(vo.getSubcontractAmount()).subtract(vo.getEntrustAmount());
             DecimalFormat df = new DecimalFormat("0.00");
             consignOrderExcelVo.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())) {
-                                consignOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
-                            }
-                            if ("2".equals(detailRes.getUnitType())) {
-                                consignOrderExcelVo.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())) {
+                                    consignOrderExcelVo.setReceiveGoodsUnit(detailRes.getFirmName());
+                                }
+                                if ("2".equals(detailRes.getUnitType())) {
+                                    consignOrderExcelVo.setShipmentsUnit(detailRes.getFirmName());
+                                }
                             }
                         }
                     }
+                } catch (Exception e) {
+                    log.error("tradeOrderInfoService.getOrderDetailById error id:{},errorMessage:{}",tOrderId,e.getMessage(),e);
                 }
             }
             consignOrderExcelVo.setSubcontractAmount(Objects.isNull(vo.getSubcontractAmount()) ? null : df.format(vo.getSubcontractAmount()) + priceType.get(vo.getPriceType()));

+ 14 - 14
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/LogisticsConsignmentService.java

@@ -211,7 +211,7 @@ public class LogisticsConsignmentService {
         HttpResult httpResult = tradeOrderInfoService.createOrCancelLogisticsOrder(param);
         if (httpResult.getCode() != HttpStatus.SUCCESS_CODE) {
             log.info("{}生成物流托运失败!,返回信息:{}", tradeOrder.getTOrderNo(), JSONObject.toJSONString(httpResult));
-            throw new BusinessException("{" + tradeOrder.getTOrderNo() + "}生成物流托运失败!"+httpResult.getMsg());
+            throw new BusinessException("{" + tradeOrder.getTOrderNo() + "}生成物流托运失败!" + httpResult.getMsg());
         }
         /**消息列表*/
         EntCacheResDto consignentMap = remoteSystemService.queryEntTreeById(Long.parseLong(bo.getConsignCompanyId()));
@@ -375,7 +375,7 @@ public class LogisticsConsignmentService {
 //                        .setContactsId(consignentMap.get(Long.parseLong(bo.getConsignCompanyId())).getContactsId())
         EntCacheResDto checkentMap = remoteSystemService.queryEntTreeById(Long.parseLong(bo.getCheckCompanyId()));
 //                        .setContactsId(checkentMap.get(Long.parseLong(bo.getCheckCompanyId())).getContactsId())
-        if (consignentMap == null || checkentMap== null) {
+        if (consignentMap == null || checkentMap == null) {
             throw new BusinessException("企业对应一级企业不存在");
         }
         KwtLogisticsOrderUnit checkUnit = new KwtLogisticsOrderUnit()
@@ -666,7 +666,7 @@ public class LogisticsConsignmentService {
         stringList = stringList.stream().sorted(Comparator.reverseOrder()).collect(Collectors.toList());
         for (String id : stringList) {
             OrderDetailRes orderDetailRes = tradeOrderInfoService.getOrderDetailById(Long.parseLong(id));
-            if (orderDetailRes==null){
+            if (orderDetailRes == null) {
                 continue;
             }
             /**
@@ -726,7 +726,7 @@ public class LogisticsConsignmentService {
      */
     public HttpResult logisticsOrderCount(String id, String type) {
         OrderDetailRes orderDetailRes = tradeOrderInfoService.getOrderDetailById(Long.parseLong(id));
-        if (orderDetailRes==null){
+        if (orderDetailRes == null) {
             return HttpResult.ok();
         }
         /**根据下单方式(代客下单/自主下单)决定托运数据是否展示*/
@@ -780,7 +780,7 @@ public class LogisticsConsignmentService {
         List<LogisticsOrderDTO> returnList = new ArrayList<>();
         for (String id : stringList) {
             OrderDetailRes orderDetailRes = tradeOrderInfoService.getOrderDetailById(Long.parseLong(id));
-            if (orderDetailRes==null){
+            if (orderDetailRes == null) {
                 continue;
             }
             log.info("贸易订单数据:{}", JSONObject.toJSONString(orderDetailRes));
@@ -1083,15 +1083,15 @@ public class LogisticsConsignmentService {
                 //托运
                 KwtLogisticsOrderUnit consignUnit = kwtLogisticsOrderUnitMapper.selectOne(
                         new LambdaQueryWrapper<KwtLogisticsOrderUnit>()
-                                .eq(KwtLogisticsOrderUnit::getLOrderId,kwtLogisticsOrder.getId())
+                                .eq(KwtLogisticsOrderUnit::getLOrderId, kwtLogisticsOrder.getId())
                                 .eq(KwtLogisticsOrderUnit::getUnitType, NumberConstant.ONE));
                 //承运
                 KwtLogisticsOrderUnit carriageUnit = kwtLogisticsOrderUnitMapper.selectOne(
                         new LambdaQueryWrapper<KwtLogisticsOrderUnit>()
-                                .eq(KwtLogisticsOrderUnit::getLOrderId,kwtLogisticsOrder.getId())
+                                .eq(KwtLogisticsOrderUnit::getLOrderId, kwtLogisticsOrder.getId())
                                 .eq(KwtLogisticsOrderUnit::getUnitType, NumberConstant.TWO));
-                commonService.cancelLogisticsConsignment(consignUnit,carriageUnit,kwtLogisticsOrder.getLOrderNo(),kwtLogisticsOrder.getCreateBy(),
-                        kwtLogisticsOrder.getEntId(), MessageEnum.CANCELLATION_LOGISTICS,MessageEnum.CARRIAGE_CANCELLATION_LOGISTICS);
+                commonService.cancelLogisticsConsignment(consignUnit, carriageUnit, kwtLogisticsOrder.getLOrderNo(), kwtLogisticsOrder.getCreateBy(),
+                        kwtLogisticsOrder.getEntId(), MessageEnum.CANCELLATION_LOGISTICS, MessageEnum.CARRIAGE_CANCELLATION_LOGISTICS);
             } else {
                 result.setMsg("操作失败:" + httpResult.getMsg());
                 result.setCode(HttpStatus.GLOBAL_EXCEPTION_CODE);
@@ -1177,15 +1177,15 @@ public class LogisticsConsignmentService {
                 //托运
                 KwtLogisticsOrderUnit consignUnit = kwtLogisticsOrderUnitMapper.selectOne(
                         new LambdaQueryWrapper<KwtLogisticsOrderUnit>()
-                                .eq(KwtLogisticsOrderUnit::getLOrderId,id)
+                                .eq(KwtLogisticsOrderUnit::getLOrderId, id)
                                 .eq(KwtLogisticsOrderUnit::getUnitType, NumberConstant.ONE));
                 //承运
                 KwtLogisticsOrderUnit carriageUnit = kwtLogisticsOrderUnitMapper.selectOne(
                         new LambdaQueryWrapper<KwtLogisticsOrderUnit>()
-                                .eq(KwtLogisticsOrderUnit::getLOrderId,id)
+                                .eq(KwtLogisticsOrderUnit::getLOrderId, id)
                                 .eq(KwtLogisticsOrderUnit::getUnitType, NumberConstant.TWO));
-                commonService.cancelLogisticsConsignment(consignUnit,carriageUnit,kwtLogisticsOrder.getLOrderNo(),kwtLogisticsOrder.getCreateBy(),
-                        kwtLogisticsOrder.getEntId(), MessageEnum.CANCELLATION_LOGISTICS,MessageEnum.CARRIAGE_CANCELLATION_LOGISTICS);
+                commonService.cancelLogisticsConsignment(consignUnit, carriageUnit, kwtLogisticsOrder.getLOrderNo(), kwtLogisticsOrder.getCreateBy(),
+                        kwtLogisticsOrder.getEntId(), MessageEnum.CANCELLATION_LOGISTICS, MessageEnum.CARRIAGE_CANCELLATION_LOGISTICS);
             } else {
                 result.setCode(HttpStatus.GLOBAL_EXCEPTION_CODE);
                 result.setMsg("操作失败:" + httpResult.getMsg());
@@ -1906,7 +1906,7 @@ public class LogisticsConsignmentService {
     }
 
     /**
-     * 导出销售/采购订单对应的运单列表
+     * 导出采购订单-对应的运单列表
      *
      * @param ids 销售/采购订单IDs
      * @return

+ 2 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/TransportCommonService.java

@@ -187,6 +187,8 @@ public class TransportCommonService {
             orderDetailVO.setCarrierContacts(unitTwo.getContacts());
             orderDetailVO.setCarrierPhone(unitTwo.getPhone());
         }
+        orderDetailVO.setStatus(logisticsOrder.getStatus());
+        orderDetailVO.setStatusLabel(LogisticsOrderEnum.getName(logisticsOrder.getStatus()));
         orderDetailVO.setGoodsId(String.valueOf(orderGoods == null ? null : orderGoods.getGoodsId()));
         orderDetailVO.setGoodsName(orderGoods == null ? null : orderGoods.getGoodsName());
         orderDetailVO.setNumber(logisticsOrder.getAmount() == null ? null : logisticsOrder.getAmount());