Browse Source

Merge remote-tracking branch 'remotes/origin/develop' into release_temp

master
jianjun 4 years ago
parent
commit
661db3eeb7
  1. 70
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java
  2. 33
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java
  3. 8
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java
  4. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  5. 38
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java
  6. 28
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java
  7. 22
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java
  8. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/govOrg/OrgTreeNode.java
  9. 15
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java
  10. 35
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  11. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  12. 109
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  13. 15
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  14. 85
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ResiEventDTO.java
  15. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java
  16. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  17. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java
  18. 35
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java
  19. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java
  20. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  21. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java
  22. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java
  23. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  24. 15
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  25. 3
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml
  26. 19
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  27. 13
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java
  28. 22
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java
  29. 37
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java
  30. 20
      epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java
  31. 34
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java
  32. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java
  33. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java
  34. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java
  35. 24
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java
  36. 8
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java
  37. 33
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java
  38. 27
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java
  39. 34
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml
  40. 10
      epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml
  41. 4
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/EventProjectInfoDTO.java
  42. 29
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/CloseResiEventFormDTO.java
  43. 2
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventDetailFormDTO.java
  44. 6
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MentionUserFormDTO.java
  45. 34
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java
  46. 3
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java
  47. 28
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UpdateViewTimeFormDTO.java
  48. 26
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java
  49. 10
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportedResultDTO.java
  50. 32
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java
  51. 22
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java
  52. 20
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java
  53. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java
  54. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ResiEventAction.java
  55. 82
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java
  56. 56
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java
  57. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  58. 34
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java
  59. 21
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java
  60. 16
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventOperationLogDao.java
  61. 14
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java
  62. 32
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java
  63. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java
  64. 31
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java
  65. 24
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java
  66. 235
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java
  67. 188
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  68. 5
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql
  69. 13
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  70. 97
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml
  71. 24
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml
  72. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml
  73. 15
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml
  74. 28
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml
  75. 2
      epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventNpcListFormDTO.java
  76. 8
      epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventNpcResultDTO.java
  77. 8
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/ResiEventController.java
  78. 2
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/ResiEventService.java
  79. 55
      epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java
  80. 5
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListUserByBadgeFormDTO.java
  81. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java
  82. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java
  83. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java
  84. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java
  85. 2
      epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

70
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java

@ -1,70 +0,0 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.utils.SpringContextUtils;
import org.springframework.core.env.Environment;
/**
* 系统环境变量枚举类
* dev|test|prod
*
* @author jianjun liu
* @date 2020-07-03 11:14
**/
public enum KongCunCustomerEnvEnum {
/**
* 环境变量枚举
*/
DEV("dev", "开发环境", "613cc61a6b8ce4c70d21bd413dac72cc"),
TEST("test", "体验环境", "b272625617e53620b2b3cbc65d1ecbbb"),
PROD("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80"),
UN_KNOWN("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80")
;
private String code;
private String name;
private String customerId;
KongCunCustomerEnvEnum(String code, String name, String customerId) {
this.code = code;
this.name = name;
this.customerId = customerId;
}
public static KongCunCustomerEnvEnum getEnum(String code) {
KongCunCustomerEnvEnum[] values = KongCunCustomerEnvEnum.values();
for (KongCunCustomerEnvEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return KongCunCustomerEnvEnum.UN_KNOWN;
}
public static KongCunCustomerEnvEnum getCurrentEnv(){
try {
Environment environment = SpringContextUtils.getBean(Environment.class);
String[] activeProfiles = environment.getActiveProfiles();
if (activeProfiles.length > 0) {
return getEnum(activeProfiles[0]);
}
} catch (Exception e) {
e.printStackTrace();
}
return KongCunCustomerEnvEnum.UN_KNOWN;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public String getCustomerId(){
return customerId;
}
}

33
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java

@ -1,7 +1,9 @@
package com.epmet.commons.tools.enums;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import org.apache.commons.lang3.StringUtils;
/**
* 组织级别枚举类
@ -42,6 +44,37 @@ public enum OrgLevelEnum {
throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode());
}
/**
* desc: 获取下一等级的组织级别
*
* @param parentAgencyLevel
* @return java.lang.String
* @author LiuJanJun
* @date 2021/8/5 1:57 下午
* todo 加上数字 根据数据返回
*/
public static String getSubOrgLevel(String parentAgencyLevel) {
String level = StrConstant.EPMETY_STR;
if (StringUtils.isBlank(parentAgencyLevel)) {
return level;
}
OrgLevelEnum anEnum = OrgLevelEnum.getEnum(parentAgencyLevel);
switch (anEnum){
case PROVINCE:
return OrgLevelEnum.CITY.getCode();
case CITY:
return OrgLevelEnum.DISTRICT.getCode();
case DISTRICT:
return OrgLevelEnum.STREET.getCode();
case STREET:
return OrgLevelEnum.COMMUNITY.getCode();
case COMMUNITY:
return OrgLevelEnum.GRID.getCode();
default:
return level;
}
}

8
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java

@ -187,7 +187,13 @@ public enum RequirePermissionEnum {
/**
* 基层治理-巡查
*/
WORK_GRASSROOT_GOVERN_PATROL("work_grassroot_govern_patrol","基层治理:巡查","巡查");
WORK_GRASSROOT_GOVERN_PATROL("work_grassroot_govern_patrol","基层治理:巡查","巡查"),
/**
* 基层治理-群众直报 功能入口
*/
RESI_EVENT_MANAGE("resi_event_manage","基层治理:群众直报","基层治理-群众直报");
private String key;
private String name;

3
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java

@ -97,6 +97,9 @@ public enum EpmetErrorCode {
VOTE_ISSUE_PLEASE(8602,"请先选择支持或反对,再发表您的想法"),
RESI_EVENT_READ(8603,"当前事件正在处理中,不能撤回"),
RESI_EVENT_NOT_MY_REPORTED(8604,"当前事件不是您发布的,无权操作"),
CAN_NOT_REPLY_RESI_EVENT_GOV(8605,"办结、立项处理后不可回复"),
CAN_NOT_REPLY_RESI_EVENT_SELF(8606,"当前事件待处理,不可回复"),
RESI_EVENT_CAN_NOT_CLOSE_CASE(8607,"事件尚未处理,请处理完成后进行办结"),
// 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),

38
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java

@ -0,0 +1,38 @@
/**
* Copyright (c) 2018 人人开源 All rights reserved.
*
* https://www.renren.io
*
* 版权所有侵权必究
*/
package com.epmet.commons.tools.utils;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 树节点所有需要实现树节点的都需要继承该类
*
* @author Mark sunlightcs@gmail.com
* @since 1.0.0
*/
@Data
public class TreeAreaCodeNode<T> extends TreeStringNode<T> implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String areaCode;
/**
* 上级ID
*/
private String parentAreaCode;
/**
* 子节点列表
*/
private List<T> children = new ArrayList<>();
}

28
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java

@ -131,4 +131,32 @@ public class TreeUtils {
return result;
}
/**
* 构建树节点
*/
public static <T extends TreeAreaCodeNode> List<T> buildTreeByAreaCode(List<T> treeNodes) {
List<T> result = new ArrayList<>();
//list转map
Map<String, T> nodeMap = new LinkedHashMap<>(treeNodes.size());
for(T treeNode : treeNodes){
nodeMap.put(treeNode.getAreaCode(), treeNode);
}
for(T node : nodeMap.values()) {
T parent = nodeMap.get(node.getParentAreaCode());
if(parent != null && !(node.getAreaCode().equals(parent.getAreaCode()))){
if (parent.getChildren() == null){
parent.setChildren(new ArrayList());
}
parent.getChildren().add(node);
continue;
}
result.add(node);
}
return result;
}
}

22
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.form.govOrg;
import lombok.Data;
import java.io.Serializable;
/**
* 各机关注册用户数入参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/6/22 12:47
*/
@Data
public class OrgTreeFormDTO implements Serializable {
private static final long serialVersionUID = 6649155066499141632L;
private String mobile;
private String customerId;
}

18
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/govOrg/OrgTreeNode.java

@ -0,0 +1,18 @@
package com.epmet.dto.result.govOrg;
import com.epmet.commons.tools.utils.TreeAreaCodeNode;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
@Data
public class OrgTreeNode extends TreeAreaCodeNode<OrgTreeNode> {
private String id;
private String pid;
private String orgId;
private String orgName;
private String level;
private List<OrgTreeNode> children=new ArrayList<>();
}

15
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java

@ -8,9 +8,11 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AgencyDetailMulticFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.govOrg.OrgTreeFormDTO;
import com.epmet.dto.result.AgencyDetailMulticResultDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.govOrg.OrgTreeNode;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
@ -129,4 +131,17 @@ public class AgencyController {
ValidatorUtils.validateEntity(formDTO, AgencyDetailMulticFormDTO.AddUserInternalGroup.class);
return new Result<AgencyDetailMulticResultDTO>().ok(agencyService.queryAgencyDetailMultiC(formDTO));
}
/**
* desc: 获取组织树 含所有直线上级 但不含部门和网格 目前
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.plugins.AgencyNodeDTO>
* @author LiuJanJun
* @date 2021/8/3 5:17 下午
*/
@PostMapping("getStaffAgencyTree")
public Result<OrgTreeNode> getStaffAgencyTree(@RequestBody OrgTreeFormDTO formDTO) {
return new Result<OrgTreeNode>().ok(agencyService.getStaffAgencyTree(formDTO));
}
}

35
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java

@ -115,7 +115,7 @@ public interface ScreenCustomerAgencyDao {
CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId);
/**
* @Description 查询组织的下级组织ID
* @Description 查询组织的下级组织ID
* @Param agencyId
* @author zxc
* @date 2020/10/28 10:33 上午
@ -135,7 +135,7 @@ public interface ScreenCustomerAgencyDao {
* @description 根据areaCode查询组织机构
* @Date 2021/2/4 21:51
**/
List<AgencyNodeDTO> queryStaffAgencyTree(@Param("areaCode")String areaCode);
List<AgencyNodeDTO> queryStaffAgencyTree(@Param("areaCode") String areaCode);
/**
* @param areaCode
@ -144,7 +144,7 @@ public interface ScreenCustomerAgencyDao {
* @description 查找组织下的部门
* @Date 2021/2/4 21:51
**/
List<DeptNodeDTO> selectDeptList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId);
List<DeptNodeDTO> selectDeptList(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId);
/**
* @param areaCode
@ -153,27 +153,27 @@ public interface ScreenCustomerAgencyDao {
* @description 查找组织下的网格
* @Date 2021/2/4 21:52
**/
List<GridNodeDTO> selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId);
List<GridNodeDTO> selectGridList(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId);
/**
* @return java.util.List<java.lang.String>
* @param areaCode
* @param agencyId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 下一级组织+直属网格
* @Date 2021/5/10 14:02
**/
List<String> getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
List<String> getNextAgencyIds(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId);
List<ScreenCustomerAgencyCommonDTO> selectSubAgencyIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
List<ScreenCustomerAgencyCommonDTO> selectSubAgencyIds(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId);
/**
* @Description 根据agencyId查询网格
* @Description 根据agencyId查询网格
* @Param agencyId
* @author zxc
* @date 2021/6/8 1:27 下午
*/
List<GridManagerListResultDTO> selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode);
List<GridManagerListResultDTO> selectGrid(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode);
/**
* 查询当前组织的下一级组织可根据areaCode查询也可根据pid查询
@ -191,13 +191,13 @@ public interface ScreenCustomerAgencyDao {
* @param parentAgencyId
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
*/
List<ScreenCustomerGridDTO> selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allCustomerIds") List<String> allCustomerIds);
List<ScreenCustomerGridDTO> selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId, @Param("allCustomerIds") List<String> allCustomerIds);
List<ParentListResultDTO> selectPAgencyById(@Param("listStr")List<String> pidList);
List<ParentListResultDTO> selectPAgencyById(@Param("listStr") List<String> pidList);
/**
* @return com.epmet.dto.result.ScreenCustomerAgencyDTO
* @param customerId
* @return com.epmet.dto.result.ScreenCustomerAgencyDTO
* @author yinzuomei
* @description 根据客户id返回当前客户下的跟组织信息
* @Date 2021/6/24 17:43
@ -205,4 +205,15 @@ public interface ScreenCustomerAgencyDao {
ScreenCustomerAgencyDTO selectCustomerRootAgency(String customerId);
ScreenCustomerAgencyDTO selectByAreaCode(String areaCode);
/**
* desc: 根据pids 或者 areaCode 获取所有下级组织
*
* @param pids
* @param areaCode
* @return java.util.List<com.epmet.dto.result.ScreenCustomerAgencyDTO>
* @author LiuJanJun
* @date 2021/8/5 11:01 上午
*/
List<ScreenCustomerAgencyDTO> selectAllSubAgencyList(@Param("pids") String pids, @Param("areaCode") String areaCode);
}

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java

@ -5,10 +5,12 @@ import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AgencyDetailMulticFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.govOrg.OrgTreeFormDTO;
import com.epmet.dto.result.AgencyDetailMulticResultDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.govOrg.OrgTreeNode;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO;
@ -104,4 +106,14 @@ public interface AgencyService {
* @return com.epmet.dto.result.AgencyDetailMulticResultDTO
*/
AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO);
/**
* desc: 获取工作人员组织树 含所有直线上级组织 不含网格及部门
*
* @param mobile
* @return com.epmet.dto.result.plugins.AgencyNodeDTO
* @author LiuJanJun
* @date 2021/8/3 5:03 下午
*/
OrgTreeNode getStaffAgencyTree(OrgTreeFormDTO mobile);
}

109
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java

@ -2,28 +2,35 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.Constant;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.OrgLevelEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.AgencyTreeUtils;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.TreeUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.datareport.redis.DataReportRedis;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AgencyDetailMulticFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.form.CustomerStaffFormDTO;
import com.epmet.dto.form.govOrg.OrgTreeFormDTO;
import com.epmet.dto.result.AgencyDetailMulticResultDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO;
import com.epmet.dto.result.govOrg.OrgTreeNode;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO;
@ -33,6 +40,7 @@ import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO;
import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO;
import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO;
import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
import lombok.extern.slf4j.Slf4j;
@ -70,6 +78,8 @@ public class AgencyServiceImpl implements AgencyService {
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private DataReportRedis dataReportRedis;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
* @Description 1组织机构树
@ -438,7 +448,7 @@ public class AgencyServiceImpl implements AgencyService {
log.info("多客户版本parentList、level要重新赋值;agencysResultDTO.getParentAreaCode()="+agencysResultDTO.getParentAreaCode());
ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode());
if (null != parentAgency) {
agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency));
agencysResultDTO.setLevel(OrgLevelEnum.getSubOrgLevel(parentAgency.getLevel()));
List<ParentListResultDTO> temp = getParentListMultic(parentList, parentAgency, formDTO.getCustomerId(), agencysResultDTO.getRootAgencyId());
agencysResultDTO.setParentList(temp);
}
@ -468,6 +478,85 @@ public class AgencyServiceImpl implements AgencyService {
return agencysResultDTO;
}
@Override
public OrgTreeNode getStaffAgencyTree(OrgTreeFormDTO formDTO) {
//todo 获取客户的所有组织 然后遍历剔除 再构建出一颗树 咋样
//获取工作人员信息
CustomerStaffFormDTO staffParam = new CustomerStaffFormDTO();
staffParam.setMobile(formDTO.getMobile());
staffParam.setCustomerId(formDTO.getCustomerId());
Result<CustomerStaffDTO> staffInfoResult = userOpenFeignClient.getCustomerStaffInfo(staffParam);
if (!staffInfoResult.success()){
throw new RenException(staffInfoResult.getCode(),staffInfoResult.getInternalMsg());
}
//获取工作人员组织信息
Result<CustomerAgencyDTO> agencyByStaff = govOrgOpenFeignClient.getAgencyByStaff(staffInfoResult.getData().getUserId());
if (!agencyByStaff.success() || agencyByStaff.getData()== null || StringUtils.isBlank(agencyByStaff.getData().getId()) ){
throw new RenException(staffInfoResult.getCode(),staffInfoResult.getMsg());
}
CustomerAgencyDTO staffAgencyDTO = agencyByStaff.getData();
//4、如果当前客户不存在子客户则areaCode置为空
Result<List<String>> crmRes=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());
if (!crmRes.success()){
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
List<OrgTreeNode> nodes = new ArrayList<>();
//单客户
if (CollectionUtils.isEmpty(crmRes.getData())){
//todo 暂不处理 有时间再说
}else {
ScreenCustomerAgencyDTO parentAgencyDTO = null;
String subAgencyAreaCode = staffAgencyDTO.getParentAreaCode();
List<OrgTreeNode> nodeList = new ArrayList<>();
/*ScreenCustomerAgencyDTO currentAgency = new ScreenCustomerAgencyDTO();
currentAgency.setCustomerId(staffAgencyDTO.getCustomerId());
currentAgency.setAgencyId(staffAgencyDTO.getId());
currentAgency.setAgencyName(staffAgencyDTO.getOrganizationName());
currentAgency.setLevel(staffAgencyDTO.getLevel());
currentAgency.setAreaCode(staffAgencyDTO.getAreaCode());
currentAgency.setParentAreaCode(staffAgencyDTO.getParentAreaCode());
currentAgency.setPid(staffAgencyDTO.getPid());
currentAgency.setPids(staffAgencyDTO.getPids());
convertOrgTreeNode(nodeList, currentAgency);*/
//多客户 获取所有直线上级
do {
parentAgencyDTO = screenCustomerAgencyDao.selectByAreaCode(subAgencyAreaCode);
if (parentAgencyDTO == null){
break;
}
convertOrgTreeNode(nodeList, parentAgencyDTO);
if (parentAgencyDTO.getPid() == null || NumConstant.ZERO_STR.equals(parentAgencyDTO.getPid())){
break;
}
subAgencyAreaCode = parentAgencyDTO.getAreaCode();
} while (true);
//多客户 获取所有下级
List<ScreenCustomerAgencyDTO> agencyNodeDTOS = screenCustomerAgencyDao.selectAllSubAgencyList(null,staffAgencyDTO.getAreaCode());
//孔村降级处理
String KONG_CUN_AGENCY_ID = "1234085031077498881";
agencyNodeDTOS.forEach(e->{
if (e.getPids().contains(KONG_CUN_AGENCY_ID)){
e.setLevel(OrgLevelEnum.getSubOrgLevel(e.getLevel()));
}
convertOrgTreeNode(nodeList, e);
});
nodes = TreeUtils.buildTreeByAreaCode(nodeList);
}
//只有一个根节点的树 所以返回一个
return nodes.get(0);
}
private void convertOrgTreeNode(List<OrgTreeNode> nodeList, ScreenCustomerAgencyDTO currentAgency) {
OrgTreeNode orgTreeNode = ConvertUtils.sourceToTarget(currentAgency, OrgTreeNode.class);
orgTreeNode.setOrgId(currentAgency.getAgencyId());
orgTreeNode.setOrgName(currentAgency.getAgencyName());
nodeList.add(orgTreeNode);
}
private List<ParentListResultDTO> getParentListMultic(List<ParentListResultDTO> resList, ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) {
ParentListResultDTO resultDTO = new ParentListResultDTO();
resultDTO.setId(firstParent.getAgencyId());
@ -491,20 +580,4 @@ public class AgencyServiceImpl implements AgencyService {
}
}
}
private String getAgencyLevelMultiC(ScreenCustomerAgencyDTO parentAgency) {
String level=StrConstant.EPMETY_STR;
if(null!=parentAgency){
if(Constant.PROVINCE.equals(parentAgency.getLevel())){
return Constant.CITY;
}else if(Constant.CITY.equals(parentAgency.getLevel())){
return Constant.DISTRICT;
}else if(Constant.DISTRICT.equals(parentAgency.getLevel())){
return Constant.STREET;
}else if(Constant.STREET.equals(parentAgency.getLevel())){
return Constant.COMMUNITY;
}
}
return level;
}
}

15
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml

@ -433,4 +433,19 @@
AND sca.AREA_CODE = #{areaCode}
limit 1
</select>
<select id="selectAllSubAgencyList" resultType="com.epmet.dto.result.ScreenCustomerAgencyDTO">
SELECT
sca.*
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
<if test="pids != null and pids != ''">
AND sca.pids like CONCAT(#{pids},'%')
</if>
<if test="areaCode != null and areaCode != ''">
AND sca.AREA_CODE like CONCAT(#{areaCode},'%')
</if>
</select>
</mapper>

85
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ResiEventDTO.java

@ -0,0 +1,85 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.project;
import lombok.Data;
import java.io.Serializable;
/**
* 居民报事表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-03
*/
@Data
public class ResiEventDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 事件id
*/
private String resiEventId;
/**
* 报给
网格grid
社区community
街道:street
区县级: district
市级: city
省级:province
*/
private String orgType;
/**
* 报给的组织或者网格id
*/
private String orgId;
/**
* org_id的上级组织idorg_id是跟组织此列为0
*/
private String orgPid;
/**
* org_id的所有上级组织idorg_id是跟组织此列为0
*/
private String orgPids;
/**
* 含义已读read未读un_read组织下的工作人员从待处理=>处理中点击查看详情前更新为已读
*/
private String orgRead;
/**
* (1)含义1:展示红点0不展示(2)注意发布事件插入数据时为1(3)何时更新人大代表回复or报事人回复or工作人员回复立项办结更新为1
*/
private Boolean redDot;
private String projectId;
private String createdBy;
}

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -81,4 +81,5 @@ public interface ProjectConstant {
* 项目来源于 工作端立项
*/
String PROJECT_ORIGIN_AGENCY="agency";
String PROJECT_ORIGIN_EVENT="resi_event";
}

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java

@ -19,10 +19,7 @@ package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectCategoryDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.ProjectPointDTO;
import com.epmet.dto.project.*;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
@ -194,4 +191,11 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
List<String> selectClosedProjectIds(@Param("customerId")String customerId,
@Param("origin")String origin,
@Param("projectStatus")String projectStatus);
/**
* 获取已转项目事件事件
* @param customerId
* @return
*/
List<ResiEventDTO> getEventList(@Param("customerId")String customerId);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java

@ -1,12 +1,18 @@
package com.epmet.healthcheck;
import com.epmet.commons.tools.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.net.Inet4Address;
import java.net.InetAddress;
import java.net.UnknownHostException;
@RestController
@RequestMapping("healthcheck")
@Slf4j
public class HealthCheckController {
/**
@ -15,7 +21,14 @@ public class HealthCheckController {
*/
@PostMapping("http")
public Result httpHealthCheck() {
return new Result();
InetAddress serverIp = null;
try {
serverIp = Inet4Address.getLocalHost();
} catch (UnknownHostException e) {
e.printStackTrace();
}
log.info("健康检查:serverName:{}", serverIp);
return new Result().ok(serverIp);
}
}

35
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java

@ -206,24 +206,54 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
Map<String, OrgStatisticsResultDTO> projectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.RESOLVED,
OrgTypeConstant.AGENCY);
Map<String, OrgStatisticsResultDTO> eventProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.RESOLVED,
ProjectConstant.PROJECT_ORIGIN_EVENT);
if (!projectResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = projectResolvedTotal.get(item.getAgencyId());
int sum = item.getApprovalProjectResolvedCount();
if (null != dto) {
sum = sum + dto.getSum();
}
item.setApprovalProjectResolvedCount(sum);
});
}
if (!eventProjectResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = eventProjectResolvedTotal.get(item.getAgencyId());
int sum = item.getApprovalProjectResolvedCount();
if (null != dto) {
item.setApprovalProjectResolvedCount(dto.getSum());
sum = sum + dto.getSum();
}
item.setApprovalProjectResolvedCount(sum);
});
}
// 当前组织内:来源于议题的项目:结案无需解决数
Map<String, OrgStatisticsResultDTO> projectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.UNRESOLVED,
OrgTypeConstant.AGENCY);
Map<String, OrgStatisticsResultDTO> eventProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId,
dateId, ProjectConstant.UNRESOLVED,
ProjectConstant.PROJECT_ORIGIN_EVENT);
if (!projectUnResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = projectUnResolvedTotal.get(item.getAgencyId());
int sum = item.getApprovalProjectUnResolvedCount();
if (null != dto) {
sum = sum + dto.getSum();
}
item.setApprovalProjectUnResolvedCount(sum);
});
}
if (!eventProjectUnResolvedTotal.isEmpty()) {
agencyGovernDailyList.forEach(item -> {
OrgStatisticsResultDTO dto = eventProjectUnResolvedTotal.get(item.getAgencyId());
int sum = item.getApprovalProjectUnResolvedCount();
if (null != dto) {
item.setApprovalProjectUnResolvedCount(dto.getSum());
sum = sum + dto.getSum();
}
item.setApprovalProjectUnResolvedCount(sum);
});
}
}
@ -249,6 +279,7 @@ public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl<FactAgency
BigDecimal resolveCount = new BigDecimal(sum);
BigDecimal selfCount = new BigDecimal(count);
item.setGridSelfGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP));
item.setGridSelfGovernProjectTotal(count);
}
}
});

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java

@ -108,6 +108,8 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
Map<String,Integer> issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED);
Map<String,Integer> eventProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.RESOLVED);
Map<String,Integer> eventProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_EVENT,DimObjectStatusConstant.UNRESOLVED);
Map<String, Integer> inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR);
Map<String, Integer> inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR);
Map<String, GovernGridClosedTotalCommonDTO> dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds);
@ -142,14 +144,24 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
insertEntity.setIssueProjectUnResolvedCount(issueProjectUnResolvedMap.get(insertEntity.getGridId()));
}
//7、当前网格内:项目立项,结案已解决数;默认为0,
int resolveCount = 0;
if(approvalProjectResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setApprovalProjectResolvedCount(approvalProjectResolvedMap.get(insertEntity.getGridId()));
resolveCount = resolveCount + approvalProjectResolvedMap.get(insertEntity.getGridId());
}
if(eventProjectResolvedMap.containsKey(insertEntity.getGridId())){
resolveCount = resolveCount + eventProjectResolvedMap.get(insertEntity.getGridId());
}
insertEntity.setApprovalProjectResolvedCount(resolveCount);
// 8、当前网格内:项目立项,结案无需解决数;默认为0,
int unResolveCount = 0;
if(approvalProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
insertEntity.setApprovalProjectUnResolvedCount(approvalProjectUnResolvedMap.get(insertEntity.getGridId()));
unResolveCount = resolveCount + approvalProjectUnResolvedMap.get(insertEntity.getGridId());
}
if(eventProjectUnResolvedMap.containsKey(insertEntity.getGridId())){
unResolveCount = resolveCount + eventProjectUnResolvedMap.get(insertEntity.getGridId());
}
insertEntity.setApprovalProjectUnResolvedCount(unResolveCount);
// 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的)
// 9、当前网格内,未出小组即未转议题的:话题关闭已解决数
if(inGroupTopicResolvedMap.containsKey(insertEntity.getGridId())){
@ -318,7 +330,7 @@ public class FactGridGovernDailyServiceImpl extends BaseServiceImpl<FactGridGove
// 12、来源于议题的项目,未出网格(在网格内流转的)结案并且无需解决的项目数
fromIssueUnResolvedInGridCount += 1;
}
} else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(governProjectInfoDTO.getOrigin())) {
} else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(governProjectInfoDTO.getOrigin()) || ProjectConstant.PROJECT_ORIGIN_EVENT.equals(governProjectInfoDTO.getOrigin())) {
if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) {
// 13、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0
fromAgencyResolvedInGridCount += 1;

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java

@ -16,6 +16,7 @@ import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.ResiEventDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.dto.topic.ResiTopicDTO;
@ -41,10 +42,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
import java.util.stream.Collectors;
/**
@ -128,6 +126,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
List<ProjectDTO> projectList = projectService.getProjectInfo(customerId, dateString);
factOriginProjectMainDailyService.deleteByDate(customerId, dateString);
if (!CollectionUtils.isEmpty(projectList)) {
Map<String, ResiEventDTO> projectEventMap = projectService.getEventList(customerId);
//提取议题ID
List<String> issueIds =
projectList.stream().filter(item -> ProjectConstant.ISSUE.equals(item.getOrigin())).map(ProjectDTO::getOriginId).collect(Collectors.toList());
@ -154,11 +153,6 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setMonthId(dimId.getMonthId());
entity.setWeekId(dimId.getWeekId());
entity.setDateId(dimId.getDateId());
if (ProjectConstant.ISSUE.equals(project.getOrigin())) {
entity.setIssueId(project.getOriginId());
} else {
entity.setIssueId("");
}
entity.setProjectStatus(project.getStatus());
entity.setIsResolved(project.getClosedStatus());
entity.setCreatedTime(project.getCreatedTime());
@ -168,6 +162,20 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
entity.setTopicId("");
entity.setTopicCreatorId("");
entity.setGridId("");
if (ProjectConstant.ISSUE.equals(project.getOrigin())) {
entity.setIssueId(project.getOriginId());
} else if (ProjectConstant.PROJECT_ORIGIN_EVENT.equals(project.getOrigin())){
entity.setIssueId("");
ResiEventDTO eventDTO = projectEventMap.get(project.getId());
if (null != eventDTO) {
if (ProjectConstant.PUBLISHER_TYPE_GRID.equals(eventDTO.getOrgType())) {
entity.setGridId(eventDTO.getOrgId());
entity.setTopicCreatorId(eventDTO.getCreatedBy());
}
}
} else {
entity.setIssueId("");
}
String[] pIds = project.getOrgIdPath().split(StrConstant.COLON);
if (pIds.length > 1) {
entity.setPid(pIds[pIds.length - 2]);

1
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.enums.KongCunCustomerEnvEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java

@ -270,7 +270,7 @@ public class StatsIssueServiceImpl implements StatsIssueService {
//已结案项目统计
List<ProjectGridDTO> closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString);
//已结案项目增量
List<ProjectGridDTO> closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString);
List<ProjectGridDTO> closedProjectIncList = projectService.getGridClosedProjectInc(customerId, dateString);
Map<String, Long> resolveMap= new HashMap<>();
Map<String, Long> unResolveMap = new HashMap<>();

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java

@ -22,6 +22,7 @@ import com.epmet.dto.ProjectCategoryDTO;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.ResiEventDTO;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.project.ProjectEntity;
@ -191,4 +192,11 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @return
*/
List<String> selectClosedProjectIds(String customerId,String origin ,String projectStatus);
/**
* 获取事件信息
* @param customerId
* @return
*/
Map<String, ResiEventDTO> getEventList(String customerId);
}

15
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java

@ -23,10 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectCategoryDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.ProjectPointDTO;
import com.epmet.dto.project.*;
import com.epmet.dto.project.result.ProjectExceedParamsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity;
import com.epmet.entity.project.ProjectEntity;
@ -37,6 +34,7 @@ import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
@ -239,5 +237,14 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return baseDao.selectClosedProjectIds(customerId,origin,projectStatus);
}
@Override
public Map<String, ResiEventDTO> getEventList(String customerId) {
List<ResiEventDTO> list = baseDao.getEventList(customerId);
if (org.apache.commons.collections4.CollectionUtils.isEmpty(list)) {
return Collections.emptyMap();
}
return list.stream().collect(Collectors.toMap(ResiEventDTO::getProjectId, Function.identity()));
}
}

3
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml

@ -707,7 +707,8 @@
) a ON fm.GRID_ID = a.orgId
WHERE
PROJECT_STATUS = 'closed'
AND ORIGIN = "issue"
AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event')
AND GRID_ID != ''
AND CUSTOMER_ID = #{customerId}
AND DATE_ID &lt;= #{dateId}
GROUP BY

19
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml

@ -55,7 +55,7 @@
FROM project
WHERE
DEL_FLAG = '0'
AND ORIGIN = 'issue'
AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event')
AND STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') <![CDATA[ <= ]]> #{date}
@ -69,7 +69,7 @@
FROM project
WHERE
DEL_FLAG = '0'
AND ORIGIN = 'issue'
AND (ORIGIN = 'issue' OR ORIGIN = 'resi_event')
AND STATUS = 'closed'
AND CUSTOMER_ID = #{customerId}
AND DATE_FORMAT(UPDATED_TIME, '%Y-%m-%d') = #{date}
@ -220,4 +220,19 @@
AND p.ORIGIN =#{origin}
</if>
</select>
<select id="getEventList" resultType="com.epmet.dto.project.ResiEventDTO">
select rero.RESI_EVENT_ID,
rero.ORG_TYPE,
rero.ORG_ID,
rero.ORG_PID,
rero.ORG_PIDS,
re.PROJECT_ID.CREATED_BY,
re.PROJECT_ID
from resi_event_report_org rero
inner join resi_event re on rero.RESI_EVENT_ID = re.id and re.SHIFT_PROJECT = 1 and re.DEL_FLAG = '0'
where rero.del_flag = '0'
and rero.CUSTOMER_ID = #{customerId}
</select>
</mapper>

13
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java

@ -1,13 +0,0 @@
package com.epmet.dto;
import lombok.Data;
import java.util.List;
@Data
public class OrgTreeNode {
private String orgId;
private String orgName;
private String orgType;
private List<OrgTreeNode> subOrgs;
}

22
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/4 5:48 下午
* @DESC
*/
@Data
public class OrgNameByTypeResultDTO implements Serializable {
private static final long serialVersionUID = -6544341694748437312L;
private String orgId;
private String orgType;
private String orgName;
}

37
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java

@ -370,4 +370,41 @@ public interface GovOrgOpenFeignClient {
*/
@PostMapping("/gov/org/staff/mine")
Result<MineResultDTO> queryStaffProfile(@RequestBody StaffInfoFromDTO fromDTO);
/**
* @Description 查询工作人员名字 xx组织-章三
* @Param userId
* @author zxc
* @date 2021/8/4 4:23 下午
*/
@PostMapping("/gov/org/staff/staffname")
Result<String> staffName(@RequestParam("userId")String userId);
/**
* @Description 查询网格名字
* @Param gridName
* @author zxc
* @date 2021/8/4 4:26 下午
*/
@PostMapping("/gov/org/customergrid/selectgridname")
Result<String> gridName(@RequestParam("gridId")String gridId);
/**
* @Description 根据类型查询组织名称
* @Param formList
* @author zxc
* @date 2021/8/4 6:14 下午
*/
@PostMapping("/gov/org/customergrid/selectorgnamebytype")
Result<List<String>> selectOrgNameByType(@RequestBody List<String> formList);
/**
* @Description 根据人查询所在组织
* @Param userId
* @author zxc
* @date 2021/8/5 10:08 上午
*/
@PostMapping("/gov/org/customergrid/selectorgsbyuserid")
Result<List<String>> selectOrgsByUserId(@RequestParam("userId")String userId);
}

20
epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java

@ -215,6 +215,26 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "mine", fromDTO);
}
@Override
public Result<String> staffName(String userId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "staffName", userId);
}
@Override
public Result<String> gridName(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "gridName", gridId);
}
@Override
public Result<List<String>> selectOrgNameByType(List<String> formList) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectOrgNameByType", formList);
}
@Override
public Result<List<String>> selectOrgsByUserId(String userId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectOrgsByUserId", userId);
}
@Override
public Result<String> selectPidsByGridId(String gridId) {
return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectPidsByGridId", gridId);

34
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerGridController.java

@ -252,4 +252,38 @@ public class CustomerGridController {
public Result<String> selectPidsByGridId(@RequestParam("gridId") String gridId){
return new Result<String>().ok(customerGridService.selectPidsByGridId(gridId));
}
/**
* @Description 查询网格名字
* @Param gridId
* @author zxc
* @date 2021/8/4 4:26 下午
*/
@PostMapping("selectgridname")
Result<String> gridName(@RequestParam("gridId")String gridId){
return new Result<String>().ok(customerGridService.gridName(gridId));
}
/**
* @Description 根据类型查询组织名称
* @Param formList
* @author zxc
* @date 2021/8/4 6:14 下午
*/
@PostMapping("selectorgnamebytype")
public Result<List<String>> selectOrgNameByType(@RequestBody List<String> formList){
return new Result<List<String>>().ok(customerGridService.selectOrgNameByType(formList));
}
/**
* @Description 根据人查询所在组织
* @Param userId
* @author zxc
* @date 2021/8/5 10:08 上午
*/
@PostMapping("/selectorgsbyuserid")
public Result<List<String>> selectOrgsByUserId(@RequestParam("userId")String userId){
return new Result<List<String>>().ok(customerGridService.selectOrgsByUserId(userId));
}
}

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/StaffController.java

@ -12,10 +12,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@ -157,4 +154,15 @@ public class StaffController {
ValidatorUtils.validateEntity(fromDTO, StaffBasicInfoFromDTO.AddUserInternalGroup.class);
return staffService.staffBasicInfo(fromDTO);
}
/**
* @Description 查询工作人员名字
* @Param userId
* @author zxc
* @date 2021/8/4 3:38 下午
*/
@PostMapping("staffname")
public Result<String> staffName(@RequestParam("userId")String userId){
return new Result<String>().ok(staffService.staffName(userId));
}
}

24
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerGridDao.java

@ -276,4 +276,28 @@ public interface CustomerGridDao extends BaseDao<CustomerGridEntity> {
* @date 2021/7/16 9:52 上午
*/
String selectPidsByGridId(@Param("gridId")String gridId);
/**
* @Description 查询网格名字
* @Param gridId
* @author zxc
* @date 2021/8/4 4:30 下午
*/
String gridName(String gridId);
/**
* @Description 查询组织名字
* @Param orgIds
* @author zxc
* @date 2021/8/4 6:25 下午
*/
List<String> selectOrgNameByType(@Param("orgIds") List<String> orgIds);
/**
* @Description 根据人查询所在组织
* @Param userId
* @author zxc
* @date 2021/8/5 10:08 上午
*/
List<String> selectOrgsByUserId(@Param("userId") String userId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerStaffAgencyDao.java

@ -108,4 +108,12 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @date 2020/8/17 10:19 上午
*/
List<String> getAgencyStaffList(@Param("agencyId")String agencyId);
/**
* @Description 查询工作人员所属组织名字
* @Param staffId
* @author zxc
* @date 2021/8/4 3:54 下午
*/
String selectStaffBelongAgency(@Param("staffId")String staffId);
}

24
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerGridService.java

@ -295,4 +295,28 @@ public interface CustomerGridService extends BaseService<CustomerGridEntity> {
* @date 2021/7/16 9:52 上午
*/
String selectPidsByGridId(String gridId);
/**
* @Description 查询网格名字
* @Param gridId
* @author zxc
* @date 2021/8/4 4:26 下午
*/
String gridName(String gridId);
/**
* @Description 根据类型查询组织名称
* @Param formList
* @author zxc
* @date 2021/8/4 6:14 下午
*/
List<String> selectOrgNameByType(List<String> formList);
/**
* @Description 根据人查询所在组织
* @Param userId
* @author zxc
* @date 2021/8/5 10:08 上午
*/
List<String> selectOrgsByUserId(String userId);
}

8
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/StaffService.java

@ -105,4 +105,12 @@ public interface StaffService {
* @author sun
*/
Result<BasicInfoResultDTO> staffBasicInfo(StaffBasicInfoFromDTO fromDTO);
/**
* @Description 查询工作人员名字
* @Param userId
* @author zxc
* @date 2021/8/4 3:38 下午
*/
String staffName(String userId);
}

33
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java

@ -721,4 +721,37 @@ public class CustomerGridServiceImpl extends BaseServiceImpl<CustomerGridDao, Cu
}
return "";
}
/**
* @Description 查询网格名字
* @Param gridId
* @author zxc
* @date 2021/8/4 4:26 下午
*/
@Override
public String gridName(String gridId) {
return baseDao.gridName(gridId);
}
/**
* @Description 根据类型查询组织名称
* @Param formList
* @author zxc
* @date 2021/8/4 6:14 下午
*/
@Override
public List<String> selectOrgNameByType(List<String> formList) {
return baseDao.selectOrgNameByType(formList);
}
/**
* @Description 根据人查询所在组织
* @Param userId
* @author zxc
* @date 2021/8/5 10:08 上午
*/
@Override
public List<String> selectOrgsByUserId(String userId) {
return baseDao.selectOrgsByUserId(userId);
}
}

