| @@ -58,7 +58,7 @@ public class WxCouponChannelController extends BaseController { | |||||
| }); | }); | ||||
| } | } | ||||
| return new ResultData(); | |||||
| return new ResultData(page); | |||||
| } | } | ||||
| } | } | ||||
| @@ -4,6 +4,8 @@ import com.iformall.common.ErrorCode; | |||||
| import com.iformall.common.ResultData; | import com.iformall.common.ResultData; | ||||
| import com.iformall.domain.po.WxCouponChannel; | import com.iformall.domain.po.WxCouponChannel; | ||||
| import com.iformall.domain.vo.WxCouponCVo; | import com.iformall.domain.vo.WxCouponCVo; | ||||
| import com.iformall.enums.EnumCouponChannelActivityStatus; | |||||
| import com.iformall.enums.EnumCouponChannelType; | |||||
| import com.iformall.service.WxCouponChannelService; | import com.iformall.service.WxCouponChannelService; | ||||
| import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
| @@ -18,6 +20,8 @@ import org.springframework.web.bind.annotation.GetMapping; | |||||
| import org.springframework.web.bind.annotation.RequestMapping; | import org.springframework.web.bind.annotation.RequestMapping; | ||||
| import org.springframework.web.bind.annotation.RestController; | import org.springframework.web.bind.annotation.RestController; | ||||
| import java.util.Date; | |||||
| @RestController | @RestController | ||||
| @RequestMapping("/api/wxCoupon") | @RequestMapping("/api/wxCoupon") | ||||
| @Api(description = "券类型相关接口") | @Api(description = "券类型相关接口") | ||||
| @@ -48,6 +52,19 @@ public class WxCouponController extends BaseController { | |||||
| if (wxCouponCVo == null) | if (wxCouponCVo == null) | ||||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | return new ResultData(ErrorCode.COUPON_IS_EMPTY); | ||||
| if (wxCouponCVo.getTargetAd()!= null && | |||||
| wxCouponCVo.getTargetAd().equals(EnumCouponChannelType.COUPON_CHANNEL_ID_TIMED.getCode())) { | |||||
| Date now = new Date(); | |||||
| if (wxCouponCVo.getBeginTime().getTime() > now.getTime()) { | |||||
| wxCouponCVo.setActivityStatus(EnumCouponChannelActivityStatus.PREPARED.getCode()); | |||||
| } else if (wxCouponCVo.getEndTime().getTime() < now.getTime()) { | |||||
| wxCouponCVo.setActivityStatus(EnumCouponChannelActivityStatus.ENDED.getCode()); | |||||
| } else { | |||||
| wxCouponCVo.setActivityStatus(EnumCouponChannelActivityStatus.STARTED.getCode()); | |||||
| } | |||||
| } | |||||
| return new ResultData(wxCouponCVo); | return new ResultData(wxCouponCVo); | ||||
| } | } | ||||
| @@ -40,9 +40,6 @@ public class WxCouponChannel implements Serializable { | |||||
| this.ids = ids; | this.ids = ids; | ||||
| } | } | ||||
| @Transient | |||||
| private Integer activityStatus; | |||||
| @Transient | @Transient | ||||
| private Date startdate; | private Date startdate; | ||||
| @@ -100,13 +97,6 @@ public class WxCouponChannel implements Serializable { | |||||
| @io.swagger.annotations.ApiModelProperty(value="子频道ID",name="subTargetId") | @io.swagger.annotations.ApiModelProperty(value="子频道ID",name="subTargetId") | ||||
| private Long subTargetId; | private Long subTargetId; | ||||
| public Integer getActivityStatus() { | |||||
| return activityStatus; | |||||
| } | |||||
| public void setActivityStatus(Integer activityStatus) { | |||||
| this.activityStatus = activityStatus; | |||||
| } | |||||
| public String getTenantId() { | public String getTenantId() { | ||||
| return tenantId; | return tenantId; | ||||
| @@ -34,6 +34,19 @@ public class WxCouponCVo extends WxCoupon implements Serializable { | |||||
| @Transient | @Transient | ||||
| private String priceStr; | private String priceStr; | ||||
| @Transient | |||||
| private Integer activityStatus; | |||||
| public Integer getActivityStatus() { | |||||
| return activityStatus; | |||||
| } | |||||
| public void setActivityStatus(Integer activityStatus) { | |||||
| this.activityStatus = activityStatus; | |||||
| } | |||||
| /*券ID**/ | /*券ID**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="券ID",name="couponId") | @io.swagger.annotations.ApiModelProperty(value="券ID",name="couponId") | ||||
| private Long couponId; | private Long couponId; | ||||
| @@ -15,6 +15,19 @@ import java.util.List; | |||||
| public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | ||||
| private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
| @Transient | |||||
| private Integer activityStatus; | |||||
| public Integer getActivityStatus() { | |||||
| return activityStatus; | |||||
| } | |||||
| public void setActivityStatus(Integer activityStatus) { | |||||
| this.activityStatus = activityStatus; | |||||
| } | |||||
| /*总库存**/ | /*总库存**/ | ||||
| @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | ||||
| private Integer inventory; | private Integer inventory; | ||||
| @@ -74,6 +87,8 @@ public class WxCouponChannelVo extends WxCouponChannel implements Serializable { | |||||
| private Integer pressLimitNum; | private Integer pressLimitNum; | ||||
| public Integer getGameWeight() { | public Integer getGameWeight() { | ||||
| return gameWeight; | return gameWeight; | ||||
| } | } | ||||