Browse Source

update

release_toaliyun_real
xhxu 5 years ago
parent
commit
9c9c55476d
5 changed files with 73 additions and 2 deletions
  1. +14
    -0
      mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java
  2. +6
    -1
      mallinkAdmin/src/main/resources/db/migration/V202009041200__commercialPreferential.sql
  3. +3
    -0
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  4. +37
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumCouponSourceType.java
  5. +13
    -1
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 14
- 0
mallinkAdmin/src/main/java/com/iformall/controller/market/WxCouponController.java View File

@@ -65,6 +65,9 @@ public class WxCouponController extends BaseController {
}else{
wxCoupon.updateTenantInfo(getTenantInfo());
}
if(null == wxCoupon.getSourceType()){
wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode());
}
return wxCouponService.list(wxCoupon, pageNum, pageSize); //全列表
}

@@ -99,6 +102,10 @@ public class WxCouponController extends BaseController {
TenantEntity tenantEntity = getTenantInfo();
wxCoupon.updateTenantInfo(tenantEntity);

if(null == wxCoupon.getSourceType()){
wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode());
}

ResultData resultData = wxCouponService.saveOrUpdate(wxCoupon);
if (resultData.code != 200) {
return resultData;
@@ -122,6 +129,9 @@ public class WxCouponController extends BaseController {
if (wxCoupon.getId() == null) {
return new ResultData(ResultData.ERROR, "缺少id");
}
if(null == wxCoupon.getSourceType()){
wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode());
}
wxCoupon.updateTenantInfo(getTenantInfo());
if(EnumDelFlag.YES.getCode().equals(wxCoupon.getIsDel())){
WxCouponChannel query = new WxCouponChannel();
@@ -304,6 +314,7 @@ public class WxCouponController extends BaseController {
if (wxCoupon.getEnddate() == null) {
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));
}
wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode());
PageInfo<WxCouponStatisVo> pageInfo = wxCouponService.findCountData(wxCoupon, pageNum, pageSize);
for (WxCouponStatisVo coupon : pageInfo.getList()) {
if (coupon.getSaleAmount() == null) {
@@ -336,6 +347,8 @@ public class WxCouponController extends BaseController {
wxCoupon.setEnddate(DateUtils.stringToDate(DateUtils.getSystemTime("yyyy-MM-dd") + " 23:59:59"));
}

wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode());

PageInfo<WxCouponStatisVo> pageInfo = wxCouponService.findCouponData(wxCoupon, pageNum, pageSize);
for (WxCouponStatisVo coupon : pageInfo.getList()) {
if (coupon.getSumSubsidy() == null) {
@@ -357,6 +370,7 @@ public class WxCouponController extends BaseController {
public ResultData findPressCountList(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) {
Map<String,Object> result = new HashedMap();
wxCoupon.updateTenantInfo(getTenantInfo());
wxCoupon.setSourceType(EnumCouponSourceType.COUPONSource_Admin.getCode());
PageInfo<WxCouponStatisVo> pages = wxCouponService.findPressData(wxCoupon,pageNum,pageSize);
return new ResultData(pages);
}


+ 6
- 1
mallinkAdmin/src/main/resources/db/migration/V202009041200__commercialPreferential.sql View File

@@ -9,4 +9,9 @@ update mall_sale_type set menus = '[2, 4, 5, 6, 7, 10, 50, 201, 202, 205, 211, 2


ALTER TABLE `wx_c_user_basic_info`
MODIFY COLUMN `tenant_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID' AFTER `id`;
MODIFY COLUMN `tenant_id` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '租户ID' AFTER `id`;



ALTER TABLE `mallink`.`wx_coupon`
ADD COLUMN `source_type` tinyint(1) NOT NULL DEFAULT 1 COMMENT '1:A端发卷,2:B端发卷' AFTER `password_support`;

+ 3
- 0
mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java View File

@@ -140,6 +140,9 @@ public class WxCoupon extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="卡密是否支持(0:不支持,1支持)",name="passwordSupport")
private Integer passwordSupport;

@io.swagger.annotations.ApiModelProperty(value="1:A端发卷,2:B端发卷",name="sourceType")
private Integer sourceType;

@TableField(exist = false)
private String merchantParams;



+ 37
- 0
mallinkService/src/main/java/com/iformall/enums/EnumCouponSourceType.java View File

@@ -0,0 +1,37 @@
package com.iformall.enums;

/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumCouponSourceType {

// 1:A端发卷,2:B端发卷
COUPONSource_Admin(1, "A端发卷"),
COUPONSource_Bapi(2, "B端发卷")
;

public static EnumCouponSourceType getEnum(Integer code) {
for (EnumCouponSourceType value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumCouponSourceType(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 13
- 1
mallinkService/src/main/resources/mapper/WxCouponMapper.xml View File

@@ -47,6 +47,7 @@
<result column="password_support" property="passwordSupport"/>
<result column="content_type" property="contentType"/>
<result column="html" property="html"/>
<result column="source_type" jdbcType="INTEGER" property="sourceType"/>
</resultMap>
<resultMap id="statisMap" type="com.iformall.domain.vo.WxCouponStatisVo">
<id column="id" jdbcType="BIGINT" property="id"/>
@@ -93,6 +94,7 @@
<result column="sum_subsidy" property="sumSubsidy"/>
<result column="payment_rate" property="paymentRate"/>
<result column="change_rate" property="changeRate"/>
<result column="source_type" jdbcType="INTEGER" property="sourceType"/>
</resultMap>

<sql id="allColumns">
@@ -100,7 +102,7 @@
`valid_type`,`valid_start_date`,`valid_end_date`,`valid_days`,`detail`,`price`,`unit`,`remain_inventory`,`inventory`,
`remark`,`status`,`create_date`,`update_date`,`business`,`sub_business`,`support_transfer`,`subsidy_num`,`subsidy_type`,
`press_limit_num`, `press_limit_hours`, `auto_refund`,`credit_price`,`credit_refund`,`put_apply_status`,`stock_apply_status`,`cancle_apply_status`,
`conditions`,approval_type,content_type
`conditions`,approval_type,content_type,source_type
</sql>

<sql id="statusColumns">
@@ -253,6 +255,10 @@
and `content_type` = #{contentType}
</if>

<if test=" null != sourceType ">
and `source_type` = #{sourceType}
</if>

<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">
@@ -437,6 +443,10 @@
and c.`content_type` = #{contentType}
</if>

<if test=" null != sourceType ">
and `source_type` = #{sourceType}
</if>

<!--如果配置了审批模板,需要过滤投放审批状态-->
<if test="0 != filterCanPut or null ==filterCanPut ">
<if test=" null != pressModelId and 0l != pressModelId">
@@ -560,6 +570,7 @@
<result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/>
<result column="conditions" jdbcType="VARCHAR" property="conditions"/>
<result column="content_type" jdbcType="INTEGER" property="contentType"/>
<result column="source_type" jdbcType="INTEGER" property="sourceType"/>

<collection column="{productId=id}" property="merchantVoList"
ofType="com.iformall.domain.vo.WxMerchantVo"
@@ -603,6 +614,7 @@
<result column="press_limit_hours" jdbcType="INTEGER" property="pressLimitHours"/>
<result column="conditions" jdbcType="VARCHAR" property="conditions"/>
<result column="content_type" jdbcType="INTEGER" property="contentType"/>
<result column="source_type" jdbcType="INTEGER" property="sourceType"/>
</resultMap>

<select id="findVoDetail" parameterType="java.lang.Long" resultMap="WxCouponCVoMap">


Loading…
Cancel
Save