| @@ -29,23 +29,23 @@ public class WxScoreRules implements Serializable { | |||||
| @Transient | @Transient | ||||
| private static final String scoreDefaultRules = | private static final String scoreDefaultRules = | ||||
| "[" + | "[" + | ||||
| "{\"id\":1,\"limit\":0,\"step\":1,\"score\":10 ,\"desc\":\"每日登陆\"}," + | |||||
| "{\"id\":1,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"每日登陆\"}," + | |||||
| "{\"id\":2,\"childs\":[" + | "{\"id\":2,\"childs\":[" + | ||||
| " {\"businessId\":1,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":2,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":3,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":4,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":5,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":7,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":50 ,\"desc\":\"线上交易1元\"}" + | |||||
| " {\"businessId\":1,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":2,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":3,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":4,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":5,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":7,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":8,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":9,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":10,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}," + | |||||
| " {\"businessId\":6,\"limit\":0,\"step\":1,\"score\":0 ,\"desc\":\"线上交易1元\"}" + | |||||
| "]}," + | "]}," + | ||||
| "{\"id\":3,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"绑定车牌1个\"}," + | |||||
| "{\"id\":5,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"授权个人信息\"}," + | |||||
| "{\"id\":6,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"授权手机号\"}," + | |||||
| "{\"id\":7,\"limit\":1,\"step\":1,\"score\":100,\"desc\":\"编辑个人信息\"}" + | |||||
| "{\"id\":3,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"绑定车牌1个\"}," + | |||||
| "{\"id\":5,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权个人信息\"}," + | |||||
| "{\"id\":6,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"授权手机号\"}," + | |||||
| "{\"id\":7,\"limit\":1,\"step\":1,\"score\":0,\"desc\":\"编辑个人信息\"}" + | |||||
| "]"; | "]"; | ||||
| @Transient | @Transient | ||||
| @@ -13,6 +13,7 @@ import com.iformall.mapper.WxScoreHistoryMapper; | |||||
| import com.iformall.mapper.WxScoreRulesMapper; | import com.iformall.mapper.WxScoreRulesMapper; | ||||
| import com.iformall.service.WxCUserService; | import com.iformall.service.WxCUserService; | ||||
| import com.iformall.service.WxScoreRulesService; | import com.iformall.service.WxScoreRulesService; | ||||
| import com.iformall.utils.Constant; | |||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| import org.slf4j.LoggerFactory; | import org.slf4j.LoggerFactory; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| @@ -27,10 +28,6 @@ import java.util.List; | |||||
| public class WxScoreRulesServiceImpl implements WxScoreRulesService { | public class WxScoreRulesServiceImpl implements WxScoreRulesService { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| private String keyPrev = "setting:scorerules1:"; | |||||
| private String creditKeyPrev = "setting:creditrules1:"; | |||||
| @Autowired | @Autowired | ||||
| WxScoreRulesMapper wxScoreRulesMapper; | WxScoreRulesMapper wxScoreRulesMapper; | ||||
| @Autowired | @Autowired | ||||
| @@ -49,7 +46,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| @Override | @Override | ||||
| public WxScoreRules getScoreRules(String tenantId) { | public WxScoreRules getScoreRules(String tenantId) { | ||||
| // get pushLime from cache | // get pushLime from cache | ||||
| String key = keyPrev + tenantId; | |||||
| String key = Constant.SCORE_RULES_KEY_PREV + tenantId; | |||||
| // 缓存存在 | // 缓存存在 | ||||
| if (scoreRulesRedisTemplate.hasKey(key)) { | if (scoreRulesRedisTemplate.hasKey(key)) { | ||||
| @@ -124,7 +121,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| @Override | @Override | ||||
| public WxScoreRules getCreditRules(String tenantId) { | public WxScoreRules getCreditRules(String tenantId) { | ||||
| // get pushLime from cache | // get pushLime from cache | ||||
| String key = creditKeyPrev + tenantId; | |||||
| String key = Constant.CREDIT_RULES_KEY_PREV + tenantId; | |||||
| // 缓存存在 | // 缓存存在 | ||||
| if (scoreRulesRedisTemplate.hasKey(key)) { | if (scoreRulesRedisTemplate.hasKey(key)) { | ||||
| @@ -170,7 +167,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| if (record != null && record.getType() == EnumScoreRules.SCORE.getCode()) { | if (record != null && record.getType() == EnumScoreRules.SCORE.getCode()) { | ||||
| // 缓存存在,删除缓存 | // 缓存存在,删除缓存 | ||||
| String key = keyPrev + record.getTenantId(); | |||||
| String key = Constant.SCORE_RULES_KEY_PREV + record.getTenantId(); | |||||
| boolean hasKey = scoreRulesRedisTemplate.hasKey(key); | boolean hasKey = scoreRulesRedisTemplate.hasKey(key); | ||||
| if (hasKey) { | if (hasKey) { | ||||
| scoreRulesRedisTemplate.delete(key); | scoreRulesRedisTemplate.delete(key); | ||||
| @@ -179,7 +176,7 @@ public class WxScoreRulesServiceImpl implements WxScoreRulesService { | |||||
| } | } | ||||
| if (record != null && record.getType() == EnumScoreRules.CREDIT.getCode()) { | if (record != null && record.getType() == EnumScoreRules.CREDIT.getCode()) { | ||||
| // 缓存存在,删除缓存 | // 缓存存在,删除缓存 | ||||
| String key = creditKeyPrev + record.getTenantId(); | |||||
| String key = Constant.CREDIT_RULES_KEY_PREV + record.getTenantId(); | |||||
| boolean hasKey = scoreRulesRedisTemplate.hasKey(key); | boolean hasKey = scoreRulesRedisTemplate.hasKey(key); | ||||
| if (hasKey) { | if (hasKey) { | ||||
| scoreRulesRedisTemplate.delete(key); | scoreRulesRedisTemplate.delete(key); | ||||
| @@ -19,6 +19,11 @@ public class Constant { | |||||
| public static final String LOGIN_USER_KEY = "LOGIN_USER_KEY"; | public static final String LOGIN_USER_KEY = "LOGIN_USER_KEY"; | ||||
| public static final String TENANT_ID = "TENANT_ID"; | public static final String TENANT_ID = "TENANT_ID"; | ||||
| // 成长值规则 key prev | |||||
| public static final String SCORE_RULES_KEY_PREV = "setting:scorerules1:"; | |||||
| // 积分规则 key prev | |||||
| public static final String CREDIT_RULES_KEY_PREV = "setting:creditrules1:"; | |||||
| public static final String fileDirectory = "./uploads/"; | public static final String fileDirectory = "./uploads/"; | ||||
| public static final String importMemPrev = "importmem/"; | public static final String importMemPrev = "importmem/"; | ||||
| public static final String adminPage = "https://admin.malls.iformall.com"; | public static final String adminPage = "https://admin.malls.iformall.com"; | ||||