Bladeren bron

1.新增承运订单导入功能

lengfaqiang 2 jaren geleden
bovenliggende
commit
c3ed7c38a8
21 gewijzigde bestanden met toevoegingen van 1143 en 33 verwijderingen
  1. 2 0
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java
  2. 74 0
      sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/res/ContractLogisticsOrderResDto.java
  3. 10 0
      sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/EntAddressResDto.java
  4. 2 0
      sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/dubbo/GoodsInfoService.java
  5. 2 0
      sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java
  6. 48 15
      sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java
  7. 5 0
      sckw-modules/sckw-product/src/main/java/com/sckw/product/dubbo/GoodsInfoServiceImpl.java
  8. 8 1
      sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java
  9. 6 6
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwWorkService.java
  10. 19 1
      sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsEnterpriseController.java
  11. 2 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEnterpriseDao.java
  12. 4 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsUserDao.java
  13. 7 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java
  14. 12 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java
  15. 6 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  16. 6 0
      sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml
  17. 12 0
      sckw-modules/sckw-system/src/main/resources/mapper/KwsUserDao.xml
  18. 23 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwtAcceptCarriageOrderController.java
  19. 134 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/ExeclDTO/LogisticsOrderExcelImportDTO.java
  20. 753 0
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/Import/KwtAcceptCarriageOrderImportService.java
  21. 8 10
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtAcceptCarriageOrderService.java

+ 2 - 0
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/RemoteContractService.java

@@ -1,6 +1,7 @@
 package com.sckw.contract.api;
 
 import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
+import com.sckw.contract.api.model.dto.res.ContractLogisticsOrderResDto;
 
 import java.math.BigDecimal;
 import java.util.List;
@@ -40,4 +41,5 @@ public interface RemoteContractService {
     Map<Integer, Integer> queryContractValidCount(Long entId,List<Long> enterpriseIds);
 
 
+    ContractLogisticsOrderResDto getContractByContractNo(String contractNo);
 }

+ 74 - 0
sckw-modules-api/sckw-contract-api/src/main/java/com/sckw/contract/api/model/dto/res/ContractLogisticsOrderResDto.java

@@ -0,0 +1,74 @@
+package com.sckw.contract.api.model.dto.res;
+
+import lombok.Data;
+
+import java.io.Serial;
+import java.io.Serializable;
+
+/**
+ * @author czh
+ * @desc 合同公共信息
+ * @date 2023/7/19
+ */
+@Data
+public class ContractLogisticsOrderResDto implements Serializable {
+
+    @Serial
+    private static final long serialVersionUID = 2656035411576510101L;
+
+    /**
+     * 合同id
+     */
+    private Long id;
+
+    /**
+     * 合同名
+     */
+    private String contactName;
+
+    /**
+     * 合同号
+     */
+    private String contractNo;
+
+    /**
+     * 签约方式  1线上  2线下
+     */
+    private Integer signingWay;
+
+    /**
+     * 签约方式名
+     */
+    private String signingWayName;
+
+    /**
+     * 合同状态 0 已签约 1待签约 2已完结 3已保存
+     */
+    private Integer status;
+
+    /**
+     * 合同状态名称
+     */
+    private String statusName;
+
+    /**
+     * 托运企业id
+     */
+    private Long consignEntId;
+
+    /**
+     * 托运企业名称
+     */
+    private String consignEntName;
+
+    /**
+     * 承运企业id
+     */
+    private Long acceptCarriageEntId;
+
+    /**
+     * 承运企业名称
+     */
+    private String acceptCarriageEntName;
+
+}

+ 10 - 0
sckw-modules-api/sckw-manage-api/src/main/java/com/sckw/manage/api/model/dto/res/EntAddressResDto.java

@@ -51,6 +51,16 @@ public class EntAddressResDto implements Serializable {
      */
     private String cityName;
 
+    /**
+     * 联系人姓名
+     */
+    private String contacts;
+
+    /**
+     * 联系电话
+     */
+    private String phone;
+
     /**
      * 详细地址
      */

+ 2 - 0
sckw-modules-api/sckw-product-api/src/main/java/com/sckw/product/api/dubbo/GoodsInfoService.java

@@ -69,4 +69,6 @@ public interface GoodsInfoService {
      * @return: java.lang.Boolean
      */
     Boolean associateSupplyEnt(Long entId);
+
+    KwpGoods getGoodsByGoodsName(String goodsName);
 }

+ 2 - 0
sckw-modules-api/sckw-system-api/src/main/java/com/sckw/system/api/RemoteSystemService.java

@@ -274,4 +274,6 @@ public interface RemoteSystemService {
      * @return
      */
     Map<Long, KwsEnterpriseResDto> queryEnterpriseByEntIds(List<Long> entIds);
+
+    KwsEnterpriseResDto findEnterpriseByName(String consignCompany);
 }

+ 48 - 15
sckw-modules/sckw-contract/src/main/java/com/sckw/contract/dubbo/RemoteContractServiceImpl.java

@@ -1,7 +1,9 @@
 package com.sckw.contract.dubbo;
 
+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.contract.api.model.dto.res.ContractLogisticsOrderResDto;
 import com.sckw.contract.api.model.dto.res.EntInfo;
 import com.sckw.contract.dao.KwcContractLogisticsMapper;
 import com.sckw.contract.dao.KwcContractTradeMapper;
@@ -12,10 +14,10 @@ import com.sckw.contract.model.entity.KwcContractTrade;
 import com.sckw.contract.service.KwcContractLogisticsUnitService;
 import com.sckw.core.model.constant.Global;
 import com.sckw.core.model.enums.ContractStatusEnum;
+import com.sckw.core.model.enums.CooperateTypeEnum;
 import com.sckw.core.model.enums.SigningWayEnum;
 import com.sckw.core.utils.CollectionUtils;
 import com.sckw.system.api.RemoteSystemService;
-import com.sckw.system.api.model.dto.res.EntCacheResDto;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.apache.dubbo.config.annotation.DubboService;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -41,7 +43,7 @@ public class RemoteContractServiceImpl implements RemoteContractService {
     @Autowired
     private KwcContractTradeMapper kwcContractTradeMapper;
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 8000)
     private RemoteSystemService remoteSystemService;
 
     @Override
@@ -128,19 +130,20 @@ public class RemoteContractServiceImpl implements RemoteContractService {
         //加客户经理数据过滤
         enterpriseIds.add(entId);
         enterpriseIds = enterpriseIds.stream().distinct().collect(Collectors.toList());
-        if (Objects.nonNull(enterpriseIds) && enterpriseIds.size() > 0) {
-            for (Long aLong : entIdList) {
-                EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(aLong);
-                if (Objects.isNull(entCacheResDto)) {
-                    return Collections.emptyMap();
-                }
-                entIdList.add(aLong);
-                List<EntCacheResDto> child = entCacheResDto.getChild();
-                if (CollectionUtils.isNotEmpty(child)) {
-                    entIdList.addAll(child.stream().map(EntCacheResDto::getId).toList());
-                }
-            }
-        }
+        entIdList.addAll(enterpriseIds);
+//        if (Objects.nonNull(enterpriseIds) && enterpriseIds.size() > 0) {
+//            for (Long aLong : entIdList) {
+//                EntCacheResDto entCacheResDto = remoteSystemService.queryEntTreeById(aLong);
+//                if (Objects.isNull(entCacheResDto)) {
+//                    return Collections.emptyMap();
+//                }
+//                entIdList.add(aLong);
+//                List<EntCacheResDto> child = entCacheResDto.getChild();
+//                if (CollectionUtils.isNotEmpty(child)) {
+//                    entIdList.addAll(child.stream().map(EntCacheResDto::getId).toList());
+//                }
+//            }
+//        }
 
         List<QueryContractValidCountResDto> queryContractValidCountResDtos = kwcContractTradeMapper.queryContractValidCount(entIdList);
         if (CollectionUtils.isEmpty(queryContractValidCountResDtos)) {
@@ -150,6 +153,36 @@ public class RemoteContractServiceImpl implements RemoteContractService {
         return queryContractValidCountResDtos.stream().collect(Collectors.toMap(QueryContractValidCountResDto::getUnitType, QueryContractValidCountResDto::getCnt, (o, n) -> n));
     }
 
+    @Override
+    public ContractLogisticsOrderResDto getContractByContractNo(String contractNo) {
+        ContractLogisticsOrderResDto logisticsOrderResDto = new ContractLogisticsOrderResDto();
+        KwcContractLogistics contractLogistics = kwcContractLogisticsMapper.selectOne(new LambdaQueryWrapper<KwcContractLogistics>()
+                .eq(KwcContractLogistics::getContractNo, contractNo));
+        if (contractLogistics != null) {
+            logisticsOrderResDto.setId(contractLogistics.getId());
+            logisticsOrderResDto.setContactName(contractLogistics.getName());
+            logisticsOrderResDto.setContractNo(contractLogistics.getContractNo());
+            logisticsOrderResDto.setSigningWay(contractLogistics.getSigningWay());
+            logisticsOrderResDto.setSigningWayName(Objects.requireNonNull(SigningWayEnum.getName(contractLogistics.getSigningWay())).getName());
+            logisticsOrderResDto.setStatus(contractLogistics.getStatus());
+            logisticsOrderResDto.setStatusName((Objects.requireNonNull(ContractStatusEnum.getName(contractLogistics.getStatus())).getName()));
+            List<KwcContractLogisticsUnit> kwcContractLogisticsUnits = kwcContractLogisticsUnitService.queryByContractId(contractLogistics.getId());
+            if (CollectionUtils.isNotEmpty(kwcContractLogisticsUnits)) {
+                for (KwcContractLogisticsUnit kwcContractLogisticsUnit : kwcContractLogisticsUnits) {
+                    if (kwcContractLogisticsUnit.getUnitType().equals(CooperateTypeEnum.CONSIGN.getCode())) {
+                        logisticsOrderResDto.setConsignEntId(kwcContractLogisticsUnit.getEntId());
+                        logisticsOrderResDto.setConsignEntName(kwcContractLogisticsUnit.getFirmName());
+                    }
+                    if (kwcContractLogisticsUnit.getUnitType().equals(CooperateTypeEnum.CARRIAGE.getCode())) {
+                        logisticsOrderResDto.setAcceptCarriageEntId(kwcContractLogisticsUnit.getEntId());
+                        logisticsOrderResDto.setAcceptCarriageEntName(kwcContractLogisticsUnit.getFirmName());
+                    }
+                }
+            }
+        }
+        return logisticsOrderResDto;
+    }
+
     private ContractCommonInfoResDto fillContractLogistics(KwcContractLogistics kwcContractLogistics) {
         ContractCommonInfoResDto contractCommonInfoResDto = new ContractCommonInfoResDto();
         List<EntInfo> entList = new ArrayList<>();

+ 5 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/dubbo/GoodsInfoServiceImpl.java

@@ -89,4 +89,9 @@ public class GoodsInfoServiceImpl implements GoodsInfoService {
         Long count = kwpGoodsService.getCountBySupplyEnt(entId);
         return Objects.nonNull(count) && count > 0L;
     }
+
+    @Override
+    public KwpGoods getGoodsByGoodsName(String goodsName) {
+        return kwpGoodsService.getGoodsByGoodsName(goodsName);
+    }
 }

+ 8 - 1
sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java

@@ -17,7 +17,6 @@ import com.sckw.core.model.vo.TableStatisticRes;
 import com.sckw.core.model.vo.TableTop;
 import com.sckw.core.utils.*;
 import com.sckw.core.web.constant.HttpStatus;
-import com.sckw.core.web.context.LoginEntHolder;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.excel.utils.DateUtil;
 import com.sckw.payment.api.dubbo.PayCenterDubboService;
@@ -1298,4 +1297,12 @@ public class KwpGoodsService {
         List<KwpGoods> list = kwpGoodsMapper.selectList(wrapper);
         return CollectionUtils.emptyIfNull(list);
     }
+
+    public com.sckw.product.api.model.KwpGoods getGoodsByGoodsName(String goodsName) {
+        KwpGoods kwpGoods = kwpGoodsMapper.selectOne(
+                new LambdaQueryWrapper<KwpGoods>().eq(KwpGoods::getName, goodsName));
+        com.sckw.product.api.model.KwpGoods goods = new com.sckw.product.api.model.KwpGoods();
+        BeanUtils.copyPropertiesValue(kwpGoods, goods);
+        return goods;
+    }
 }

+ 6 - 6
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwWorkService.java

@@ -29,22 +29,22 @@ import java.util.*;
 @Service
 public class KwWorkService {
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 8000)
     private TransportStatisticsService transportStatisticsService;
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 8000)
     private PaymentDubboService paymentDubboService;
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 80000)
     private RemoteContractService remoteContractService;
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 80000)
     private TradeOrderStatisticsService tradeOrderStatisticsService;
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 80000)
     private RemoteSystemService remoteSystemService;
 
