|
|
@ -33,7 +33,6 @@ import com.epmet.dto.form.UserResiInfoFormDTO; |
|
|
|
import com.epmet.dto.form.UserRoleFormDTO; |
|
|
|
import com.epmet.dto.result.UserResiInfoResultDTO; |
|
|
|
import com.epmet.dto.result.UserRoleResultDTO; |
|
|
|
import com.epmet.modules.exception.ModuleErrorCode; |
|
|
|
import com.epmet.modules.feign.EpmetUserFeignClient; |
|
|
|
import com.epmet.modules.group.dao.ResiGroupDao; |
|
|
|
import com.epmet.modules.group.dao.ResiGroupOperationDao; |
|
|
@ -54,10 +53,7 @@ import com.epmet.resi.group.constant.MemberStateConstant; |
|
|
|
import com.epmet.resi.group.dto.UserRoleDTO; |
|
|
|
import com.epmet.resi.group.dto.group.*; |
|
|
|
import com.epmet.resi.group.dto.group.form.*; |
|
|
|
import com.epmet.resi.group.dto.group.result.CreatedResultDTO; |
|
|
|
import com.epmet.resi.group.dto.group.result.GroupSummarizeResultDTO; |
|
|
|
import com.epmet.resi.group.dto.group.result.MyGroupResultDTO; |
|
|
|
import com.epmet.resi.group.dto.group.result.RecommendGroupResultDTO; |
|
|
|
import com.epmet.resi.group.dto.group.result.*; |
|
|
|
import com.epmet.resi.group.dto.member.GroupMemeberOperationDTO; |
|
|
|
import com.epmet.resi.group.dto.member.ResiGroupMemberDTO; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
@ -314,7 +310,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
resiGroupOperation.setOperateUserId(applyCreateGroupFormDTO.getUserId()); |
|
|
|
resiGroupOperationService.save(resiGroupOperation); |
|
|
|
//4、插入一群成员信息(群主)
|
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO=new ResiGroupMemberDTO(); |
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO(); |
|
|
|
resiGroupMemberDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); |
|
|
|
resiGroupMemberDTO.setResiGroupId(resiGroupEntity.getId()); |
|
|
|
resiGroupMemberDTO.setGroupLeaderFlag(LeaderFlagConstant.GROUP_LEADER); |
|
|
@ -322,7 +318,7 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
resiGroupMemberDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); |
|
|
|
resiGroupMemberService.save(resiGroupMemberDTO); |
|
|
|
//5、插入一条入群记录(群主的)
|
|
|
|
GroupMemeberOperationDTO groupMemeberOperationDTO=new GroupMemeberOperationDTO(); |
|
|
|
GroupMemeberOperationDTO groupMemeberOperationDTO = new GroupMemeberOperationDTO(); |
|
|
|
groupMemeberOperationDTO.setCustomerUserId(applyCreateGroupFormDTO.getUserId()); |
|
|
|
groupMemeberOperationDTO.setGroupId(resiGroupEntity.getId()); |
|
|
|
groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.UNDER_AUDITTING); |
|
|
@ -334,20 +330,20 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
applyCreateGroupFormDTO.getUserId(), |
|
|
|
applyCreateGroupFormDTO.getCustomerId(), |
|
|
|
applyCreateGroupFormDTO.getGridId()); |
|
|
|
ResiGroupStatisticalDTO resiGroupStatisticalDTO=new ResiGroupStatisticalDTO(); |
|
|
|
ResiGroupStatisticalDTO resiGroupStatisticalDTO = new ResiGroupStatisticalDTO(); |
|
|
|
resiGroupStatisticalDTO.setResiGroupId(resiGroupEntity.getId()); |
|
|
|
resiGroupStatisticalDTO.setTotalMembers(NumConstant.ONE); |
|
|
|
resiGroupStatisticalDTO.setTotalNormalMemebers(NumConstant.ONE); |
|
|
|
resiGroupStatisticalDTO.setTotalTopics(NumConstant.ZERO); |
|
|
|
resiGroupStatisticalDTO.setTotalIssues(NumConstant.ZERO); |
|
|
|
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ |
|
|
|
if (NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())) { |
|
|
|
resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ONE); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
resiGroupStatisticalDTO.setTotalPartyMembers(NumConstant.ZERO); |
|
|
|
} |
|
|
|
if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){ |
|
|
|
if (NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { |
|
|
|
resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ONE); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ZERO); |
|
|
|
} |
|
|
|
resiGroupStatisticalService.save(resiGroupStatisticalDTO); |
|
|
@ -452,23 +448,23 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
resiGroupOperation.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); |
|
|
|
resiGroupOperationService.update(resiGroupOperation); |
|
|
|
//3、将群主在群成员的状态改为已通过
|
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberDao.selectLeaderMember(agreeApplyGroupFormDTO.getGroupId()); |
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(agreeApplyGroupFormDTO.getGroupId()); |
|
|
|
resiGroupMemberDTO.setStatus(MemberStateConstant.APPROVED); |
|
|
|
resiGroupMemberService.update(resiGroupMemberDTO); |
|
|
|
//4、更新群主的出入群记录改为已通过
|
|
|
|
GroupMemeberOperationDTO groupMemeberOperationDTO=groupMemeberOperationDao.selectLeaderRecord(agreeApplyGroupFormDTO.getGroupId()); |
|
|
|
GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(agreeApplyGroupFormDTO.getGroupId()); |
|
|
|
groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.APPROVED); |
|
|
|
groupMemeberOperationDTO.setOperateUserId(agreeApplyGroupFormDTO.getUserId()); |
|
|
|
groupMemeberOperationService.update(groupMemeberOperationDTO); |
|
|
|
//5、给用户发送消息???待定
|
|
|
|
//6、新增小组缓存信息
|
|
|
|
Map<String,Object> param = new HashMap<>(); |
|
|
|
param.put("resiGroupId",resiGroupDTO.getId()); |
|
|
|
Map<String, Object> param = new HashMap<>(); |
|
|
|
param.put("resiGroupId", resiGroupDTO.getId()); |
|
|
|
List<ResiGroupStatisticalDTO> statisticalList = resiGroupStatisticalService.list(param); |
|
|
|
if(null != statisticalList && statisticalList.size() > 0){ |
|
|
|
ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO,statisticalList.get(0)); |
|
|
|
if (null != statisticalList && statisticalList.size() > 0) { |
|
|
|
ResiGroupInfoRedisDTO groupRedis = transferToGroupInfoRedis(resiGroupDTO, statisticalList.get(0)); |
|
|
|
resiGroupRedis.set(groupRedis); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
//当没有查询到组统计信息时
|
|
|
|
UserRoleFormDTO userRoleFormDTO = new UserRoleFormDTO(); |
|
|
|
userRoleFormDTO.setApp("resi"); |
|
|
@ -502,11 +498,11 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
resiGroupOperation.setOperateReason(disAgreeApplyGroupFormDTO.getRejectReason()); |
|
|
|
resiGroupOperationService.update(resiGroupOperation); |
|
|
|
//3、将群主在群成员的状态改为已通过
|
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO=resiGroupMemberDao.selectLeaderMember(disAgreeApplyGroupFormDTO.getGroupId()); |
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO = resiGroupMemberDao.selectLeaderMember(disAgreeApplyGroupFormDTO.getGroupId()); |
|
|
|
resiGroupMemberDTO.setStatus(MemberStateConstant.REJECTED); |
|
|
|
resiGroupMemberService.update(resiGroupMemberDTO); |
|
|
|
//4、更新群主的出入群记录改为已通过
|
|
|
|
GroupMemeberOperationDTO groupMemeberOperationDTO=groupMemeberOperationDao.selectLeaderRecord(disAgreeApplyGroupFormDTO.getGroupId()); |
|
|
|
GroupMemeberOperationDTO groupMemeberOperationDTO = groupMemeberOperationDao.selectLeaderRecord(disAgreeApplyGroupFormDTO.getGroupId()); |
|
|
|
groupMemeberOperationDTO.setOperateStatus(MemberStateConstant.REJECTED); |
|
|
|
groupMemeberOperationDTO.setOperateUserId(disAgreeApplyGroupFormDTO.getUserId()); |
|
|
|
groupMemeberOperationService.update(groupMemeberOperationDTO); |
|
|
@ -555,26 +551,38 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
return userRoleDTO; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public Result<List<GroupAuditedResultDTO>> audited(GroupAuditedFromDTO formDTO) { |
|
|
|
Result<List<GroupAuditedResultDTO>> result = new Result<>(); |
|
|
|
//查询条件
|
|
|
|
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(); |
|
|
|
formDTO.setPageNo(pageIndex); |
|
|
|
//获取审核列表
|
|
|
|
List<GroupAuditedResultDTO> resultList = baseDao.selectAuditedGroupList(formDTO); |
|
|
|
|
|
|
|
return result.ok(resultList); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @return ResiGroupInfoRedisDTO |
|
|
|
* @Description 将ResiGroupDTO与ResiGroupStatisticalDTO转换成ResiGroupInfoRedisDTO |
|
|
|
* @Param ResiGroupDTO |
|
|
|
* @Param ResiGroupStatisticalDTO |
|
|
|
* @return ResiGroupInfoRedisDTO |
|
|
|
* @Author wangc |
|
|
|
* @Date 2020.04.13 16:36 |
|
|
|
**/ |
|
|
|
private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO,ResiGroupStatisticalDTO statisticalDTO){ |
|
|
|
private ResiGroupInfoRedisDTO transferToGroupInfoRedis(ResiGroupDTO groupDTO, ResiGroupStatisticalDTO statisticalDTO) { |
|
|
|
|
|
|
|
ResiGroupStatisticalInfoRedisDTO statisticalObjct = |
|
|
|
ConvertUtils.sourceToTarget(statisticalDTO,ResiGroupStatisticalInfoRedisDTO.class); |
|
|
|
ConvertUtils.sourceToTarget(statisticalDTO, ResiGroupStatisticalInfoRedisDTO.class); |
|
|
|
statisticalObjct.setTotalEarnestMembers(statisticalDTO.getTotalEarnestMemebers()); |
|
|
|
statisticalObjct.setTotalNormalMembers(statisticalDTO.getTotalNormalMemebers()); |
|
|
|
ResiGroupInfoRedisDTO targetObject = |
|
|
|
ConvertUtils.sourceToTarget(groupDTO,ResiGroupInfoRedisDTO.class); |
|
|
|
ConvertUtils.sourceToTarget(groupDTO, ResiGroupInfoRedisDTO.class); |
|
|
|
targetObject.setGroupId(groupDTO.getId()); |
|
|
|
targetObject.setGroupState(groupDTO.getState()); |
|
|
|
SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN); |
|
|
|
if(null != groupDTO.getLatestTopicPublishDate()){ |
|
|
|
if (null != groupDTO.getLatestTopicPublishDate()) { |
|
|
|
targetObject.setLatestTopicPublishDate(format.format(groupDTO.getLatestTopicPublishDate())); |
|
|
|
} |
|
|
|
targetObject.setGroupStatisticalInfo(statisticalObjct); |
|
|
|