|
@@ -133,7 +133,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
@@ -133,7 +133,7 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
133
|
if(null == req.getId()){
|
133
|
if(null == req.getId()){
|
134
|
req.setCouponToken(UUID.randomUUID().toString());
|
134
|
req.setCouponToken(UUID.randomUUID().toString());
|
135
|
req.setCreateTime(DateUtil.getCurrentTimeSecond());
|
135
|
req.setCreateTime(DateUtil.getCurrentTimeSecond());
|
136
|
- req.setStatus(Coupon.CouponStatusEnum.WAITE_CHECK.getValue());
|
136
|
+ req.setStatus(Coupon.CouponStatusEnum.IN_EFFECT.getValue());
|
137
|
couponMapper.insertByCouponSaveUpdateReq(req);
|
137
|
couponMapper.insertByCouponSaveUpdateReq(req);
|
138
|
}else{
|
138
|
}else{
|
139
|
couponMapper.updateByCouponSaveUpdateReq(req);
|
139
|
couponMapper.updateByCouponSaveUpdateReq(req);
|
|
@@ -243,9 +243,24 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
|
@@ -243,9 +243,24 @@ public class CouponServiceImpl implements ICouponService,IBusinessExportService{ |
243
|
String useTime = com.yoho.ufo.util.DateUtil.int2DateStr(coupon.getStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+
|
243
|
String useTime = com.yoho.ufo.util.DateUtil.int2DateStr(coupon.getStartTime(),"yyyy-MM-dd HH:mm:ss")+"至"+
|
244
|
com.yoho.ufo.util.DateUtil.int2DateStr(coupon.getEndTime(),"yyyy-MM-dd HH:mm:ss");
|
244
|
com.yoho.ufo.util.DateUtil.int2DateStr(coupon.getEndTime(),"yyyy-MM-dd HH:mm:ss");
|
245
|
CouponQueryResp resp = new CouponQueryResp(coupon.getId(),coupon.getCouponName(),coupon.getCouponNum(),
|
245
|
CouponQueryResp resp = new CouponQueryResp(coupon.getId(),coupon.getCouponName(),coupon.getCouponNum(),
|
246
|
- useTime,coupon.getRemark(), Coupon.CouponStatusEnum.getKey(coupon.getStatus()),coupon.getStatus());
|
246
|
+ useTime,coupon.getRemark(), getStatusDesc(coupon),coupon.getStatus());
|
247
|
resps.add(resp);
|
247
|
resps.add(resp);
|
248
|
}
|
248
|
}
|
249
|
return resps;
|
249
|
return resps;
|
250
|
}
|
250
|
}
|
|
|
251
|
+
|
|
|
252
|
+ private String getStatusDesc(Coupon coupon){
|
|
|
253
|
+ if(Coupon.CouponStatusEnum.INVALID.getValue()!=coupon.getStatus()){
|
|
|
254
|
+ return Coupon.CouponStatusEnum.INVALID.getKey();
|
|
|
255
|
+ }
|
|
|
256
|
+ //0:未生效,1:生效中,2:已过期
|
|
|
257
|
+ int curTime = DateUtil.getCurrentTimeSecond();
|
|
|
258
|
+ if(coupon.getStartTime()>curTime){
|
|
|
259
|
+ return "未生效";
|
|
|
260
|
+ }
|
|
|
261
|
+ if(coupon.getEndTime()>=curTime){
|
|
|
262
|
+ return "生效中";
|
|
|
263
|
+ }
|
|
|
264
|
+ return "已过期";
|
|
|
265
|
+ }
|
251
|
} |
266
|
} |