-    @DubboReference(version = "1.0.0", group = "design", check = false)
+    @DubboReference(version = "1.0.0", group = "design", check = false,timeout = 80000)
     private RemoteUserService remoteUserService;
 
 

+ 19 - 1
sckw-modules/sckw-system/src/main/java/com/sckw/system/controller/KwsEnterpriseController.java

@@ -4,7 +4,7 @@ import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.system.model.KwsEnterprise;
 import com.sckw.system.model.vo.req.*;
-import com.sckw.system.model.vo.req.FindListReqVo;
+import com.sckw.system.model.vo.res.KwsUserSystemTypeVo;
 import com.sckw.system.service.KwsEnterpriseService;
 import jakarta.servlet.http.HttpServletRequest;
 import jakarta.servlet.http.HttpServletResponse;
@@ -13,6 +13,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.ArrayList;
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -93,6 +95,22 @@ public class KwsEnterpriseController {
         return HttpResult.ok();
     }
 
+    /**
+     * 查询客户经理
+     *
+     * @return return
+     */
+    @RequestMapping(name = "查询客户经理", value = "/getManagerAll", method = RequestMethod.GET)
+    public HttpResult getManagerAll() {
+        List<KwsUserSystemTypeVo> managerAll = new ArrayList<>();
+        try {
+            managerAll = kwsEntService.getManagerAll();
+        } catch (Exception e) {
+            return HttpResult.error(e.getMessage());
+        }
+        return HttpResult.ok(managerAll);
+    }
+
     /**
      * @param id 主键ID
      * @return HttpResult

+ 2 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsEnterpriseDao.java

@@ -224,4 +224,6 @@ public interface KwsEnterpriseDao {
      * @return
      */
     List<KwsEnterprise> queryEnterpriseByEntIds(@Param("entIds") List<Long> entIds);
+
+    KwsEnterprise findEnterpriseByName(@Param("enterpriseName") String enterpriseName);
 }

+ 4 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dao/KwsUserDao.java

@@ -110,4 +110,8 @@ public interface KwsUserDao {
     List<KwsUser> selectByDeptIds(@Param(value = "list") List<Long> deptIds);
 
     List<KwsUserSystemTypeVo> selectUserBySystemType(@Param("systemType") Integer systemType);
+
+    List<KwsUserSystemTypeVo> selectUserBySystemTypeAndMain(@Param("systemType") Integer systemType,@Param("isMain")Integer isMain);
+
+    List<KwsUser> selectManager();
 }

+ 7 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteBaseService.java

@@ -313,4 +313,11 @@ public class RemoteBaseService {
         }
         return map;
     }
+
+    public KwsEnterpriseResDto findEnterpriseByName(String enterpriseName) {
+        KwsEnterprise kwsEnterprise = kwsEnterpriseDao.findEnterpriseByName(enterpriseName);
+        KwsEnterpriseResDto kwsEnterpriseResDto = new KwsEnterpriseResDto();
+        BeanUtils.copyProperties(kwsEnterprise, kwsEnterpriseResDto);
+        return kwsEnterpriseResDto;
+    }
 }

+ 12 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/dubbo/RemoteSystemServiceImpl.java

@@ -839,6 +839,7 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
 
     /**
      * 企业主键id查询数据库企业信息
+     *
      * @param entIds 企业id查询数据库企业信息
      * @return
      */
@@ -847,4 +848,15 @@ public class RemoteSystemServiceImpl implements RemoteSystemService {
         return remoteBaseService.queryEnterpriseByEntIds(entIds);
     }
 
+    /**
+     * 企业名称 精确查询企业
+     * @param enterpriseName
+     * @return
+     */
+    @Override
+    public KwsEnterpriseResDto findEnterpriseByName(String enterpriseName) {
+        KwsEnterpriseResDto dto= remoteBaseService.findEnterpriseByName(enterpriseName);
+        return dto;
+    }
+
 }

+ 6 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -1423,4 +1423,10 @@ public class KwsEnterpriseService {
         }
         RedissonUtils.putSet(key, enterpriseIds);
     }
+
+    public List<KwsUserSystemTypeVo> getManagerAll() {
+//        List<KwsUser> list = userDao.selectManager();
+        List<KwsUserSystemTypeVo> list = userDao.selectUserBySystemTypeAndMain(SystemTypeEnum.MANAGE.getCode(), NumberConstant.ZERO);
+        return list;
+    }
 }

+ 6 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsEnterpriseDao.xml

@@ -926,4 +926,10 @@
           </foreach>
       </if>
     </select>
+
+  <select id="findEnterpriseByName" resultMap="BaseResultMap">
+      select
+      <include refid="Base_Column_List" />
+      from kws_enterprise where firm_name =#{enterpriseName}
+    </select>
 </mapper>

+ 12 - 0
sckw-modules/sckw-system/src/main/resources/mapper/KwsUserDao.xml

@@ -381,4 +381,16 @@
       from kws_user AS u
       where u.del_flag = 0 and u.status = 0 and u.system_type = #{systemType}
     </select>
+
+    <select id="selectUserBySystemTypeAndMain" resultType="com.sckw.system.model.vo.res.KwsUserSystemTypeVo">
+      select u.id AS id,u.system_type AS systemType,u.account AS account,u.name AS name, u.phone AS phone,u.is_main as isMain
+      from kws_user AS u
+      where u.del_flag = 0 and u.status = 0 and u.system_type = #{systemType} and u.is_main=#{isMain}
+    </select>
+
+    <select id="selectManager" resultMap="BaseResultMap">
+      select a.*
+      from kws_user a
+      where a.del_flag = 0 and a.status = 0 and a.is_main = 0
+    </select>
 </mapper>

+ 23 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/KwtAcceptCarriageOrderController.java

@@ -1,6 +1,7 @@
 package com.sckw.transport.controller;
 
 import com.alibaba.fastjson.JSONObject;
+import com.sckw.core.annotation.Log;
 import com.sckw.core.annotation.RepeatSubmit;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.enums.OrderRuleEnum;
@@ -16,6 +17,7 @@ import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.transport.model.dto.*;
 import com.sckw.transport.model.param.*;
 import com.sckw.transport.model.vo.execlVo.AcceptCarriageOrderExcelVo;
+import com.sckw.transport.service.Import.KwtAcceptCarriageOrderImportService;
 import com.sckw.transport.service.KwtAcceptCarriageOrderService;
 import com.sckw.transport.service.KwtLogisticsOrderImportService;
 import com.sckw.transport.service.KwtTransportCommonService;
@@ -46,6 +48,9 @@ public class KwtAcceptCarriageOrderController {
     @Autowired
     KwtAcceptCarriageOrderService acceptCarriageOrderService;
 
+    @Autowired
+    KwtAcceptCarriageOrderImportService acceptCarriageOrderImportService;
+
     @Autowired
     KwtTransportCommonService transportCommonService;
 
@@ -403,6 +408,24 @@ public class KwtAcceptCarriageOrderController {
         }
     }
 
+    /**
+     * 承运订单数据导入(外部数据)
+     *
+     * @param file 文件
+     * @return  响应结果
+     */
+    @Log(description = "承运订单数据导入(外部数据)")
+    @RepeatSubmit(interval = 1000,message ="前方拥堵,请稍后尝试")
+    @RequestMapping(value = "/externalImportExcel", method = RequestMethod.POST)
+    public HttpResult externalImportExcel(@RequestParam("file") MultipartFile file) {
+        try {
+            return acceptCarriageOrderImportService.externalImportExcel(file);
+        } catch (Exception e) {
+            return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());
+        }
+    }
+
+
     /**
      * 工作台-承运业务统计
      * @param dateType 1代表周 2代表月

+ 134 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/ExeclDTO/LogisticsOrderExcelImportDTO.java

@@ -0,0 +1,134 @@
+package com.sckw.transport.model.dto.ExeclDTO;
+
+import jakarta.validation.constraints.*;
+import lombok.Data;
+import org.hibernate.validator.constraints.Length;
+
+import java.io.Serializable;
+import java.math.BigDecimal;
+
+/**
+ * @author lfdc
+ * @description 承运订单导入
+ * @date 2023-12-17 16:12:02
+ */
+@Data
+public class LogisticsOrderExcelImportDTO implements Serializable {
+    private static final long serialVersionUID = 370622351109421619L;
+    /**
+     * 托运单位
+     */
+    @NotBlank(message = "托运单位不能为空")
+    @Length(max = 32,message = "托运单位不能超过:{max}")
+    private String consignCompany;
+    /**
+     * 承运单位
+     */
+    @NotBlank(message = "承运单位不能为空")
+    @Length(max = 32,message = "承运单位不能超过:{max}")
+    private String acceptCarriageCompany;
+    /**
+     * 货物名称
+     */
+    @NotBlank(message = "货物名称不能为空")
+    private String goodsName;
+    /**
+     * 商品分类
+     */
+    @NotBlank(message = "商品分类不能为空")
+    private String goodsModel;
+    /**
+     * 合同号
+     */
+    @NotBlank(message = "合同号不能为空")
+    private String contract;
+    /**
+     * 计费方式
+     */
+    @NotBlank(message = "计费方式不能为空")
+    private String billingMode;
+    /**
+     * 运价
+     */
+    @Digits(integer = 10, fraction = 2, message = "运价格式错误")
+    @DecimalMin(value = "0.00", message = "运价最小值为{value}")
+    private BigDecimal price;
+    /**
+     * 运价单位
+     */
+    @NotBlank(message = "总量单位不能为空")
+    private String priceType;
+    /**
+     * 税率
+     */
+    @Digits(integer = 2, fraction = 2, message = "税率格式错误")
+    @DecimalMin(value = "0.00", message = "税率最小值为{value}")
+    private BigDecimal taxRate;
+    /**
+     * 运输总量
+     */
+    @Digits(integer = 10, fraction = 2, message = "运输总量格式错误")
+    @DecimalMin(value = "0.00", message = "运输总量最小值为{value}")
+    private BigDecimal amount;
+    /**
+     * 总量单位
+     */
+    @NotBlank(message = "总量单位不能为空")
+    private String amountUnit;
+    /**
+     * 合理损耗
+     */
+    @Digits(integer = 5, fraction = 2, message = "合理损耗格式错误")
+    @DecimalMin(value = "0.00", message = "合理损耗最小值为{value}")
+    private BigDecimal loss;
+    /**
+     * 商品价值(扣亏货值)
+     */
+    @Digits(integer = 5, fraction = 2, message = "扣亏货值格式错误")
+    @DecimalMin(value = "0.00", message = "扣亏货值最小值为{value}")
+    private BigDecimal goodsPrice;
+    /**
+     * 商品价值(扣亏货值)单位
+     */
+    @NotBlank(message = "扣亏货值不能为空")
+    private String goodsPriceUnit;
+    /**
+     * 计划发货时间
+     */
+    @NotBlank(message = "计划发货时间不能为空")
+    private String startTime;
+    /**
+     * 计划卸货时间
+     */
+    @NotBlank(message = "计划卸货时间不能为空")
+    private String endTime;
+
+    /**
+     * 结算周期(周结、月结、季结)
+     */
+    @NotBlank(message = "结算周期不能为空")
+    private String settlementCycle;
+
+    /**
+     * 支付方式
+     */
+    @NotBlank(message = "支付方式不能为空")
+    private String payment;
+
+    /**
+     * 装货地址-名称
+     */
+    @NotBlank(message = "装货地址不能为空")
+    private String loadAddress;
+    /**
+     * 卸货地址-名称
+     */
+    @NotBlank(message = "卸货地址不能为空")
+    private String unloadAddress;
+
+    /**
+     * 备注
+     */
+    @Length(max = 200, message = "单据编号长度错误最大长度:{max}")
+    private String remark;
+}

+ 753 - 0
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/Import/KwtAcceptCarriageOrderImportService.java

