diff --git a/mallinkAdmin/src/main/resources/db/migration/V2023033000001_upd_merchant_credit_locked.sql b/mallinkAdmin/src/main/resources/db/migration/V2023033000001_upd_merchant_credit_locked.sql index 6e299bb4d..3db6ccff8 100644 --- a/mallinkAdmin/src/main/resources/db/migration/V2023033000001_upd_merchant_credit_locked.sql +++ b/mallinkAdmin/src/main/resources/db/migration/V2023033000001_upd_merchant_credit_locked.sql @@ -7,6 +7,23 @@ INSERT INTO `mallink`.`sys_config`(`id`, `config_item_key`, `config_item_remark` --初始化数据 --INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (78910, 10, '1', '789', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102010, 10, '1', '1020', '1028', '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102110, 10, '1', '1021', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102210, 10, '1', '1022', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102310, 10, '1', '1023', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102410, 10, '1', '1024', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102610, 10, '1', '1026', '1025', '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102710, 10, '1', '1027', '1025', '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102810, 10, '1', '1028', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (102910, 10, '1', '1029', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (103010, 10, '1', '1030', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (103110, 10, '1', '1031', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (103510, 10, '1', '1035', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (103610, 10, '1', '1036', '1037', '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (103710, 10, '1', '1037', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); +INSERT INTO `mallink`.`sys_config_value`(`id`, `config_item_id`, `config_item_value`, `tenant_id`, `parent_tenant_id`, `create_date`, `update_date`) VALUES (105010, 10, '1', '1050', NULL, '2023-03-30 18:13:01', '2023-03-30 18:13:01'); + + ALTER TABLE `mallink`.`wx_score_rules` DROP COLUMN `credit_locked`; diff --git a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java index 1b242c60a..bd3f2fb5e 100644 --- a/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java +++ b/mallinkService/src/main/java/com/iformall/domain/po/WxCardSpend.java @@ -23,6 +23,9 @@ public class WxCardSpend extends TenantEntity { @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType") private Integer payType; + @TableField(exist = false) + protected List payTypeS; + @io.swagger.annotations.ApiModelProperty(value="储值卡ID",name="cardId") private Long cardId; @TableField(exist = false) diff --git a/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java b/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java index 26f4e76d2..f4e150be4 100644 --- a/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java +++ b/mallinkService/src/main/java/com/iformall/service/WxScoreRulesService.java @@ -23,7 +23,7 @@ public interface WxScoreRulesService { * @param * @return */ - WxScoreRules getScoreRules(String tenantId); + WxScoreRules getScoreRules(String tenantId,TenantEntity tenantEntity); /** * 获取租户的ScoreRules @@ -37,7 +37,7 @@ public interface WxScoreRulesService { * @param * @return */ - WxScoreRules getCreditRules(String tenantId); + WxScoreRules getCreditRules(String tenantId,TenantEntity tenantEntity); /** * 获取租户的积分规则 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 e72d9f515..3884384ae 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxCardSpendServiceImpl.java @@ -706,6 +706,13 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { @Override public PageInfo listMerchantAsPage(WxCardSpendVo record, Integer pageIndex, Integer pageSize) { + //只查付款和退款的数据 + if(record.getPayType() == null){ + List payTypeS = new ArrayList(); + payTypeS.add(EnumPayType.PAY_PAYMENT.getCode()); + payTypeS.add(EnumPayType.PAY_B_REFUND.getCode()); + record.setPayTypeS(payTypeS); + } handleQueryParam(record); PageInfo> cardInfoPage = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.sumMerchant(record)); PageInfo pageInfo = new PageInfo(); diff --git a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java index 912f8234f..c69b9a611 100644 --- a/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java +++ b/mallinkService/src/main/java/com/iformall/service/impl/WxScoreRulesServiceImpl.java @@ -84,7 +84,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { } @Override - public WxScoreRules getScoreRules(String tenantId) { + public WxScoreRules getScoreRules(String tenantId,TenantEntity tenantEntity) { // get pushLime from cache String key = Constant.SCORE_RULES_KEY_PREV + tenantId; @@ -100,17 +100,15 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { scoreRules.setType(EnumScoreRules.SCORE.getCode()); List list = wxScoreRulesMapper.findList(scoreRules); - TenantEntity baseTenantEntity = new TenantEntity(); - baseTenantEntity.setTenantId(tenantId); if (list.size() > 0) { scoreRules = list.get(0); - scoreRules.setRules(getScoreRulesNew(baseTenantEntity,scoreRules.getRules(),EnumScoreRules.SCORE)); + scoreRules.setRules(getScoreRulesNew(tenantEntity,scoreRules.getRules(),EnumScoreRules.SCORE)); } else { // 如果成长值规则不存在,启用默认值 final IdWorker idWorker = IdWorker.get(); scoreRules.setId(idWorker.nextId()); - scoreRules.setRules(getScoreRulesNew(baseTenantEntity,WxScoreRules.getScoreDefaultRules(),EnumScoreRules.SCORE)); + scoreRules.setRules(getScoreRulesNew(tenantEntity,WxScoreRules.getScoreDefaultRules(),EnumScoreRules.SCORE)); wxScoreRulesMapper.insert(scoreRules); } // 插入缓存 @@ -125,9 +123,9 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { WxScoreRules scoreRules = null; WxMallDispose mallDispose = wxMallDisposeService.getMallDispose(tenantEntity); if(EnumMallDispose.MALL.getCode().equals(mallDispose.getGrowthValueDispose())){ - scoreRules = this.getScoreRules(tenantEntity.getTenantId()); + scoreRules = this.getScoreRules(tenantEntity.getTenantId(),tenantEntity); }else{ - scoreRules = this.getScoreRules(tenantEntity.getFinalTenantId()); + scoreRules = this.getScoreRules(tenantEntity.getFinalTenantId(),tenantEntity); } return scoreRules; } @@ -181,7 +179,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { } @Override - public WxScoreRules getCreditRules(String tenantId) { + public WxScoreRules getCreditRules(String tenantId,TenantEntity tenantEntity) { // get pushLime from cache String key = Constant.CREDIT_RULES_KEY_PREV + tenantId; @@ -197,16 +195,14 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { scoreRules.setType(EnumScoreRules.CREDIT.getCode()); List list = wxScoreRulesMapper.findList(scoreRules); - TenantEntity baseTenantEntity = new TenantEntity(); - baseTenantEntity.setTenantId(tenantId); if (list.size() > 0) { scoreRules = list.get(0); - scoreRules.setRules(getScoreRulesNew(baseTenantEntity,scoreRules.getRules(),EnumScoreRules.CREDIT)); + scoreRules.setRules(getScoreRulesNew(tenantEntity,scoreRules.getRules(),EnumScoreRules.CREDIT)); } else { // 如果积分规则不存在,启用默认值 final IdWorker idWorker = IdWorker.get(); scoreRules.setId(idWorker.nextId()); - scoreRules.setRules(getScoreRulesNew(baseTenantEntity,WxScoreRules.getCreditDefaultRules(),EnumScoreRules.CREDIT)); + scoreRules.setRules(getScoreRulesNew(tenantEntity,WxScoreRules.getCreditDefaultRules(),EnumScoreRules.CREDIT)); wxScoreRulesMapper.insert(scoreRules); } @@ -223,9 +219,9 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { WxMallDispose mallDispose = wxMallDisposeService.getMallDispose(tenantEntity); logger.info("WxMallDispose >>"+JSONObject.toJSONString(mallDispose)); if(EnumMallDispose.MALL.getCode().equals(mallDispose.getPointsDispose())){ - scoreRules = this.getCreditRules(tenantEntity.getTenantId()); + scoreRules = this.getCreditRules(tenantEntity.getTenantId(),tenantEntity); }else{ - scoreRules = this.getCreditRules(tenantEntity.getFinalTenantId()); + scoreRules = this.getCreditRules(tenantEntity.getFinalTenantId(),tenantEntity); } return scoreRules; } diff --git a/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml b/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml index 198a81792..cda6eb24f 100644 --- a/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml +++ b/mallinkService/src/main/resources/mapper/WxCardSpendMapper.xml @@ -111,6 +111,12 @@ and `create_date` <= #{enddate} + + and `pay_type` in + + #{ptItem} + + and `merchant_id` in