Browse Source

Merge remote-tracking branch 'origin/dev_data_stats' into dev_data_stats

master
wangchao 5 years ago
parent
commit
102f09e2b6
  1. 2
      epmet-auth/deploy/docker-compose-dev.yml
  2. 2
      epmet-auth/deploy/docker-compose-test.yml
  3. 2
      epmet-auth/pom.xml
  4. 20
      epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java
  5. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java
  6. 33
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java
  7. 29
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/filter/LogMsgSendFilter.java
  8. 185
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java
  9. 25
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimDepartmentDTO.java
  10. 29
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserAgencyInfoResultDTO.java
  11. 62
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagUsedAgencyDTO.java
  12. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDTO.java
  13. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
  14. 2
      epmet-module/data-report/data-report-server/pom.xml
  15. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java
  16. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java
  17. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java
  18. 40
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java
  19. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java
  20. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java
  21. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java
  22. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java
  23. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java
  24. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java
  25. 14
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java
  26. 27
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java
  27. 1
      epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml
  28. 27
      epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml
  29. 2
      epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml
  30. 12
      epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml
  31. 2
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
  32. 2
      epmet-module/data-statistical/data-statistical-server/pom.xml
  33. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  34. 8
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java
  35. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java
  36. 32
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java
  37. 66
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java
  38. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml
  39. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml
  40. 2
      epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml
  41. 2
      epmet-module/epmet-job/epmet-job-server/pom.xml
  42. 2
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml
  43. 2
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml
  44. 2
      epmet-module/epmet-message/epmet-message-server/pom.xml
  45. 2
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java
  46. 2
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java
  47. 2
      epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml
  48. 2
      epmet-module/gov-issue/gov-issue-server/pom.xml
  49. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java
  50. 6
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java
  51. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java
  52. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueExcel.java
  53. 11
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  54. 2
      epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/epmet_gov_issue.sql
  55. 2
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml
  56. 2
      epmet-module/gov-project/gov-project-server/pom.xml
  57. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  58. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  59. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  60. 18
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  61. 2
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/IssueDTO.java
  62. 2
      epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml
  63. 12
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovStaffRoleFormDTO.java
  64. 14
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  65. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  66. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  67. 2
      epmet-user/epmet-user-server/pom.xml
  68. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java
  69. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java
  70. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java
  71. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java
  72. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java
  73. 9
      epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml

2
epmet-auth/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.25
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:0.3.26
ports:
- "8081:8081"
network_mode: host # 使用现有网络

2
epmet-auth/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-auth-server:
container_name: epmet-auth-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.21
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:0.3.22
ports:
- "8081:8081"
network_mode: host # 使用现有网络

2
epmet-auth/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.25</version>
<version>0.3.26</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-cloud</artifactId>

20
epmet-auth/src/main/java/com/epmet/service/impl/GovLoginServiceImpl.java

@ -22,6 +22,7 @@ import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgFeignClient;
import com.epmet.jwt.JwtTokenProperties;
import com.epmet.jwt.JwtTokenUtils;
@ -62,6 +63,8 @@ public class GovLoginServiceImpl implements GovLoginService {
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient;
@Autowired
private EpmetUserOpenFeignClient userOpenFeignClient;
/**
* @param formDTO
@ -297,7 +300,22 @@ public class GovLoginServiceImpl implements GovLoginService {
if (userDetails == null) {
return;
}
List<GovTokenDto.Role> roles = queryGovStaffRoles(staffId, orgId);
GovStaffRoleFormDTO form = new GovStaffRoleFormDTO();
form.setRoleIdList(roleIds);
Result<List<GovStaffRoleResultDTO>> result = userOpenFeignClient.getByIds(form);
if (!result.success()) {
throw new RenException("更新缓存中的角色列表失败:" + result.getInternalMsg());
}
List<GovTokenDto.Role> roles = result.getData().stream().map(roleDto -> {
GovTokenDto.Role role = new GovTokenDto.Role();
role.setRoleName(roleDto.getRoleName());
role.setRoleKey(roleDto.getRoleKey());
role.setId(roleDto.getRoleId());
return role;
}).collect(Collectors.toList());
userDetails.setRoleList(roles);
cpUserDetailRedis.set(userDetails, jwtTokenProperties.getExpire());
}

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

@ -127,4 +127,8 @@ public interface Constant {
*/
String UNREAD = "unread";
/**
* 创建时间字段名
*/
String CREATED_TIME = "created_time";
}

33
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java

@ -1,25 +1,32 @@
package com.epmet.commons.tools.dto.form;
import com.alibaba.fastjson.JSON;
import lombok.Data;
import org.springframework.util.CollectionUtils;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* desc: 钉钉文本消息参数 实体类
* date: 2019/2/20 11:00
*
* @date: 2020/6/29 9:06
* @author: jianjun liu
* email:liujianjun@yunzongnet.com
* email:liujianjun@git.elinkit.com.cn
*/
public class DingTalkTextMsg {
public class DingTalkTextMsg implements Serializable {
private static final long serialVersionUID = -3611771312188821915L;
/**
* 消息接收者
*/
private String receiver;
private String webHook;
/**
* 密钥
*/
private String secret;
/**
* 发送内容
*/
@ -35,12 +42,12 @@ public class DingTalkTextMsg {
*/
private boolean isAtAll;
public String getReceiver() {
return receiver;
public String getWebHook() {
return webHook;
}
public void setReceiver(String receiver) {
this.receiver = receiver;
public void setWebHook(String webHook) {
this.webHook = webHook;
}
public String getContent() {
@ -67,6 +74,14 @@ public class DingTalkTextMsg {
isAtAll = atAll;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public String getMsgContent() {
Map<String, Object> items = new HashMap<>();
items.put("msgtype", "text");

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

@ -6,8 +6,9 @@ import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.classic.spi.IThrowableProxy;
import ch.qos.logback.classic.spi.StackTraceElementProxy;
import ch.qos.logback.core.spi.FilterReply;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.dto.form.DingTalkTextMsg;
import com.epmet.commons.tools.utils.DingdingMsgSender;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -21,6 +22,10 @@ import java.text.SimpleDateFormat;
*/
public class LogMsgSendFilter extends LevelFilter {
private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class);
private DingdingMsgSender msgSender = new DingdingMsgSender();
private String webHook;
private String secret;
@Override
public FilterReply decide(ILoggingEvent event) {
//如果日志级别等于设置的日志级别 则发送消息
@ -43,9 +48,16 @@ public class LogMsgSendFilter extends LevelFilter {
IThrowableProxy throwableProxy = event.getThrowableProxy();
//异常信息处理 暂时处理一级的5行数据
apendStackInfo(stringBuilder, throwableProxy);
Result<String> flag = HttpClientManager.getInstance().sendAlarmMsg(stringBuilder.toString());
if (!flag.success()) {
DingTalkTextMsg msg = new DingTalkTextMsg();
msg.setContent(stringBuilder.toString());
if (StringUtils.isNotBlank(webHook)) {
msg.setWebHook(webHook);
}
if (StringUtils.isNotBlank(secret)) {
msg.setSecret(secret);
}
boolean flag = msgSender.sendMsgAsync(msg);
if (!flag) {
logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString());
}
} catch (Exception e) {
@ -94,4 +106,11 @@ public class LogMsgSendFilter extends LevelFilter {
return dateFormat.format(timestamp);
}
public void setWebHook(String webHook) {
this.webHook = webHook;
}
public void setSecret(String secret) {
this.secret = secret;
}
}

185
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DingdingMsgSender.java

@ -0,0 +1,185 @@
package com.epmet.commons.tools.utils;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.dto.form.DingTalkTextMsg;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import com.google.common.collect.Lists;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import javax.annotation.PreDestroy;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
/**
* desc: 发送消息工具类
*
* @date: 2020/6/29 8:43
* @author: jianjun liu
*/
@Component
public class DingdingMsgSender {
private final Logger logger = LoggerFactory.getLogger(DingdingMsgSender.class);
//如果不设置则为 开发环境机器人地址
private static final String webHook = "https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c";
private static final String secret = "SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19";
/**
* 默认10
*/
private static Integer maxQueueSize = 10;
/**
* 有序队列
*/
private ArrayBlockingQueue<DingTalkTextMsg> msgQueue = new ArrayBlockingQueue<>(maxQueueSize);
private volatile boolean running = false;
private Cache<String, AtomicInteger> limitCache = CacheBuilder.newBuilder().expireAfterWrite(1, TimeUnit.MINUTES).maximumSize(1000).build();
public DingdingMsgSender() {
}
private void handleMsg() {
DingTalkTextMsg msg = null;
try {
//阻塞取元素
msg = msgQueue.take();
if (msg != null) {
AtomicInteger limitCount = limitCache.getIfPresent(msg.getWebHook());
if (limitCount == null) {
limitCount = new AtomicInteger(1);
limitCache.put(msg.getWebHook(), limitCount);
}
if (limitCount.intValue() > maxQueueSize) {
msgQueue.offer(msg);
Thread.sleep(1000);
} else {
sendPostByJSON(msg);
limitCount.addAndGet(1);
}
} else {
Thread.sleep(1000);
}
} catch (Exception e) {
logger.warn("handleMsg exception,serverUrl:" + msg.getWebHook() + ",msg:" + JSON.toJSONString(msg), e);
}
}
/**
* desc:异步发送消息
*
* @param messageParam
* @return
* @throws IOException
*/
public boolean sendMsgAsync(DingTalkTextMsg messageParam) {
if (!running) {
running = true;
getThread().start();
}
boolean flag = false;
int currentQueueSize = msgQueue.size();
//非阻塞 添加/删除元素
if (currentQueueSize < maxQueueSize) {
flag = msgQueue.offer(messageParam);
} else {
msgQueue.poll();
DingTalkTextMsg param = new DingTalkTextMsg();
param.setContent("待发送消息队列已满,当前队列个数" + msgQueue.size() + "\n" + "最新消息内容:" + JSON.toJSONString(messageParam));
param.setWebHook(messageParam.getWebHook());
sendPostByJSON(param);
}
return flag;
}
/**
* 同步发送报警
*
* @param messageParam
* @return
* @throws IOException
*/
public Result<String> sendMsgSync(DingTalkTextMsg messageParam) {
return sendPostByJSON(messageParam);
}
private Thread getThread() {
Thread sendMsgThread = new Thread("MsgSender-Thread") {
@Override
public void run() {
while (running) {
handleMsg();
}
}
};
return sendMsgThread;
}
@PreDestroy
public void destroy() {
running = false;
}
/**
* 发送POST 请求
*
* @param param 请求参数JSON格式
* @return
*/
private Result<String> sendPostByJSON(DingTalkTextMsg param) {
if (StringUtils.isBlank(param.getWebHook())) {
param.setWebHook(webHook);
}
if (StringUtils.isBlank(param.getSecret())) {
param.setSecret(secret);
}
Result<String> result = new Result<String>().error();
Long timestamp = System.currentTimeMillis();
try {
String stringToSign = timestamp + "\n" + param.getSecret();
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(param.getSecret().getBytes("UTF-8"), "HmacSHA256"));
byte[] signData = mac.doFinal(stringToSign.getBytes("UTF-8"));
String sign = URLEncoder.encode(new String(Base64.encodeBase64(signData)), "UTF-8");
String url = param.getWebHook();
url = url.concat("&timestamp=" + timestamp + "&sign=" + sign);
String jsonStrParam = param.getMsgContent();
result = HttpClientManager.getInstance().sendPostByJSON(url, jsonStrParam);
} catch (Exception e) {
logger.warn("sendPostByJSON error", e);
}
return result;
}
public static void main(String[] args) {
for (int i = 0; i < 50; i++) {
DingTalkTextMsg dingTalkTextMsg = new DingTalkTextMsg();
dingTalkTextMsg.setWebHook("");
dingTalkTextMsg.setContent("测试消息" + i);
dingTalkTextMsg.setAtMobiles(Lists.newArrayList());
dingTalkTextMsg.setAtAll(false);
dingTalkTextMsg.setSecret("");
DingdingMsgSender msgSender = new DingdingMsgSender();
msgSender.sendMsgAsync(dingTalkTextMsg);
}
}
}

25
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimDepartmentDTO.java

@ -0,0 +1,25 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* 部门维度
*
* @author yinzuomei@elink-cn.com
* @date 2020/6/29 13:59
*/
@Data
public class DimDepartmentDTO implements Serializable {
private static final long serialVersionUID = -521155628850201172L;
/**
* DEPARTMENT_ID
*/
private String id;
/**
* 部门名称
*/
private String departmentName;
}

29
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserAgencyInfoResultDTO.java

@ -0,0 +1,29 @@
package com.epmet.dto.result.user;
import com.epmet.dto.DimAgencyDTO;
import com.epmet.dto.DimDepartmentDTO;
import com.epmet.dto.DimGridDTO;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 直属机关部门网格列表查询 返参DTO
*
* @author yinzuomei@elink-cn.com
* @date 2020/6/29 13:55
*/
@Data
public class UserAgencyInfoResultDTO implements Serializable {
private static final long serialVersionUID = 4471324414446061654L;
private Boolean subGridFlag;
private Boolean subDepartmentFlag;
private Boolean subAgencyFlag;
// @JsonIgnore
private List<DimAgencyDTO> subAgencyList;
// @JsonIgnore
private List<DimGridDTO> subGridList;
// @JsonIgnore
private List<DimDepartmentDTO> subDepartmentList;
}

62
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagUsedAgencyDTO.java

@ -0,0 +1,62 @@
/**
* 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.publicity.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* 文章引用标签阅读数量机关统计表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagUsedAgencyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 标签名称 标签名称
*/
private String name;
/**
* 使用改标签的数量
*/
private Integer value;
/**
* 固定值文章数量
*/
private String type="文章数量";
/**
* 机关Id
*/
private String agencyId;
/**
* 标签Id
*/
private String tagId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java → epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDTO.java

@ -30,7 +30,7 @@ import java.util.Date;
* @since v1.0.0 2020-06-19
*/
@Data
public class FactTagAgencyDTO implements Serializable {
public class FactTagViewedAgencyDTO implements Serializable {
private static final long serialVersionUID = 1L;

2
epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
data-report-server:
container_name: data-report-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.8
image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:0.3.10
ports:
- "8109:8109"
network_mode: host # 使用现有网络

2
epmet-module/data-report/data-report-server/pom.xml

@ -3,7 +3,7 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.8</version>
<version>0.3.10</version>
<artifactId>data-report-server</artifactId>
<parent>

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java

@ -65,7 +65,7 @@ public class PublicityController {
* @author jyy
*/
@PostMapping("tagviewed")
public Result<List<FactTagAgencyDTO>> tagviewed(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) {
public Result<List<FactTagViewedAgencyDTO>> tagviewed(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class);
Integer pageSize = formDTO.getPageSize();
@ -73,7 +73,7 @@ public class PublicityController {
pageSize = NumConstant.TEN;
}
String type = formDTO.getType();
return new Result<List<FactTagAgencyDTO>>().ok(publicityService.tagviewed(tokenDto, pageSize, type));
return new Result<List<FactTagViewedAgencyDTO>>().ok(publicityService.tagviewed(tokenDto, pageSize, type));
}
/**
@ -82,7 +82,7 @@ public class PublicityController {
* @author jyy
*/
@PostMapping("tagused")
public Result<List<FactTagAgencyDTO>> tagused(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) {
public Result<List<FactTagUsedAgencyDTO>> tagused(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class);
Integer pageSize = formDTO.getPageSize();
@ -90,7 +90,7 @@ public class PublicityController {
pageSize = NumConstant.TEN;
}
String type = formDTO.getType();
return new Result<List<FactTagAgencyDTO>>().ok(publicityService.tagused(tokenDto, pageSize, type));
return new Result<List<FactTagUsedAgencyDTO>>().ok(publicityService.tagused(tokenDto, pageSize, type));
}
/**

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java

@ -6,10 +6,7 @@ import com.epmet.dto.form.user.UserIncrTrendFormDTO;
import com.epmet.dto.form.user.UserSubAgencyFormDTO;
import com.epmet.dto.form.user.UserSubGridFormDTO;
import com.epmet.dto.form.user.UserSummaryInfoFormDTO;
import com.epmet.dto.result.user.UserIncrTrendResultDTO;
import com.epmet.dto.result.user.UserSubAgencyResultDTO;
import com.epmet.dto.result.user.UserSubGridResultDTO;
import com.epmet.dto.result.user.UserSummaryInfoResultDTO;
import com.epmet.dto.result.user.*;
import com.epmet.service.user.UserAnalysisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
@ -87,4 +84,18 @@ public class UserAnalysisController {
return new Result<List<UserIncrTrendResultDTO>>().ok(userIncrTrendResultDTO);
}
/**
* @param
* @return com.epmet.commons.tools.utils.Result<com.epmet.dto.result.user.UserAgencyInfoResultDTO>
* @author yinzuomei
* @description 直属机关部门网格列表查询
* @Date 2020/6/29 14:10
**/
@PostMapping("checksublist")
public Result<UserAgencyInfoResultDTO> checkSubList() {
UserAgencyInfoResultDTO userAgencyInfoResultDTO = userService.checkSubList();
return new Result<UserAgencyInfoResultDTO>().ok(userAgencyInfoResultDTO);
}
}

2
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java

@ -32,7 +32,7 @@ public interface GroupDao {
* @param
* @author zxc
*/
List<GroupSubAgencyResultDTO> getSubGroupCount();
List<GroupSubAgencyResultDTO> getSubGroupCount(@Param("customerId") String customerId);
/**
* @Description 获取直属网格下的小组数

40
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java

@ -42,76 +42,76 @@ public interface PublicityDao {
/**
* @Description 当月获取机关下获取每个标签阅读数量按照数量降序取前pagesize个
* @param agencyId,monthId,pageSize 机关id展示数量
* @author zxc
* @author jyy
*/
List<FactTagAgencyDTO> getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
List<FactTagViewedAgencyDTO> getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
/**
* @Description 当季获取机关下获取每个标签阅读数量按照数量降序取前pagesize个
* @param agencyId,quarterId,pageSize 机关id展示数量
* @author zxc
* @author jyy
*/
List<FactTagAgencyDTO> getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize);
List<FactTagViewedAgencyDTO> getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize);
/**
* @Description 当年获取机关下获取每个标签阅读数量按照数量降序取前pagesize个
* @param agencyId,yearId,pageSize 机关id展示数量
* @author zxc
* @author jyy
*/
List<FactTagAgencyDTO> getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
List<FactTagViewedAgencyDTO> getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
/**
* @Description 当月获取机关下获取每个标签发文数量按照数量降序取前pagesize个
* @param agencyId,monthId,pageSize 机关id展示数量
* @author zxc
* @author jyy
*/
List<FactTagAgencyDTO> getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
List<FactTagUsedAgencyDTO> getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize);
/**
* @Description 当季获取机关下获取每个标签发文数量按照数量降序取前pagesize个
* @param agencyId,quarterId,pageSize 机关id展示数量
* @author zxc
* @author jyy
*/
List<FactTagAgencyDTO> getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize);
List<FactTagUsedAgencyDTO> getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize);
/**
* @Description 当年获取机关下每个标签发文数量按照数量降序取前pagesize个
* @param agencyId,yearId,pageSize 机关id展示数量
* @author zxc
* @author jyy
*/
List<FactTagAgencyDTO> getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
List<FactTagUsedAgencyDTO> getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize);
/**
* @Description 当月下级机发文数
* @param agencyId,monthId 机关id
* @author zxc
* @author jyy
*/
List<FactPublishedAgencyDTO> getSubAgencyPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
/**
* @Description 当季下级机发文数
* @param agencyId,quarterId 机关id季度
* @author zxc
* @author jyy
*/
List<FactPublishedAgencyDTO> getSubAgencyPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId);
/**
* @Description 当年下级机发文数
* @param agencyId,yearId 机关id
* @author zxc
* @author jyy
*/
List<FactPublishedAgencyDTO> getSubAgencyPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId);
/**
* @Description 当月下级部门文数
* @param agencyId,monthId 机关id
* @author zxc
* @author jyy
*/
List<FactPublishedDepartmentDTO> getSubDepartPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
/**
* @Description 当季下级部门文数
* @param agencyId,quarterId 机关id季度
* @author zxc
* @author jyy
*/
List<FactPublishedDepartmentDTO> getSubDepartPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId);
/**
@ -124,20 +124,20 @@ public interface PublicityDao {
/**
* @Description 当月下级网格文数
* @param agencyId,monthId 机关id
* @author zxc
* @author jyy
*/
List<FactPublishedGridDTO> getSubGridPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
/**
* @Description 当季下级网格文数
* @param agencyId,quarterId 机关id季度
* @author zxc
* @author jyy
*/
List<FactPublishedGridDTO> getSubGridPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId);
/**
* @Description 当年下级网格文数
* @param agencyId,yearId 机关id
* @author zxc
* @author jyy
*/
List<FactPublishedGridDTO> getSubGridPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId);

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java

@ -54,7 +54,7 @@ public interface TopicDao {
* @param
* @author zxc
*/
List<TopicSubAgencyResultDTO> getAllTopicShiftedInfoLastDay();
List<TopicSubAgencyResultDTO> getAllTopicShiftedInfoLastDay(@Param("customerId") String customerId);
/**
* @Description 校验机关下是否存在直属网格
@ -75,7 +75,7 @@ public interface TopicDao {
* @param
* @author zxc
*/
List<TopicSubGridResultDTO> getGridAllTopicShiftedInfoLastDay();
List<TopicSubGridResultDTO> getGridAllTopicShiftedInfoLastDay(@Param("customerId")String customerId);
/**
* @Description 话题日增长

10
epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java

@ -2,6 +2,7 @@ package com.epmet.dao.user;
import com.epmet.dto.DimAgencyDTO;
import com.epmet.dto.DimDepartmentDTO;
import com.epmet.dto.DimGridDTO;
import com.epmet.dto.result.user.UserIncrTrendResDTO;
import com.epmet.dto.result.user.UserSubAgencyResDTO;
@ -132,4 +133,13 @@ public interface UserAnalysisDao {
* @Date 2020/6/23 11:24
**/
List<UserIncrTrendResDTO> selectParticipationUserMonthIncr(@Param("agencyId") String myAgencyId);
/**
* @return java.util.List<com.epmet.dto.DimDepartmentDTO>
* @param myAgencyId 工作人员所属机关单位id
* @author yinzuomei
* @description 查询机关下的部门列表
* @Date 2020/6/29 14:18
**/
List<DimDepartmentDTO> selectSubDepartmentList(@Param("agencyId")String myAgencyId);
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java

@ -50,9 +50,12 @@ public class GroupServiceImpl implements GroupService {
@Override
public List<GroupSubAgencyResultDTO> subAgency(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto);
String customerId = tokenDto.getCustomerId();
List<GroupSubAgencyResultDTO> result = new ArrayList<>();
//获取下级机关
List<SubAgencyResultDTO> subAgencyList = groupDao.getSubAgencyList(agencyId);
List<GroupSubAgencyResultDTO> subGroupCount = groupDao.getSubGroupCount();
//查询客户下
List<GroupSubAgencyResultDTO> subGroupCount = groupDao.getSubGroupCount(customerId);
if (subAgencyList.size()!= NumConstant.ZERO){
subGroupCount.forEach(group -> {
subAgencyList.forEach(subAgency -> {

8
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java

@ -18,12 +18,8 @@
package com.epmet.service.publicity;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.publicity.dto.result.*;
import org.apache.commons.lang3.StringUtils;
import java.util.Date;
import java.util.List;
/**
@ -46,14 +42,14 @@ public interface PublicityService {
* @param tokenDto,formDTO
* @author jyy
*/
public List<FactTagAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) ;
public List<FactTagViewedAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) ;
/**
* @Description 宣传能力工作端宣传能力-获取发表最多的分类数据
* @param tokenDto,pageSize,type
* @author jyy
*/
public List<FactTagAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) ;
public List<FactTagUsedAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) ;
/**
* @param tokenDto type

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java

@ -64,7 +64,7 @@ public class PublicityServiceImpl implements PublicityService {
* @author jyy
*/
@Override
public List<FactTagAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) {
public List<FactTagViewedAgencyDTO> tagviewed(TokenDto tokenDto, Integer pageSize, String type) {
String agencyId = this.getLoginUserDetails(tokenDto);
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN);
@ -92,7 +92,7 @@ public class PublicityServiceImpl implements PublicityService {
* @author jyy
*/
@Override
public List<FactTagAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) {
public List<FactTagUsedAgencyDTO> tagused(TokenDto tokenDto, Integer pageSize, String type) {
String agencyId = this.getLoginUserDetails(tokenDto);
Date date = new Date();
String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN);

6
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java

@ -94,12 +94,13 @@ public class TopicServiceImpl implements TopicService {
@Override
public List<TopicSubGridResultDTO> topicSubGrid(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto);
String customerId = tokenDto.getCustomerId();
List<TopicSubGridResultDTO> result = new ArrayList<>();
List<TopicSubGridResultDTO> resultAll = new ArrayList<>();
List<String> subGridIdList = topicDao.getSubGridIdList(agencyId);
if (subGridIdList.size() != NumConstant.ZERO){
List<TopicSubGridResultDTO> gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay();
List<TopicSubGridResultDTO> gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay();
List<TopicSubGridResultDTO> gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(customerId);
subGridIdList.forEach(gridId -> {
gridAllTopicInfoLastDay.forEach(gridTopic -> {
if (gridId.equals(gridTopic.getGridId())){
@ -135,13 +136,14 @@ public class TopicServiceImpl implements TopicService {
@Override
public List<TopicSubAgencyResultDTO> topicSubAgency(TokenDto tokenDto) {
String agencyId = this.getLoginUserDetails(tokenDto);
String customerId = tokenDto.getCustomerId();
List<TopicSubAgencyResultDTO> result = new ArrayList<>();
List<TopicSubAgencyResultDTO> resultAll = new ArrayList<>();
List<String> subAgencyIdList = topicDao.getSubAgencyIdList(agencyId);
//存在下级机关
if (subAgencyIdList.size() != NumConstant.ZERO){
List<TopicSubAgencyResultDTO> allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay();
List<TopicSubAgencyResultDTO> allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay();
List<TopicSubAgencyResultDTO> allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(customerId);
//话题状态为 已关闭、讨论中、已屏蔽
subAgencyIdList.forEach(agencyIdOne -> {
allTopicInfoLastDay.forEach(agency -> {

14
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java

@ -5,10 +5,7 @@ import com.epmet.dto.form.user.UserIncrTrendFormDTO;
import com.epmet.dto.form.user.UserSubAgencyFormDTO;
import com.epmet.dto.form.user.UserSubGridFormDTO;
import com.epmet.dto.form.user.UserSummaryInfoFormDTO;
import com.epmet.dto.result.user.UserIncrTrendResultDTO;
import com.epmet.dto.result.user.UserSubAgencyResultDTO;
import com.epmet.dto.result.user.UserSubGridResultDTO;
import com.epmet.dto.result.user.UserSummaryInfoResultDTO;
import com.epmet.dto.result.user.*;
import java.util.List;
@ -64,4 +61,13 @@ public interface UserAnalysisService {
* @Date 2020/6/22 13:42
**/
List<UserIncrTrendResultDTO> incrTrendV2(UserIncrTrendFormDTO formDTO);
/**
* @return com.epmet.dto.result.user.UserAgencyInfoResultDTO
* @param
* @author yinzuomei
* @description 直属机关部门网格列表查询
* @Date 2020/6/29 14:10
**/
UserAgencyInfoResultDTO checkSubList();
}

27
epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java

@ -9,6 +9,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.UserAnalysisConstant;
import com.epmet.dao.user.UserAnalysisDao;
import com.epmet.dto.DimAgencyDTO;
import com.epmet.dto.DimDepartmentDTO;
import com.epmet.dto.DimGridDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.user.UserIncrTrendFormDTO;
@ -454,6 +455,32 @@ public class UserAnalysisServiceImpl implements UserAnalysisService {
return resultList;
}
@Override
public UserAgencyInfoResultDTO checkSubList() {
//获取用户所属机关id
String myAgencyId = this.getMyAgency();
UserAgencyInfoResultDTO userAgencyInfoResultDTO=new UserAgencyInfoResultDTO();
userAgencyInfoResultDTO.setSubAgencyFlag(false);
userAgencyInfoResultDTO.setSubGridFlag(false);
userAgencyInfoResultDTO.setSubDepartmentFlag(false);
List<DimAgencyDTO> subAgencyList=userAnalysisDao.selectSubAgencyList(myAgencyId);
if(null!=subAgencyList&&subAgencyList.size()>0){
userAgencyInfoResultDTO.setSubAgencyFlag(true);
}
List<DimGridDTO> subGridList=userAnalysisDao.selectSubGridList(myAgencyId);
if(null!=subGridList&&subGridList.size()>0){
userAgencyInfoResultDTO.setSubGridFlag(true);
}
List<DimDepartmentDTO> subDepartmentList=userAnalysisDao.selectSubDepartmentList(myAgencyId);
if(null!=subDepartmentList&&subDepartmentList.size()>0){
userAgencyInfoResultDTO.setSubDepartmentFlag(true);
}
userAgencyInfoResultDTO.setSubAgencyList(subAgencyList);
userAgencyInfoResultDTO.setSubGridList(subGridList);
userAgencyInfoResultDTO.setSubDepartmentList(subDepartmentList);
return userAgencyInfoResultDTO;
}
private List<UserIncrTrendResultDTO> initUserIncrTrendResultDTO(String type) {
List<UserIncrTrendResultDTO> list=new ArrayList<>();
if(UserAnalysisConstant.DAY_TYPE.equals(type)){

1
epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml

@ -43,6 +43,7 @@
AND da.del_flag = '0'
WHERE
fgad.del_flag = '0'
AND fgad.customer_id = #{customerId}
AND fgad.date_id = (SELECT MAX(date_id) FROM fact_group_agency_daily WHERE del_flag = '0')
</select>

27
epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml

@ -14,12 +14,12 @@
</select>
<!-- 机关当月—每个标签阅读数量—前pageSize -->
<select id="getViewedMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
<select id="getViewedMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagViewedAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
SUM(tag_read_count) AS value
FROM fact_tag_viewed_agency_monthly
where agency_id = #{agencyId}
AND month_id = #{monthId}
@ -29,12 +29,12 @@
</select>
<!-- 机关当季—每个标签阅读数量—前pageSize -->
<select id="getViewedQuarterlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
<select id="getViewedQuarterlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagViewedAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
SUM(tag_read_count) AS value
FROM fact_tag_viewed_agency_quarterly
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
@ -44,12 +44,12 @@
</select>
<!-- 机关当年—每个标签阅读数量—前pageSize -->
<select id="getViewedYearlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
<select id="getViewedYearlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagViewedAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(tag_read_count) AS value
SUM(tag_read_count) AS value
FROM fact_tag_viewed_agency_yearly
where agency_id = #{agencyId}
AND year_id = #{yearId}
@ -59,12 +59,12 @@
</select>
<!-- 机关当月—每个标签发文数量—前pageSize -->
<select id="getUsedMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
<select id="getUsedMonthlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagUsedAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(used_count) AS value
SUM(used_count) AS value
FROM fact_tag_used_agency_monthly
where agency_id = #{agencyId}
AND month_id = #{monthId}
@ -74,12 +74,12 @@
</select>
<!-- 机关当季—每个标签发文数量—前pageSize -->
<select id="getUsedQuarterlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
<select id="getUsedQuarterlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagUsedAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(used_count) AS value
SUM(used_count) AS value
FROM fact_tag_used_agency_quarterly
where agency_id = #{agencyId}
AND quarter_id = #{quarterId}
@ -89,12 +89,12 @@
</select>
<!-- 机关当年—每个标签发文数量—前pageSize -->
<select id="getUsedYearlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagAgencyDTO">
<select id="getUsedYearlyCountByTag" resultType="com.epmet.publicity.dto.result.FactTagUsedAgencyDTO">
SELECT
tag_name AS name,
agency_id AS agencyId,
tag_id AS tagId,
COUNT(used_count) AS value
SUM(used_count) AS value
FROM fact_tag_used_agency_yearly
where agency_id = #{agencyId}
AND year_id = #{yearId}
@ -116,6 +116,7 @@
where
pub.agency_id = agency.id
AND pub.PID =#{agencyId}
AND pub.agency_id not LIKE '%self%'
AND pub.month_id=#{monthId}
GROUP BY pub.agency_id
ORDER BY value DESC,agencyId ASC
@ -135,6 +136,7 @@
where
pub.agency_id = agency.id
AND pub.PID =#{agencyId}
AND pub.agency_id not LIKE '%self%'
AND pub.quarter_id=#{quarterId}
GROUP BY pub.agency_id
ORDER BY value DESC,agencyId ASC
@ -153,6 +155,7 @@
where
pub.agency_id = agency.id
AND pub.PID =#{agencyId}
AND pub.agency_id not LIKE '%self%'
AND pub.year_id=#{yearId}
GROUP BY pub.agency_id
ORDER BY value DESC,agencyId ASC

2
epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml

@ -94,6 +94,7 @@
LEFT JOIN dim_agency da ON da.id = ftiad.agency_id AND da.del_flag = '0'
WHERE
ftiad.del_flag = '0'
AND ftiad.customer_id = #{customerId}
AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_agency_daily WHERE del_flag = '0')
</select>
@ -138,6 +139,7 @@
LEFT JOIN dim_grid da ON da.id = ftiad.grid_id AND da.del_flag = '0'
WHERE
ftiad.del_flag = '0'
AND ftiad.customer_id = #{customerId}
AND ftiad.date_id = (SELECT MAX(date_id) AS dateId FROM fact_topic_issue_grid_daily WHERE del_flag = '0')
</select>

12
epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml

@ -220,4 +220,16 @@
m.MONTH_ID DESC
LIMIT 12
</select>
<!-- 查询机关下的部门列表 -->
<select id="selectSubDepartmentList" parameterType="java.lang.String" resultType="com.epmet.dto.DimDepartmentDTO">
SELECT
dd.id,
dd.DEPARTMENT_NAME
FROM
dim_department dd
WHERE
dd.DEL_FLAG = '0'
AND dd.AGENCY_ID =#{agencyId}
</select>
</mapper>

2
epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
data-statistical-server:
container_name: data-statistical-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.7
image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:0.3.13
ports:
- "8108:8108"
network_mode: host # 使用现有网络

2
epmet-module/data-statistical/data-statistical-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.7</version>
<version>0.3.13</version>
<parent>
<artifactId>data-statistical</artifactId>
<groupId>com.epmet</groupId>

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java

@ -2,20 +2,21 @@ package com.epmet.controller;
import com.epmet.dto.AgencySubTreeDto;
import com.epmet.service.StatsDemoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.time.LocalDateTime;
import java.util.List;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Future;
import java.util.List;
@RequestMapping("demo")
@RestController
@Slf4j
public class DemoController {
@Autowired
@ -24,6 +25,13 @@ public class DemoController {
@Autowired
private ExecutorService executorService;
@GetMapping("testAlarm")
public void testAlarm() {
for (int i = 0; i < 20; i++) {
log.error("测试消息"+i);
}
}
@GetMapping("testtx")
public void testTx() {
demoService.testTx();

8
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java

@ -50,21 +50,21 @@ public interface GroupDataDao {
* @param
* @author zxc
*/
List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(@Param("allGrid") List<String> allGrid,@Param("dateId")String dateId);
List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(@Param("customerId") String customerId,@Param("dateId")String dateId);
/**
* @Description 查询机关下网格内的小组人数 待优化
* @param
* @author zxc
*/
List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(@Param("allGrid") List<String> allGrid,@Param("dateId")String dateId);
List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(@Param("customerId") String customerId,@Param("dateId")String dateId);
/**
* @Description 查询机关下每个小组的人数 待优化
* @param
* @author zxc
*/
List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(@Param("allGrid") List<String> allGrid,@Param("dateId")String dateId);
List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(@Param("customerId") String customerId,@Param("dateId")String dateId);
/**
* @Description 查询机关下的小组日增数 待优化
@ -72,7 +72,7 @@ public interface GroupDataDao {
* @param dateId
* @author zxc
*/
List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(@Param("allGrid") List<String> allGrid,@Param("dateId")String dateId);
List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(@Param("customerId") String customerId,@Param("dateId")String dateId);
/**
* @Description 查询机关下所有网格小组人数

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java

@ -21,24 +21,24 @@ public interface GroupDataService {
/**
* @Description 获取同级机关下网格下的小组数量
* @param allGrid
* @param
* @author zxc
*/
List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(List<String> allGrid,String dateId);
List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(String customerId,String dateId);
/**
* @Description 查询机关下网格内的小组人数
* @param
* @author zxc
*/
List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(List<String> allGrid,String dateId);
List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(String customerId,String dateId);
/**
* @Description 查询机关下每个小组的人数
* @param
* @author zxc
*/
List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(List<String> allGrid,String dateId);
List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(String customerId,String dateId);
/**
* @Description 查询机关下的小组日增数
@ -46,7 +46,7 @@ public interface GroupDataService {
* @param yesterday
* @author zxc
*/
List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(List<String> allGrid,String yesterday);
List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(String customerId,String yesterday);
/**
* @Description 查询机关下所有网格小组人数

32
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java

@ -133,11 +133,11 @@ public class GroupDataServiceImpl implements GroupDataService {
* @param
* @author zxc
*/
public List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(List<String> allGrid,String dateId){
if (allGrid.size() == NumConstant.ZERO){
public List<AgencyGroupTotalCountResultDTO> getAgencyGroupTotalCount(String customerId,String dateId){
/*if (allGrid.size() == NumConstant.ZERO){
return new ArrayList<>();
}
return groupDataDao.getAgencyGroupTotalCount(allGrid,dateId);
}*/
return groupDataDao.getAgencyGroupTotalCount(customerId,dateId);
}
/**
@ -146,11 +146,11 @@ public class GroupDataServiceImpl implements GroupDataService {
* @author zxc
*/
@Override
public List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(List<String> allGrid,String dateId) {
if (allGrid.size() == NumConstant.ZERO){
public List<AgencyGridGroupPeopleTotalResultDTO> selectAgencyGridGroupPeopleTotal(String customerId,String dateId) {
/*if (allGrid.size() == NumConstant.ZERO){
return new ArrayList<>();
}
return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid,dateId);
}*/
return groupDataDao.selectAgencyGridGroupPeopleTotal(customerId,dateId);
}
/**
@ -158,11 +158,11 @@ public class GroupDataServiceImpl implements GroupDataService {
* @param
* @author zxc
*/
public List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(List<String> allGrid,String dateId){
if (allGrid.size() == NumConstant.ZERO){
public List<AgencyGridGroupPeopleResultDTO> selectAgencyEveryGroupPeopleCount(String customerId,String dateId){
/*if (allGrid.size() == NumConstant.ZERO){
return new ArrayList<>();
}
return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid,dateId);
}*/
return groupDataDao.selectAgencyEveryGroupPeopleCount(customerId,dateId);
}
/**
@ -171,11 +171,11 @@ public class GroupDataServiceImpl implements GroupDataService {
* @param dateId
* @author zxc
*/
public List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(List<String> allGrid,String dateId){
if (allGrid.size() == NumConstant.ZERO){
public List<AgencyGroupIncrResultDTO> selectAgencyGroupIncr(String customerId,String dateId){
/*if (allGrid.size() == NumConstant.ZERO){
return new ArrayList<>();
}
return groupDataDao.selectAgencyGroupIncr(allGrid, dateId);
}*/
return groupDataDao.selectAgencyGroupIncr(customerId, dateId);
}
/**

66
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java

@ -151,45 +151,70 @@ public class StatsGroupServiceImpl implements StatsGroupService {
BeanUtils.copyProperties(timeDim,agencyResult);
//机关下的所有网格(包括直属网格)
List<String> allGrid = this.getAllGrid(agencyId,customerId);
if (allGrid.size() != NumConstant.ZERO) {
String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId);
agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId);
agencyResult.setPid(StringUtils.isBlank(pidByAgencyId) ? "0" : pidByAgencyId);
// 1. 机关下有多少网格
List<GridIdListByCustomerResultDTO> customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId);
AtomicReference<Integer> gridSize = new AtomicReference<>(0);
if (customerGridIdList.size() != NumConstant.ZERO){
if (customerGridIdList.size() != NumConstant.ZERO) {
customerGridIdList.forEach(gridId -> {
allGrid.forEach(allAgencyGrid -> {
if (gridId.getGridId().equals(allAgencyGrid)){
if (gridId.getGridId().equals(allAgencyGrid)) {
gridSize.updateAndGet(v -> v + NumConstant.ONE);
}
});
});
agencyResult.setGridTotal(gridSize.get());
}else {
} else {
agencyResult.setGridTotal(NumConstant.ZERO);
}
// 2. 机关下有多少小组,只算 state = ‘approved’
List<AgencyGroupTotalCountResultDTO> agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId);
Integer groupCount = agencyGroupTotalCount.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount));
List<AgencyGroupTotalCountResultDTO> approvedResult = new ArrayList<>();
List<AgencyGroupTotalCountResultDTO> agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(customerId, dateId);
allGrid.forEach(grid -> {
agencyGroupTotalCount.forEach(groupTotal -> {
if (grid.equals(groupTotal.getGridId())) {
approvedResult.add(groupTotal);
}
});
});
Integer groupCount = approvedResult.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount));
agencyResult.setGroupTotalCount(groupCount);
// 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed"
List<AgencyGridGroupPeopleTotalResultDTO> agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid,dateId);
Integer groupPeopleCount = agencyGridGroupPeopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal));
List<AgencyGridGroupPeopleTotalResultDTO> peopleTotal = new ArrayList<>();
List<AgencyGridGroupPeopleTotalResultDTO> agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(customerId, dateId);
allGrid.forEach(grid -> {
agencyGridGroupPeopleTotal.forEach(people -> {
if (grid.equals(people.getGridId())) {
peopleTotal.add(people);
}
});
});
Integer groupPeopleCount = peopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal));
agencyResult.setGroupMemberTotalCount(groupPeopleCount);
// 4. 机关下小组平均人数
agencyResult.setGroupMemberAvgCount(
agencyResult.getGroupTotalCount() == NumConstant.ZERO ? NumConstant.ZERO :
agencyResult.getGroupMemberTotalCount()/agencyResult.getGroupTotalCount());
agencyResult.getGroupMemberTotalCount() / agencyResult.getGroupTotalCount());
// 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID
List<AgencyGridGroupPeopleResultDTO> agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid,dateId);
List<AgencyGridGroupPeopleResultDTO> sorted = agencyGridGroupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList());
List<AgencyGridGroupPeopleResultDTO> groupPeople = new ArrayList<>();
List<AgencyGridGroupPeopleResultDTO> agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(customerId, dateId);
allGrid.forEach(grid -> {
agencyGridGroupPeople.forEach(group -> {
if (grid.equals(group.getGridId())) {
groupPeople.add(group);
}
});
});
List<AgencyGridGroupPeopleResultDTO> sorted = groupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList());
Integer groupPeopleMedian;
if (sorted.size() == NumConstant.ONE){
if (sorted.size() == NumConstant.ONE) {
agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount());
agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId());
agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount());
agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId());
}else if (sorted.size() >= NumConstant.TWO){
} else if (sorted.size() >= NumConstant.TWO) {
groupPeopleMedian = sorted.size() % NumConstant.TWO == NumConstant.ZERO ?
(sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 :
sorted.get(sorted.size() / NumConstant.TWO).getGroupCount();
@ -200,9 +225,18 @@ public class StatsGroupServiceImpl implements StatsGroupService {
agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId());
}
// 6. 机关下小组增量
List<AgencyGroupIncrResultDTO> agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, dateId);
Integer groupIncr = agencyGroupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr));
agencyResult.setGroupIncr(groupIncr);
List<AgencyGroupIncrResultDTO> groupIncr = new ArrayList<>();
List<AgencyGroupIncrResultDTO> agencyGroupIncr = groupDataService.selectAgencyGroupIncr(customerId, dateId);
allGrid.forEach(grid -> {
agencyGroupIncr.forEach(incr -> {
if (grid.equals(incr.getGridId())) {
groupIncr.add(incr);
}
});
});
Integer groupIncrCount = groupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr));
agencyResult.setGroupIncr(groupIncrCount);
}
result.add(agencyResult);
});
return result;

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml

@ -130,6 +130,8 @@
<level>ERROR</level>
<onMatch>ACCEPT</onMatch>
<onMismatch>DENY</onMismatch>
<webHook>https://oapi.dingtalk.com/robot/send?access_token=90782b119f82a5b6bb8e0f819b6a77bbc2102b53aa2d7d2e24fa10b66d580b1c</webHook>
<secret>SEC080aac67ff78e79fdaba132aa51e3fb3f6060dec99492feaac82cabf9f8b6a19</secret>
</filter>
</appender>

16
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml

@ -73,7 +73,6 @@
<!-- 机关下——所有网格内的小组数量 -->
<select id="getAgencyGroupTotalCount" resultType="com.epmet.dto.group.result.AgencyGroupTotalCountResultDTO">
<foreach collection="allGrid" item="grid" separator=" UNION ALL ">
SELECT
grid_id AS gridId,
COUNT(*) AS gridGroupCount
@ -82,16 +81,14 @@
WHERE
DEL_FLAG = 0
AND state = 'approved'
AND grid_id = #{grid}
AND customer_id = #{customerId}
AND DATE_FORMAT(created_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY
grid_id
</foreach>
</select>
<!-- 查询机关下的网格内小组成员总数 , 人员状态不为 “removed” -->
<select id="selectAgencyGridGroupPeopleTotal" resultType="com.epmet.dto.group.result.AgencyGridGroupPeopleTotalResultDTO">
<foreach collection="allGrid" item="grid" separator=" UNION ALL ">
SELECT
rg.grid_id AS gridId,
COUNT(rgm.id) AS gridGroupPeopleTotal
@ -101,16 +98,14 @@
WHERE
rg.DEL_FLAG = 0
AND rg.state = 'approved'
AND rg.grid_id = #{grid}
AND rg.customer_id = #{customerId}
AND rgm.status != 'removed'
AND DATE_FORMAT(rgm.created_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY rg.grid_id
</foreach>
</select>
<!-- 查询机关下每个小组的人数 -->
<select id="selectAgencyEveryGroupPeopleCount" resultType="com.epmet.dto.group.result.AgencyGridGroupPeopleResultDTO">
<foreach collection="allGrid" item="grid" separator=" UNION ALL ">
SELECT
rg.grid_id AS gridId,
rg.id AS groupId,
@ -121,17 +116,15 @@
WHERE
rg.DEL_FLAG = 0
AND rg.state = 'approved'
AND rg.grid_id = #{grid}
AND rg.customer_id = #{customerId}
AND rgm.STATUS != 'removed'
AND DATE_FORMAT(rgm.created_time,'%Y%m%d') <![CDATA[ <= ]]> #{dateId}
GROUP BY
rgm.resi_group_id
</foreach>
</select>
<!-- 查询机关下的小组日增数 -->
<select id="selectAgencyGroupIncr" resultType="com.epmet.dto.group.result.AgencyGroupIncrResultDTO">
<foreach collection="allGrid" item="grid" separator=" UNION ALL ">
SELECT
COUNT(*) AS groupIncr,
grid_id AS gridId
@ -139,11 +132,10 @@
resi_group
WHERE
state = 'approved'
AND grid_id = #{grid}
AND customer_id = #{customerId}
AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId}
GROUP BY
grid_id
</foreach>
</select>
<select id="getAgencyGrid" resultType="com.epmet.dto.group.result.GroupPeopleCountResultDTO">

2
epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-job-server:
container_name: epmet-job-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.11
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:0.3.13
ports:
- "8084:8084"
network_mode: host # 使用现有网络

2
epmet-module/epmet-job/epmet-job-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.11</version>
<version>0.3.13</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-job</artifactId>

2
epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-message-server:
container_name: epmet-message-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:0.3.22
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:0.3.23
ports:
- "8085:8085"
network_mode: host # 使用现有网络

2
epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-message-server:
container_name: epmet-message-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-message-server:0.3.19
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-message-server:0.3.21
ports:
- "8085:8085"
network_mode: host # 使用现有网络

2
epmet-module/epmet-message/epmet-message-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.22</version>
<version>0.3.23</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-message</artifactId>

2
epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java

@ -51,7 +51,7 @@ public class SysSmsServiceImpl extends BaseServiceImpl<SysSmsDao, SysSmsEntity>
@Override
public PageData<SysSmsDTO> page(Map<String, Object> params) {
IPage<SysSmsEntity> page = baseDao.selectPage(
getPage(params, Constant.CREATE_DATE, false),
getPage(params, Constant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, SysSmsDTO.class);

2
epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java

@ -59,7 +59,7 @@ public class IssueDTO implements Serializable {
private String closeReason;
/**
* 解决类型 未关闭时可以为空已解决resloved未解决unresloved对应在关闭议题时所选的checkbox转项目后而且已经结案这个字段不回写
* 解决类型 未关闭时可以为空已解决resolved未解决unresolved对应在关闭议题时所选的checkbox转项目后而且已经结案这个字段不回写
*/
private String resolveType;

2
epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-issue-server:
container_name: gov-issue-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.42
image: 192.168.1.130:10080/epmet-cloud-dev/gov-issue-server:0.3.45
ports:
- "8101:8101"
network_mode: host # 使用现有网络

2
epmet-module/gov-issue/gov-issue-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.43</version>
<version>0.3.45</version>
<parent>
<artifactId>gov-issue</artifactId>
<groupId>com.epmet</groupId>

4
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java

@ -29,11 +29,11 @@ public interface IssueConstant {
/**
* 议题解决类型-已解决
*/
String ISSUE_RESLOVED = "resloved";
String ISSUE_RESOLVED = "resolved";
/**
* 议题解决类型-未解决
*/
String ISSUE_UNRESLOVED = "unresloved";
String ISSUE_UNRESOLVED = "unresolved";
String SELECT_EXCEPTION = "获取议题详情数据失败";
String UPPDATE_EXCEPTION = "议题详情表数据更新失败";

6
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java

@ -18,12 +18,12 @@ public interface UserMessageConstant {
/**
* 议题关闭时选择已解决
*/
String ISSUE_RESLOVED_MSG = "您好,您发表的话题\"%s\"问题已解决,解决方案是:%s";
String ISSUE_RESOLVED_MSG = "您好,您发表的话题\"%s\"问题已解决,解决方案是:%s";
/**
* 议题关闭时选择无需解决
*/
String ISSUE_UNRESLOVED_MSG = "您好,您发表的话题\"%s\"问题无需解决,原因:%s";
String ISSUE_UNRESOLVED_MSG = "您好,您发表的话题\"%s\"问题无需解决,原因:%s";
/**
* 议题转项目消息模板
@ -33,6 +33,6 @@ public interface UserMessageConstant {
/**
* 议题转项目消息模板
*/
String PROJECT_RESLOVED_MSG = "您好。您收到一条【%s】的新信息,请您尽快处理。";
String PROJECT_RESOLVED_MSG = "您好。您收到一条【%s】的新信息,请您尽快处理。";
}

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java

@ -59,7 +59,7 @@ public class IssueEntity extends BaseEpmetEntity {
private String closeReason;
/**
* 解决类型 未关闭时可以为空已解决resloved未解决unresloved对应在关闭议题时所选的checkbox转项目后而且已经结案这个字段不回写
* 解决类型 未关闭时可以为空已解决resolved未解决unresolved对应在关闭议题时所选的checkbox转项目后而且已经结案这个字段不回写
*/
private String resolveType;

2
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueExcel.java

@ -46,7 +46,7 @@ public class IssueExcel {
@Excel(name = "关闭理由 【未关闭时可以为空】关闭议题时必填的理由,转项目后而且已经结案,这个字段不回写")
private String closeReason;
@Excel(name = "解决类型 【未关闭时可以为空】已解决resloved、未解决unresloved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写")
@Excel(name = "解决类型 【未关闭时可以为空】已解决resolved、未解决unresolved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写")
private String resolveType;
@Excel(name = "议题名称 最多20字")

11
epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java

@ -398,10 +398,10 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
ResiTopicDTO topicDTO = resultTopicDTO.getData();
//4.2:创建消息模板
String messageContent = "";
if (IssueConstant.ISSUE_RESLOVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_RESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
} else if (IssueConstant.ISSUE_UNRESLOVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_UNRESLOVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
if (IssueConstant.ISSUE_RESOLVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_RESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
} else if (IssueConstant.ISSUE_UNRESOLVED.equals(formDTO.getResolveType())) {
messageContent = String.format(UserMessageConstant.ISSUE_UNRESOLVED_MSG, topicDTO.getTopicContent(), formDTO.getCloseReason());
}
//4.3:调用服务,发送消息
if (!saveUserMessageList(topicDTO, messageContent, entity).success()) {
@ -504,6 +504,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
//3:调用gov-project服务,新增项目各业务表初始数据
Result<IssueProjectResultDTO> resultDTO = govProjectFeignClient.issueShiftProject(formDTO);
if (!resultDTO.success() || null == resultDTO.getData()) {
logger.error(resultDTO.getInternalMsg());
throw new RenException(IssueConstant.GOV_PRJECT_EXCEPTION);
}
IssueProjectResultDTO issueProjectResultDTO = resultDTO.getData();
@ -563,7 +564,7 @@ public class IssueServiceImpl extends BaseServiceImpl<IssueDao, IssueEntity> imp
msgList.add(msgIssue);
}
//2:创建项目工作人员消息对象
String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESLOVED_MSG, entity.getIssueTitle());
String projectStaffMessage = String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, entity.getIssueTitle());
//所选人员如果即在部门下又在网格下则只发一条消息
Map<String,String> map = new HashMap<>();
formDTO.getStaffList().forEach(staff->{

2
epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/epmet_gov_issue.sql

@ -30,7 +30,7 @@ CREATE TABLE `issue` (
`SOURCE_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源类型 eg:resi_topic',
`SOURCE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '来源ID eg:2223232(当SOURCE_TYPE为\"resi_topic\"时,这里指话题的ID)',
`CLOSE_REASON` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '关闭理由 【未关闭时可以为空】关闭议题时必填的理由,转项目后而且已经结案,这个字段不回写',
`RESOLVE_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '解决类型 【未关闭时可以为空】已解决resloved、未解决unresloved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写',
`RESOLVE_TYPE` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '解决类型 【未关闭时可以为空】已解决resolved、未解决unresolved,对应在关闭议题时所选的checkbox,转项目后而且已经结案,这个字段不回写',
`ISSUE_TITLE` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '议题名称 最多20字',
`SUGGESTION` varchar(1024) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '建议 最多1000字',
`CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '客户ID',

2
epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
gov-project-server:
container_name: gov-project-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.27
image: 192.168.1.130:10080/epmet-cloud-dev/gov-project-server:0.3.30
ports:
- "8102:8102"
network_mode: host # 使用现有网络

2
epmet-module/gov-project/gov-project-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>0.3.28</version>
<version>0.3.30</version>
<parent>
<artifactId>gov-project</artifactId>
<groupId>com.epmet</groupId>

5
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -113,4 +113,9 @@ public interface ProjectConstant {
* 获取项目节点数据失败
*/
String SELECT_process_EXCEPTION = "获取项目节点数据失败";
/**
* 议题转项目已存在项目数据不能重复转
* 议题转项目 项目服务数据入库成功议题数据更新或发送消息失败导致议题数据可以回滚项目服务数据不能回滚
*/
String SAVE_PROJECT_EXCEPTION = "已存在项目数据,不能重复转项目";
}

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

@ -103,4 +103,12 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @Description 获取客户下已结案项目列表按结案时间倒序
**/
List<LatestListResultDTO> selectClosedProjectList(LatestListFormDTO formDTO);
/**
* @param projectDTO
* @return
* @Author sun
* @Description 根据客户Id机关Id议题Id查询项目数据是否存在
**/
List<ProjectDTO> selectProjectList(ProjectDTO projectDTO);
}

11
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -467,6 +467,17 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
IssueProjectResultDTO issueProjectResultDTO = new IssueProjectResultDTO();
List<TickStaffFormDTO> staffList = formDTO.getStaffList();
IssueDTO issueDTO = formDTO.getIssueDTO();
//0.因项目还未添加分布式事务,议题转项目,如果项目数据入库成功议题数据也修改成功但是消息发送失败时则议题数据可以回滚但项目服务的数据不能回滚
//先根据客户Id机关Id议题Id查询项目表是否已存在,存在则说明之前转过切失败了,这样的数据不能再操作了,只能操作数据库,将项目表和项目进展表数据清除
ProjectDTO projectDTO = new ProjectDTO();
projectDTO.setCustomerId(issueDTO.getCustomerId());
projectDTO.setAgencyId(issueDTO.getOrgId());
projectDTO.setOrigin(ProjectConstant.ISSUE);
projectDTO.setOriginId(issueDTO.getId());
List<ProjectDTO> listProject = baseDao.selectProjectList(projectDTO);
if (null != listProject && listProject.size() > NumConstant.ZERO) {
throw new RenException(ProjectConstant.SAVE_PROJECT_EXCEPTION);
}
//1:调用gov-org服务,获取所有勾选人员以及议题数据对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值使用
List<String> agencyIdList = staffList.stream().map(TickStaffFormDTO::getAgencyId).collect(Collectors.toList());
agencyIdList.add(issueDTO.getOrgId());

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

@ -165,4 +165,22 @@
ORDER BY p.created_time DESC
</select>
<select id="selectProjectList" resultType="com.epmet.dto.ProjectDTO">
SELECT
id,
customer_id,
agency_id,
origin,
origin_id,
title
FROM
project
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND agency_id = #{agencyId}
AND origin = #{origin}
AND origin_id = #{originId}
</select>
</mapper>

2
epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/IssueDTO.java

@ -59,7 +59,7 @@ public class IssueDTO implements Serializable {
private String closeReason;
/**
* 解决类型 未关闭时可以为空已解决resloved未解决unresloved对应在关闭议题时所选的checkbox转项目后而且已经结案这个字段不回写
* 解决类型 未关闭时可以为空已解决resolved未解决unresolved对应在关闭议题时所选的checkbox转项目后而且已经结案这个字段不回写
*/
private String resolveType;

2
epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
resi-partymember-server:
container_name: resi-partymember-server-test
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.51
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/resi-partymember-server:0.3.52
ports:
- "8096:8096"
network_mode: host # 使用现有网络

12
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovStaffRoleFormDTO.java

@ -0,0 +1,12 @@
package com.epmet.dto.form;
import lombok.Data;
import java.util.List;
@Data
public class GovStaffRoleFormDTO {
private List<String> roleIdList;
}

14
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java

@ -4,12 +4,10 @@ import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.GovStaffRoleFormDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.TagCustomerFormDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.TagCustomerResultDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.fallback.EpmetUserOpenFeignClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
@ -24,6 +22,7 @@ import java.util.List;
* @author yinzuomei@elink-cn.com
* @date 2020/6/4 13:09
*/
//@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class, url = "localhost:8087")
@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class)
public interface EpmetUserOpenFeignClient {
@ -72,4 +71,11 @@ public interface EpmetUserOpenFeignClient {
@PostMapping("/epmetuser/user/getcustomeridbyuserid")
Result<TagCustomerResultDTO> getCustomerIdByUserId(@RequestBody TagCustomerFormDTO formDTO);
/**
* 根据角色id列表批量查询角色信息
* @param form
* @return
*/
@PostMapping("/epmetuser/govstaffrole/getbyids")
Result<List<GovStaffRoleResultDTO>> getByIds(@RequestBody GovStaffRoleFormDTO form);
}

11
epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java

@ -5,12 +5,10 @@ import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.CustomerStaffDTO;
import com.epmet.dto.form.CustomerStaffRoleListFormDTO;
import com.epmet.dto.form.GovStaffRoleFormDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.TagCustomerFormDTO;
import com.epmet.dto.result.CustomerStaffRoleListResultDTO;
import com.epmet.dto.result.CustomerStaffRoleResultDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.TagCustomerResultDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import org.springframework.stereotype.Component;
@ -50,4 +48,9 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getCustomerIdByUserId", formDTO);
}
@Override
public Result<List<GovStaffRoleResultDTO>> getByIds(GovStaffRoleFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getById", form);
}
}

2
epmet-user/epmet-user-server/deploy/docker-compose-dev.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-user-server:
container_name: epmet-user-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.64
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-user-server:0.3.65
ports:
- "8087:8087"
network_mode: host # 不会创建新的网络

2
epmet-user/epmet-user-server/pom.xml

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<version>0.3.64</version>
<version>0.3.65</version>
<parent>
<groupId>com.epmet</groupId>
<artifactId>epmet-user</artifactId>

27
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java

@ -1,17 +1,20 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.RoleDTO;
import com.epmet.dto.form.GovStaffRoleFormDTO;
import com.epmet.dto.result.GovStaffRoleResultDTO;
import com.epmet.dto.result.GovStaffRoleTemplateDTO;
import com.epmet.entity.GovStaffRoleEntity;
import com.epmet.service.GovStaffRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
@RequestMapping("govstaffrole")
@RestController
@ -40,4 +43,20 @@ public class GovStaffRoleController {
List<GovStaffRoleTemplateDTO> roleTemplates = govStaffRoleService.listRoleTemplates();
return new Result().ok(roleTemplates);
}
/**
* 使用id列表查询角色列表
* @param form
* @return
*/
@PostMapping("getbyids")
public Result<List<GovStaffRoleResultDTO>> getByIds(@RequestBody GovStaffRoleFormDTO form) {
List<GovStaffRoleResultDTO> roleDTOS = new ArrayList<>();
List<String> roleIdList = form.getRoleIdList();
if (!CollectionUtils.isEmpty(roleIdList)) {
roleDTOS = roleIdList.stream().map(roleId -> govStaffRoleService.getDTOById(roleId)).collect(Collectors.toList());
}
return new Result<List<GovStaffRoleResultDTO>>().ok(roleDTOS);
}
}

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

@ -59,4 +59,6 @@ public interface GovStaffRoleDao extends BaseDao<GovStaffRoleEntity> {
GovStaffRoleDTO getRoleByCustomerIdAndRoleKey(@Param("customerId") String customerId, @Param("roleKey") String roleKey);
List<GovStaffRoleResultDTO> listRolesByCustomer(@Param("customerId") String customerId);
GovStaffRoleResultDTO getDTOById(@Param("roleId") String roleId);
}

4
epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java

@ -8,8 +8,8 @@ import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class, url = "localhost:8081")
//@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class)
//@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class, url = "localhost:8081")
@FeignClient(name = ServiceConstant.EPMET_AUTH_SERVER, fallback = AuthFeignClientCallback.class)
public interface AuthFeignClient {
/**

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

@ -125,4 +125,6 @@ public interface GovStaffRoleService extends BaseService<GovStaffRoleEntity> {
List<GovStaffRoleResultDTO> listRolesByCustomer(String customerId);
List<GovStaffRoleTemplateDTO> listRoleTemplates();
GovStaffRoleResultDTO getDTOById(String roleId);
}

5
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java

@ -176,4 +176,9 @@ public class GovStaffRoleServiceImpl extends BaseServiceImpl<GovStaffRoleDao, Go
public List<GovStaffRoleTemplateDTO> listRoleTemplates() {
return govStaffRoleTemplateDao.listValidateRoles();
}
@Override
public GovStaffRoleResultDTO getDTOById(String roleId) {
return govStaffRoleDao.getDTOById(roleId);
}
}

9
epmet-user/epmet-user-server/src/main/resources/mapper/GovStaffRoleDao.xml

@ -59,4 +59,13 @@
FROM gov_staff_role r
WHERE r.CUSTOMER_ID = #{customerId}
</select>
<select id="getDTOById" resultType="com.epmet.dto.result.GovStaffRoleResultDTO">
SELECT gsr.ID AS roleId,
gsr.ROLE_KEY AS roleKey,
gsr.ROLE_NAME AS roleName,
gsr.CUSTOMER_ID AS customerId,
gsr.ORG_TYPE AS orgType
FROM gov_staff_role gsr WHERE ID = #{roleId}
</select>
</mapper>
Loading…
Cancel
Save