瀏覽代碼

1.修改益寿缘商城制单新增支付类型业务 2.修复益寿缘商城购物车查询BUG 3.益寿缘商城计算订单金额新增支付类型 4.益寿缘商城创建订单新增支付类型

wjj 1 月之前
父節點
當前提交
83260498ce

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCartScrmMapper.java

@@ -85,7 +85,7 @@ public interface FsStoreCartScrmMapper
             "</if>" +
             "and c.user_id= #{uid} " +
             "</script>"})
-    List<FsStoreCartVO> selectFsStoreCartListByUid(long uid,@Param("config") MedicalMallConfig config);
+    List<FsStoreCartVO> selectFsStoreCartListByUid(@Param("uid") long uid,@Param("config") MedicalMallConfig config);
     @Delete({"<script>"+
             "delete from fs_store_cart_scrm where id in"+
            "<foreach collection='array' item='id' open='(' separator=',' close=')'>#{id}</foreach>"+

+ 33 - 25
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -227,13 +227,13 @@ public interface FsStoreProductScrmMapper
             "select p.* from fs_store_product_scrm p  " +
             //新增审核状态及所属店铺审核状态
             "<if test='config.isAudit == \"1\" '>" +
-            "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
+            " inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
             "</if>" +
-            "where p.is_del=0 and p.is_show=1  " +
+            " where p.is_del=0 and p.is_show=1  " +
             "<if test='config.isAudit == \"1\" '>" +
-            "and p.is_audit = '1'" +
+            " and p.is_audit = '1' " +
             "</if>" +
-            "and p.product_id=#{productId} " +
+            " and p.product_id=#{productId} " +
             "</script>"})
     FsStoreProductQueryVO selectFsStoreProductByIdQuery(@Param("productId") Long productId, @Param("storeId") String storeId, @Param("config") MedicalMallConfig config);
     @Update("update fs_store_product_scrm set stock=stock-#{num}, sales=sales+#{num}" +
@@ -242,50 +242,58 @@ public interface FsStoreProductScrmMapper
     @Update("update fs_store_product_scrm set stock=stock+#{num}, sales=sales-#{num}" +
             " where product_id=#{productId}")
     int incStockDecSales( @Param("num")Long num, @Param("productId")Long productId);
-    @Select("select p.* from fs_store_product_scrm p " +
+    @Select({"<script> " +
+            "select p.* from fs_store_product_scrm p " +
             //新增审核状态及所属店铺审核状态
             "<if test='config.isAudit == \"1\" '>" +
             "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
             "</if>" +
-            "where p.is_del=0 and p.is_show=1 " +
+            " where p.is_del=0 and p.is_show=1 " +
             "<if test='config.isAudit == \"1\" '>" +
-            "and p.is_audit = '1'  " +
+            " and p.is_audit = '1'  " +
             "</if>" +
-            "and  p.is_new=1 and p.is_display=1 order by p.sort desc limit #{count}")
-    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(int count,@Param("config") MedicalMallConfig  config);
-    @Select("select p.* from fs_store_product_scrm p " +
+            " and  p.is_new=1 and p.is_display=1 order by p.sort desc limit #{count} " +
+            "</script>"})
+    List<FsStoreProductListQueryVO> selectFsStoreProductNewQuery(@Param("count")int count,@Param("config") MedicalMallConfig  config);
+    @Select({"<script> " +
+            "select p.* from fs_store_product_scrm p " +
             //新增审核状态及所属店铺审核状态
             "<if test='config.isAudit == \"1\" '>" +
-            "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
+            " inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
             "</if>" +
-            "where p.is_del=0 and p.is_show=1 " +
+            " where p.is_del=0 and p.is_show=1 " +
             "<if test='config.isAudit == \"1\" '>" +
-            "and p.is_audit = '1'" +
+            " and p.is_audit = '1' " +
             "</if>" +
-            "and  p.is_hot=1 and p.is_display=1 order by p.sort desc limit #{count}")
-    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(int count,@Param("config") MedicalMallConfig  config);
-    @Select("select p.* from fs_store_product_scrm p " +
+            "and  p.is_hot=1 and p.is_display=1 order by p.sort desc limit #{count}" +
+            "</script>"})
+    List<FsStoreProductListQueryVO> selectFsStoreProductHotQuery(@Param("count") int count,@Param("config") MedicalMallConfig  config);
+    @Select({"<script> " +
+            "select p.* from fs_store_product_scrm p " +
             //新增审核状态及所属店铺审核状态
             "<if test='config.isAudit == \"1\" '>" +
-            "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
+            " inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
             "</if>" +
-            "where p.is_del=0 and p.is_show=1 " +
+            " where p.is_del=0 and p.is_show=1 " +
             "<if test='config.isAudit == \"1\" '>" +
-            "and p.is_audit = '1'" +
+            " and p.is_audit = '1' " +
             "</if>" +
-            "and  p.is_good=1 and p.is_display=1 order by p.sort desc limit #{count}")
+            " and  p.is_good=1 and p.is_display=1 order by p.sort desc limit #{count}" +
+            "</script>"})
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodQuery(int count,@Param("config") MedicalMallConfig  config);
     List<FsStoreProductListQueryVO> selectFsStoreProductTuiListQuery(@Param("config") MedicalMallConfig  config);
-    @Select("select p.* from fs_store_product_scrm p " +
+    @Select({"<script> " +
+            "select p.* from fs_store_product_scrm p " +
             //新增审核状态及所属店铺审核状态
             "<if test='config.isAudit == \"1\" '>" +
-            "inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
+            " inner join fs_store_scrm fs on fs.store_id = p.store_id and fs.is_audit = 1 " +
             "</if>" +
-            "where p.is_del=0 and p.is_show=1 " +
+            " where p.is_del=0 and p.is_show=1 " +
             "<if test='config.isAudit == \"1\" '>" +
-            "and p.is_audit = '1'" +
+            " and p.is_audit = '1' " +
             "</if>" +
-            "and  p.is_good=1 and p.is_display=1 order by p.sort desc")
+            " and  p.is_good=1 and p.is_display=1 order by p.sort desc" +
+            "</script>"})
     List<FsStoreProductListQueryVO> selectFsStoreProductGoodListQuery(@Param("config") MedicalMallConfig  config);
     @Select({"<script> " +
             "select count(1) from fs_store_product_scrm  " +

+ 1 - 1
fs-service/src/main/java/com/fs/hisStore/service/IFsStoreOrderScrmService.java

@@ -179,7 +179,7 @@ public interface IFsStoreOrderScrmService
 
     R addUserCart(long userId, String createOrderKey);
 
-    R updateSalseOrderMoney(String createOrderKey, BigDecimal money,BigDecimal payAmount);
+    R updateSalseOrderMoney(String createOrderKey, BigDecimal money,BigDecimal payAmount,Integer payType);
 
     Integer selectFsStoreOrderCountByType(Long companyId, long userId, int type);
 

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

@@ -499,10 +499,16 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + param.getOrderKey());
         BigDecimal payPrice = getOrderSumPrice(carts, "truePrice");
         if (StringUtils.isNotEmpty(param.getCreateOrderKey())) {
-            BigDecimal money = redisCache.getCacheObject("createOrderMoney:" + param.getCreateOrderKey());
-            if (money != null) {
-                payPrice = money;
+            Integer payType = redisCache.getCacheObject("createOrderPayType:" + param.getCreateOrderKey());
+            if (payType != null && payType == 3) {
+                payPrice = redisCache.getCacheObject("createOrderAmount:" + param.getCreateOrderKey());
+            } else {
+                BigDecimal money = redisCache.getCacheObject("createOrderMoney:" + param.getCreateOrderKey());
+                if (money != null) {
+                    payPrice = money;
+                }
             }
+
         }
         BigDecimal serviceFee = BigDecimal.ZERO;
         String configJson = configService.selectConfigByKey("store.config");
@@ -590,6 +596,10 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         //计算金额
         FsStoreOrderComputeDTO dto = this.computedOrder(userId, computedParam);
         String cartIds = redisCache.getCacheObject("orderKey:" + param.getOrderKey());
+        Integer payType = redisCache.getCacheObject("createOrderPayType:" + param.getCreateOrderKey());
+        if (payType != null) {
+            param.setPayType(payType.toString());
+        }
 //        Integer totalNum = 0;
         BigDecimal integral = BigDecimal.ZERO;
         if (cartIds != null) {
@@ -2236,10 +2246,15 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         String key = redisCache.getCacheObject("createOrderKey:" + createOrderKey);
         List<FsStoreCartQueryVO> carts = redisCache.getCacheObject("orderCarts:" + createOrderKey);
         BigDecimal money = redisCache.getCacheObject("createOrderMoney:" + createOrderKey);
+        Integer payType = redisCache.getCacheObject("createOrderPayType:" + createOrderKey);
+        //展示代收金额
+        if (payType != null && payType == 3) {
+            money = redisCache.getCacheObject("createOrderAmount:" + createOrderKey);
+        }
         if (StringUtils.isEmpty(key)) {
             throw new CustomException("订单已过期", 501);
         }
-        return R.ok().put("carts", carts).put("totalMoney", money);
+        return R.ok().put("carts", carts).put("totalMoney", money).put("payType", payType);
     }
 
     @Override
@@ -2275,7 +2290,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
     }
 
     @Override
-    public R updateSalseOrderMoney(String createOrderKey, BigDecimal money, BigDecimal payAmount) {
+    public R updateSalseOrderMoney(String createOrderKey, BigDecimal money, BigDecimal payAmount,Integer payType) {
         //货到付款自定义金额
         if (payAmount == null) {
             String configJson = configService.selectConfigByKey("store.config");
@@ -2315,6 +2330,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         }
         redisCache.setCacheObject("createOrderMoney:" + createOrderKey, money, 24, TimeUnit.HOURS);
         redisCache.setCacheObject("createOrderAmount:" + createOrderKey, payAmount, 24, TimeUnit.HOURS);//物流代收自定义金额
+        redisCache.setCacheObject("createOrderPayType:" + createOrderKey, payType, 24, TimeUnit.HOURS);//支付类型 1-全付款 3-物流代收(货到付款)
         return R.ok();
     }
 

+ 5 - 1
fs-user-app/src/main/java/com/fs/app/controller/store/CompanyOrderScrmController.java

@@ -88,6 +88,7 @@ public class CompanyOrderScrmController extends AppBaseController {
                                    @RequestParam("createOrderKey")String createOrderKey,
                                    @RequestParam(value = "money",required = false) BigDecimal money,
                                    @RequestParam(value = "payAmount",required = false) BigDecimal payAmount,
+                                   @RequestParam(value = "payType",required = false) Integer payType,
                                    HttpServletRequest request){
         Long userId=redisCache.getCacheObject("company-user-token:"+token);
         if(userId==null){
@@ -96,7 +97,10 @@ public class CompanyOrderScrmController extends AppBaseController {
         if (money == null){
             money = BigDecimal.ZERO;
         }
-        return orderService.updateSalseOrderMoney(createOrderKey,money,payAmount);
+        if (payAmount == null){
+            payAmount = BigDecimal.ZERO;
+        }
+        return orderService.updateSalseOrderMoney(createOrderKey,money,payAmount,payType);
     }
 
     @ApiOperation("商品改价")