diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java index d706137fe..3fbd8a563 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java @@ -11,15 +11,15 @@ import java.io.Serializable; @Table(name = "wx_coupon") public class WxCoupon implements Serializable { private static final long serialVersionUID = 1L; - + @Id - protected Long id; - - @Transient - protected List ids; - @Transient - protected String sortColumns; - + protected Long id; + + @Transient + protected List ids; + @Transient + protected String sortColumns; + public Long getId() { return id; } @@ -27,20 +27,21 @@ public class WxCoupon implements Serializable { public void setId(Long id) { this.id = id; } - + public String getSortColumns() { return sortColumns; } - - public List getIds() { + + public List getIds() { return ids; } - public void setIds(List ids) { + + public void setIds(List ids) { this.ids = ids; } - - - + + + /*租户ID**/ @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") private String tenantId; @@ -61,10 +62,10 @@ public class WxCoupon implements Serializable { private String subTitle; /*售价(适用于类型2,3,4,5)**/ @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") - private BigDecimal salePrice; + private Integer salePrice; /*使用条件金额(适用于类型1,2,3,4)**/ @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") - private BigDecimal usePrice; + private Integer usePrice; /*限领张数**/ @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") private Integer useLimitQuantity; @@ -97,7 +98,7 @@ public class WxCoupon implements Serializable { private String detail; /*面额**/ @io.swagger.annotations.ApiModelProperty(value="面额",name="price") - private BigDecimal price; + private Integer price; /*剩余库存**/ @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") private Integer remainInventory; @@ -107,8 +108,8 @@ public class WxCoupon implements Serializable { /*购买须知**/ @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") private String remark; - /*状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)**/ - @io.swagger.annotations.ApiModelProperty(value="状态(0:草稿,1:待生效,2:已生效,3:已失效,4:已作废)",name="status") + /*状态(-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") @@ -119,7 +120,6 @@ public class WxCoupon implements Serializable { /*业态**/ @io.swagger.annotations.ApiModelProperty(value="业态",name="business") private String business; - public String getTenantId() { return tenantId; } @@ -156,16 +156,16 @@ public class WxCoupon implements Serializable { public void setSubTitle(String _subTitle) { subTitle = _subTitle; } - public BigDecimal getSalePrice() { + public Integer getSalePrice() { return salePrice; } - public void setSalePrice(BigDecimal _salePrice) { + public void setSalePrice(Integer _salePrice) { salePrice = _salePrice; } - public BigDecimal getUsePrice() { + public Integer getUsePrice() { return usePrice; } - public void setUsePrice(BigDecimal _usePrice) { + public void setUsePrice(Integer _usePrice) { usePrice = _usePrice; } public Integer getUseLimitQuantity() { @@ -228,10 +228,10 @@ public class WxCoupon implements Serializable { public void setDetail(String _detail) { detail = _detail; } - public BigDecimal getPrice() { + public Integer getPrice() { return price; } - public void setPrice(BigDecimal _price) { + public void setPrice(Integer _price) { price = _price; } public Integer getRemainInventory() { @@ -282,33 +282,33 @@ public class WxCoupon implements Serializable { public static enum Field { Id_ASC("`id` ASC"),Id_DESC("`id` 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") - ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` 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") - ; + ,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") + ,TargetAd_ASC("`targetAd` ASC"),TargetAd_DESC("`targetAd` 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; @@ -324,8 +324,8 @@ public class WxCoupon implements Serializable { return this.getValue(); } } - - public void setSortColumns(Field... fields) + + public void setSortColumns(WxCoupon.Field... fields) { if (fields == null || fields.length == 0) { return; @@ -340,9 +340,9 @@ public class WxCoupon implements Serializable { sb.append(","); sb.append(fields[k].toString()); } - + } - + public void setSortColumns(String sortColumns) { if (sortColumns == null || "".equals(sortColumns.trim())) { @@ -350,7 +350,7 @@ public class WxCoupon implements Serializable { } if (sortColumns.contains(",")) { String[] cols = sortColumns.split(","); - List fList = new ArrayList(); + java.util.List fList = new java.util.ArrayList(); for (int k = 0; k < cols.length; k++) { fList.add(Field.valueOf(cols[k])); } diff --git a/mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java b/mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java index e3389bc10..e00fd00f9 100644 --- a/mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java +++ b/mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java @@ -32,171 +32,142 @@ public class WxCouponOrder implements Serializable { return sortColumns; } - public List getIds() { + public List getIds() { return ids; } - public void setIds(List ids) { + public void setIds(List ids) { this.ids = ids; } + + /***/ - @io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId") + @io.swagger.annotations.ApiModelProperty(value="",name="tenantId") private Long tenantId; /*单张券ID**/ - @io.swagger.annotations.ApiModelProperty(value = "单张券ID", name = "couponId") + @io.swagger.annotations.ApiModelProperty(value="单张券ID",name="couponId") private Long couponId; /*c端用户id**/ - @io.swagger.annotations.ApiModelProperty(value = "c端用户id", name = "cUserId") + @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") private Long cUserId; /*操作券B端小程序用户ID**/ - @io.swagger.annotations.ApiModelProperty(value = "操作券B端小程序用户ID", name = "bUserId") + @io.swagger.annotations.ApiModelProperty(value="操作券B端小程序用户ID",name="bUserId") private Long bUserId; /*用户订单ID**/ - @io.swagger.annotations.ApiModelProperty(value = "用户订单ID", name = "orderId") + @io.swagger.annotations.ApiModelProperty(value="用户订单ID",name="orderId") private Long orderId; - /*该订单对应券的实际过期时间**/ - @io.swagger.annotations.ApiModelProperty(value = "该订单对应券的实际过期时间", name = "expiredTime") + /*该订单对应券的实际过期时间 +**/ + @io.swagger.annotations.ApiModelProperty(value="该订单对应券的实际过期时间 ",name="expiredTime") private Date expiredTime; /*状态:0,待使用 1,已核销 2,已过期 3,已作废 **/ - @io.swagger.annotations.ApiModelProperty(value = "状态:0,待使用 1,已核销 2,已过期 3,已作废 ", name = "couponOrderStatus") + @io.swagger.annotations.ApiModelProperty(value="状态:0,待使用 1,已核销 2,已过期 3,已作废 ",name="couponOrderStatus") private Integer couponOrderStatus; /***/ - @io.swagger.annotations.ApiModelProperty(value = "", name = "createDate") + @io.swagger.annotations.ApiModelProperty(value="",name="createDate") private Date createDate; /***/ - @io.swagger.annotations.ApiModelProperty(value = "", name = "updateDate") + @io.swagger.annotations.ApiModelProperty(value="",name="updateDate") private Date updateDate; /*单券实际购买价格**/ - @io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice") - private BigDecimal couponPrice; - - public Long getTenantId() { + @io.swagger.annotations.ApiModelProperty(value="单券实际购买价格",name="couponPrice") + private Integer couponPrice; + public Long getTenantId() { return tenantId; } - public void setTenantId(Long _tenantId) { tenantId = _tenantId; } - - public Long getCouponId() { + public Long getCouponId() { return couponId; } - public void setCouponId(Long _couponId) { couponId = _couponId; } - - public Long getCUserId() { + public Long getCUserId() { return cUserId; } - public void setCUserId(Long _cUserId) { cUserId = _cUserId; } - - public Long getBUserId() { + public Long getBUserId() { return bUserId; } - public void setBUserId(Long _bUserId) { bUserId = _bUserId; } - - public Long getOrderId() { + public Long getOrderId() { return orderId; } - public void setOrderId(Long _orderId) { orderId = _orderId; } - - public Date getExpiredTime() { + public Date getExpiredTime() { return expiredTime; } - public void setExpiredTime(Date _expiredTime) { expiredTime = _expiredTime; } - - public Integer getCouponOrderStatus() { + public Integer getCouponOrderStatus() { return couponOrderStatus; } - public void setCouponOrderStatus(Integer _couponOrderStatus) { couponOrderStatus = _couponOrderStatus; } - - public Date getCreateDate() { + public Date getCreateDate() { return createDate; } - public void setCreateDate(Date _createDate) { createDate = _createDate; } - - public Date getUpdateDate() { + public Date getUpdateDate() { return updateDate; } - public void setUpdateDate(Date _updateDate) { updateDate = _updateDate; } - - public BigDecimal getCouponPrice() { + public Integer getCouponPrice() { return couponPrice; } - - public void setCouponPrice(BigDecimal _couponPrice) { + public void setCouponPrice(Integer _couponPrice) { couponPrice = _couponPrice; } - public static enum Field { - CouponOrderId_ASC("`couponOrderId` ASC"), - CouponOrderId_DESC("`couponOrderId` DESC"), - TenantId_ASC("`tenantId` ASC"), - TenantId_DESC("`tenantId` DESC"), - CouponId_ASC("`couponId` ASC"), - CouponId_DESC("`couponId` DESC"), - CUserId_ASC("`cUserId` ASC"), - CUserId_DESC("`cUserId` DESC"), - BUserId_ASC("`bUserId` ASC"), - BUserId_DESC("`bUserId` DESC"), - OrderId_ASC("`orderId` ASC"), - OrderId_DESC("`orderId` DESC"), - ExpiredTime_ASC("`expiredTime` ASC"), - ExpiredTime_DESC("`expiredTime` DESC"), - CouponOrderStatus_ASC("`couponOrderStatus` ASC"), - CouponOrderStatus_DESC("`couponOrderStatus` DESC"), - CreateDate_ASC("`createDate` ASC"), - CreateDate_DESC("`createDate` DESC"), - UpdateDate_ASC("`updateDate` ASC"), - UpdateDate_DESC("`updateDate` DESC"), - CouponPrice_ASC("`couponPrice` ASC"), - CouponPrice_DESC("`couponPrice` DESC"); + public static enum Field + { + Id_ASC("`id` ASC"),Id_DESC("`id` DESC") + ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") + ,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC") + ,CUserId_ASC("`cUserId` ASC"),CUserId_DESC("`cUserId` DESC") + ,BUserId_ASC("`bUserId` ASC"),BUserId_DESC("`bUserId` DESC") + ,OrderId_ASC("`orderId` ASC"),OrderId_DESC("`orderId` DESC") + ,ExpiredTime_ASC("`expiredTime` ASC"),ExpiredTime_DESC("`expiredTime` DESC") + ,CouponOrderStatus_ASC("`couponOrderStatus` ASC"),CouponOrderStatus_DESC("`couponOrderStatus` DESC") + ,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC") + ,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC") + ,CouponPrice_ASC("`couponPrice` ASC"),CouponPrice_DESC("`couponPrice` DESC") + ; private String value; - - Field(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(WxCouponOrder.Field... fields) { + public void setSortColumns(WxCouponOrder.Field... fields) + { if (fields == null || fields.length == 0) { return; } @@ -213,7 +184,8 @@ public class WxCouponOrder implements Serializable { } - public void setSortColumns(String sortColumns) { + public void setSortColumns(String sortColumns) + { if (sortColumns == null || "".equals(sortColumns.trim())) { return; } diff --git a/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java b/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java index 6bef8144c..a0c8168d1 100644 --- a/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java +++ b/mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java @@ -6,7 +6,7 @@ import com.simple.domain.vo.CouponListReq; import org.apache.ibatis.annotations.Param; import com.simple.domain.po.WxCoupon; -public interface WxCouponMapper extends CommonMapper { +public interface WxCouponMapper extends CommonMapper { List findList(WxCoupon wxCoupon); diff --git a/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java b/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java index 28a8fdd7c..817f6956c 100644 --- a/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java +++ b/mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java @@ -3,6 +3,7 @@ import com.simple.domain.dto.WxUserCouponDto; import com.simple.domain.po.WxCoupon; import com.simple.domain.po.WxOrder; import com.simple.mapper.WxCouponMapper; +import com.simple.mapper.WxCouponOrderMapper; import com.simple.service.WxOrderService; import com.simple.service.WxUserCouponService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,7 +21,7 @@ import java.util.stream.Collectors; public class WxUserCouponServiceImpl implements WxUserCouponService { @Autowired - private WxOrderService wxOrderService; + private WxCouponOrderMapper wxCouponOrderMapper; @Autowired private WxCouponMapper wxCouponMapper; diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index 2333e89aa..28aab475c 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -9,8 +9,8 @@ - - + + @@ -21,7 +21,7 @@ - + diff --git a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml index d109c4057..3d7ba0907 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml @@ -12,87 +12,87 @@ - + - + `id`,`tenant_id`,`coupon_id`,`c_user_id`,`b_user_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price` - where 1 = 1 - - - and `id` = #{id} - - - - - and `tenant_id` = #{tenantId} - - - - - and `coupon_id` = #{couponId} - - - - - and `c_user_id` = #{cUserId} - - - - - and `b_user_id` = #{bUserId} - - - - - and `order_id` = #{orderId} - - - - - and `expired_time` = #{expiredTime} - - - - - and `coupon_order_status` = #{couponOrderStatus} - - - - - and `create_date` = #{createDate} - - - - - and `update_date` = #{updateDate} - - - - - and `coupon_price` = #{couponPrice} - - + where 1 = 1 + + + and `id` = #{id} + + + + + and `tenant_id` = #{tenantId} + + + + + and `coupon_id` = #{couponId} + + + + + and `c_user_id` = #{cUserId} + + + + + and `b_user_id` = #{bUserId} + + + + + and `order_id` = #{orderId} + + + + + and `expired_time` = #{expiredTime} + + + + + and `coupon_order_status` = #{couponOrderStatus} + + + + + and `create_date` = #{createDate} + + + + + and `update_date` = #{updateDate} + + + + + and `coupon_price` = #{couponPrice} + + - and id in + and id in - #{idItem} + #{idItem} - + order by ${sortColumns} - + - - - - - - + + + + + +