|
@ -51,10 +51,7 @@ import com.epmet.modules.group.entity.GroupEditSubmitRecordEntity; |
|
|
import com.epmet.modules.group.entity.ResiGroupEntity; |
|
|
import com.epmet.modules.group.entity.ResiGroupEntity; |
|
|
import com.epmet.modules.group.entity.ResiGroupOperationEntity; |
|
|
import com.epmet.modules.group.entity.ResiGroupOperationEntity; |
|
|
import com.epmet.modules.group.redis.ResiGroupRedis; |
|
|
import com.epmet.modules.group.redis.ResiGroupRedis; |
|
|
import com.epmet.modules.group.service.ResiGroupCodeService; |
|
|
import com.epmet.modules.group.service.*; |
|
|
import com.epmet.modules.group.service.ResiGroupOperationService; |
|
|
|
|
|
import com.epmet.modules.group.service.ResiGroupService; |
|
|
|
|
|
import com.epmet.modules.group.service.ResiGroupStatisticalService; |
|
|
|
|
|
import com.epmet.modules.member.dao.GroupMemeberOperationDao; |
|
|
import com.epmet.modules.member.dao.GroupMemeberOperationDao; |
|
|
import com.epmet.modules.member.dao.ResiGroupMemberDao; |
|
|
import com.epmet.modules.member.dao.ResiGroupMemberDao; |
|
|
import com.epmet.modules.member.redis.ResiGroupMemberRedis; |
|
|
import com.epmet.modules.member.redis.ResiGroupMemberRedis; |
|
@ -73,6 +70,7 @@ import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; |
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberInfoRedisDTO; |
|
|
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; |
|
|
import com.epmet.resi.group.dto.member.form.EditAuditSwitchFormDTO; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.Logger; |
|
|
import org.slf4j.LoggerFactory; |
|
|
import org.slf4j.LoggerFactory; |
|
@ -82,7 +80,6 @@ import org.springframework.stereotype.Service; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
import org.springframework.transaction.support.TransactionSynchronizationAdapter; |
|
|
import org.springframework.transaction.support.TransactionSynchronizationAdapter; |
|
|
import org.springframework.transaction.support.TransactionSynchronizationManager; |
|
|
import org.springframework.transaction.support.TransactionSynchronizationManager; |
|
|
import org.springframework.util.CollectionUtils; |
|
|
|
|
|
|
|
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
import java.text.SimpleDateFormat; |
|
|
import java.util.*; |
|
|
import java.util.*; |
|
@ -159,6 +156,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ResiGroupCodeService resiGroupCodeService; |
|
|
private ResiGroupCodeService resiGroupCodeService; |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
|
private ResiGroupMilestoneStatsService resiGroupMilestoneStatsService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public PageData<ResiGroupDTO> page(Map<String, Object> params) { |
|
|
public PageData<ResiGroupDTO> page(Map<String, Object> params) { |
|
|
IPage<ResiGroupEntity> page = baseDao.selectPage( |
|
|
IPage<ResiGroupEntity> page = baseDao.selectPage( |
|
@ -943,7 +943,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
**/ |
|
|
**/ |
|
|
@Override |
|
|
@Override |
|
|
public List<String> getGroupIdByGridId(String gridId) { |
|
|
public List<String> getGroupIdByGridId(String gridId) { |
|
|
if(StringUtils.isBlank(gridId)) return null; |
|
|
if(StringUtils.isBlank(gridId)) { |
|
|
|
|
|
return null; |
|
|
|
|
|
} |
|
|
return baseDao.getGroupIdByGridId(gridId); |
|
|
return baseDao.getGroupIdByGridId(gridId); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -956,8 +958,9 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
**/ |
|
|
**/ |
|
|
@Override |
|
|
@Override |
|
|
public Map<String, Set<String>> getGroupIdsByGridIdList(List<String> gridIdList) { |
|
|
public Map<String, Set<String>> getGroupIdsByGridIdList(List<String> gridIdList) { |
|
|
if(null == gridIdList || gridIdList.size() < NumConstant.ONE) |
|
|
if(null == gridIdList || gridIdList.size() < NumConstant.ONE) { |
|
|
return null; |
|
|
return null; |
|
|
|
|
|
} |
|
|
Map<String, Set<String>> result = new HashMap<>(); |
|
|
Map<String, Set<String>> result = new HashMap<>(); |
|
|
List<ResiGroupDTO> groups = new ArrayList<>(); |
|
|
List<ResiGroupDTO> groups = new ArrayList<>(); |
|
|
Map<String,List<ResiGroupDTO>> groupMap |
|
|
Map<String,List<ResiGroupDTO>> groupMap |
|
@ -1166,6 +1169,46 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
update(after); |
|
|
update(after); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* 小组成就详情 |
|
|
|
|
|
* |
|
|
|
|
|
* @param formDTO |
|
|
|
|
|
* @return com.epmet.resi.group.dto.group.result.AchievementDetailResultDTO |
|
|
|
|
|
* @author zhaoqifeng |
|
|
|
|
|
* @date 2021/4/19 14:25 |
|
|
|
|
|
*/ |
|
|
|
|
|
@Override |
|
|
|
|
|
public AchievementDetailResultDTO achievementDetail(GroupFormDTO formDTO) { |
|
|
|
|
|
AchievementDetailResultDTO resultDTO = new AchievementDetailResultDTO(); |
|
|
|
|
|
List<AchievementDetailResultDTO.AchievementBean> achievementList = new ArrayList<>(); |
|
|
|
|
|
//1.小组创建时间
|
|
|
|
|
|
ResiGroupEntity group = baseDao.selectById(formDTO.getGroupId()); |
|
|
|
|
|
resultDTO.setCreatedDate(DateUtils.dateToTimestamp(group.getCreatedTime())); |
|
|
|
|
|
|
|
|
|
|
|
//2.即将完成的3个成就
|
|
|
|
|
|
List<ResiGroupMilestoneStatsDTO> unAchievedList = resiGroupMilestoneStatsService.getUnAchieved(formDTO.getGroupId()); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(unAchievedList)) { |
|
|
|
|
|
unAchievedList.forEach(item -> { |
|
|
|
|
|
AchievementDetailResultDTO.AchievementBean bean = new AchievementDetailResultDTO.AchievementBean(); |
|
|
|
|
|
String describe = item.getMileageName() + "(" + item.getCurrentValue().toString() + "/" + item.getTargetValue().toString() + ")"; |
|
|
|
|
|
bean.setDescribe(describe); |
|
|
|
|
|
achievementList.add(bean); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
//3.已完成的成就
|
|
|
|
|
|
List<ResiGroupMilestoneStatsDTO> achievedList = resiGroupMilestoneStatsService.getAchieved(formDTO.getGroupId()); |
|
|
|
|
|
if (CollectionUtils.isNotEmpty(achievedList)) { |
|
|
|
|
|
achievedList.forEach(item -> { |
|
|
|
|
|
AchievementDetailResultDTO.AchievementBean bean = new AchievementDetailResultDTO.AchievementBean(); |
|
|
|
|
|
bean.setDescribe(item.getMileageName()); |
|
|
|
|
|
bean.setCompletionDate(DateUtils.dateToTimestamp(item.getArriveTime())); |
|
|
|
|
|
achievementList.add(bean); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
resultDTO.setAchievement(achievementList); |
|
|
|
|
|
return resultDTO; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public GroupDetailResultDTO getGroupDetail(String groupId) { |
|
|
public GroupDetailResultDTO getGroupDetail(String groupId) { |
|
|
GroupDetailResultDTO groupDetail = new GroupDetailResultDTO(); |
|
|
GroupDetailResultDTO groupDetail = new GroupDetailResultDTO(); |
|
|