Przeglądaj źródła

1、4.2接口调整;

zk 1 rok temu
rodzic
commit
797b0a8d4d

+ 7 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtWaybillOrderV1Mapper.java

@@ -64,6 +64,13 @@ public interface KwtWaybillOrderV1Mapper extends BaseMapper<KwtWaybillOrderV1> {
      */
     WaybillCountVo findCountByDriverOrTruck(@Param("driverId") Long driverId, @Param("truckId") Long truckId);
 
+    /**
+     * 查询统计运单数量信息
+     * @param lOrderId 物流订单ID
+     * @return 统计信息
+     */
+    WaybillCountVo findCountByLOrderId(@Param("lOrderId") Long lOrderId);
+
     /**
      * 查询统计司机或车辆关联订单运量信息
      * @param driverId 司机ID

+ 4 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dubbo/TransportServiceImpl.java

@@ -103,6 +103,9 @@ public class TransportServiceImpl implements TransportRemoteService {
     @Autowired
     private KwtWaybillOrderMapper waybillOrderDao;
 
+    @Autowired
+    private KwtWaybillOrderV1Mapper waybillOrderV1Mapper;
+
     @Autowired
     private KwtLogisticsOrderLineFreightRateMapper lineFreightRateMapper;
 
@@ -293,11 +296,7 @@ public class TransportServiceImpl implements TransportRemoteService {
 //                    actualAmount = (logisticsOrderDTO.getTotalUnloadAmount() == null ? NumberConstant.ZERO_TWO : logisticsOrderDTO.getTotalUnloadAmount()).multiply(price).subtract(fineValue);
         } else if (DictEnum.CHARGING_TYPE_3.getValue().equals(billingMode)) {
             // 物流订单运单趟次数量
-            Map<String, Object> map = new HashMap<>(NumberConstant.SIXTEEN) {{
-                put("upperlOrderId", logisticsOrderDTO.getLOrderId());
-                put("passStatus", Global.NUMERICAL_ONE);
-            }};
-            WaybillCountVo waybillOrderCount = waybillOrderDao.findWaybillOrderCount(map);
+            WaybillCountVo waybillOrderCount = waybillOrderV1Mapper.findCountByLOrderId(Long.parseLong(logisticsOrderDTO.getLOrderId()));
             BigDecimal totalComplete = waybillOrderCount == null ? NumberConstant.ZERO_TWO : new BigDecimal(waybillOrderCount.getTotalComplete());
             actualAmount = totalComplete.multiply(price);
         } else if (DictEnum.CHARGING_TYPE_4.getValue().equals(billingMode)) {

+ 11 - 0
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderV1Mapper.xml

@@ -229,6 +229,17 @@
         </if>
     </select>
 
+    <select id="findCountByLOrderId" resultType="com.sckw.transport.model.vo.WaybillCountVo">
+        SELECT
+        count(case when wo.status = 502 then 1 end) totalComplete
+        from kwt_waybill_order wo
+        left join kwt_waybill_order_subtask wos on wos.w_order_id = wo.id
+        where wo.del_flag = 0 and wos.del_flag = 0
+        <if test="lOrderId != null and lOrderId != ''">
+            and wos.l_order_id = #{lOrderId, jdbcType=BIGINT}
+        </if>
+    </select>
+
     <select id="findAmountByDriverOrTruck" resultType="com.sckw.transport.model.vo.WaybillCountVo">
         SELECT
         IFNULL(SUM(wos.load_amount), 0.0) loadAmount