فهرست منبع

Merge remote-tracking branch 'origin/dev' into dev

xucaiqin 2 سال پیش
والد
کامیت
b6c03c72f3
17فایلهای تغییر یافته به همراه156 افزوده شده و 72 حذف شده
  1. 2 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java
  2. 5 0
      sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/enums/Source.java
  3. 2 1
      sckw-common/sckw-common-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  4. 6 1
      sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/model/SckwMessage.java
  5. 4 3
      sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateManageController.java
  6. 19 2
      sckw-modules/sckw-message/src/main/java/com/sckw/message/service/MessageService.java
  7. 3 2
      sckw-modules/sckw-message/src/main/java/com/sckw/message/service/SckwMessageHandlerService.java
  8. 26 17
      sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java
  9. 10 3
      sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml
  10. 15 8
      sckw-modules/sckw-product/src/main/java/com/sckw/product/service/KwpGoodsService.java
  11. 9 7
      sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java
  12. 5 0
      sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/EntDetailResVo.java
  13. 27 18
      sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java
  14. 4 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/enterpriseApp/AppWayBillController.java
  15. 6 1
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtWaybillOrderMapper.java
  16. 2 2
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/model/dto/WaybillListAppDTO.java
  17. 11 5
      sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

+ 2 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/context/Enums.java

@@ -4,6 +4,7 @@ import com.sckw.core.common.enums.NumberConstant;
 import com.sckw.core.exception.SourceInitializeException;
 import com.sckw.core.model.enums.LogisticsOrderEnum;
 import com.sckw.excel.translate.Sources;
+import jakarta.annotation.PostConstruct;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.core.Ordered;
 import org.springframework.data.redis.core.RedisTemplate;