@@ -0,0 +1,753 @@
+package com.sckw.transport.service.Import;
+
+import com.alibaba.excel.EasyExcel;
+import com.alibaba.excel.ExcelReader;
+import com.alibaba.excel.read.metadata.ReadSheet;
+import com.sckw.contract.api.RemoteContractService;
+import com.sckw.contract.api.model.dto.res.ContractLogisticsOrderResDto;
+import com.sckw.core.common.enums.enums.DictTypeEnum;
+import com.sckw.core.exception.BusinessException;
+import com.sckw.core.model.constant.NumberConstant;
+import com.sckw.core.model.enums.*;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.IdWorker;
+import com.sckw.core.utils.OrderGenerateSeqNoUtils;
+import com.sckw.core.utils.StringUtils;
+import com.sckw.core.web.constant.HttpStatus;
+import com.sckw.core.web.context.LoginUserHolder;
+import com.sckw.core.web.response.HttpResult;
+import com.sckw.excel.easyexcel.ExcelImportListener;
+import com.sckw.excel.utils.DateUtil;
+import com.sckw.excel.utils.ExcelUtil;
+import com.sckw.excel.utils.ValidUtil;
+import com.sckw.fleet.api.RemoteFleetService;
+import com.sckw.manage.api.RemoteManageService;
+import com.sckw.manage.api.model.dto.res.EntAddressResDto;
+import com.sckw.manage.api.model.dto.res.FindEntCooperateResVo;
+import com.sckw.order.api.dubbo.TradeOrderInfoService;
+import com.sckw.payment.api.dubbo.PaymentDubboService;
+import com.sckw.product.api.dubbo.GoodsInfoService;
+import com.sckw.product.api.model.KwpGoods;
+import com.sckw.redis.config.RedisLockUtil;
+import com.sckw.system.api.RemoteSystemService;
+import com.sckw.system.api.model.dto.res.EntCacheResDto;
+import com.sckw.system.api.model.dto.res.KwsEnterpriseResDto;
+import com.sckw.system.api.model.dto.res.SysDictResDto;
+import com.sckw.transport.common.config.MessageUrlConfig;
+import com.sckw.transport.dao.*;
+import com.sckw.transport.model.*;
+import com.sckw.transport.model.dto.ExeclDTO.LogisticsOrderExcelImportDTO;
+import com.sckw.transport.service.KwtCommonService;
+import com.sckw.transport.service.KwtLogisticsOrderGoodsService;
+import com.sckw.transport.service.KwtTransportCommonService;
+import com.sckw.transport.service.KwtWaybillOrderService;
+import jakarta.annotation.Resource;
+import lombok.RequiredArgsConstructor;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.cloud.stream.function.StreamBridge;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.InputStream;
+import java.math.BigDecimal;
+import java.util.*;
+import java.util.stream.Collectors;
+
+/**
+ * @author lfdc
+ * @description 承运订单导入service
+ * @date 2023-12-17 16:12:50
+ */
+@Slf4j
+@Service
+@RequiredArgsConstructor
+public class KwtAcceptCarriageOrderImportService {
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    RemoteSystemService remoteSystemService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    TradeOrderInfoService tradeOrderInfoService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    GoodsInfoService goodsInfoService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 8000)
+    RemoteFleetService fleetService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
+    RemoteContractService remoteContractService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
+    RemoteManageService remoteManageService;
+
+    @DubboReference(version = "1.0.0", group = "design", check = false, timeout = 6000)
+    PaymentDubboService paymentDubboService;
+
+    @Autowired
+    KwtTransportCommonService transportCommonService;
+
+    @Autowired
+    private MessageUrlConfig messageUrlConfig;
+
+    @Autowired
+    public KwtCommonService commonService;
+
+    @Autowired
+    public KwtWaybillOrderService waybillOrderService;
+
+    @Autowired
+    public KwtLogisticsOrderGoodsService logisticsOrderGoodsService;
+
+    @Resource
+    private StreamBridge streamBridge;
+
+    @Autowired
+    private KwtLogisticsOrderMapper logisticsOrderMapper;
+
+    @Autowired
+    private KwtLogisticsOrderTrackMapper logisticsOrderTrackMapper;
+
+    @Autowired
+    private KwtWaybillOrderMapper waybillOrderMapper;
+
+    @Autowired
+    private KwtWaybillOrderTicketMapper waybillOrderTicketMapper;
+
+    @Autowired
+    public KwtLogisticsOrderGoodsMapper kwtLogisticsOrderGoodsMapper;
+
+    @Autowired
+    public KwtLogisticsOrderContractMapper kwtLogisticsOrderContractMapper;
+
+    @Autowired
+    private KwtLogisticsOrderCirculateMapper logisticsOrderCirculateMapper;
+
+    @Autowired
+    private KwtLogisticsOrderAddressMapper logisticsOrderAddressMapper;
+
+    @Autowired
+    public KwtLogisticsOrderUnitMapper logisticsOrderUnitMapper;
+
+    @Autowired
+    public KwtLogisticsOrderGoodsMapper goodsMapper;
+
+
+    private final RedisLockUtil redisLockUtil;
+
+    /**
+     * 承运订单导入
+     *
+     * @param file
+     * @return
+     */
+    @Transactional
+    public HttpResult externalImportExcel(MultipartFile file) {
+
+        /**文件存储至oss*/
+
+        /**文件必填写校验*/
+        HttpResult result = this.checkImportExcel(file);
+        if (result.getCode() != HttpStatus.SUCCESS_CODE) {
+            return result;
+        }
+        /**文件填写数据校验*/
+        List<LogisticsOrderExcelImportDTO> driverExcels = (List) result.getData();
+        checkDataFormat(driverExcels);
+
+        /**数据存储*/
+        saveExternalImportExcel(driverExcels);
+        return null;
+    }
+
+    /**
+     * 数据存储
+     *
+     * @param driverExcels 导入文件数据
+     */
+    private void saveExternalImportExcel(List<LogisticsOrderExcelImportDTO> driverExcels) {
+
+        //商品分类
+        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.INDUSTRY_TYPE.getType());
+        Map<String, SysDictResDto> goodsModel = dictResDtoMap.values().stream().collect(Collectors.toMap(SysDictResDto::getLabel, v -> v));
+
+        //计费方式
+        Map<String, SysDictResDto> chargingTypeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.CHARGING_TYPE.getType());
+        Map<String, SysDictResDto> chargingType = chargingTypeMap.values().stream().collect(Collectors.toMap(SysDictResDto::getLabel, v -> v));
+
+        //运价方式/扣亏货值
+        Map<String, SysDictResDto> priceTypeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.PRICE_TYPE.getType());
+        Map<String, SysDictResDto> priceTypeEnum = priceTypeMap.values().stream().collect(Collectors.toMap(SysDictResDto::getLabel, v -> v));
+
+        //结算周期
+        Map<String, SysDictResDto> settlementCycleMap = remoteSystemService.queryDictMapByType(DictTypeEnum.SETTLEMENT_CYCLE.getType());
+        Map<String, SysDictResDto> settlementCycleEnum = settlementCycleMap.values().stream().collect(Collectors.toMap(SysDictResDto::getLabel, v -> v));
+
+        //支付方式
+        Map<String, SysDictResDto> tradeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
+        Map<String, SysDictResDto> tradeEnum = tradeMap.values().stream().collect(Collectors.toMap(SysDictResDto::getLabel, v -> v));
+
+        //计量单位
+        Map<String, SysDictResDto> unitTypeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.UNIT_TYPE.getType());
+        Map<String, SysDictResDto> unitTypeEnum = unitTypeMap.values().stream().collect(Collectors.toMap(SysDictResDto::getLabel, v -> v));
+
+        int number = 0;
+        for (LogisticsOrderExcelImportDTO excelImport : driverExcels) {
+            number = number + 1;
+            commonService.getRedisGenerateOrderNo();
+            /**生成订单编号*/
+            String lOrderNo = OrderGenerateSeqNoUtils.getSeqNo(RedisOrderGenerateEnum.LOGISTICS_ORDER, OrderRuleEnum.LOGISTICS_ORDER, "2", "0", "0");
+            HttpResult httpResult = ValidUtil.serviceValid(excelImport);
+            if (!String.valueOf(HttpStatus.SUCCESS_CODE).equals(String.valueOf(httpResult.getCode()))) {
+                throw new RuntimeException(httpResult.getMsg());
+            }
+            String consignCompany = excelImport.getConsignCompany().trim();
+            KwsEnterpriseResDto consignEnterprise = remoteSystemService.findEnterpriseByName(consignCompany);
+            String acceptCarriageCompany = excelImport.getAcceptCarriageCompany().trim();
+            KwsEnterpriseResDto acceptCarriageEnterprise = remoteSystemService.findEnterpriseByName(acceptCarriageCompany);
+            List<FindEntCooperateResVo> entCooperate = remoteManageService.findEntCooperate(acceptCarriageEnterprise.getId(), consignEnterprise.getId(), CooperateTypeEnum.CONSIGN.getCode());
+            if (entCooperate == null) {
+                throw new RuntimeException("第" + number + "行,该托运企业与我方并无合作关系!");
+            }
+            /**保存新建数据*/
+            Long lOrderId = new IdWorker(NumberConstant.ONE).nextId();
+            /**根据合同计算当前单据状态*/
+            /**判断生成物流订单应生成哪一种单据状态*/
+            String contractNo = excelImport.getContract().trim();
+            ContractLogisticsOrderResDto commonInfoResDto = remoteContractService.getContractByContractNo(contractNo);
+            /**状态判断
+             * 是否是已签约合同
+             * */
+            // 0 已签约 1待签约
+            Integer status = commonInfoResDto.getStatus();
+            Integer orderStatus = LogisticsOrderEnum.PENDING_ORDER.getCode();
+            if (NumberConstant.ONE == status) {
+                orderStatus = LogisticsOrderEnum.TO_BE_PLANNED.getCode();
+            } else if (NumberConstant.ZERO == status) {
+                orderStatus = LogisticsOrderEnum.WAIT_DELIVERY.getCode();
+            } else {
+                log.info("导入订单异常,合同状态:{}", status);
+                throw new BusinessException("导入订单异常");
+            }
+            saveLogisticsOrder(excelImport, lOrderId, orderStatus, lOrderNo, chargingType, priceTypeEnum, settlementCycleEnum, tradeEnum, unitTypeEnum);
+            saveLogisticsOrderAddress(excelImport, lOrderId);
+            saveLogisticsOrderGoods(excelImport, lOrderId, lOrderNo);
+            saveLogisticsOrderContract(excelImport, lOrderId, commonInfoResDto);
+            saveLogisticsOrderTrack(lOrderId, orderStatus);
+            saveLogisticsOrderUnit(excelImport, lOrderId);
+//            saveMongoDb(excelImport, orderStatus, lOrderId, lOrderNo, commonInfoResDto);
+//            /**发送信息至消息列表*/
+//            //托运单位
+//            EntCacheResDto entCacheResDto = remoteSystemService.queryEntCacheById(consignEnterprise.getId());
+//            KwtLogisticsOrderUnit consignUnit = new KwtLogisticsOrderUnit();
+//            consignUnit.setUnitType(NumberConstant.ONE);
+//            consignUnit.setEntId(consignEnterprise.getId());
+//            consignUnit.setTopEntId(entCacheResDto == null ? null : entCacheResDto.getId());
+//            consignUnit.setFirmName(excelImport.getConsignCompany());
+//            consignUnit.setContactsId(consignEnterprise.getContacts());
+//
+//            //承运单位
+//            EntCacheResDto entCacheResDto1 = remoteSystemService.queryEntCacheById(Long.parseLong(orderDTO.getAcceptCompanyId()));
+//            KwtLogisticsOrderUnit carriageUnit = new KwtLogisticsOrderUnit();
+//            carriageUnit.setUnitType(NumberConstant.TWO);
+//            carriageUnit.setEntId(Long.parseLong(orderDTO.getAcceptCompanyId()));
+//            carriageUnit.setTopEntId(entCacheResDto1 == null ? null : entCacheResDto1.getId());
+//            carriageUnit.setFirmName(orderDTO.getAcceptCompany());
+//            carriageUnit.setContactsId(Long.parseLong(orderDTO.getAcceptContactsId()));
+//            commonService.newSendLogisticsOrderToMessage(consignUnit, carriageUnit, lOrderNo, LoginUserHolder.getUserId(), LoginUserHolder.getEntId()
+//                    , messageUrlConfig.getPc().getConsignLogisticsAddOrderUrl(), messageUrlConfig.getApp().getConsignLogisticsAddOrderUrl()
+//                    , messageUrlConfig.getPc().getCarriageLogisticsAddOrderUrl(), messageUrlConfig.getApp().getCarriageLogisticsAddOrderUrl()
+//                    , MessageEnum.NEW_LOGISTICS_ORDER, MessageEnum.NEW_CARRIAGE_ORDER
+//                    , "1"
+//            );
+        }
+
+    }
+
+    /**
+     * 物流订单单位
+     * @param excelImport
+     * @param lOrderId
+     */
+    private void saveLogisticsOrderUnit(LogisticsOrderExcelImportDTO excelImport, Long lOrderId) {
+        //托运
+        String consignCompany = excelImport.getConsignCompany().trim();
+        KwsEnterpriseResDto consignEnterprise = remoteSystemService.findEnterpriseByName(consignCompany);
+        //承运
+        String acceptCarriageCompany = excelImport.getAcceptCarriageCompany().trim();
+        KwsEnterpriseResDto acceptCarriageEnterprise = remoteSystemService.findEnterpriseByName(acceptCarriageCompany);
+
+        //托运
+        KwtLogisticsOrderUnit consignUnit = new KwtLogisticsOrderUnit();
+        consignUnit.setId(new IdWorker(NumberConstant.ONE).nextId());
+        consignUnit.setLOrderId(lOrderId);
+        consignUnit.setUnitType(NumberConstant.ONE);
+        consignUnit.setEntId(consignEnterprise.getId());
+        List<Long> entIds = new ArrayList<>();
+        entIds.add(consignEnterprise.getId());
+        entIds.add(acceptCarriageEnterprise.getId());
+        Map<Long, EntCacheResDto> entMap = remoteSystemService.queryEntTreeByIds(entIds);
+        EntCacheResDto ent = entMap.get(consignEnterprise.getId());
+        if (Objects.isNull(ent)) {
+            throw new BusinessException("企业:" + excelImport.getConsignCompany() + "的一级企业信息不存在!");
+        }
+//        consignUnit.setContactsId(Long.parseLong(orderDTO.getConsignContactsId()));
+//        consignUnit.setTopEntId(ent.getId());
+//        consignUnit.setFirmName(excelImport.getConsignCompany());
+//        consignUnit.setContacts(orderDTO.getConsignContacts());
+//        consignUnit.setPhone(orderDTO.getConsignContactPhone());
+        consignUnit.setStatus(NumberConstant.ZERO);
+        consignUnit.setCreateBy(LoginUserHolder.getUserId());
+        consignUnit.setCreateTime(new Date());
+        consignUnit.setUpdateBy(LoginUserHolder.getUserId());
+        consignUnit.setUpdateTime(new Date());
+        //承运
+        KwtLogisticsOrderUnit unit = new KwtLogisticsOrderUnit();
+        unit.setId(new IdWorker(NumberConstant.TWO).nextId());
+        unit.setLOrderId(lOrderId);
+        unit.setUnitType(NumberConstant.TWO);
+        unit.setEntId(acceptCarriageEnterprise.getId());
+        EntCacheResDto ent1 = entMap.get(acceptCarriageEnterprise.getId());
+        if (Objects.isNull(ent1)) {
+            throw new BusinessException("企业:" + excelImport.getAcceptCarriageCompany() + "的一级企业信息不存在!");
+        }
+//        unit.setContactsId(Long.parseLong(orderDTO.getAcceptContactsId()));
+//        unit.setTopEntId(ent1.getId());
+//        unit.setFirmName(orderDTO.getAcceptCompany());
+//        unit.setContacts(orderDTO.getAcceptContacts());
+//        unit.setPhone(orderDTO.getAcceptContactPhone());
+//        unit.setRemark(orderDTO.getRemark());
+        unit.setStatus(NumberConstant.ZERO);
+        unit.setCreateBy(LoginUserHolder.getUserId());
+        unit.setCreateTime(new Date());
+        unit.setUpdateBy(LoginUserHolder.getUserId());
+        unit.setUpdateTime(new Date());
+        logisticsOrderUnitMapper.insert(consignUnit);
+        logisticsOrderUnitMapper.insert(unit);
+    }
+
+    /** 物流订单-状态信息
+     * @param lOrderId
+     * @param orderStatus
+     */
+    private void saveLogisticsOrderTrack(Long lOrderId, Integer orderStatus) {
+        KwtLogisticsOrderTrack track = new KwtLogisticsOrderTrack();
+        track.setId(new IdWorker(NumberConstant.ONE).nextId());
+        track.setLOrderId(lOrderId);
+        track.setStatus(orderStatus);
+        track.setCreateBy(LoginUserHolder.getUserId());
+        track.setCreateTime(new Date());
+        track.setUpdateBy(LoginUserHolder.getUserId());
+        track.setUpdateTime(new Date());
+        logisticsOrderTrackMapper.insert(track);
+    }
+
+    /**
+     * 保存合同信息
+     * @param excelImport
+     * @param lOrderId
+     * @param commonInfoResDto
+     */
+    private void saveLogisticsOrderContract(LogisticsOrderExcelImportDTO excelImport, Long lOrderId, ContractLogisticsOrderResDto commonInfoResDto) {
+        KwtLogisticsOrderContract contract = new KwtLogisticsOrderContract();
+        contract.setId(new IdWorker(NumberConstant.ONE).nextId());
+        contract.setContractId(commonInfoResDto.getId());
+        contract.setLOrderId(lOrderId);
+        contract.setContractNo(excelImport.getContract());
+        contract.setContractName(commonInfoResDto.getContactName());
+        contract.setSigningWay(String.valueOf(commonInfoResDto.getSigningWay()));
+        contract.setStatus(NumberConstant.ZERO);
+        contract.setCreateBy(LoginUserHolder.getUserId());
+        contract.setCreateTime(new Date());
+        contract.setUpdateBy(LoginUserHolder.getUserId());
+        contract.setUpdateTime(new Date());
+        kwtLogisticsOrderContractMapper.insert(contract);
+    }
+
+    /**
+     * 保存商品信息
+     * @param excelImport
+     * @param lOrderId
+     * @param lOrderNo
+     */
+    private void saveLogisticsOrderGoods(LogisticsOrderExcelImportDTO excelImport, Long lOrderId, String lOrderNo) {
+        String goodsName = excelImport.getGoodsName().trim();
+        KwpGoods kwpGoods = goodsInfoService.getGoodsByGoodsName(goodsName);
+        KwtLogisticsOrderGoods goods = new KwtLogisticsOrderGoods();
+        goods.setId(new IdWorker(NumberConstant.ONE).nextId());
+        goods.setLOrderId(lOrderId);
+        goods.setLOrderNo(lOrderNo);
+        goods.setGoodsName(kwpGoods.getName());
+        goods.setGoodsType(kwpGoods.getGoodsType());
+        goods.setStatus(NumberConstant.ZERO);
+        goods.setCreateBy(LoginUserHolder.getUserId());
+        goods.setCreateTime(new Date());
+        goods.setUpdateBy(LoginUserHolder.getUserId());
+        goods.setUpdateTime(new Date());
+        goodsMapper.insert(goods);
+    }
+
+    /**
+     * 保存地址信息
+     * @param excelImport
+     * @param lOrderId
+     */
+    private void saveLogisticsOrderAddress(LogisticsOrderExcelImportDTO excelImport, Long lOrderId) {
+        String loadAddressName = excelImport.getLoadAddress();
+        String unloadAddressName = excelImport.getUnloadAddress();
+        String acceptCarriageCompany = excelImport.getAcceptCarriageCompany().trim();
+        KwsEnterpriseResDto acceptCarriageEnterprise = remoteSystemService.findEnterpriseByName(acceptCarriageCompany);
+        Long id = acceptCarriageEnterprise.getId();
+        Map<Long, List<EntAddressResDto>> longListMap = remoteManageService.queryEntAddressByEntIdList(Collections.singletonList(id));
+        List<EntAddressResDto> addressRes = longListMap.get(id);
+        if (CollectionUtils.isNotEmpty(addressRes)) {
+
+            Map<Integer, List<EntAddressResDto>> collect = addressRes.stream().collect(Collectors.groupingBy(EntAddressResDto::getDefaultType));
+            List<EntAddressResDto> loadAddressRes = collect.get(AddressDefaultTypeEnum.SHIPMENT.getCode());
+            Map<String, EntAddressResDto> loadAddressMap = new HashMap<>();
+            if (CollectionUtils.isNotEmpty(loadAddressRes)) {
+                loadAddressMap = loadAddressRes.stream().collect(Collectors.toMap(EntAddressResDto::getName, v -> v));
+            }
+            List<EntAddressResDto> unloadAddressRes = collect.get(AddressDefaultTypeEnum.TAKE.getCode());
+            Map<String, EntAddressResDto> unloadAddressMap = new HashMap<>();
+            if (CollectionUtils.isNotEmpty(unloadAddressRes)) {
+                unloadAddressMap = unloadAddressRes.stream().collect(Collectors.toMap(EntAddressResDto::getName, v -> v));
+            }
+            List<EntAddressResDto> allAddressRes = collect.get(AddressDefaultTypeEnum.BOTH.getCode());
+            Map<String, EntAddressResDto> allAddressResMap = new HashMap<>();
+
+            if (CollectionUtils.isNotEmpty(allAddressRes)) {
+                allAddressResMap = allAddressRes.stream().collect(Collectors.toMap(EntAddressResDto::getName, v -> v));
+            }
+
+            /**装货地址*/
+            KwtLogisticsOrderAddress loadAddress = new KwtLogisticsOrderAddress();
+            loadAddress.setId(new IdWorker(NumberConstant.ONE).nextId());
+            loadAddress.setLOrderId(lOrderId);
+            loadAddress.setAddressType(NumberConstant.ONE);
+            if (loadAddressMap != null || allAddressResMap != null) {
+                EntAddressResDto entAddressResDto = loadAddressMap.get(loadAddressName);
+                EntAddressResDto entAddressResDto1 = allAddressResMap.get(loadAddressName);
+                if (entAddressResDto == null){
+                    if (entAddressResDto1.getName().equals(loadAddressName)){
+                        loadAddress.setName(entAddressResDto1.getName());
+                        loadAddress.setContacts(entAddressResDto1.getContacts());
+                        loadAddress.setPhone(entAddressResDto1.getPhone());
+                        loadAddress.setCityCode(entAddressResDto1.getCityCode());
+                        loadAddress.setCityName(entAddressResDto1.getCityName());
+                        loadAddress.setDetailAddress(entAddressResDto1.getDetailAddress());
+                        loadAddress.setLat(entAddressResDto1.getLat());
+                        loadAddress.setLng(entAddressResDto1.getLng());
+                    }
+                }else {
+                    if (entAddressResDto.getName().equals(loadAddressName)){
+                        loadAddress.setName(entAddressResDto.getName());
+                        loadAddress.setContacts(entAddressResDto.getContacts());
+                        loadAddress.setPhone(entAddressResDto.getPhone());
+                        loadAddress.setCityCode(entAddressResDto.getCityCode());
+                        loadAddress.setCityName(entAddressResDto.getCityName());
+                        loadAddress.setDetailAddress(entAddressResDto.getDetailAddress());
+                        loadAddress.setLat(entAddressResDto.getLat());
+                        loadAddress.setLng(entAddressResDto.getLng());
+                    }
+                }
+                loadAddress.setEntryType(NumberConstant.FOUR);
+                loadAddress.setStatus(NumberConstant.ZERO);
+                loadAddress.setCreateBy(LoginUserHolder.getUserId());
+                Date date = new Date();
+                loadAddress.setCreateTime(date);
+                loadAddress.setUpdateBy(LoginUserHolder.getUserId());
+                loadAddress.setUpdateTime(date);
+                logisticsOrderAddressMapper.insert(loadAddress);
+            }
+
+            /**卸货地址*/
+            KwtLogisticsOrderAddress unloadAddress = new KwtLogisticsOrderAddress();
+            unloadAddress.setId(new IdWorker(NumberConstant.TWO).nextId());
+            unloadAddress.setLOrderId(lOrderId);
+            unloadAddress.setAddressType(NumberConstant.TWO);
+            if (unloadAddressMap != null || allAddressResMap != null) {
+                EntAddressResDto entAddressResDto = unloadAddressMap.get(unloadAddressName);
+                EntAddressResDto entAddressResDto1 = allAddressResMap.get(unloadAddressName);
+                if (entAddressResDto == null){
+                    if (entAddressResDto1.getName().equals(loadAddressName)){
+                        unloadAddress.setName(entAddressResDto1.getName());
+                        unloadAddress.setContacts(entAddressResDto1.getContacts());
+                        unloadAddress.setPhone(entAddressResDto1.getPhone());
+                        unloadAddress.setCityCode(entAddressResDto1.getCityCode());
+                        unloadAddress.setCityName(entAddressResDto1.getCityName());
+                        unloadAddress.setDetailAddress(entAddressResDto1.getDetailAddress());
+                        unloadAddress.setLat(entAddressResDto1.getLat());
+                        unloadAddress.setLng(entAddressResDto1.getLng());
+                    }
+                }else {
+                    if (entAddressResDto.getName().equals(loadAddressName)){
+                        unloadAddress.setName(entAddressResDto.getName());
+                        unloadAddress.setContacts(entAddressResDto.getContacts());
+                        unloadAddress.setPhone(entAddressResDto.getPhone());
+                        unloadAddress.setCityCode(entAddressResDto.getCityCode());
+                        unloadAddress.setCityName(entAddressResDto.getCityName());
+                        unloadAddress.setDetailAddress(entAddressResDto.getDetailAddress());
+                        unloadAddress.setLat(entAddressResDto.getLat());
+                        unloadAddress.setLng(entAddressResDto.getLng());
+                    }
+                }
+                unloadAddress.setEntryType(NumberConstant.FOUR);
+                unloadAddress.setStatus(NumberConstant.ZERO);
+                unloadAddress.setCreateBy(LoginUserHolder.getUserId());
+                Date date = new Date();
+                unloadAddress.setCreateTime(date);
+                unloadAddress.setUpdateBy(LoginUserHolder.getUserId());
+                unloadAddress.setUpdateTime(date);
+                logisticsOrderAddressMapper.insert(unloadAddress);
+            }
+        }
+    }
+
+    /**
+     * @param excelImport         导入文件
+     * @param lOrderId            订单id
+     * @param orderStatus         订单状态
+     * @param lOrderNo            订单号
+     * @param chargingType        计费方式
+     * @param priceTypeEnum       运价方式/扣亏货值
+     * @param settlementCycleEnum 结算周期
+     * @param tradeEnum           支付方式
+     */
+    private void saveLogisticsOrder(LogisticsOrderExcelImportDTO excelImport, Long lOrderId, Integer orderStatus,
+                                    String lOrderNo
+            , Map<String, SysDictResDto> chargingType
+            , Map<String, SysDictResDto> priceTypeEnum
+            , Map<String, SysDictResDto> settlementCycleEnum
+            , Map<String, SysDictResDto> tradeEnum
+            , Map<String, SysDictResDto> unitTypeEnum
+    ) {
+        KwtLogisticsOrder order = new KwtLogisticsOrder();
+        order.setId(lOrderId);
+        order.setEntId(LoginUserHolder.getEntId());
+        order.setType(String.valueOf(NumberConstant.TWO));
+        order.setLOrderNo(lOrderNo);
+        order.setPids(lOrderId.toString());
+        String settlementCycle = excelImport.getSettlementCycle().trim();
+        order.setSettlementCycle(settlementCycleEnum.get(settlementCycle) == null ? null : Long.parseLong(settlementCycleEnum.get(settlementCycle).getValue()));
+        String billingMode = excelImport.getBillingMode().trim();
+        order.setBillingMode(chargingType.get(billingMode) == null ? null : chargingType.get(billingMode).getValue());
+        order.setPrice(excelImport.getPrice());
+        String priceType = excelImport.getPriceType().trim();
+        order.setPriceType(priceTypeEnum.get(priceType) == null ? null : Long.parseLong(priceTypeEnum.get(priceType).getValue()));
+        String payment = excelImport.getPayment().trim();
+        order.setPayment(tradeEnum.get(payment) == null ? null : Long.parseLong(tradeEnum.get(payment).getValue()));
+        order.setAmount(excelImport.getAmount());
+        String amountUnit = excelImport.getAmountUnit().trim();
+        order.setUnit(unitTypeEnum.get(amountUnit) == null ? null : unitTypeEnum.get(amountUnit).getValue());
+        order.setLoss(excelImport.getLoss() == null ? null : excelImport.getLoss());
+        //当前合理损耗  文档导入默认使用 千分比 ‰
+        order.setLossUnit(String.valueOf(TaxRateTypeEnum.PERCENT.getCode()));
+        order.setGoodsPrice(excelImport.getGoodsPrice() == null ? null : excelImport.getGoodsPrice());
+        String goodsPriceUnit = excelImport.getGoodsPriceUnit().trim();
+        order.setGoodsPriceUnit(priceTypeEnum.get(goodsPriceUnit) == null ? null : priceTypeEnum.get(goodsPriceUnit).getValue());
+        order.setStartTime(org.apache.commons.lang3.ObjectUtils.isEmpty(excelImport.getStartTime()) ?
+                null : DateUtil.strToTime(excelImport.getStartTime() + " 00:00:00"));
+        order.setEndTime(org.apache.commons.lang3.ObjectUtils.isEmpty(excelImport.getEndTime()) ?
+                null : DateUtil.strToTime(excelImport.getEndTime() + " 23:59:00"));
+        BigDecimal decimal = new BigDecimal(NumberConstant.ZERO);
+        order.setSubcontractAmount(decimal);
+        order.setEntrustAmount(decimal);
+        order.setUnloadAmount(decimal);
+        order.setLoadAmount(decimal);
+        order.setIgnoreAmount(decimal);
+        order.setDeficitAmount(decimal);
+        order.setDeficitPrice(decimal);
+        order.setTaxRate(excelImport.getTaxRate());
+        order.setRemark(excelImport.getRemark());
+        order.setStatus(orderStatus);
+        order.setCreateBy(LoginUserHolder.getUserId());
+        order.setCreateTime(new Date());
+        order.setUpdateBy(LoginUserHolder.getUserId());
+        order.setUpdateTime(new Date());
+        order.setBindStatus(String.valueOf(NumberConstant.ZERO));
+        order.setTotalUnloadAmount(decimal);
+        order.setTotalLoadAmount(decimal);
+        logisticsOrderMapper.insert(order);
+    }
+
+    /**
+     * 文件填写数据校验
+     *
+     * @param driverExcels 导入文件数据检验
+     */
+    private void checkDataFormat(List<LogisticsOrderExcelImportDTO> driverExcels) {
+        //商品分类
+        Map<String, SysDictResDto> dictResDtoMap = remoteSystemService.queryDictMapByType(DictTypeEnum.INDUSTRY_TYPE.getType());
+        List<String> goodsModel = dictResDtoMap.values().stream().map(SysDictResDto::getLabel).distinct().collect(Collectors.toList());
+
+        //计费方式
+        Map<String, SysDictResDto> chargingTypeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.CHARGING_TYPE.getType());
+        List<String> chargingType = chargingTypeMap.values().stream().map(SysDictResDto::getLabel).distinct().collect(Collectors.toList());
+
+        //运价方式/扣亏货值
+        Map<String, SysDictResDto> priceTypeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.PRICE_TYPE.getType());
+        List<String> priceTypeEnum = priceTypeMap.values().stream().map(SysDictResDto::getLabel).distinct().collect(Collectors.toList());
+
+        //结算周期
+        Map<String, SysDictResDto> settlementCycleMap = remoteSystemService.queryDictMapByType(DictTypeEnum.SETTLEMENT_CYCLE.getType());
+        List<String> settlementCycleEnum = settlementCycleMap.values().stream().map(SysDictResDto::getLabel).distinct().collect(Collectors.toList());
+
+        //支付方式
+        Map<String, SysDictResDto> tradeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.TRADE_TYPE.getType());
+        List<String> tradeEnum = tradeMap.values().stream().map(SysDictResDto::getLabel).distinct().collect(Collectors.toList());
+
+        //计量单位
+        Map<String, SysDictResDto> unitTypeMap = remoteSystemService.queryDictMapByType(DictTypeEnum.UNIT_TYPE.getType());
+        List<String> unitTypeEnum = unitTypeMap.values().stream().map(SysDictResDto::getLabel).distinct().collect(Collectors.toList());
+
+
+        int number = 0;
+        for (int i = 0; i < driverExcels.size(); i++) {
+            number = number + 1;
+            LogisticsOrderExcelImportDTO excelImport = driverExcels.get(i);
+            String consignCompany = excelImport.getConsignCompany().trim();
+            KwsEnterpriseResDto consignEnterprise = remoteSystemService.findEnterpriseByName(consignCompany);
+            if (consignEnterprise == null) {
+                throw new RuntimeException("第" + number + "行托运企业不存在!");
+            }
+            String acceptCarriageCompany = excelImport.getAcceptCarriageCompany().trim();
+            KwsEnterpriseResDto acceptCarriageEnterprise = remoteSystemService.findEnterpriseByName(acceptCarriageCompany);
+            if (acceptCarriageEnterprise == null) {
+                throw new RuntimeException("第" + number + "行承运企业不存在!");
+            }
+            String goodsName = excelImport.getGoodsName().trim();
+            KwpGoods goods = goodsInfoService.getGoodsByGoodsName(goodsName);
+            if (goods == null) {
+                throw new RuntimeException("第" + number + "行货物信息不存在");
+            }
+            String goodsModelType = excelImport.getGoodsModel().trim();
+            if (!goodsModel.contains(goodsModelType)) {
+                throw new RuntimeException("第" + number + "行商品分类信息不存在");
+            }
+            String contractNo = excelImport.getContract().trim();
+            ContractLogisticsOrderResDto commonInfoResDto = remoteContractService.getContractByContractNo(contractNo);
+            if (commonInfoResDto == null) {
+                throw new RuntimeException("第" + number + "行合同信息不存在");
+            }
+            if (commonInfoResDto.getConsignEntName() == null) {
+                throw new RuntimeException("第" + number + "行合同信息托运企业不存在");
+            }
+            if (!commonInfoResDto.getConsignEntName().equals(consignCompany)) {
+                throw new RuntimeException("第" + number + "行合同信息的托运单位并非该[" + consignCompany + "]托运企业");
+            }
+            if (commonInfoResDto.getAcceptCarriageEntName() == null) {
+                throw new RuntimeException("第" + number + "行合同信息承运企业不存在");
+            }
+            if (!commonInfoResDto.getAcceptCarriageEntName().equals(acceptCarriageCompany)) {
+                throw new RuntimeException("第" + number + "行合同信息的托运单位并非该[" + acceptCarriageCompany + "]承运企业");
+            }
+            String billingMode = excelImport.getBillingMode().trim();
+            if (!chargingType.contains(billingMode)) {
+                throw new RuntimeException("第" + number + "行计费方式不存在");
+            }
+            String priceType = excelImport.getPriceType().trim();
+            if (!priceTypeEnum.contains(priceType)) {
+                throw new RuntimeException("第" + number + "行运价单位错误");
+            }
+            String amountUnit = excelImport.getAmountUnit().trim();
+            if (!unitTypeEnum.contains(amountUnit)) {
+                throw new RuntimeException("第" + number + "行承运量单位错误");
+            }
+            String goodsPriceUnit = excelImport.getGoodsPriceUnit().trim();
+            if (StringUtils.isNotBlank(goodsPriceUnit)) {
+                if (!priceTypeEnum.contains(goodsPriceUnit)) {
+                    throw new RuntimeException("第" + number + "行扣亏货值单位错误");
+                }
+            }
+            String settlementCycle = excelImport.getSettlementCycle().trim();
+            if (!settlementCycleEnum.contains(settlementCycle)) {
+                throw new RuntimeException("第" + number + "行结算周期不存在");
+            }
+            String payment = excelImport.getPayment().trim();
+            if (!tradeEnum.contains(payment)) {
+                throw new RuntimeException("第" + number + "行支付方式不存在");
+            }
+            String unloadAddressName = excelImport.getUnloadAddress();
+            String loadAddressName = excelImport.getLoadAddress();
+            Long id = acceptCarriageEnterprise.getId();
+            Map<Long, List<EntAddressResDto>> longListMap = remoteManageService.queryEntAddressByEntIdList(Collections.singletonList(id));
+            List<EntAddressResDto> addressRes = longListMap.get(id);
+            if (CollectionUtils.isNotEmpty(addressRes)) {
+                Map<Integer, List<EntAddressResDto>> collect = addressRes.stream().collect(Collectors.groupingBy(EntAddressResDto::getDefaultType));
+                List<String> loadAddress = new ArrayList<>();
+                List<String> unloadAddress = new ArrayList<>();
+                List<EntAddressResDto> loadAddressRes = collect.get(AddressDefaultTypeEnum.SHIPMENT.getCode());
+                if (CollectionUtils.isNotEmpty(loadAddressRes)) {
+                    List<String> loadAddressStr = loadAddressRes.stream().map(EntAddressResDto::getName).collect(Collectors.toList());
+                    loadAddress.addAll(loadAddressStr);
+                }
+                List<EntAddressResDto> unloadAddressRes = collect.get(AddressDefaultTypeEnum.TAKE.getCode());
+                if (CollectionUtils.isNotEmpty(unloadAddressRes)) {
+                    List<String> unloadAddressStr = unloadAddressRes.stream().map(EntAddressResDto::getName).collect(Collectors.toList());
+                    unloadAddress.addAll(unloadAddressStr);
+                }
+                List<EntAddressResDto> allAddressRes = collect.get(AddressDefaultTypeEnum.BOTH.getCode());
+                if (CollectionUtils.isNotEmpty(allAddressRes)) {
+                    List<String> allAddress = allAddressRes.stream().map(EntAddressResDto::getName).collect(Collectors.toList());
+                    loadAddress.addAll(allAddress);
+                    unloadAddress.addAll(allAddress);
+                }
+                if (loadAddress.size() > 0) {
+                    loadAddress = loadAddress.stream().distinct().collect(Collectors.toList());
+                    if (!loadAddress.contains(loadAddressName)) {
+                        throw new RuntimeException("第" + number + "行承运企业在系统中并未维护该装货地址");
+                    }
+                }
+                if (unloadAddress.size() > 0) {
+                    unloadAddress = unloadAddress.stream().distinct().collect(Collectors.toList());
+                    if (!unloadAddress.contains(unloadAddressName)) {
+                        throw new RuntimeException("第" + number + "行承运企业在系统中并未维护该卸货地址");
+                    }
+                }
+            } else {
+                throw new RuntimeException("第" + number + "行承运企业系统中并未维护装货地址或卸货地址");
+            }
+        }
+
+        /**获取需要发送工作台消息数据*/
+        List<String> acceptCarriageCompanyList = driverExcels.stream().map(LogisticsOrderExcelImportDTO::getAcceptCarriageCompany).distinct().collect(Collectors.toList());
+        List<String> consignCompanyList = driverExcels.stream().map(LogisticsOrderExcelImportDTO::getConsignCompany).distinct().collect(Collectors.toList());
+    }
+
+    /**
+     * @param file 上传文件
+     * @desc 文件必填写校验
+     **/
+    public HttpResult checkImportExcel(MultipartFile file) {
+        ExcelReader excelReader = null;
+        try {
+            /**数据校验**/
+            if (ExcelUtil.checkExcel(file)) {
+                return HttpResult.error("请上传Excel格式的文件!");
+            }
+            ExcelImportListener importListener = new ExcelImportListener();
+            InputStream inputStream = file.getInputStream();
+            excelReader = EasyExcel.read(inputStream, importListener).build();
+            ReadSheet readSheet = EasyExcel.readSheet(0).headRowNumber(3).head(LogisticsOrderExcelImportDTO.class).build();
+            excelReader.read(readSheet);
+            if (importListener.getErrorList().size() > 0) {
+                return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, "数据格式不正确,请确认!", importListener.getErrorList());
+            }
+            if (importListener.getDataList().size() == 0) {
+                return HttpResult.error("导入数据不能空!");
+            }
+            return HttpResult.ok(importListener.getDataList());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return HttpResult.error("订单导入异常!");
+        } finally {
+            if (excelReader != null) {
+                excelReader.finish();
+            }
+        }
+    }
+
+}

