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

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

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

+ 8 - 6
sckw-modules/sckw-manage/src/main/java/com/sckw/manage/service/KwmCooperateManageService.java

@@ -17,6 +17,7 @@ import com.sckw.core.utils.CollectionUtils;
 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.utils.EasyExcelUtil;
 import com.sckw.manage.dao.KwmCooperateMapper;
 import com.sckw.manage.dao.KwmCooperateTypeMapper;
@@ -40,7 +41,7 @@ import org.apache.dubbo.config.annotation.DubboReference;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
-
+import org.springframework.util.Assert;
 import java.util.*;
 import java.util.stream.Collectors;
 
@@ -190,19 +191,20 @@ public class KwmCooperateManageService {
         Long userId = LoginUserHolder.getUserId();
         Date date = new Date();
         //判断是否可以解除-销售订单
-        Boolean order = tradeOrderInfoService.associateEnt(kwmCooperates.get(0).getEntId());
+        Boolean order = tradeOrderInfoService.associateEnt(kwmCooperates.get(0).getInviteeEntId(),kwmCooperates.get(0).getInviteeEntId());
         if (order)
         {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.MSG_031);
         }
 
         //判断是否可以解除-托运和承运
-        Boolean sport = transportDubboService.checkLogisticsOrderFinishByEntId(kwmCooperates.get(0).getEntId());
-        if (sport)
+        HttpResult response = transportDubboService.checkLogisticsOrderIsFinishByEntId(kwmCooperates.get(0).getInviteeEntId(),kwmCooperates.get(0).getInviteeEntId());
+        Object receivedResult = response.getData();
+        if (receivedResult !=  null)
         {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.MSG_031);
         }
-        Map<OrderEnum, List<String>> ledgerMap = paymentDubboService.checkLedger(kwmCooperates.get(0).getEntId());
+        Map<OrderEnum, List<String>> ledgerMap = paymentDubboService.checkLedger(kwmCooperates.get(0).getInviteeEntId(),kwmCooperates.get(0).getInviteeEntId());
         if (!CollectionUtils.isEmpty(ledgerMap.get(OrderEnum.LOGISTICS)))
         {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.MSG_031);
@@ -211,7 +213,7 @@ public class KwmCooperateManageService {
         {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.MSG_031);
         }
-        Map<OrderEnum,List<String>> settlementMap= paymentDubboService.checkSettlement(kwmCooperates.get(0).getEntId());
+        Map<OrderEnum,List<String>> settlementMap= paymentDubboService.checkSettlement(kwmCooperates.get(0).getInviteeEntId(),kwmCooperates.get(0).getInviteeEntId());
         if (!CollectionUtils.isEmpty(settlementMap.get(OrderEnum.LOGISTICS)))
         {
             throw new SystemException(HttpStatus.CRUD_FAIL_CODE, HttpStatus.MSG_031);

+ 0 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/PurchaseOrderDraftParam.java

@@ -32,12 +32,10 @@ public class PurchaseOrderDraftParam {
     /**
      * 订单总量
      */
-    @DecimalMin(value = "0.01",message = "订单总量必须大于零")
     private BigDecimal amount;
     /**
      * 订单金额
      */
-    @DecimalMin(value = "0.01",message = "订单金额必须大于零")
     private BigDecimal price;
 
     /**

+ 0 - 2
sckw-modules/sckw-order/src/main/java/com/sckw/order/model/vo/req/UpdateOrderParam.java

@@ -44,13 +44,11 @@ public class UpdateOrderParam {
     /**
      * 订单总量
      */
-    @DecimalMin(value = "0.01",message = "订单总量必须大于零")
     private BigDecimal amount;
 
     /**
      * 订单金额
      */
-    @DecimalMin(value = "0.01",message = "订单金额必须大于零")
     private BigDecimal price;
 
     /**

+ 4 - 16
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -614,11 +614,11 @@ public class KwoTradeOrderService {
 
 
     private void checkParams(UpdateOrderParam param, String source) {
-        if (Objects.isNull(param.getAmount())) {
-            throw new BusinessException("订单总量不能为空!");
+        if (Objects.isNull(param.getAmount()) || param.getAmount().compareTo(BigDecimal.ZERO) <= 0) {
+            throw new BusinessException("订单总量不能为空且必须大于零!");
         }
-        if (Objects.isNull(param.getPrice())) {
-            throw new BusinessException("订单金额不能为空!");
+        if (Objects.isNull(param.getPrice()) || param.getPrice().compareTo(BigDecimal.ZERO) <= 0) {
+            throw new BusinessException("订单金额不能为空且必须大于零!");
         }
         if (StringUtils.isBlank(param.getTrading())) {
             throw new BusinessException("交易方式不能为空!");
@@ -643,18 +643,6 @@ public class KwoTradeOrderService {
             if (Objects.isNull(contractInfo.getContractId())) {
                 throw new BusinessException("合同id不能为空!");
             }
-            if (StringUtils.isBlank(contractInfo.getContractNo())) {
-                throw new BusinessException("合同编号不能为空!");
-            }
-            if (StringUtils.isBlank(contractInfo.getContractName())) {
-                throw new BusinessException("合同名称不能为空!");
-            }
-            if (StringUtils.isBlank(contractInfo.getContractSigningWay())) {
-                throw new BusinessException("合同签约方式不能为空!");
-            }
-            if (StringUtils.isBlank(contractInfo.getContractStatus())) {
-                throw new BusinessException("合同状态不能为空!");
-            }
         }
         GoodsInfo goodsInfo = param.getGoodsInfo();
         if (Objects.isNull(goodsInfo)) {