@@ -27,6 +28,7 @@ public class Enums implements Source, Ordered {
     @Autowired
     private RedisTemplate<String, Object> redisTemplate;
 
+
     public Enums() {
         initial();
     }

+ 5 - 0
sckw-common/sckw-common-excel/src/main/java/com/sckw/excel/translate/enums/Source.java

@@ -11,6 +11,8 @@ package com.sckw.excel.translate.enums;
  * @copyright
  */
 public enum Source {
+
+    TEST("com.sckw.excel.translate.context.Enums"),
     /**
      * 字典
      */
@@ -45,6 +47,9 @@ public enum Source {
         if (clazzName.equals(ENUMS.getClazz())) {
             return ENUMS;
         }
+        if (clazzName.equals(TEST.getClazz())) {
+            return TEST;
+        }
         return null;
     }
 }

+ 2 - 1
sckw-common/sckw-common-excel/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -1 +1,2 @@
-com.sckw.excel.translate.SourceUtil
+com.sckw.excel.translate.SourceUtil
+com.sckw.excel.translate.context.Enums

+ 6 - 1
sckw-common/sckw-common-stream/src/main/java/com/sckw/stream/model/SckwMessage.java

@@ -42,10 +42,15 @@ public class SckwMessage {
     private Map<String, Object> params;
 
     /**
-     * 消息跳转url
+     * 消息跳转url(废弃)
      */
     private String msgUrl;
 
+    /**
+     * 消息跳转urls(key为app、pc,value为对应的跳转地址)
+     */
+    private Map<String, String> msgUrls;
+
     /**
      * 推送设备类型
      */

+ 4 - 3
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/controller/KwmCooperateManageController.java

@@ -8,6 +8,7 @@ import com.sckw.manage.service.KwmCooperateManageService;
 import jakarta.servlet.http.HttpServletResponse;
 import jakarta.validation.Valid;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.http.MediaType;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -134,7 +135,7 @@ public class KwmCooperateManageController {
      * @date: 2023/7/22
      */
     @PostMapping("findEntCooperate")
-    public HttpResult findEntCooperate(@RequestBody FindEntCooperateReqVo reqVo) {
+    public HttpResult findEntCooperate(@Valid @RequestBody FindEntCooperateReqVo reqVo) {
         return HttpResult.ok(kwmCooperateManageService.findEntCooperate(reqVo));
     }
 
@@ -147,7 +148,7 @@ public class KwmCooperateManageController {
      * @date: 2023/8/1
      */
     @PostMapping("findCooperateByEnt")
-    public HttpResult findCooperateByEnt(@RequestBody FindCooperateByEntReqVo reqVo) {
+    public HttpResult findCooperateByEnt(@Valid @RequestBody FindCooperateByEntReqVo reqVo) {
         return HttpResult.ok(kwmCooperateManageService.findCooperateByEnt(reqVo));
     }
 
@@ -159,7 +160,7 @@ public class KwmCooperateManageController {
      * @date: 2023/7/22
      */
     @PostMapping("findTargetEntCooperateInOur")
-    public HttpResult findTargetEntCooperateInOur(@RequestBody FindCooperateByEntReqVo reqVo) {
+    public HttpResult findTargetEntCooperateInOur(@Valid @RequestBody FindCooperateByEntReqVo reqVo) {
         return HttpResult.ok(kwmCooperateManageService.findTargetEntCooperateInOur(reqVo));
     }
 

+ 19 - 2
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/MessageService.java

@@ -1,5 +1,6 @@
 package com.sckw.message.service;
 
+import com.alibaba.fastjson2.JSONObject;
 import com.sckw.core.common.enums.enums.DictEnum;
 import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
@@ -122,12 +123,17 @@ public class MessageService {
         if (CollectionUtils.isEmpty(list)) {
             return Collections.emptyList();
         }
+        String clientType = LoginUserHolder.getClientType();
         List<Long> userIds = list.stream().map(MessageListDTO::getCreateBy).toList();
         Map<Long, UserCacheResDto> map = remoteSystemService.queryUserCacheMapByIds(userIds);
         List<KwmMessageListResVO> result = new ArrayList<>(list.size());
         list.forEach(e -> {
             UserCacheResDto user = map.get(e.getCreateBy());
             KwmMessageListResVO res = BeanUtils.copyProperties(e, KwmMessageListResVO.class);
+            if (Objects.nonNull(e.getUrl())) {
+                Map<String, Object> urlMap = JSONObject.parse(e.getUrl());
+                res.setUrl(Objects.isNull(urlMap.get(clientType)) ? null : urlMap.get(clientType).toString());
+            }
             res.setStatusLabel(MsgStatusEnum.getNameByCode(res.getStatus()));
             res.setCategoryLabel(DictEnum.getLabel(DictTypeEnum.MSG_CATEGORY.getType(), e.getCategory()));
             if (Objects.nonNull(user)) {
@@ -207,6 +213,11 @@ public class MessageService {
         }
         KwmMessageUser kwmMessageUser = msgList.get(0);
         KwmMessage message = kwmMessageService.getById(kwmMessageUser.getMsgId());
+        if (Objects.nonNull(message.getUrl())) {
+            String clientType = LoginUserHolder.getClientType();
+            Map<String, Object> urlMap = JSONObject.parse(message.getUrl());
+            message.setUrl(Objects.isNull(urlMap.get(clientType)) ? null : urlMap.get(clientType).toString());
+        }
         //更新用户消息为已读状态
         kwmMessageUserService.readByMsgIds(ids);
         return message;
@@ -268,11 +279,17 @@ public class MessageService {
         if (CollectionUtils.isEmpty(result)) {
             return Collections.emptyList();
         }
+        String clientType = LoginUserHolder.getClientType();
         result.forEach(e -> {
             dto.setStatus(e.getStatus()).setType(e.getType());
             UserMsgCenterLatestMsgDTO msg = kwmMessageUserService.getLatestMsg(dto);
-            e.setId(msg.getId()).setTitle(msg.getTitle()).setContent(msg.getContent())
-                    .setUrl(msg.getUrl()).setCreateTime(msg.getCreateTime());
+            if (Objects.nonNull(msg.getUrl())) {
+                Map<String, Object> urlMap = JSONObject.parse(msg.getUrl());
+                e.setUrl(Objects.isNull(urlMap.get(clientType)) ? null : urlMap.get(clientType).toString());
+            }
+            e.setId(msg.getId()).setTitle(msg.getTitle())
+                    .setContent(msg.getContent())
+                    .setCreateTime(msg.getCreateTime());
         });
         return result;
     }

+ 3 - 2
sckw-modules/sckw-message/src/main/java/com/sckw/message/service/SckwMessageHandlerService.java

@@ -17,6 +17,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.List;
+import java.util.Objects;
 
 /**
  * @desc: message消息处理service
@@ -61,8 +62,8 @@ public class SckwMessageHandlerService {
                 .title(messageEnum.getTitle())
                 .content(content)
                 .clientType(messageEnum.getPushType())
-                .url(sckwMessage.getMsgUrl())
-                .params(JSON.toJSONString(sckwMessage.getParams()))
+                .url(Objects.isNull(sckwMessage.getMsgUrls()) ? null : JSON.toJSONString(sckwMessage.getMsgUrls()))
+                .params(Objects.isNull(sckwMessage.getParams()) ? null : JSON.toJSONString(sckwMessage.getParams()))
                 .build();
         kwmMessage.setCreateBy(createBy);
         kwmMessage.setUpdateBy(createBy);

+ 26 - 17
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -11,6 +11,7 @@ import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.enums.CooperateTypeEnum;
 import com.sckw.core.model.enums.OrderRuleEnum;
 import com.sckw.core.model.enums.RedisOrderGenerateEnum;
@@ -96,11 +97,17 @@ public class KwoTradeOrderService {
     private final KwoTradeOrderContractService kwoTradeOrderContractService;
     private final KwoTradeOrderTrackService kwoTradeOrderTrackService;
 
-    @Value("${valet.order.list.url}")
-    private String valetOrderListUrl;
+    @Value("${url.order.list.valet.pc}")
+    private String pcValetListUrl;
 
-    @Value("${purchase.order.list.url}")
-    private String purchaseOrderListUrl;
+    @Value("${url.order.list.valet.app}")
+    private String appValetListUrl;
+
+    @Value("${url.order.list.purchase.pc}")
+    private String pcPurchaseListUrl;
+
+    @Value("${url.order.list.purchase.app}")
+    private String appPurchaseListUrl;
 
     /**
      * @desc: 采购下单草稿
@@ -321,10 +328,10 @@ public class KwoTradeOrderService {
             if (!Objects.equals(procureUser.getUserId(), LoginUserHolder.getUserId())) {
                 userInfos.add(procureUser);
             }
-            sendMsg(MessageEnum.ORDER_INITIATE_PURCHASE, map, purchaseOrderListUrl, userInfos);
+            sendMsg(MessageEnum.ORDER_INITIATE_PURCHASE, map, pcPurchaseListUrl, appPurchaseListUrl, userInfos);
             //给供应企业联系人发消息
             map.put("firmName", procureFireName);
-            sendMsg(MessageEnum.ORDER_NEW_PENDING, map, valetOrderListUrl, List.of(supplyUser));
+            sendMsg(MessageEnum.ORDER_NEW_PENDING, map, pcValetListUrl, appValetListUrl, List.of(supplyUser));
         } else {
             //代客下单
             //给创建人及供应企业联系人发消息
@@ -332,10 +339,10 @@ public class KwoTradeOrderService {
             if (!Objects.equals(supplyUser.getUserId(), LoginUserHolder.getUserId())) {
                 userInfos.add(supplyUser);
             }
-            sendMsg(MessageEnum.ORDER_INITIATE_SALE, map, valetOrderListUrl, userInfos);
+            sendMsg(MessageEnum.ORDER_INITIATE_SALE, map, pcValetListUrl, appValetListUrl, userInfos);
             //给采购企业联系人发消息
             map.put("firmName", supplyFireName);
-            sendMsg(MessageEnum.ORDER_NEW_VALET_MSG, map, purchaseOrderListUrl, List.of(procureUser));
+            sendMsg(MessageEnum.ORDER_NEW_VALET_MSG, map, pcPurchaseListUrl, appPurchaseListUrl, List.of(procureUser));
         }
     }
 
@@ -345,16 +352,18 @@ public class KwoTradeOrderService {
      * @date: 2023-09-06 15:57
      * @Param msgEnum: 消息枚举
      * @Param params: 消息变量
-     * @Param url: 消息调转url
+     * @Param pcUrl: pc消息调转url
+     * @Param appUrl: app消息调转url
      * @Param userInfos:  发送消息用户集合
      * @return: void
      */
-    private void sendMsg(MessageEnum msgEnum, Map<String, Object> params, String url, List<UserInfo> userInfos) {
-        SckwMessage msg = new SckwMessage();
-        msg.setRequestId(UUIDUtils.get32UUID())
-                .setMessageEnum(msgEnum)
-                .setParams(params)
-                .setMsgUrl(url)
+    private void sendMsg(MessageEnum msgEnum, Map<String, Object> params, String pcUrl, String appUrl, List<UserInfo> userInfos) {
+        Map<String, String> urls = new HashMap<>();
+        urls.put(ClientTypeEnum.pc.getValue(), pcUrl);
+        urls.put(ClientTypeEnum.app.getValue(), appUrl);
+        SckwMessage msg = new SckwMessage(msgEnum);
+        msg.setParams(params)
+                .setMsgUrls(urls)
                 .setUserInfos(userInfos)
                 .setCreateBy(LoginUserHolder.getUserId());
         log.info("有新的提醒消息:{}", JSON.toJSONString(msg));
@@ -980,7 +989,7 @@ public class KwoTradeOrderService {
         map.put("firmName", purchase.getFirmName());
         UserInfo supplyUser = new UserInfo();
         supplyUser.setUserId(supply.getContactsId()).setEntId(supply.getTopEntId());
-        sendMsg(MessageEnum.ORDER_REJECT_VALET, map, valetOrderListUrl, List.of(supplyUser));
+        sendMsg(MessageEnum.ORDER_REJECT_VALET, map, pcValetListUrl, appValetListUrl, List.of(supplyUser));
         //给订单创建人及采购企业联系人发消息
         map.put("firmName", supply.getFirmName());
         List<UserInfo> userInfos = new ArrayList<>();
@@ -992,7 +1001,7 @@ public class KwoTradeOrderService {
             purchaseUser.setUserId(purchase.getContactsId()).setEntId(purchase.getTopEntId());
             userInfos.add(purchaseUser);
         }
-        sendMsg(MessageEnum.ORDER_REJECT_PURCHASE, map, purchaseOrderListUrl, userInfos);
+        sendMsg(MessageEnum.ORDER_REJECT_PURCHASE, map, pcPurchaseListUrl, appPurchaseListUrl, userInfos);
     }
 
     /**

+ 10 - 3
sckw-modules/sckw-order/src/main/resources/mapper/KwoWantBuyMapper.xml

@@ -51,10 +51,17 @@
             and kb.create_time &lt;= #{wantBuyReq.endCreateTime,jdbcType=TIMESTAMP}
         </if>
         <if test="wantBuyReq.tradings != null and wantBuyReq.tradings.size() > 0">
-            and kt.trading in
-            <foreach collection="wantBuyReq.tradings" item="item" open="(" close=")" separator=",">
-                #{item,jdbcType=VARCHAR}
+            <!--私用and条件-->
+<!--            and kt.trading in-->
+<!--            <foreach collection="wantBuyReq.tradings" item="item" open="(" close=")" separator=",">-->
+<!--                #{item,jdbcType=VARCHAR}-->
+<!--            </foreach>-->
+            <!-- 使用 AND 条件 -->
+            and (
+            <foreach collection="wantBuyReq.tradings" item="item" separator=" and ">
+                kt.trading = #{item,jdbcType=VARCHAR}
             </foreach>
+            )
         </if>
         <if test="wantBuyReq.wantBuyIds != null and wantBuyReq.wantBuyIds.size() > 0">
             and kb.id in

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

@@ -10,11 +10,15 @@ import com.sckw.core.common.enums.enums.DictTypeEnum;
 import com.sckw.core.exception.BusinessException;
 import com.sckw.core.exception.CustomPromptException;
 import com.sckw.core.model.constant.Global;
+import com.sckw.core.model.enums.ClientTypeEnum;
 import com.sckw.core.model.page.PageResult;
 import com.sckw.core.model.vo.TableBottom;
 import com.sckw.core.model.vo.TableStatisticRes;
 import com.sckw.core.model.vo.TableTop;
-import com.sckw.core.utils.*;
+import com.sckw.core.utils.BeanUtils;
+import com.sckw.core.utils.CollectionUtils;
+import com.sckw.core.utils.NumberUtils;
+import com.sckw.core.utils.StringUtils;
 import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.excel.utils.DateUtil;
@@ -79,8 +83,10 @@ public class KwpGoodsService {
     private final KwpGoodsPriceRangeService kwpGoodsPriceRangeService;
     private final StreamBridge streamBridge;
 
-    @Value("${goods.url.list}")
-    private String goodsListUrl;
+    @Value("${goods.url.list.pc}")
+    private String pcGoodsListUrl;
+    @Value("${goods.url.list.app}")
+    private String appGoodsListUrl;
 
 
     /**
@@ -706,11 +712,12 @@ public class KwpGoodsService {
         UserInfo createUser = new UserInfo();
         createUser.setUserId(goods.getCreateBy()).setEntId(goods.getEntId());
         userInfos.add(createUser);
-        SckwMessage msg = new SckwMessage();
-        msg.setRequestId(UUIDUtils.get32UUID())
-                .setMessageEnum(msgEnum)
-                .setParams(map)
-                .setMsgUrl(goodsListUrl)
+        HashMap<String, String> urlMap = new HashMap<>();
+        urlMap.put(ClientTypeEnum.app.getValue(), appGoodsListUrl);
+        urlMap.put(ClientTypeEnum.pc.getValue(), pcGoodsListUrl);
+        SckwMessage msg = new SckwMessage(msgEnum);
+        msg.setParams(map)
+                .setMsgUrls(urlMap)
                 .setUserInfos(userInfos)
                 .setCreateBy(LoginUserHolder.getUserId());
         log.info(msgEnum.getTitle() + "消息:{}", JSON.toJSONString(msg));

+ 9 - 7
sckw-modules/sckw-report/src/main/java/com/sckw/report/service/KwTransportService.java

@@ -306,7 +306,7 @@ public class KwTransportService {
                 statuses.add(CarWaybillEnum.REFUSE_TRAFFIC.getCode());
                 statuses.add(CarWaybillEnum.REVOKED.getCode());
                 criteria.and("status").in(statuses);
-            }else {
+            } else {
                 criteria.and("status").is(Integer.valueOf(query.getStatus()));
             }
         }
@@ -500,8 +500,7 @@ public class KwTransportService {
                 //单证审核计算
                 if (CarWaybillEnum.APPROVAL_IN.getStatus().equals(result.getValue())
                         || CarWaybillEnum.APPROVAL_NO_PASS.getStatus().equals(result.getValue())
-                        || CarWaybillEnum.APPROVAL_PASS.getStatus().equals(result.getValue()))
-                {
+                        || CarWaybillEnum.APPROVAL_PASS.getStatus().equals(result.getValue())) {
                     documentCheck = documentCheck + result.getTotal();
                 }
             }
@@ -602,10 +601,12 @@ public class KwTransportService {
             vo.setStatusLabel(CarWaybillEnum.getName(waybillOrder.getStatus()));
             // 托量单位
             vo.setUnit(waybillOrder.getUnit() == null ? null : waybillOrder.getUnit());
-            if(waybillOrder.getUnit() != null) {
+            if (waybillOrder.getUnit() != null) {
                 Map<String, SysDictResDto> unitType = remoteSystemService.queryDictMapByType(DictTypeEnum.UNIT_TYPE.getType());
-                SysDictResDto sysDict = unitType.get(waybillOrder.getUnit());
-                vo.setUnitLabel(sysDict.getLabel());
+                if (!unitType.isEmpty()) {
+                    SysDictResDto sysDict = unitType.get(waybillOrder.getUnit());
+                    vo.setUnitLabel(sysDict == null ? null : sysDict.getLabel());
+                }
             }
             vo.setSendCarTime(waybillOrder.getCreateTime() == null ?
                     null : DateUtil.getDateTime(waybillOrder.getCreateTime()));
@@ -645,7 +646,7 @@ public class KwTransportService {
                 String lossUnit = waybillOrder.getLossUnit();
                 Map<String, SysDictResDto> LossUnitType = remoteSystemService.queryDictMapByType(DictTypeEnum.TAX_RATE_TYPE.getType());
                 SysDictResDto sysDictRes = LossUnitType.get(lossUnit);
-
+                if (sysDictRes != null) {
                 if (sysDictRes.getLabel().equals("%")) {
                     // 百分比
                     lossAmount = loss.multiply(waybillOrder.getLoadAmount()).divide(BigDecimal.valueOf(100));
@@ -653,6 +654,7 @@ public class KwTransportService {
                     // 千分比
                     lossAmount = loss.multiply(waybillOrder.getLoadAmount()).divide(BigDecimal.valueOf(1000));
                 }
+                }
                 lossAmount = deficitAmount.subtract(lossAmount);
                 if (lossAmount.compareTo(new BigDecimal("0.00")) < 0) {
                     lossAmount = new BigDecimal("0.00");

+ 5 - 0
sckw-modules/sckw-system/src/main/java/com/sckw/system/model/vo/res/EntDetailResVo.java

@@ -32,6 +32,11 @@ public class EntDetailResVo implements Serializable {
      */
     private String contacts;
 
+    /**
+     * 企业联系人
+     */
+    private Long contactsId;
+
     /**
      * 联系电话
      */

+ 27 - 18
sckw-modules/sckw-system/src/main/java/com/sckw/system/service/KwsEnterpriseService.java

@@ -1,4 +1,5 @@
 package com.sckw.system.service;
+
 import java.util.Date;
 
 import cn.hutool.core.date.DateUtil;
@@ -333,19 +334,19 @@ public class KwsEnterpriseService {
         }
         Arrays.stream(reqVo.getEntTypes().split(",")).toList().forEach(item -> {
             //if (!finalTypeList.contains(Integer.parseInt(item))) {
-                KwsEntType kwsEntType = new KwsEntType();
-                kwsEntType.setEntId(entId);
-                kwsEntType.setType(Integer.parseInt(item));
-                kwsEntType.setId(new IdWorker(1).nextId());
-                kwsEntType.setStatus(Global.NO);
-                kwsEntType.setCreateBy(userId);
-                kwsEntType.setCreateTime(date);
-                kwsEntType.setUpdateBy(userId);
-                kwsEntType.setUpdateTime(date);
-                kwsEntType.setDelFlag(Global.NO);
-                if (kwsEntTypeDao.insert(kwsEntType) <= 0) {
-                    throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
-                }
+            KwsEntType kwsEntType = new KwsEntType();
+            kwsEntType.setEntId(entId);
+            kwsEntType.setType(Integer.parseInt(item));
+            kwsEntType.setId(new IdWorker(1).nextId());
+            kwsEntType.setStatus(Global.NO);
+            kwsEntType.setCreateBy(userId);
+            kwsEntType.setCreateTime(date);
+            kwsEntType.setUpdateBy(userId);
+            kwsEntType.setUpdateTime(date);
+            kwsEntType.setDelFlag(Global.NO);
+            if (kwsEntTypeDao.insert(kwsEntType) <= 0) {
+                throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.INSERT_FAIL);
+            }
             //}
         });
 
@@ -383,9 +384,9 @@ public class KwsEnterpriseService {
         map.put("entName", kwsEnterprise.getFirmName());
         map.put("createByName", kwsEnterprise.getContacts());
         commonService.sendSystemMessage(Collections.singletonList(new UserInfo().setUserId(userId).setEntId(entId)),
-                                        MessageEnum.ENT_CERTIFICATE,
-                                        map,
-                                        entCertificateUrl);
+                MessageEnum.ENT_CERTIFICATE,
+                map,
+                entCertificateUrl);
     }
 
     /**
@@ -412,7 +413,7 @@ public class KwsEnterpriseService {
         for (KwsEntCertificate kwsEntCertificate : kwsEntCertificateList) {
             //先把旧的作废
             List<KwsEntCertificate> previous = kwsEntCertificateDao.findByEntType(kwsEntCertificate.getEntId(), kwsEntCertificate.getType());
-            previous = previous.stream().filter(item -> item.getId().compareTo(kwsEntCertificate.getId()) != 0).toList();
+            previous = previous.stream().filter(item -> !item.getId().equals(kwsEntCertificate.getId())).toList();
             if (!CollectionUtils.isEmpty(previous)) {
                 for (KwsEntCertificate kwsEntCertificate1 : previous) {
                     kwsEntCertificate1.setDelFlag(Global.YES);
@@ -533,6 +534,10 @@ public class KwsEnterpriseService {
             throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ENTCERTIFICATES_NOT_EXISTS);
         }
 
+        kwsEntCertificates = kwsEntCertificates.stream().filter(item -> item.getStatus().equals(Global.NO)).toList();
+        if (CollectionUtils.isEmpty(kwsEntCertificates)) {
+            throw new SystemException(HttpStatus.QUERY_FAIL_CODE, HttpStatus.ENTCERTIFICATES_NOT_EXISTS);
+        }
         /*拼装返参*/
         List<CertificateResVo> list = new ArrayList<>();
         kwsEntCertificates.forEach(item -> {
@@ -778,6 +783,10 @@ public class KwsEnterpriseService {
         }
         EntDetailResVo entDetailResVo = new EntDetailResVo();
         BeanUtils.copyProperties(kwsEnterprise, entDetailResVo);
+        FindManagePojo manageInfoByEntId = kwsEnterpriseDao.findManageInfoByEntId(kwsEnterprise.getId());
+        if (Objects.nonNull(manageInfoByEntId)) {
+            entDetailResVo.setContactsId(manageInfoByEntId.getUserId());
+        }
         List<KwsEntType> listByEntIds = kwsEntTypeDao.findListByEntIds(Collections.singletonList(kwsEnterprise.getId()));
         if (CollectionUtils.isNotEmpty(listByEntIds)) {
             entDetailResVo.setEntTypes(String.join(Global.COMMA, listByEntIds.stream().map(KwsEntType::getType).map(String::valueOf).distinct().toList()));
@@ -786,8 +795,8 @@ public class KwsEnterpriseService {
     }
 
     /**
-     * @desc 企业联系人信息
      * @param id 企业信息
+     * @desc 企业联系人信息
      * @author zk
      * @date 2023/9/1
      **/

+ 4 - 2
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/controller/enterpriseApp/AppWayBillController.java

@@ -30,9 +30,11 @@ public class AppWayBillController {
      */
     @Valid
     @RequestMapping(name = "APP运单统计分类", value = "/waybillStatistic", method = RequestMethod.GET)
-    public HttpResult waybillStatistic(@RequestParam("keyword") String keyword) {
+    public HttpResult waybillStatistic(@RequestParam("keyword") String keyword,
+                                       @RequestParam("startDate") String startDate,
+                                       @RequestParam("endDate") String endDate) {
         try {
-            return waybillManagementService.waybillDataStatisticApp(keyword);
+            return waybillManagementService.waybillDataStatisticApp(keyword, startDate, endDate);
         } catch (Exception e) {
             log.error("APP运单统计分类:订单id {},error {} ", keyword, e.getMessage(), e);
             return HttpResult.error(HttpStatus.GLOBAL_EXCEPTION_CODE, e.getMessage());

+ 6 - 1
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/dao/KwtWaybillOrderMapper.java

@@ -130,7 +130,12 @@ public interface KwtWaybillOrderMapper extends BaseMapper<KwtWaybillOrder> {
      * @param statuses 查询状态
      * @return
      */
-    Long selectWaybillOrderCountByStatus(@Param("entId") Long entId, @Param("statuses") List<Long> statuses, @Param("keyword") String keyword);
+    Long selectWaybillOrderCountByStatus(
+            @Param("entId") Long entId,
+            @Param("statuses") List<Long> statuses,
+            @Param("keyword") String keyword,
+            @Param("startDate") String startDate,
+            @Param("endDate") String endDate);
 
     Map<String,Object> selectOrderByOrderId(@Param("orderId") Long orderId, @Param("type") Integer type, @Param("statusList") List<Long> statusList);
 

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

@@ -46,13 +46,13 @@ public class WaybillListAppDTO {
      * 查询开始时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date startDate;
+    private String startDate;
 
     /**
      * 查询结束时间
      */
     @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
-    private Date endDate;
+    private String endDate;
 
     /**
      * 物流订单单号

+ 11 - 5
sckw-modules/sckw-transport/src/main/java/com/sckw/transport/service/WaybillManagementService.java

@@ -816,15 +816,21 @@ public class WaybillManagementService {
      * @param keyword
      * @return
      */
-    public HttpResult waybillDataStatisticApp(String keyword) {
+    public HttpResult waybillDataStatisticApp(String keyword, String startDate, String endDate) {
         Long entId = LoginUserHolder.getEntId();
+        if(StringUtils.isNotBlank(startDate)) {
+            startDate = startDate.concat(" 00:00:00");
+        }
+        if(StringUtils.isNotBlank(endDate)) {
+            endDate = endDate.concat(" 00:00:00");
+        }
         // 运输途中
         Map<String, String> _onway = new HashMap<>();
         _onway.put("name", "运输中");
         _onway.put("value", "onway");
         _onway.put("total", "0");
         List<Long> onWayStates = getWallBillStatues("onway");
-        Long onWayCount = kwtWaybillOrderMapper.selectWaybillOrderCountByStatus(entId, onWayStates, keyword);
+        Long onWayCount = kwtWaybillOrderMapper.selectWaybillOrderCountByStatus(entId, onWayStates, keyword, null, null);
         _onway.put("total", onWayCount.toString());
         // 已完成
         Map<String, String> _finish = new HashMap<>();
@@ -832,7 +838,7 @@ public class WaybillManagementService {
         _finish.put("value", "finish");
         _finish.put("total", "0");
         List<Long> finishStates = getWallBillStatues("finish");
-        Long finishCount = kwtWaybillOrderMapper.selectWaybillOrderCountByStatus(entId, finishStates, keyword);
+        Long finishCount = kwtWaybillOrderMapper.selectWaybillOrderCountByStatus(entId, finishStates, keyword, startDate, endDate);
         _finish.put("total", finishCount.toString());
         List<Map<String, String>> _list = new ArrayList<>();
         _list.add(_onway);
@@ -952,8 +958,8 @@ public class WaybillManagementService {
                 LoginUserHolder.getEntId(),
                 _statuses,
                 query.getKeyword(),
-                query.getStartDate() == null ? null : query.getStartDate().toString().concat(" 00:00:00"),
-                query.getEndDate() == null ? null : query.getEndDate().toString().concat(" 23:59:59")
+                StringUtils.isBlank(query.getStartDate()) ? null : query.getStartDate().concat(" 00:00:00"),
+                StringUtils.isBlank(query.getEndDate()) ? null : query.getEndDate().concat(" 23:59:59")
         );
         return HttpResult.ok(amount);
     }