Explorar o código

对账确认 ,修改物流订单状态

xucaiqin hai 1 ano
pai
achega
bd456cd159

+ 0 - 1
sckw-modules/sckw-example/src/main/java/com/sckw/example/controller/TestController.java

@@ -2,7 +2,6 @@ package com.sckw.example.controller;
 
 import com.sckw.payment.api.dubbo.PayCenterDubboService;
 import com.sckw.payment.api.dubbo.PaymentDubboService;
-import com.sckw.payment.api.model.constant.ChannelEnum;
 import com.sckw.payment.api.model.dto.MemberDetail;
 import com.sckw.payment.api.model.dto.WalletDto;
 import com.sckw.payment.api.model.dto.common.R;

+ 22 - 3
sckw-modules/sckw-payment/src/main/java/com/sckw/payment/service/KwpLedgerLogisticsService.java

@@ -1,5 +1,7 @@
 package com.sckw.payment.service;
 
+import com.sckw.core.model.enums.LogisticsOrderEnum;
+
 import com.alibaba.fastjson2.JSONObject;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
@@ -15,6 +17,7 @@ import com.sckw.core.utils.CollectionUtils;
 import com.sckw.core.utils.IdWorker;
 import com.sckw.core.utils.OrderGenerateSeqNoUtils;
 import com.sckw.core.utils.StringTimeUtil;
+import com.sckw.core.web.constant.HttpStatus;
 import com.sckw.core.web.context.LoginUserHolder;
 import com.sckw.core.web.response.HttpResult;
 import com.sckw.payment.dao.KwpLedgerLogisticsMapper;
@@ -35,6 +38,7 @@ import com.sckw.system.api.model.dto.res.UserCacheResDto;
 import com.sckw.transport.api.dubbo.TransportRemoteService;
 import com.sckw.transport.api.model.dto.AcceptCarriageLogisticsOrderDto;
 import com.sckw.transport.api.model.dto.AccountCheckingBindDTO;
+import com.sckw.transport.api.model.param.UpdateOrderStatusDto;
 import io.seata.spring.annotation.GlobalTransactional;
 import jakarta.annotation.Resource;
 import lombok.extern.slf4j.Slf4j;
@@ -66,7 +70,6 @@ public class KwpLedgerLogisticsService extends AbsLedger {
     private KwpLedgerLogisticsOrderService logisticsOrderService;
     @Resource
     private MessageSender messageSender;
-
     @Resource
     private KwpLedgerLogisticsMapper logisticsMapper;
     @DubboReference(version = "1.0.0", group = "design", check = false)
@@ -543,6 +546,22 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         KwpLedgerLogisticsUnit logisticsUnit = logisticsUnitService.queryCustomerEnt(confirmReq.getIdLong(), LogisticsUnitType.SHIPPER);
         //承运方
         KwpLedgerLogisticsUnit logisticsUnit2 = logisticsUnitService.queryCustomerEnt(confirmReq.getIdLong(), LogisticsUnitType.CARRIER);
+
+        //5.27 修改物流单状态
+        List<KwpLedgerLogisticsOrder> kwpLedgerLogisticsOrders = logisticsOrderService.queryList(confirmReq.getIdLong());
+        if (CollectionUtils.isNotEmpty(kwpLedgerLogisticsOrders)) {
+            UpdateOrderStatusDto updateOrderStatusDto = new UpdateOrderStatusDto();
+            updateOrderStatusDto.setOrderIds(kwpLedgerLogisticsOrders.stream().map(KwpLedgerLogisticsOrder::getLOrderId).toList());
+            updateOrderStatusDto.setLogisticsOrderStatus(LogisticsOrderEnum.HAVE_RECONCILED);
+            updateOrderStatusDto.setUpdateById(LoginUserHolder.getUserId());
+            updateOrderStatusDto.setUpdateBy(LoginUserHolder.getUserId());
+            updateOrderStatusDto.setUpdateTime(LocalDateTime.now());
+            HttpResult httpResult = transportRemoteService.logisticsOrderInitiateReconciliationUpdateStatus(updateOrderStatusDto);
+            if (!Objects.equals(httpResult.getCode(), HttpStatus.SUCCESS_CODE)) {
+                throw new BusinessException(httpResult.getMsg());
+            }
+        }
+
         //推送创建人
         messageSender.sendCreate(LoginUserHolder.getUserId(), new HashMap<>(Global.NUMERICAL_SIXTEEN) {{
             put("company", logisticsUnit.getFirmName());
@@ -814,8 +833,8 @@ public class KwpLedgerLogisticsService extends AbsLedger {
         return logisticsMapper.selectJoin(entId, entTarget);
     }
 
-    public LedgerSize count(Long entId,List<Long> enterpriseIds) {
-        return logisticsMapper.countSize(entId,enterpriseIds);
+    public LedgerSize count(Long entId, List<Long> enterpriseIds) {
+        return logisticsMapper.countSize(entId, enterpriseIds);
     }
 
     public List<LedgerLogisticsDto> exportList(LogisticsReq logisticsReq, List<Long> idList) {