Commit 155b1cdf authored by zhangfeng's avatar zhangfeng

Merge branch 'release-bugfix-zhangfeng' into 'release'

bugfix-438,443: 分享统计id命名,客户端活动列表筛选

See merge request !19
parents f3f9469d 08e9b30d
...@@ -16,7 +16,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; ...@@ -16,7 +16,7 @@ import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
@Validated @Validated
@RestController @RestController
@Api(tags = "管理后台 - 分享记录") @Api(tags = "用户 APP - 分享记录")
@RequestMapping("/member/score-rule/share-record") @RequestMapping("/member/score-rule/share-record")
public class AppScoreRuleShareRecordController { public class AppScoreRuleShareRecordController {
......
...@@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult; ...@@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.json.JsonUtils; import cn.iocoder.yudao.framework.common.util.json.JsonUtils;
import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils; import cn.iocoder.yudao.framework.dict.core.util.DictFrameworkUtils;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery; import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQuery;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService; import cn.iocoder.yudao.framework.mybatis.core.service.AbstractService;
import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO; import cn.iocoder.yudao.framework.mybatis.core.vo.PageVO;
import cn.iocoder.yudao.module.depository.service.warehouse.WarehouseService; import cn.iocoder.yudao.module.depository.service.warehouse.WarehouseService;
...@@ -57,6 +58,8 @@ import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*; ...@@ -57,6 +58,8 @@ import static cn.iocoder.yudao.module.member.enums.ErrorCodeConstants.*;
public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, ScoreRuleDO> implements ScoreRuleService { public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, ScoreRuleDO> implements ScoreRuleService {
private static final String PROD_REGISTER_URL = "https://app2.groupage.cn/#/pages/register/register?code="; private static final String PROD_REGISTER_URL = "https://app2.groupage.cn/#/pages/register/register?code=";
private static final String UAT_REGISTER_URL = "https://apptest.groupage.cn/#/pages/register/register?code="; private static final String UAT_REGISTER_URL = "https://apptest.groupage.cn/#/pages/register/register?code=";
private static final String PROD_SHARE_URL = "https://app2.groupage.cn/#";
private static final String UAT_SHARE_URL = "https://apptest.groupage.cn/#";
@Value("${spring.profiles.active}") @Value("${spring.profiles.active}")
private String env; private String env;
@Resource @Resource
...@@ -509,7 +512,12 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score ...@@ -509,7 +512,12 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
@Override @Override
public List<AppScoreRuleListBackVO> appGetScoreRuleList(AppScoreRuleListReqVO reqVO) { public List<AppScoreRuleListBackVO> appGetScoreRuleList(AppScoreRuleListReqVO reqVO) {
List<ScoreRuleDO> scoreRuleDOS = scoreRuleMapper.selectList("status", ScoreRuleStatusEnum.ENABLED.getValue()); // 开启,且活动开始时间在当前时间前,结束时间在当前时间后
LambdaQueryWrapperX<ScoreRuleDO> queryWrapperX = new LambdaQueryWrapperX<>();
queryWrapperX.eq(ScoreRuleDO::getStatus, ScoreRuleStatusEnum.ENABLED.getValue())
.lt(ScoreRuleDO::getStartTime, new Date())
.gt(ScoreRuleDO::getEndTime, new Date());
List<ScoreRuleDO> scoreRuleDOS = scoreRuleMapper.selectList(queryWrapperX);
if (CollectionUtils.isNotEmpty(scoreRuleDOS)) { if (CollectionUtils.isNotEmpty(scoreRuleDOS)) {
List<AppScoreRuleListBackVO> appScoreRuleListBackVOS = new ArrayList<>(); List<AppScoreRuleListBackVO> appScoreRuleListBackVOS = new ArrayList<>();
for (ScoreRuleDO scoreRuleDO : scoreRuleDOS) { for (ScoreRuleDO scoreRuleDO : scoreRuleDOS) {
...@@ -531,6 +539,13 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score ...@@ -531,6 +539,13 @@ public class ScoreRuleServiceImpl extends AbstractService<ScoreRuleMapper, Score
} }
} else if (scoreRuleDO.getType() == ScoreRuleTypeEnum.SHARE.getValue()) { } else if (scoreRuleDO.getType() == ScoreRuleTypeEnum.SHARE.getValue()) {
ScoreRuleShareExtraVO scoreRuleShareExtraVO = JsonUtils.parseObject(scoreRuleDO.getExtra(), ScoreRuleShareExtraVO.class); ScoreRuleShareExtraVO scoreRuleShareExtraVO = JsonUtils.parseObject(scoreRuleDO.getExtra(), ScoreRuleShareExtraVO.class);
MemberUserDO memberUserDO = memberUserService.getUser(reqVO.getMemberId());
String activityUrl = scoreRuleShareExtraVO.getActivityUrl();
if (memberUserDO != null && !"pro".equals(env)) {
scoreRuleShareExtraVO.setActivityUrl(UAT_SHARE_URL + activityUrl);
} else if (memberUserDO != null) {
scoreRuleShareExtraVO.setActivityUrl(PROD_SHARE_URL + activityUrl);
}
appScoreRuleListBackVO.setExtraShare(scoreRuleShareExtraVO); appScoreRuleListBackVO.setExtraShare(scoreRuleShareExtraVO);
} }
String type = appScoreRuleListBackVO.getType().toString(); String type = appScoreRuleListBackVO.getType().toString();
......
...@@ -91,7 +91,7 @@ public class ScoreRuleGenCodeUtils { ...@@ -91,7 +91,7 @@ public class ScoreRuleGenCodeUtils {
if (currentMaxShareRecordCode == null){ if (currentMaxShareRecordCode == null){
codeNum = 1L; codeNum = 1L;
} else { } else {
codeNum = Long.parseLong(currentMaxShareRecordCode.substring(3)) + 1; codeNum = Long.parseLong(currentMaxShareRecordCode.substring(5)) + 1;
} }
redisHelper.set(key, String.valueOf(codeNum),10, TimeUnit.SECONDS); redisHelper.set(key, String.valueOf(codeNum),10, TimeUnit.SECONDS);
} catch (InterruptedException e) { } catch (InterruptedException e) {
...@@ -100,7 +100,8 @@ public class ScoreRuleGenCodeUtils { ...@@ -100,7 +100,8 @@ public class ScoreRuleGenCodeUtils {
lock.unlock(); lock.unlock();
} }
} }
// 获得5位序列号,不足位前面补0 // 获得5位序列号
codeNum = codeNum % 100000;
code.append(String.format("%05d", codeNum)); code.append(String.format("%05d", codeNum));
return code.toString(); return code.toString();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment