Explorar o código

修改app端运单详情、按路线计费的运单呈现
解决完结采购订单报错
解决app端和PC端订单数据不一致问题
調整app端运单的装/卸货凭证展示

czh hai 1 ano
pai
achega
fc437d805f

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

@@ -122,4 +122,6 @@ public interface KwtWaybillOrderV1Mapper extends BaseMapper<KwtWaybillOrderV1> {
     WaybillCountVo findWaybillOrderCount(Map<String, Object> map);
 
     int selectDataByLorderId(@Param("id") String id, @Param("statusList") List<Integer> statusList);
+
+    int selectDataByLorderIds(@Param("list") List<Long> longList, @Param("status") Integer status);
 }

+ 2 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/WaybillOrderQueryDto.java

@@ -107,6 +107,8 @@ public class WaybillOrderQueryDto extends PageRequest{
      */
     private List<Long> userIds;
 
+    private String lOrderId;
+
     public void setLoadCityCodeLevel(Integer loadCityCodeLevel) {
         this.loadCityCodeLevel = loadCityCodeLevel != null && loadCityCodeLevel == 3 ? 0 : loadCityCodeLevel == 2 ? 4 : 2;
     }

+ 6 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/LineFreightRateVo.java

@@ -3,6 +3,7 @@ package com.sckw.transport.model.vo;
 import lombok.Data;
 
 import java.io.Serializable;
+import java.math.BigDecimal;
 
 /**
  * @author lfdc
@@ -28,4 +29,9 @@ public class LineFreightRateVo implements Serializable {
      * 结算数量
      */
     private Integer lineFreightCount;
+
+    /**
+     * 单价
+     */
+    private BigDecimal price;
 }

+ 4 - 6
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtLogisticsConsignmentService.java

