Commit d721e71e authored by hezhen's avatar hezhen

123

parent 28a380fa
...@@ -119,27 +119,25 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> { ...@@ -119,27 +119,25 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
log.error("----参数不能为空"); log.error("----参数不能为空");
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空"); return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空");
} }
List<UserCouponVo> list=new ArrayList<>(); Long time=System.currentTimeMillis();
if (amout.compareTo(new BigDecimal("0.00"))>0){ List<UserCouponVo> list=mapper.getUserCouponsByType(userId,type,time,channel);
Long time=System.currentTimeMillis(); if(list.size()>0){
list=mapper.getUserCouponsByType(userId,type,time,channel); for (UserCouponVo couponVo:list){
if(list.size()>0){
for (UserCouponVo couponVo:list){
Integer status=2; Integer status=2;
if(couponVo.getType()==1){ if (amout.compareTo(new BigDecimal("0.00"))>0){
if (amout.compareTo(couponVo.getWithAmount())>=0){ if(couponVo.getType()==1){
if (amout.compareTo(couponVo.getWithAmount())>=0){
status=1;
}
}else if (couponVo.getType()==3){
status=1; status=1;
} }
}else if (couponVo.getType()==3){
status=1;
} }
couponVo.setStatus(status);
couponVo.setStatus(status);
}
list.sort(Comparator.comparing(UserCouponVo::getStatus));
} }
list.sort(Comparator.comparing(UserCouponVo::getStatus));
} }
return ObjectRestResponse.succ(list); return ObjectRestResponse.succ(list);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment