Browse Source

Merge remote-tracking branch 'origin/dev_staff_info' into develop

# Conflicts:
#	epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
#	epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
dev_shibei_match
yinzuomei 4 years ago
parent
commit
58eb20b7c1
  1. 1
      doc/开发规范/命名规范.txt
  2. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  3. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java
  4. 21
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IdAndNameDTO.java
  5. 86
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java
  6. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgTypeEnum.java
  7. 1
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java
  8. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  9. 26
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java
  10. 19
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallBackFactory.java
  11. 23
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java
  12. 2
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java
  13. 10
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java
  14. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java
  15. 133
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java
  16. 91
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java
  17. 1
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java
  18. 28
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ListStaffFormDTO.java
  19. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/RoleUsersFormDTO.java
  20. 91
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java
  21. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java
  22. 23
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleListResultDTO.java
  23. 25
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java
  24. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/OrgDTO.java
  25. 39
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java
  26. 44
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java
  27. 22
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/ReceiversFormDTO.java
  28. 45
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java
  29. 18
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java
  30. 45
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgStaffListResultDTO.java
  31. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/ReceiversResultDTO.java
  32. 82
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffAgencyDTO.java
  33. 43
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffDetailV2ResultDTO.java
  34. 45
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgNameResultDTO.java
  35. 42
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgRelationResultDTO.java
  36. 20
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/SubOrgResultDTO.java
  37. 34
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoGroupDetailFormDTO.java
  38. 36
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoIdDTO.java
  39. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoRepliesFormDTO.java
  40. 33
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/MySentFormDTO.java
  41. 97
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoDetailResDTO.java
  42. 19
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoGroupDetailResDTO.java
  43. 27
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoRedDotResultDTO.java
  44. 28
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyDetail.java
  45. 18
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyResDTO.java
  46. 24
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MyInfoGroupResultDTO.java
  47. 35
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MyReceivedResDTO.java
  48. 31
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MySentResDTO.java
  49. 21
      epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/StaffInfoCommonDTO.java
  50. 18
      epmet-module/data-aggregator/data-aggregator-server/pom.xml
  51. 8
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DemoController.java
  52. 51
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java
  53. 47
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java
  54. 158
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java
  55. 72
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoProfileDao.java
  56. 109
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java
  57. 20
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java
  58. 15
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleDao.java
  59. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java
  60. 21
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java
  61. 29
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java
  62. 25
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java
  63. 10
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java
  64. 78
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetmessage/InfoProfileEntity.java
  65. 58
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetmessage/InfoReceiversEntity.java
  66. 94
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java
  67. 268
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java
  68. 62
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java
  69. 220
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java
  70. 54
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java
  71. 116
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java
  72. 5
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml
  73. 139
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml
  74. 136
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml
  75. 89
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml
  76. 16
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleDao.xml
  77. 23
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml
  78. 90
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml
  79. 83
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml
  80. 33
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml
  81. 17
      epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml
  82. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  83. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  84. 52
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/AddReceiverGroupFormDTO.java
  85. 17
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrgCommonDTO.java
  86. 36
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadInfoFormDTO.java
  87. 37
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadReplyFormDTO.java
  88. 43
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReplyInfoFormDTO.java
  89. 69
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendInfoFormDTO.java
  90. 17
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/AddReceiverGroupResultDTO.java
  91. 17
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/ReplyInfoResultDTO.java
  92. 17
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendInfoResultDTO.java
  93. 4
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/UserMessageConstans.java
  94. 153
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java
  95. 32
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoAttDao.java
  96. 33
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoDao.java
  97. 44
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoGroupReceiversDao.java
  98. 31
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoProfileDao.java
  99. 32
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoReceiverGroupDao.java
  100. 44
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoReceiversDao.java

1
doc/开发规范/命名规范.txt

@ -9,6 +9,7 @@
4、插入:insertXXX
5、删除:deleteXXX
6、获取统计值的方法用 selectCount
索引命名规范 idx_ 普通索引; unq_唯一索引

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java

@ -36,9 +36,11 @@ public interface NumConstant {
int THIRTY_ONE = 31;
int FORTY = 40;
int FORTY_ONE = 41;
int FORTY_NINE = 49;
int FIFTY = 50;
int FIFTY_ONE = 51;
int SIXTY = 60;
int NINETY_NINE=99;
int ONE_HUNDRED = 100;
int TWO_HUNDRED = 200;
int FIVE_HUNDRED = 500;

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java

@ -140,7 +140,7 @@ public interface ServiceConstant {
String EPMET_POINT_SERVER = "epmet-point-server";
/**
* 开放接口服务
* 聚合查询服务
*/
String EPMET_EXT_SERVER = "epmet-ext-server";
String DATA_AGGREGATOR_SERVER = "data-aggregator-server";
}

21
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/IdAndNameDTO.java

@ -0,0 +1,21 @@
package com.epmet.commons.tools.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* desc:通用Id and Name 不要轻易修改
*
* @author: LiuJanJun
* @date: 2021/8/19 4:12 下午
* @version: 1.0
*/
@Data
public class IdAndNameDTO implements Serializable {
private static final long serialVersionUID = 4481647404402681862L;
private String id;
private String name;
}

86
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/result/CustomerStaffInfoCacheResult.java

@ -0,0 +1,86 @@
package com.epmet.commons.tools.dto.result;
import com.epmet.commons.tools.dto.form.IdAndNameDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* desc:工作人员信息结果类
* @Author zxc
* @DateTime 2021/6/15 10:00 上午
* @DESC
*/
@Data
public class CustomerStaffInfoCacheResult implements Serializable {
private static final long serialVersionUID = 3519630252798469087L;
/**
* 工作人员所属组织ID
*/
private String agencyId;
/**
* 工作人员所属组织名称
*/
private String agencyName;
/**
* 2级组织名称 根据添加的来源返回xx组织-组织/网格/部门
*/
private String twoOrgName;
/**
* 工作人员ID
*/
private String staffId;
/**
* 真实姓名
*/
private String realName;
/**
* 性别0.未知1男2.
*/
private Integer gender;
/**
* 手机号-唯一键
*/
private String mobile;
/**
* 头像
*/
private String headPhoto;
/**
* 工作人员是从哪中组织类型添加的 3个值agencygriddept
* @see com.epmet.commons.tools.enums.OrgTypeEnum
*/
private String fromOrgType;
/**
* 角色map key为角色key value 为角色名称
*/
private Map<String,String> roleMap;
/**
* 所属组织的上级组织
*/
private IdAndNameDTO parentAgency;
/**
* 所属网格列表
*/
private List<IdAndNameDTO> gridList;
/**
* 所属部门
*/
private List<IdAndNameDTO> deptList;
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/eum/OrgTypeEnum.java → epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgTypeEnum.java

@ -1,4 +1,4 @@
package com.epmet.datareport.eum;
package com.epmet.commons.tools.enums;
/**
* 需要组织类型枚举类
@ -8,6 +8,7 @@ package com.epmet.datareport.eum;
**/
public enum OrgTypeEnum {
DEPARTMENT("department", "部门"),
DEPT("dept", "部门"),
AGENCY("agency", "组织"),
GRID("grid", "网格"),
;

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

@ -54,6 +54,7 @@ public enum RequirePermissionEnum {
ORG_STAFF_CREATE("org_staff_create", "组织:工作人员:新增", "组织:工作人员:新增"),
ORG_STAFF_UPDATE("org_staff_update", "组织:工作人员:编辑", "组织:工作人员:编辑"),
ORG_STAFF_FORBIDDEN("org_staff_forbidden", "组织:工作人员:禁用", "组织:工作人员:禁用"),
ORG_STAFF_ENABLE("org_staff_enable", "组织:工作人员:解禁", "组织:工作人员:解禁"),
ORG_STAFF_TRANSFER("org_staff_transfer", "组织:工作人员:调动", "组织:工作人员:调动"),
/**

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

@ -103,6 +103,11 @@ public enum EpmetErrorCode {
RESI_EVENT_CAN_NOT_CLOSE_CASE(8607,"事件尚未处理,请处理完成后进行办结"),
RESI_EVENT_SHIFT_PROJECT(8608,"事件已立项,请勿重复操作"),
PLEASE_CHOOSE_RECEIVER(8609,"请选择接收人"),
REPLY_INFO_CONTENT_NOT_NULL(8610,"回复内容不能为空"),
PLEASE_CHOOSE_MEMBER(8611,"请选择成员"),
INFO_GROUP_NAME_EXISTS(8612,"名称已存在"),
// 爱心互助 居民端
NOT_IN_THE_SIGN_IN_RANGE(8510, "您还未进入指定的签到范围~"),
// 活动报名失败,弹窗:志愿者认证

26
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/CommonAggFeignClient.java

@ -0,0 +1,26 @@
package com.epmet.commons.tools.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.feign.fallback.CommonAggFeignClientFallBackFactory;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
/**
* @Description
* @Author sun
*/
@FeignClient(name = ServiceConstant.DATA_AGGREGATOR_SERVER, fallbackFactory = CommonAggFeignClientFallBackFactory.class)
public interface CommonAggFeignClient {
/**
* desc:根据工作人员Id 获取工作人员信息
* @param staffId
* @return
*/
@PostMapping("/data/aggregator/epmetuser/getStaffInfo/{staffId}")
Result<CustomerStaffInfoCache> getStaffInfo(@PathVariable("staffId") String staffId);
}

19
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallBackFactory.java

@ -0,0 +1,19 @@
package com.epmet.commons.tools.feign.fallback;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.feign.CommonAggFeignClient;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
public class CommonAggFeignClientFallBackFactory implements FallbackFactory<CommonAggFeignClient> {
private CommonAggFeignClientFallback fallback = new CommonAggFeignClientFallback();
@Override
public CommonAggFeignClient create(Throwable cause) {
log.error(String.format("FeignClient调用发生异常,异常信息:%s", ExceptionUtils.getThrowableErrorStackTrace(cause)));
return fallback;
}
}

23
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/feign/fallback/CommonAggFeignClientFallback.java

@ -0,0 +1,23 @@
package com.epmet.commons.tools.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.feign.CommonAggFeignClient;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import org.springframework.stereotype.Component;
/**
* 调用政府端权限
* @Author wxz
* @Description
* @Date 2020/4/24 11:17
**/
@Component
public class CommonAggFeignClientFallback implements CommonAggFeignClient {
@Override
public Result<CustomerStaffInfoCache> getStaffInfo(String staffId) {
return ModuleUtils.feignConError(ServiceConstant.DATA_AGGREGATOR_SERVER, "getStaffInfo", staffId);
}
}

2
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java

@ -205,7 +205,7 @@ public class LogMsgSendFilter extends LevelFilter {
}
return slashMatcher.start();
} catch (Exception e) {
logger.warn("getCharacterPosition no matche", e);
logger.warn("getCharacterPosition no matche");
return string.length();
}
}

10
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java

@ -491,4 +491,14 @@ public class RedisKeys {
public static String getNoRepeatSubmitKey(String key) {
return rootPrefix.concat("no_repeat_submit:").concat(key);
}
/**
* desc根据工作人员Id 获取工作人员缓存key
* @param customerId
* @param staffId
* @return
*/
public static String getCustomerStaffInfoKey(String customerId, String staffId) {
return rootPrefix.concat("gov:staff:").concat(customerId).concat(StrConstant.COLON).concat(staffId);
}
}

4
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisUtils.java

@ -115,8 +115,8 @@ public class RedisUtils {
redisTemplate.delete(keys(pattern));
}
public void delete(String key) {
redisTemplate.delete(key);
public Boolean delete(String key) {
return redisTemplate.delete(key);
}
public void delete(Collection<String> keys) {

133
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/CustomerStaffRedis.java

@ -0,0 +1,133 @@
package com.epmet.commons.tools.redis.common;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.feign.CommonAggFeignClient;
import com.epmet.commons.tools.redis.RedisKeys;
import com.epmet.commons.tools.redis.RedisUtils;
import com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.jetbrains.annotations.Nullable;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import javax.annotation.PostConstruct;
import java.util.Map;
/**
* 工作人员缓存通用类
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-22
*/
@Slf4j
@Component
public class CustomerStaffRedis {
@Autowired
private RedisUtils redisUtils;
@Autowired
private CommonAggFeignClient commonAggFeignClient;
private static CustomerStaffRedis customerStaffRedis;
private static final String ROLE_MAP_KEY = "roleMap";
@PostConstruct
public void init() {
customerStaffRedis = this;
customerStaffRedis.redisUtils = this.redisUtils;
customerStaffRedis.commonAggFeignClient = this.commonAggFeignClient;
}
public static void initTest() {
CustomerStaffInfoCacheResult role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "9e37adcce6472152e6508a19d3683e02");
role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "e08316376c972b5cb3f085bb39a3680f");
System.out.println(JSON.toJSONString(role));
role = getStaffInfo("45687aa479955f9d06204d415238f7cc", "ec524bbbc41d0662cbb36236161005e9");
System.out.println(JSON.toJSONString(role));
System.out.println(JSON.toJSONString(getStaffRoleMap("45687aa479955f9d06204d415238f7cc", "7f694a66efe60a47c2114875f310248a")));
}
/**
* desc: 根据工作人员Id 获取某工作人员信息如果缓存不存在则查询db返回;缓存默认一天
*
* @param customerId
* @param staffId
* @return com.epmet.commons.tools.redis.common.bean.CustomerStaffInfoCache
* @author LiuJanJun
* @date 2021/8/19 10:29 下午
* @remark 此方法仅用于 获取某个工作人员的信息不用于获取客户下所有工作人员信息
*/
public static CustomerStaffInfoCacheResult getStaffInfo(String customerId, String staffId) {
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
Map<String, Object> roleMap = customerStaffRedis.redisUtils.hGetAll(key);
if (!CollectionUtils.isEmpty(roleMap)) {
return ConvertUtils.mapToEntity(roleMap, CustomerStaffInfoCacheResult.class);
}
CustomerStaffInfoCache resultData = reloadStaffCache(staffId, key);
if (resultData == null) {
return null;
}
return ConvertUtils.sourceToTarget(resultData, CustomerStaffInfoCacheResult.class);
}
@Nullable
private static CustomerStaffInfoCache reloadStaffCache(String staffId, String key) {
Result<CustomerStaffInfoCache> staffResult = customerStaffRedis.commonAggFeignClient.getStaffInfo(staffId);
if (staffResult == null || !staffResult.success()) {
throw new RenException("获取工作人员信息失败");
}
CustomerStaffInfoCache resultData = staffResult.getData();
if (resultData == null) {
log.warn("getStaffInfo staff is null,staffId:{}", staffId);
return null;
}
Map<String, Object> map = BeanUtil.beanToMap(resultData, false, true);
customerStaffRedis.redisUtils.hMSet(key, map);
return resultData;
}
/**
* desc: 根据工作人员Id 获取某工作人员角色map信息
*
* @param customerId
* @param staffId
*/
public static Map<String, String> getStaffRoleMap(String customerId, String staffId) {
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
Map<String, String> roleMap = (Map<String, String>) customerStaffRedis.redisUtils.hGet(key, ROLE_MAP_KEY);
if (!CollectionUtils.isEmpty(roleMap)) {
return roleMap;
}
reloadStaffCache(staffId, key);
return getStaffRoleMap(customerId, staffId);
}
/**
* desc: 根据客户id及工作人员Id 删除缓存
*
* @param customerId
* @param staffId
* @return boolean
* @author LiuJanJun
* @date 2021/8/19 10:39 下午
*/
public static Boolean delStaffInfoFormCache(String customerId, String staffId) {
if (StringUtils.isBlank(customerId) || StringUtils.isBlank(staffId)) {
log.warn("delStaffInfoFormCache param is blank,customerId:{},staffId:{}", customerId, staffId);
return false;
}
String key = RedisKeys.getCustomerStaffInfoKey(customerId, staffId);
return customerStaffRedis.redisUtils.delete(key);
}
}

91
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/common/bean/CustomerStaffInfoCache.java

@ -0,0 +1,91 @@
package com.epmet.commons.tools.redis.common.bean;
import com.epmet.commons.tools.dto.form.IdAndNameDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* desc:客户工作人员缓存实体类
* @Author zxc
* @DateTime 2021/6/15 10:00 上午
* @DESC
*/
@Data
public class CustomerStaffInfoCache implements Serializable {
private static final long serialVersionUID = 4627478063125903910L;
/**
* 工作人员所属组织ID
*/
private String agencyId;
/**
* 工作人员所属组织名称
*/
private String agencyName;
/**
* 2级组织名称 根据添加的来源返回xx组织-组织/网格/部门
*/
private String twoOrgName;
/**
* 工作人员ID
*/
private String staffId;
/**
* 真实姓名
*/
private String realName;
/**
* 性别0.未知1男2.
*/
private Integer gender;
/**
* 手机号-唯一键
*/
private String mobile;
/**
* 头像
*/
private String headPhoto;
/**
* 角色map key为角色key value 为角色名称
*/
private Map<String,String> roleMap;
/**
* 工作人员是从哪中组织类型添加的 3个值agencygriddept
* @see com.epmet.commons.tools.enums.OrgTypeEnum
*/
private String fromOrgType;
/**
* 工作人员是从哪中组织添加的 组织Id
*/
private String fromOrgId;
/**
* 所属组织的上级组织
*/
private IdAndNameDTO parentAgency;
/**
* 所属网格列表
*/
private List<IdAndNameDTO> gridList;
/**
* 所属部门
*/
private List<IdAndNameDTO> deptList;
}

1
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java

@ -32,4 +32,5 @@ public interface DataSourceConstant {
String EVALUATION_INDEX = "evaluationIndex";
String OPERCUSTOMIZE="opercustomize";
String EPMET_MESSAGE="epmetmessage";
}

28
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/ListStaffFormDTO.java

@ -0,0 +1,28 @@
package com.epmet.dataaggre.dto.epmetuser.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 对外接口--通讯录姓名检索工作人员-接口入参
* @Auth sun
*/
@Data
public class ListStaffFormDTO implements Serializable {
private static final long serialVersionUID = -3381286960911634231L;
/**
* 待检索姓名
*/
@NotBlank(message = "姓名不能为空", groups = ListStaffFormDTO.Staff.class)
private String realName;
/**
* token中客户Id
*/
private String customerId;
public interface Staff extends CustomerClientShowGroup {}
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/form/RoleUsersFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.dto.epmetuser.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Data 2021/8/19 14:06
*/
@Data
public class RoleUsersFormDTO implements Serializable {
private static final long serialVersionUID = -7732382052293191415L;
@NotBlank(message = "角色ID不能为空")
private String roleId;
private String customerId;
}

91
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/CustomerStaffResultDTO.java

@ -0,0 +1,91 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import com.epmet.commons.tools.dto.form.IdAndNameDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
import java.util.Map;
/**
* @Author zxc
* @DateTime 2021/6/15 10:00 上午
* @DESC
*/
@Data
public class CustomerStaffResultDTO implements Serializable {
private static final long serialVersionUID = 6989603307304337912L;
/**
* 工作人员所属组织ID
*/
private String agencyId;
/**
* 工作人员所属组织名称
*/
private String agencyName;
/**
* 工作人员ID
*/
private String staffId;
/**
* 真实姓名
*/
private String realName;
/**
* 性别0.未知1男2.
*/
private Integer gender;
/**
* 手机号-唯一键
*/
private String mobile;
/**
* 头像
*/
private String headPhoto;
/**
* 工作人员是从哪中组织类型添加的 3个值agencygriddept
* @see com.epmet.commons.tools.enums.OrgTypeEnum
*/
private String fromOrgType;
/**
* 工作人员是从哪中组织添加的 组织Id
*/
private String fromOrgId;
/**
* 角色map key为角色key value 为角色名称
*/
private Map<String,String> roleMap;
/**
* 所属组织的上级组织
*/
private IdAndNameDTO parentAgency;
/**
* 所属网格列表
*/
private List<IdAndNameDTO> gridList;
/**
* 所属部门
*/
private List<IdAndNameDTO> deptList;
//特殊处理的 属性 start ==========
/**
* 2级组织名称 根据添加的来源返回xx组织-组织/网格/部门
*/
private String twoOrgName;
}

33
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 通讯录姓名检索工作人员-接口返参
* @Auth sun
*/
@Data
public class ListStaffResultDTO implements Serializable {
private static final long serialVersionUID = 7129564173128153335L;
//工作人员用户id
private String staffId = "";
//工作人员姓名
private String name = "";
//性别
private String gender = "";
//头像
private String headPhoto = "";
//手机号
private String mobile = "";
//未禁用enable,已禁用disabled
private String enableFlag = "";
//人员新增所属组织名【组织-组织,组织-部门,组织-网格】
private String orgName = "";
//职责名称列表
private List<String> roles;
}

23
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleListResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 14:16
*/
@NoArgsConstructor
@Data
public class RoleListResultDTO implements Serializable {
private static final long serialVersionUID = -9030492894290373999L;
private String roleId;
private String description;
private String roleName;
private String roleKey;
private Integer staffNum;
}

25
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/RoleUsersResultDTO.java

@ -0,0 +1,25 @@
package com.epmet.dataaggre.dto.epmetuser.result;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 14:06
*/
@NoArgsConstructor
@Data
public class RoleUsersResultDTO implements Serializable {
private static final long serialVersionUID = 7109847663910323991L;
private String staffId;
private String name;
private String headPhoto;
private String orgName;
private Integer gender;
private List<String> roles;
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/OrgDTO.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 14:21
*/
@Data
public class OrgDTO implements Serializable {
private static final long serialVersionUID = -3659371769044867016L;
private String orgId;
private String orgName;
private String orgType;
private Integer staffNum;
}

39
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/ReceiverDTO.java

@ -0,0 +1,39 @@
package com.epmet.dataaggre.dto.govorg;
import lombok.Data;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 14:50
*/
@Data
public class ReceiverDTO implements Serializable {
private static final long serialVersionUID = 7756394210796777416L;
/**
* ID
*/
private String staffId;
/**
* 姓名
*/
private String staffName;
/**
* 头像
*/
private String headPhoto;
/**
* 所属组织目前显示两级
*/
private String orgName;
/**
* 1已读0未读
*/
private Boolean readFlag;
/**
* 1男2女0未知
*/
private Integer gender;
}

44
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/OrgStaffListFormDTO.java

@ -0,0 +1,44 @@
package com.epmet.dataaggre.dto.govorg.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 通讯录组织/部门/网格下人员列表-接口入参
* @Auth sun
*/
@Data
public class OrgStaffListFormDTO implements Serializable {
private static final long serialVersionUID = -1974456701949979946L;
/**
* 组织部门网格Id
*/
@NotBlank(message = "类型Id不能为空", groups = OrgStaffListFormDTO.OrgStaff.class)
private String orgId;
/**
* 类型组织:agency 部门:dept 网格:grid
*/
@NotBlank(message = "类型不能为空", groups = OrgStaffListFormDTO.OrgStaff.class)
private String orgType;
/**
* 页码从1开始
*/
@Min(value = 1, message = "页码必须大于0", groups = OrgStaffListFormDTO.OrgStaff.class)
private Integer pageNo;
/**
* 页容量默认10页
*/
@Min(value = 1, message = "每页条数必须大于0", groups = OrgStaffListFormDTO.OrgStaff.class)
private Integer pageSize = 10;
//客户Id
private String customerId;
//工作人员id集合
private List<String> staffIds;
public interface OrgStaff extends CustomerClientShowGroup {}
}

22
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/ReceiversFormDTO.java

@ -0,0 +1,22 @@
package com.epmet.dataaggre.dto.govorg.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author Administrator
*/
@Data
public class ReceiversFormDTO implements Serializable {
private static final long serialVersionUID = -1588067365064394258L;
@NotBlank(message = "消息ID不能为空")
private String infoId;
private Integer pageNo = 1;
private Integer pageSize = 10;
private String readFlag;
}

45
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/StaffDetailV2FormDTO.java

@ -0,0 +1,45 @@
package com.epmet.dataaggre.dto.govorg.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description 通讯录人员详情v2-接口返参
* @Auth sun
*/
@Data
public class StaffDetailV2FormDTO implements Serializable {
private static final long serialVersionUID = -1974456701949979946L;
//工作人员用户id
private String staffId = "";
//工作人员姓名
private String name = "";
//性别
private String gender = "";
//手机号
private String mobile = "";
//头像
private String headPhoto = "";
//激活状态:inactive未激活,active已激活
private String activeFlag = "";
//激活时间
private Date activeTime;
//未禁用enable,已禁用disabled
private String enableFlag = "";
//fulltime专职parttime兼职
private String workType = "";
//人员新增所属组织名【组织-组织,组织-部门,组织-网格】
private String orgName = "";
//人员添加类型的Id
private String orgId = "";
//人员添加时的类型【agency;dept;grid】
private String orgType = "";
//职责名称列表
private List<String> roles;
}

18
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/SubOrgFormDTO.java

@ -0,0 +1,18 @@
package com.epmet.dataaggre.dto.govorg.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 14:18
*/
@Data
public class SubOrgFormDTO implements Serializable {
private static final long serialVersionUID = -3651225675593357002L;
@NotBlank(message = "组织ID不能为空")
private String agencyId;
}

45
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/OrgStaffListResultDTO.java

@ -0,0 +1,45 @@
/**
* 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.dataaggre.dto.govorg.result;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 通讯录组织/部门/网格下人员列表-接口返参
* @Auth sun
*/
@Data
public class OrgStaffListResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 人员总数
*/
private Integer staffCount;
/**
* 人员列表
*/
private List<ListStaffResultDTO> staffList;
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/ReceiversResultDTO.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.dto.govorg.result;
import com.epmet.dataaggre.dto.govorg.ReceiverDTO;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
import java.util.List;
/**
* @author Administrator
*/
@NoArgsConstructor
@Data
public class ReceiversResultDTO implements Serializable {
private static final long serialVersionUID = 255217078396991037L;
private Integer total;
private List<ReceiverDTO> dataList;
}

82
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffAgencyDTO.java

@ -0,0 +1,82 @@
/**
* 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.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
/**
* 机关单位信息表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
*/
@Data
public class StaffAgencyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private String agencyId;
/**
* 组织名称
*/
private String agencyName;
/**
* 上级组织机构ID
*/
private String pid;
/**
* 所有上级组织机构ID(以英文:隔开)
*/
private String pids;
/**
* 所有上级名称,-连接
*/
private String allParentName;
private String parentAgencyName;
/**
* 机关级别社区级community
街道:street,
区县级: district,
市级: city
省级:province 机关级别社区级community街道:street,区县级: district,市级: city省级:province
*/
private String level;
/**
* 地区编码
*/
private String areaCode;
/**
* 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701
*/
private String parentAreaCode;
}

43
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffDetailV2ResultDTO.java

@ -0,0 +1,43 @@
/**
* 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.dataaggre.dto.govorg.result;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 通讯录人员详情v2-接口返参
* @Auth sun
*/
@Data
public class StaffDetailV2ResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 工资人员Id
*/
@NotBlank(message = "人员Id不能为空", groups = StaffDetailV2ResultDTO.Staff.class)
private String staffId;
public interface Staff extends CustomerClientShowGroup {}
}

45
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgNameResultDTO.java

@ -0,0 +1,45 @@
/**
* 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.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
/**
* 查询工作人员注册组织信息
* @author sun
*/
@Data
public class StaffOrgNameResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
//工作人员所属组织Id
private String agencyId = "";
//人员Id
private String staffId = "";
//人员注册时所属组织名【组织-组织,组织-部门,组织-网格】
private String orgName = "";
//工作人员添加入口Id(agencyId;deptId;gridId)
private String orgId = "";
//工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
private String orgType = "";
}

42
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/CustomerStaffRedis.java → epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/StaffOrgRelationResultDTO.java

@ -15,33 +15,37 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
package com.epmet.dataaggre.dto.govorg.result;
import lombok.Data;
import java.io.Serializable;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 政府工作人员表
* 工作人员注册组织关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-18
* @since v1.0.0 2021-08-19
*/
@Component
public class CustomerStaffRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
@Data
public class StaffOrgRelationResultDTO implements Serializable {
}
private static final long serialVersionUID = 1L;
/**
* 工作人员Id
*/
private String staffId;
public void set(){
/**
* 工作人员添加入口Id(agencyId;deptId;gridId)
*/
private String orgId;
}
/**
* 工作人员添加入口类型(组织:agency;部门:dept;网格:gridId)
*/
private String orgType;
public String get(String id){
return null;
}
}
}

20
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/result/SubOrgResultDTO.java

@ -0,0 +1,20 @@
package com.epmet.dataaggre.dto.govorg.result;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 14:20
*/
@Data
public class SubOrgResultDTO implements Serializable {
private static final long serialVersionUID = 3080780461845963616L;
private List<OrgDTO> subAgencyList;
private List<OrgDTO> departmentList;
private List<OrgDTO> gridList;
}

34
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoGroupDetailFormDTO.java

@ -0,0 +1,34 @@
package com.epmet.dataaggre.dto.message.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 群组列表
* @Author yinzuomei
* @Date 2021/8/20 12:54 下午
*/
@Data
public class InfoGroupDetailFormDTO extends PageFormDTO implements Serializable {
@NotBlank(message = "群组id不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String receiverGroupId;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups =PageFormDTO.AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String customerId;
}

36
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoIdDTO.java

@ -0,0 +1,36 @@
package com.epmet.dataaggre.dto.message.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 通用dto
* @Author yinzuomei
* @Date 2021/8/20 7:48 下午
*/
@Data
public class InfoIdDTO implements Serializable {
private static final long serialVersionUID = -3852837936492128925L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "消息id不能为空",groups = AddUserInternalGroup.class)
private String infoId;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

33
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/InfoRepliesFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.message.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 发送消息详情页-回复列表
* @Author yinzuomei
* @Date 2021/8/20 1:42 下午
*/
@Data
public class InfoRepliesFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 8001971787502569463L;
@NotBlank(message = "消息id不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String infoId;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups =PageFormDTO.AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String customerId;
}

33
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/form/MySentFormDTO.java

@ -0,0 +1,33 @@
package com.epmet.dataaggre.dto.message.form;
import com.epmet.commons.tools.dto.form.PageFormDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 我发出的消息列表查询
* @Author yinzuomei
* @Date 2021/8/20 2:58 下午
*/
@Data
public class MySentFormDTO extends PageFormDTO implements Serializable {
private static final long serialVersionUID = 2007425752362914036L;
private String content;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups =PageFormDTO.AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = PageFormDTO.AddUserInternalGroup.class)
private String customerId;
}

97
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoDetailResDTO.java

@ -0,0 +1,97 @@
package com.epmet.dataaggre.dto.message.result;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description 消息详情
* @Author yinzuomei
* @Date 2021/8/20 7:49 下午
*/
@Data
public class InfoDetailResDTO implements Serializable {
private String infoId;
/**
* 发布人头像
*/
private String headPhoto;
/**
* 发布人id
*/
private String publishStaffId;
/**
* 发布人姓名
*/
private String publishStaffName;
/**
* 发布人2级组织名
*/
private String publishOrgName;
/**
* 发布人性别
*/
private String publishStaffGender;
/**
* 是否本人发布true:是当前用户发布
*/
private Boolean isMine;
/**
* 消息内容完整版
*/
private String content;
/**
* 发送时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date publishTime;
/**
* 共XX个接收人
*/
private Integer totalReceiver;
/**
* 已读的数量
*/
private Integer readTotal;
/**
* 未读的数量
*/
private Integer unReadCount;
/**
* 第一个接受人的id
*/
//@JsonIgnore
private String firstReceiverStaffId;
/**
* 第一个接受人的姓名
*/
private String firstReceiverName;
/**
* 未读的回复数量
*/
private Integer unReadReplyNum;
/**
* 附件列表
*/
private List<FileCommonDTO> attachmentList;
}

19
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoGroupDetailResDTO.java

@ -0,0 +1,19 @@
package com.epmet.dataaggre.dto.message.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 群组详情
* @Author yinzuomei
* @Date 2021/8/20 12:58 下午
*/
@Data
public class InfoGroupDetailResDTO implements Serializable {
private String receiverGroupId;
private String name;
private List<StaffInfoCommonDTO> staffList;
}

27
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoRedDotResultDTO.java

@ -0,0 +1,27 @@
package com.epmet.dataaggre.dto.message.result;
import com.epmet.commons.tools.constant.NumConstant;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/8/20 3:22 下午
* @DESC
*/
@Data
public class InfoRedDotResultDTO implements Serializable {
private static final long serialVersionUID = 6417699657069808978L;
/**
* 我发出的新回复数量
*/
private Integer sentNewReplyCount = NumConstant.ZERO;
/**
* 我收到的未读的消息数量
*/
private Integer receivedUnReadCount = NumConstant.ZERO;
}

28
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyDetail.java

@ -0,0 +1,28 @@
package com.epmet.dataaggre.dto.message.result;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description 发送消息-回复详情
* @Author yinzuomei
* @Date 2021/8/20 2:01 下午
*/
@Data
public class InfoReplyDetail extends StaffInfoCommonDTO implements Serializable {
private static final long serialVersionUID = -9038141920493410767L;
private String replyId;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date replyTime;
private String content;
/**
* 附件列表
*/
private List<FileCommonDTO> attachmentList;
}

18
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/InfoReplyResDTO.java

@ -0,0 +1,18 @@
package com.epmet.dataaggre.dto.message.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 发送消息-回复列表
* @Author yinzuomei
* @Date 2021/8/20 2:00 下午
*/
@Data
public class InfoReplyResDTO implements Serializable {
private Integer total;
private List<InfoReplyDetail> dataList;
}

24
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MyInfoGroupResultDTO.java

@ -0,0 +1,24 @@
package com.epmet.dataaggre.dto.message.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 我创建的群组列表
* @Author yinzuomei
* @Date 2021/8/20 10:30 上午
*/
@Data
public class MyInfoGroupResultDTO implements Serializable {
private static final long serialVersionUID = 3621868560778309056L;
private String receiverGroupId;
private String name;
private Integer totalMem;
@JsonIgnore
private List<String> staffIdList;
private List<String> staffNameList;
}

35
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MyReceivedResDTO.java

@ -0,0 +1,35 @@
package com.epmet.dataaggre.dto.message.result;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description 我收到的消息列表
* @Author yinzuomei
* @Date 2021/8/20 6:55 下午
*/
@Data
public class MyReceivedResDTO implements Serializable {
private static final long serialVersionUID = 2602131254448130443L;
private String infoId;
private String publishStaffName;
private String publishStaffOrgName;
private String headPhoto;
private String content;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date publishTime;
/**
* 附件列表 列表默认返回一个
*/
private List<FileCommonDTO> attachmentList;
private Boolean readFlag;
private String publishStaffGender;
private String firstAttId;
}

31
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/MySentResDTO.java

@ -0,0 +1,31 @@
package com.epmet.dataaggre.dto.message.result;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @Description 我发送的消息列表
* @Author yinzuomei
* @Date 2021/8/20 3:01 下午
*/
@Data
public class MySentResDTO implements Serializable {
private static final long serialVersionUID = -6765856639039569052L;
private String infoId;
private String content;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private Date publishTime;
private Integer totalReceiver;
private Integer readTotal;
private String firstAttId;
/**
* 附件列表 列表默认返回一个
*/
private List<FileCommonDTO> attachmentList;
}

21
epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/message/result/StaffInfoCommonDTO.java

@ -0,0 +1,21 @@
package com.epmet.dataaggre.dto.message.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 工作人员列表基本信息通用吧
* @Author yinzuomei
* @Date 2021/8/20 1:02 下午
*/
@Data
public class StaffInfoCommonDTO implements Serializable {
private String staffId;
private String staffName;
private String gender;
private String orgName;
private String headPhoto;
}

18
epmet-module/data-aggregator/data-aggregator-server/pom.xml

@ -294,6 +294,12 @@
<datasource.druid.opercustomize.username>epmet_oper_customize_user</datasource.druid.opercustomize.username>
<datasource.druid.opercustomize.password>EpmEt-db-UsEr</datasource.druid.opercustomize.password>
<datasource.druid.epmetmessage.url>
<![CDATA[jdbc:mysql://192.168.1.140:3306/epmet_message?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.epmetmessage.url>
<datasource.druid.epmetmessage.username>epmet_message_user</datasource.druid.epmetmessage.username>
<datasource.druid.epmetmessage.password>EpmEt-db-UsEr</datasource.druid.epmetmessage.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>192.168.1.140</spring.redis.host>
@ -395,6 +401,12 @@
<datasource.druid.opercustomize.username>epmet</datasource.druid.opercustomize.username>
<datasource.druid.opercustomize.password>elink@833066</datasource.druid.opercustomize.password>
<datasource.druid.epmetmessage.url>
<![CDATA[jdbc:mysql://rm-m5ef9t617j6o5eup7.mysql.rds.aliyuncs.com:3306/epmet_message?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.epmetmessage.url>
<datasource.druid.epmetmessage.username>epmet</datasource.druid.epmetmessage.username>
<datasource.druid.epmetmessage.password>elink@833066</datasource.druid.epmetmessage.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com</spring.redis.host>
@ -496,6 +508,12 @@
<datasource.druid.opercustomize.username>epmet_oper_customize_user</datasource.druid.opercustomize.username>
<datasource.druid.opercustomize.password>EpmEt-db-UsEr</datasource.druid.opercustomize.password>
<datasource.druid.epmetmessage.url>
<![CDATA[jdbc:mysql://rm-m5e3vzs2637224wj9.mysql.rds.aliyuncs.com:3306/epmet_message?allowMultiQueries=true&useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=Asia/Shanghai]]>
</datasource.druid.epmetmessage.url>
<datasource.druid.epmetmessage.username>epmet_message_user</datasource.druid.epmetmessage.username>
<datasource.druid.epmetmessage.password>EpmEt-db-UsEr</datasource.druid.epmetmessage.password>
<!-- redis配置 -->
<spring.redis.index>0</spring.redis.index>
<spring.redis.host>r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com</spring.redis.host>

8
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DemoController.java

@ -1,5 +1,6 @@
package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dataaggre.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
@ -17,7 +18,14 @@ public class DemoController {
@GetMapping("doIt")
public Result doIt() {
demoService.doIt();
//CustomerStaffRedis bean = SpringContextUtils.getBean(CustomerStaffRedis.class);
CustomerStaffRedis.initTest();
return new Result();
}
}

51
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/EpmetUserController.java

@ -14,6 +14,7 @@ import com.epmet.dataaggre.dto.epmetuser.form.OpenStaffDetailFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolDateListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolRecordListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.excel.StaffPatrollExcel;
@ -220,4 +221,54 @@ public class EpmetUserController {
ExcelUtils.exportExcelToTarget(response, null, resultDTOS, StaffPatrollExcel.class);
}
/**
* @Param formDTO
* @Description 通讯录姓名检索工作人员
* @author sun
*/
@PostMapping("stafflistbyrealname")
public Result<List<ListStaffResultDTO>> staffListByRealName(@LoginUser TokenDto tokenDto, @RequestBody ListStaffFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, ListStaffFormDTO.Staff.class);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<ListStaffResultDTO>>().ok(epmetUserService.listStaff(formDTO));
}
/**
* @Description 根据角色查询人员列表
* @Param formDTO
* @Return {@link Result<List<RoleUsersResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:05
*/
@PostMapping("roleusers")
public Result<List<RoleUsersResultDTO>> roleUsers(@LoginUser TokenDto tokenDto, @RequestBody RoleUsersFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<List<RoleUsersResultDTO>>().ok(epmetUserService.getRoleUsers(formDTO));
}
/**
* @Description 角色列表(带人数)
* @Param tokenDto
* @Return {@link Result<List<RoleListResultDTO>>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:10
*/
@PostMapping("rolelist")
public Result<List<RoleListResultDTO>> roleList(@LoginUser TokenDto tokenDto) {
return new Result<List<RoleListResultDTO>>().ok(epmetUserService.getRoleList(tokenDto.getCustomerId()));
}
/**
* 根据staffId查询用户基本信息
* remark:
*/
@PostMapping("getStaffInfo/{staffId}")
public Result getStaffInfo(@PathVariable(name = "staffId") String staffId){
return new Result<CustomerStaffResultDTO>().ok(epmetUserService.getStaffInfo(staffId));
}
}

47
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GovOrgController.java

@ -9,12 +9,8 @@ import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.security.user.LoginUserUtil;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dataaggre.dto.govorg.form.GridMemberDataAnalysisFromDTO;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.govorg.result.NextAreaCodeResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.enums.GridMemberDataAnalysisEnums;
import com.epmet.dataaggre.service.AggreGridService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
@ -128,4 +124,43 @@ public class GovOrgController {
return new Result<StaffAgencyGridListResultDTO>().ok(govOrgService.staffAgencyGridList(tokenDto));
}
/**
* @Param formDTO
* @Description 通讯录组织/部门/网格下人员列表
* @author sun
*/
@PostMapping("stafflist")
public Result<OrgStaffListResultDTO> staffList(@LoginUser TokenDto tokenDto, @RequestBody OrgStaffListFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, OrgStaffListFormDTO.OrgStaff.class);
if(!"agency".equals(formDTO.getOrgType())&&!"dept".equals(formDTO.getOrgType())&&!"grid".equals(formDTO.getOrgType())){
throw new RenException("参数类型错误");
}
formDTO.setCustomerId(tokenDto.getCustomerId());
return new Result<OrgStaffListResultDTO>().ok(govOrgService.staffList(formDTO));
}
/**
* @Param formDTO
* @Description 通讯录人员详情v2
* @author sun
*/
@PostMapping("staffdetailv2")
public Result<StaffDetailV2FormDTO> staffDetailV2(@RequestBody StaffDetailV2ResultDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, StaffDetailV2ResultDTO.Staff.class);
return new Result<StaffDetailV2FormDTO>().ok(govOrgService.staffDetailV2(formDTO));
}
/**
* @Description 下级组织/部门/网格列表
* @Param formDTO
* @Return {@link Result<SubOrgResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:13
*/
@PostMapping("suborg")
public Result<SubOrgResultDTO> subOrg(@RequestBody SubOrgFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
return new Result<SubOrgResultDTO>().ok(govOrgService.getSubOrg(formDTO));
}
}

158
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/InfoController.java

@ -0,0 +1,158 @@
package com.epmet.dataaggre.controller;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.dto.form.PageFormDTO;
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.dataaggre.dto.govorg.form.ReceiversFormDTO;
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.form.InfoIdDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.form.MySentFormDTO;
import com.epmet.dataaggre.dto.message.result.*;
import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService;
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 javax.annotation.Resource;
import java.util.List;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 14:45
*/
@RestController
@RequestMapping("info")
public class InfoController {
@Resource
private EpmetMessageService epmetMessageService;
/**
* @Description 已读未读列表
* @Param formDTO
* @Return {@link Result<ReceiversResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 14:49
*/
@PostMapping("receivers")
public Result<ReceiversResultDTO> receivers(@RequestBody ReceiversFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
ReceiversResultDTO result = epmetMessageService.getReceiverList(formDTO);
return new Result<ReceiversResultDTO>().ok(result);
}
/**
* 发送消息-我创建的群组列表
*
* @param tokenDto
* @return com.epmet.commons.tools.utils.Result<List<MyInfoGroupResultDTO>>
* @author yinzuomei
* @date 2021/8/20 10:32 上午
*/
@PostMapping("grouplist")
public Result<List<MyInfoGroupResultDTO>> queryMyGroupList(@LoginUser TokenDto tokenDto){
return new Result<List<MyInfoGroupResultDTO>>().ok(epmetMessageService.queryMyGroupList(tokenDto.getUserId(),tokenDto.getCustomerId()));
}
/**
* 发送消息-群组详情
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO>
* @author yinzuomei
* @date 2021/8/20 12:59 下午
*/
@PostMapping("groupdetail")
public Result<InfoGroupDetailResDTO> queryGroupDetail(@LoginUser TokenDto tokenDto, @RequestBody InfoGroupDetailFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
return new Result<InfoGroupDetailResDTO>().ok(epmetMessageService.queryGroupDetail(formDTO));
}
/**
* 发送消息-消息详情-回复列表分页查询
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.message.result.InfoReplyResDTO>
* @author yinzuomei
* @date 2021/8/20 2:09 下午
*/
@PostMapping("replylist")
public Result<InfoReplyResDTO> queryInfoReplies(@LoginUser TokenDto tokenDto,@RequestBody InfoRepliesFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, PageFormDTO.AddUserInternalGroup.class);
return new Result<InfoReplyResDTO>().ok(epmetMessageService.queryInfoReplies(formDTO));
}
/**
* @Description 发送消息我收到我发送红点
* @Param userId
* @author zxc
* @date 2021/8/20 3:38 下午
*/
@PostMapping("reddot")
public Result<InfoRedDotResultDTO> redDot(@LoginUser TokenDto tokenDto){
return new Result<InfoRedDotResultDTO>().ok(epmetMessageService.redDot(tokenDto.getUserId()));
}
/**
* 发送消息-我发送的列表 可根据内容搜索
*
* @param tokenDto
* @param mySentFormDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO>>
* @author yinzuomei
* @date 2021/8/20 3:02 下午
*/
@PostMapping("sentlist")
public Result<List<MySentResDTO>> queryMySent(@LoginUser TokenDto tokenDto, @RequestBody MySentFormDTO mySentFormDTO){
mySentFormDTO.setCustomerId(tokenDto.getCustomerId());
mySentFormDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(mySentFormDTO,PageFormDTO.AddUserInternalGroup.class);
return new Result<List<MySentResDTO>>().ok(epmetMessageService.queryMySent(mySentFormDTO));
}
/**
* 发送消息-我收到的列表
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/20 6:54 下午
*/
@PostMapping("receivedlist")
public Result<List<MyReceivedResDTO>> queryMyReceivedList(@LoginUser TokenDto tokenDto, @RequestBody MySentFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,PageFormDTO.AddUserInternalGroup.class);
return new Result<List<MyReceivedResDTO>>().ok(epmetMessageService.queryMyReceivedList(formDTO));
}
/**
* 消息详情我收到的我发送的通用
*
* @param tokenDto
* @param infoIdDTO
* @return com.epmet.commons.tools.utils.Result<com.epmet.dataaggre.dto.message.result.InfoDetailResDTO>
* @author yinzuomei
* @date 2021/8/20 7:57 下午
*/
@PostMapping("infodetail")
public Result<InfoDetailResDTO> queryInfoDetail(@LoginUser TokenDto tokenDto,@RequestBody InfoIdDTO infoIdDTO){
infoIdDTO.setCustomerId(tokenDto.getCustomerId());
infoIdDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(infoIdDTO,InfoIdDTO.AddUserInternalGroup.class);
return new Result<InfoDetailResDTO>().ok(epmetMessageService.queryInfoDetail(infoIdDTO));
}
}

72
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoProfileDao.java

@ -0,0 +1,72 @@
/**
* 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.dataaggre.dao.epmetmessage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.dataaggre.dto.message.result.InfoDetailResDTO;
import com.epmet.dataaggre.dto.message.result.MyReceivedResDTO;
import com.epmet.dataaggre.dto.message.result.MySentResDTO;
import com.epmet.dataaggre.entity.epmetmessage.InfoProfileEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 消息概要表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@Mapper
public interface InfoProfileDao extends BaseDao<InfoProfileEntity> {
/**
* 我发出的消息列表
*
* @param publishStaffId
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO>
* @author yinzuomei
* @date 2021/8/20 3:46 下午
*/
List<MySentResDTO> selectListMySent(@Param("publishStaffId") String publishStaffId,@Param("content") String content);
/**
* 我收到的消息列表
*
* @param userId
* @param content
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyReceivedResDTO>
* @author yinzuomei
* @date 2021/8/20 7:01 下午
*/
List<MyReceivedResDTO> selectListMyReceived(@Param("userId") String userId, @Param("content") String content);
/**
* 消息详情
*
* @param infoId
* @return com.epmet.dataaggre.dto.message.result.InfoDetailResDTO
* @author yinzuomei
* @date 2021/8/20 7:58 下午
*/
InfoDetailResDTO selectInfoDetail(String infoId);
List<FileCommonDTO> selectInfoAtt(String infoId);
}

109
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetmessage/InfoReceiversDao.java

@ -0,0 +1,109 @@
/**
* 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.dataaggre.dao.epmetmessage;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO;
import com.epmet.dataaggre.dto.message.result.InfoReplyDetail;
import com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO;
import com.epmet.dataaggre.entity.epmetmessage.InfoReceiversEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 消息接收人记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@Mapper
public interface InfoReceiversDao extends BaseDao<InfoReceiversEntity> {
/**
* 我创建的群组列表
*
* @param staffId
* @param customerId
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO>
* @author yinzuomei
* @date 2021/8/20 10:37 上午
*/
List<MyInfoGroupResultDTO> selectMyGroupList(@Param("staffId") String staffId,@Param("customerId") String customerId,@Param("receiverGroupId")String receiverGroupId);
/**
* 我创建的组内所有的人
*
* @param staffId
* @param customerId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @date 2021/8/20 10:46 上午
*/
List<String> selectDistinctStaffIds(@Param("staffId") String staffId,
@Param("customerId") String customerId,
@Param("receiverGroupId")String receiverGroupId);
/**
* 根据小组id查询群组基本信息 (群组id, 群组名称)
*
* @param receiverGroupId
* @return com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO
* @author yinzuomei
* @date 2021/8/20 2:19 下午
*/
InfoGroupDetailResDTO selectGroupInfo(String receiverGroupId);
/**
* 分页查询消息的回复列表
*
* @param infoId
* @return java.util.List<com.epmet.dataaggre.dto.message.result.InfoReplyDetail>
* @author yinzuomei
* @date 2021/8/20 2:20 下午
*/
List<InfoReplyDetail> selectListReply(String infoId);
/**
* 回复附件
*
* @param replyId
* @return java.util.List<com.epmet.commons.tools.dto.form.FileCommonDTO>
* @author yinzuomei
* @date 2021/8/20 2:31 下午
*/
List<FileCommonDTO> selectReplyAtt(String replyId);
/**
* @Description 查询我收到的未读的消息数量
* @Param userId
* @author zxc
* @date 2021/8/20 4:16 下午
*/
Integer selectUnReadCount(@Param("userId") String userId);
/**
* @Description 我发出的新回复数量
* @Param userId
* @author zxc
* @date 2021/8/20 4:20 下午
*/
Integer selectNewReplyCount(@Param("userId") String userId);
}

20
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/CustomerStaffDao.java

@ -19,6 +19,8 @@ package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -44,4 +46,22 @@ public interface CustomerStaffDao extends BaseDao<CustomerStaffEntity> {
* @author sun
*/
List<CustomerStaffDTO> selectByStaffIds(@Param("staffIds") List<String> staffIds, @Param("realName") String realName);
/**
* @Description 模糊查询用户角色信息
* @author sun
*/
List<ListStaffResultDTO> selectByRealName(@Param("customerId") String customerId, @Param("realName") String realName);
/**
* @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前
* @author sun
*/
List<ListStaffResultDTO> selectStaffList(OrgStaffListFormDTO formDTO);
/**
* @Description 查询工作人员基础信息
* @author sun
*/
CustomerStaffDTO selectByStaffId(@Param("staffId") String staffId);
}

15
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/GovStaffRoleDao.java

@ -19,7 +19,11 @@ package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity;
import com.epmet.dto.result.StaffRoleResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 政府端角色表
@ -29,5 +33,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public interface GovStaffRoleDao extends BaseDao<GovStaffRoleEntity> {
}
/**
* desc:根据员工id 获取角色列表
*
* @param staffId
* @return
*/
List<StaffRoleResultDTO> getStaffRoleList(@Param("staffId") String staffId);
}

16
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StaffRoleDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.epmetuser;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.epmetuser.result.RoleListResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity;
@ -48,4 +49,19 @@ public interface StaffRoleDao extends BaseDao<StaffRoleEntity> {
**/
List<StaffRoleListResultDTO> selectStaffRoleList(@Param("customerId") String customerId, @Param("staffId") String staffId);
/**
* @Description 查询工作人员拥有的角色名称列表
* @Author sun
**/
List<String> selectByStaffId(@Param("staffId") String staffId);
/**
* @Description 角色人数
* @Param customerId
* @Return {@link List< RoleListResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 17:16
*/
List<RoleListResultDTO> getRoleCountList(@Param("customerId") String customerId);
}

21
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java

@ -20,6 +20,8 @@ package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -42,7 +44,7 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<AgencyGridResultDTO> selectAllSubAgency(@Param("subPids") String subPids);
/**
* @Description 根据userId查询组织ID
* @Description 根据userId查询组织ID
* @Param userId
* @author zxc
* @date 2020/12/25 下午4:55
@ -52,11 +54,24 @@ public interface CustomerAgencyDao extends BaseDao<CustomerAgencyEntity> {
List<String> selectUsedAreaCodeList(@Param("parentAreaCode") String parentAreaCode);
List<CustomerAgencyEntity> selectNextAgency(@Param("customerId")String customerId, @Param("pid")String pid);
List<CustomerAgencyEntity> selectNextAgency(@Param("customerId") String customerId, @Param("pid") String pid);
/**
* @Author sun
* @Description 递归查询当前组织的直属下级组织列表
**/
List<StaffAgencyGridListResultDTO> selectSubAgencyList(@Param("subAgencyPids") String subAgencyPids);
}
/**
* @Description 批量查询工作人员注册组织信息
* @author sun
*/
List<StaffOrgNameResultDTO> selelctStaffOrg(@Param("staffIdList") List<String> staffIdList);
/**
* desc:获取工作人员是怎么添加的
* @param staffId
* @return
*/
StaffOrgRelationResultDTO getStaffFromOrgType(@Param("staffId") String staffId);
}

29
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffAgencyDao.java

@ -19,11 +19,15 @@ package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffAgencyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 人员-机关单位关系表
*
@ -44,4 +48,27 @@ public interface CustomerStaffAgencyDao extends BaseDao<CustomerStaffAgencyEntit
* @author sun
*/
CustomerAgencyDTO selectAgencyByStaffId(@Param("customerId") String customerId, @Param("staffId") String staffId);
}
/**
* desc:获取工作人员在的网格
* @param staffId
* @return
*/
List<CustomerGridDTO> getStaffGridList(@Param("staffId") String staffId);
/**
* @Description 按类型查询组织部门网格下所有工作人员Id列表
* @author sun
*/
List<String> selectStaffList(@Param("orgId") String orgId, @Param("orgType") String orgType);
/**
* @Description 获取下级组织列表
* @Param agencyId
* @Return {@link List<OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:08
*/
List<OrgDTO> selectSubAgency(@Param("agencyId") String agencyId);
}

25
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffDepartmentDao.java

@ -18,11 +18,16 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffDepartmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 部门人员关系表
* 部门人员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-20
@ -30,4 +35,20 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface CustomerStaffDepartmentDao extends BaseDao<CustomerStaffDepartmentEntity> {
}
/**
* desc:获取工作人员所在的部门列表
*
* @param staffId
* @return
*/
List<CustomerDepartmentDTO> getStaffDeptList(@Param("staffId") String staffId);
/**
* @Description
* @Param agencyId
* @Return {@link List< OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:29
*/
List<OrgDTO> selectDepartmentList(@Param("agencyId") String agencyId);
}

10
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerStaffGridDao.java

@ -18,6 +18,7 @@
package com.epmet.dataaggre.dao.govorg;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dataaggre.dto.govorg.OrgDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffAgencyGridListResultDTO;
import com.epmet.dataaggre.entity.govorg.CustomerStaffGridEntity;
@ -46,4 +47,13 @@ public interface CustomerStaffGridDao extends BaseDao<CustomerStaffGridEntity> {
* @author sun
*/
List<StaffAgencyGridListResultDTO.GridResultDTO> getStaffGridList(@Param("agencyId") String agencyId, @Param("staffId") String staffId);
/**
* @Description 获取组织下的网格级网格人数
* @Param agencyId
* @Return {@link List< OrgDTO>}
* @Author zhaoqifeng
* @Date 2021/8/20 14:37
*/
List<OrgDTO> selectGridList(@Param("agencyId") String agencyId);
}

78
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetmessage/InfoProfileEntity.java

@ -0,0 +1,78 @@
/**
* 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.dataaggre.entity.epmetmessage;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 消息概要表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("info_profile")
public class InfoProfileEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
private String customerId;
/**
* 消息主表的id
*/
private String infoId;
/**
* 发布人id
*/
private String publishStaffId;
/**
* 内容概要取前100字
*/
private String content;
/**
* 附件ID第一个用于展示
*/
private String firstAttId;
/**
* 应读人数
*/
private Integer totalReceiver;
/**
* 已读人数插入是为0
*/
private Integer readTotal;
/**
* 未读的回复数量发布人每次查看详情后置为0接收人回复一条+1
*/
private Integer unReadReplyNum;
}

58
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetmessage/InfoReceiversEntity.java

@ -0,0 +1,58 @@
/**
* 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.dataaggre.entity.epmetmessage;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
/**
* 消息接收人记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("info_receivers")
public class InfoReceiversEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 消息主表.id
*/
private String infoId;
/**
* 工作人员id
*/
private String staffId;
/**
* 已读1;未读0
*/
private Boolean readFlag;
}

94
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/EpmetMessageService.java

@ -0,0 +1,94 @@
package com.epmet.dataaggre.service.epmetmessage;
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO;
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.form.InfoIdDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.form.MySentFormDTO;
import com.epmet.dataaggre.dto.message.result.*;
import java.util.List;
/**
* @author Administrator
*/
public interface EpmetMessageService {
/**
* @Description 获取已读未读人员列表
* @Param formDTO
* @Return {@link ReceiversResultDTO}
* @Author zhaoqifeng
* @Date 2021/8/19 14:56
*/
ReceiversResultDTO getReceiverList(ReceiversFormDTO formDTO);
/**
* 我创建的群组列表
*
* @param staffId
* @param customerId
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO>
* @author yinzuomei
* @date 2021/8/20 10:33 上午
*/
List<MyInfoGroupResultDTO> queryMyGroupList(String staffId, String customerId);
/**
* 发送消息-群组详情
*
* @param formDTO
* @return com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO
* @author yinzuomei
* @date 2021/8/20 12:59 下午
*/
InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO);
/**
* 发送消息-消息详情-回复列表分页查询
*
* @param formDTO
* @return com.epmet.dataaggre.dto.message.result.InfoReplyResDTO
* @author yinzuomei
* @date 2021/8/20 2:09 下午
*/
InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO);
/**
* @Description 发送消息我收到我发送红点
* @Param userId
* @author zxc
* @date 2021/8/20 3:38 下午
*/
InfoRedDotResultDTO redDot(String userId);
/**
* 发送消息-我发送的列表 可根据内容搜索
*
* @param mySentFormDTO
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO>
* @author yinzuomei
* @date 2021/8/20 3:03 下午
*/
List<MySentResDTO> queryMySent(MySentFormDTO mySentFormDTO);
/**
* 发送消息-我收到的消息列表 可根据内容搜索
*
* @param formDTO
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyReceivedResDTO>
* @author yinzuomei
* @date 2021/8/20 7:00 下午
*/
List<MyReceivedResDTO> queryMyReceivedList(MySentFormDTO formDTO);
/**
* 消息详情我收到的我发送的通用
*
* @param infoIdDTO
* @return com.epmet.dataaggre.dto.message.result.InfoDetailResDTO
* @author yinzuomei
* @date 2021/8/20 7:57 下午
*/
InfoDetailResDTO queryInfoDetail(InfoIdDTO infoIdDTO);
}

268
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetmessage/impl/EpmetMessageServiceImpl.java

@ -0,0 +1,268 @@
package com.epmet.dataaggre.service.epmetmessage.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.epmetmessage.InfoProfileDao;
import com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao;
import com.epmet.dataaggre.dto.govorg.ReceiverDTO;
import com.epmet.dataaggre.dto.govorg.form.ReceiversFormDTO;
import com.epmet.dataaggre.dto.govorg.result.ReceiversResultDTO;
import com.epmet.dataaggre.dto.message.form.InfoGroupDetailFormDTO;
import com.epmet.dataaggre.dto.message.form.InfoIdDTO;
import com.epmet.dataaggre.dto.message.form.InfoRepliesFormDTO;
import com.epmet.dataaggre.dto.message.form.MySentFormDTO;
import com.epmet.dataaggre.dto.message.result.*;
import com.epmet.dataaggre.entity.epmetmessage.InfoReceiversEntity;
import com.epmet.dataaggre.service.epmetmessage.EpmetMessageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
/**
* @Description
* @Author zhaoqifeng
* @Date 2021/8/19 15:23
*/
@Service
@DataSource(DataSourceConstant.EPMET_MESSAGE)
@Slf4j
public class EpmetMessageServiceImpl implements EpmetMessageService {
@Autowired
private InfoReceiversDao infoReceiversDao;
@Autowired
private InfoProfileDao infoProfileDao;
/**
* @param formDTO
* @Description 获取已读未读人员列表
* @Param formDTO
* @Return {@link ReceiversResultDTO}
* @Author zhaoqifeng
* @Date 2021/8/19 14:56
*/
@Override
public ReceiversResultDTO getReceiverList(ReceiversFormDTO formDTO) {
ReceiversResultDTO result = new ReceiversResultDTO();
//检索已读/未读人员列表,并分页
LambdaQueryWrapper<InfoReceiversEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(InfoReceiversEntity :: getInfoId, formDTO.getInfoId());
wrapper.eq(StringUtils.isNotBlank(formDTO.getReadFlag()), InfoReceiversEntity :: getReadFlag, NumConstant.ONE_STR.equals(formDTO.getReadFlag()));
Page<InfoReceiversEntity> page = new Page<>(formDTO.getPageNo(), formDTO.getPageSize());
IPage<InfoReceiversEntity> iPage = infoReceiversDao.selectPage(page, wrapper);
List<InfoReceiversEntity> list = iPage.getRecords();
result.setTotal((int) iPage.getTotal());
//结果为空,返回
if (CollectionUtils.isEmpty(list)) {
result.setDataList(Collections.emptyList());
return result;
}
//构建人员列表
List<ReceiverDTO> dataList = list.stream().map(item -> {
ReceiverDTO dto = new ReceiverDTO();
dto.setStaffId(item.getStaffId());
dto.setReadFlag(item.getReadFlag());
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
dto.setStaffName(staffInfoCache.getRealName());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setOrgName(staffInfoCache.getTwoOrgName());
return dto;
}).collect(Collectors.toList());
result.setDataList(dataList);
return result;
}
/**
* 我创建的群组列表
*
* @param staffId
* @param customerId
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO>
* @author yinzuomei
* @date 2021/8/20 10:33 上午
*/
@Override
public List<MyInfoGroupResultDTO> queryMyGroupList(String staffId, String customerId) {
// 按照小组的创建时间升序,新创建在后面, 显示的人员时按照info_group_receivers 群成员表的主键升序
List<MyInfoGroupResultDTO> list = infoReceiversDao.selectMyGroupList(staffId, customerId,null);
if (CollectionUtils.isNotEmpty(list)) {
// 2、遍历每个群组,赋值工作人员姓名列表
for (MyInfoGroupResultDTO group : list) {
List<String> staffNameList = new ArrayList<>();
for (String userId : group.getStaffIdList()) {
//查询每个工作人员的基本信息,获取姓名
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(customerId, userId);
if (null != staffInfoCache) {
staffNameList.add(staffInfoCache.getRealName());
}
}
group.setStaffNameList(staffNameList);
}
}
return list;
}
/**
* 发送消息-群组详情
*
* @param formDTO
* @return com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO
* @author yinzuomei
* @date 2021/8/20 12:59 下午
*/
@Override
public InfoGroupDetailResDTO queryGroupDetail(InfoGroupDetailFormDTO formDTO) {
InfoGroupDetailResDTO resDTO = infoReceiversDao.selectGroupInfo(formDTO.getReceiverGroupId());
if (null == resDTO) {
throw new RenException("info_receiver_group dosen't have record");
}
resDTO.setStaffList(new ArrayList<>());
//按照info_group_receivers 群成员表的主键升序
PageInfo<String> staffIds = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoReceiversDao.selectDistinctStaffIds(formDTO.getUserId(), formDTO.getCustomerId(), formDTO.getReceiverGroupId()));
if (CollectionUtils.isNotEmpty(staffIds.getList())) {
for (String userId : staffIds.getList()) {
//查询每个工作人员的基本信息
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), userId);
if (null != staffInfoCache) {
StaffInfoCommonDTO staffInfo = new StaffInfoCommonDTO();
staffInfo.setStaffId(userId);
staffInfo.setStaffName(staffInfoCache.getRealName());
staffInfo.setGender(staffInfoCache.getGender().toString());
staffInfo.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR);
staffInfo.setOrgName(staffInfoCache.getTwoOrgName());
resDTO.getStaffList().add(staffInfo);
}
}
}
return resDTO;
}
/**
* 发送消息-消息详情-回复列表分页查询
*
* @param formDTO
* @return com.epmet.dataaggre.dto.message.result.InfoReplyResDTO
* @author yinzuomei
* @date 2021/8/20 2:09 下午
*/
@Override
public InfoReplyResDTO queryInfoReplies(InfoRepliesFormDTO formDTO) {
InfoReplyResDTO result = new InfoReplyResDTO();
// 按照回复时间降序排列 ,新回复的在最上面
PageInfo<InfoReplyDetail> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoReceiversDao.selectListReply(formDTO.getInfoId()));
result.setTotal((int) data.getTotal());
for (InfoReplyDetail detail : data.getList()) {
//查询每个工作人员的基本信息
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), detail.getStaffId());
detail.setStaffName(staffInfoCache.getRealName());
detail.setGender(staffInfoCache.getGender().toString());
detail.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR);
detail.setOrgName(staffInfoCache.getTwoOrgName());
}
result.setDataList(data.getList());
return result;
}
/**
* @Description 发送消息我收到我发送红点
* 我发出的查询info_profile限制住created_by=当前用户 sum未读的回复数
* 我收到的info_receivers并且未读的 count(distinct info_id)
* @Param userId
* @author zxc
* @date 2021/8/20 3:38 下午
*/
@Override
public InfoRedDotResultDTO redDot(String userId) {
InfoRedDotResultDTO result = new InfoRedDotResultDTO();
result.setReceivedUnReadCount(infoReceiversDao.selectUnReadCount(userId));
result.setSentNewReplyCount(infoReceiversDao.selectNewReplyCount(userId));
return result;
}
/**
* 发送消息-我发送的列表 可根据内容搜索
*
* @param formDTO
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MySentResDTO>
* @author yinzuomei
* @date 2021/8/20 3:03 下午
*/
@Override
public List<MySentResDTO> queryMySent(MySentFormDTO formDTO) {
PageInfo<MySentResDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> infoProfileDao.selectListMySent(formDTO.getUserId(),formDTO.getContent()));
return data.getList();
}
/**
* 发送消息-我收到的消息列表 可根据内容搜索
*
* @param formDTO
* @return java.util.List<com.epmet.dataaggre.dto.message.result.MyReceivedResDTO>
* @author yinzuomei
* @date 2021/8/20 7:00 下午
*/
@Override
public List<MyReceivedResDTO> queryMyReceivedList(MySentFormDTO formDTO) {
PageInfo<MyReceivedResDTO> data = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize())
.doSelectPageInfo(() -> infoProfileDao.selectListMyReceived(formDTO.getUserId(),formDTO.getContent()));
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(formDTO.getCustomerId(), formDTO.getUserId());
for(MyReceivedResDTO resDTO: data.getList()){
resDTO.setHeadPhoto(StringUtils.isNotBlank(staffInfoCache.getHeadPhoto()) ? staffInfoCache.getHeadPhoto() : StrConstant.EPMETY_STR);
resDTO.setPublishStaffGender(String.valueOf(staffInfoCache.getGender()));
resDTO.setPublishStaffOrgName(staffInfoCache.getTwoOrgName());
resDTO.setPublishStaffName(staffInfoCache.getRealName());
}
return data.getList();
}
/**
* 消息详情我收到的我发送的通用
*
* @param infoIdDTO
* @return com.epmet.dataaggre.dto.message.result.InfoDetailResDTO
* @author yinzuomei
* @date 2021/8/20 7:57 下午
*/
@Override
public InfoDetailResDTO queryInfoDetail(InfoIdDTO infoIdDTO) {
InfoDetailResDTO resDTO=infoProfileDao.selectInfoDetail(infoIdDTO.getInfoId());
if(null!=resDTO){
if (resDTO.getPublishStaffId().equals(infoIdDTO.getUserId())) {
resDTO.setIsMine(true);
} else {
resDTO.setIsMine(false);
}
resDTO.setAttachmentList(infoProfileDao.selectInfoAtt(infoIdDTO.getInfoId()));
if(StringUtils.isNotBlank(resDTO.getPublishStaffId())){
CustomerStaffInfoCacheResult publisher = CustomerStaffRedis.getStaffInfo(infoIdDTO.getCustomerId(), resDTO.getPublishStaffId());
resDTO.setHeadPhoto(StringUtils.isNotBlank(publisher.getHeadPhoto()) ? publisher.getHeadPhoto() : StrConstant.EPMETY_STR);
resDTO.setPublishOrgName(publisher.getTwoOrgName());
resDTO.setPublishStaffGender(publisher.getGender().toString());
resDTO.setPublishStaffName(publisher.getRealName());
}
if(StringUtils.isNotBlank(resDTO.getFirstReceiverStaffId())){
CustomerStaffInfoCacheResult first = CustomerStaffRedis.getStaffInfo(infoIdDTO.getCustomerId(), resDTO.getFirstReceiverStaffId());
resDTO.setFirstReceiverName(first.getRealName());
}
}
return resDTO;
}
}

62
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/EpmetUserService.java

@ -1,10 +1,10 @@
package com.epmet.dataaggre.service.epmetuser;
import com.epmet.dataaggre.dto.epmetuser.form.OpenStaffDetailFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolDateListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolRecordListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import java.util.List;
@ -50,7 +50,7 @@ public interface EpmetUserService {
/**
* 历史巡查日期查询
* @author zhaoqifeng
* @date 2021/6/10 14:36
* @date 2021/6/10 14:36
* @param formDTO
* @return com.epmet.dataaggre.dto.epmetuser.result.PatrolDateListResultDTO
*/
@ -86,14 +86,58 @@ public interface EpmetUserService {
* @Author sun
**/
List<StaffRoleListResultDTO> getStaffRoleList(String customerId, String userId);
/**
* 我要报事-人大代表个人中心 是否显示@我是否显示红点
*
* @param userId
*
* @param userId
* @return com.epmet.dataaggre.dto.epmetuser.result.UserEventLogoResultDTO
* @author yinzuomei
* @author yinzuomei
* @date 2021/8/3 15:09
*/
UserEventLogoResultDTO mentionMeEvent(String userId);
/**
* @Param formDTO
* @Description 通讯录姓名检索工作人员
* @author sun
*/
List<ListStaffResultDTO> listStaff(ListStaffFormDTO formDTO);
/**
* 根据角色查询人员列表
* @Param formDTO
* @Return {@link List<RoleUsersResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:03
*/
List<RoleUsersResultDTO> getRoleUsers(RoleUsersFormDTO formDTO);
/**
* @Description 获取角色列表
* @Param customerId
* @Return {@link List<RoleListResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:09
*/
List<RoleListResultDTO> getRoleList(String customerId);
/**
* desc:根据工作人员Id 获取工作人员全部信息
* @param staffId
* @return
*/
CustomerStaffResultDTO getStaffInfo(String staffId);
/**
* @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前
* @author sun
*/
List<ListStaffResultDTO> getStaffInfoList(OrgStaffListFormDTO formDTO);
/**
* @Description 查询工作人员基础信息角色信息
* @author sun
*/
StaffDetailV2FormDTO selectByStaffId(String staffId);
}

220
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/EpmetUserServiceImpl.java

@ -1,7 +1,14 @@
package com.epmet.dataaggre.service.epmetuser.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
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.dto.form.IdAndNameDTO;
import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.BadgeConstant;
import com.epmet.dataaggre.constant.DataSourceConstant;
@ -9,20 +16,26 @@ import com.epmet.dataaggre.dao.epmetuser.*;
import com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolDetailDTO;
import com.epmet.dataaggre.dto.epmetuser.StaffPatrolRecordDTO;
import com.epmet.dataaggre.dto.epmetuser.form.OpenStaffDetailFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolDateListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.PatrolRecordListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.StaffListFormDTO;
import com.epmet.dataaggre.dto.epmetuser.form.*;
import com.epmet.dataaggre.dto.epmetuser.result.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.result.GridStaffResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO;
import com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO;
import com.epmet.dataaggre.entity.epmetuser.CustomerStaffEntity;
import com.epmet.dataaggre.entity.epmetuser.GovStaffRoleEntity;
import com.epmet.dataaggre.entity.epmetuser.ResiUserBadgeEntity;
import com.epmet.dataaggre.entity.epmetuser.StaffRoleEntity;
import com.epmet.dataaggre.service.epmetuser.EpmetUserService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolDetailService;
import com.epmet.dataaggre.service.epmetuser.StaffPatrolRecordService;
import com.epmet.dataaggre.service.govorg.GovOrgService;
import com.epmet.dataaggre.service.govproject.GovProjectService;
import com.epmet.dto.result.StaffRoleResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
@ -61,6 +74,8 @@ public class EpmetUserServiceImpl implements EpmetUserService {
private ResiUserBadgeDao resiUserBadgeDao;
@Autowired
private GovProjectService govProjectService;
@Resource
private GovStaffRoleDao govStaffRoleDao;
/**
* @Description 根据UserIds查询
@ -424,5 +439,202 @@ public class EpmetUserServiceImpl implements EpmetUserService {
return resultDTO;
}
/**
* @Param formDTO
* @Description 通讯录姓名检索工作人员
* @author sun
*/
@Override
public List<ListStaffResultDTO> listStaff(ListStaffFormDTO formDTO) {
//1.模糊查询用户、角色信息
List<ListStaffResultDTO> resultList = customerStaffDao.selectByRealName(formDTO.getCustomerId(), formDTO.getRealName());
if (null == resultList || resultList.size() < NumConstant.ONE) {
return new ArrayList<>();
}
//2.查询用户注册组织信息
List<String> staffIdList = resultList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList());
List<StaffOrgNameResultDTO> orgList = govOrgService.getStaffOrgName(staffIdList);
//3.封装数据并返回
resultList.forEach(re -> orgList.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgName(s.getOrgName())));
return resultList;
}
/**
* 根据角色查询人员列表
*
* @param formDTO
* @Param formDTO
* @Return {@link List<RoleUsersResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:03
*/
@Override
public List<RoleUsersResultDTO> getRoleUsers(RoleUsersFormDTO formDTO) {
LambdaQueryWrapper<StaffRoleEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StaffRoleEntity :: getCustomerId, formDTO.getCustomerId());
wrapper.eq(StaffRoleEntity::getRoleId, formDTO.getRoleId());
List<StaffRoleEntity> staffRoleList = staffRoleDao.selectList(wrapper);
if (CollectionUtils.isEmpty(staffRoleList)) {
return Collections.emptyList();
}
return staffRoleList.stream().map(item -> {
RoleUsersResultDTO dto = new RoleUsersResultDTO();
dto.setStaffId(item.getStaffId());
//从redis获取用户信息
CustomerStaffInfoCacheResult staffInfoCache = CustomerStaffRedis.getStaffInfo(item.getCustomerId(), item.getStaffId());
dto.setGender(staffInfoCache.getGender());
dto.setHeadPhoto(staffInfoCache.getHeadPhoto());
dto.setName(staffInfoCache.getRealName());
dto.setOrgName(staffInfoCache.getTwoOrgName());
dto.setRoles(new ArrayList<>(staffInfoCache.getRoleMap().values()));
return dto;
}).collect(Collectors.toList());
}
/**
* @param customerId
* @Description 获取角色列表
* @Param customerId
* @Return {@link List<RoleListResultDTO>}
* @Author zhaoqifeng
* @Date 2021/8/19 15:09
*/
@Override
public List<RoleListResultDTO> getRoleList(String customerId) {
//获取角色列表
LambdaQueryWrapper<GovStaffRoleEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(GovStaffRoleEntity :: getCustomerId, customerId);
wrapper.orderByAsc(GovStaffRoleEntity ::getSort);
List<GovStaffRoleEntity> list = govStaffRoleDao.selectList(wrapper);
//获取角色人数
List<RoleListResultDTO> countList = staffRoleDao.getRoleCountList(customerId);
Map<String, Integer> map = new HashMap<>();
if (CollectionUtils.isNotEmpty(countList)) {
map = countList.stream().collect(Collectors.toMap(RoleListResultDTO :: getRoleId, RoleListResultDTO :: getStaffNum));
}
Map<String, Integer> finalMap = map;
//构建返回值
return list.stream().map(item -> {
RoleListResultDTO dto = new RoleListResultDTO();
dto.setRoleId(item.getId());
dto.setRoleKey(item.getRoleKey());
dto.setRoleName(item.getRoleName());
dto.setDescription(item.getDescription());
dto.setStaffNum(null == finalMap.get(item.getId())?NumConstant.ZERO:finalMap.get(item.getId()));
return dto;
}).collect(Collectors.toList());
}
@Override
public CustomerStaffResultDTO getStaffInfo(String staffId) {
LambdaQueryWrapper<CustomerStaffEntity> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CustomerStaffEntity::getUserId,staffId)
.eq(CustomerStaffEntity::getDelFlag,NumConstant.ZERO_STR);
CustomerStaffEntity staffEntity = customerStaffDao.selectOne(queryWrapper);
CustomerStaffResultDTO result = ConvertUtils.sourceToTarget(staffEntity, CustomerStaffResultDTO.class);
//查询工作人员所属组织信息
CustomerAgencyDTO agencyDTO = govOrgService.gridByAgencyId(null,staffId);
if (agencyDTO == null){
log.error("getStaffInfo have any agency staffId:{}",staffId);
return null;
}
result.setAgencyName(agencyDTO.getOrganizationName());
StaffOrgRelationResultDTO fromOrgTypeDto = govOrgService.getStaffFromOrgType(staffId);
String fromOrgType = OrgTypeEnum.AGENCY.getCode();
if (fromOrgTypeDto != null){
fromOrgType = fromOrgTypeDto.getOrgType();
result.setFromOrgId(fromOrgTypeDto.getOrgId());
}
result.setFromOrgType(fromOrgType);
boolean isContinueMkName = true;
StringBuilder showNameBuilder = new StringBuilder(16);
if (OrgTypeEnum.AGENCY.getCode().equals(fromOrgType)){
String allParentName = agencyDTO.getAllParentName();
if (StringUtils.isNotBlank(allParentName)){
showNameBuilder.append(allParentName.substring(allParentName.lastIndexOf(StrConstant.HYPHEN)+NumConstant.ONE));
showNameBuilder.append(StrConstant.HYPHEN);
showNameBuilder.append(agencyDTO.getOrganizationName());
isContinueMkName = false;
}else{
showNameBuilder.append(agencyDTO.getOrganizationName());
}
}
List<StaffRoleResultDTO> roleList = govStaffRoleDao.getStaffRoleList(staffId);
Map<String, String> roleMap = roleList.stream().collect(Collectors.toMap(StaffRoleResultDTO::getRoleKey, StaffRoleResultDTO::getRoleName));
result.setRoleMap(roleMap);
//1.查询工作人员所在的网格列表
List<CustomerGridDTO> list = govOrgService.getStaffGridList(staffId);
List<IdAndNameDTO> idAndNameList = new ArrayList<>();
for (CustomerGridDTO customerGridDTO : list) {
IdAndNameDTO grid = new IdAndNameDTO();
grid.setId(customerGridDTO.getId());
grid.setName(customerGridDTO.getGridName());
idAndNameList.add(grid);
if (isContinueMkName && OrgTypeEnum.GRID.getCode().equals(fromOrgType)&&grid.getId().equals(result.getFromOrgId())){
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(grid.getName());
}
}
result.setGridList(idAndNameList);
//查询工作人员所在的部门列表
List<CustomerDepartmentDTO> deptList = govOrgService.getStaffDeptList(staffId);
idAndNameList = new ArrayList<>();
for (CustomerDepartmentDTO org : deptList) {
IdAndNameDTO dept = new IdAndNameDTO();
dept.setId(org.getId());
dept.setName(org.getDepartmentName());
idAndNameList.add(dept);
if (isContinueMkName && OrgTypeEnum.DEPT.getCode().equals(fromOrgType)&&dept.getId().equals(result.getFromOrgId())){
showNameBuilder.append(agencyDTO.getOrganizationName()).append(StrConstant.HYPHEN).append(dept.getName());
}
}
result.setDeptList(idAndNameList);
//特殊处理 显示的名字
result.setTwoOrgName(showNameBuilder.toString());
return result;
}
/**
* @Description 分页查询工作人员基础信息角色信息组织人员单位领导角色人员在前部门人员部门领导角色人员在前网格人员网格长角色人员在前
* @author sun
*/
@Override
public List<ListStaffResultDTO> getStaffInfoList(OrgStaffListFormDTO formDTO) {
//分别查询不能类型下人员信息、角色信息,按需求排序
int pageIndex = (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize();
formDTO.setPageNo(pageIndex);
List<ListStaffResultDTO> resultList = customerStaffDao.selectStaffList(formDTO);
return resultList;
}
/**
* @Description 查询工作人员基础信息角色信息
* @author sun
*/
@Override
public StaffDetailV2FormDTO selectByStaffId(String staffId) {
StaffDetailV2FormDTO result = new StaffDetailV2FormDTO();
//基本信息
CustomerStaffDTO dto = customerStaffDao.selectByStaffId(staffId);
if (null == dto) {
return result;
}
//角色信息
List<String> list = staffRoleDao.selectByStaffId(staffId);
//汇总数据
result = ConvertUtils.sourceToTarget(dto, StaffDetailV2FormDTO.class);
result.setName(dto.getRealName());
result.setRoles(list);
return result;
}
}

54
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java

@ -2,8 +2,12 @@ package com.epmet.dataaggre.service.govorg;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
@ -81,4 +85,54 @@ public interface GovOrgService {
*/
StaffAgencyGridListResultDTO staffAgencyGridList(TokenDto tokenDto);
/**
* @Param formDTO
* @Description 通讯录组织/部门/网格下人员列表
* @author sun
*/
OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO);
/**
* @Param formDTO
* @Description 通讯录人员详情v2
* @author sun
*/
StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO);
/**
* @Description 下级组织/部门/网格列表
* @Param formDTO
* @Return {@link SubOrgResultDTO}
* @Author zhaoqifeng
* @Date 2021/8/19 15:12
*/
SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO);
/**
* @Description 批量查询工作人员注册组织信息
* @author sun
*/
List<StaffOrgNameResultDTO> getStaffOrgName(List<String> staffIdList);
/**
* desc:工作人员所在网格
* @param staffId
* @return
*/
List<CustomerGridDTO> getStaffGridList(String staffId);
/**
* desc:工作人员所在部门
* @param staffId
* @return
*/
List<CustomerDepartmentDTO> getStaffDeptList(String staffId);
/**
* desc获取工作人员是由哪个类型添加进来的
* @param staffId
* @return
*/
StaffOrgRelationResultDTO getStaffFromOrgType(String staffId);
}

116
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java

@ -1,21 +1,26 @@
package com.epmet.dataaggre.service.govorg.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.dataaggre.constant.DataSourceConstant;
import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao;
import com.epmet.dataaggre.dao.govorg.CustomerGridDao;
import com.epmet.dataaggre.dao.govorg.CustomerStaffAgencyDao;
import com.epmet.dataaggre.dao.govorg.CustomerStaffGridDao;
import com.epmet.dataaggre.dao.govorg.*;
import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO;
import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO;
import com.epmet.dataaggre.dto.govorg.*;
import com.epmet.dataaggre.dto.govorg.form.*;
import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO;
import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO;
import com.epmet.dataaggre.dto.govorg.CustomerGridDTO;
import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO;
import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO;
import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO;
import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO;
import com.epmet.dataaggre.dto.govorg.form.SubOrgFormDTO;
import com.epmet.dataaggre.dto.govorg.result.*;
import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO;
import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity;
@ -48,6 +53,8 @@ public class GovOrgServiceImpl implements GovOrgService {
@Autowired
private CustomerStaffAgencyDao customerStaffAgencyDao;
@Autowired
private CustomerStaffDepartmentDao customerStaffDepartmentDao;
@Autowired
private CustomerGridDao customerGridDao;
@Autowired
private AreaCodeService areaCodeService;
@ -372,4 +379,105 @@ public class GovOrgServiceImpl implements GovOrgService {
return subAgencyList;
}
/**
* @Param formDTO
* @Description 通讯录组织/部门/网格下人员列表
* @author sun
*/
@Override
public OrgStaffListResultDTO staffList(OrgStaffListFormDTO formDTO) {
OrgStaffListResultDTO resultDTO = new OrgStaffListResultDTO();
//1.按类型查询组织、部门、网格下所有工作人员Id列表[需要按角色排序 所以这里不能分页]
List<String> staffIds = customerStaffAgencyDao.selectStaffList(formDTO.getOrgId(), formDTO.getOrgType());
if (org.springframework.util.CollectionUtils.isEmpty(staffIds)) {
return resultDTO;
}
formDTO.setStaffIds(staffIds);
//2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】
List<ListStaffResultDTO> staffList = epmetUserService.getStaffInfoList(formDTO);
//3.封装数据并返回
resultDTO.setStaffCount(staffIds.size());
resultDTO.setStaffList((null == staffList ? new ArrayList<>() : staffList));
return resultDTO;
}
/**
* @Param formDTO
* @Description 通讯录人员详情v2
* @author sun
*/
@Override
public StaffDetailV2FormDTO staffDetailV2(StaffDetailV2ResultDTO formDTO) {
//1.查询工作人员基本信息、角色信息
StaffDetailV2FormDTO result = epmetUserService.selectByStaffId(formDTO.getStaffId());
if (null == result) {
return new StaffDetailV2FormDTO();
}
//2.查询工作人员注册组织关系信息
List<String> staffIdList = new ArrayList<>();
staffIdList.add(formDTO.getStaffId());
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList);
if (null == list || list.size() < NumConstant.ONE) {
throw new RenException("未查询到工作人员注册组织信息");
}
//3.封装数据并返回
result.setOrgId(list.get(0).getOrgId());
result.setOrgName(list.get(0).getOrgName());
result.setOrgType(list.get(0).getOrgType());
return result;
}
/**
* @param formDTO
* @Description 下级组织/部门/网格列表
* @Param formDTO
* @Return {@link SubOrgResultDTO}
* @Author zhaoqifeng
* @Date 2021/8/19 15:12
*/
@Override
public SubOrgResultDTO getSubOrg(SubOrgFormDTO formDTO) {
//下级组织列表
List<OrgDTO> subAgencyList = customerStaffAgencyDao.selectSubAgency(formDTO.getAgencyId());
//下级部门列表
List<OrgDTO> departmentList = customerStaffDepartmentDao.selectDepartmentList(formDTO.getAgencyId());
//下级网格列表
List<OrgDTO> gridList = customerStaffGridDao.selectGridList(formDTO.getAgencyId());
SubOrgResultDTO result = new SubOrgResultDTO();
result.setSubAgencyList(subAgencyList);
result.setDepartmentList(departmentList);
result.setGridList(gridList);
return result;
}
/**
* @Description 批量查询工作人员注册组织信息
* @author sun
*/
@Override
public List<StaffOrgNameResultDTO> getStaffOrgName(List<String> staffIdList) {
List<StaffOrgNameResultDTO> resultList = customerAgencyDao.selelctStaffOrg(staffIdList);
return resultList;
}
@Override
public List<CustomerGridDTO> getStaffGridList(String staffId) {
return customerStaffAgencyDao.getStaffGridList(staffId);
}
@Override
public List<CustomerDepartmentDTO> getStaffDeptList(String staffId) {
return customerStaffDepartmentDao.getStaffDeptList(staffId);
}
@Override
public StaffOrgRelationResultDTO getStaffFromOrgType(String staffId) {
return customerAgencyDao.getStaffFromOrgType(staffId);
}
}

5
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml

@ -144,6 +144,11 @@ dynamic:
url: @datasource.druid.opercustomize.url@
username: @datasource.druid.opercustomize.username@
password: @datasource.druid.opercustomize.password@
epmetmessage:
driver-class-name: com.mysql.cj.jdbc.Driver
url: @datasource.druid.epmetmessage.url@
username: @datasource.druid.epmetmessage.username@
password: @datasource.druid.epmetmessage.password@
feign:
hystrix:
enabled: true

139
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoProfileDao.xml

@ -0,0 +1,139 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.epmetmessage.InfoProfileDao">
<resultMap id="MySentResDTOMap" type="com.epmet.dataaggre.dto.message.result.MySentResDTO">
<id property="infoId" column="id" />
<result property="content" column="content"/>
<result property="publishTime" column="CREATED_TIME"/>
<result property="totalReceiver" column="total_receiver"/>
<result property="readTotal" column="read_total"/>
<result property="firstAttId" column="first_att_id"/>
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" >
<result property="name" column="name"/>
<result property="url" column="url"/>
<result property="type" column="type"/>
<result property="format" column="format"/>
<result property="size" column="size"/>
<result property="duration" column="duration"/>
</collection>
</resultMap>
<!-- 我发出的消息列表-->
<select id="selectListMySent" parameterType="map" resultMap="MySentResDTOMap">
select
i.id,
ip.content,
i.CREATED_TIME,
ip.total_receiver,
ip.read_total,
ip.first_att_id,
ia.ATTACHMENT_NAME AS name,
ia.ATTACHMENT_FORMAT AS format,
ia.ATTACHMENT_TYPE AS type,
ia.ATTACHMENT_URL AS url,
(case when ip.first_att_id is null or ip.first_att_id='' then null
else ia.ATTACHMENT_SIZE
end) as size,
(case when ip.first_att_id is null or ip.first_att_id='' then null
else ia.duration
end) as duration
from info_profile ip
inner join info i
on(ip.INFO_ID=i.id)
left join info_att ia
on(ip.first_att_id=ia.id and ia.DEL_FLAG='0')
where ip.DEL_FLAG='0'
and i.DEL_FLAG='0'
and i.publish_staff_id=#{publishStaffId}
<if test="null != content and content !=''">
and i.content like concat('%',trim(#{content}),'%')
</if>
order by i.CREATED_TIME desc
</select>
<resultMap id="MyReceivedResDTOMap" type="com.epmet.dataaggre.dto.message.result.MyReceivedResDTO">
<id property="infoId" column="INFO_ID" />
<result property="content" column="content"/>
<result property="publishTime" column="CREATED_TIME"/>
<result property="firstAttId" column="first_att_id"/>
<result property="readFlag" column="READ_FLAG"/>
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" >
<result property="name" column="name"/>
<result property="url" column="url"/>
<result property="type" column="type"/>
<result property="format" column="format"/>
<result property="size" column="size"/>
<result property="duration" column="duration"/>
</collection>
</resultMap>
<select id="selectListMyReceived" parameterType="map" resultMap="MyReceivedResDTOMap">
SELECT
ir.INFO_ID,
ip.content,
ii.CREATED_TIME,
ir.READ_FLAG,
ip.first_att_id,
ia.ATTACHMENT_NAME AS name,
ia.ATTACHMENT_FORMAT AS format,
ia.ATTACHMENT_TYPE AS type,
ia.ATTACHMENT_URL AS url,
(case when ip.first_att_id is null or ip.first_att_id='' then null
else ia.ATTACHMENT_SIZE
end) as size,
(case when ip.first_att_id is null or ip.first_att_id='' then null
else ia.duration
end) as duration
FROM
info_receivers ir
INNER JOIN info ii ON ( ir.INFO_ID = ii.ID )
INNER JOIN info_profile ip ON ( ii.ID = ip.INFO_ID AND ip.DEL_FLAG = '0' )
LEFT JOIN info_att ia on ( ip.first_att_id = ia.id AND ia.DEL_FLAG = '0' )
WHERE
ir.DEL_FLAG = '0'
AND ii.DEL_FLAG = '0'
AND ir.STAFF_ID = #{userId}
<if test="null != content and content !=''">
and ii.content like concat('%',trim(#{content}),'%')
</if>
ORDER BY
ii.CREATED_TIME DESC
</select>
<select id="selectInfoDetail" parameterType="java.lang.String" resultType="com.epmet.dataaggre.dto.message.result.InfoDetailResDTO">
select
ii.id as infoId,
ii.publish_staff_id as publishStaffId,
ii.content,
ii.CREATED_TIME as publishTime,
ip.total_receiver as totalReceiver,
ip.read_total as readTotal,
ip.total_receiver-ip.read_total as unReadCount,
(
select ir.STAFF_ID from info_receivers ir
where ir.INFO_ID=#{infoId}
and ir.DEL_FLAG='0'
order by ir.id asc limit 1
) as firstReceiverStaffId,
ip.UN_READ_REPLY_NUM as unReadReplyNum
from info ii
inner join info_profile ip
on(ii.id=ip.INFO_ID)
where ii.DEL_FLAG='0'
and ii.ID=#{infoId}
</select>
<select id="selectInfoAtt" parameterType="java.lang.String" resultType="com.epmet.commons.tools.dto.form.FileCommonDTO">
select
ia.ATTACHMENT_NAME AS name,
ia.ATTACHMENT_FORMAT AS format,
ia.ATTACHMENT_TYPE AS type,
ia.ATTACHMENT_URL AS url,
ia.ATTACHMENT_SIZE as size,
ia.duration
from info_att ia
where ia.info_id=#{infoId}
and ia.DEL_FLAG = '0'
order by ia.sort asc
</select>
</mapper>

136
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetmessage/InfoReceiversDao.xml

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao">
<resultMap id="MyInfoGroupResultDTOMap" type="com.epmet.dataaggre.dto.message.result.MyInfoGroupResultDTO">
<id property="receiverGroupId" column="receiverGroupId" />
<result property="name" column="name"/>
<result property="totalMem" column="totalMem"/>
<collection property="staffIdList" ofType="java.lang.String">
<result column="staffId"/>
</collection>
</resultMap>
<!-- 我创建的群组列表 -->
<select id="selectMyGroupList" parameterType="map" resultMap="MyInfoGroupResultDTOMap">
SELECT
irg.ID as receiverGroupId,
irg.`NAME` as name,
( SELECT count( igr.id ) FROM info_group_receivers igr WHERE igr.DEL_FLAG = '0' AND igr.info_receiver_group_id = irg.id ) AS totalMem,
igr.STAFF_ID as staffId
FROM
info_receiver_group irg
left join info_group_receivers igr
on(irg.id=igr.info_receiver_group_id and igr.DEL_FLAG='0')
WHERE
AND irg.CREATE_STAFF_ID = #{staffId}
AND irg.CUSTOMER_ID = #{customerId}
<if test="null != receiverGroupId and receiverGroupId !=''">
and irg.id=#{receiverGroupId}
</if>
order by irg.CREATED_TIME asc,igr.id asc
</select>
<!-- 我创建的组内所有的人 -->
<select id="selectDistinctStaffIds" parameterType="map" resultType="java.lang.String">
SELECT DISTINCT
igr.STAFF_ID
FROM
info_group_receivers igr
LEFT JOIN info_receiver_group irg ON ( igr.info_receiver_group_id = irg.id )
WHERE
igr.DEL_FLAG = '0'
AND igr.CUSTOMER_ID = #{customerId}
AND irg.DEL_FLAG = '0'
AND irg.CUSTOMER_ID = #{customerId}
AND irg.CREATE_STAFF_ID = #{staffId}
<if test="null != receiverGroupId and receiverGroupId !=''">
AND irg.id =#{receiverGroupId}
</if>
order by igr.id asc
</select>
<!-- 根据小组id,查询群组基本信息 -->
<select id="selectGroupInfo" parameterType="java.lang.String" resultType="com.epmet.dataaggre.dto.message.result.InfoGroupDetailResDTO">
SELECT
irg.ID as receiverGroupId,
irg.`NAME` as name
FROM
info_receiver_group irg
where irg.id=#{receiverGroupId}
and irg.DEL_FLAG = '0'
</select>
<resultMap id="InfoReplyDetailMap" type="com.epmet.dataaggre.dto.message.result.InfoReplyDetail">
<id property="replyId" column="id" />
<result property="replyTime" column="CREATED_TIME"/>
<result property="staffId" column="FROM_USER_ID"/>
<result property="content" column="content"></result>
<collection property="attachmentList" ofType="com.epmet.commons.tools.dto.form.FileCommonDTO" column="id" select="com.epmet.dataaggre.dao.epmetmessage.InfoReceiversDao.selectReplyAtt"/>
</resultMap>
<!-- 分页查询消息的回复列表 -->
<select id="selectListReply" parameterType="java.lang.String" resultMap="InfoReplyDetailMap">
SELECT
ir.id,
ir.CREATED_TIME,
ir.FROM_USER_ID,
( SELECT IFNULL( ipc.CONTENT, '' ) FROM info_reply_content ipc WHERE ipc.REPLY_TYPE = 'text' AND ipc.INFO_REPLY_ID = ir.id and ipc.DEL_FLAG='0') AS content
FROM
info_reply ir
WHERE
ir.DEL_FLAG = '0'
AND ir.INFO_ID = #{infoId}
ORDER BY
ir.CREATED_TIME DESC,
ir.id DESC
</select>
<select id="selectReplyAtt" parameterType="java.lang.String" resultType="com.epmet.commons.tools.dto.form.FileCommonDTO">
SELECT
m.ATTACHMENT_NAME as name,
(
case when m.ATTACHMENT_NAME is null or m.ATTACHMENT_NAME='' then null
else m.ATTACHMENT_SIZE
end
) as size,
M.ATTACHMENT_FORMAT as format,
M.REPLY_TYPE as `type`,
m.CONTENT as url,
(
case when m.ATTACHMENT_NAME is null or m.ATTACHMENT_NAME='' then null
else m.DURATION
end
)as duration
FROM
info_reply_content m
WHERE
m.DEL_FLAG = '0'
AND m.INFO_REPLY_ID = ''
AND m.REPLY_TYPE != 'text'
ORDER BY
m.SORT ASC
</select>
<!-- 查询我收到的未读的消息数量 -->
<select id="selectUnReadCount" resultType="java.lang.Integer">
SELECT
IFNULL(COUNT(INFO_ID),0)
FROM info_receivers
WHERE
DEL_FLAG = '0'
AND STAFF_ID = #{userId}
AND READ_FLAG = 0
</select>
<!-- 我发出的,新回复数量 -->
<select id="selectNewReplyCount" resultType="java.lang.Integer">
SELECT
IFNULL(SUM(UN_READ_REPLY_NUM) ,0)
FROM info_profile
WHERE
DEL_FLAG = '0'
AND CREATED_BY = #{userId}
</select>
</mapper>

89
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/CustomerStaffDao.xml

@ -31,4 +31,93 @@
</if>
</select>
<resultMap id="staffList" type="com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO">
<result property="staffId" column="user_id"/>
<result property="name" column="real_name"/>
<result property="gender" column="gender"/>
<result property="headPhoto" column="head_photo"/>
<result property="mobile" column="mobile"/>
<result property="enableFlag" column="enable_flag"/>
<association property="roles" column="user_id" select="com.epmet.dataaggre.dao.epmetuser.StaffRoleDao.selectByStaffId"/>
</resultMap>
<select id="selectByRealName" resultMap="staffList">
SELECT
*
FROM
customer_staff
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND real_name LIKE CONCAT('%', #{realName}, '%')
</select>
<select id="selectStaffList" resultMap="staffList">
SELECT
*
FROM
customer_staff
WHERE
del_flag = '0'
AND user_id IN (
<!-- 按人员Id列表查询,先查询每个人有的角色,然后把有单位领导角色的人排在前边,其他的在按创建时间降序 -->
SELECT
t.staff_id
FROM (
<!-- 里边的sql,尽管有去重,一个人有多个角色时,在里边sql查询出来的是一个人两条数据,is_first一个是0一个是1,所以外层需要在按人分组 -->
SELECT DISTINCT<!-- 没有这个去重会改变最终的结果顺序,至于为什么还不清楚 -->
sr.staff_id,
case when gsr.role_key =
<choose>
<when test="orgType != null and orgType == 'agency' ">
'agency_leader'
</when>
<when test="orgType != null and orgType == 'dept' ">
'dept_leader'
</when>
<otherwise>
'grid_manager'
</otherwise>
</choose>
then 1 else 0 end is_first<!-- 有单位领导角色的人赋值为1,没有的赋值为0 -->
FROM staff_role sr
INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id AND gsr.customer_id = #{customerId}
WHERE
sr.del_flag = '0'
AND sr.staff_id IN
(
<foreach collection="staffIds" item="staffId" separator=",">
#{staffId}
</foreach>
)
ORDER BY
gsr.role_key <![CDATA[<>]]>
<choose>
<when test="orgType != null and orgType == 'agency' ">
'agency_leader'
</when>
<when test="orgType != null and orgType == 'dept' ">
'dept_leader'
</when>
<otherwise>
'grid_manager'
</otherwise>
</choose>
, sr.created_time DESC<!-- 标注有点位领导角色的人不参与排序也就是默认拍在前边 -->
) t
GROUP BY t.staff_id
ORDER BY t.is_first <![CDATA[<>]]> 1
LIMIT #{pageNo}, #{pageSize}
)
</select>
<select id="selectByStaffId" resultType="com.epmet.dataaggre.dto.epmetuser.CustomerStaffDTO">
SELECT
*
FROM
customer_staff
WHERE
del_flag = '0'
AND USER_ID = #{staffId}
</select>
</mapper>

16
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/GovStaffRoleDao.xml

@ -3,4 +3,18 @@
<mapper namespace="com.epmet.dataaggre.dao.epmetuser.GovStaffRoleDao">
</mapper>
<select id="getStaffRoleList" resultType="com.epmet.dto.result.StaffRoleResultDTO">
SELECT
DISTINCT
gsr.ROLE_KEY,
sr.ORG_ID,
sr.CUSTOMER_ID,
gsr.ROLE_NAME,
sr.STAFF_ID
FROM staff_role sr
LEFT JOIN gov_staff_role gsr ON gsr.ID = sr.ROLE_ID AND gsr.DEL_FLAG = 0
WHERE sr.DEL_FLAG = 0
AND sr.STAFF_ID = #{staffId}
</select>
</mapper>

23
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StaffRoleDao.xml

@ -46,4 +46,27 @@
</if>
</select>
<select id="selectByStaffId" resultType="java.lang.String">
SELECT
gsr.role_name
FROM
staff_role sr
INNER JOIN gov_staff_role gsr ON sr.role_id = gsr.id
WHERE
sr.staff_id = #{staffId}
ORDER BY
gsr.sort ASC
</select>
<select id="getRoleCountList" resultType="com.epmet.dataaggre.dto.epmetuser.result.RoleListResultDTO">
SELECT
ROLE_ID,
count( STAFF_ID ) AS staffNum
FROM
staff_role
WHERE
CUSTOMER_ID = #{customerId}
GROUP BY
ROLE_ID
</select>
</mapper>

90
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml

@ -62,4 +62,92 @@
created_time DESC
</select>
</mapper>
<select id="selelctStaffOrg" resultType="com.epmet.dataaggre.dto.govorg.result.StaffOrgNameResultDTO">
SELECT
ca.id agencyId,
sor.staff_id staffId,
IF(
ca.pid = '0',
ca.organization_name,
CONCAT(
(select organization_name from customer_agency where id = ca.pid),
'-',
ca.organization_name
)
)orgName,
sor.org_id orgId,
'agency' orgType
FROM
staff_org_relation sor
INNER JOIN customer_agency ca ON sor.org_id = ca.id
WHERE
sor.org_type = 'agency'
<if test="staffIdList != null and staffIdList.size() > 0">
sor.staff_id IN (
<foreach collection="staffIdList" item="staffId" separator=",">
#{staffId}
</foreach>
)
</if>
UNION
SELECT
ca.ID agencyId,
sor.staff_id staffId,
IF(
ca.pid = '0',
cd.department_name,
CONCAT(
ca.organization_name,
'-',
cd.department_name
)
)orgName,
sor.org_id orgId,
'dept' orgType
FROM
staff_org_relation sor
INNER JOIN customer_department cd ON sor.org_id = cd.id
INNER JOIN customer_agency ca ON cd.agency_id = ca.id
WHERE
sor.org_type = 'dept'
<if test="staffIdList != null and staffIdList.size() > 0">
sor.staff_id IN (
<foreach collection="staffIdList" item="staffId" separator=",">
#{staffId}
</foreach>
)
</if>
UNION
SELECT
ca.ID agencyId,
sor.staff_id staffId,
IF(
ca.pid = '0',
cg.grid_name,
CONCAT(
ca.organization_name,
'-',
cg.grid_name
)
)orgName,
sor.org_id orgId,
'grid' orgType
FROM
staff_org_relation sor
INNER JOIN customer_grid cg ON sor.org_id = cg.id
INNER JOIN customer_agency ca ON cg.pid = ca.id
WHERE
sor.org_type = 'grid'
<if test="staffIdList != null and staffIdList.size() > 0">
sor.staff_id IN (
<foreach collection="staffIdList" item="staffId" separator=",">
#{staffId}
</foreach>
)
</if>
</select>
<select id="getStaffFromOrgType" resultType="com.epmet.dataaggre.dto.govorg.result.StaffOrgRelationResultDTO">
SELECT STAFF_ID,ORG_ID,ORG_TYPE FROM staff_org_relation WHERE del_flag = '0' AND staff_id = #{staffId}
</select>
</mapper>

83
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml

@ -33,8 +33,87 @@
WHERE
csa.del_flag = '0'
AND ca.del_flag = '0'
AND csa.customer_id = #{customerId}
<if test="customerId != null and customerId != ''">
AND csa.customer_id = #{customerId}
</if>
AND csa.user_id = #{staffId}
</select>
<select id="getStaffGridList" resultType="com.epmet.dataaggre.dto.govorg.CustomerGridDTO">
SELECT
g.ID,
g.GRID_NAME
FROM
customer_staff_grid sg
INNER JOIN customer_grid g ON ( sg.GRID_ID = g.ID )
WHERE
sg.DEL_FLAG = '0'
AND g.DEL_FLAG = '0'
AND sg.USER_ID = #{staffId}
</select>
</mapper>
<select id="selectStaffList" resultType="java.lang.String">
<choose>
<when test="orgType != null and orgType == 'dept' ">
SELECT
user_id
FROM
customer_staff_department
WHERE
del_flag = '0'
AND department_id = #{orgId}
ORDER BY
created_time ASC
</when>
<when test="orgType != null and orgType == 'grid' ">
SELECT
user_id
FROM
customer_staff_grid
WHERE
del_flag = '0'
AND grid_id = #{orgId}
ORDER BY
created_time ASC
</when>
<otherwise>
SELECT
user_id
FROM
customer_staff_agency
WHERE
del_flag = '0'
AND agency_id = #{orgId}
ORDER BY
created_time ASC
</otherwise>
</choose>
</select>
<select id="selectSubAgency" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
ca.ID AS orgId,
ca.ORGANIZATION_NAME AS orgName,
"agency" AS orgType,
count( csa.USER_ID ) AS staffNum
FROM
customer_agency ca
LEFT JOIN (
SELECT
a.PIDS,
b.USER_ID
FROM
customer_agency a
INNER JOIN customer_staff_agency b ON b.AGENCY_ID = a.ID
AND b.DEL_FLAG = '0'
WHERE
a.DEL_FLAG = '0'
) csa ON csa.PIDS LIKE CONCAT( '%', ca.ID, '%' )
WHERE
ca.DEL_FLAG = '0'
AND ca.PID = #{agencyId}
GROUP BY
ca.ID
ORDER BY ca.CREATED_TIME ASC
</select>
</mapper>

33
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffDepartmentDao.xml

@ -2,4 +2,35 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dataaggre.dao.govorg.CustomerStaffDepartmentDao">
</mapper>
<select id="getStaffDeptList" resultType="com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO">
SELECT
g.ID,
g.DEPARTMENT_NAME
FROM
customer_staff_department sg
INNER JOIN customer_department g ON ( sg.DEPARTMENT_ID = g.ID )
WHERE
sg.DEL_FLAG = '0'
AND g.DEL_FLAG = '0'
AND sg.USER_ID = #{staffId}
</select>
<select id="selectDepartmentList" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
cd.ID AS orgId,
cd.DEPARTMENT_NAME AS orgName,
"dept" AS orgType,
count( csd.USER_ID ) AS staffNum
FROM
customer_department cd
LEFT JOIN customer_staff_department csd ON cd.ID = csd.DEPARTMENT_ID
AND csd.DEL_FLAG = '0'
WHERE
cd.DEL_FLAG = '0'
AND cd.AGENCY_ID = #{agencyId}
GROUP BY
cd.ID
ORDER BY
cd.CREATED_TIME ASC
</select>
</mapper>

17
epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffGridDao.xml

@ -35,4 +35,21 @@
AND ca.id = #{agencyId}
</select>
<select id="selectGridList" resultType="com.epmet.dataaggre.dto.govorg.OrgDTO">
SELECT
cg.ID AS orgId,
cg.GRID_NAME AS orgName,
"grid" AS orgType,
count( csg.USER_ID ) AS staffNum
FROM
customer_grid cg
LEFT JOIN customer_staff_grid csg ON cg.ID = csg.GRID_ID
AND csg.DEL_FLAG = '0'
WHERE
cg.DEL_FLAG = 0
AND cg.PID = #{agencyId}
GROUP BY
cg.ID
ORDER BY cg.CREATED_TIME ASC
</select>
</mapper>

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java

@ -1,8 +1,8 @@
package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.enums.OrgTypeEnum;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.eum.OrgTypeEnum;
import com.epmet.datareport.service.evaluationindex.screen.IndexService;
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;

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

@ -2,6 +2,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.redis.common.CustomerStaffRedis;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
@ -10,7 +11,6 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.CustomerAgencyUserRoleDTO;
import com.epmet.dto.form.CustomerAgencyUserRoleFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.ColorProjectTotalFormDTO;
@ -117,14 +117,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
CustomerAgencyUserRoleFormDTO userRoleFormDTO = new CustomerAgencyUserRoleFormDTO();
userRoleFormDTO.setCustomerId(formDTO.getCustomerId());
userRoleFormDTO.setStaffId(item.getReportUserId());
Result<CustomerAgencyUserRoleDTO> userRoles = userOpenFeignClient.getUserRoles(userRoleFormDTO);
if (userRoles != null && userRoles.success() && userRoles.getData() != null){
Map<String,String> roles = userRoles.getData().getRoles();
if (!CollectionUtils.isEmpty(roles)){
item.setReportUserRoleSet(roles.keySet());
}
Map<String, String> staffRoleMap = CustomerStaffRedis.getStaffRoleMap(formDTO.getCustomerId(), item.getReportUserId());
if (!CollectionUtils.isEmpty(staffRoleMap)){
item.setReportUserRoleSet(staffRoleMap.keySet());
}
}

52
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/AddReceiverGroupFormDTO.java

@ -0,0 +1,52 @@
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;
import java.util.Set;
/**
* @Description 发送消息-新增群组
* @Author yinzuomei
* @Date 2021/8/20 9:39 上午
*/
@Data
public class AddReceiverGroupFormDTO implements Serializable {
private static final long serialVersionUID = 6221853016790893895L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
@NotBlank(message = "名称不能为空",groups = AddUserShowGroup.class)
@Length(min = 1,max = 20,groups = AddUserShowGroup.class,message = "名称最多输入20个字")
private String name;
/**
* 单独选择的人的userId集合
*/
private Set<String> staffIdList;
/**
* 按架构选择的组织或者网格或者部门的集合
*/
private Set<OrgCommonDTO> orgList;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

17
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/OrgCommonDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 从架构通用dto
* @Author yinzuomei
* @Date 2021/8/19 10:00 上午
*/
@Data
public class OrgCommonDTO implements Serializable {
private String orgId;
private String orgType;
}

36
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadInfoFormDTO.java

@ -0,0 +1,36 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 我收到的列表有红点的点击消息调用此接口
* @Author yinzuomei
* @Date 2021/8/19 4:58 下午
*/
@Data
public class ReadInfoFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
@NotBlank(message = "infoId不能为空",groups = AddUserInternalGroup.class)
private String infoId;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

37
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReadReplyFormDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Description 我发出的发布人点击详情后阅读回复将未读回复数置为0
* @Author yinzuomei
* @Date 2021/8/19 5:49 下午
*/
@Data
public class ReadReplyFormDTO implements Serializable {
private static final long serialVersionUID = 1315143292245373474L;
public interface AddUserInternalGroup {
}
@NotBlank(message = "infoId不能为空", groups = AddUserInternalGroup.class)
private String infoId;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空", groups = AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class)
private String customerId;
}

43
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ReplyInfoFormDTO.java

@ -0,0 +1,43 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @Description 回复消息
* @Author yinzuomei
* @Date 2021/8/19 5:18 下午
*/
@Data
public class ReplyInfoFormDTO implements Serializable {
public interface AddUserInternalGroup {
}
@NotBlank(message = "infoId不能为空",groups = ReadInfoFormDTO.AddUserInternalGroup.class)
private String infoId;
private String content;
/**
* 附件列表
*/
private List<FileCommonDTO> attachmentList;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups = ReadInfoFormDTO.AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = ReadInfoFormDTO.AddUserInternalGroup.class)
private String customerId;
}

69
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/SendInfoFormDTO.java

@ -0,0 +1,69 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.dto.form.FileCommonDTO;
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;
import java.util.List;
import java.util.Set;
/**
* @Description 发送消息入参DTO
* @Author yinzuomei
* @Date 2021/8/19 9:52 上午
*/
@Data
public class SendInfoFormDTO implements Serializable {
private static final long serialVersionUID = -3668230349576949684L;
public interface AddUserInternalGroup {
}
public interface AddUserShowGroup extends CustomerClientShowGroup {
}
/**
* 消息内容不能超过100不可为空
*/
@NotBlank(message = "消息内容不能为空",groups = AddUserShowGroup.class)
@Length(min = 1, max = 1000, message = "消息内容最多输入1000字", groups = AddUserShowGroup.class)
private String content;
/**
* 单独选择的人的userId集合
*/
private Set<String> staffIdList;
/**
* 按架构选择的组织或者网格或者部门的集合
*/
private Set<OrgCommonDTO> orgList;
/**
* 按职责选择时角色的id集合
*/
private Set<String> roleIdList;
/**
* 按群组选择时群组的id集合
*/
private Set<String> groupIdList;
/**
* 附件列表
*/
private List<FileCommonDTO> attachmentList;
//以下参数从token中获取
/**
* 当前用户id
*/
@NotBlank(message = "userId不能为空",groups =AddUserInternalGroup.class)
private String userId;
/**
* 当前客户id
*/
@NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class)
private String customerId;
}

17
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/AddReceiverGroupResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 添加小组返参
* @Author yinzuomei
* @Date 2021/8/20 9:56 上午
*/
@Data
public class AddReceiverGroupResultDTO implements Serializable {
private static final long serialVersionUID = 4729777797252376046L;
private String receiverGroupId;
}

17
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/ReplyInfoResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 回复消息返参
* @Author yinzuomei
* @Date 2021/8/20 9:51 上午
*/
@Data
public class ReplyInfoResultDTO implements Serializable {
private static final long serialVersionUID = -634463925415755405L;
private String replyId;
}

17
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/SendInfoResultDTO.java

@ -0,0 +1,17 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @Description 发送消息返参DTO
* @Author yinzuomei
* @Date 2021/8/19 10:20 上午
*/
@Data
public class SendInfoResultDTO implements Serializable {
private static final long serialVersionUID = 3339252317982375852L;
private String infoId;
}

4
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/constant/UserMessageConstans.java

@ -18,4 +18,8 @@ public interface UserMessageConstans {
*/
String APP = "app";
String INFO_TITLE="您有一条新消息";
String MESSAGE_TYPE_INFO="info";
String INFO_CONTENT_TEMP="您有一条【%s】的新消息,请您查看";
}

153
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/controller/InfoController.java

@ -0,0 +1,153 @@
/**
* 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.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.*;
import com.epmet.dto.result.AddReceiverGroupResultDTO;
import com.epmet.dto.result.ReplyInfoResultDTO;
import com.epmet.dto.result.SendInfoResultDTO;
import com.epmet.service.InfoService;
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;
/**
* 消息主表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@RestController
@RequestMapping("info")
public class InfoController {
@Autowired
private InfoService infoService;
/**
* 发送消息
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<SendInfoResultDTO>
* @author yinzuomei
* @date 2021/8/19 10:25 上午
*/
@PostMapping("send")
public Result<SendInfoResultDTO> sendInfo(@LoginUser TokenDto tokenDto, @RequestBody SendInfoFormDTO formDTO) {
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO, SendInfoFormDTO.AddUserShowGroup.class, SendInfoFormDTO.AddUserInternalGroup.class);
return new Result<SendInfoResultDTO>().ok(infoService.sendInfo(formDTO));
}
/**
* 发送消息我收到的-阅读消息
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/19 5:03 下午
*/
@PostMapping("read-info")
public Result readInfo(@LoginUser TokenDto tokenDto,@RequestBody ReadInfoFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ReadInfoFormDTO.AddUserInternalGroup.class);
infoService.readInfo(formDTO);
return new Result();
}
/**
* 回复消息目前需求是发布人不可以回复
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/19 5:29 下午
*/
@PostMapping("reply-info")
public Result<ReplyInfoResultDTO> replyInfo(@LoginUser TokenDto tokenDto, @RequestBody ReplyInfoFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ReplyInfoFormDTO.AddUserInternalGroup.class);
return new Result<ReplyInfoResultDTO>().ok(infoService.replyInfo(formDTO));
}
/**
* 我发出的发布人点击详情后阅读回复将未读回复数置为0
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author yinzuomei
* @date 2021/8/19 5:51 下午
*/
@PostMapping("read-reply")
public Result readInfoReply(@LoginUser TokenDto tokenDto,@RequestBody ReadReplyFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,ReadReplyFormDTO.AddUserInternalGroup.class);
infoService.readInfoReply(formDTO);
return new Result();
}
/**
* 添加群组
*
* @param tokenDto
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<AddReceiverGroupResultDTO>
* @author yinzuomei
* @date 2021/8/20 9:58 上午
*/
@PostMapping("add-receivergroup")
public Result<AddReceiverGroupResultDTO> addReceiverGroup(@LoginUser TokenDto tokenDto, @RequestBody AddReceiverGroupFormDTO formDTO){
formDTO.setCustomerId(tokenDto.getCustomerId());
formDTO.setUserId(tokenDto.getUserId());
ValidatorUtils.validateEntity(formDTO,AddReceiverGroupFormDTO.AddUserShowGroup.class,AddReceiverGroupFormDTO.AddUserInternalGroup.class);
return new Result<AddReceiverGroupResultDTO>().ok(infoService.addReceiverGroup(formDTO));
}
}

32
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/GovStaffRoleRedis.java → epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoAttDao.java

@ -15,33 +15,19 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
package com.epmet.dao;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.InfoAttEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 政府端角色
* 消息的附件
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-04-22
* @since v1.0.0 2021-08-18
*/
@Component
public class GovStaffRoleRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
@Mapper
public interface InfoAttDao extends BaseDao<InfoAttEntity> {
}

33
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoDao.java

@ -0,0 +1,33 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.InfoEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 消息主表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@Mapper
public interface InfoDao extends BaseDao<InfoEntity> {
}

44
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoGroupReceiversDao.java

@ -0,0 +1,44 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.InfoGroupReceiversEntity;
import org.apache.ibatis.annotations.Mapper;
import java.util.Set;
/**
* 消息-群组成员关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@Mapper
public interface InfoGroupReceiversDao extends BaseDao<InfoGroupReceiversEntity> {
/**
* 群组里面的工作人员去重
*
* @param groupIdList
* @return java.util.Set<java.lang.String>
* @author yinzuomei
* @date 2021/8/19 10:51 上午
*/
Set<String> selectStaffIds(Set<String> groupIdList);
}

31
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/RoleRedis.java → epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoProfileDao.java

@ -15,33 +15,22 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
package com.epmet.dao;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.InfoProfileEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 角色表
* 消息概要表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30
* @since v1.0.0 2021-08-18
*/
@Component
public class RoleRedis {
@Autowired
private RedisUtils redisUtils;
@Mapper
public interface InfoProfileDao extends BaseDao<InfoProfileEntity> {
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
int addReadTotal(String infoId);
InfoProfileEntity selectByInfoId(String infoId);
}

32
epmet-user/epmet-user-server/src/main/java/com/epmet/redis/UserRoleRedis.java → epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoReceiverGroupDao.java

@ -15,33 +15,21 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
package com.epmet.dao;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.InfoReceiverGroupEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 用户角色关系表
* 消息-群组表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-03-30
* @since v1.0.0 2021-08-18
*/
@Component
public class UserRoleRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
@Mapper
public interface InfoReceiverGroupDao extends BaseDao<InfoReceiverGroupEntity> {
int selectCountName(@Param("name") String name, @Param("customerId")String customerId, @Param("userId")String userId);
}

44
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/dao/InfoReceiversDao.java

@ -0,0 +1,44 @@
/**
* 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.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.InfoReceiversEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* 消息接收人记录表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-08-18
*/
@Mapper
public interface InfoReceiversDao extends BaseDao<InfoReceiversEntity> {
/**
* 消息的某一个接收人记录
*
* @param infoId
* @param userId
* @return com.epmet.entity.InfoReceiversEntity
* @author yinzuomei
* @date 2021/8/19 5:11 下午
*/
InfoReceiversEntity selectInfoReceiver(@Param("infoId")String infoId, @Param("userId")String userId);
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save