Ver Fonte

fix(coupon):修正立减金类型验证逻辑与状态查询条件

- 修改立减金类型判断逻辑,使用参数中的couponType进行校验
- 调整普通优惠券状态查询条件,支持状态0、1、2
- 更新立减金状态查询条件,支持状态0、4
xw há 3 semanas atrás
pai
commit
40e5b5172a

+ 2 - 2
fs-service/src/main/java/com/fs/hisStore/mapper/FsStoreCouponUserScrmMapper.java

@@ -86,7 +86,7 @@ public interface FsStoreCouponUserScrmMapper
     List<FsStoreCouponUserScrm> selectFsStoreCouponUserListByEnable(@Param("maps")FsCouponUserEnableParam param);
     @Select({"<script> " +
             "select cu.*,u.nickname,u.phone from fs_store_coupon_user_scrm cu inner join fs_user u  on u.user_id=cu.user_id inner join fs_store_coupon_scrm c on c.coupon_id = cu.coupon_id  " +
-            "where  cu.is_del=0 and c.type!=3 and cu.status=0 and cu.limit_time &gt; now() " +
+            "where  cu.is_del=0 and c.type!=3 and cu.status in (0,1,2) and cu.limit_time &gt; now() " +
             "<if test = 'maps.status != null     '> " +
             "and cu.status =#{maps.status} " +
             "</if>" +
@@ -141,7 +141,7 @@ public interface FsStoreCouponUserScrmMapper
 
     @Select({"<script> " +
             "select cu.*,u.nickname,u.phone from fs_store_coupon_user_scrm cu inner join fs_user u  on u.user_id=cu.user_id inner join fs_store_coupon_scrm c on c.coupon_id = cu.coupon_id   " +
-            "where  cu.is_del=0 and c.type=3 and cu.status=0  " +
+            "where  cu.is_del=0 and c.type=3 and cu.status in (0,4)  " +
             "<if test = 'maps.status != null     '> " +
             "and cu.status =#{maps.status} " +
             "</if>" +

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

@@ -429,7 +429,7 @@ public class FsStoreCouponIssueScrmServiceImpl implements IFsStoreCouponIssueScr
             }
 
             // 验证立减金类型
-            if (couponUser.getCouponType() == null || couponUser.getCouponType() != 3) {
+            if (param.getCouponType() == null || param.getCouponType() != 3) {
                 return R.error("该记录不是立减金");
             }