Просмотр исходного кода

增加运单详情翻译字段

lengfaqiang 2 лет назад
Родитель
Сommit
ef46166abe

+ 24 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/SckwLogisticsOrderVO.java

@@ -88,6 +88,11 @@ public class SckwLogisticsOrderVO {
      */
     private String unit;
 
+    /**
+     * 单位(吨、方、箱、件)
+     */
+    private String unitLabel;
+
     /**
      * 合理损耗
      */
@@ -97,6 +102,10 @@ public class SckwLogisticsOrderVO {
      * 合理损耗单位(‰/kG)
      */
     private String lossUnit;
+    /**
+     * 合理损耗单位(‰/kG)
+     */
+    private String lossUnitLabel;
 
     /**
      * 商品价值(扣亏货值)
@@ -108,6 +117,11 @@ public class SckwLogisticsOrderVO {
      */
     private String goodsPriceUnit;
 
+    /**
+     * 商品价值(扣亏货值)单位
+     */
+    private String goodsPriceUnitLabel;
+
     /**
      * 卸货日期
      */
@@ -259,6 +273,11 @@ public class SckwLogisticsOrderVO {
      */
     private String contractSigningWay;
 
+    /**
+     * 托运企业主键ID
+     */
+    private Long checkId;
+
     /**
      * 托运企业主键ID
      */
@@ -284,6 +303,11 @@ public class SckwLogisticsOrderVO {
      */
     private String checkPhone;
 
+    /**
+     * 承运企业主键ID
+     */
+    private Long carrierId;
+
     /**
      * 承运企业主键ID
      */

+ 13 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/vo/WaybillDetailVO.java

@@ -43,6 +43,19 @@ public class WaybillDetailVO {
      * 亏吨量
      */
     private BigDecimal deficitAmount;
+
+
+    /**
+     * 单位
+     */
+    private String unit;
+
+
+    /**
+     * 单位翻译
+     */
+    private String unitLabel;
+
     /**
      * 合理损耗
      */

+ 6 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/AcceptCarriageOrderService.java

@@ -825,6 +825,11 @@ public class AcceptCarriageOrderService {
                 }
             }
         }
+        vo.setUnit(kwtLogisticsOrder.getUnit());
+        if (kwtLogisticsOrder.getUnit() != null) {
+            SysDictResDto dictResDto = remoteSystemService.queryDictByTypeAndValue(DictTypeEnum.UNIT_TYPE.getType(), kwtLogisticsOrder.getUnit());
+            vo.setUnitLabel(dictResDto == null ? null : dictResDto.getLabel());
+        }
         vo.setWaybillType(waybillOrder.getType());
         vo.setDeficitAmount(waybillOrder.getDeficitAmount());
         vo.setLoss(kwtLogisticsOrder.getLoss());
@@ -1363,7 +1368,7 @@ public class AcceptCarriageOrderService {
         }
 
         //修改合同履约量
-        commonService.updatePerformed(logisticsOrder,orderFinishDTO.getLoadAmount(),orderFinishDTO.getUnloadAmount());
+        commonService.updatePerformed(logisticsOrder, orderFinishDTO.getLoadAmount(), orderFinishDTO.getUnloadAmount());
 
         //修改mongodb的数据
         updateMongoDbByLogisticsOrder(logisticsOrder.getId(), orderFinishDTO, ignoreAmount);

+ 27 - 4
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/TransportCommonService.java

@@ -27,6 +27,7 @@ import com.sckw.stream.model.SckwBusSum;
 import com.sckw.system.api.RemoteSystemService;
 import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import com.sckw.system.api.model.dto.res.SysDictResDto;
+import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import com.sckw.transport.api.model.vo.LogisticsOrderVO;
 import com.sckw.transport.dao.*;
 import com.sckw.transport.model.*;
@@ -565,10 +566,32 @@ public class TransportCommonService {
         List<Long> contractIds = StringUtils.splitStrToList(contractParam.getContractIds(), Long.class);
         Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(Collections.singletonList(LoginUserHolder.getEntId()));
         List<SckwLogisticsOrderVO> list = logisticsOrderMapper.selectOrderListByContractId(contractParam.getContractType(), entMap.get(LoginUserHolder.getEntId()).getId(), contractIds);
-        List<SckwLogisticsOrderVO> returnList =new ArrayList<>();
-        if (CollectionUtils.isNotEmpty(list)){
-             returnList = list.stream().skip((contractParam.getPage() - 1) * contractParam.getPageSize()).limit(contractParam.getPageSize()).collect(Collectors.toList());
-
+        List<SckwLogisticsOrderVO> returnList = new ArrayList<>();
+        /**支付方式*/
+//        Map<String, String> dictResDtoMap = getDictData(DictTypeEnum.UNIT_TYPE.getType());
+        /**计量单位*/
+        Map<String, String> unitTypeDictData = getDictData(DictTypeEnum.TRADE_TYPE.getType());
+        /**运价方式*/
+//        Map<String, String> priceDictData = getDictData(DictTypeEnum.PRICE_TYPE.getType());
+        /**计费方式*/
+//        Map<String, String> chargingDictData = getDictData(DictTypeEnum.CHARGING_TYPE.getType());
+        /**结算周期*/
+        Map<String, String> settlementDictData = getDictData(DictTypeEnum.SETTLEMENT_CYCLE.getType());
+        /**签约方式*/
+//        Map<String, String> signingWay = getDictData(DictTypeEnum.SIGNING_TYPE.getType());
+        /**合理损耗*/
+        Map<String, String> taxRateTypeDictData = getDictData(DictTypeEnum.TAX_RATE_TYPE.getType());
+        if (CollectionUtils.isNotEmpty(list)) {
+            for (SckwLogisticsOrderVO vo : list) {
+                vo.setStatusLabel(LogisticsOrderEnum.getDestination(vo.getStatus()));
+                vo.setLossUnitLabel(vo.getLossUnit() == null ? null : taxRateTypeDictData.get(vo.getLossUnit()));
+                vo.setUnitLabel(vo.getUnit() == null ? null : unitTypeDictData.get(vo.getUnit()));
+                vo.setGoodsPriceUnitLabel(vo.getGoodsPriceUnit() == null ? null : unitTypeDictData.get(vo.getGoodsPriceUnit()));
+                vo.setSettlementCycleLabel(vo.getSettlementCycle() == null ? null : settlementDictData.get(vo.getSettlementCycle().toString()));
+                UserCacheResDto userCacheResDto = remoteSystemService.queryUserCacheById(vo.getCreateBy());
+                vo.setCreateByName(userCacheResDto == null ? null : userCacheResDto.getName());
+            }
+            returnList = list.stream().skip((contractParam.getPage() - 1) * contractParam.getPageSize()).limit(contractParam.getPageSize()).collect(Collectors.toList());
         }
         PageResult build = PageResult.build(contractParam.getPage(), contractParam.getPageSize(), list.stream().count(), returnList);
         return HttpResult.ok(build);

+ 17 - 7
sckw-modules/sckw-transport/src/main/resources/mapper/KwtLogisticsOrderMapper.xml

@@ -104,9 +104,16 @@
     <select id="selectOrderListByContractId" resultType="com.sckw.transport.model.vo.SckwLogisticsOrderVO">
         SELECT
         a.STATUS,
+        a.id AS lOrderId,
         a.l_order_no AS lOrderNo,
         f.contract_no AS contractNo,
+        d.id as checkId,
+        d.ent_id as checkEntId,
+        d.top_ent_id as checkTopEntId,
         d.firm_name AS checkFirmName,
+        e.id as carrierId,
+        e.ent_id as carrierEntId,
+        e.top_ent_id as carrierTopEntId,
         e.firm_name AS carrierFirmName,
         g.goods_name AS goodsName,
         a.amount AS carryingCapacity,
@@ -115,7 +122,9 @@
         b.detail_address AS loadDetailAddress,
         a.payment AS payment,
         a.loss AS loss,
+        a.loss_unit AS lossUnit,
         a.goods_price AS goodsPrice,
+        a.goods_price_unit AS goodsPriceUnit,
         a.settlement_cycle AS settlementCycle,
         e.contacts AS carrierContacts,
         e.phone AS carrierPhone,
@@ -129,7 +138,8 @@
         a.end_time AS endTime,
         a.remark AS remark,
         a.create_by AS createBy,
-        a.create_time AS createTime
+        a.create_time AS createTime,
+        f.contract_id AS contractId
         FROM
         kwt_logistics_order a
         LEFT JOIN kwt_logistics_order_address b ON a.id = b.l_order_id
@@ -149,12 +159,12 @@
         AND f.del_flag = 0
         <where>
             a.del_flag = 0
-            <if test="type == 1">
-                and (d.top_ent_id = #{entId} or d.ent_id = #{entId})
-            </if>
-            <if test="type == 2">
-                and (e.top_ent_id = #{entId} or e.ent_id = #{entId})
-            </if>
+<!--            <if test="type == 1">-->
+<!--                and (d.top_ent_id = #{entId} or d.ent_id = #{entId})-->
+<!--            </if>-->
+<!--            <if test="type == 2">-->
+<!--                and (e.top_ent_id = #{entId} or e.ent_id = #{entId})-->
+<!--            </if>-->
             <if test="contractIds != null and contractIds.size() > 0">
                 and f.contract_id in
                 <foreach collection="contractIds" item="item" separator="," open="(" close=")">