Browse Source

1.托运订单新增查询接口

lengfaqiang 1 năm trước cách đây
mục cha
commit
b431dd6308

+ 20 - 0
sckw-gateway/src/main/resources/bootstrap-lfdc.yml

@@ -0,0 +1,20 @@
+spring:
+  cloud:
+    nacos:
+      discovery:
+        # 服务注册地址
+        server-addr: 10.10.10.230:8848
+        # 命名空间
+        namespace: sckw_lfdc
+        # 共享配置
+        group: sckw-service-platform
+      config:
+        # 配置中心地址
+        server-addr: 10.10.10.230:8848
+        # 配置文件格式
+        file-extension: yaml
+        # 命名空间
+        namespace: sckw_lfdc
+        # 共享配置
+        group: sckw-service-platform
+

+ 4 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/param/AddLogisticsOrderParam.java

@@ -93,7 +93,7 @@ public class AddLogisticsOrderParam implements Serializable {
     /**
      * goodsId
      */
-    @NotNull(message = "goodsId不能为空")
+//    @NotNull(message = "goodsId不能为空")
     private Long goodsId;
 
     /**
@@ -129,9 +129,9 @@ public class AddLogisticsOrderParam implements Serializable {
     /**
      * 运价
      */
-    @NotNull(message = "运价不能为空")
-    @Digits(integer = 10, fraction = 2, message = "装货量格式错误")
-    @DecimalMin(value = "0.00", message = "运价最小为{value}")
+//    @NotNull(message = "运价不能为空")
+//    @Digits(integer = 10, fraction = 2, message = "装货量格式错误")
+//    @DecimalMin(value = "0.00", message = "运价最小为{value}")
     private BigDecimal price;
 
     /**

+ 34 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtConsignOrderService.java

@@ -144,6 +144,9 @@ public class KwtConsignOrderService {
     @Autowired
     public KwtWaybillOrderMapper kwtWaybillOrderMapper;
 
+    @Autowired
+    private KwtLogisticsOrderAddressMapper logisticsOrderAddressMapper;
+
     @Autowired
     public KwtWaybillOrderTicketMapper kwtWaybillOrderTicketMapper;
 
@@ -1854,7 +1857,38 @@ public class KwtConsignOrderService {
                     log.info(vo.getTOrderId() + "查询错误:{}", e.getMessage(), e);
                 }
             }
+            String lOrderId = vo.getLOrderId();
+            List<String> loadName = new ArrayList<String>();
+            List<String> loadAddressList = new ArrayList<String>();
+            List<KwtLogisticsOrderAddress> loadAddress = logisticsOrderAddressMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderAddress>()
+                    .eq(KwtLogisticsOrderAddress::getAddressType, NumberConstant.ONE)
+                    .eq(KwtLogisticsOrderAddress::getDelFlag, NumberConstant.ZERO)
+                    .eq(KwtLogisticsOrderAddress::getLOrderId, lOrderId)
+            );
+            loadAddress.forEach(address -> {
+                loadName.add(address.getName());
+                loadAddressList.add(address.getDetailAddress());
+            });
 
+            List<String> unloadName = new ArrayList<String>();
+            List<String> unloadAddressList = new ArrayList<String>();
+            List<KwtLogisticsOrderAddress> unloadAddress = logisticsOrderAddressMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrderAddress>()
+                    .eq(KwtLogisticsOrderAddress::getAddressType, NumberConstant.TWO)
+                    .eq(KwtLogisticsOrderAddress::getDelFlag, NumberConstant.ZERO)
+                    .eq(KwtLogisticsOrderAddress::getLOrderId, lOrderId)
+            );
+            unloadAddress.forEach(address -> {
+                unloadName.add(address.getName());
+                unloadAddressList.add(address.getDetailAddress());
+            });
+            vo.setLoadNames(loadName);
+            vo.setLoadAddresses(loadAddressList);
+            vo.setUnloadNames(unloadName);
+            vo.setUnloadAddresses(unloadAddressList);
+            List<LoadAddressVo> loadAddressAmount = logisticsOrderAddressMapper.findByAddressAndLoadAmount(Long.parseLong(lOrderId), NumberConstant.ONE);
+            vo.setLoading(loadAddressAmount);
+            List<UnLoadAddressVo> unloadAddressAmount = logisticsOrderAddressMapper.findByAddressAndUnLoadAmount(Long.parseLong(lOrderId), NumberConstant.TWO);
+            vo.setUnloading(unloadAddressAmount);
         }
         return PageRes.build(pageInfo, list);
     }

+ 16 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtLogisticsOrderConsignmentService.java

@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.sckw.contract.api.RemoteContractService;
 import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
 import com.sckw.core.common.enums.StringConstant;
+import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
@@ -808,7 +809,10 @@ public class KwtLogisticsOrderConsignmentService {
         if (!String.valueOf(HttpStatus.SUCCESS_CODE).equals(String.valueOf(httpResult.getCode()))) {
             return HttpResult.error(httpResult.getMsg());
         }
+        /**验证数据*/
         checkCreateLogisticOrderParam(addOrderDTO);
+        /**数据填写验证*/
+        checkLogisticsOrder(addOrderDTO);
         String consignCompanyId = addOrderDTO.getConsignCompanyId();
         String acceptCompanyId = addOrderDTO.getAcceptCompanyId();
         List<FindEntCooperateResVo> entCooperate = manageService.findEntCooperate(Long.parseLong(consignCompanyId), Long.parseLong(acceptCompanyId), CooperateTypeEnum.CARRIAGE.getCode());
@@ -886,6 +890,18 @@ public class KwtLogisticsOrderConsignmentService {
         return HttpResult.ok(lOrderId);
     }
 
+    private void checkLogisticsOrder(AddLogisticsOrderParam addOrderDTO) {
+        /**计费方式验证*/
+        if (!DictEnum.CHARGING_TYPE_4.getValue().equals(addOrderDTO.getBillingMode())) {
+            if (Objects.isNull(addOrderDTO.getGoodsId())) {
+                throw new RuntimeException("商品id不能为空");
+            }
+            if (addOrderDTO.getPrice() == null || addOrderDTO.getPrice().compareTo(NumberConstant.ZERO_TWO) < 1) {
+                throw new RuntimeException("运价填写错误");
+            }
+        }
+    }
+
     private void saveCreateLogisticsOrderLineFreight(AddLogisticsOrderParam addOrderDTO, Long lOrderId) {
         List<LineFreightDto> lineFreightList = addOrderDTO.getLineFreightList();
         Map<Long, BigDecimal> lineFreightMap = lineFreightList.stream().collect(Collectors.toMap(LineFreightDto::getLineFreightId, LineFreightDto::getAmount));

+ 3 - 1
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -2510,7 +2510,9 @@
     </select>
     <select id="selectLogisticsOrderListByConsign" resultType="com.sckw.transport.model.vo.AcceptCarriageOrderVO">
         SELECT
-        <include refid="New_Query_Column_List">
+<!--        <include refid="New_Query_Column_List">-->
+<!--        </include>-->
+        <include refid="New_Query_Column_List_v42">
         </include>
         FROM (
         SELECT