| @@ -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 (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` | ALTER TABLE `mallink`.`wx_score_rules` | ||||
| DROP COLUMN `credit_locked`; | DROP COLUMN `credit_locked`; | ||||
| @@ -23,6 +23,9 @@ public class WxCardSpend extends TenantEntity { | |||||
| @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType") | @io.swagger.annotations.ApiModelProperty(value="EnumPayType",name="payType") | ||||
| private Integer payType; | private Integer payType; | ||||
| @TableField(exist = false) | |||||
| protected List<Integer> payTypeS; | |||||
| @io.swagger.annotations.ApiModelProperty(value="储值卡ID",name="cardId") | @io.swagger.annotations.ApiModelProperty(value="储值卡ID",name="cardId") | ||||
| private Long cardId; | private Long cardId; | ||||
| @TableField(exist = false) | @TableField(exist = false) | ||||
| @@ -23,7 +23,7 @@ public interface WxScoreRulesService { | |||||
| * @param | * @param | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxScoreRules getScoreRules(String tenantId); | |||||
| WxScoreRules getScoreRules(String tenantId,TenantEntity tenantEntity); | |||||
| /** | /** | ||||
| * 获取租户的ScoreRules | * 获取租户的ScoreRules | ||||
| @@ -37,7 +37,7 @@ public interface WxScoreRulesService { | |||||
| * @param | * @param | ||||
| * @return | * @return | ||||
| */ | */ | ||||
| WxScoreRules getCreditRules(String tenantId); | |||||
| WxScoreRules getCreditRules(String tenantId,TenantEntity tenantEntity); | |||||
| /** | /** | ||||
| * 获取租户的积分规则 | * 获取租户的积分规则 | ||||
| @@ -706,6 +706,13 @@ public class WxCardSpendServiceImpl implements WxCardSpendService { | |||||
| @Override | @Override | ||||
| public PageInfo<WxCardSpendMerchantVo> listMerchantAsPage(WxCardSpendVo record, Integer pageIndex, Integer pageSize) { | public PageInfo<WxCardSpendMerchantVo> listMerchantAsPage(WxCardSpendVo record, Integer pageIndex, Integer pageSize) { | ||||
| //只查付款和退款的数据 | |||||
| if(record.getPayType() == null){ | |||||
| List<Integer> payTypeS = new ArrayList(); | |||||
| payTypeS.add(EnumPayType.PAY_PAYMENT.getCode()); | |||||
| payTypeS.add(EnumPayType.PAY_B_REFUND.getCode()); | |||||
| record.setPayTypeS(payTypeS); | |||||
| } | |||||
| handleQueryParam(record); | handleQueryParam(record); | ||||
| PageInfo<Map<String,Object>> cardInfoPage = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.sumMerchant(record)); | PageInfo<Map<String,Object>> cardInfoPage = PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCardSpendMapper.sumMerchant(record)); | ||||
| PageInfo<WxCardSpendMerchantVo> pageInfo = new PageInfo<WxCardSpendMerchantVo>(); | PageInfo<WxCardSpendMerchantVo> pageInfo = new PageInfo<WxCardSpendMerchantVo>(); | ||||
| @@ -84,7 +84,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxScoreRules getScoreRules(String tenantId) { | |||||
| public WxScoreRules getScoreRules(String tenantId,TenantEntity tenantEntity) { | |||||
| // get pushLime from cache | // get pushLime from cache | ||||
| String key = Constant.SCORE_RULES_KEY_PREV + tenantId; | String key = Constant.SCORE_RULES_KEY_PREV + tenantId; | ||||
| @@ -100,17 +100,15 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| scoreRules.setType(EnumScoreRules.SCORE.getCode()); | scoreRules.setType(EnumScoreRules.SCORE.getCode()); | ||||
| List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | ||||
| TenantEntity baseTenantEntity = new TenantEntity(); | |||||
| baseTenantEntity.setTenantId(tenantId); | |||||
| if (list.size() > 0) { | if (list.size() > 0) { | ||||
| scoreRules = list.get(0); | scoreRules = list.get(0); | ||||
| scoreRules.setRules(getScoreRulesNew(baseTenantEntity,scoreRules.getRules(),EnumScoreRules.SCORE)); | |||||
| scoreRules.setRules(getScoreRulesNew(tenantEntity,scoreRules.getRules(),EnumScoreRules.SCORE)); | |||||
| } else { | } else { | ||||
| // 如果成长值规则不存在,启用默认值 | // 如果成长值规则不存在,启用默认值 | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| scoreRules.setId(idWorker.nextId()); | scoreRules.setId(idWorker.nextId()); | ||||
| scoreRules.setRules(getScoreRulesNew(baseTenantEntity,WxScoreRules.getScoreDefaultRules(),EnumScoreRules.SCORE)); | |||||
| scoreRules.setRules(getScoreRulesNew(tenantEntity,WxScoreRules.getScoreDefaultRules(),EnumScoreRules.SCORE)); | |||||
| wxScoreRulesMapper.insert(scoreRules); | wxScoreRulesMapper.insert(scoreRules); | ||||
| } | } | ||||
| // 插入缓存 | // 插入缓存 | ||||
| @@ -125,9 +123,9 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| WxScoreRules scoreRules = null; | WxScoreRules scoreRules = null; | ||||
| WxMallDispose mallDispose = wxMallDisposeService.getMallDispose(tenantEntity); | WxMallDispose mallDispose = wxMallDisposeService.getMallDispose(tenantEntity); | ||||
| if(EnumMallDispose.MALL.getCode().equals(mallDispose.getGrowthValueDispose())){ | if(EnumMallDispose.MALL.getCode().equals(mallDispose.getGrowthValueDispose())){ | ||||
| scoreRules = this.getScoreRules(tenantEntity.getTenantId()); | |||||
| scoreRules = this.getScoreRules(tenantEntity.getTenantId(),tenantEntity); | |||||
| }else{ | }else{ | ||||
| scoreRules = this.getScoreRules(tenantEntity.getFinalTenantId()); | |||||
| scoreRules = this.getScoreRules(tenantEntity.getFinalTenantId(),tenantEntity); | |||||
| } | } | ||||
| return scoreRules; | return scoreRules; | ||||
| } | } | ||||
| @@ -181,7 +179,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public WxScoreRules getCreditRules(String tenantId) { | |||||
| public WxScoreRules getCreditRules(String tenantId,TenantEntity tenantEntity) { | |||||
| // get pushLime from cache | // get pushLime from cache | ||||
| String key = Constant.CREDIT_RULES_KEY_PREV + tenantId; | String key = Constant.CREDIT_RULES_KEY_PREV + tenantId; | ||||
| @@ -197,16 +195,14 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| scoreRules.setType(EnumScoreRules.CREDIT.getCode()); | scoreRules.setType(EnumScoreRules.CREDIT.getCode()); | ||||
| List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | List<WxScoreRules> list = wxScoreRulesMapper.findList(scoreRules); | ||||
| TenantEntity baseTenantEntity = new TenantEntity(); | |||||
| baseTenantEntity.setTenantId(tenantId); | |||||
| if (list.size() > 0) { | if (list.size() > 0) { | ||||
| scoreRules = list.get(0); | scoreRules = list.get(0); | ||||
| scoreRules.setRules(getScoreRulesNew(baseTenantEntity,scoreRules.getRules(),EnumScoreRules.CREDIT)); | |||||
| scoreRules.setRules(getScoreRulesNew(tenantEntity,scoreRules.getRules(),EnumScoreRules.CREDIT)); | |||||
| } else { | } else { | ||||
| // 如果积分规则不存在,启用默认值 | // 如果积分规则不存在,启用默认值 | ||||
| final IdWorker idWorker = IdWorker.get(); | final IdWorker idWorker = IdWorker.get(); | ||||
| scoreRules.setId(idWorker.nextId()); | scoreRules.setId(idWorker.nextId()); | ||||
| scoreRules.setRules(getScoreRulesNew(baseTenantEntity,WxScoreRules.getCreditDefaultRules(),EnumScoreRules.CREDIT)); | |||||
| scoreRules.setRules(getScoreRulesNew(tenantEntity,WxScoreRules.getCreditDefaultRules(),EnumScoreRules.CREDIT)); | |||||
| wxScoreRulesMapper.insert(scoreRules); | wxScoreRulesMapper.insert(scoreRules); | ||||
| } | } | ||||
| @@ -223,9 +219,9 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| WxMallDispose mallDispose = wxMallDisposeService.getMallDispose(tenantEntity); | WxMallDispose mallDispose = wxMallDisposeService.getMallDispose(tenantEntity); | ||||
| logger.info("WxMallDispose >>"+JSONObject.toJSONString(mallDispose)); | logger.info("WxMallDispose >>"+JSONObject.toJSONString(mallDispose)); | ||||
| if(EnumMallDispose.MALL.getCode().equals(mallDispose.getPointsDispose())){ | if(EnumMallDispose.MALL.getCode().equals(mallDispose.getPointsDispose())){ | ||||
| scoreRules = this.getCreditRules(tenantEntity.getTenantId()); | |||||
| scoreRules = this.getCreditRules(tenantEntity.getTenantId(),tenantEntity); | |||||
| }else{ | }else{ | ||||
| scoreRules = this.getCreditRules(tenantEntity.getFinalTenantId()); | |||||
| scoreRules = this.getCreditRules(tenantEntity.getFinalTenantId(),tenantEntity); | |||||
| } | } | ||||
| return scoreRules; | return scoreRules; | ||||
| } | } | ||||
| @@ -111,6 +111,12 @@ | |||||
| <if test="null != enddate"> | <if test="null != enddate"> | ||||
| and `create_date` <= #{enddate} | and `create_date` <= #{enddate} | ||||
| </if> | </if> | ||||
| <if test=" null != payTypeS "> | |||||
| and `pay_type` in | |||||
| <foreach collection="payTypeS" index="index" item="ptItem" open="(" separator="," close=")"> | |||||
| #{ptItem} | |||||
| </foreach> | |||||
| </if> | |||||
| <if test=" null != merchantIdList "> | <if test=" null != merchantIdList "> | ||||
| and `merchant_id` in | and `merchant_id` in | ||||
| <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")"> | <foreach collection="merchantIdList" index="index" item="midItem" open="(" separator="," close=")"> | ||||