27
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java

@ -7,6 +7,7 @@ import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dao.CustomerStaffAgencyDao;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -14,6 +15,7 @@ import com.epmet.entity.CustomerAgencyEntity;
import com.epmet.entity.CustomerStaffAgencyEntity;
import com.epmet.feign.*;
import com.epmet.service.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@ -51,6 +53,8 @@ public class StaffServiceImpl implements StaffService {
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Autowired
private RedisUtils redisUtils;
@Autowired
private CustomerStaffAgencyDao customerStaffAgencyDao;
@Override
public Result<StaffsInAgencyResultDTO> getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) {
@ -274,4 +278,27 @@ public class StaffServiceImpl implements StaffService {
public Result<BasicInfoResultDTO> staffBasicInfo(StaffBasicInfoFromDTO fromDTO) {
return epmetUserOpenFeignClient.getStaffBasicInfo(fromDTO);
}
/**
* @Description 查询工作人员名字
* @Param userId
* @author zxc
* @date 2021/8/4 3:38 下午
*/
@Override
public String staffName(String userId) {
// 查询所属组织名字
String agencyName = customerStaffAgencyDao.selectStaffBelongAgency(userId);
if (StringUtils.isEmpty(agencyName)){
throw new RenException("查询工作人员所属组织名称为空");
}
StaffBasicInfoFromDTO formDTO = new StaffBasicInfoFromDTO();
formDTO.setStaffId(userId);
Result<BasicInfoResultDTO> staffBasicInfo = epmetUserOpenFeignClient.getStaffBasicInfo(formDTO);
if (!staffBasicInfo.success()){
throw new RenException("查询工作人员姓名失败");
}
String result = agencyName.concat(staffBasicInfo.getData().getRealName());
return result;
}
}

34
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml

@ -584,4 +584,38 @@
<select id="selectPidsByGridId" resultType="java.lang.String">
SELECT PIDS FROM customer_grid WHERE DEL_FLAG = '0' AND ID = #{gridId}
</select>
<!-- 查询网格名字 -->
<select id="gridName" resultType="java.lang.String">
SELECT
CONCAT(ca.ORGANIZATION_NAME,'-',cg.GRID_NAME) AS gridName
FROM customer_grid cg
LEFT JOIN customer_agency ca ON (ca.id = cg.PID AND ca.DEL_FLAG = '0')
WHERE cg.DEL_FLAG = 0
AND cg.ID = #{gridId}
</select>
<!-- 查询组织名字 -->
<select id="selectOrgNameByType" resultType="java.lang.String">
SELECT GRID_NAME AS orgName FROM customer_grid WHERE DEL_FLAG = '0'
AND(
<foreach collection="orgIds" item="orgId" separator=" or ">
id = #{orgId}
</foreach>
)
UNION ALL
SELECT ORGANIZATION_NAME AS orgName FROM customer_agency WHERE DEL_FLAG = '0'
AND(
<foreach collection="orgIds" item="orgId" separator=" or ">
id = #{orgId}
</foreach>
)
</select>
<!-- 根据人查询所在组织 -->
<select id="selectOrgsByUserId" resultType="java.lang.String">
SELECT GRID_ID AS orgId FROM customer_staff_grid WHERE del_flag = '0' AND USER_ID = #{userId}
union ALL
SELECT agency_id AS orgId FROM customer_staff_agency WHERE del_flag = '0' and USER_ID = #{userId}
</select>
</mapper>

10
epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerStaffAgencyDao.xml

@ -152,4 +152,14 @@
del_flag = '0'
AND agency_id = #{agencyId}
</select>
<!-- 查询工作人员所属组织名字 -->
<select id="selectStaffBelongAgency" resultType="java.lang.String">
SELECT
CONCAT(ca.ORGANIZATION_NAME,'-') AS agencyName
FROM customer_staff_agency sa
LEFT JOIN customer_agency ca ON (ca.ID = sa.AGENCY_ID AND ca.DEL_FLAG = '0')
WHERE sa.DEL_FLAG = 0
AND sa.USER_ID = #{staffId}
</select>
</mapper>

4
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/EventProjectInfoDTO.java

@ -1,5 +1,6 @@
package com.epmet.dto;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -29,6 +30,9 @@ public class EventProjectInfoDTO implements Serializable {
*/
private String operationTime;
@JsonIgnore
private String userId;
/**
* 报事说明
*/

29
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/CloseResiEventFormDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 报事-办结 入参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/5 10:44
*/
@Data
public class CloseResiEventFormDTO implements Serializable {
private static final long serialVersionUID = -3621650590714057648L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "eventId不能为空", groups = AddUserInternalGroup.class)
private String eventId;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
}

2
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/EventDetailFormDTO.java

@ -19,4 +19,6 @@ public class EventDetailFormDTO implements Serializable {
@NotBlank(message = "报事ID不能为空",groups = EventDetailForm.class)
private String eventId;
private String orgId;
}

6
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MentionUserFormDTO.java

@ -32,4 +32,10 @@ public class MentionUserFormDTO implements Serializable {
* 注册网格的所有上级
*/
private String pids;
/**
* 人大代表姓名
*/
private String userShowName;
}

34
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 回复通用入参
*
* @author yinzuomei@elink-cn.com
* @date 2021/8/4 14:16
*/
@Data
public class ReplyFormDTO implements Serializable {
private static final long serialVersionUID = 1653042839040178697L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "事件id不能为空",groups = AddUserInternalGroup.class)
private String resiEventId;
@Length(min = 1, max = 200, message = "请填写回复内容,最多输入200字", groups = AddUserShowGroup.class)
private String content;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
}

3
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReplyListFormDTO.java

@ -20,4 +20,7 @@ public class ReplyListFormDTO implements Serializable {
@NotBlank(message = "报事ID不能为空",groups = ReplyListForm.class)
private String resiEventId;
@NotBlank(message = "当前用户id不能为空",groups = ReplyListForm.class)
private String currentUserId;
}

28
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/UpdateViewTimeFormDTO.java

@ -9,21 +9,35 @@ import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/3 10:55 上午
* @DESC
* @DESC 报事-首次查看事件-两端通用
*/
@Data
public class UpdateViewTimeFormDTO implements Serializable {
private static final long serialVersionUID = 7104400078458366322L;
public interface AddUserInternalGroup {
}
public interface GovInternalGroup {
}
public interface UpdateViewTimeForm{}
// 居民端:resi_user;工作端:staff
@NotBlank(message = "viewType不能为空", groups = AddUserInternalGroup.class)
private String viewType;
@NotBlank(message = "eventId不能为空", groups = AddUserInternalGroup.class)
private String eventId;
@NotBlank(message = "orgId不能为空", groups = GovInternalGroup.class)
private String orgId;
//以下参数从token中获取
/**
* 居民端用户:resi_user工作人员:staff
* 当前用户id
*/
@NotBlank(message = "viewType不能为空",groups = UpdateViewTimeForm.class)
private String viewType;
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
@NotBlank(message = "事件ID不能为空",groups = UpdateViewTimeForm.class)
private String eventId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

26
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/EventDetailResultDTO.java

@ -1,6 +1,7 @@
package com.epmet.dto.result;
import com.epmet.dto.EventProjectInfoDTO;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
@ -37,6 +38,9 @@ public class EventDetailResultDTO implements Serializable {
*/
private String gridName;
@JsonIgnore
private String gridId;
/**
* 是否办结truefalse
*/
@ -62,11 +66,33 @@ public class EventDetailResultDTO implements Serializable {
*/
private List<String> eventPerson;
/**
* 被提到的组织
*/
private List<String> eventOrg;
/**
* 报事人名字
*/
private String eventPeopleName;
@JsonIgnore
private String eventUserId;
/**
* 项目信息
*/
private EventProjectInfoDTO projectInfo;
@JsonIgnore
private List<String> orgNameList;
@JsonIgnore
private String projectId;
@JsonIgnore
private Boolean isProject;
public EventDetailResultDTO() {
this.eventTime = "";
this.eventContent = "";

10
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MyReportedResultDTO.java

@ -52,4 +52,14 @@ public class MyReportedResultDTO implements Serializable {
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date showTime;
/**
* true:显示回复false不显示回复按钮
*/
private String replyButtonFlag;
/**
* 事件是否被阅读过;1已读针对报事人待处理列表
*/
private Boolean readFlag;
}

32
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/NewEventsResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author zxc
* @DateTime 2021/8/5 9:51 上午
* @DESC
*/
@Data
public class NewEventsResultDTO implements Serializable {
private static final long serialVersionUID = 2151884734349908080L;
/**
* 事件内容
*/
private String eventContent;
/**
* 事件时间
*/
private String eventTime;
/**
* 事件图片
*/
private List<String> eventImgs;
}

22
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/OrgNameByTypeResultDTO.java

@ -0,0 +1,22 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/4 5:48 下午
* @DESC
*/
@Data
public class OrgNameByTypeResultDTO implements Serializable {
private static final long serialVersionUID = -6544341694748437312L;
private String orgId;
private String orgType;
private String orgName;
}

20
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ReplyListResultDTO.java

@ -1,8 +1,11 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @Author zxc
@ -14,5 +17,22 @@ public class ReplyListResultDTO implements Serializable {
private static final long serialVersionUID = 4875335642497226847L;
/**
* 回复人的昵称比如南宁路社区,人大代表-李四,山东路-尹女士
* */
private String replyName;
/**
* 回复时间
* */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone="GMT+8")
private Date replyTime;
/**
* 回复的内容
* */
private String replyContent;
@JsonIgnore
private String replyUserId;
}

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/EventConstant.java

@ -43,4 +43,10 @@ public interface EventConstant {
*/
String RESOLVED="resolved";
String UN_SOLVED="un_solved";
/**
* 小程序类型
*/
String TYPE_GOV = "gov";
String TYPE_RESI = "resi";
}

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ResiEventAction.java

@ -16,13 +16,13 @@ public enum ResiEventAction {
// 5、办结:close_case;
// 6、选择是否已解决:choose_resolve;
// 7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;
PUBLISH ( "publish",""),
RECALL( "recall",""),
REPLY ("reply",""),
SHIFIT_PROJECT ( "shift_project",""),
CLOSE_CASE ( "close_case",""),
CHOOSE_RESOLVE ( "choose_resolve",""),
READ( "read","");
PUBLISH ( "publish","发布事件"),
RECALL( "recall","撤回事件"),
REPLY ("reply","回复"),
SHIFIT_PROJECT ( "shift_project","立项"),
CLOSE_CASE ( "close_case","办结"),
CHOOSE_RESOLVE ( "choose_resolve","选择是否解决"),
READ_FIRST( "read_first","首次查看事件");
private String code;

82
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventController.java

@ -21,6 +21,7 @@ import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.EventConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.service.ResiEventService;
@ -42,34 +43,35 @@ import java.util.List;
@RestController
@RequestMapping("resievent")
public class ResiEventController {
@Autowired
private ResiEventService resiEventService;
/**
* @Description 报事详情-两端通用
* @Description 报事详情-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 1:47 下午
*/
@PostMapping("eventdetail")
public Result<EventDetailResultDTO> eventDetail(@RequestBody EventDetailFormDTO formDTO){
public Result<EventDetailResultDTO> eventDetail(@LoginUser TokenDto tokenDto, @RequestBody EventDetailFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<EventDetailResultDTO>().ok(resiEventService.eventDetail(formDTO));
return new Result<EventDetailResultDTO>().ok(resiEventService.eventDetail(formDTO, tokenDto));
}
/**
* 我要报事-提交
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/3 10:46
*/
@PostMapping("report")
public Result<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO){
public Result<ResiEventIdDTO> report(@LoginUser TokenDto tokenDto, @RequestBody ResiEventFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ResiEventFormDTO.AddUserShowGroup.class,ResiEventFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, ResiEventFormDTO.AddUserShowGroup.class, ResiEventFormDTO.AddUserInternalGroup.class);
return new Result<ResiEventIdDTO>().ok(resiEventService.report(formDTO));
}
@ -77,15 +79,15 @@ public class ResiEventController {
* 我要报事-撤回
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/3 10:54
*/
@PostMapping("recall")
public Result recall(@LoginUser TokenDto tokenDto,@RequestBody ReCallEventFormDTO formDTO){
public Result recall(@LoginUser TokenDto tokenDto, @RequestBody ReCallEventFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ResiEventIdDTO.ResiEventIdGroup.class,ReCallEventFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, ResiEventIdDTO.ResiEventIdGroup.class, ReCallEventFormDTO.AddUserInternalGroup.class);
resiEventService.reCall(formDTO);
return new Result();
}
@ -95,15 +97,15 @@ public class ResiEventController {
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/3 13:57
*/
@PostMapping("chooseresolve")
public Result chooseResolve(@LoginUser TokenDto tokenDto,@RequestBody ChooseResolveFormDTO formDTO){
public Result chooseResolve(@LoginUser TokenDto tokenDto, @RequestBody ChooseResolveFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ResiEventIdDTO.ResiEventIdGroup.class,ChooseResolveFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, ResiEventIdDTO.ResiEventIdGroup.class, ChooseResolveFormDTO.AddUserInternalGroup.class);
resiEventService.chooseResolve(formDTO);
return new Result();
}
@ -114,39 +116,44 @@ public class ResiEventController {
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MyReportedResultDTO>>
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.MyReportedResultDTO>>
* @author yinzuomei
* @date 2021/8/3 14:27
*/
@PostMapping("myreported")
public Result<List<MyReportedResultDTO>> queryMyReported(@LoginUser TokenDto tokenDto, @RequestBody MyReportedFormDTO formDTO){
public Result<List<MyReportedResultDTO>> queryMyReported(@LoginUser TokenDto tokenDto, @RequestBody MyReportedFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,MyReportedFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, MyReportedFormDTO.AddUserInternalGroup.class);
return new Result<List<MyReportedResultDTO>>().ok(resiEventService.queryMyReported(formDTO));
}
/**
* @Description 群众直报待处理处理中已办结列表
* @Description 群众直报待处理处理中已办结列表
* @Param formDTO
* @author zxc
* @date 2021/8/3 10:53 上午
*/
@PostMapping("eventlist")
public Result<List<EventListResultDTO>> eventList(@RequestBody EventListFormDTO formDTO){
public Result<List<EventListResultDTO>> eventList(@RequestBody EventListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, EventListFormDTO.EventListForm.class);
return new Result<List<EventListResultDTO>>().ok(resiEventService.eventList(formDTO));
}
/**
* @Description 查看报事时,更新时间操作
* @Description 报事-首次查看事件-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:01 上午
*/
@PostMapping("updateviewtime")
public Result updateViewTime(@RequestBody UpdateViewTimeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.UpdateViewTimeForm.class);
public Result updateViewTime(@LoginUser TokenDto tokenDto, @RequestBody UpdateViewTimeFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
formDTO.setCustomerId(tokenDto.getCustomerId());
ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.AddUserInternalGroup.class);
if (EventConstant.STAFF.equals(formDTO.getViewType())) {
ValidatorUtils.validateEntity(formDTO, UpdateViewTimeFormDTO.GovInternalGroup.class);
}
resiEventService.updateViewTime(formDTO);
return new Result();
}
@ -156,16 +163,43 @@ public class ResiEventController {
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.MyReportedResultDTO>>
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.MyReportedResultDTO>>
* @author yinzuomei
* @date 2021/8/4 9:40
*/
@PostMapping("mentionlist")
public Result<List<UserMentionResultDTO>> mentionList(@LoginUser TokenDto tokenDto, @RequestBody UserMentionFormDTO formDTO){
public Result<List<UserMentionResultDTO>> mentionList(@LoginUser TokenDto tokenDto, @RequestBody UserMentionFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,UserMentionFormDTO.AddUserInternalGroup.class);
ValidatorUtils.validateEntity(formDTO, UserMentionFormDTO.AddUserInternalGroup.class);
return new Result<List<UserMentionResultDTO>>().ok(resiEventService.mentionList(formDTO));
}
/**
* @Description 最新直报
* @Param userId
* @author zxc
* @date 2021/8/5 9:55 上午
*/
@PostMapping("newevents")
public Result<List<NewEventsResultDTO>> newEvents(@LoginUser TokenDto tokenDto) {
return new Result<List<NewEventsResultDTO>>().ok(resiEventService.newEvents(tokenDto.getUserId()));
}
/**
* 报事办结
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/5 10:47
*/
@PostMapping("close")
public Result closeResiEvent(@LoginUser TokenDto tokenDto, @RequestBody CloseResiEventFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, CloseResiEventFormDTO.AddUserInternalGroup.class);
resiEventService.closeResiEvent(formDTO);
return new Result();
}
}

56
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ResiEventReplyController.java

@ -17,8 +17,11 @@
package com.epmet.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.ReplyFormDTO;
import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.service.ResiEventReplyService;
@ -51,9 +54,60 @@ public class ResiEventReplyController {
* @date 2021/8/3 11:11 上午
*/
@PostMapping("list")
public Result<List<ReplyListResultDTO>> replyList(@RequestBody ReplyListFormDTO formDTO){
public Result<List<ReplyListResultDTO>> replyList(@LoginUser TokenDto tokenDto, @RequestBody ReplyListFormDTO formDTO){
formDTO.setCurrentUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, ReplyListFormDTO.ReplyListForm.class);
return new Result<List<ReplyListResultDTO>>().ok(resiEventReplyService.replyList(formDTO));
}
/**
* 报事-工作人员回复
*
* @param tokenDto
* @param replyFormDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/4 14:19
*/
@PostMapping("govReply")
public Result govReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO replyFormDTO){
replyFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(replyFormDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class);
resiEventReplyService.govReply(replyFormDTO);
return new Result();
}
/**
* 报事当事人回复
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/4 14:37
*/
@PostMapping("selfReply")
public Result selfReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class);
resiEventReplyService.selfReply(formDTO);
return new Result();
}
/**
* 艾特的人回复
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/4 15:06
*/
@PostMapping("atReply")
public Result atReply(@LoginUser TokenDto tokenDto,@RequestBody ReplyFormDTO formDTO){
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ReplyFormDTO.AddUserShowGroup.class,ReplyFormDTO.AddUserInternalGroup.class);
resiEventReplyService.atReply(formDTO);
return new Result();
}
}

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java

@ -18,6 +18,7 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.EventProjectInfoDTO;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.LatestListFormDTO;
@ -206,4 +207,12 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @return java.util.List<com.epmet.dto.result.UnResolvedResultDTO>
*/
List<UnResolvedResultDTO> selectUnResolvedListByGrid(@Param("gridId")String gridId);
/**
* @Description 查询报事转项目详情
* @Param projectId
* @author zxc
* @date 2021/8/4 2:43 下午
*/
EventProjectInfoDTO selectEventProjectInfo(@Param("projectId")String projectId);
}

34
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventDao.java

@ -18,8 +18,10 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.EventDetailResultDTO;
import com.epmet.dto.result.EventListResultDTO;
import com.epmet.dto.result.MyReportedResultDTO;
import com.epmet.dto.result.NewEventsResultDTO;
import com.epmet.entity.ResiEventEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -54,4 +56,36 @@ public interface ResiEventDao extends BaseDao<ResiEventEntity> {
* @date 2021/8/3 23:21
*/
List<MyReportedResultDTO> queryMyReported(@Param("userId") String userId, @Param("statusCondition")String statusCondition);
/**
* @Description 查询报事详情
* @Param eventId
* @author zxc
* @date 2021/8/4 2:16 下午
*/
EventDetailResultDTO selectEventDetail(@Param("eventId")String eventId);
/**
* @Description 更新报事人红点状态
* @Param userId
* @author zxc
* @date 2021/8/4 5:30 下午
*/
void updateResiEvent(@Param("userId") String userId,@Param("eventId")String eventId);
/**
* @Description 更新人大代表红点状态
* @Param userId
* @author zxc
* @date 2021/8/4 5:32 下午
*/
void updateEventMention(@Param("userId") String userId,@Param("eventId")String eventId);
/**
* @Description 最新直报
* @Param orgIds
* @author zxc
* @date 2021/8/5 10:42 上午
*/
List<NewEventsResultDTO> newEvents(@Param("orgIds")List<String> orgIds);
}

21
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventMentionDao.java

@ -44,4 +44,25 @@ public interface ResiEventMentionDao extends BaseDao<ResiEventMentionEntity> {
* @date 2021/8/4 9:54
*/
List<UserMentionResultDTO> selectMentionList(@Param("userId")String userId, @Param("readFlag")String readFlag);
/**
* 人大代表从未读-已读首次查看事件
*
* @param eventId
* @param userId
* @return int
* @author yinzuomei
* @date 2021/8/4 16:37
*/
int updateReadFlag(@Param("eventId") String eventId, @Param("userId")String userId);
/**
* 展示红点
*
* @param resiEventId
* @return int
* @author yinzuomei
* @date 2021/8/4 17:41
*/
int updateRedDotShow(@Param("resiEventId") String resiEventId,@Param("excludeUserId")String excludeUserId);
}

16
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventOperationLogDao.java

@ -20,6 +20,9 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventOperationLogEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 事件操作日志表
@ -29,5 +32,16 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ResiEventOperationLogDao extends BaseDao<ResiEventOperationLogEntity> {
/**
* 查询事件操作日志
*
* @param eventId
* @param userId
* @param actionCode
* @return com.epmet.entity.ResiEventOperationLogEntity
* @author yinzuomei
* @date 2021/8/4 16:44
*/
List<ResiEventOperationLogEntity> selectByUserAction(@Param("eventId") String eventId, @Param("userId")String userId, @Param("actionCode")String actionCode);
}

14
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReplyDao.java

@ -18,9 +18,12 @@
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.entity.ResiEventReplyEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* 事件回复表
*
@ -29,5 +32,14 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ResiEventReplyDao extends BaseDao<ResiEventReplyEntity> {
/**
* 查询事件的回复列表
*
* @param resiEventId
* @return java.util.List<com.epmet.dto.result.ReplyListResultDTO>
* @author yinzuomei
* @date 2021/8/4 13:22
*/
List<ReplyListResultDTO> selectReplyList(String resiEventId);
}

32
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ResiEventReportOrgDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ResiEventReportOrgEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 事件相关组织表
@ -29,5 +30,34 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface ResiEventReportOrgDao extends BaseDao<ResiEventReportOrgEntity> {
/**
* 工作人员从待处理=处理中
*
* @param eventId
* @param orgId
* @return int
* @author yinzuomei
* @date 2021/8/4 16:40
*/
int updateReadFlag(@Param("eventId") String eventId, @Param("orgId") String orgId,@Param("userId") String userId);
/**
* @Description 更新组织的红点显示状态
* @Param eventId
* @Param orgId
* @author zxc
* @date 2021/8/4 5:42 下午
*/
void updateEventOrg(@Param("eventId") String eventId, @Param("orgId") String orgId);
/**
* 展示红点
*
* @param resiEventId
* @return int
* @author yinzuomei
* @date 2021/8/4 17:41
*/
int updateRedDotShow(String resiEventId);
}

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ResiEventMentionEntity.java

@ -50,6 +50,11 @@ public class ResiEventMentionEntity extends BaseEpmetEntity {
*/
private String userType;
/**
* 人大代表目前显示姓名
*/
private String userShowName;
/**
* 居民端用户id
*/

31
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventReplyService.java

@ -18,10 +18,10 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.form.ReplyFormDTO;
import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.entity.ResiEventReplyEntity;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@ -41,4 +41,33 @@ public interface ResiEventReplyService extends BaseService<ResiEventReplyEntity>
*/
List<ReplyListResultDTO> replyList(ReplyListFormDTO formDTO);
/**
* 报事-工作人员回复
*
* @param replyFormDTO
* @return void
* @author yinzuomei
* @date 2021/8/4 14:20
*/
void govReply(ReplyFormDTO replyFormDTO);
/**
* 报事当事人回复
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/4 14:39
*/
void selfReply(ReplyFormDTO formDTO);
/**
* 艾特的人回复
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/4 15:06
*/
void atReply(ReplyFormDTO formDTO);
}

24
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ResiEventService.java

@ -1,6 +1,7 @@
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.ResiEventEntity;
@ -24,7 +25,7 @@ public interface ResiEventService extends BaseService<ResiEventEntity> {
List<EventListResultDTO> eventList(EventListFormDTO formDTO);
/**
* @Description 查看报事时,更新时间操作
* @Description 报事-首次查看事件-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:01 上午
@ -37,7 +38,7 @@ public interface ResiEventService extends BaseService<ResiEventEntity> {
* @author zxc
* @date 2021/8/3 1:47 下午
*/
EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO);
EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO, TokenDto tokenDto);
/**
* 我要报事-提交
@ -88,4 +89,23 @@ public interface ResiEventService extends BaseService<ResiEventEntity> {
* @date 2021/8/4 9:41
*/
List<UserMentionResultDTO> mentionList(UserMentionFormDTO formDTO);
/**
* @Description 最新直报
* @Param userId
* @author zxc
* @date 2021/8/5 9:55 上午
*/
List<NewEventsResultDTO> newEvents(String userId);
/**
* 报事办结
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/5 10:48
*/
void closeResiEvent(CloseResiEventFormDTO formDTO);
}

235
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventReplyServiceImpl.java

@ -18,14 +18,38 @@
package com.epmet.service.impl;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.dao.ResiEventReplyDao;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.EventConstant;
import com.epmet.constant.ResiEventAction;
import com.epmet.dao.*;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.ReplyFormDTO;
import com.epmet.dto.form.ReplyListFormDTO;
import com.epmet.dto.result.ReplyListResultDTO;
import com.epmet.dto.result.UserBaseInfoResultDTO;
import com.epmet.entity.ResiEventEntity;
import com.epmet.entity.ResiEventOperationLogEntity;
import com.epmet.entity.ResiEventReplyEntity;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.ResiEventReplyService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* 事件回复表
@ -35,6 +59,23 @@ import java.util.List;
*/
@Service
public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao, ResiEventReplyEntity> implements ResiEventReplyService {
@Autowired
private ResiEventDao resiEventDao;
@Autowired
private ResiEventOperationLogDao resiEventOperationLogDao;
@Autowired
private ResiEventMentionDao resiEventMentionDao;
@Autowired
private ResiEventReportOrgDao resiEventReportOrgDao;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Value("${openapi.scan.server.url}")
private String scanApiUrl;
@Value("${openapi.scan.method.textSyncScan}")
private String textSyncScanMethod;
/**
* @Description 报事详情-回复列表-两端通用
@ -44,6 +85,196 @@ public class ResiEventReplyServiceImpl extends BaseServiceImpl<ResiEventReplyDao
*/
@Override
public List<ReplyListResultDTO> replyList(ReplyListFormDTO formDTO) {
return null;
List<ReplyListResultDTO> list=baseDao.selectReplyList(formDTO.getResiEventId());
list.forEach(dto->{
if(dto.getReplyUserId().equals(formDTO.getCurrentUserId())){
dto.setReplyName("我");
}
});
return list;
}
/**
* 报事-工作人员回复:办结立项处理后不可回复
*
* @param replyFormDTO
* @return void
* @author yinzuomei
* @date 2021/8/4 14:20
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void govReply(ReplyFormDTO replyFormDTO) {
ResiEventEntity eventEntity=queryResiEntity(replyFormDTO.getResiEventId());
// 回复内容走审核
scanReplyContent(replyFormDTO.getContent());
//查询工作人员所属组织
Result<CustomerAgencyDTO> staffResult = govOrgOpenFeignClient.getAgencyByStaff(replyFormDTO.getUserId());
if (!staffResult.success() && null == staffResult.getData()) {
throw new RenException("查询当前工作人员信息异常");
}
// 插入回复表
ResiEventReplyEntity resiEventReplyEntity=new ResiEventReplyEntity();
resiEventReplyEntity.setCustomerId(eventEntity.getCustomerId());
resiEventReplyEntity.setResiEventId(replyFormDTO.getResiEventId());
resiEventReplyEntity.setFromUserId(replyFormDTO.getUserId());
resiEventReplyEntity.setContent(replyFormDTO.getContent());
resiEventReplyEntity.setUserShowName(staffResult.getData().getOrganizationName());
resiEventReplyEntity.setCreatedTime(new Date());
baseDao.insert(resiEventReplyEntity);
// 记录操作日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(eventEntity.getCustomerId());
reCallLog.setResiEventId(eventEntity.getId());
reCallLog.setUserId(replyFormDTO.getUserId());
reCallLog.setUserIdentity(EventConstant.STAFF);
reCallLog.setActionCode(ResiEventAction.REPLY.getCode());
reCallLog.setActionDesc(ResiEventAction.REPLY.getDesc());
reCallLog.setOperateTime(resiEventReplyEntity.getCreatedTime());
resiEventOperationLogDao.insert(reCallLog);
// 1、更新被@的人的红点置为显示
resiEventMentionDao.updateRedDotShow(replyFormDTO.getResiEventId(),null);
// 2、更新报事人的红点置为显示
eventEntity.setRedDot(true);
//更新事件最后一次操作时间
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime());
resiEventDao.updateById(eventEntity);
// 3、组织改为不显示已经在查看详情中操作了 ,目前只有一个组织,如果后面可以报给多个组织,这里入参要增加orgId todo
}
private ResiEventEntity queryResiEntity(String resiEventId) {
ResiEventEntity eventEntity=resiEventDao.selectById(resiEventId);
// 办结、立项处理后不可回复
if(EventConstant.EVENT_STATUS_CLOSED_CASE.equals(eventEntity.getStatus())||eventEntity.getShiftProject()){
throw new RenException(EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_GOV.getCode(),EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_GOV.getMsg());
}
return eventEntity;
}
/**
* 报事当事人回复
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/4 14:39
*/
@Transactional(rollbackFor = Exception.class)
@Override
public void selfReply(ReplyFormDTO formDTO) {
//查询原事件、已办结、已立项不可回复
ResiEventEntity eventEntity=queryResiEntity(formDTO.getResiEventId());
// 只有被人读过,才可以回复
if (!eventEntity.getReadFlag()) {
throw new RenException(EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_SELF.getCode(), EpmetErrorCode.CAN_NOT_REPLY_RESI_EVENT_SELF.getMsg());
}
// 回复内容走审核
scanReplyContent(formDTO.getContent());
// 查询当前用户的显示昵称
List<String> userIdList =new ArrayList<>();
userIdList.add(formDTO.getUserId());
Result<List<UserBaseInfoResultDTO>> userResult=epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if(!userResult.success()|| CollectionUtils.isEmpty(userResult.getData())){
throw new RenException("查询当前用户信息异常");
}
// 插入回复表
ResiEventReplyEntity resiEventReplyEntity=new ResiEventReplyEntity();
resiEventReplyEntity.setCustomerId(eventEntity.getCustomerId());
resiEventReplyEntity.setResiEventId(formDTO.getResiEventId());
resiEventReplyEntity.setFromUserId(formDTO.getUserId());
resiEventReplyEntity.setContent(formDTO.getContent());
resiEventReplyEntity.setUserShowName(userResult.getData().get(0).getShowName());
resiEventReplyEntity.setCreatedTime(new Date());
baseDao.insert(resiEventReplyEntity);
//更新事件最后一次操作时间
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime());
resiEventDao.updateById(eventEntity);
// 记录操作日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(eventEntity.getCustomerId());
reCallLog.setResiEventId(eventEntity.getId());
reCallLog.setUserId(formDTO.getUserId());
reCallLog.setUserIdentity(EventConstant.REPORT_USER);
reCallLog.setActionCode(ResiEventAction.REPLY.getCode());
reCallLog.setActionDesc(ResiEventAction.REPLY.getDesc());
reCallLog.setOperateTime(resiEventReplyEntity.getCreatedTime());
resiEventOperationLogDao.insert(reCallLog);
// 1、更新被@的人的红点置为显示
resiEventMentionDao.updateRedDotShow(formDTO.getResiEventId(),null);
// 2、更新报事人的红点置为不显示已经在查看详情中操作了
// 3、组织改为显示
resiEventReportOrgDao.updateRedDotShow(formDTO.getResiEventId());
}
/**
* 艾特的人回复
*
* @param replyFormDTO
* @return void
* @author yinzuomei
* @date 2021/8/4 15:06
*/
@Override
public void atReply(ReplyFormDTO replyFormDTO) {
ResiEventEntity eventEntity=queryResiEntity(replyFormDTO.getResiEventId());
// 回复内容走审核
scanReplyContent(replyFormDTO.getContent());
// 查询当前用户的显示昵称
List<String> userIdList =new ArrayList<>();
userIdList.add(replyFormDTO.getUserId());
Result<List<UserBaseInfoResultDTO>> userResult=epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if(!userResult.success()|| CollectionUtils.isEmpty(userResult.getData())){
throw new RenException("查询当前用户信息异常");
}
// 插入回复表
ResiEventReplyEntity resiEventReplyEntity=new ResiEventReplyEntity();
resiEventReplyEntity.setCustomerId(eventEntity.getCustomerId());
resiEventReplyEntity.setResiEventId(replyFormDTO.getResiEventId());
resiEventReplyEntity.setFromUserId(replyFormDTO.getUserId());
resiEventReplyEntity.setContent(replyFormDTO.getContent());
resiEventReplyEntity.setUserShowName("人大代表-".concat(userResult.getData().get(0).getRealName()));
resiEventReplyEntity.setCreatedTime(new Date());
baseDao.insert(resiEventReplyEntity);
// 记录操作日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(eventEntity.getCustomerId());
reCallLog.setResiEventId(eventEntity.getId());
reCallLog.setUserId(replyFormDTO.getUserId());
reCallLog.setUserIdentity(EventConstant.RESI_USER);
reCallLog.setActionCode(ResiEventAction.REPLY.getCode());
reCallLog.setActionDesc(ResiEventAction.REPLY.getDesc());
reCallLog.setOperateTime(resiEventReplyEntity.getCreatedTime());
resiEventOperationLogDao.insert(reCallLog);
// 1、当前被艾特的人红点不展示已经在查看详情接口操作了,其他被@的人的红点置为显示
resiEventMentionDao.updateRedDotShow(replyFormDTO.getResiEventId(),replyFormDTO.getUserId());
// 2、更新报事人的红点置为显示
eventEntity.setRedDot(true);
//更新事件最后一次操作时间
eventEntity.setLatestOperatedTime(resiEventReplyEntity.getCreatedTime());
resiEventDao.updateById(eventEntity);
// 3、组织改为显示
resiEventReportOrgDao.updateRedDotShow(replyFormDTO.getResiEventId());
}
private void scanReplyContent(String content) {
if (StringUtils.isNotBlank(content)) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setContent(content);
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode(), EpmetErrorCode.TEXT_SCAN_FAILED.getMsg());
}
}
}
}
}

188
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -29,12 +29,14 @@ import com.epmet.commons.tools.scan.param.ImgTaskDTO;
import com.epmet.commons.tools.scan.param.TextScanParamDTO;
import com.epmet.commons.tools.scan.param.TextTaskDTO;
import com.epmet.commons.tools.scan.result.SyncScanResult;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.utils.ScanContentUtils;
import com.epmet.constant.EventConstant;
import com.epmet.constant.ResiEventAction;
import com.epmet.dao.*;
import com.epmet.dto.EventProjectInfoDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.entity.*;
@ -48,6 +50,7 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
@ -82,6 +85,10 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
private ResiEventMentionDao resiEventMentionDao;
@Autowired
private ResiEventOperationLogDao resiEventOperationLogDao;
@Autowired
private ProjectDao projectDao;
@Autowired
private ResiEventReplyDao resiEventReplyDao;
/**
* @Description 群众直报待处理处理中已办结列表
@ -102,14 +109,46 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
}
/**
* @Description 查看报事时,更新时间操作
* @Description 报事-首次查看事件-两端通用
* @Param formDTO
* @author zxc
* @date 2021/8/3 11:01 上午
*/
@Override
public void updateViewTime(UpdateViewTimeFormDTO formDTO) {
ResiEventEntity eventEntity=baseDao.selectById(formDTO.getEventId());
if (null == eventEntity) {
throw new RenException(String.format("没有找到事件记录,eventId:%s",formDTO.getEventId()));
}
if(formDTO.getUserId().equals(eventEntity.getReportUserId())){
log.warn("报事人查看详情不需要调用此接口");
return;
}
// 这个事件已经被查看了
eventEntity.setReadFlag(true);
baseDao.updateById(eventEntity);
// 居民端:resi_user;工作端:staff
if(EventConstant.RESI_USER.equals(formDTO.getViewType())){
//被@的人置为已读
resiEventMentionDao.updateReadFlag(formDTO.getEventId(),formDTO.getUserId());
}else if(EventConstant.STAFF.equals(formDTO.getViewType())){
// 当前组织置为已读
resiEventReportOrgDao.updateReadFlag(formDTO.getEventId(),formDTO.getOrgId(),formDTO.getUserId());
}
// 插入首次查看日志
List<ResiEventOperationLogEntity> logEntityList = resiEventOperationLogDao.selectByUserAction(formDTO.getEventId(), formDTO.getUserId(), ResiEventAction.READ_FIRST.getCode());
if (CollectionUtils.isEmpty(logEntityList)) {
ResiEventOperationLogEntity publishLog=new ResiEventOperationLogEntity();
publishLog.setCustomerId(formDTO.getCustomerId());
publishLog.setResiEventId(formDTO.getEventId());
publishLog.setUserId(formDTO.getUserId());
publishLog.setUserIdentity(formDTO.getViewType());
publishLog.setActionCode(ResiEventAction.READ_FIRST.getCode());
publishLog.setActionDesc(ResiEventAction.READ_FIRST.getDesc());
publishLog.setOperateTime(new Date());
publishLog.setCreatedTime(publishLog.getOperateTime());
resiEventOperationLogDao.insert(publishLog);
}
}
/**
@ -119,9 +158,60 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
* @date 2021/8/3 1:47 下午
*/
@Override
public EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO) {
return null;
@Transactional(rollbackFor = Exception.class)
public EventDetailResultDTO eventDetail(EventDetailFormDTO formDTO, TokenDto tokenDto) {
EventDetailResultDTO dto = baseDao.selectEventDetail(formDTO.getEventId());
if (null == dto){
return new EventDetailResultDTO();
}
// 已转项目
if (dto.getIsProject()){
// 查询项目信息
EventProjectInfoDTO eventProjectInfo = projectDao.selectEventProjectInfo(dto.getProjectId());
// 查询操作人的名字
Result<String> staffName = govOrgOpenFeignClient.staffName(eventProjectInfo.getUserId());
if (!staffName.success()){
throw new RenException("查询工作人员名字失败");
}
eventProjectInfo.setOperationName(staffName.getData());
dto.setProjectInfo(eventProjectInfo);
}
// 查询报事人名字
List<String> userIdList = new ArrayList<>();
userIdList.add(dto.getEventUserId());
Result<List<UserBaseInfoResultDTO>> userResult=epmetUserOpenFeignClient.queryUserBaseInfo(userIdList);
if(!userResult.success()|| CollectionUtils.isEmpty(userResult.getData())){
throw new RenException("查询当前用户信息异常");
}
userResult.getData().forEach(u -> {
if (u.getUserId().equals(dto.getEventUserId())){
dto.setEventPeopleName(u.getShowName());
}
});
// 查询所属网格
Result<String> gridNameResult = govOrgOpenFeignClient.gridName(dto.getGridId());
if (!gridNameResult.success()){
throw new RenException("查询所属网格失败");
}
dto.setGridName(gridNameResult.getData());
// 查询报事的org
List<String> orgNameList = dto.getOrgNameList();
Result<List<String>> orgResult = govOrgOpenFeignClient.selectOrgNameByType(orgNameList);
if (!orgResult.success()){
throw new RenException("查询组织名称失败");
}
List<String> data = orgResult.getData();
dto.setEventOrg(data);
// 更改已读状态 报事人的红点:resi_event,艾特人的:resi_event_mention,所代表的组织的:resi_event_report_org
if (tokenDto.getApp().equals(EventConstant.TYPE_RESI)){
baseDao.updateResiEvent(tokenDto.getUserId(),formDTO.getEventId());
baseDao.updateEventMention(tokenDto.getUserId(),formDTO.getEventId());
}else if (tokenDto.getApp().equals(EventConstant.TYPE_GOV)){
resiEventReportOrgDao.updateEventOrg(formDTO.getEventId(), formDTO.getOrgId());
}
return dto;
}
/**
* 我要报事-提交
*
@ -185,6 +275,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
publishLog.setActionCode(ResiEventAction.PUBLISH.getCode());
publishLog.setActionDesc(ResiEventAction.PUBLISH.getDesc());
publishLog.setOperateTime(resiEventEntity.getCreatedTime());
publishLog.setCreatedTime(resiEventEntity.getCreatedTime());
resiEventOperationLogDao.insert(publishLog);
//9、返回事件id
ResiEventIdDTO resiEventIdDTO=new ResiEventIdDTO();
@ -199,12 +290,14 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
mentionEntity.setCustomerId(customerId);
mentionEntity.setResiEventId(resiEventId);
mentionEntity.setUserType(EventConstant.NPC_USER);
mentionEntity.setUserShowName(npc.getUserShowName());
mentionEntity.setUserId(npc.getUserId());
mentionEntity.setGridId(npc.getGridId());
mentionEntity.setAgencyId(npc.getAgencyId());
mentionEntity.setPids(npc.getPids());
mentionEntity.setReadFlag(EventConstant.UN_READ);
mentionEntity.setRedDot(true);
//默认不展示,因为此时在未读列表中
mentionEntity.setRedDot(false);
list.add(mentionEntity);
});
return list;
@ -219,7 +312,8 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
entity.setOrgType(org.getOrgLevel());
//默认是未读
entity.setOrgRead(EventConstant.UN_READ);
entity.setRedDot(true);
//默认是不展示红点,因为此时在待处理中。
entity.setRedDot(false);
list.add(entity);
});
return list;
@ -324,6 +418,7 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
reCallLog.setActionCode(ResiEventAction.RECALL.getCode());
reCallLog.setActionDesc(ResiEventAction.RECALL.getDesc());
reCallLog.setOperateTime(resiEventEntity.getLatestOperatedTime());
reCallLog.setCreatedTime(resiEventEntity.getLatestOperatedTime());
resiEventOperationLogDao.insert(reCallLog);
}
@ -374,9 +469,27 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
*/
@Override
public List<MyReportedResultDTO> queryMyReported(MyReportedFormDTO formDTO) {
// 未处理: 发了没有人看过的时间
// 处理中: 有人看,正在处理中的
// 已办结:有人看,已经办结了的
PageInfo<MyReportedResultDTO> result = PageHelper.startPage(formDTO.getPageNo(),
formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.queryMyReported(formDTO.getUserId(),
formDTO.getStatusCondition()));
result.getList().forEach(resultDTO->{
if(EventConstant.EVENT_STATUS_CLOSED_CASE.equals(resultDTO.getStatus())){
// 已办结的不显示回复按钮
resultDTO.setReplyButtonFlag("false");
}else{
// 处理中的事件
if(resultDTO.getReadFlag()){
// 被别人看过了就显示回复
resultDTO.setReplyButtonFlag("true");
}else{
//别人没看过
resultDTO.setReplyButtonFlag("false");
}
}
});
return result.getList();
}
@ -396,5 +509,68 @@ public class ResiEventServiceImpl extends BaseServiceImpl<ResiEventDao, ResiEven
return result.getList();
}
/**
* @Description 最新直报
* @Param userId
* @author zxc
* @date 2021/8/5 9:55 上午
*/
@Override
public List<NewEventsResultDTO> newEvents(String userId) {
Result<List<String>> listResult = govOrgOpenFeignClient.selectOrgsByUserId(userId);
if (!listResult.success()){
throw new RenException("查询userId:"+userId+",所在org失败");
}
List<String> orgIds = listResult.getData();
if (!CollectionUtils.isEmpty(orgIds)){
List<NewEventsResultDTO> result = baseDao.newEvents(orgIds);
return result;
}
return new ArrayList<>();
}
/**
* 报事办结没有回复或立项不可办结
*
* @param formDTO
* @return void
* @author yinzuomei
* @date 2021/8/5 10:48
*/
@Override
public void closeResiEvent(CloseResiEventFormDTO formDTO) {
ResiEventEntity resiEventEntity=baseDao.selectById(formDTO.getEventId());
if(null==resiEventEntity){
throw new RenException(String.format("根据事件id没有找到记录",formDTO.getEventId()));
}
List<ReplyListResultDTO> replyList=resiEventReplyDao.selectReplyList(formDTO.getEventId());
//如果未转项目,也没有回复,不允许办结
if(!resiEventEntity.getShiftProject()&&CollectionUtils.isEmpty(replyList)){
throw new RenException(EpmetErrorCode.RESI_EVENT_CAN_NOT_CLOSE_CASE.getCode(),EpmetErrorCode.RESI_EVENT_CAN_NOT_CLOSE_CASE.getMsg());
}
// 1、修改事件状态
resiEventEntity.setRedDot(true);
resiEventEntity.setStatus(EventConstant.EVENT_STATUS_CLOSED_CASE);
resiEventEntity.setCloseCaseTime(new Date());
resiEventEntity.setLatestOperatedTime(resiEventEntity.getCloseCaseTime());
baseDao.updateById(resiEventEntity);
// 2、记录操作日志
ResiEventOperationLogEntity reCallLog=new ResiEventOperationLogEntity();
reCallLog.setCustomerId(resiEventEntity.getCustomerId());
reCallLog.setResiEventId(resiEventEntity.getId());
reCallLog.setUserId(formDTO.getUserId());
reCallLog.setUserIdentity(EventConstant.STAFF);
reCallLog.setActionCode(ResiEventAction.CLOSE_CASE.getCode());
reCallLog.setActionDesc(ResiEventAction.CLOSE_CASE.getDesc());
reCallLog.setOperateTime(resiEventEntity.getCloseCaseTime());
resiEventOperationLogDao.insert(reCallLog);
// 3、红点:
// 当前工作人员办结后:
// 3.1、报事人在已办结列表中展示红点:上面已经更新
// 3.2、人大代表在未读/已读列表中展示红点
resiEventMentionDao.updateRedDotShow(formDTO.getEventId(),null);
// 3.3、目前Db设计支持报给多个层级(组织或网格),按理说应该更新非当前组织外,其他的组织,显示红点,先不做了吧 todo
}
}

5
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.16__create_resievent_tables.sql

@ -54,6 +54,7 @@ CREATE TABLE `resi_event_mention` (
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id',
`RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id',
`USER_TYPE` varchar(32) NOT NULL COMMENT '人大代表:npc_user',
`USER_SHOW_NAME` varchar(64) NOT NULL COMMENT '人大代表目前显示姓名',
`USER_ID` varchar(64) NOT NULL COMMENT '居民端用户id',
`GRID_ID` varchar(64) NOT NULL COMMENT '居民注册网格ID',
`AGENCY_ID` varchar(64) NOT NULL COMMENT '居民所属社区,就是grid_id的所属组织',
@ -114,8 +115,8 @@ CREATE TABLE `resi_event_operation_log` (
`RESI_EVENT_ID` varchar(64) NOT NULL COMMENT '事件id',
`USER_ID` varchar(64) NOT NULL COMMENT '用户id',
`USER_IDENTITY` varchar(32) NOT NULL COMMENT '居民端用户:resi_user;工作人员:staff;报事人:report_user',
`ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;\r\n',
`ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、查看阅读事件:read:人大代表未读=>已读;工作人员待处理=>处理中;',
`ACTION_CODE` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;\r\n',
`ACTION_DESC` varchar(32) NOT NULL COMMENT '1、发布事件:publish;\r\n2、撤回事件:recall;\r\n3、复:reply;\r\n4、立项:shift_project;\r\n5、办结:close_case;\r\n6、选择是否已解决:choose_resolve;\r\n7、首次查看阅读事件:read_first:人大代表未读=>已读;工作人员待处理=>处理中;',
`OPERATE_TIME` datetime NOT NULL COMMENT '操作时间',
`DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 1删除;0未删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',

13
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml

@ -379,4 +379,17 @@
ORDER BY a.UPDATED_TIME DESC
</select>
<!-- 查询报事转项目详情 -->
<select id="selectEventProjectInfo" resultType="com.epmet.dto.EventProjectInfoDTO">
SELECT
p.ID AS projectId,
IFNULL(DATE_FORMAT(p.CREATED_TIME,'%Y-%m-%d %h-%m-%s'),'') AS operationTime,
p.CREATED_BY AS userId,
IFNULL(pp.PUBLIC_REPLY,'') AS projectDeclare
FROM project p
LEFT JOIN project_process pp ON (pp.PROJECT_ID = p.ID AND pp.DEL_FLAG = '0')
WHERE p.DEL_FLAG = '0'
AND p.ID = #{projectId}
</select>
</mapper>

97
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventDao.xml

@ -18,7 +18,7 @@
SELECT IFNULL(rea.ATTACHMENT_URL,'') AS img,t.* FROM
(SELECT
re.EVENT_CONTENT AS eventContent,
IFNULL(DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i:%s'),'') AS eventTime,
IFNULL(DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime,
re.ID AS eventId,
(CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject,
(CASE WHEN ro.RED_DOT = 1 THEN TRUE ELSE FALSE END) AS redDot
@ -51,6 +51,7 @@
<result property="status" column="STATUS" />
<result property="shiftProject" column="SHIFT_PROJECT" />
<result property="showTime" column="LATEST_OPERATED_TIME" />
<result property="readFlag" column="READ_FLAG" />
<collection property="imgList" ofType="java.lang.String">
<constructor>
<arg column="img_url"/>
@ -70,7 +71,8 @@
re.`STATUS`,
re.SHIFT_PROJECT,
re.LATEST_OPERATED_TIME,
rea.ATTACHMENT_URL as img_url
rea.ATTACHMENT_URL as img_url,
re.READ_FLAG
from resi_event re
left join resi_event_attachment rea
on(re.id=rea.RESI_EVENT_ID
@ -83,8 +85,99 @@
and re.READ_FLAG='0'
</if>
<if test='statusCondition != "un_read" '>
and re.READ_FLAG='1'
and re.`STATUS`=#{statusCondition}
</if>
order by re.LATEST_OPERATED_TIME desc
</select>
<!-- 报事详情 -->
<resultMap id="selectEventDetailMap" type="com.epmet.dto.result.EventDetailResultDTO">
<result property="isProject" column="isProject"/>
<result property="eventTime" column="eventTime"/>
<result property="eventContent" column="eventContent"/>
<result property="eventAddress" column="eventAddress"/>
<result property="isClosed" column="isClosed"/>
<result property="isResolve" column="isResolve"/>
<result property="isRollback" column="isRollback"/>
<result property="projectId" column="projectId"/>
<result property="gridId" column="gridId"/>
<result property="eventUserId" column="eventUserId"/>
<collection property="eventImgs" ofType="java.lang.String">
<result column="eventImg"/>
</collection>
<collection property="eventPerson" ofType="java.lang.String">
<result column="person"/>
</collection>
<collection property="orgNameList" ofType="java.lang.String">
<result column="orgId"/>
</collection>
</resultMap>
<select id="selectEventDetail" resultMap="selectEventDetailMap">
SELECT
IFNULL(DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i'),'') AS eventTime,
IFNULL(re.EVENT_CONTENT,'') AS eventContent,
IFNULL(re.ADDRESS,'') AS eventAddress,
(CASE WHEN re.`STATUS` = 'processing' THEN FALSE WHEN re.`STATUS` = 'closed_case' THEN TRUE ELSE FALSE END) AS isClosed,
(IF('' = re.RESOLVE_STATUS OR NULL = re.RESOLVE_STATUS, TRUE, FALSE)) AS isResolve,
(CASE WHEN re.READ_FLAG = 1 THEN FALSE ELSE TRUE END) AS isRollback,
(CASE WHEN re.SHIFT_PROJECT = 1 THEN TRUE ELSE FALSE END) AS isProject,
IFNULL(re.project_id,'') AS projectId,
IFNULL(ea.ATTACHMENT_URL,'') AS eventImg,
concat('人大代表-',IFNULL(em.USER_SHOW_NAME,'')) AS person,
re.GRID_ID AS gridId,
re.CREATED_BY AS eventUserId,
ro.ORG_ID AS orgId
FROM resi_event re
LEFT JOIN resi_event_attachment ea ON (ea.RESI_EVENT_ID = re.ID AND ea.DEL_FLAG = '0')
LEFT JOIN resi_event_mention em ON (em.RESI_EVENT_ID = re.ID AND em.DEL_FLAG = '0')
LEFT JOIN resi_event_report_org ro ON (ro.RESI_EVENT_ID = re.ID AND ro.DEL_FLAG = '0')
WHERE re.DEL_FLAG = '0'
AND re.ID = #{eventId}
</select>
<!-- 更新报事人红点状态 -->
<update id="updateResiEvent">
UPDATE resi_event
SET RED_DOT = 0,
UPDATED_TIME = NOW()
WHERE DEL_FLAG = '0'
AND ID = #{eventId}
AND REPORT_USER_ID = #{userId}
</update>
<!-- 更新人大代表红点状态 -->
<update id="updateEventMention">
UPDATE resi_event_mention
SET RED_DOT = 0,
UPDATED_TIME = NOW()
WHERE DEL_FLAG = '0'
AND USER_ID = #{userId}
AND RESI_EVENT_ID = #{eventId}
</update>
<resultMap id="newEventsMap" type="com.epmet.dto.result.NewEventsResultDTO">
<result property="eventContent" column="eventContent"/>
<result property="eventTime" column="eventTime"/>
<collection property="eventImgs" ofType="java.lang.String">
<result column="img"/>
</collection>
</resultMap>
<select id="newEvents" resultMap="newEventsMap">
SELECT
IFNULL(re.EVENT_CONTENT,'') AS eventContent,
DATE_FORMAT(re.CREATED_TIME,'%Y-%m-%d %H:%i') AS eventTime,
IFNULL(ea.ATTACHMENT_URL,'') AS img
FROM resi_event_report_org ro
LEFT JOIN resi_event re ON (re.ID = ro.RESI_EVENT_ID AND re.DEL_FLAG = '0')
LEFT JOIN resi_event_attachment ea ON (ea.RESI_EVENT_ID = ro.RESI_EVENT_ID AND ea.DEL_FLAG = '0' AND
ea.ATTACHMENT_TYPE = 'image' AND ea.SORT IN (0,1,2))
WHERE ro.DEL_FLAG = '0'
AND ro.ORG_READ = 'un_read'
AND ro.ORG_ID IN(
<foreach collection="orgIds" item="orgId" separator=",">
#{orgId}
</foreach>)
ORDER BY ro.CREATED_TIME DESC
</select>
</mapper>

24
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventMentionDao.xml

@ -54,4 +54,28 @@
</if>
</select>
<!-- 人大代表从未读-》已读,首次查看事件 -->
<update id="updateReadFlag" parameterType="map">
UPDATE resi_event_mention
SET READ_FLAG = 'read',
UPDATED_BY = #{userId},
UPDATED_TIME = NOW()
WHERE
RESI_EVENT_ID = #{eventId}
AND USER_ID = #{userId}
AND DEL_FLAG = '0'
</update>
<!-- 除了当前用户,都置为显示红点 -->
<update id="updateRedDotShow" parameterType="map">
UPDATE resi_event_mention
SET RED_DOT = '1',
UPDATED_TIME = NOW()
WHERE
RESI_EVENT_ID = #{resiEventId}
<if test="excludeUserId != null and excludeUserId.trim() != ''">
and user_id !=#{excludeUserId}
</if>
AND DEL_FLAG = '0'
</update>
</mapper>

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventOperationLogDao.xml

@ -2,7 +2,13 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ResiEventOperationLogDao">
<select id="selectByUserAction" parameterType="map" resultType="com.epmet.entity.ResiEventOperationLogEntity">
select * from resi_event_operation_log m
where m.DEL_FLAG='0'
and m.RESI_EVENT_ID=#{eventId}
and m.USER_ID=#{userId}
and m.ACTION_CODE=#{actionCode}
</select>
</mapper>

15
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReplyDao.xml

@ -3,6 +3,19 @@
<mapper namespace="com.epmet.dao.ResiEventReplyDao">
<select id="selectReplyList" parameterType="java.lang.String" resultType="com.epmet.dto.result.ReplyListResultDTO">
SELECT
rer.USER_SHOW_NAME as replyName,
rer.CREATED_TIME as replyTime,
rer.CONTENT as replyContent,
rer.FROM_USER_ID as replyUserId
FROM
resi_event_reply rer
WHERE
rer.DEL_FLAG = '0'
AND rer.RESI_EVENT_ID = #{resiEventId}
ORDER BY
rer.CREATED_TIME DESC
</select>
</mapper>

28
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ResiEventReportOrgDao.xml

@ -4,5 +4,33 @@
<mapper namespace="com.epmet.dao.ResiEventReportOrgDao">
<update id="updateReadFlag" parameterType="map">
UPDATE resi_event_report_org
SET READ_FLAG = 'read',
UPDATED_BY = #{userId},
UPDATED_TIME = NOW()
WHERE
RESI_EVENT_ID = #{eventId}
AND ORG_ID = #{orgId}
AND DEL_FLAG = '0'
</update>
<update id="updateRedDotShow" parameterType="java.lang.String">
UPDATE resi_event_report_org
SET RED_DOT = '1',
UPDATED_TIME = NOW()
WHERE
RESI_EVENT_ID = #{resiEventId}
AND DEL_FLAG = '0'
</update>
<!-- 更新组织的红点显示状态 -->
<update id="updateEventOrg">
UPDATE resi_event_report_org
SET RED_DOT = 0,
UPDATED_TIME = NOW()
WHERE DEL_FLAG = '0'
AND ORG_ID = #{orgId}
AND RESI_EVENT_ID = #{eventId}
</update>
</mapper>

2
epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/form/ResiEventNpcListFormDTO.java

@ -9,5 +9,5 @@ import lombok.Data;
*/
@Data
public class ResiEventNpcListFormDTO {
private String gridId;
private String customerId;
}

8
epmet-module/resi-home/resi-home-client/src/main/java/com/epmet/dto/result/ResiEventNpcResultDTO.java

@ -20,8 +20,16 @@ public class ResiEventNpcResultDTO {
private String gridId;
/**
* 展示名
*/
private String displayName;
/**
* 真实姓名
*/
private String userShowName;
private String headImgUrl;
private String agencyId;

8
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/controller/ResiEventController.java

@ -32,15 +32,15 @@ public class ResiEventController {
/**
* @return
* @Description 查询人大代表列表
* @Description 查询人大代表列表(客户下的)
* @author wxz
* @date 2021.08.03 09:17
*/
@PostMapping("/npc-list-ingrid")
@PostMapping("/npc-list")
public Result<HashMap<String, List<ResiEventNpcResultDTO>>> listNpc(@RequestBody ResiEventNpcListFormDTO input) {
ValidatorUtils.validateEntity(input);
String gridId = input.getGridId();
List<ResiEventNpcResultDTO> npcs = resiEventService.listNpcByGrid(gridId);
String customerId = input.getCustomerId();
List<ResiEventNpcResultDTO> npcs = resiEventService.listNpcByGrid(customerId);
HashMap<String, List<ResiEventNpcResultDTO>> wrapper = new HashMap<>();
wrapper.put("reportTargets", npcs);

2
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/ResiEventService.java

@ -18,7 +18,7 @@ public interface ResiEventService {
* @author wxz
* @date 2021.08.03 09:29
*/
List<ResiEventNpcResultDTO> listNpcByGrid(String gridId);
List<ResiEventNpcResultDTO> listNpcByGrid(String customerId);
/**
* @Description 查询上报目标列表

55
epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/service/impl/ResiEventServiceImpl.java

@ -36,32 +36,65 @@ public class ResiEventServiceImpl implements ResiEventService, ResultDataResolve
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
@Override
public List<ResiEventNpcResultDTO> listNpcByGrid(String gridId) {
public List<ResiEventNpcResultDTO> listNpcByGrid(String customerId) {
// 查询网格所属的组织信息
Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(gridId);
GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null);
String parentAgencyId = gridInfoData.getParentAgencyId();
String pids = gridInfoData.getPids();
//Result<GridInfoResultDTO> gridInfoResult = govOrgOpenFeignClient.queryGridInfo(customerId);
//GridInfoResultDTO gridInfoData = getResultDataOrThrowsException(gridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null);
//String parentAgencyId = gridInfoData.getParentAgencyId();
//String pids = gridInfoData.getPids();
//查询人大代表列表
ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(gridId, BadgeConstant.BADGE_KEY_NPC);
ListUserByBadgeFormDTO npcForm = new ListUserByBadgeFormDTO(customerId, BadgeConstant.BADGE_KEY_NPC);
Result<List<ListUserByBadgeResultDTO>> npcResult = epmetUserOpenFeignClient.listUsersByBadge(npcForm);
List<ListUserByBadgeResultDTO> npcData = getResultDataOrThrowsException(npcResult, ServiceConstant.EPMET_USER_SERVER, null, null);
List<ResiEventNpcResultDTO> npcResultList = npcData.stream()
.map(npc -> new ResiEventNpcResultDTO(npc.getUserId(), gridId, "人大代表-".concat(npc.getRealName()), npc.getHeadImgUrl(), parentAgencyId, pids))
.collect(Collectors.toList());
//批量查询人大代表所在的网格信息
List<String> npcGridIds = npcData.stream().map(d -> d.getGridId()).collect(Collectors.toList());
OrgInfoFormDTO form = new OrgInfoFormDTO(OrgInfoConstant.GRID, npcGridIds);
Result<List<OrgInfoResultDTO>> npcGridInfoResult = govOrgOpenFeignClient.selectOrgInfo(form);
List<OrgInfoResultDTO> npcGridInfos = getResultDataOrThrowsException(npcGridInfoResult, ServiceConstant.GOV_ORG_SERVER, null, null);
Map<String, OrgInfoResultDTO> npcGridInfoMap = convertNpcGridInfos2Map(npcGridInfos);
List<ResiEventNpcResultDTO> npcResultList = new ArrayList<>();
npcData.stream().forEach(npc -> {
OrgInfoResultDTO gridInfo = npcGridInfoMap.get(npc.getGridId());
ResiEventNpcResultDTO resiEventNpcInfo = new ResiEventNpcResultDTO(
npc.getUserId(),
npc.getGridId(),
"人大代表-".concat(npc.getRealName()),
npc.getRealName(),
npc.getHeadImgUrl(),
gridInfo != null ? gridInfo.getAgencyId() : null,
gridInfo != null ? gridInfo.getPids().concat(":").concat(gridInfo.getAgencyId()) : null);
npcResultList.add(resiEventNpcInfo);
}
);
return npcResultList;
}
/**
* @Description 此处会调用org上游接口批量获取父级组织信息由于上游接口排序不可控因此此处需要使用TreeSet做排序
* @return
* @Description 将网格信息转化为map
* @author wxz
* @date 2021.08.04 14:25
*/
private Map<String, OrgInfoResultDTO> convertNpcGridInfos2Map(List<OrgInfoResultDTO> npcGridInfos) {
HashMap<String, OrgInfoResultDTO> result = new HashMap<>();
npcGridInfos.stream().forEach(i -> {
result.put(i.getOrgId(), i);
});
return result;
}
/**
* @return
* @Description 此处会调用org上游接口批量获取父级组织信息由于上游接口排序不可控因此此处需要使用TreeSet做排序
* @author wxz
* @date 2021.08.03 15:51
*/
*/
@Override
public TreeSet<ResiEventTargetLevelResultDTO> listReportTargetLevels(String gridId) {
TreeSet<ResiEventTargetLevelResultDTO> targetLevels = new TreeSet<>();

5
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/ListUserByBadgeFormDTO.java

@ -11,10 +11,9 @@ import javax.validation.constraints.NotBlank;
@NoArgsConstructor
public class ListUserByBadgeFormDTO {
@NotBlank(message = "网格ID不能为空")
private String gridId;
@NotBlank(message = "客户ID不能为空")
private String customerId;
@NotBlank(message = "徽章key不能为空")
private String badgeKey;
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/BadgeController.java

@ -199,10 +199,10 @@ public class BadgeController {
public Result<List<ListUserByBadgeResultDTO>> listUsersByBadge(@RequestBody ListUserByBadgeFormDTO input) {
ValidatorUtils.validateEntity(input);
String gridId = input.getGridId();
String customerId = input.getCustomerId();
String badgeKey = input.getBadgeKey();
List<ListUserByBadgeResultDTO> users = badgeService.listUsersByBadge(gridId, badgeKey);
List<ListUserByBadgeResultDTO> users = badgeService.listUsersByBadge(customerId, badgeKey);
return new Result<List<ListUserByBadgeResultDTO>>().ok(users);
}
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/dao/BadgeDao.java

@ -203,5 +203,5 @@ public interface BadgeDao extends BaseDao<BadgeEntity> {
* @author wxz
* @date 2021.08.02 10:40
*/
List<ListUserByBadgeResultDTO> listUsersByBadge(@Param("gridId") String gridId, @Param("badgeKey") String badgeKey);
List<ListUserByBadgeResultDTO> listUsersByBadge(@Param("customerId") String customerId, @Param("badgeKey") String badgeKey);
}

2
epmet-user/epmet-user-server/src/main/java/com/epmet/service/BadgeService.java

@ -199,5 +199,5 @@ public interface BadgeService extends BaseService<BadgeEntity> {
* @author wxz
* @date 2021.08.02 10:39
*/
List<ListUserByBadgeResultDTO> listUsersByBadge(String gridId, String badgeKey);
List<ListUserByBadgeResultDTO> listUsersByBadge(String customerId, String badgeKey);
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/BadgeServiceImpl.java

@ -481,7 +481,7 @@ public class BadgeServiceImpl extends BaseServiceImpl<BadgeDao, BadgeEntity> imp
}
@Override
public List<ListUserByBadgeResultDTO> listUsersByBadge(String gridId, String badgeKey) {
return baseDao.listUsersByBadge(gridId, badgeKey);
public List<ListUserByBadgeResultDTO> listUsersByBadge(String customerId, String badgeKey) {
return baseDao.listUsersByBadge(customerId, badgeKey);
}
}

2
epmet-user/epmet-user-server/src/main/resources/mapper/BadgeDao.xml

@ -320,7 +320,7 @@
user_base_info.HEAD_IMG_URL
from resi_user_badge
inner join badge on (badge.BADGE_KEY = #{badgeKey}
and resi_user_badge.GRID_ID = #{gridId}
and resi_user_badge.CUSTOMER_ID=#{customerId}
and resi_user_badge.CERTIFICATION_AUTID_STATUS = 'approved'
and resi_user_badge.DEL_FLAG = 0
and resi_user_badge.BADGE_ID = badge.ID

Loading…
Cancel
Save