Browse Source

锦水第一次优化

feature/syp_points
songyunpeng 5 years ago
parent
commit
d95c8f1933
  1. 20
      esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml
  2. 5
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java
  3. 2
      esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml
  4. 5
      esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueSubmitFormDTO.java
  5. 23
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml
  6. 16
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/dao/ArchivesDao.java
  7. 9
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/ArchivesService.java
  8. 56
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java
  9. 9
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/dao/ArchivesDeptDao.java
  10. 11
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/ArchivesDeptService.java
  11. 12
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/impl/ArchivesDeptServiceImpl.java
  12. 8
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/dept/dao/DeptInfoDao.java
  13. 9
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/dept/service/DeptInfoService.java
  14. 9
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/dept/service/impl/DeptInfoServiceImpl.java
  15. 2
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/AdminFeignClient.java
  16. 27
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java
  17. 2
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java
  18. 28
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java
  19. 18
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/ReportIssueDao.java
  20. 9
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/ReportIssueService.java
  21. 117
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java
  22. 63
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/OrganizationModifyConsumer.java
  23. 37
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/OrganizationModifyDTO.java
  24. 7
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml
  25. 15
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archives/ArchivesDao.xml
  26. 3
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archivesdept/ArchivesDeptDao.xml
  27. 3
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/dept/DeptInfoDao.xml
  28. 16
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/ReportIssueDao.xml
  29. 3
      esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/specialuser/SpecialUserDao.xml
  30. 8
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/dao/HandleRoleDeptDao.java
  31. 9
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/HandleRoleDeptService.java
  32. 9
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/impl/HandleRoleDeptServiceImpl.java
  33. 8
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/OrganizationModifyConsumer.java
  34. 4
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handleroledept/HandleRoleDeptDao.xml
  35. 6
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml
  36. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActApplyInfoFormDTO.java
  37. 6
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml
  38. 19
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActApplyInfoDao.java
  39. 9
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActApplyInfoService.java
  40. 118
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java
  41. 46
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/OrganizationModifyConsumer.java
  42. 2
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java
  43. 37
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/OrganizationModifyDTO.java
  44. 3
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml
  45. 16
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActApplyInfoDao.xml
  46. 8
      esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml
  47. 9
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicSubmitFormDTO.java
  48. 5
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml
  49. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java
  50. 16
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java
  51. 16
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java
  52. 16
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyUserGroupDao.java
  53. 56
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java
  54. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java
  55. 37
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java
  56. 10
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java
  57. 9
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicService.java
  58. 9
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyUserGroupService.java
  59. 61
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java
  60. 56
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java
  61. 61
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java
  62. 3
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/application.yml
  63. 15
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml
  64. 16
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml
  65. 15
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyUserGroupDao.xml
  66. 156
      esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/logback-spring.xml
  67. 8
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java
  68. 9
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java
  69. 11
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java
  70. 9
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java
  71. 9
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java
  72. 51
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java
  73. 4
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java
  74. 58
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java
  75. 12
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml
  76. 12
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

20
esua-epdc/epdc-admin/epdc-admin-server/src/main/resources/mapper/SysUserDao.xml

@ -7,16 +7,19 @@
select t1.*, (select t2.name from sys_dept t2 where t2.id=t1.dept_id) deptName from sys_user t1
where t1.del_flag = 0 and t1.super_admin = 0
<if test="username != null and username.trim() != ''">
and t1.username like #{username}
and t1.username
like concat('%', #{username}, '%')
</if>
<if test="realname != null and realname.trim() != ''">
and t1.real_name like #{realname}
and t1.real_name
like concat('%', #{realname}, '%')
</if>
<if test="mobile != null and mobile.trim() != ''">
and t1.mobile like #{mobile}
and t1.mobile
like concat('%', #{mobile}, '%')
</if>
<if test="email != null and email.trim() != ''">
and t1.email like #{email}
and t1.email like concat('%', #{email}, '%')
</if>
<if test="deptIdList != null">
and t1.dept_id in
@ -56,7 +59,8 @@
sys_user u
LEFT JOIN sys_dept d ON u.dept_id = d.id
WHERE
u.username = #{value} AND u.del_flag = 0
u.username
like concat('%', #{value}, '%') AND u.del_flag = 0
</select>
<update id="updatePassword">
@ -175,7 +179,8 @@
u.scrip
from sys_user u
LEFT JOIN sys_user_dept ud ON u.id = ud.user_id AND ud.del_flag = '0'
where u.del_flag='0' and ud.dept_id=#{gridId} and u.mobile = #{mobile}
where u.del_flag='0' and ud.dept_id=#{gridId} and u.mobile
like concat('%', #{mobile}, '%')
order by u.CREATE_DATE desc
limit 1
</select>
@ -201,6 +206,7 @@
OPEN_ID,
scrip
from sys_user
where del_flag='0' and scrip = #{scrip}
where del_flag='0' and scrip
like concat('%', #{scrip}, '%')
</select>
</mapper>

5
esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/security/content/ModuleName.java

@ -15,7 +15,10 @@ public enum ModuleName {
ITEM_SATISFACTION("item_satisfaction","项目详情-满意度评价"),
PARTY_GROUP_TOPIC("party_group_topic","党群1+1-发个新话题"),
PARTY_GROUP_TOPIC_COMMENT("party_group_topic_comment","党群1+1-评论"),
HELP_SIGNIN("help_signIn","初心互助-已报名活动-我要打卡");
HELP_SIGNIN("help_signIn","初心互助-已报名活动-我要打卡"),
ACT_APPLY("act_apply","初心互助-申请发单"),
REPORT_ISSUE("report_issue","我要举报")
;
private String name;

2
esua-epdc/epdc-module/epdc-content-security/epdc-content-security-server/pom.xml

@ -179,7 +179,7 @@
<properties>
<spring.profiles.active>test</spring.profiles.active>
<server.port>11016</server.port>
<server.port>11017</server.port>
<spring.redis.index>2</spring.redis.index>
<spring.redis.host>114.215.125.123</spring.redis.host>

5
esua-epdc/epdc-module/epdc-custom/epdc-custom-client/src/main/java/com/elink/esua/epdc/dto/form/ReportIssueSubmitFormDTO.java

@ -97,4 +97,9 @@ public class ReportIssueSubmitFormDTO implements Serializable {
* 所有部门
*/
private String allDeptNames;
/**
*是否提交为内容待审核状态
*/
private Boolean isConReview;
}

23
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/pom.xml

@ -68,6 +68,12 @@
<artifactId>orika-spring-boot-starter</artifactId>
<version>1.8.0</version>
</dependency>
<!--RocketMq-->
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-spring-boot-starter</artifactId>
<version>2.0.2</version>
</dependency>
</dependencies>
<build>
@ -150,6 +156,12 @@
<nacos.ip>47.104.224.45</nacos.ip>
<nacos.namespace>fa5bf520-09c1-410c-a876-28e98c0534d3</nacos.namespace>
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
</properties>
</profile>
@ -175,6 +187,11 @@
<nacos.server-addr>47.104.224.45:8848</nacos.server-addr>
<nacos.ip>47.104.224.45</nacos.ip>
<nacos.namespace>fa5bf520-09c1-410c-a876-28e98c0534d3</nacos.namespace>
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
</properties>
</profile>
@ -202,6 +219,12 @@
</spring.datasource.druid.url>
<spring.datasource.druid.username>epdc</spring.datasource.druid.username>
<spring.datasource.druid.password>epdc@jinshui888</spring.datasource.druid.password>
<!--RocketMQ-->
<rocketmq.name.server>172.16.0.7:9876;172.16.0.8:9876</rocketmq.name.server>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
</properties>
</profile>
</profiles>

16
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/dao/ArchivesDao.java

@ -79,4 +79,20 @@ public interface ArchivesDao extends BaseDao<ArchivesEntity> {
* @return java.util.List<com.elink.esua.epdc.dto.result.ArchiveResultDTO>
**/
ArchiveDetailResultDTO selectArchiveDetailInfo(String id);
/**
* @Description 查询需要修改组织机构信息事件
* @Author songyunpeng
* @Date 2020/11/25
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.dto.ArchivesDTO>
**/
List<ArchivesDTO> selectListOfOrganizationInfo(String toString);
/**
* @Description 更新部门名
* @Author songyunpeng
* @Date 2020/11/25
* @Param [newDeptName, deptId]
* @return void
**/
void updateGridByDeptId(String newDeptName, Long deptId);
}

9
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/ArchivesService.java

@ -28,6 +28,7 @@ import com.elink.esua.epdc.dto.result.ArchiveDetailResultDTO;
import com.elink.esua.epdc.dto.result.ArchiveResultDTO;
import com.elink.esua.epdc.modules.archives.entity.ArchivesEntity;
import com.elink.esua.epdc.modules.archives.excel.ArchivesExcel;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -148,4 +149,12 @@ public interface ArchivesService extends BaseService<ArchivesEntity> {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.result.ArchiveDetailResultDTO>
**/
Result<ArchiveDetailResultDTO> getArchiveDetail(String id);
/**
* @Description 档案修改组织机构
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

56
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archives/service/impl/ArchivesServiceImpl.java

@ -27,12 +27,12 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.exception.RenException;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.config.StreamUtils;
import com.elink.esua.epdc.dto.ArchivesDTO;
import com.elink.esua.epdc.dto.EpdcArchivesErroyResultDTO;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.form.ArchiveDeptFormDTO;
import com.elink.esua.epdc.dto.form.ArchiveFormDTO;
import com.elink.esua.epdc.dto.result.ArchiveDeptResultDTO;
@ -45,6 +45,7 @@ import com.elink.esua.epdc.modules.archives.redis.ArchivesRedis;
import com.elink.esua.epdc.modules.archives.service.ArchivesService;
import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -258,6 +259,59 @@ public class ArchivesServiceImpl extends BaseServiceImpl<ArchivesDao, ArchivesEn
return new Result<ArchiveDetailResultDTO>().ok(archiveDetailResultDTO);
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改组织机构信息事件
List<ArchivesDTO> eventsList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != eventsList && eventsList.size() > 0) {
// 组织机构信息处理
List<ArchivesEntity> entities = handleOrganizationInfo(dto, eventsList);
// 更新事件组织机构信息
updateBatchById(entities);
}
// 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
/**
* 组织机构信息处理
*
* @return java.util.List<com.elink.esua.epdc.entity.UserEntity>
* @params [dto, userList]
* @author liuchuang
* @since 2020/3/7 15:22
*/
private List<ArchivesEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<ArchivesDTO> userList) {
List<ArchivesEntity> entities = new ArrayList<>();
for (ArchivesDTO user : userList) {
ArchivesEntity entity = new ArchivesEntity();
if (StringUtils.isNotEmpty(user.getParentDeptIds()) && StringUtils.isNotEmpty(user.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(user.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(user.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(user.getAllDeptIds()) && StringUtils.isNotEmpty(user.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(user.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(user.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
/***
* 批量添加档案
* @return java.lang.String

9
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/dao/ArchivesDeptDao.java

@ -29,5 +29,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ArchivesDeptDao extends BaseDao<ArchivesDeptEntity> {
/**
* @Description 更新部门名
* @Author songyunpeng
* @Date 2020/11/25
* @Param [newDeptName, deptId]
* @return void
**/
void updateGridByDeptId(String newDeptName, Long deptId);
}

11
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/ArchivesDeptService.java

@ -21,6 +21,8 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.dto.ArchivesDeptDTO;
import com.elink.esua.epdc.modules.archivesdept.entity.ArchivesDeptEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -101,5 +103,12 @@ public interface ArchivesDeptService extends BaseService<ArchivesDeptEntity> {
* @date 2020/7/30 13:31
*/
boolean modifyArchives(Long deptId,String dept);
/**
* @Description 档案部门修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

12
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/archivesdept/service/impl/ArchivesDeptServiceImpl.java

@ -19,16 +19,16 @@ package com.elink.esua.epdc.modules.archivesdept.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.toolkit.SqlHelper;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.modules.archivesdept.dao.ArchivesDeptDao;
import com.elink.esua.epdc.dto.ArchivesDeptDTO;
import com.elink.esua.epdc.modules.archivesdept.dao.ArchivesDeptDao;
import com.elink.esua.epdc.modules.archivesdept.entity.ArchivesDeptEntity;
import com.elink.esua.epdc.modules.archivesdept.redis.ArchivesDeptRedis;
import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -117,4 +117,10 @@ public class ArchivesDeptServiceImpl extends BaseServiceImpl<ArchivesDeptDao, Ar
return true;
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
}

8
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/dept/dao/DeptInfoDao.java

@ -63,4 +63,12 @@ public interface DeptInfoDao extends BaseDao<DeptInfoEntity> {
* @Date 15:18 2020-05-20
**/
List<DeptInfoDTO> selectListDeptInfoPage(Map<String, Object> params);
/**
* @Description 更新部门名称
* @Author songyunpeng
* @Date 2020/11/25
* @Param [newDeptName, deptId]
* @return void
**/
void updateGridByDeptId(String newDeptName, Long deptId);
}

9
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/dept/service/DeptInfoService.java

@ -24,6 +24,7 @@ import com.elink.esua.epdc.dto.DeptInfoDTO;
import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO;
import com.elink.esua.epdc.dto.result.EpdcDeptInfoResultDTO;
import com.elink.esua.epdc.modules.dept.entity.DeptInfoEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -104,4 +105,12 @@ public interface DeptInfoService extends BaseService<DeptInfoEntity> {
* @Date 13:41 2020-05-20
**/
Result<List<EpdcDeptInfoResultDTO>> listDeptInfo(EpdcDeptInfoFormDTO formDTO);
/**
* @Description 部门信息表修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

9
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/dept/service/impl/DeptInfoServiceImpl.java

@ -22,9 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.user.SecurityUser;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.DeptInfoDTO;
import com.elink.esua.epdc.dto.form.EpdcDeptInfoFormDTO;
@ -33,6 +31,7 @@ import com.elink.esua.epdc.modules.dept.dao.DeptInfoDao;
import com.elink.esua.epdc.modules.dept.entity.DeptInfoEntity;
import com.elink.esua.epdc.modules.dept.redis.DeptInfoRedis;
import com.elink.esua.epdc.modules.dept.service.DeptInfoService;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -122,4 +121,10 @@ public class DeptInfoServiceImpl extends BaseServiceImpl<DeptInfoDao, DeptInfoEn
return new Result().ok(listDeptInfo);
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 更新部门名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
}

2
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/AdminFeignClient.java

@ -2,7 +2,7 @@ package com.elink.esua.epdc.modules.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.modules.feign.fallback.AdminFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;

27
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/ContentSecurityFeignClient.java

@ -0,0 +1,27 @@
package com.elink.esua.epdc.modules.feign;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.feign.fallback.ContentSecurityFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
/**
* 内容审核端接口
*
* @author wangtong
* @date 2020/7/6 15:58
*/
@FeignClient(name = ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, fallback = ContentSecurityFeignClientFallback.class)
public interface ContentSecurityFeignClient {
@PostMapping(value = "contentSecurity/handleResult/insertViolationsRecord", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result insertViolationsRecord(@RequestBody SaveCheckRecordsDTO record);
@PostMapping(value = "contentSecurity/handleResult/insertRecords", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)
Result insertRecords(@RequestBody SaveCheckRecordsDTO record);
}

2
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/AdminFeignClientFallback.java

@ -1,9 +1,9 @@
package com.elink.esua.epdc.modules.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.ParentAndAllDeptDTO;
import com.elink.esua.epdc.dto.SysSimpleDictDTO;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import org.springframework.stereotype.Component;

28
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/feign/fallback/ContentSecurityFeignClientFallback.java

@ -0,0 +1,28 @@
package com.elink.esua.epdc.modules.feign.fallback;
import com.elink.esua.epdc.commons.tools.constant.ServiceConstant;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO;
import com.elink.esua.epdc.commons.tools.utils.ModuleUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient;
import org.springframework.stereotype.Component;
/**
* @author wangtong
* @date 2020/7/6 15:58
*/
@Component
public class ContentSecurityFeignClientFallback implements ContentSecurityFeignClient {
@Override
public Result insertViolationsRecord(SaveCheckRecordsDTO record) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertViolationsRecord", record);
}
@Override
public Result insertRecords(SaveCheckRecordsDTO record) {
return ModuleUtils.feignConError(ServiceConstant.EPDC_CONTENT_SECURITY_SERVER, "insertRecords", record);
}
}

18
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/dao/ReportIssueDao.java

@ -18,6 +18,7 @@
package com.elink.esua.epdc.modules.reportissue.dao;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
import com.elink.esua.epdc.dto.ReportIssueDTO;
import com.elink.esua.epdc.dto.form.ReportIssueListFormDTO;
import com.elink.esua.epdc.dto.result.ReportIssueResultDTO;
import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity;
@ -53,5 +54,20 @@ public interface ReportIssueDao extends BaseDao<ReportIssueEntity> {
* @since 2020/10/23 16:23
*/
ReportIssueResultDTO selectOneReportIssue(String id);
/**
* @Description 查询需要修改组织机构信息事件
* @Author songyunpeng
* @Date 2020/11/25
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.dto.ArchivesDTO>
**/
List<ReportIssueDTO> selectListOfOrganizationInfo(String toString);
/**
* @Description 更新部门名
* @Author songyunpeng
* @Date 2020/11/25
* @Param [newDeptName, deptId]
* @return void
**/
void updateGridByDeptId(String newDeptName, Long deptId);
}

9
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/ReportIssueService.java

@ -26,6 +26,7 @@ import com.elink.esua.epdc.dto.form.ReportIssueShieldFormDTO;
import com.elink.esua.epdc.dto.form.ReportIssueSubmitFormDTO;
import com.elink.esua.epdc.dto.result.ReportIssueResultDTO;
import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -137,4 +138,12 @@ public interface ReportIssueService extends BaseService<ReportIssueEntity> {
* @since 2020/10/23 16:41
*/
Result modifyReportIssueShieldFlag(ReportIssueShieldFormDTO formDto);
/**
* @Description 我要举报修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

117
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/reportissue/service/impl/ReportIssueServiceImpl.java

@ -20,10 +20,16 @@ package com.elink.esua.epdc.modules.reportissue.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils;
import com.elink.esua.epdc.commons.tools.security.content.ModuleName;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.constant.CustomImageConstant;
import com.elink.esua.epdc.dto.ReportIssueDTO;
@ -31,15 +37,19 @@ import com.elink.esua.epdc.dto.form.ReportIssueListFormDTO;
import com.elink.esua.epdc.dto.form.ReportIssueShieldFormDTO;
import com.elink.esua.epdc.dto.form.ReportIssueSubmitFormDTO;
import com.elink.esua.epdc.dto.result.ReportIssueResultDTO;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient;
import com.elink.esua.epdc.modules.reportissue.dao.ReportIssueDao;
import com.elink.esua.epdc.modules.reportissue.entity.ReportIssueEntity;
import com.elink.esua.epdc.modules.reportissue.service.CustomImgService;
import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@ -56,6 +66,13 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
@Autowired
private CustomImgService customImgService;
@Autowired
private AdminFeignClient adminFeignClient;
@Autowired
private ContentSecurityFeignClient contentSecurityFeign;
@Override
public PageData<ReportIssueDTO> page(Map<String, Object> params) {
// 检索条件
@ -128,11 +145,56 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
@Override
@Transactional(rollbackFor = Exception.class)
public Result saveReportIssue(ReportIssueSubmitFormDTO formDto) {
//内容审核 - start
Boolean isConReview = formDto.getIsConReview();
List<String> textList = new ArrayList<>();
textList.add(formDto.getContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(formDto.getDeptId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
CheckResultDTO imgResult = CheckDataUtils.checkImgs(formDto.getImages());
if(!isConReview &&
((contentResult != null && !contentResult.getAllPass()) || (imgResult != null && !imgResult.getAllPass()))){
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
formDto.getNickname(), CheckDataUtils.cate_two, CheckDataUtils.decision_one, ModuleName.ISSUE_SUBMIT.getCode(), textList,
formDto.getImages(), null,contentResult, imgResult,null,formDto.getMobile(),"0",deptDto);
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
//内容审核 - end
ReportIssueEntity entity = ConvertUtils.sourceToTarget(formDto, ReportIssueEntity.class);
if (insert(entity)) {
// 保存图片
customImgService.saveImages(formDto.getImages(), entity.getId(), CustomImageConstant.IMAGE_TYPE_YJFW_JSQF_JBWT);
}
//内容审核 - start
//接口异常,保存至待审核信息
if((contentResult == null || imgResult == null) && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
formDto.getNickname(), CheckDataUtils.cate_two, null,ModuleName.ISSUE_SUBMIT.getCode(), textList,
formDto.getImages(), entity.getId(),null,null, null,formDto.getMobile(),"1",deptDto);
contentSecurityFeign.insertRecords(record);
}
//保存待审核记录
if (contentResult != null && imgResult != null) {
CheckResultMessageDTO twoTypes = null;
if(isConReview){
twoTypes = CheckDataUtils.saveTwoTypes(contentResult, imgResult);
}else{
twoTypes = CheckDataUtils.checkTwoTypes(contentResult, imgResult);
}
if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) {
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(formDto.getUserId(),
formDto.getNickname(), CheckDataUtils.cate_two, null, ModuleName.ISSUE_SUBMIT.getCode(), textList,
formDto.getImages(), entity.getId(), null, null, twoTypes, formDto.getMobile(), "0",deptDto);
contentSecurityFeign.insertRecords(record);
}
}
//内容审核 - end
return new Result();
}
@ -160,5 +222,58 @@ public class ReportIssueServiceImpl extends BaseServiceImpl<ReportIssueDao, Repo
return new Result();
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改组织机构信息事件
List<ReportIssueDTO> eventsList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != eventsList && eventsList.size() > 0) {
// 组织机构信息处理
List<ReportIssueEntity> entities = handleOrganizationInfo(dto, eventsList);
// 更新事件组织机构信息
updateBatchById(entities);
}
// 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
/**
* 组织机构信息处理
*
* @return java.util.List<com.elink.esua.epdc.entity.UserEntity>
* @params [dto, userList]
* @author liuchuang
* @since 2020/3/7 15:22
*/
private List<ReportIssueEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<ReportIssueDTO> userList) {
List<ReportIssueEntity> entities = new ArrayList<>();
for (ReportIssueDTO user : userList) {
ReportIssueEntity entity = new ReportIssueEntity();
if (StringUtils.isNotEmpty(user.getParentDeptIds()) && StringUtils.isNotEmpty(user.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(user.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(user.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(user.getAllDeptIds()) && StringUtils.isNotEmpty(user.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(user.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(user.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
}

63
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/OrganizationModifyConsumer.java

@ -0,0 +1,63 @@
package com.elink.esua.epdc.modules.rocketmq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant;
import com.elink.esua.epdc.modules.archives.service.ArchivesService;
import com.elink.esua.epdc.modules.archivesdept.service.ArchivesDeptService;
import com.elink.esua.epdc.modules.dept.service.DeptInfoService;
import com.elink.esua.epdc.modules.reportissue.service.ReportIssueService;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
* 组织机构信息修改-监听MQ消息
*
* @Authorliuchuang
* @Date2020/3/6 0:21
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ORGANIZATION, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING)
public class OrganizationModifyConsumer implements RocketMQListener<MessageExt> {
@Autowired
private ArchivesService archivesService;
@Autowired
private ArchivesDeptService archivesDeptService;
@Autowired
private DeptInfoService deptInfoService;
@Autowired
private ReportIssueService reportIssueService;
@Override
public void onMessage(MessageExt messageExt) {
log.info("EPDC-CUSTOM-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId());
try {
String charset = "UTF-8";
String body = new String(messageExt.getBody(), charset);
OrganizationModifyDTO dto = JSONObject.parseObject(body, OrganizationModifyDTO.class);
// 档案修改组织机构信息
archivesService.modifyOrganizationInfo(dto);
// 档案部门修改组织机构信息
archivesDeptService.modifyOrganizationInfo(dto);
// 部门信息表修改组织机构信息
deptInfoService.modifyOrganizationInfo(dto);
// 我要举报修改组织机构信息
reportIssueService.modifyOrganizationInfo(dto);
log.info("EPDC-CUSTOM-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body);
} catch (Exception e) {
log.info("EPDC-CUSTOM-SERVER消费消息失败:msgId:{}", messageExt.getMsgId());
e.printStackTrace();
}
}
}

37
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/OrganizationModifyDTO.java

@ -0,0 +1,37 @@
package com.elink.esua.epdc.modules.rocketmq.dto;
import lombok.Data;
import java.io.Serializable;
/**
*
* 组织机构信息修改-接收MQ消息DTO
*
* @Authorliuchuang
* @Date2020/3/6 22:34
*/
@Data
public class OrganizationModifyDTO implements Serializable {
private static final long serialVersionUID = 6288521726874495827L;
/**
* 部门ID
*/
private Long deptId;
/**
* 旧部门名称
*/
private String oldDeptName;
/**
* 新部门名称
*/
private String newDeptName;
/**
* 部门类型
*/
private String typeKey;
}

7
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/application.yml

@ -68,3 +68,10 @@ mybatis-plus:
map-underscore-to-camel-case: true
cache-enabled: false
call-setters-on-nulls: true
rocketmq:
name-server: @rocketmq.name.server@
consumer:
group: @rocketmq.consumer.group@

15
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archives/ArchivesDao.xml

@ -25,6 +25,9 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="updateGridByDeptId">
UPDATE epdc_archives SET DEPT = #{newDeptName}, UPDATED_TIME = NOW() WHERE DEPT_ID = #{deptId}
</update>
<select id="getArchivesPageFromPc" resultType="com.elink.esua.epdc.dto.ArchivesDTO">
select
ID,
@ -116,6 +119,18 @@
WHERE
DEL_FLAG = '0' and id = #{id}
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.ArchivesDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_archives
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
</mapper>

3
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/archivesdept/ArchivesDeptDao.xml

@ -15,6 +15,9 @@
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<update id="updateGridByDeptId">
UPDATE epdc_archives_dept SET DEPT = #{newDeptName}, UPDATED_TIME = NOW() WHERE DEPT_ID = #{deptId}
</update>
</mapper>

3
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/dept/DeptInfoDao.xml

@ -16,6 +16,9 @@
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="sort" column="SORT"/>
</resultMap>
<update id="updateGridByDeptId">
UPDATE epdc_dept_info SET DEPT_NAME = #{newDeptName}, UPDATED_TIME = NOW() WHERE DEPT_ID = #{deptId}
</update>
<select id="getDeptNameCount" resultType="int">
SELECT

16
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/reportissue/ReportIssueDao.xml

@ -60,5 +60,19 @@
ORDER BY
ci.IMG_URL
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.ReportIssueDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_report_issue
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
<update id="updateGridByDeptId">
UPDATE epdc_report_issue SET DEPT_NAME = #{newDeptName}, UPDATED_TIME = NOW() WHERE DEPT_ID = #{deptId}
</update>
</mapper>

3
esua-epdc/epdc-module/epdc-custom/epdc-custom-server/src/main/resources/mapper/specialuser/SpecialUserDao.xml

@ -66,7 +66,8 @@
and SU_DISABILITY_TYPE = #{suDisabilityType}
</if>
<if test="suVillage!=null and suVillage!=''">
and SU_VILLAGE = #{suVillage}
and SU_VILLAGE
like concat('%', #{suVillage}, '%')
</if>
<if test="suIsLow == 1">
and SU_IS_LOW = '1'

8
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/dao/HandleRoleDeptDao.java

@ -42,4 +42,12 @@ public interface HandleRoleDeptDao extends BaseDao<HandleRoleDeptEntity> {
List<Long> queryWhistleDeptIdList(String roleId);
int deleteByRoleId(String roleId);
/**
* @Description 修改处理部门名称
* @Author songyunpeng
* @Date 2020/11/24
* @Param [newDeptName, deptId]
* @return void
**/
void updateDeptNameByDeptId(String newDeptName, Long deptId);
}

9
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/HandleRoleDeptService.java

@ -25,6 +25,7 @@ import com.elink.esua.epdc.dto.handleroledept.HandleRoleDeptDTO;
import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO;
import com.elink.esua.epdc.dto.handleroledept.result.HandleRoleDeptPermissionDTO;
import com.elink.esua.epdc.modules.handleroledept.entity.HandleRoleDeptEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -123,4 +124,12 @@ public interface HandleRoleDeptService extends BaseService<HandleRoleDeptEntity>
* @Date 2019/12/26 15:01
**/
Result<List<HandleRoleDeptPermissionDTO>> listHandleRoleDeptPermission(String roleId);
/**
* @Description 修改处理部门名称
* @Author songyunpeng
* @Date 2020/11/24
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

9
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/handleroledept/service/impl/HandleRoleDeptServiceImpl.java

@ -21,9 +21,9 @@ import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.dto.handleroledept.HandleRoleDeptDTO;
import com.elink.esua.epdc.dto.handleroledept.form.HandleRoleDeptFormDTO;
@ -32,7 +32,7 @@ import com.elink.esua.epdc.modules.handleroledept.dao.HandleRoleDeptDao;
import com.elink.esua.epdc.modules.handleroledept.entity.HandleRoleDeptEntity;
import com.elink.esua.epdc.modules.handleroledept.redis.HandleRoleDeptRedis;
import com.elink.esua.epdc.modules.handleroledept.service.HandleRoleDeptService;
import com.elink.esua.epdc.modules.rolecategory.entity.HandleRoleCategoryEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -163,5 +163,10 @@ public class HandleRoleDeptServiceImpl extends BaseServiceImpl<HandleRoleDeptDao
List<HandleRoleDeptPermissionDTO> list = ConvertUtils.sourceToTarget(handleRoleDeptEntityList, HandleRoleDeptPermissionDTO.class);
return new Result<List<HandleRoleDeptPermissionDTO>>().ok(list);
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 更新部门名称
baseDao.updateDeptNameByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
}

8
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/OrganizationModifyConsumer.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.modules.rocketmq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant;
import com.elink.esua.epdc.modules.events.service.EpdcEventsService;
import com.elink.esua.epdc.modules.handleroledept.service.HandleRoleDeptService;
import com.elink.esua.epdc.modules.issue.service.IssueHandleService;
import com.elink.esua.epdc.modules.issue.service.IssueService;
import com.elink.esua.epdc.modules.item.service.*;
@ -51,6 +52,11 @@ public class OrganizationModifyConsumer implements RocketMQListener<MessageExt>
@Autowired
private ItemInformationService itemInformationService;
@Autowired
private HandleRoleDeptService handleRoleDeptService;
@Override
public void onMessage(MessageExt messageExt) {
log.info("EPDC-EVENTS-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId());
@ -74,6 +80,8 @@ public class OrganizationModifyConsumer implements RocketMQListener<MessageExt>
itemHandleProcessService.modifyOrganizationInfo(dto);
//项目消息表修改处理部门
itemInformationService.modifyOrganizationInfo(dto);
//处理部门角色权限表处理部门
handleRoleDeptService.modifyOrganizationInfo(dto);
log.info("EPDC-EVENTS-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body);
} catch (Exception e) {
log.info("EPDC-EVENTS-SERVER消费消息失败:msgId:{}", messageExt.getMsgId());

4
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/handleroledept/HandleRoleDeptDao.xml

@ -28,4 +28,8 @@
<delete id="deleteByRoleId" parameterType="java.lang.String">
delete from epdc_handle_role_dept where ROLE_ID=#{roleId}
</delete>
<update id="updateDeptNameByDeptId">
UPDATE epdc_handle_role_dept SET DEPT_NAME = #{newDeptName}, UPDATED_TIME = NOW() WHERE DEPT_ID = #{deptId}
</update>
</mapper>

6
esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/resources/mapper/item/ItemDao.xml

@ -887,7 +887,7 @@
(
SELECT
'ITEM_COUNT' AS keystr,
COUNT( * ) AS pendingHandleNum
COUNT( DISTINCT item.ID ) AS pendingHandleNum
FROM
epdc_item item
LEFT JOIN epdc_item_dept dept ON item.id = dept.ITEM_ID
@ -907,7 +907,7 @@
INNER JOIN (
SELECT
'ITEM_COUNT' AS keystr,
COUNT( * ) AS closingCaseNum
COUNT( DISTINCT item.ID ) AS closingCaseNum
FROM
epdc_item item
LEFT JOIN epdc_item_dept dept ON item.id = dept.ITEM_ID
@ -926,7 +926,7 @@
INNER JOIN (
SELECT
'ITEM_COUNT' AS keystr,
COUNT( * ) AS closedNum
COUNT( DISTINCT item.ID ) AS closedNum
FROM
epdc_item item
LEFT JOIN epdc_item_dept dept ON item.id = dept.ITEM_ID

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-client/src/main/java/com/elink/esua/epdc/activity/form/ActApplyInfoFormDTO.java

@ -142,4 +142,10 @@ public class ActApplyInfoFormDTO implements Serializable {
*/
private String allDeptNames;
/**
*是否提交为内容待审核状态
*/
private Boolean isConReview;
}

6
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/pom.xml

@ -175,6 +175,8 @@
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
</properties>
</profile>
@ -203,6 +205,8 @@
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
</properties>
</profile>
@ -233,6 +237,8 @@
<!--RocketMQ-->
<rocketmq.name.server>172.16.0.7:9876;172.16.0.8:9876</rocketmq.name.server>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
</properties>
</profile>
</profiles>

19
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/dao/ActApplyInfoDao.java

@ -17,6 +17,7 @@
package com.elink.esua.epdc.modules.activity.dao;
import com.elink.esua.epdc.activity.ActApplyInfoDTO;
import com.elink.esua.epdc.activity.form.ActApplyRecordFormDTO;
import com.elink.esua.epdc.activity.result.ActApplyRecordResultDTO;
import com.elink.esua.epdc.commons.mybatis.dao.BaseDao;
@ -41,4 +42,22 @@ public interface ActApplyInfoDao extends BaseDao<ActApplyInfoEntity> {
* @return java.util.List<com.elink.esua.epdc.activity.result.ActApplyRecordResultDTO>
**/
List<ActApplyRecordResultDTO> selectListActApplyRecord(ActApplyRecordFormDTO actApplyRecordFormDTO);
/**
* @Description 查询需要修改组织机构信息事件
* @Author songyunpeng
* @Date 2020/11/25
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.activity.ActApplyInfoDTO>
**/
List<ActApplyInfoDTO> selectListOfOrganizationInfo(String toString);
/**
*
* 更新网格名称
*
* @params [newDeptName, deptId]
* @return void
* @author liuchuang
* @since 2020/3/7 1:20
*/
void updateGridByDeptId(String newDeptName, Long deptId);
}

9
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/ActApplyInfoService.java

@ -25,6 +25,7 @@ import com.elink.esua.epdc.commons.mybatis.service.BaseService;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.entity.ActApplyInfoEntity;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -120,4 +121,12 @@ public interface ActApplyInfoService extends BaseService<ActApplyInfoEntity> {
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.activity.result.ActApplyRecordResultDTO>
**/
Result<List<ActApplyRecordResultDTO>> applyRecord(ActApplyRecordFormDTO actApplyRecordFormDTO);
/**
* @Description 活动申请修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

118
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/activity/service/impl/ActApplyInfoServiceImpl.java

@ -27,21 +27,27 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl;
import com.elink.esua.epdc.commons.tools.constant.FieldConstant;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.page.PageData;
import com.elink.esua.epdc.commons.tools.security.content.CheckDataUtils;
import com.elink.esua.epdc.commons.tools.security.content.ModuleName;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.ParentAndAllDeptDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.form.SaveCheckRecordsDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultDTO;
import com.elink.esua.epdc.commons.tools.security.content.dto.result.CheckResultMessageDTO;
import com.elink.esua.epdc.commons.tools.utils.ConvertUtils;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.modules.activity.dao.ActApplyInfoDao;
import com.elink.esua.epdc.modules.activity.entity.ActApplyInfoEntity;
import com.elink.esua.epdc.modules.activity.redis.ActApplyInfoRedis;
import com.elink.esua.epdc.modules.activity.service.ActApplyInfoService;
import com.elink.esua.epdc.modules.feign.AdminFeignClient;
import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 活动申请信息表
@ -54,7 +60,10 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl<ActApplyInfoDao, Ac
@Autowired
private ActApplyInfoRedis actApplyInfoRedis;
@Autowired
private ContentSecurityFeignClient contentSecurityFeign;
@Autowired
private AdminFeignClient adminFeignClient;
@Override
public PageData<ActApplyInfoDTO> page(Map<String, Object> params) {
IPage<ActApplyInfoEntity> page = baseDao.selectPage(
@ -128,9 +137,52 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl<ActApplyInfoDao, Ac
if(dto.getActStartTime().after(dto.getActEndTime())){
return new Result().error("开始时间不能大于结束时间");
}
//内容审核 - start
Boolean isConReview = dto.getIsConReview();
List<String> textList = new ArrayList<>();
textList.add(dto.getActContent());
// 获取所有上级机构名称和ID拼接
ParentAndAllDeptDTO deptDto = adminFeignClient.getParentAndAllDept(dto.getGridId()).getData();
CheckResultDTO contentResult = CheckDataUtils.checkContent(textList);
if (!isConReview && (contentResult != null && !contentResult.getAllPass())) {
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(dto.getApplyUserId(),
dto.getNickname(),CheckDataUtils.cate_two , CheckDataUtils.decision_one,
ModuleName.ISSUE_COMMENT.getCode(), textList,null, null,contentResult,
null,null,dto.getMobile(),"0",deptDto);
contentSecurityFeign.insertViolationsRecord(record);
return new Result().error(CheckDataUtils.violations_code,CheckDataUtils.violations_message);
}
//内容审核 - end
ActApplyInfoEntity entity = ConvertUtils.sourceToTarget(dto, ActApplyInfoEntity.class);
insert(entity);
//内容审核 - 开始
//接口异常,保存至待审核信息
if(contentResult == null && !isConReview) {
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(dto.getApplyUserId(),
dto.getNickname(), CheckDataUtils.cate_two, null,ModuleName.ISSUE_COMMENT.getCode(), textList,
null, entity.getId(),null,null, null,dto.getMobile(),"1",deptDto);
contentSecurityFeign.insertRecords(record);
}
//判断是否为待审核
if (contentResult != null) {
CheckResultMessageDTO twoTypes = null;
if(isConReview){
twoTypes = CheckDataUtils.saveTwoTypes(contentResult, null);
}else{
twoTypes = CheckDataUtils.checkTwoTypes(contentResult, null);
}
if (CheckDataUtils.review.equals(twoTypes.getSuggestion())) {
//组装要保存的信息
SaveCheckRecordsDTO record = CheckDataUtils.getPackageRecords(dto.getApplyUserId(),
dto.getNickname(), CheckDataUtils.cate_two, null, ModuleName.ISSUE_COMMENT.getCode(), textList,
null,entity.getId(), null,null,twoTypes,dto.getMobile(),"0",deptDto);
contentSecurityFeign.insertRecords(record);
}
}
//内容审核 - 结束
return new Result();
}
@ -143,4 +195,58 @@ public class ActApplyInfoServiceImpl extends BaseServiceImpl<ActApplyInfoDao, Ac
return new Result<List<ActApplyRecordResultDTO>>().ok(actApplyRecordResultDTOS);
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改组织机构信息事件
List<ActApplyInfoDTO> eventsList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != eventsList && eventsList.size() > 0) {
// 组织机构信息处理
List<ActApplyInfoEntity> entities = handleOrganizationInfo(dto, eventsList);
// 更新事件组织机构信息
updateBatchById(entities);
}
// 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
/**
*
* 组织机构信息处理
*
* @params [dto, eventsList]
* @return java.util.List<com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity>
* @author liuchuang
* @since 2020/3/7 1:17
*/
private List<ActApplyInfoEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<ActApplyInfoDTO> eventsList) {
List<ActApplyInfoEntity> entities = new ArrayList<>();
for (ActApplyInfoDTO events: eventsList) {
ActApplyInfoEntity entity = new ActApplyInfoEntity();
if (StringUtils.isNotEmpty(events.getParentDeptIds()) && StringUtils.isNotEmpty(events.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(events.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(events.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(events.getAllDeptIds()) && StringUtils.isNotEmpty(events.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(events.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(events.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
}

46
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/OrganizationModifyConsumer.java

@ -0,0 +1,46 @@
package com.elink.esua.epdc.modules.rocketmq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant;
import com.elink.esua.epdc.modules.activity.service.ActApplyInfoService;
import com.elink.esua.epdc.modules.rocketmq.dto.OrganizationModifyDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
* 组织机构信息修改-监听MQ消息
*
* @Authorliuchuang
* @Date2020/3/6 0:21
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ORGANIZATION, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING)
public class OrganizationModifyConsumer implements RocketMQListener<MessageExt> {
@Autowired
private ActApplyInfoService actApplyInfoService;
@Override
public void onMessage(MessageExt messageExt) {
log.info("EPDC-HEART-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId());
try {
String charset = "UTF-8";
String body = new String(messageExt.getBody(), charset);
OrganizationModifyDTO dto = JSONObject.parseObject(body, OrganizationModifyDTO.class);
// 活动申请修改组织机构信息
actApplyInfoService.modifyOrganizationInfo(dto);
log.info("EPDC-HEART-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body);
} catch (Exception e) {
log.info("EPDC-HEART-SERVER消费消息失败:msgId:{}", messageExt.getMsgId());
e.printStackTrace();
}
}
}

2
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/consumer/RejectCheckRecordConsumer.java

@ -21,7 +21,7 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING)
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_HEART_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING)
public class RejectCheckRecordConsumer implements RocketMQListener<MessageExt> {
@Autowired

37
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/java/com/elink/esua/epdc/modules/rocketmq/dto/OrganizationModifyDTO.java

@ -0,0 +1,37 @@
package com.elink.esua.epdc.modules.rocketmq.dto;
import lombok.Data;
import java.io.Serializable;
/**
*
* 组织机构信息修改-接收MQ消息DTO
*
* @Authorliuchuang
* @Date2020/3/6 22:34
*/
@Data
public class OrganizationModifyDTO implements Serializable {
private static final long serialVersionUID = 6288521726874495827L;
/**
* 部门ID
*/
private Long deptId;
/**
* 旧部门名称
*/
private String oldDeptName;
/**
* 新部门名称
*/
private String newDeptName;
/**
* 部门类型
*/
private String typeKey;
}

3
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/application.yml

@ -91,4 +91,5 @@ mybatis-plus:
rocketmq:
name-server: @rocketmq.name.server@
consumer:
group: @rocketmq.consumer.contentSecurity.group@
group: @rocketmq.consumer.group@
contentSecurity-group: @rocketmq.consumer.contentSecurity.group@

16
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActApplyInfoDao.xml

@ -42,6 +42,20 @@
order by CREATED_TIME desc
LIMIT #{pageIndex},#{pageSize}
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.activity.ActApplyInfoDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_act_apply_info
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
<update id="updateGridByDeptId">
UPDATE epdc_act_apply_info SET GRID = #{newDeptName}, UPDATED_TIME = NOW() WHERE GRID_ID = #{deptId}
</update>
</mapper>

8
esua-epdc/epdc-module/epdc-heart/epdc-heart-server/src/main/resources/mapper/activity/ActUserRelationDao.xml

@ -97,10 +97,10 @@
AND relation.STATUS = #{status}
</if>
<if test="mobile != null and mobile.trim() != ''">
AND relation.MOBILE = trim(#{mobile})
AND relation.MOBILE like concat('%',trim(#{mobile}), '%')
</if>
<if test="realName != null and realName.trim() != ''">
AND relation.REAL_NAME = trim(#{realName})
AND relation.REAL_NAME like concat('%',trim(#{realName}), '%')
</if>
<if test="actId != null and actId != ''">
AND relation.ACT_ID = #{actId}
@ -173,10 +173,10 @@
AND relation.STATUS = #{status}
</if>
<if test="mobile != null and mobile.trim() != ''">
AND relation.MOBILE = trim(#{mobile})
AND relation.MOBILE like concat('%',trim(#{mobile}), '%')
</if>
<if test="realName != null and realName.trim() != ''">
AND relation.REAL_NAME = trim(#{realName})
AND relation.REAL_NAME like concat('%',trim(#{realName}), '%')
</if>
<if test="actId != null and actId != ''">
AND relation.ACT_ID = #{actId}

9
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyTopicSubmitFormDTO.java

@ -3,6 +3,7 @@ package com.elink.esua.epdc.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.math.BigDecimal;
@ -22,8 +23,8 @@ public class PartyTopicSubmitFormDTO implements Serializable {
/**
* 话题内容
*/
@NotBlank(message = "话题内容不能为空且在2000个字以内")
@Size(min = 1, max = 2000, message = "话题内容不能为空且在2000个字以内")
@NotBlank(message = "话题内容不能为空且在1000个字以内")
@Size(min = 1, max = 1000, message = "话题内容不能为空且在1000个字以内")
private String topicContent;
/**
@ -41,13 +42,13 @@ public class PartyTopicSubmitFormDTO implements Serializable {
/**
* 话题位置纬度
*/
@NotBlank(message = "话题位置纬度不能为空")
@NotNull(message = "话题位置纬度不能为空")
private BigDecimal topicLatitude;
/**
* 话题位置经度
*/
@NotBlank(message = "话题位置经度不能为空")
@NotNull(message = "话题位置经度不能为空")
private BigDecimal topicLongitude;
/**

5
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/pom.xml

@ -157,6 +157,7 @@
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
</properties>
</profile>
@ -186,6 +187,8 @@
<!--RocketMQ-->
<rocketmq.name.server>47.104.85.99:9876;114.215.125.123:9876</rocketmq.name.server>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
</properties>
</profile>
@ -217,6 +220,8 @@
<!--RocketMQ-->
<rocketmq.name.server>172.16.0.7:9876;172.16.0.8:9876</rocketmq.name.server>
<rocketmq.consumer.contentSecurity.group>jinshui-contentSecurityGroup</rocketmq.consumer.contentSecurity.group>
<rocketmq.consumer.group>jinshui-organizationGroup</rocketmq.consumer.group>
</properties>
</profile>
</profiles>

2
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java

@ -17,7 +17,6 @@
package com.elink.esua.epdc.controller;
import com.elink.esua.epdc.common.token.dto.TokenDto;
import com.elink.esua.epdc.commons.tools.constant.NumConstant;
import com.elink.esua.epdc.commons.tools.utils.Result;
import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils;
@ -75,6 +74,7 @@ public class AppPartyTopicController {
**/
@PostMapping("submit")
public Result submit(@RequestBody PartyTopicSubmitFormDTO formDto) {
ValidatorUtils.validateEntity(formDto);
return partyTopicService.saveTopic(formDto);
}

16
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyGroupDao.java

@ -74,4 +74,20 @@ public interface PartyGroupDao extends BaseDao<PartyGroupEntity> {
* @return com.elink.esua.epdc.dto.PartyGroupDTO
**/
PartyGroupDTO getPartyGroupDTOByName(String partyGroupName);
/**
* @Description 查询需要修改组织机构信息事件
* @Author songyunpeng
* @Date 2020/11/25
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.dto.PartyGroupDTO>
**/
List<PartyGroupDTO> selectListOfOrganizationInfo(String toString);
/**
* @Description
* @Author songyunpeng
* @Date 2020/11/25
* @Param [newDeptName, deptId]
* @return void
**/
void updateGridByDeptId(String newDeptName, Long deptId);
}

16
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyTopicDao.java

@ -128,4 +128,20 @@ public interface PartyTopicDao extends BaseDao<PartyTopicEntity> {
* @since 2020/9/8 13:55
*/
void updateTopicTopFlagById(@Param("formDto") PartyGroupTopicTopFormDTO formDto);
/**
* @Description 查询需要修改组织机构信息事件
* @Author songyunpeng
* @Date 2020/11/25
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.dto.PartyTopicDTO>
**/
List<PartyTopicDTO> selectListOfOrganizationInfo(String toString);
/**
* @Description
* @Author songyunpeng
* @Date 2020/11/25
* @Param [newDeptName, deptId]
* @return void
**/
void updateGridByDeptId(String newDeptName, Long deptId);
}

16
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/dao/PartyUserGroupDao.java

@ -86,4 +86,20 @@ public interface PartyUserGroupDao extends BaseDao<PartyUserGroupEntity> {
* @return void
**/
void updateInfoByUserId(PartyUserNewInfoFormDTO formDTO);
/**
* @Description 查询需要修改组织机构信息事件
* @Author songyunpeng
* @Date 2020/11/25
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.dto.PartyUserGroupDTO>
**/
List<PartyUserGroupDTO> selectListOfOrganizationInfo(String toString);
/**
* @Description
* @Author songyunpeng
* @Date 2020/11/25
* @Param [newDeptName, deptId]
* @return void
**/
void updateGridByDeptId(String newDeptName, Long deptId);
}

56
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java

@ -0,0 +1,56 @@
package com.elink.esua.epdc.rocketmq.consumer;
import com.alibaba.fastjson.JSONObject;
import com.elink.esua.epdc.commons.tools.constant.RocketMqConstant;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.service.PartyGroupService;
import com.elink.esua.epdc.service.PartyTopicService;
import com.elink.esua.epdc.service.PartyUserGroupService;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.common.message.MessageExt;
import org.apache.rocketmq.spring.annotation.MessageModel;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
*
* 组织机构信息修改-监听MQ消息
*
* @Authorliuchuang
* @Date2020/3/6 0:21
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_ORGANIZATION, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING)
public class OrganizationModifyConsumer implements RocketMQListener<MessageExt> {
@Autowired
private PartyTopicService partyTopicService;
@Autowired
private PartyGroupService partyGroupService;
@Autowired
private PartyUserGroupService partyUserGroupService;
@Override
public void onMessage(MessageExt messageExt) {
log.info("EPDC-HEART-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId());
try {
String charset = "UTF-8";
String body = new String(messageExt.getBody(), charset);
OrganizationModifyDTO dto = JSONObject.parseObject(body, OrganizationModifyDTO.class);
// 话题修改组织机构信息
partyTopicService.modifyOrganizationInfo(dto);
// 党群修改组织机构信息
partyGroupService.modifyOrganizationInfo(dto);
// 党群成员修改组织机构信息
partyUserGroupService.modifyOrganizationInfo(dto);
log.info("EPDC-HEART-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body);
} catch (Exception e) {
log.info("EPDC-HEART-SERVER消费消息失败:msgId:{}", messageExt.getMsgId());
e.printStackTrace();
}
}
}

2
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/RejectCheckRecordConsumer.java

@ -22,7 +22,7 @@ import org.springframework.stereotype.Component;
*/
@Slf4j
@Component
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.group}", messageModel = MessageModel.BROADCASTING)
@RocketMQMessageListener(topic = RocketMqConstant.MQ_TOPIC_GROUP_CONTENTSECURITY, consumerGroup = "${rocketmq.consumer.contentSecurity-group}", messageModel = MessageModel.BROADCASTING)
public class RejectCheckRecordConsumer implements RocketMQListener<MessageExt> {
@Autowired

37
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/rocketmq/dto/OrganizationModifyDTO.java

@ -0,0 +1,37 @@
package com.elink.esua.epdc.rocketmq.dto;
import lombok.Data;
import java.io.Serializable;
/**
*
* 组织机构信息修改-接收MQ消息DTO
*
* @Authorliuchuang
* @Date2020/3/6 22:34
*/
@Data
public class OrganizationModifyDTO implements Serializable {
private static final long serialVersionUID = 6288521726874495827L;
/**
* 部门ID
*/
private Long deptId;
/**
* 旧部门名称
*/
private String oldDeptName;
/**
* 新部门名称
*/
private String newDeptName;
/**
* 部门类型
*/
private String typeKey;
}

10
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyGroupService.java

@ -27,6 +27,7 @@ import com.elink.esua.epdc.dto.form.PartyGroupListFormDTO;
import com.elink.esua.epdc.dto.form.PartyUserJoinGroupFormDTO;
import com.elink.esua.epdc.dto.result.PartyGroupResultDTO;
import com.elink.esua.epdc.entity.PartyGroupEntity;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -146,5 +147,12 @@ public interface PartyGroupService extends BaseService<PartyGroupEntity> {
* @return com.elink.esua.epdc.dto.PartyGroupDTO
**/
PartyGroupDTO getPartyGroupDTOByName(String partyGroupName);
/**
* @Description 修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

9
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyTopicService.java

@ -26,6 +26,7 @@ import com.elink.esua.epdc.dto.form.*;
import com.elink.esua.epdc.dto.result.PartyTopicDetailResultDTO;
import com.elink.esua.epdc.dto.result.PartyTopicResultDTO;
import com.elink.esua.epdc.entity.PartyTopicEntity;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO;
import java.util.List;
@ -200,4 +201,12 @@ public interface PartyTopicService extends BaseService<PartyTopicEntity> {
* @since 2020/9/8 9:44
*/
Result modifyTopicTopFlag(PartyGroupTopicTopFormDTO formDto);
/**
* @Description 修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

9
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/PartyUserGroupService.java

@ -29,6 +29,7 @@ import com.elink.esua.epdc.dto.form.PartyUserIdentityFormDTO;
import com.elink.esua.epdc.dto.form.PartyUserNewInfoFormDTO;
import com.elink.esua.epdc.dto.result.PartyUserGroupResultDTO;
import com.elink.esua.epdc.entity.PartyUserGroupEntity;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -173,4 +174,12 @@ public interface PartyUserGroupService extends BaseService<PartyUserGroupEntity>
* @return com.elink.esua.epdc.commons.tools.utils.Result
**/
Result updateInfo(PartyUserNewInfoFormDTO formDTO);
/**
* @Description 修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

61
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyGroupServiceImpl.java

@ -31,10 +31,12 @@ import com.elink.esua.epdc.dto.form.PartyGroupListFormDTO;
import com.elink.esua.epdc.dto.form.PartyUserJoinGroupFormDTO;
import com.elink.esua.epdc.dto.result.PartyGroupResultDTO;
import com.elink.esua.epdc.entity.PartyGroupEntity;
import com.elink.esua.epdc.entity.PartyTopicEntity;
import com.elink.esua.epdc.entity.PartyUserGroupEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.feign.UserFeignClient;
import com.elink.esua.epdc.redis.PartyGroupRedis;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.service.PartyGroupService;
import com.elink.esua.epdc.service.PartyUserGroupService;
import org.apache.commons.lang3.StringUtils;
@ -42,10 +44,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 党群表
@ -307,5 +306,59 @@ public class PartyGroupServiceImpl extends BaseServiceImpl<PartyGroupDao, PartyG
public PartyGroupDTO getPartyGroupDTOByName(String partyGroupName) {
return baseDao.getPartyGroupDTOByName(partyGroupName);
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改组织机构信息事件
List<PartyGroupDTO> eventsList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != eventsList && eventsList.size() > 0) {
// 组织机构信息处理
List<PartyGroupEntity> entities = handleOrganizationInfo(dto, eventsList);
// 更新事件组织机构信息
updateBatchById(entities);
}
// 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
/**
*
* 组织机构信息处理
*
* @params [dto, eventsList]
* @return java.util.List<com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity>
* @author liuchuang
* @since 2020/3/7 1:17
*/
private List<PartyGroupEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<PartyGroupDTO> eventsList) {
List<PartyGroupEntity> entities = new ArrayList<>();
for (PartyGroupDTO events: eventsList) {
PartyGroupEntity entity = new PartyGroupEntity();
if (StringUtils.isNotEmpty(events.getParentDeptIds()) && StringUtils.isNotEmpty(events.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(events.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(events.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(events.getAllDeptIds()) && StringUtils.isNotEmpty(events.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(events.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(events.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
}

56
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java

@ -47,6 +47,7 @@ import com.elink.esua.epdc.entity.PartyTopicEntity;
import com.elink.esua.epdc.entity.PartyTopicUserAttitudeEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.feign.ContentSecurityFeignClient;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.rocketmq.dto.RejectRecordDTO;
import com.elink.esua.epdc.service.PartyTopicImgService;
import com.elink.esua.epdc.service.PartyTopicService;
@ -339,4 +340,59 @@ public class PartyTopicServiceImpl extends BaseServiceImpl<PartyTopicDao, PartyT
return new Result();
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改组织机构信息事件
List<PartyTopicDTO> eventsList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != eventsList && eventsList.size() > 0) {
// 组织机构信息处理
List<PartyTopicEntity> entities = handleOrganizationInfo(dto, eventsList);
// 更新事件组织机构信息
updateBatchById(entities);
}
// 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
/**
*
* 组织机构信息处理
*
* @params [dto, eventsList]
* @return java.util.List<com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity>
* @author liuchuang
* @since 2020/3/7 1:17
*/
private List<PartyTopicEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<PartyTopicDTO> eventsList) {
List<PartyTopicEntity> entities = new ArrayList<>();
for (PartyTopicDTO events: eventsList) {
PartyTopicEntity entity = new PartyTopicEntity();
if (StringUtils.isNotEmpty(events.getParentDeptIds()) && StringUtils.isNotEmpty(events.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(events.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(events.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(events.getAllDeptIds()) && StringUtils.isNotEmpty(events.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(events.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(events.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
}

61
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyUserGroupServiceImpl.java

@ -41,16 +41,14 @@ import com.elink.esua.epdc.entity.PartyUserGroupEntity;
import com.elink.esua.epdc.enums.BannedEnum;
import com.elink.esua.epdc.feign.UserFeignClient;
import com.elink.esua.epdc.redis.PartyUserGroupRedis;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.service.PartyUserGroupService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 党群成员关系表
@ -235,6 +233,61 @@ public class PartyUserGroupServiceImpl extends BaseServiceImpl<PartyUserGroupDao
return new Result();
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改组织机构信息事件
List<PartyUserGroupDTO> eventsList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != eventsList && eventsList.size() > 0) {
// 组织机构信息处理
List<PartyUserGroupEntity> entities = handleOrganizationInfo(dto, eventsList);
// 更新事件组织机构信息
updateBatchById(entities);
}
// 更新网格名称
baseDao.updateGridByDeptId(dto.getNewDeptName(), dto.getDeptId());
}
/**
*
* 组织机构信息处理
*
* @params [dto, eventsList]
* @return java.util.List<com.elink.esua.epdc.modules.events.entity.EpdcEventsEntity>
* @author liuchuang
* @since 2020/3/7 1:17
*/
private List<PartyUserGroupEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<PartyUserGroupDTO> eventsList) {
List<PartyUserGroupEntity> entities = new ArrayList<>();
for (PartyUserGroupDTO events: eventsList) {
PartyUserGroupEntity entity = new PartyUserGroupEntity();
if (StringUtils.isNotEmpty(events.getParentDeptIds()) && StringUtils.isNotEmpty(events.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(events.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(events.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(events.getAllDeptIds()) && StringUtils.isNotEmpty(events.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(events.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(events.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(events.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
private void modifyIdentityFlag(String groupUserId, String identityFlag) {
//判断是否是指定群主操作

3
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/application.yml

@ -91,4 +91,5 @@ mybatis-plus:
rocketmq:
name-server: @rocketmq.name.server@
consumer:
group: @rocketmq.consumer.contentSecurity.group@
group: @rocketmq.consumer.group@
contentSecurity-group: @rocketmq.consumer.contentSecurity.group@

15
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyGroupDao.xml

@ -109,4 +109,19 @@
<select id="getPartyGroupDTOByName" resultType="com.elink.esua.epdc.dto.PartyGroupDTO">
select ID from epdc_party_group where PARTY_GROUP_NAME = #{partyGroupName} and DEL_FLAG='0' limit 1;
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.PartyGroupDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_party_group
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
<update id="updateGridByDeptId">
UPDATE epdc_party_topic SET DEPT = #{newDeptName}, UPDATED_TIME = NOW() WHERE DEPT_ID = #{deptId}
</update>
</mapper>

16
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml

@ -341,7 +341,21 @@
AND pt.ID = #{formDto.topicId}
AND ug.USER_ID = #{formDto.userId}
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.PartyTopicDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_party_topic
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
<update id="updateGridByDeptId">
UPDATE epdc_party_topic SET GRID = #{newDeptName}, UPDATED_TIME = NOW() WHERE GRID_ID = #{deptId}
</update>
<update id="updateTopicTopFlagById">
UPDATE epdc_party_topic SET TOP_FLAG = #{formDto.topFlag}
<if test='formDto.topFlag == "0"'>

15
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyUserGroupDao.xml

@ -250,4 +250,19 @@
and PARTY_GROUP_ID = #{partyGroupId} and USER_ID = #{userId}
LIMIT 1
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.PartyUserGroupDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_party_user_group
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
<update id="updateGridByDeptId">
UPDATE epdc_party_user_group SET GRID = #{newDeptName}, UPDATED_TIME = NOW() WHERE GRID_ID = #{deptId}
</update>
</mapper>

156
esua-epdc/epdc-module/epdc-points/epdc-points-server/src/main/resources/logback-spring.xml

@ -1,21 +1,159 @@
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/base.xml" />
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="TRACE" />
<include resource="org/springframework/boot/logging/logback/base.xml"/>
<property name="log.path" value="logs/points"/>
<!-- 彩色日志格式 -->
<property name="CONSOLE_LOG_PATTERN"
value="${CONSOLE_LOG_PATTERN:-%clr(%d{yyyy-MM-dd HH:mm:ss.SSS}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
<!--1. 输出到控制台-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--此日志appender是为开发使用,只配置最底级别,控制台输出的日志级别是大于或等于此级别的日志信息-->
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
<level>debug</level>
</filter>
<encoder>
<Pattern>${CONSOLE_LOG_PATTERN}</Pattern>
<!-- 设置字符集 -->
<charset>UTF-8</charset>
</encoder>
</appender>
<!--2. 输出到文档-->
<!-- 2.1 level为 DEBUG 日志,时间滚动输出 -->
<appender name="DEBUG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/debug.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 日志归档 -->
<fileNamePattern>${log.path}/debug-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录debug级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>debug</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.2 level为 INFO 日志,时间滚动输出 -->
<appender name="INFO_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/info.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset>
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- 每天日志归档路径以及格式 -->
<fileNamePattern>${log.path}/info-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录info级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>info</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.3 level为 WARN 日志,时间滚动输出 -->
<appender name="WARN_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/warn.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/warn-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录warn级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>warn</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 2.4 level为 ERROR 日志,时间滚动输出 -->
<appender name="ERROR_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<!-- 正在记录的日志文档的路径及文档名 -->
<file>${log.path}/error.log</file>
<!--日志文档输出格式-->
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{50} - %msg%n</pattern>
<charset>UTF-8</charset> <!-- 此处设置字符集 -->
</encoder>
<!-- 日志记录器的滚动策略,按日期,按大小记录 -->
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<fileNamePattern>${log.path}/error-%d{yyyy-MM-dd}.%i.log</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<maxFileSize>100MB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
<!--日志文档保留天数-->
<maxHistory>15</maxHistory>
</rollingPolicy>
<!-- 此日志文档只记录ERROR级别的 -->
<filter class="ch.qos.logback.classic.filter.LevelFilter">
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
</filter>
</appender>
<!-- 开发、测试环境 -->
<springProfile name="dev,test">
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO" />
<logger name="io.renren" level="DEBUG" />
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.elink.esua.epdc" level="INFO"/>
<logger name="com.elink.esua.epdc.dao" level="DEBUG"/>
<root level="INFO">
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
<!-- 生产环境 -->
<springProfile name="prod">
<logger name="org.springframework.web" level="ERROR"/>
<logger name="org.springboot.sample" level="ERROR" />
<logger name="io.renren" level="ERROR" />
<logger name="org.springframework.web" level="INFO"/>
<logger name="org.springboot.sample" level="INFO"/>
<logger name="com.elink.esua.epdc" level="INFO"/>
<root level="INFO">
<appender-ref ref="CONSOLE"/>
<appender-ref ref="DEBUG_FILE"/>
<appender-ref ref="INFO_FILE"/>
<appender-ref ref="WARN_FILE"/>
<appender-ref ref="ERROR_FILE"/>
</root>
</springProfile>
</configuration>
</configuration>

8
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/HousingInformationDao.java

@ -77,4 +77,12 @@ public interface HousingInformationDao extends BaseDao<HousingInformationEntity>
* @return java.util.List<com.elink.esua.epdc.dto.HousingInformationDTO>
**/
List<HousingInformationDTO> getHouseInfoByHouseHeadID(String houseHeadId);
/**
* @Description 查询需要修改的组织机构信息
* @Author songyunpeng
* @Date 2020/11/24
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.dto.VolunteerInfoDTO>
**/
List<HousingInformationDTO> selectListOfOrganizationInfo(String deptId);
}

9
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/dao/VolunteerInfoDao.java

@ -168,4 +168,13 @@ public interface VolunteerInfoDao extends BaseDao<VolunteerInfoEntity> {
* @return void
**/
void updateKindnessTime(EpdcVolunteerKindnessTimeUpdateFormDTO formDto);
/**
* @Description 查询需要修改的组织机构信息
* @Author songyunpeng
* @Date 2020/11/24
* @Param [toString]
* @return java.util.List<com.elink.esua.epdc.dto.VolunteerInfoDTO>
**/
List<VolunteerInfoDTO> selectListOfOrganizationInfo(String deptId);
}

11
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/rocketmq/consumer/OrganizationModifyConsumer.java

@ -39,6 +39,12 @@ public class OrganizationModifyConsumer implements RocketMQListener<MessageExt>
@Autowired
private UserInvitationRecordService userInvitationRecordService;
@Autowired
private VolunteerInfoService volunteerInfoService;
@Autowired
private HousingInformationService housingInformationService;
@Override
public void onMessage(MessageExt messageExt) {
log.info("EPDC-USER-SERVER消费消息START:{topic:{}, msgId:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId());
@ -56,6 +62,11 @@ public class OrganizationModifyConsumer implements RocketMQListener<MessageExt>
userGridRelationService.modifyOrganizationInfo(dto);
// 用户邀请记录表修改组织机构信息
userInvitationRecordService.modifyOrganizationInfo(dto);
//志愿者修改组织机构信息
volunteerInfoService.modifyOrganizationInfo(dto);
//房屋信息修改组织结构信息
housingInformationService.modifyOrganizationInfo(dto);
log.info("EPDC-USER-SERVER消费消息END:{topic:{}, msgId:{}, body:{}}", RocketMqConstant.MQ_TOPIC_ORGANIZATION, messageExt.getMsgId(), body);
} catch (Exception e) {
log.info("EPDC-USER-SERVER消费消息失败:msgId:{}", messageExt.getMsgId());

9
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/HousingInformationService.java

@ -24,6 +24,7 @@ import com.elink.esua.epdc.dto.BasePopulationInformationExportDto;
import com.elink.esua.epdc.dto.BaseResidentInformationExportDto;
import com.elink.esua.epdc.dto.HousingInformationDTO;
import com.elink.esua.epdc.entity.HousingInformationEntity;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@ -137,4 +138,12 @@ public interface HousingInformationService extends BaseService<HousingInformatio
* @return java.util.List<com.elink.esua.epdc.dto.HousingInformationDTO>
**/
List<HousingInformationDTO> getHouseInfoByHouseHeadID(String houseHeadId);
/**
* @Description 房屋信息修改组织结构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

9
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/VolunteerInfoService.java

@ -32,6 +32,7 @@ import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListCountResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.entity.VolunteerInfoEntity;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import java.util.List;
import java.util.Map;
@ -255,4 +256,12 @@ public interface VolunteerInfoService extends BaseService<VolunteerInfoEntity> {
* @Date 14:18 2020-10-29
**/
List<VolunteerInfoDTO> exportVolunteerList(Map<String, Object> params);
/**
* @Description 志愿者修改组织机构信息
* @Author songyunpeng
* @Date 2020/11/25
* @Param [dto]
* @return void
**/
void modifyOrganizationInfo(OrganizationModifyDTO dto);
}

51
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java

@ -40,6 +40,7 @@ import com.elink.esua.epdc.excel.BasePopulationInformationExcel;
import com.elink.esua.epdc.excel.BaseResidentInformationExcel;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.redis.HousingInformationRedis;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.service.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.Workbook;
@ -388,6 +389,56 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
return baseDao.getHouseInfoByHouseHeadID(houseHeadId);
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改的组织机构信息
List<HousingInformationDTO> userList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != userList && userList.size() > 0) {
// 组织机构信息处理
List<HousingInformationEntity> entities = handleOrganizationInfo(dto, userList);
// 更新事件组织机构信息
updateBatchById(entities);
}
}
/**
* 组织机构信息处理
*
* @return java.util.List<com.elink.esua.epdc.entity.UserEntity>
* @params [dto, userList]
* @author liuchuang
* @since 2020/3/7 15:22
*/
private List<HousingInformationEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<HousingInformationDTO> userList) {
List<HousingInformationEntity> entities = new ArrayList<>();
for (HousingInformationDTO user : userList) {
HousingInformationEntity entity = new HousingInformationEntity();
if (StringUtils.isNotEmpty(user.getParentDeptIds()) && StringUtils.isNotEmpty(user.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(user.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(user.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(user.getAllDeptIds()) && StringUtils.isNotEmpty(user.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(user.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(user.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
/**
* @return void
* @Description 校验完成后插入居民信息

4
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/UserServiceImpl.java

@ -765,10 +765,10 @@ public class UserServiceImpl extends BaseServiceImpl<UserDao, UserEntity> implem
if (StringUtils.isBlank(userId)) {
return new Result<EpdcPartyMemberDetailDto>().error("用户Id不能为空");
}
String idNo = baseDao.getPartyMemberIdNoByUserID(userId);
/*String idNo = baseDao.getPartyMemberIdNoByUserID(userId);
if (StringUtils.isBlank(idNo)) {
return new Result<EpdcPartyMemberDetailDto>().error("用户身份证号为空");
}
}*/
EpdcPartyMemberDetailDto dto = baseDao.partyMemberDetailByUserId(userId);
if (dto == null) {
dto = baseDao.partyMemberDetailFaild(userId);

58
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/VolunteerInfoServiceImpl.java

@ -44,6 +44,7 @@ import com.elink.esua.epdc.dto.epdc.result.EpdcAppVolunteerListResultDTO;
import com.elink.esua.epdc.dto.epdc.result.EpdcGetVolunteerRankDTO;
import com.elink.esua.epdc.entity.VolunteerInfoEntity;
import com.elink.esua.epdc.feign.AdminFeignClient;
import com.elink.esua.epdc.rocketmq.dto.OrganizationModifyDTO;
import com.elink.esua.epdc.service.UserTagRelationService;
import com.elink.esua.epdc.service.VolunteerInfoService;
import org.apache.commons.lang3.StringUtils;
@ -51,10 +52,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* 志愿者信息表
@ -459,4 +457,56 @@ public class VolunteerInfoServiceImpl extends BaseServiceImpl<VolunteerInfoDao,
return baseDao.volunteerInfoList(params);
}
@Override
public void modifyOrganizationInfo(OrganizationModifyDTO dto) {
// 查询需要修改的组织机构信息
List<VolunteerInfoDTO> userList = baseDao.selectListOfOrganizationInfo(dto.getDeptId().toString());
if (null != userList && userList.size() > 0) {
// 组织机构信息处理
List<VolunteerInfoEntity> entities = handleOrganizationInfo(dto, userList);
// 更新事件组织机构信息
updateBatchById(entities);
}
}
/**
* 组织机构信息处理
*
* @return java.util.List<com.elink.esua.epdc.entity.UserEntity>
* @params [dto, userList]
* @author liuchuang
* @since 2020/3/7 15:22
*/
private List<VolunteerInfoEntity> handleOrganizationInfo(OrganizationModifyDTO dto, List<VolunteerInfoDTO> userList) {
List<VolunteerInfoEntity> entities = new ArrayList<>();
for (VolunteerInfoDTO user : userList) {
VolunteerInfoEntity entity = new VolunteerInfoEntity();
if (StringUtils.isNotEmpty(user.getParentDeptIds()) && StringUtils.isNotEmpty(user.getParentDeptNames())) {
List<String> parentDeptIds = Arrays.asList(user.getParentDeptIds().split(","));
List<String> parentDeptNames = Arrays.asList(user.getParentDeptNames().split("-"));
int index = parentDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && parentDeptNames.size() > index) {
parentDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setParentDeptNames(StringUtils.join(parentDeptNames, "-"));
}
}
if (StringUtils.isNotEmpty(user.getAllDeptIds()) && StringUtils.isNotEmpty(user.getAllDeptNames())) {
List<String> allDeptIds = Arrays.asList(user.getAllDeptIds().split(","));
List<String> allDeptNames = Arrays.asList(user.getAllDeptNames().split("-"));
int index = allDeptIds.indexOf(dto.getDeptId().toString());
if (index >= 0 && allDeptNames.size() > index) {
allDeptNames.set(index, dto.getNewDeptName());
entity.setId(user.getId());
entity.setAllDeptNames(StringUtils.join(allDeptNames, "-"));
}
}
entities.add(entity);
}
return entities;
}
}

12
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/HousingInformationDao.xml

@ -184,6 +184,18 @@
where t.DEL_FLAG ='0' and t1.RESIDENT_ID = #{houseHeadId} and t1.IS_HOUSE_HEAD = '1'
</select>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.HousingInformationDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_housing_information
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
</mapper>

12
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/mapper/VolunteerInfoDao.xml

@ -301,4 +301,16 @@
</foreach>
AND DEL_FLAG = '0'
</update>
<select id="selectListOfOrganizationInfo" resultType="com.elink.esua.epdc.dto.VolunteerInfoDTO">
SELECT
ID,
PARENT_DEPT_IDS,
PARENT_DEPT_NAMES,
ALL_DEPT_IDS,
ALL_DEPT_NAMES
FROM
epdc_volunteer_info
WHERE
FIND_IN_SET( #{deptId}, ALL_DEPT_IDS )
</select>
</mapper>

Loading…
Cancel
Save