From 2bac034f471647342f93e03804b740e98fe0b7be Mon Sep 17 00:00:00 2001 From: lin <642018748@qq.com> Date: Tue, 11 Apr 2023 15:59:36 +0800 Subject: [PATCH] fix card --- .../db/migration/V2023041300002_card.sql | 102 ++++++++++++++++++ .../schedule/CouponOrderNoticeSchedule.java | 2 +- .../java/com/iformall/domain/po/WxCoupon.java | 6 +- .../domain/po/WxMerchantTradeDaily.java | 1 - .../com/iformall/enums/EnumCardScoreRule.java | 36 +++++++ .../service/impl/WxCardSpendServiceImpl.java | 14 ++- .../main/resources/mapper/WxCouponMapper.xml | 11 +- 7 files changed, 160 insertions(+), 12 deletions(-) create mode 100644 mallinkAdmin/src/main/resources/db/migration/V2023041300002_card.sql create mode 100644 mallinkService/src/main/java/com/iformall/enums/EnumCardScoreRule.java diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023041300002_card.sql b/mallinkAdmin/src/main/resources/db/migration/V2023041300002_card.sql new file mode 100644 index 000000000..54d3be7d3 --- /dev/null +++ b/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; + + diff --git a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderNoticeSchedule.java b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderNoticeSchedule.java index 22769c8fe..bbaf31f93 100644 --- a/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderNoticeSchedule.java +++ b/mallinkSchedule/src/main/java/com/iformall/schedule/CouponOrderNoticeSchedule.java @@ -121,7 +121,7 @@ public class CouponOrderNoticeSchedule { public void couponOrderExpiringSchedule() { List malls = getMalls(); for (WxMall mall: malls) { - Date oneDayBefore = DateUtils.getTimeAfterDays(1, new Date()); + Date oneDayBefore = DateUtils.getTimeAfterDays(2, new Date()); List list = wxCouponOrderMapper.findExpiredFreeCouponOrderByValidDate(mall.getTenantId(),oneDayBefore); if (null != list && list.size() > 0 ) { list.stream().forEach(co -> { diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java index e75cb230f..eeebb477a 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCoupon.java +++ b/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") diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantTradeDaily.java b/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantTradeDaily.java index 66eea2de0..743f996e9 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxMerchantTradeDaily.java +++ b/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; diff --git a/mallinkService/src/main/java/com/iformall/enums/EnumCardScoreRule.java b/mallinkService/src/main/java/com/iformall/enums/EnumCardScoreRule.java new file mode 100644 index 000000000..6f2a8b167 --- /dev/null +++ b/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; + } +} diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java index 3884384ae..069e8272a 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java +++ b/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()); diff --git a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml index eeefe44c1..8538a1233 100644 --- a/mallinkService/src/main/resources/mapper/WxCouponMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCouponMapper.xml @@ -58,6 +58,7 @@ + @@ -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 @@ -398,7 +399,7 @@ 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} @@ -432,7 +433,7 @@