diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java index 06199f77c..342a64f68 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxCampaignController.java @@ -112,7 +112,7 @@ public class WxCampaignController extends BaseController { wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); wxCouponChannel.setSubTargetId(wxCampaign.getId()); wxCouponChannel.setStatus(EnumCampaignStatus.STATUS_THROW_IN.getCode()); - List couponList = wxCouponChannelService.listAPI(wxCouponChannel); + List couponList = wxCouponChannelService.listVo(wxCouponChannel); wxCampaign.setCoupons(couponList); } return new ResultData(Result.SUCCESS, "查询成功", wxCampaign); diff --git a/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponChannelController.java index 474c6b5a3..863dfea50 100644 --- a/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkAdmin/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -52,7 +52,7 @@ public class WxCouponChannelController extends BaseController { } wxCouponChannel.setTenantId(getUser().getTenantId()); wxCouponChannel.setSortColumns(WxCouponChannel.Field.Id_DESC); - final PageInfo page = wxCouponChannelService.listPageCAPI(wxCouponChannel, pageNum, pageSize); + final PageInfo page = wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize); return new ResultData(page); } diff --git a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java index ad3cb9e2b..38d7f3a2b 100644 --- a/mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java +++ b/mallinkBApi/src/main/java/com/iformall/controller/WxCouponOrderController.java @@ -28,8 +28,6 @@ public class WxCouponOrderController extends BaseController { @Autowired private WxCouponOrderService wxCouponOrderService; - - @ApiOperation("分页列表接口") @GetMapping("list") @ApiImplicitParams({ @@ -93,8 +91,7 @@ public class WxCouponOrderController extends BaseController { @ApiImplicitParams({ @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "string", paramType = "query", required = true) }) - public ResultData detail(String couponOrderId) { - + public ResultData detail(String couponOrderId) { if(couponOrderId == null) { return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCampaignController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCampaignController.java index b8b66ae58..fccbd1f77 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCampaignController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCampaignController.java @@ -66,7 +66,7 @@ public class WxCampaignController extends BaseController { wxCouponChannel.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_CAMPAIN.getCode()); wxCouponChannel.setSubTargetId(wxCampaign.getId()); wxCouponChannel.setStatus(0); - List couponList = wxCouponChannelService.listAPI(wxCouponChannel); + List couponList = wxCouponChannelService.listVo(wxCouponChannel); wxCampaign.setCoupons(couponList); } return new ResultData(Result.SUCCESS, "查询成功", wxCampaign); diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java index 2a728e600..d8bf0aad8 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponChannelController.java @@ -27,8 +27,6 @@ public class WxCouponChannelController extends BaseController { @Autowired private WxCouponChannelService wxCouponChannelService; - - @ApiOperation("分页列表接口") @GetMapping("list") @ApiImplicitParams({ @@ -40,7 +38,7 @@ public class WxCouponChannelController extends BaseController { wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); wxCouponChannel.setSortColumns(WxCouponChannel.Field.CreateDate_DESC); - return new ResultData(wxCouponChannelService.listPageCAPI(wxCouponChannel, pageNum, pageSize)); + return new ResultData(wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize)); } } diff --git a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java index d2edad140..f51dc32ad 100644 --- a/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java +++ b/mallinkCApi/src/main/java/com/iformall/controller/WxCouponController.java @@ -2,10 +2,10 @@ package com.iformall.controller; import com.iformall.common.ErrorCode; import com.iformall.common.ResultData; -import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.vo.WxCouponCVo; -import com.iformall.service.WxCouponService; +import com.iformall.service.WxCouponChannelService; + import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -25,7 +25,7 @@ public class WxCouponController extends BaseController { private final Logger logger = LoggerFactory.getLogger(this.getClass()); @Autowired - private WxCouponService wxCouponService; + private WxCouponChannelService wxCouponChannelService; @ApiOperation("根据id(couponChannel)查询接口") @@ -46,7 +46,7 @@ public class WxCouponController extends BaseController { WxCouponChannel wxCouponChannel = new WxCouponChannel(); wxCouponChannel.setId(couponChannelIdL); wxCouponChannel.setTenantId(getTenantId()); - WxCouponCVo wxCouponCVo = wxCouponService.selectDetailForCUser(wxCouponChannel); + WxCouponCVo wxCouponCVo = wxCouponChannelService.findDetailVo(wxCouponChannel); if (wxCouponCVo == null) return new ResultData(ErrorCode.COUPON_IS_EMPTY); diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponCVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponCVo.java index ccc04333d..bd0e34f6a 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponCVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponCVo.java @@ -1,5 +1,6 @@ package com.iformall.domain.vo; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.iformall.domain.po.WxCoupon; import javax.persistence.Id; @@ -9,19 +10,14 @@ import java.math.BigDecimal; import java.text.DecimalFormat; import java.util.Date; import java.util.List; - -public class WxCouponCVo implements Serializable { +@JsonIgnoreProperties(value = {"handler"}) +public class WxCouponCVo extends WxCoupon implements Serializable { private static final long serialVersionUID = 1L; /*投放券频道id**/ @Id protected Long id; - @Transient - protected List ids; - @Transient - protected String sortColumns; - public Long getId() { return id; } @@ -30,19 +26,6 @@ public class WxCouponCVo implements Serializable { this.id = id; } - public String getSortColumns() { - return sortColumns; - } - - public List getIds() { - return ids; - } - - public void setIds(List ids) { - this.ids = ids; - } - - @Transient private String salePriceStr; @@ -52,12 +35,14 @@ public class WxCouponCVo implements Serializable { @Transient private String priceStr; - + /*券ID**/ + @io.swagger.annotations.ApiModelProperty(value="券ID",name="couponId") + private Long couponId; + /*投放频道位置(1.列表, 2.限时抢购)**/ + @io.swagger.annotations.ApiModelProperty(value="投放频道位置(1.列表, 2.限时抢购)",name="targetAd") + private Integer targetAd; /*发放相关参数*/ - /*卡券id**/ - @io.swagger.annotations.ApiModelProperty(value="卡券id",name="couponId") - private Long couponId; /*开始时间**/ @io.swagger.annotations.ApiModelProperty(value="开始时间",name="beginTime") private Date beginTime; @@ -66,355 +51,50 @@ public class WxCouponCVo implements Serializable { private Date endTime; - /*租户ID**/ - @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") - private String tenantId; - /*商户id**/ - @io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId") - private Long merchantId; - /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ - @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") - private Integer type; - /*封面图**/ - @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") - private String coverImg; - /*券名称**/ - @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") - private String title; - /*副标题**/ - @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") - private String subTitle; - /*售价(适用于类型2,3,4,5)**/ - @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") - private Integer salePrice; - /*使用条件金额(适用于类型1,2,3,4)**/ - @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") - private Integer usePrice; - /*限领张数**/ - @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") - private Integer useLimitQuantity; - /*1.主动领取2.定向投放**/ - @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") - private Integer sendType; - /*发放开始时间**/ - @io.swagger.annotations.ApiModelProperty(value="发放开始时间",name="sendStartDate") - private Date sendStartDate; - /*发放结束时间**/ - @io.swagger.annotations.ApiModelProperty(value="发放结束时间",name="sendEndDate") - private Date sendEndDate; - /*有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)**/ - @io.swagger.annotations.ApiModelProperty(value="有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)",name="validType") - private Integer validType; - /*有效日期-开始**/ - @io.swagger.annotations.ApiModelProperty(value="有效日期-开始",name="validStartDate") - private Date validStartDate; - /*有效日期-结束**/ - @io.swagger.annotations.ApiModelProperty(value="有效日期-结束",name="validEndDate") - private Date validEndDate; - /*自领取之日几日有效,(停车券当天有效)**/ - @io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效,(停车券当天有效)",name="validDays") - private Integer validDays; - /*须知**/ - @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") - private String detail; - /*面额**/ - @io.swagger.annotations.ApiModelProperty(value="面额",name="price") - private Integer price; - /*单位**/ - @io.swagger.annotations.ApiModelProperty(value="单位0:钱分,1:小时",name="unit") - private Integer unit; - /*剩余库存**/ - @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") - private Integer remainInventory; - /*总库存**/ - @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") - private Integer inventory; - /*购买须知**/ - @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") - private String remark; - /*状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)**/ - @io.swagger.annotations.ApiModelProperty(value="状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)",name="status") - private Integer status; - /*创建时间**/ - @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") - private Date createDate; - /*更新时间**/ - @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") - private Date updateDate; - /*业态**/ - @io.swagger.annotations.ApiModelProperty(value="业态",name="business") - private Integer business; - - /*发券商户信息*/ - /*商户图片**/ - @io.swagger.annotations.ApiModelProperty(value="商户图片",name="imgUrl") - private String merchantImgUrl; - /*商户名**/ - @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") - private String merchantName; - /*联系方式**/ - @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") - private String merchantLinkPhone; - /*商户状态**/ - @io.swagger.annotations.ApiModelProperty(value="商户状态1可用0停用",name="status") - private Integer merchantStatus; - - - /*地址**/ - @io.swagger.annotations.ApiModelProperty(value="地址",name="addr") - private String addr; - /*百度poi(省市区县street等)**/ - @io.swagger.annotations.ApiModelProperty(value="百度poi(省市区县street等)",name="baiduPoi") - private String baiduPoi; - /*商铺编号**/ - @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") - private String shopNumber; - /*楼座号**/ - @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") - private String buildingName; - /*楼层号**/ - @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") - private String floorName; - + @io.swagger.annotations.ApiModelProperty(value="商户列表",name="merchantVoList") + private List merchantVoList; - public Date getBeginTime() { - return beginTime; - } - public void setBeginTime(Date _beginTime) { - beginTime = _beginTime; - } - public Date getEndTime() { - return endTime; - } - public void setEndTime(Date _endTime) { - endTime = _endTime; - } - public Long getCouponId() { + public Long getCouponId() { return couponId; } - public void setCouponId(Long _couponId) { - couponId = _couponId; - } - public String getTenantId() { - return tenantId; - } - public void setTenantId(String _tenantId) { - tenantId = _tenantId; - } - public Long getMerchantId() { - return merchantId; - } - public void setMerchantId(Long _merchantId) { - merchantId = _merchantId; - } - public Integer getType() { - return type; - } - public void setType(Integer _type) { - type = _type; - } - public String getCoverImg() { - return coverImg; - } - public void setCoverImg(String _coverImg) { - coverImg = _coverImg; - } - public String getTitle() { - return title; - } - public void setTitle(String _title) { - title = _title; - } - public String getSubTitle() { - return subTitle; - } - public void setSubTitle(String _subTitle) { - subTitle = _subTitle; - } - public Integer getSalePrice() { - return salePrice; - } - public void setSalePrice(Integer _salePrice) { - salePrice = _salePrice; - } - public Integer getUsePrice() { - return usePrice; - } - public void setUsePrice(Integer _usePrice) { - usePrice = _usePrice; - } - public Integer getUseLimitQuantity() { - return useLimitQuantity; - } - public void setUseLimitQuantity(Integer _useLimitQuantity) { - useLimitQuantity = _useLimitQuantity; - } - public Integer getSendType() { - return sendType; - } - public void setSendType(Integer _sendType) { - sendType = _sendType; - } - public Date getSendStartDate() { - return sendStartDate; - } - public void setSendStartDate(Date _sendStartDate) { - sendStartDate = _sendStartDate; - } - public Date getSendEndDate() { - return sendEndDate; - } - public void setSendEndDate(Date _sendEndDate) { - sendEndDate = _sendEndDate; - } - public Integer getValidType() { - return validType; - } - public void setValidType(Integer _validType) { - validType = _validType; - } - public Date getValidStartDate() { - return validStartDate; - } - public void setValidStartDate(Date _validStartDate) { - validStartDate = _validStartDate; - } - public Date getValidEndDate() { - return validEndDate; - } - public void setValidEndDate(Date _validEndDate) { - validEndDate = _validEndDate; - } - public Integer getValidDays() { - return validDays; - } - public void setValidDays(Integer _validDays) { - validDays = _validDays; - } - public String getDetail() { - return detail; - } - public void setDetail(String _detail) { - detail = _detail; - } - public Integer getPrice() { - return price; - } - public void setPrice(Integer _price) { - price = _price; + public void setCouponId(Long couponId) { + this.couponId = couponId; } - public Integer getUnit() { - return unit; + public Integer getTargetAd() { + return targetAd; } - public void setUnit(Integer unit) { - this.unit = unit; + public void setTargetAd(Integer targetAd) { + this.targetAd = targetAd; } - public Integer getRemainInventory() { - return remainInventory; - } - public void setRemainInventory(Integer _remainInventory) { - remainInventory = _remainInventory; - } - public Integer getInventory() { - return inventory; - } - public void setInventory(Integer _inventory) { - inventory = _inventory; - } - public String getRemark() { - return remark; - } - public void setRemark(String _remark) { - remark = _remark; - } - public Integer getStatus() { - return status; - } - public void setStatus(Integer _status) { - status = _status; - } - public Date getCreateDate() { - return createDate; - } - public void setCreateDate(Date _createDate) { - createDate = _createDate; - } - public Date getUpdateDate() { - return updateDate; - } - public void setUpdateDate(Date _updateDate) { - updateDate = _updateDate; - } - public Integer getBusiness() { - return business; - } - public void setBusiness(Integer _business) { - business = _business; + public List getMerchantVoList() { + return merchantVoList; } - - public String getBuildingName() {return buildingName; } - public void setBuildingName(String _building) { - buildingName = _building; - } - public String getFloorName() { - return floorName; - } - public void setFloorName(String _floor) { - floorName = _floor; - } - public String getShopNumber() { - return shopNumber; - } - public void setShopNumber(String _shopNumber) { - shopNumber = _shopNumber; - } - public String getBaiduPoi() { - return baiduPoi; - } - public void setBaiduPoi(String _baiduPoi) { - baiduPoi = _baiduPoi; - } - public String getAddr() { - return addr; - } - public void setAddr(String _addr) { - addr = _addr; + public void setMerchantVoList(List merchantVoList) { + this.merchantVoList = merchantVoList; } - - public String getMerChantImgUrl() { - return merchantImgUrl; - } - public void setMerChantImgUrl(String _imgUrl) { - merchantImgUrl = _imgUrl; - } - public String getMerchantName() { - return merchantName; - } - public void setMerchantName(String _name) { - merchantName = _name; - } - public String getMerchantLinkPhone() { - return merchantLinkPhone; + public Date getBeginTime() { + return beginTime; } - public void setMerchantLinkPhone(String _linkPhone) { - merchantLinkPhone = _linkPhone; + public void setBeginTime(Date _beginTime) { + beginTime = _beginTime; } - public Integer getMerchantStatus() { - return merchantStatus; + public Date getEndTime() { + return endTime; } - public void setMerchantStatus(Integer status) { - this.merchantStatus = status; + public void setEndTime(Date _endTime) { + endTime = _endTime; } + public String getSalePriceStr() { - if(salePrice!=null) { - salePriceStr = new BigDecimal(salePrice).divide(new BigDecimal(100)).toString(); + if(getSalePrice()!=null) { + salePriceStr = new BigDecimal(getSalePrice()).divide(new BigDecimal(100)).toString(); } return salePriceStr; } @@ -424,8 +104,8 @@ public class WxCouponCVo implements Serializable { } public String getUsePriceStr() { - if(usePrice!=null) { - usePriceStr = new BigDecimal(usePrice).divide(new BigDecimal(100)).toString(); + if(getUsePrice()!=null) { + usePriceStr = new BigDecimal(getUsePrice()).divide(new BigDecimal(100)).toString(); } return usePriceStr; } @@ -435,8 +115,8 @@ public class WxCouponCVo implements Serializable { } public String getPriceStr() { - if(price!=null) { - priceStr = new BigDecimal(price).divide(new BigDecimal(100)).toString(); + if(getPrice()!=null) { + priceStr = new BigDecimal(getPrice()).divide(new BigDecimal(100)).toString(); } return priceStr; } @@ -445,84 +125,4 @@ public class WxCouponCVo implements Serializable { this.priceStr = priceStr; } - public static enum Field - { - Id_ASC("`id` ASC"),Id_DESC("`id` DESC") - ,CouponChannelId_ASC("`couponChannelId` ASC"),CouponChannelId_DESC("`couponChannelId` DESC") - ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") - ,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC") - ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") - ,CoverImg_ASC("`coverImg` ASC"),CoverImg_DESC("`coverImg` DESC") - ,Title_ASC("`title` ASC"),Title_DESC("`title` DESC") - ,SubTitle_ASC("`subTitle` ASC"),SubTitle_DESC("`subTitle` DESC") - ,SalePrice_ASC("`salePrice` ASC"),SalePrice_DESC("`salePrice` DESC") - ,UsePrice_ASC("`usePrice` ASC"),UsePrice_DESC("`usePrice` DESC") - ,UseLimitQuantity_ASC("`useLimitQuantity` ASC"),UseLimitQuantity_DESC("`useLimitQuantity` DESC") - ,SendType_ASC("`sendType` ASC"),SendType_DESC("`sendType` DESC") - ,SendStartDate_ASC("`sendStartDate` ASC"),SendStartDate_DESC("`sendStartDate` DESC") - ,SendEndDate_ASC("`sendEndDate` ASC"),SendEndDate_DESC("`sendEndDate` DESC") - ,ValidType_ASC("`validType` ASC"),ValidType_DESC("`validType` DESC") - ,ValidStartDate_ASC("`validStartDate` ASC"),ValidStartDate_DESC("`validStartDate` DESC") - ,ValidEndDate_ASC("`validEndDate` ASC"),ValidEndDate_DESC("`validEndDate` DESC") - ,ValidDays_ASC("`validDays` ASC"),ValidDays_DESC("`validDays` DESC") - ,Detail_ASC("`detail` ASC"),Detail_DESC("`detail` DESC") - ,Price_ASC("`price` ASC"),Price_DESC("`price` DESC") - ,RemainInventory_ASC("`remainInventory` ASC"),RemainInventory_DESC("`remainInventory` DESC") - ,Inventory_ASC("`inventory` ASC"),Inventory_DESC("`inventory` DESC") - ,Remark_ASC("`remark` ASC"),Remark_DESC("`remark` DESC") - ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") - ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") - ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") - ,Business_ASC("`business` ASC"),Business_DESC("`business` DESC") - ; - private String value; - Field(String value){ - this.value = value; - } - public String getValue() { - return value; - } - public void setCol(String value) { - this.value = value; - } - @Override - public String toString() { - return this.getValue(); - } - } - - public void setSortColumns(WxCoupon.Field... fields) - { - if (fields == null || fields.length == 0) { - return; - } - for (int k = 0; k < fields.length; k++) { - if (fields[k] == null) { - return; - } - } - StringBuilder sb = new StringBuilder(fields[0].toString()); - for (int k = 1; k < fields.length; k++) { - sb.append(","); - sb.append(fields[k].toString()); - } - - } - - public void setSortColumns(String sortColumns) - { - if (sortColumns == null || "".equals(sortColumns.trim())) { - return; - } - if (sortColumns.contains(",")) { - String[] cols = sortColumns.split(","); - List fList = new java.util.ArrayList(); - for (int k = 0; k < cols.length; k++) { - fList.add(WxCoupon.Field.valueOf(cols[k])); - } - this.setSortColumns(fList.toArray(new WxCoupon.Field[fList.size()])); - } else { - this.setSortColumns(WxCoupon.Field.valueOf(sortColumns)); - } - } } diff --git a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java index f1d85e99e..1efbdecb1 100644 --- a/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java +++ b/mallinkService/src/main/java/com/iformall/domain/vo/WxCouponChannelVo.java @@ -1,14 +1,11 @@ package com.iformall.domain.vo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.WxCouponChannel; -import com.iformall.domain.po.WxMerchant; - import javax.persistence.Transient; import java.io.Serializable; import java.math.BigDecimal; -import java.text.DecimalFormat; + import java.util.List; /** diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java index e9fd0fb61..80495bde2 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponChannelMapper.java @@ -2,6 +2,7 @@ package com.iformall.mapper; import java.util.*; import com.iformall.common.CommonMapper; +import com.iformall.domain.vo.WxCouponCVo; import com.iformall.domain.vo.WxCouponChannelVo; import com.iformall.domain.po.WxCouponChannel; @@ -13,6 +14,8 @@ public interface WxCouponChannelMapper extends CommonMapper findVoList(WxCouponChannel wxCouponChannel); + WxCouponCVo findVoDetail(WxCouponChannel wxCouponChannel); + void updateStatusByCouponId(WxCouponChannel wxCouponChannel); void offExpiriedCouponChannelByEndTime(); diff --git a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java index 06e2f2d55..c0e226976 100644 --- a/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/iformall/mapper/WxCouponMapper.java @@ -11,10 +11,9 @@ public interface WxCouponMapper extends CommonMapper { List findList(WxCoupon wxCoupon); - WxCouponCVo selectDetailForCUser(WxCouponChannel wxCouponChannel); - void reduceInventory(@Param("id")Long id,@Param("number")Integer number); void offExpiriedCouponByValidDate(); + void offExpiriedCouponByMerchantStatus(); } diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java index ccfdaee5e..4b28ff43d 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponChannelService.java @@ -3,6 +3,7 @@ package com.iformall.service; import com.github.pagehelper.PageInfo; import com.iformall.common.ResultData; import com.iformall.domain.po.WxCouponChannel; +import com.iformall.domain.vo.WxCouponCVo; import com.iformall.domain.vo.WxCouponChannelVo; import java.util.Date; @@ -28,7 +29,9 @@ public interface WxCouponChannelService { * @param pageSize * @return */ - PageInfo listPageCAPI(WxCouponChannel record, Integer pageIndex, Integer pageSize); + PageInfo listPageCVo(WxCouponChannel record, Integer pageIndex, Integer pageSize); + + WxCouponCVo findDetailVo(WxCouponChannel record); /** * 根据实体查询Vo分页列表 @@ -36,7 +39,7 @@ public interface WxCouponChannelService { * @param record * @return */ - List listAPI(WxCouponChannel record); + List listVo(WxCouponChannel record); /** * 根据Id获得实体 diff --git a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java index 99cd5a2f0..dc475f580 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxCouponService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxCouponService.java @@ -49,8 +49,6 @@ public interface WxCouponService { */ void deleteById(Long id); - WxCouponCVo selectDetailForCUser(WxCouponChannel record); - ResultData updateCoupon(WxCoupon wxCoupon); void reduceInventory(Long id,Integer number); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java index 98811669a..3c04c2156 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponChannelServiceImpl.java @@ -11,6 +11,7 @@ import com.iformall.common.ResultData; import com.iformall.domain.po.WxCoupon; import com.iformall.domain.po.WxCouponChannel; import com.iformall.domain.po.WxMerchant; +import com.iformall.domain.vo.WxCouponCVo; import com.iformall.domain.vo.WxCouponChannelAddVo; import com.iformall.domain.vo.WxCouponChannelVo; import com.iformall.enums.EnumCouponChannelStatus; @@ -129,7 +130,6 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { return vo; } - if(wxCoupon.getStatus()!=EnumCouponStatus.COUPON_STATUS_THROW_IN.getCode()) { logger.debug(wxCoupon.getId()+couponid+ErrorCode.COUPON_IS_TAKE_OFF.getMessage()); vo.toCouponChannnelVo(wxCoupon,channelId); @@ -191,20 +191,19 @@ public class WxCouponChannelServiceImpl implements WxCouponChannelService { * @return */ @Override - public PageInfo listPageCAPI(WxCouponChannel record, Integer pageIndex, Integer pageSize) { - List wxCouponChannelVoList = new ArrayList<>(); + public PageInfo listPageCVo(WxCouponChannel record, Integer pageIndex, Integer pageSize) { PageHelper.startPage(pageIndex, pageSize); + return new PageInfo<>(wxCouponChannelMapper.findVoList(record)); + } - wxCouponChannelVoList = wxCouponChannelMapper.findVoList(record); - - return new PageInfo<>(wxCouponChannelVoList); + @Override + public WxCouponCVo findDetailVo(WxCouponChannel record) { + return wxCouponChannelMapper.findVoDetail(record); } @Override - public List listAPI(WxCouponChannel record) { - List wxCouponChannelVoList = new ArrayList<>(); + public List listVo(WxCouponChannel record) { return wxCouponChannelMapper.findVoList(record); - } } diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java index 74ae9d1ed..6881a0a92 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCouponServiceImpl.java @@ -176,11 +176,7 @@ public class WxCouponServiceImpl implements WxCouponService { public void deleteById(Long id) { wxCouponMapper.deleteByPrimaryKey(id); } - - @Override - public WxCouponCVo selectDetailForCUser(WxCouponChannel record) { - return wxCouponMapper.selectDetailForCUser(record); - } + @Override @Transactional diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java index f872845ec..a1b1d2b83 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxGameServiceImpl.java @@ -83,7 +83,7 @@ public class WxGameServiceImpl implements WxGameService { couponChannelQ.setTargetAd(EnumCouponChannelType.COUPON_CHANNEL_ID_GAME.getCode()); couponChannelQ.setSubTargetId(record.getId()); couponChannelQ.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); - List wxCouponChannelVos = wxCouponChannelService.listAPI(couponChannelQ); + List wxCouponChannelVos = wxCouponChannelService.listVo(couponChannelQ); Map wxCouponChannelsMap = new HashMap(); for(WxCouponChannelVo wxCouponChannelVo: wxCouponChannelVos) { wxCouponChannelsMap.put(wxCouponChannelVo.getCouponId(), wxCouponChannelVo); diff --git a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml index c769b6611..8b76d4ff4 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponChannelMapper.xml @@ -100,7 +100,7 @@ update wx_coupon_channel set status=#{status} where tenant_id=#{tenantId} and coupon_id=#{couponId} - + , c.remain_inventory,c.inventory,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.price,c.unit,c.use_limit_quantity,c.send_type @@ -136,14 +136,66 @@ - + + + cc.id,cc.coupon_id,cc.target_ad,cc.begin_time,cc.end_time, + c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select @@ -153,86 +147,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - c.tenant_id,c.merchant_id,c.type,c.cover_img,c.title,c.sub_title,c.sale_price,c.use_price,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.valid_days,c.detail,c.price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.create_date,c.update_date,c.business, - m.img_url,m.name,m.link_phone,m.status, - s.addr,s.shop_number,s.baidu_poi, - mb.building_name,mf.floor_name, - cc.id,cc.coupon_id,cc.target_ad,cc.begin_time,cc.end_time - - - - - - update wx_coupon SET remain_inventory = remain_inventory - #{number} where id = #{id} and remain_inventory>= #{number}