Authored by csgyoho

Merge branch 'dev-resources-20181116' into test6.8.2

... ... @@ -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 "已过期";
}
}
... ...
... ... @@ -28,8 +28,8 @@ public class Coupon implements Serializable {
/**商品限制条件-特定商品*/
public static final int PRODUCTLIMITTYPE_SPECIALPRODUCT = 1;
public enum CouponStatusEnum {
//0:未生效,1:生效中,2:已过期,3:已作废
WAITE_CHECK(0,"未生效"),IN_EFFECT(1,"生效中"),REVIEW_REJECTION(2,"已过期"),INVALID(3,"已作废");
//0:待审核,1:有效,2:审核驳回,3:作废
WAITE_CHECK(0,"待审核"),IN_EFFECT(1,"有效"),REVIEW_REJECTION(2,"审核驳回"),INVALID(3,"已作废");
private int value;
private String key;
... ...