Ver Fonte

1.商城小程序制单赠品不计算金额 2.完善商城订单推送ERP定时任务

wjj há 3 dias atrás
pai
commit
290b3c4ce7

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

@@ -1027,7 +1027,7 @@ public interface FsStoreOrderScrmMapper
 
     List<FsStoreOrderScrm> selectFsStoreOrderStatisticsByUserId(@Param("ids") List<Long> ids);
 
-    @Select("select id from fs_store_order_scrm WHERE `status`= 1  and  extend_order_id is null ")
+    @Select("select id from fs_store_order_scrm WHERE `status`= 1  and  extend_order_id is null and handle_collection_id is not null ")
     List<Long> selectFsStoreOrderNoCreateOms();
 
     @Select("select * from fs_store_order_scrm where status = 1 and extend_order_id is not null and delivery_id is null ")

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreProductScrmMapper.java

@@ -197,6 +197,9 @@ public interface FsStoreProductScrmMapper
             "<if test = 'maps.storeId != null'> " +
             "and p.store_id = #{maps.storeId}" +
             "</if>" +
+            "<if test = 'maps.isGift != null'> " +
+            "and p.is_gift = #{maps.isGift}" +
+            "</if>" +
             "<if test = 'maps.defaultOrder != null and maps.defaultOrder==\"desc\"  '> " +
             "order by p.sort desc,product_id desc" +
             "</if>" +

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

@@ -24,6 +24,9 @@ public class FsStoreProductQueryParam extends BaseQueryParam implements Serializ
     @ApiModelProperty(value = "1 只显示商城展示的商品 0展示所有")
     private Integer isDisplay=1;
 
+    @ApiModelProperty(value = "是否赠品")
+    private Integer isGift;
+
     // token 需用户端传入
     private String token;
     // 用户企业ID

+ 7 - 2
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -2871,7 +2871,9 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         //计算总价
         BigDecimal totalMoney = BigDecimal.ZERO;
         for (FsStoreCartQueryVO vo : carts) {
-            totalMoney = totalMoney.add(vo.getPrice().multiply(new BigDecimal(vo.getCartNum().toString())));
+            if (vo.getType().equals("product")) {
+                totalMoney = totalMoney.add(vo.getPrice().multiply(new BigDecimal(vo.getCartNum().toString())));
+            }
         }
         redisCache.setCacheObject("createOrderMoney:" + uuid, totalMoney, 120, TimeUnit.DAYS);
         return R.ok().put("orderKey", uuid).put("carts", carts);
@@ -2911,6 +2913,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                     .isPay(0)
                     .isDel(0)
                     .isBuy(1)
+                    .type(vo.getType())
                     .changePrice(vo.getPrice())
                     .build();
             storeCart.setCreateTime(new Date());
@@ -4368,7 +4371,7 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
         if(order.getCompanyCustomerId() != null) {
             user = userService.selectFsUserById(param.getUserId());
         } else {
-            userService.selectFsUserById(order.getUserId());
+            user = userService.selectFsUserById(order.getUserId());
 
         }
         if(user!=null){
@@ -4393,12 +4396,14 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
                         order.setPayDelivery(order.getPayPrice().subtract(payMoney));
                         order.setPayMoney(payMoney);
                     }else {
+                        //客户信息制单走这儿
                         order.setPayMoney(order.getPayPrice());
                         order.setPayDelivery(order.getTotalPrice().subtract(order.getPayMoney()));
                     }
 
                 }
                 else if(param.getPayType().equals(3)){
+                    //小程序制单物流走这儿
                     //货到付款
                     order.setPayType("3");
                     BigDecimal amount=redisCache.getCacheObject("orderAmount:"+order.getId());

+ 2 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreCartVO.java

@@ -38,4 +38,6 @@ import java.math.BigDecimal;
     private Integer stock;
 
     private Integer productType;
+
+    private String type;
 }

+ 3 - 0
fs-service/src/main/java/com/fs/hisStore/vo/FsStoreProductListQueryVO.java

@@ -61,6 +61,9 @@ public class FsStoreProductListQueryVO implements Serializable
 
     private Long storeId;
 
+    //是否赠品
+    private Integer isGift;
+