Browse Source

Merge remote-tracking branch 'origin/dev_temp' into dev_temp

dev_shibei_match
yinzuomei 4 years ago
parent
commit
b70667d651
  1. 2
      epmet-auth/src/main/resources/bootstrap.yml
  2. 4
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java
  3. 1
      epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java
  4. 57
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java
  5. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java
  6. 2
      epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/support/GroupLevelUtils.java
  7. 3
      epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

2
epmet-auth/src/main/resources/bootstrap.yml

@ -145,7 +145,7 @@ thirdplat:
appkey: @thirdplat.jcet.g.appkey@
appsecret: @thirdplat.jcet.g.appsecret@
pyld:
domain: https://epmet-ext9.elinkservice.cn/platform
domain: https://epmet-ext1-py.elinkservice.cn/platform
appId: 7a5aec009ba4eba8e254ee64fe3775e1
appKey: 14faef9af508d1c253b720ea5a43f9de
appSecret: 38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595

4
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/BizPointTotalDetailServiceImpl.java

@ -41,6 +41,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.Collator;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Collectors;
@ -195,7 +196,8 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota
}));
list =
list.stream().sorted(Comparator.comparing(GroupPointRankingResultDTO :: getPoint, Comparator.comparingInt(Integer::parseInt)).reversed().thenComparing(GroupPointRankingResultDTO::getGroupName))
list.stream().sorted(Comparator.comparing(GroupPointRankingResultDTO :: getPoint, Comparator.comparingInt(Integer::parseInt)).reversed()
.thenComparing(GroupPointRankingResultDTO::getGroupName, Collator.getInstance(Locale.CHINA)))
.collect(Collectors.toList());
AtomicInteger i = new AtomicInteger(1);
list.forEach(dto -> {

1
epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointActionLogServiceImpl.java

@ -427,6 +427,7 @@ public class UserPointActionLogServiceImpl extends BaseServiceImpl<UserPointActi
action.setCreatedBy(grantPoint.getOperatorId());
action.setUpdatedBy(grantPoint.getOperatorId());
action.setSourceId(grantPoint.getSourceId());
action.setSourceType("activity");
action.setOperatorAgencyId(grantPoint.getOpAgencyId());
baseDao.insert(action);
//2.新增/修改用户积分日统计

57
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java

@ -77,60 +77,61 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService
case TOPIC:
//查询话题数
QueryWrapper<ResiTopicEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ResiTopicEntity::getCustomerId,customerId)
.eq(ResiTopicEntity::getGroupId,groupId)
.eq(ResiTopicEntity::getDelFlag,NumConstant.ZERO);
queryWrapper.lambda().eq(ResiTopicEntity::getCustomerId, customerId)
.eq(ResiTopicEntity::getGroupId, groupId)
.eq(ResiTopicEntity::getDelFlag, NumConstant.ZERO);
currentValue = resiTopicDao.selectCount(queryWrapper);
break;
case MEMBER:
currentValue = resiGroupMemberDao.countMembers(customerId, groupId);
currentValue = resiGroupMemberDao.countAllMembers(customerId, groupId);
break;
case TOISSUE:
//查询已经转议题的话题数
queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ResiTopicEntity::getCustomerId,customerId)
.eq(ResiTopicEntity::getGroupId,groupId)
queryWrapper.lambda().eq(ResiTopicEntity::getCustomerId, customerId)
.eq(ResiTopicEntity::getGroupId, groupId)
.eq(ResiTopicEntity::getShiftIssue, NumConstant.ONE)
.eq(ResiTopicEntity::getDelFlag,NumConstant.ZERO);
.eq(ResiTopicEntity::getDelFlag, NumConstant.ZERO);
currentValue = resiTopicDao.selectCount(queryWrapper);
break;
case RESOVLE_TOPIC:
//查询已经关闭且为已解决的话题数
queryWrapper = new QueryWrapper<>();
queryWrapper.lambda().eq(ResiTopicEntity::getCustomerId,customerId)
.eq(ResiTopicEntity::getGroupId,groupId)
queryWrapper.lambda().eq(ResiTopicEntity::getCustomerId, customerId)
.eq(ResiTopicEntity::getGroupId, groupId)
.eq(ResiTopicEntity::getStatus, TopicConstant.CLOSED)
.eq(ResiTopicEntity::getClosedStatus, TopicConstant.RESOLVED)
.eq(ResiTopicEntity::getShiftIssue, NumConstant.ONE)
.eq(ResiTopicEntity::getDelFlag,NumConstant.ZERO);
.eq(ResiTopicEntity::getDelFlag, NumConstant.ZERO);
currentValue = resiTopicDao.selectCount(queryWrapper);
break;
default:
log.info("calculateAcm error");
}
if(currentValue == 0){
if (currentValue == 0) {
return true;
}
log.info("calculateAcm achievementType:{},groupId:{},currentValue:{}",groupId,currentValue,achievementType);
log.info("calculateAcm achievementType:{},groupId:{},currentValue:{}", groupId, currentValue, achievementType);
calculateGroupAchievement(customerId, groupId, currentValue, achievementType);
return true;
}
/**
* desc: 计算小组的人数等级
* desc: 计算小组成就
*
* @param customerId
* @param groupId
*/
private void calculateGroupAchievement(String customerId, String groupId, int currentValue, String achievementType) {
//根据成就类型获取小组未实现成就 数据库正常只会有一条
ResiGroupAchievementStatsEntity one = super.achievementStatsService.selectLastUnAchieved(customerId, groupId, achievementType);
List<ResiGroupAchievementStatsEntity> haveArrive = new ArrayList<>();
//如果没有实现的成就则说明是初始化
//如果没有实现的成就则说明是初始化
if (one == null) {
initAchievementStat(customerId, groupId, achievementType, currentValue, haveArrive);
super.achievementStatsService.saveOrUpdate(haveArrive,false);
//初始化如果记录存在 只更新修改时间
super.achievementStatsService.saveOrUpdate(haveArrive, false);
return;
}
@ -144,13 +145,13 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService
int pageNum = NumConstant.ONE;
int pageSize = NumConstant.TEN;
do {
List<ResiGroupAchievementConfigEntity> list = getConfigByType(achievementType,pageNum++,pageSize);
List<ResiGroupAchievementConfigEntity> list = getConfigByType(achievementType, pageNum++, pageSize);
isContinue = buildArriveList(customerId, groupId, achievementType, currentValue, one.getTargetValue(), haveArrive, list);
}while (isContinue);
} while (isContinue);
}
if (isBatch) {
super.achievementStatsService.saveOrUpdate(haveArrive,true);
super.achievementStatsService.saveOrUpdate(haveArrive, true);
} else {
//未实现 只更新当前值
ResiGroupAchievementStatsDTO newStat = new ResiGroupAchievementStatsDTO();
@ -160,31 +161,39 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService
}
}
/**
* desc: 初始化成就
*
* @return void
* @author LiuJanJun
* @date 2021/4/23 6:20 下午
*/
private void initAchievementStat(String customerId, String groupId, String achievementType, int currentValue, List<ResiGroupAchievementStatsEntity> haveArrive) {
boolean isContinue;
int pageNum = NumConstant.ONE;
int pageSize = NumConstant.TEN;
do { //没有任何数据说明是初始化
List<ResiGroupAchievementConfigEntity> list = getConfigByType(achievementType,pageNum++,pageSize);
List<ResiGroupAchievementConfigEntity> list = getConfigByType(achievementType, pageNum++, pageSize);
//查询和初始化都失败啦
if (CollectionUtils.isEmpty(list)) {
log.error("calculateMember get config fail");
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode());
}
isContinue = buildArriveList(customerId, groupId, achievementType, currentValue, null, haveArrive, list);
}while (isContinue);
} while (isContinue);
if (CollectionUtils.isEmpty(haveArrive)) {
throw new RenException("小组达成成就失败");
}
}
private boolean buildArriveList(String customerId, String groupId, String achievementType, int currentValue, Integer targetValue, List<ResiGroupAchievementStatsEntity> haveArrive, List<ResiGroupAchievementConfigEntity> list) {
private boolean buildArriveList(String customerId, String groupId, String achievementType, int currentValue, Integer targetValue,
List<ResiGroupAchievementStatsEntity> haveArrive, List<ResiGroupAchievementConfigEntity> list) {
boolean isContinue = true;
for (ResiGroupAchievementConfigEntity configEntity : list) {
if (targetValue != null) {
//筛选出已经完成的成就
if (configEntity.getTargetValue()<targetValue){
if (configEntity.getTargetValue() < targetValue) {
continue;
}
}
@ -211,7 +220,7 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService
return isContinue;
}
private List<ResiGroupAchievementConfigEntity> getConfigByType(String achievementType,int pageNum,int pageSize) {
private List<ResiGroupAchievementConfigEntity> getConfigByType(String achievementType, int pageNum, int pageSize) {
List<ResiGroupAchievementConfigEntity> list = super.getAchievemnetConfigPage(pageNum, pageSize, achievementType);
if (CollectionUtils.isEmpty(list)) {
log.warn("获取小组成就配置错误,{} 开始进行初始化规则", achievementType);

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/member/dao/ResiGroupMemberDao.java

@ -178,5 +178,5 @@ public interface ResiGroupMemberDao extends BaseDao<ResiGroupMemberEntity> {
* @author LiuJanJun
* @date 2021/4/23 3:14 下午
*/
int countMembers(@Param("customerId") String customerId, @Param("groupId") String groupId);
int countAllMembers(@Param("customerId") String customerId, @Param("groupId") String groupId);
}

2
epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/support/GroupLevelUtils.java

@ -9,7 +9,7 @@ import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 小组等级积分工具类
* 小组等级积分工具类 0,300,700,1200,1800
*
* @author zhaoqifeng
* @date 2021/4/21 10:22

3
epmet-module/resi-group/resi-group-server/src/main/resources/mapper/member/ResiGroupMemberDao.xml

@ -191,7 +191,7 @@
ORDER BY
rgm.CREATED_TIME DESC
</select>
<select id="countMembers" resultType="int">
<select id="countAllMembers" resultType="int">
SELECT
count(*)
FROM
@ -199,7 +199,6 @@
WHERE
rgm.RESI_GROUP_ID = #{groupId}
AND rgm.CUSTOMER_ID = #{customerId}
and rgm.STATUS = 'approved'
AND rgm.GROUP_LEADER_FLAG = 'member'
</select>

Loading…
Cancel
Save