@@ -2127,8 +2127,8 @@ public class KwtLogisticsConsignmentService {
      * @param tradeOrderId 贸易订单id
      * @return
      */
-    public Long statisticsWaybillCount(String tradeOrderId) {
-        Long count = 0L;
+    public Integer statisticsWaybillCount(String tradeOrderId) {
+        int count = 0;
         List<KwtLogisticsOrder> orderList = kwtLogisticsOrderMapper.selectList(new LambdaQueryWrapper<KwtLogisticsOrder>()
                 .eq(KwtLogisticsOrder::getTOrderId, tradeOrderId).eq(KwtLogisticsOrder::getDelFlag, NumberConstant.ZERO));
         if (org.springframework.util.CollectionUtils.isEmpty(orderList)) {
@@ -2138,10 +2138,8 @@ public class KwtLogisticsConsignmentService {
         if (org.springframework.util.CollectionUtils.isEmpty(longList)) {
             return count;
         }
-        count = waybillOrderMapper.selectCount(new LambdaQueryWrapper<KwtWaybillOrder>()
-                .eq(KwtWaybillOrder::getStatus, CarWaybillEnum.APPROVAL_PASS.getCode())
-                .in(KwtWaybillOrder::getLOrderId, longList));
-        return count;
+
+        return waybillOrderV1Mapper.selectDataByLorderIds(longList, CarWaybillEnum.APPROVAL_PASS.getCode());
     }
 
     /**

+ 18 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtWaybillManagementV1Service.java

@@ -414,6 +414,22 @@ public class KwtWaybillManagementV1Service {
         String checkFirmName = units.stream().filter(item -> item.getUnitType().equals(NumberConstant.TWO)).map(KwtLogisticsOrderUnit::getFirmName).collect(Collectors.joining(", "));
         String carrierFirmName = units.stream().filter(item -> item.getUnitType().equals(NumberConstant.TWO)).map(KwtLogisticsOrderUnit::getFirmName).collect(Collectors.joining(", "));
 
+        List<KwtWaybillOrderTicket> waybillOrderTicketV1 = kwtWaybillOrderTicketMapper.findWaybillOrderTicketV1(wOrderId, null, null, null);
+        String loadUrls = "";
+        String downUrls = "";
+        if (CollectionUtils.isNotEmpty(waybillOrderTicketV1)) {
+            Map<Integer, List<KwtWaybillOrderTicket>> collect = waybillOrderTicketV1.stream().collect(Collectors.groupingBy(KwtWaybillOrderTicket::getType));
+            List<KwtWaybillOrderTicket> kwtWaybillOrderTickets = collect.get(Global.NUMERICAL_ONE);
+            if (CollectionUtils.isNotEmpty(kwtWaybillOrderTickets)) {
+                loadUrls = kwtWaybillOrderTickets.stream().map(item -> FileUtils.splice(item.getUrls())).collect(Collectors.joining(Global.COMMA));
+            }
+
+            List<KwtWaybillOrderTicket> kwtWaybillOrderTickets1 = collect.get(Global.NUMERICAL_TWO);
+            if (CollectionUtils.isNotEmpty(kwtWaybillOrderTickets1)) {
+                downUrls = kwtWaybillOrderTickets1.stream().map(item -> FileUtils.splice(item.getUrls())).collect(Collectors.joining(Global.COMMA));
+            }
+        }
+
         //数据拼接
         Map<String, Object> result = new HashMap<>(Global.NUMERICAL_SIXTEEN);
         result.put("wOrderId", wOrderId);
@@ -428,6 +444,8 @@ public class KwtWaybillManagementV1Service {
         result.put("checkFirmName", checkFirmName);
         result.put("carrierFirmName", carrierFirmName);
         result.put("trackList", trackList);
+        result.put("loadUrls", loadUrls);
+        result.put("downUrls", downUrls);
         return HttpResult.ok(result);
     }
 

+ 2 - 1
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderLineFreightRateMapper.xml

@@ -13,7 +13,8 @@
         select id,
                line_freight_rate_id AS lineFreightId,
                `name`               AS lineFreightName,
-               transport_amount     AS lineFreightCount
+               transport_amount     AS lineFreightCount,
+               transport_price  as price
         from kwt_logistics_order_line_freight_rate
         where l_order_id = #{orderId}
           AND del_flag = 0

+ 18 - 13
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderSubtaskMapper.xml

@@ -149,20 +149,25 @@
         count(case when wo.status in (102, 103, 202, 502) then 1 end) ndexFinish
         from kwt_waybill_order wo
         where wo.del_flag = 0
-        <if test="entId != null and entId != ''">
-            and wo.ent_id = #{entId, jdbcType=VARCHAR}
-        </if>
-        <if test="userIds != null and userIds.size() > 0">
-            and wo.create_by IN
-            <foreach collection="userIds" open="(" close=")" item="item" separator=",">
-                #{item}
-            </foreach>
+        <if test="lOrderId != null and lOrderId != ''">
+            and exists(select 1 from kwt_waybill_order_subtask wos where wo.id = wos.w_order_id and wos.l_order_id = #{lOrderId})
         </if>
-        <if test="entIds != null and entIds.size() > 0">
-            and wo.ent_id IN
-            <foreach collection="entIds" open="(" close=")" item="item" separator=",">
-                #{item}
-            </foreach>
+        <if test="lOrderId == null or lOrderId == ''">
+            <if test="entId != null and entId != ''">
+                and wo.ent_id = #{entId, jdbcType=VARCHAR}
+            </if>
+            <if test="userIds != null and userIds.size() > 0">
+                and wo.create_by IN
+                <foreach collection="userIds" open="(" close=")" item="item" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="entIds != null and entIds.size() > 0">
+                and wo.ent_id IN
+                <foreach collection="entIds" open="(" close=")" item="item" separator=",">
+                    #{item}
+                </foreach>
+            </if>
         </if>
         <if test="queryWstatus != null and queryWstatus != ''">
             AND wo.status in

+ 33 - 13
sckw-modules/sckw-transport/src/main/resources/mapper/KwtWaybillOrderV1Mapper.xml

@@ -73,20 +73,25 @@
         wo.update_time updateTime, wo.status
         from kwt_waybill_order wo
         where wo.del_flag = 0
-        <if test="entId != null and entId != ''">
-            and wo.ent_id = #{entId, jdbcType=VARCHAR}
-        </if>
-        <if test="userIds != null and userIds.size() > 0">
-            and wo.create_by IN
-            <foreach collection="userIds" open="(" close=")" item="item" separator=",">
-                #{item}
-            </foreach>
+        <if test="lOrderId != null and lOrderId != ''">
+            and exists(select 1 from kwt_waybill_order_subtask wos where wo.id = wos.w_order_id and wos.l_order_id = #{lOrderId})
         </if>
-        <if test="entIds != null and entIds.size() > 0">
-            and wo.ent_id IN
-            <foreach collection="entIds" open="(" close=")" item="item" separator=",">
-                #{item}
-            </foreach>
+        <if test="lOrderId == null or lOrderId == ''">
+            <if test="entId != null and entId != ''">
+                and wo.ent_id = #{entId, jdbcType=VARCHAR}
+            </if>
+            <if test="userIds != null and userIds.size() > 0">
+                and wo.create_by IN
+                <foreach collection="userIds" open="(" close=")" item="item" separator=",">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="entIds != null and entIds.size() > 0">
+                and wo.ent_id IN
+                <foreach collection="entIds" open="(" close=")" item="item" separator=",">
+                    #{item}
+                </foreach>
+            </if>
         </if>
         <if test="queryWstatus != null and queryWstatus != ''">
             AND wo.status in
@@ -448,4 +453,19 @@
             </if>
         </where>
     </select>
+
+    <select id="selectDataByLorderIds" resultType="java.lang.Integer">
+        SELECT COUNT(b.id)
+        FROM kwt_waybill_order_subtask k
+        left join kwt_waybill_order a on k.w_order_id = a.id and a.del_flag = 0 and k.del_flag = 0
+        LEFT JOIN kwt_logistics_order b ON k.l_order_id = b.id AND a.del_flag = 0 AND b.del_flag = 0
+        <where>
+            <if test="list != null and list.size() > 0">
+                and b.id in <foreach collection="list" item="item" open="(" close=")" separator=",">  #{item}</foreach>
+            </if>
+            <if test="status != null">
+                AND a.`status`= #{status}
+            </if>
+        </where>
+    </select>
 </mapper>