Преглед изворни кода

feat:叮当销售制单-金额调整

caoliqin пре 2 недеља
родитељ
комит
76c0294fa1

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderCreateParam.java

@@ -70,4 +70,7 @@ public class FsStoreOrderCreateParam implements Serializable
 
     //关联Id
     private Long associatedId;
+
+    // (叮当国医)自定义总价
+    private BigDecimal totalPrice;
 }

+ 1 - 0
fs-service/src/main/java/com/fs/hisStore/param/FsStoreOrderCreateUserParam.java

@@ -32,4 +32,5 @@ public class FsStoreOrderCreateUserParam implements Serializable
     private BigDecimal amount; //货到付款代收金额
     private Integer orderType; //订单类型
     private Integer orderMedium; //媒体来源
+    private BigDecimal totalPrice; // (叮当国医)自定义总价
 }

+ 21 - 5
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -1239,7 +1239,11 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             }
             storeOrder.setCartId(cartIds);
             storeOrder.setTotalNum(Long.parseLong(String.valueOf(carts.size())));
-            storeOrder.setTotalPrice(dto.getTotalPrice());
+            if(CloudHostUtils.hasCloudHostName("叮当国医")){
+                storeOrder.setTotalPrice(param.getTotalPrice());
+            } else {
+                storeOrder.setTotalPrice(dto.getTotalPrice());
+            }
             storeOrder.setTotalPostage(dto.getPayPostage());
 
             //优惠券处理
@@ -1292,8 +1296,14 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
 
             //后台制单处理
             if (param.getPayPrice() != null && param.getPayPrice().compareTo(BigDecimal.ZERO) > 0) {
-                if (param.getPayPrice().compareTo(dto.getTotalPrice()) > 0) {
-                    return R.error("改价价格不能大于商品总价");
+                if(CloudHostUtils.hasCloudHostName("叮当国医")){
+                    if (param.getPayPrice().compareTo(param.getTotalPrice()) > 0) {
+                        return R.error("改价价格不能大于商品总价");
+                    }
+                } else {
+                    if (param.getPayPrice().compareTo(dto.getTotalPrice()) > 0) {
+                        return R.error("改价价格不能大于商品总价");
+                    }
                 }
                 storeOrder.setPayPrice(param.getPayPrice());
             } else {
@@ -1318,8 +1328,13 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                 BigDecimal amount = param.getAmount();  //货到付款 自定义代收金额
                 if (amount != null && amount.compareTo(BigDecimal.ZERO) > 0) {
                     storeOrder.setStatus(0);
-                    storeOrder.setPayMoney(amount);
-                    storeOrder.setPayDelivery(storeOrder.getPayPrice().subtract(amount));
+                    if(CloudHostUtils.hasCloudHostName("叮当国医")){
+                        storeOrder.setPayMoney(param.getPayPrice());
+                        storeOrder.setPayDelivery(amount);
+                    } else {
+                        storeOrder.setPayMoney(amount);
+                        storeOrder.setPayDelivery(storeOrder.getPayPrice().subtract(amount));
+                    }
                 } else {
                     storeOrder.setStatus(1);
                 }
@@ -2524,6 +2539,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
             createParam.setOrderCreateType(3); //后台制单
             createParam.setOrderType(param.getOrderType());
             createParam.setOrderMedium(param.getOrderMedium()); //后台制单
+            createParam.setTotalPrice(param.getTotalPrice());
             return this.createOrder(param.getUserId(), createParam);
         } else {
             throw new CustomException("创建失败");