浏览代码

修复代码提交冲突

Eric 3 年之前
父节点
当前提交
cde78f8e00

+ 2 - 1
cooleshow-user/user-admin/src/main/java/com/yonge/cooleshow/admin/io/request/coupon/CouponInfoVO.java

@@ -70,7 +70,8 @@ public class CouponInfoVO {
 
         public String getName() {
 
-            return Optional.ofNullable(this.name).filter(x -> !x.matches(MK.EXP_INT)).orElse(null);
+            return Optional.ofNullable(this.name)
+                    .filter(x -> StringUtils.isNotEmpty(x) && !x.matches(MK.EXP_INT)).orElse(null);
         }
 
         public Long getCouponId() {

+ 6 - 3
cooleshow-user/user-biz/src/main/java/com/yonge/cooleshow/biz/dal/service/impl/CouponIssueServiceImp.java

@@ -28,6 +28,7 @@ import com.yonge.cooleshow.common.enums.EStatus;
 import com.yonge.toolset.base.exception.BizException;
 import com.yonge.toolset.thirdparty.message.MessageSenderPluginContext;
 import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
 import org.joda.time.DateTime;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -77,9 +78,11 @@ public class CouponIssueServiceImp extends ServiceImpl<CouponIssueMapper, Coupon
 
         // 优惠券过期状态
         couponIssueWrappers = couponIssueWrappers.stream()
-                .peek(couponIssueWrapper -> {
-                    if (couponIssueWrapper.getEndTime().compareTo(query.getExpiredTime()) <0) {
-                        couponIssueWrapper.setUseState(CouponUseStateEnum.EXPIRED);
+                .peek(x -> {
+                    if (StringUtils.isEmpty(x.getOrderNo())
+                            && CouponUseStateEnum.WITHDRAW != x.getUseState()
+                            && x.getEndTime().compareTo(query.getExpiredTime()) <0) {
+                        x.setUseState(CouponUseStateEnum.EXPIRED);
                     }
                 }).collect(Collectors.toList());
 

+ 1 - 1
cooleshow-user/user-biz/src/main/resources/config/mybatis/CouponInfoMapper.xml

@@ -49,7 +49,7 @@
             <if test="record.category != null">
                 AND t1.category_ = #{record.category}
             </if>
-            <if test="record.status">
+            <if test="record.status != null">
                 AND t1.status_ = #{record.status}
             </if>
             <if test="record.timestamp != null">