+ 8 - 10
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/KwtAcceptCarriageOrderService.java

@@ -3,9 +3,6 @@ package com.sckw.transport.service;
 import cn.hutool.core.date.DateField;
 import cn.hutool.core.date.DateTime;
 import cn.hutool.core.util.ArrayUtil;
-import com.alibaba.excel.EasyExcel;
-import com.alibaba.excel.ExcelReader;
-import com.alibaba.excel.read.metadata.ReadSheet;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -14,20 +11,18 @@ import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.sckw.contract.api.RemoteContractService;
 import com.sckw.contract.api.model.dto.res.ContractCommonInfoResDto;
-import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.common.enums.StringConstant;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.constant.NumberConstant;
 import com.sckw.core.model.enums.*;
 import com.sckw.core.model.page.PageRes;
 import com.sckw.core.utils.*;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
-import com.sckw.excel.easyexcel.ExcelImportListener;
 import com.sckw.excel.utils.DateUtil;
-import com.sckw.excel.utils.ExcelUtil;
 import com.sckw.excel.utils.ValidUtil;
 import com.sckw.fleet.api.RemoteFleetService;
 import com.sckw.fleet.api.model.vo.RTruckVo;
@@ -38,7 +33,10 @@ import com.sckw.mongo.model.SckwLogisticsOrder;
 import com.sckw.mongo.model.SckwWaybillOrder;
 import com.sckw.mongo.model.TableTops;
 import com.sckw.order.api.dubbo.TradeOrderInfoService;
