|
|
@ -5,8 +5,10 @@ import com.epmet.commons.tools.constant.NumConstant; |
|
|
|
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|
|
|
import com.epmet.commons.tools.exception.RenException; |
|
|
|
import com.epmet.modules.enums.AchievementTypeEnum; |
|
|
|
import com.epmet.modules.group.dao.ResiGroupDao; |
|
|
|
import com.epmet.modules.group.entity.ResiGroupAchievementConfigEntity; |
|
|
|
import com.epmet.modules.group.entity.ResiGroupAchievementStatsEntity; |
|
|
|
import com.epmet.modules.group.entity.ResiGroupEntity; |
|
|
|
import com.epmet.modules.group.service.AbstractStatsAchievementService; |
|
|
|
import com.epmet.modules.group.service.StatsAchievementService; |
|
|
|
import com.epmet.modules.member.dao.ResiGroupMemberDao; |
|
|
@ -38,22 +40,39 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService |
|
|
|
private ResiGroupMemberDao resiGroupMemberDao; |
|
|
|
@Autowired |
|
|
|
private ResiTopicDao resiTopicDao; |
|
|
|
@Autowired |
|
|
|
private ResiGroupDao resiGroupDao; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* desc: 计算小组成就 统一入口 |
|
|
|
* |
|
|
|
* @param achievementType 成就类型 |
|
|
|
* @return java.lang.Boolean |
|
|
|
* @author LiuJanJun |
|
|
|
* @date 2021/4/20 |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public Boolean calculateAcm(String achievementType) { |
|
|
|
if (StringUtils.isBlank(achievementType)) { |
|
|
|
public Boolean initAllGroupAchievement() { |
|
|
|
|
|
|
|
//计算所有类型的 小组人数、话题数、转议题数、小组内问题解决数
|
|
|
|
} |
|
|
|
return null; |
|
|
|
QueryWrapper<ResiGroupEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
queryWrapper.lambda().eq(ResiGroupEntity::getDelFlag,'0'); |
|
|
|
List<ResiGroupEntity> groupEntities = resiGroupDao.selectList(queryWrapper); |
|
|
|
groupEntities.forEach(group->{ |
|
|
|
AchievementTypeEnum[] achievementTypeEnum = AchievementTypeEnum.values(); |
|
|
|
Integer integer = super.initPre(group.getCustomerId()); |
|
|
|
log.info("initPre del:{}",integer); |
|
|
|
for (AchievementTypeEnum anEnum : achievementTypeEnum) { |
|
|
|
try { |
|
|
|
Thread.sleep(2); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
calculateAcm(group.getCustomerId(),group.getId(),anEnum.getCode()); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -108,9 +127,6 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService |
|
|
|
default: |
|
|
|
log.info("calculateAcm error"); |
|
|
|
} |
|
|
|
if (currentValue == 0) { |
|
|
|
return true; |
|
|
|
} |
|
|
|
log.info("calculateAcm achievementType:{},groupId:{},currentValue:{}", groupId, currentValue, achievementType); |
|
|
|
calculateGroupAchievement(customerId, groupId, currentValue, achievementType); |
|
|
|
return true; |
|
|
@ -221,7 +237,7 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService |
|
|
|
} |
|
|
|
|
|
|
|
private List<ResiGroupAchievementConfigEntity> getConfigByType(String achievementType, int pageNum, int pageSize) { |
|
|
|
List<ResiGroupAchievementConfigEntity> list = super.getAchievemnetConfigPage(pageNum, pageSize, achievementType); |
|
|
|
List<ResiGroupAchievementConfigEntity> list = super.getAchievementConfigPage(pageNum, pageSize, achievementType); |
|
|
|
if (CollectionUtils.isEmpty(list)) { |
|
|
|
log.warn("获取小组成就配置错误,{} 开始进行初始化规则", achievementType); |
|
|
|
list = super.initAchievementConfig(achievementType); |
|
|
|