Просмотр исходного кода

支付金额改为integer,以分为单位

release_toaliyun_real
Stormeye.Wu 7 лет назад
Родитель
Сommit
fd77ce3afc
5 измененных файлов: 190 добавлений и 180 удалений
  1. +36
    -36
      mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java
  2. +84
    -75
      mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java
  3. +1
    -1
      mallinkService/src/main/java/com/simple/mapper/WxCouponMapper.java
  4. +2
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxUserCouponServiceImpl.java
  5. +67
    -67
      mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml

+ 36
- 36
mallinkService/src/main/java/com/simple/domain/po/WxCoupon.java Просмотреть файл

@@ -11,7 +11,7 @@ import java.io.Serializable;
@Table(name = "wx_coupon")
public class WxCoupon implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@@ -27,11 +27,11 @@ public class WxCoupon implements Serializable {
public void setId(Long id) {
this.id = id;
}
public String getSortColumns() {
return sortColumns;
}
public List<Long> getIds() {
return ids;
}
@@ -39,9 +39,9 @@ public class WxCoupon implements Serializable {
public void setIds(List<Long> ids) {
this.ids = ids;
}
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@@ -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,7 +324,7 @@ public class WxCoupon implements Serializable {
return this.getValue();
}
}
public void setSortColumns(WxCoupon.Field... fields)
{
if (fields == null || fields.length == 0) {
@@ -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())) {


+ 84
- 75
mallinkService/src/main/java/com/simple/domain/po/WxCouponOrder.java Просмотреть файл

@@ -32,17 +32,18 @@ public class WxCouponOrder implements Serializable {
return sortColumns;
}

public List<Long> getIds() {
public List<Long> getIds() {
return ids;
}

public void setIds(List<Long> ids) {
public void setIds(List<Long> ids) {
this.ids = ids;
}


/***/
@io.swagger.annotations.ApiModelProperty(value = "", name = "tenantId")
private Long tenantId;
private String tenantId;
/*单张券ID**/
@io.swagger.annotations.ApiModelProperty(value = "单张券ID", name = "couponId")
private Long couponId;
@@ -56,7 +57,7 @@ public class WxCouponOrder implements Serializable {
@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")
@@ -69,13 +70,13 @@ public class WxCouponOrder implements Serializable {
private Date updateDate;
/*单券实际购买价格**/
@io.swagger.annotations.ApiModelProperty(value = "单券实际购买价格", name = "couponPrice")
private Integer couponPrice;
private Integer couponPrice;

public Long getTenantId() {
public String getTenantId() {
return tenantId;
}

public void setTenantId(Long _tenantId) {
public void setTenantId(String _tenantId) {
tenantId = _tenantId;
}

@@ -143,78 +144,86 @@ public class WxCouponOrder implements Serializable {
updateDate = _updateDate;
}

public Integer getCouponPrice() {
public Integer getCouponPrice() {
return couponPrice;
}

public void setCouponPrice(Integer _couponPrice) {
public void setCouponPrice(Integer _couponPrice) {
couponPrice = _couponPrice;
}



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){
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)
{
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(",");
java.util.List<Field> fList = new java.util.ArrayList();
for (int k = 0; k < cols.length; k++) {
fList.add(Field.valueOf(cols[k]));
}
this.setSortColumns(fList.toArray(new Field[fList.size()]));
} else {
this.setSortColumns(Field.valueOf(sortColumns));
}
}
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) {
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) {
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(",");
java.util.List<Field> fList = new java.util.ArrayList();
for (int k = 0; k < cols.length; k++) {
fList.add(Field.valueOf(cols[k]));
}
this.setSortColumns(fList.toArray(new Field[fList.size()]));
} else {
this.setSortColumns(Field.valueOf(sortColumns));
}
}
}

+ 1
- 1
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<WxCoupon, String> {
public interface WxCouponMapper extends CommonMapper<WxCoupon, Long> {

List<WxCoupon> findList(WxCoupon wxCoupon);



+ 2
- 1
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;



+ 67
- 67
mallinkService/src/main/resources/mapper/WxCouponOrderMapper.xml Просмотреть файл

@@ -14,85 +14,85 @@
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
<result column="coupon_price" jdbcType="INTEGER" property="couponPrice" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`coupon_id`,`c_user_id`,`b_user_id`,`order_id`,`expired_time`,`coupon_order_status`,`create_date`,`update_date`,`coupon_price`
</sql>

<sql id="dynamicWhereConditions">
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != couponId ">
and `coupon_id` = #{couponId}
</if>
<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
</if>
<if test=" null != bUserId ">
and `b_user_id` = #{bUserId}
</if>
<if test=" null != orderId ">
and `order_id` = #{orderId}
</if>
<if test=" null != expiredTime ">
and `expired_time` = #{expiredTime}
</if>
<if test=" null != couponOrderStatus ">
and `coupon_order_status` = #{couponOrderStatus}
</if>
<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and `update_date` = #{updateDate}
</if>
<if test=" null != couponPrice ">
and `coupon_price` = #{couponPrice}
</if>
where 1 = 1
<if test=" null != id ">
and `id` = #{id}
</if>
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != couponId ">
and `coupon_id` = #{couponId}
</if>
<if test=" null != cUserId ">
and `c_user_id` = #{cUserId}
</if>
<if test=" null != bUserId ">
and `b_user_id` = #{bUserId}
</if>
<if test=" null != orderId ">
and `order_id` = #{orderId}
</if>
<if test=" null != expiredTime ">
and `expired_time` = #{expiredTime}
</if>
<if test=" null != couponOrderStatus ">
and `coupon_order_status` = #{couponOrderStatus}
</if>
<if test=" null != createDate ">
and `create_date` = #{createDate}
</if>
<if test=" null != updateDate ">
and `update_date` = #{updateDate}
</if>
<if test=" null != couponPrice ">
and `coupon_price` = #{couponPrice}
</if>
<if test=" null != ids ">
and id in
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
#{idItem}
#{idItem}
</foreach>
</if>
</if>
<if test=" null != sortColumns"> order by ${sortColumns} </if>
</sql>
<select id="findList" parameterType="com.simple.domain.po.WxCouponOrder" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_coupon_order
<include refid="dynamicWhereConditions" />
</select>
</mapper>

Загрузка…
Отмена
Сохранить