diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java index 503ba39761..b23d1c7a46 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/group/service/impl/StatsAchievementServiceImpl.java @@ -63,8 +63,6 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService List 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); @@ -136,7 +134,7 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService } /** - * desc: 计算小组成就 + * desc: 插入或更新小组成就 * * @param customerId * @param groupId @@ -148,7 +146,15 @@ public class StatsAchievementServiceImpl extends AbstractStatsAchievementService List haveArrive = new ArrayList<>(); //如果没有实现的成就则说明是初始化 if (one == null) { - initAchievementStat(customerId, groupId, achievementType, currentValue, haveArrive); + //第一次创建小组时;初始化那集中类型的成就;没有即将完成的成就 且 类型为小组成员 且 成员(不包括组长)数为0 所以需要初始化下 小组成就的那4类 + if (AchievementTypeEnum.MEMBER.getCode().equals(achievementType) && currentValue == NumConstant.ZERO) { + for (AchievementTypeEnum achievement : AchievementTypeEnum.values()) { + initAchievementStat(customerId, groupId, achievement.getCode(), currentValue, haveArrive); + } + } else { + initAchievementStat(customerId, groupId, achievementType, currentValue, haveArrive); + } + //初始化如果记录存在 只更新修改时间 super.saveOrUpdate(haveArrive, false); return;