-import com.sckw.order.api.model.*;
+import com.sckw.order.api.model.CompleteLogisticsOrderParam;
+import com.sckw.order.api.model.GoodsLoadingParam;
+import com.sckw.order.api.model.OrderDetailRes;
+import com.sckw.order.api.model.UnitInfoDetailRes;
 import com.sckw.payment.api.dubbo.PaymentDubboService;
 import com.sckw.payment.api.model.dto.SettlementMoney;
 import com.sckw.product.api.dubbo.GoodsInfoService;
@@ -72,9 +70,7 @@ import org.springframework.data.mongodb.core.MongoTemplate;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.util.ObjectUtils;
-import org.springframework.web.multipart.MultipartFile;
 
-import java.io.InputStream;
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.DecimalFormat;
@@ -1157,7 +1153,9 @@ public class KwtAcceptCarriageOrderService {
             //只展示待接单数据统计
             List<DriverListVo> truckCount = logisticsOrderMapper.selectDriverCountById(driverParam);
             Map<String, Integer> truckMap = new HashMap<>(Global.NUMERICAL_SIXTEEN);
-            truckCount.forEach(entity -> { truckMap.put(entity.getTruckNo(), entity.getCount());});
+            truckCount.forEach(entity -> {
+                truckMap.put(entity.getTruckNo(), entity.getCount());
+            });
 
             Map<String, String> dictData = commonService.getDictData(DictTypeEnum.TRUCK_TYPE.getType());
             for (DriverListVo driverListVo : list) {