|
|
@ -310,11 +310,39 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
//2、插入一条待审核的组信息
|
|
|
|
ResiGroupEntity resiGroupEntity = this.structureResiGroupEntity(applyCreateGroupFormDTO); |
|
|
|
insert(resiGroupEntity); |
|
|
|
//3、插入一条待审核的操作记录
|
|
|
|
//3.1、查询当前申请人的身份,生成对应格式的消息内容
|
|
|
|
UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), |
|
|
|
applyCreateGroupFormDTO.getUserId(), |
|
|
|
applyCreateGroupFormDTO.getCustomerId(), |
|
|
|
applyCreateGroupFormDTO.getGridId()); |
|
|
|
if (!NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag()) && !NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())) { |
|
|
|
return new Result().error(EpmetErrorCode.CANNOT_CREATE_GROUP.getCode()); |
|
|
|
} |
|
|
|
String roleName = ""; |
|
|
|
if(NumConstant.ONE_STR.equals(userRoleDTO.getPartymemberFlag())){ |
|
|
|
roleName = ModuleConstant.PARTYMEMBER; |
|
|
|
}else if(NumConstant.ONE_STR.equals(userRoleDTO.getWarmHeartedFlag())){ |
|
|
|
roleName = ModuleConstant.WAREMHEARTED_RESI; |
|
|
|
} |
|
|
|
UserResiInfoFormDTO resiParam = new UserResiInfoFormDTO(); |
|
|
|
resiParam.setCustomerId(applyCreateGroupFormDTO.getCustomerId()); |
|
|
|
resiParam.setUserId(applyCreateGroupFormDTO.getUserId()); |
|
|
|
Result<UserResiInfoResultDTO> resiResult = |
|
|
|
epmetUserFeignClient.getUserResiInfoDTO(resiParam); |
|
|
|
String userName = ""; |
|
|
|
if(resiResult.success() && null != resiResult.getData()){ |
|
|
|
userName = (StringUtils.isBlank(resiResult.getData().getSurname()) ? "" : resiResult.getData().getSurname()) |
|
|
|
+ (StringUtils.isBlank(resiResult.getData().getName()) ? "" :resiResult.getData().getName()); |
|
|
|
} |
|
|
|
userName = StringUtils.isBlank(userName) ? ModuleConstant.UNKNOWN : userName; |
|
|
|
String msg = String.format(ModuleConstant.CREATION_OF_GROUP_MESSAGE_TEMPLATE,roleName,userName,applyCreateGroupFormDTO); |
|
|
|
//3.2、插入一条待审核的操作记录
|
|
|
|
ResiGroupOperationDTO resiGroupOperation = new ResiGroupOperationDTO(); |
|
|
|
resiGroupOperation.setResiGroupId(resiGroupEntity.getId()); |
|
|
|
resiGroupOperation.setState(GroupStateConstant.GROUP_UNDER_AUDITTING); |
|
|
|
resiGroupOperation.setOperateUserId(applyCreateGroupFormDTO.getUserId()); |
|
|
|
resiGroupOperation.setMessageText(msg); |
|
|
|
resiGroupOperation.setReadFlag(ModuleConstant.UNREAD); |
|
|
|
resiGroupOperationService.save(resiGroupOperation); |
|
|
|
//4、插入一群成员信息(群主)
|
|
|
|
ResiGroupMemberDTO resiGroupMemberDTO = new ResiGroupMemberDTO(); |
|
|
@ -333,10 +361,10 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
groupMemeberOperationDTO.setEnterGroupType(EnterGroupTypeConstant.CREATED); |
|
|
|
groupMemeberOperationService.save(groupMemeberOperationDTO); |
|
|
|
//6、群初始统计记录
|
|
|
|
UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), |
|
|
|
/*UserRoleDTO userRoleDTO = this.checkPartyMemberOrWarmHeated(applyCreateGroupFormDTO.getApp(), |
|
|
|
applyCreateGroupFormDTO.getUserId(), |
|
|
|
applyCreateGroupFormDTO.getCustomerId(), |
|
|
|
applyCreateGroupFormDTO.getGridId()); |
|
|
|
applyCreateGroupFormDTO.getGridId());*/ |
|
|
|
ResiGroupStatisticalDTO resiGroupStatisticalDTO = new ResiGroupStatisticalDTO(); |
|
|
|
resiGroupStatisticalDTO.setResiGroupId(resiGroupEntity.getId()); |
|
|
|
resiGroupStatisticalDTO.setTotalMembers(NumConstant.ONE); |
|
|
@ -354,6 +382,8 @@ public class ResiGroupServiceImpl extends BaseServiceImpl<ResiGroupDao, ResiGrou |
|
|
|
resiGroupStatisticalDTO.setTotalEarnestMemebers(NumConstant.ZERO); |
|
|
|
} |
|
|
|
resiGroupStatisticalService.save(resiGroupStatisticalDTO); |
|
|
|
//8.发送一条建组审核消息给当前网格的管理员,给当前网格数据的机构下所有的管理员发送消息
|
|
|
|
|
|
|
|
return new Result(); |
|
|
|
} |
|
|
|
|
|
|
|