xucaiqin před 1 měsícem
rodič
revize
bbc5876f7e

+ 1 - 1
sckw-modules/sckw-order/src/main/java/com/sckw/order/controller/KwoTradeOrderController.java

@@ -96,7 +96,7 @@ public class KwoTradeOrderController {
     /**
      * 门户贸易订单下单
      */
-//    @GlobalTransactional(name = "default_tx_group")
+    @GlobalTransactional(name = "default_tx_group")
     @RepeatSubmit(interval = 1000, message = "前方拥堵,请稍后尝试")
     @PostMapping(value = "/addOrder", produces = MediaType.APPLICATION_JSON_VALUE)
     @Operation(summary = "门户贸易订单下单", description = "门户贸易订单下单")

+ 10 - 7
sckw-modules/sckw-order/src/main/java/com/sckw/order/serivce/KwoTradeOrderService.java

@@ -2205,10 +2205,10 @@ public class KwoTradeOrderService {
         kwoTradeOrderUnitService.insertBatch(list);
 
         //扣减库存
-        HttpResult updateResult = goodsInfoService.updateGoodsAmount(tradeOrderParam.getGoodsId(), tradeOrderParam.getAmount());
-        if (!Objects.equals(HttpStatus.SUCCESS_CODE, updateResult.getCode())) {
-            throw new BusinessException(updateResult.getMsg());
-        }
+//        HttpResult updateResult = goodsInfoService.updateGoodsAmount(tradeOrderParam.getGoodsId(), tradeOrderParam.getAmount());
+//        if (!Objects.equals(HttpStatus.SUCCESS_CODE, updateResult.getCode())) {
+//            throw new BusinessException(updateResult.getMsg());
+//        }
     }
 
     private TradeContractResDto checkPara(TradeOrderParam tradeOrderParam, KwoTradeOrder order, KwpGoods goodsById) {
@@ -2284,8 +2284,10 @@ public class KwoTradeOrderService {
         if (unitMap.keySet().size() < 2) {
             throw new BusinessException("贸易订单企业信息缺失");
         }
-        TradeContractResDto tradeContractResDto = remoteContractService.queryTradeContract(tradeOrderAuditParam.getTradeContractId(), tradeOrderAuditParam.getGoodsId());
-
+        TradeContractResDto tradeContractResDto = remoteContractService.queryTradeContract(tradeOrderAuditParam.getTradeContractId(), byOrderId.getGoodsId());
+        if (Objects.isNull(tradeContractResDto)) {
+            throw new BusinessException("贸易合同不存在");
+        }
         List<LogisticsEntDto> logisticsContractId = tradeOrderAuditParam.getLogisticsContractList();
         if (Objects.equals(tradeContractResDto.getConsignment(), 2) && CollUtil.isEmpty(logisticsContractId)) {
             throw new BusinessException("卖方托运时,物流合同不能为空");
@@ -2454,7 +2456,8 @@ public class KwoTradeOrderService {
             addLogisticOrderParam.setUnloadCityName(unloadAddress.getCityName());
             addLogisticOrderParam.setUnLoadDetailAddress(unloadAddress.getDetailAddress());
         }
-
+        addLogisticOrderParam.setEntId(LoginUserHolder.getEntId());
+        addLogisticOrderParam.setUserId(LoginUserHolder.getUserId());
         log.info("创建物流订单:{}", JSONObject.toJSONString(addLogisticOrderParam));
         transportRemoteService.addLogisticOrder(addLogisticOrderParam);
         return true;

+ 4 - 0
sckw-modules/sckw-product/src/main/java/com/sckw/product/model/vo/res/GoodsDetailVo.java

@@ -174,7 +174,11 @@ public class GoodsDetailVo {
      */
     @Schema(description = "状态label")
     private String statusLabel;
+    @Schema(description = "签约价")
+    private BigDecimal signPrice;
 
+    @Schema(description = "是否签约")
+    private boolean signFlag;
     @Schema(description = "供应商信息")
     private GoodsEntInfo goodsEntInfo;
 

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

@@ -304,7 +304,15 @@ public class KwpGoodsService {
             addressInfo.setTypeName(CollectionUtils.isNotEmpty(addressMap) ? addressMap.get(addressInfo.getType()) : null);
         }
         detail.setImages(images).setPrice(price).setGoodsEntInfo(goodsEntInfo).setAttributes(attributes).setAddressInfo(addressInfo);
-
+        Long entId = LoginUserHolder.getEntId();
+        detail.setSignFlag(false);
+        if (Objects.nonNull(entId)) {
+            TradeContractGoodsDto tradeContractResDto = remoteContractService.queryTradeContractNew(entId, id,LocalDateTime.now());
+            if (Objects.nonNull(tradeContractResDto)) {
+                detail.setSignPrice(tradeContractResDto.getPrice());
+                detail.setSignFlag(true);
+            }
+        }
         return detail;
     }