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

fix card

release_toaliyun_real
lin 3 лет назад
Родитель
Сommit
2bac034f47
7 измененных файлов: 160 добавлений и 12 удалений
  1. +102
    -0
      mallinkAdmin/src/main/resources/db/migration/V2023041300002_card.sql
  2. +1
    -1
      mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderNoticeSchedule.java
  3. +3
    -3
      mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java
  4. +0
    -1
      mallinkService/src/main/java/com/iformall/domain/po/WxMerchantTradeDaily.java
  5. +36
    -0
      mallinkService/src/main/java/com/iformall/enums/EnumCardScoreRule.java
  6. +12
    -2
      mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java
  7. +6
    -5
      mallinkService/src/main/resources/mapper/WxCouponMapper.xml

+ 102
- 0
mallinkAdmin/src/main/resources/db/migration/V2023041300002_card.sql Просмотреть файл

@@ -0,0 +1,102 @@
alter table wx_coupon_0 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_1 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_2 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_3 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_4 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_5 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_6 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_7 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_8 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_9 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_10 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_11 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_12 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_13 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_14 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_15 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_16 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_17 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_18 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_19 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_20 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_21 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_22 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_23 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_24 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_25 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_26 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_27 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_28 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_29 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_30 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_31 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_32 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_33 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_34 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_35 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_36 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_37 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_38 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_39 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_40 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_41 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_42 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_43 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_44 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_45 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_46 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_47 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_48 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_49 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_50 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_51 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_52 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_53 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_54 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_55 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_56 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_57 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_58 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_59 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_60 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_61 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_62 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_63 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_64 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_65 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_66 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_67 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_68 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_69 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_70 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_71 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_72 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_73 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_74 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_75 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_76 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_77 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_78 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_79 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_80 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_81 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_82 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_83 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_84 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_85 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_86 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_87 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_88 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_89 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_90 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_91 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_92 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_93 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_94 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_95 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_96 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_97 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_98 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;
alter table wx_coupon_99 add column card_score_rule int(1) NOT NULL DEFAULT 1 COMMENT '卡积分成长值积分规则EnumCardScoreRule' AFTER used_password;



+ 1
- 1
mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderNoticeSchedule.java Просмотреть файл

