...
|
...
|
@@ -133,7 +133,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
|
if(null == req.getId()){
|
|
|
req.setCouponToken(UUID.randomUUID().toString());
|
|
|
req.setCreateTime(DateUtil.getCurrentTimeSecond());
|
|
|
req.setStatus(Coupon.CouponStatusEnum.WAITE_CHECK.getValue());
|
|
|
req.setStatus(Coupon.CouponStatusEnum.IN_EFFECT.getValue());
|
|
|
couponMapper.insertByCouponSaveUpdateReq(req);
|
|
|
}else{
|
|
|
couponMapper.updateByCouponSaveUpdateReq(req);
|
...
|
...
|
@@ -243,9 +243,24 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
|
String useTime = com.yoho.ufo.util.DateUtil.int2DateStr(coupon.getStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+
|
|
|
com.yoho.ufo.util.DateUtil.int2DateStr(coupon.getEndTime(),"yyyy-MM-dd HH:mm:ss");
|
|
|
CouponQueryResp resp = new CouponQueryResp(coupon.getId(),coupon.getCouponName(),coupon.getCouponNum(),
|
|
|
useTime,coupon.getRemark(), Coupon.CouponStatusEnum.getKey(coupon.getStatus()),coupon.getStatus());
|
|
|
useTime,coupon.getRemark(), getStatusDesc(coupon),coupon.getStatus());
|
|
|
resps.add(resp);
|
|
|
}
|
|
|
return resps;
|
|
|
}
|
|
|
|
|
|
private String getStatusDesc(Coupon coupon){
|
|
|
if(Coupon.CouponStatusEnum.INVALID.getValue()!=coupon.getStatus()){
|
|
|
return Coupon.CouponStatusEnum.INVALID.getKey();
|
|
|
}
|
|
|
//0:未生效,1:生效中,2:已过期
|
|
|
int curTime = DateUtil.getCurrentTimeSecond();
|
|
|
if(coupon.getStartTime()>curTime){
|
|
|
return "未生效";
|
|
|
}
|
|
|
if(coupon.getEndTime()>=curTime){
|
|
|
return "生效中";
|
|
|
}
|
|
|
return "已过期";
|
|
|
}
|
|
|
} |
...
|
...
|
|