Commit d721e71e authored by hezhen's avatar hezhen

123

parent 28a380fa
......@@ -119,13 +119,12 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
log.error("----参数不能为空");
return ObjectRestResponse.createFailedResult(ResultCode.NULL_CODE,"参数不能为空");
}
List<UserCouponVo> list=new ArrayList<>();
if (amout.compareTo(new BigDecimal("0.00"))>0){
Long time=System.currentTimeMillis();
list=mapper.getUserCouponsByType(userId,type,time,channel);
List<UserCouponVo> list=mapper.getUserCouponsByType(userId,type,time,channel);
if(list.size()>0){
for (UserCouponVo couponVo:list){
Integer status=2;
if (amout.compareTo(new BigDecimal("0.00"))>0){
if(couponVo.getType()==1){
if (amout.compareTo(couponVo.getWithAmount())>=0){
status=1;
......@@ -133,13 +132,12 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
}else if (couponVo.getType()==3){
status=1;
}
}
couponVo.setStatus(status);
}
list.sort(Comparator.comparing(UserCouponVo::getStatus));
}
}
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