@@ -121,7 +121,7 @@ public class CouponOrderNoticeSchedule {
public void couponOrderExpiringSchedule() {
List<WxMall> malls = getMalls();
for (WxMall mall: malls) {
Date oneDayBefore = DateUtils.getTimeAfterDays(1, new Date());
Date oneDayBefore = DateUtils.getTimeAfterDays(2, new Date());
List<WxCouponOrder> list = wxCouponOrderMapper.findExpiredFreeCouponOrderByValidDate(mall.getTenantId(),oneDayBefore);
if (null != list && list.size() > 0 ) {
list.stream().forEach(co -> {


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

@@ -143,7 +143,6 @@ public class WxCoupon extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value="原价(适用于类型10)",name="origPrice")
private Integer origPrice;


@io.swagger.annotations.ApiModelProperty(value="单位(0:rmb分 1:小时*100)",name="unit")
private Integer unit;
@io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory")
@@ -205,6 +204,9 @@ public class WxCoupon extends TenantEntity {

@io.swagger.annotations.ApiModelProperty(value="使用密码",name="usedPassword")
private String usedPassword;
@io.swagger.annotations.ApiModelProperty(value="卡积分成长值积分规则EnumCardScoreRule",name="cardScoreRule")
private Integer cardScoreRule;

@io.swagger.annotations.ApiModelProperty(value="1:A端发卷,2:B端发卷",name="sourceType")
private Integer sourceType;
@@ -251,14 +253,12 @@ public class WxCoupon extends TenantEntity {
@TableField(exist = false)
@io.swagger.annotations.ApiModelProperty(value="营销分析",name="wxCouponStatisVo")
private WxCouponStatisVo wxCouponStatisVo;

@io.swagger.annotations.ApiModelProperty(value="投放审批状态",name="putApplyStatus")
private Integer putApplyStatus;
@io.swagger.annotations.ApiModelProperty(value="库存审批状态",name="stockApplyStatus")
private Integer stockApplyStatus;
@io.swagger.annotations.ApiModelProperty(value="作废审批状态",name="cancleApplyStatus")
private Integer cancleApplyStatus;

@io.swagger.annotations.ApiModelProperty(value="EnumCouponContentType 内容类型(0:小程序页面类型,1:富文本类型)",name="contentType")
private Integer contentType;
@io.swagger.annotations.ApiModelProperty(value="富文本内容",name="html")


+ 0
- 1
mallinkService/src/main/java/com/iformall/domain/po/WxMerchantTradeDaily.java Просмотреть файл

@@ -56,7 +56,6 @@ public class WxMerchantTradeDaily extends TenantEntity {
@io.swagger.annotations.ApiModelProperty(value = "凭证", name = "proof")
protected String proof;
@io.swagger.annotations.ApiModelProperty(value = "月份如2019-05", name = "month")

@TableField(exist = false)
private String month;



+ 36
- 0
mallinkService/src/main/java/com/iformall/enums/EnumCardScoreRule.java Просмотреть файл

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


/**
* @author gongbiao
*/
public enum EnumCardScoreRule {

BY_SALE_PRICE(1, "按售价进行比例积分"),
BY_PRICE(2, "按面额进行比例积分");

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

private Integer code;
private String message;

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

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 12
- 2
mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java Просмотреть файл

@@ -311,7 +311,12 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
if (null != orderUpdate.getCUserId() && (!Constant.defaultCUserId.equals(orderUpdate.getCUserId()))) {
// 成长值
try {
orderUpdate.setPayment(payment);
//看是按售价比例算还是按面额比例算
if (coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_SALE_PRICE.getCode().intValue()) {
orderUpdate.setPayment(payment);
}else if(coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_PRICE.getCode().intValue()){
orderUpdate.setPayment(record.getDeductionAmount());
}
wxScoreRulesService.addScore2(coupon,EnumScoreType.CONSUMPTION, orderUpdate, coupon.getBusiness());
} catch (Exception e) {
logger.error("成长值:" + e.getMessage());
@@ -330,7 +335,12 @@ public class WxCardSpendServiceImpl implements WxCardSpendService {
creditHistory.setFinalTenantId(record.getFinalTenantId());
creditHistory.setCreditType(EnumScoreType.CONSUMPTION.getCode());
creditHistory.setBusinessId(coupon.getBusiness());
creditHistory.setSpend(payment);
//看是按售价比例算还是按面额比例算
if (coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_SALE_PRICE.getCode().intValue()) {
creditHistory.setSpend(payment);
}else if(coupon.getCardScoreRule().intValue() == EnumCardScoreRule.BY_PRICE.getCode().intValue()){
creditHistory.setSpend(record.getDeductionAmount());
}
//如果券与商户一对一 则直接将消费商户更新为此商户 若一对多 则消费商户显示多商户
creditHistory.setMerchantId(record.getMerchantId());
WxMerchant wxMerchant = wxMerchantMapper.selectById(record.getMerchantId());


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

@@ -58,6 +58,7 @@
<result column="password_support" property="passwordSupport"/>
<result column="is_recharge" jdbcType="INTEGER" property="isRecharge"/>
<result column="used_password" jdbcType="VARCHAR" property="usedPassword"/>
<result column="card_score_rule" jdbcType="INTEGER" property="cardScoreRule"/>
<result column="content_type" property="contentType"/>
<result column="html" property="html"/>
<result column="source_type" jdbcType="INTEGER" property="sourceType"/>
@@ -133,7 +134,7 @@
c.`id`,c.`tenant_id`,c.`parent_tenant_id`,c.`make_merchant_id`,c.`brand`,c.`type`,c.`cover_img`,c.`cover_picture`,c.`detail_picture`,
c.`title`,c.`sub_title`,c.`item_group`,c.`sale_price`,c.`freight_price`,c.`use_price`,c.`use_limit_rule`,c.`use_limit_quantity`,c.`send_type`,
c.`valid_type`,c.`valid_start_date`,c.`valid_end_date`,c.pick_start_date,c.pick_end_date,c.`valid_days`,c.`detail`,c.`price`,c.tail_price,c.orig_price,c.`unit`,c.`remain_inventory`,c.`inventory`,
c.`remark`,c.`status`,c.`create_date`,c.`update_date`,c.`business`,c.`sub_business`,c.`support_transfer`,c.`subsidy_num`,c.`subsidy_type`,c.`is_after_set_price`,
c.`remark`,c.`status`,c.`create_date`,c.`update_date`,c.`business`,c.`sub_business`,c.`support_transfer`,c.`subsidy_num`,c.`subsidy_type`,c.`is_after_set_price`,c.`card_score_rule`,
c.`press_limit_num`, c.`press_limit_hours`,c.`press_pay_reduce_stock`,c.`press_support_is_new`, c.`auto_refund`,c.`credit_price`,c.`credit_refund`,c.`put_apply_status`,c.`stock_apply_status`,c.`cancle_apply_status`,
c.`conditions`,c.approval_type,c.content_type,c.source_type,c.merchant_type,c.password_support,c.is_recharge,c.used_password,c.gift_list,c.product_type,c.category_id,c.goods_id
</sql>
@@ -398,7 +399,7 @@
<select id="findTenantSimpleList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select id,title,sale_price,use_price,price,tail_price,orig_price,auto_refund,business,subsidy_type,source_type,merchant_type,type,unit,cover_img,
sub_title,item_group,valid_type,valid_start_date,valid_end_date,pick_start_date,pick_end_date,is_after_set_price
sub_title,item_group,valid_type,valid_start_date,valid_end_date,pick_start_date,pick_end_date,is_after_set_price,card_score_rule
from wx_coupon c where c.`tenant_id` = #{tenantId}
<if test=" null != ids ">
and id in
@@ -417,13 +418,13 @@
<select id="findSimpleDetail" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select c.id,c.type,c.cover_img,c.title,c.sub_title,c.item_group,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date,
c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund,c.business,c.subsidy_type,c.source_type,c.merchant_type,c.content_type,c.gift_list,c.support_transfer,c.subsidy_num,
c.is_after_set_price from wx_coupon c where c.id = #{id} and c.`tenant_id` = #{tenantId}
c.is_after_set_price,c.card_score_rule from wx_coupon c where c.id = #{id} and c.`tenant_id` = #{tenantId}
</select>
<select id="findCouponCVoDetail" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select c.id,c.type,c.cover_img,c.cover_picture,c.detail_picture,c.title,c.sub_title,c.item_group,c.sale_price,c.use_price,
c.use_limit_rule,c.use_limit_quantity,c.send_type,c.valid_type,c.valid_start_date,c.valid_end_date,c.pick_start_date,c.pick_end_date,
c.valid_days,c.detail,c.price,c.tail_price,c.orig_price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.is_after_set_price,
c.valid_days,c.detail,c.price,c.tail_price,c.orig_price,c.unit,c.remain_inventory,c.inventory,c.remark,c.status,c.is_after_set_price,c.card_score_rule,
c.create_date,c.update_date,c.business,c.sub_business,c.support_transfer,c.press_limit_num, c.auto_refund,c.credit_price,c.conditions,c.content_type
from wx_coupon c where c.id = #{id} and c.`tenant_id` = #{tenantId}
</select>
@@ -432,7 +433,7 @@
<select id="findSimpleDetailList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap">
select c.id,c.type,c.cover_img,c.title,c.sub_title,c.item_group,c.sale_price,c.use_price,c.price,c.tail_price,c.orig_price,c.unit,c.detail,c.remark,c.valid_type,c.valid_start_date,
c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund,c.business,c.subsidy_type,c.source_type,c.merchant_type,c.content_type,c.is_after_set_price
c.valid_end_date,c.pick_start_date,c.pick_end_date,c.auto_refund,c.business,c.subsidy_type,c.source_type,c.merchant_type,c.content_type,c.is_after_set_price,c.card_score_rule
from wx_coupon c
<include refid="dynamicWhereConditions"/>
</select>


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