Browse Source

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

master
yinzuomei 5 years ago
parent
commit
e3f2867e92
  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. 37
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/DingTalkTextMsg.java
  7. 151
      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. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
  10. 2
      epmet-module/data-report/data-report-server/pom.xml
  11. 2
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
  12. 2
      epmet-module/data-statistical/data-statistical-server/pom.xml
  13. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  14. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/logback-spring.xml
  15. 2
      epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml
  16. 2
      epmet-module/epmet-job/epmet-job-server/pom.xml
  17. 2
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml
  18. 2
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-test.yml
  19. 2
      epmet-module/epmet-message/epmet-message-server/pom.xml
  20. 2
      epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/service/impl/SysSmsServiceImpl.java
  21. 2
      epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/IssueDTO.java
  22. 2
      epmet-module/gov-issue/gov-issue-server/deploy/docker-compose-dev.yml
  23. 2
      epmet-module/gov-issue/gov-issue-server/pom.xml
  24. 4
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/IssueConstant.java
  25. 6
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/constant/UserMessageConstant.java
  26. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/entity/IssueEntity.java
  27. 2
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/excel/IssueExcel.java
  28. 11
      epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java
  29. 2
      epmet-module/gov-issue/gov-issue-server/src/main/resources/db/migration/epmet_gov_issue.sql
  30. 2
      epmet-module/gov-project/gov-project-server/deploy/docker-compose-dev.yml
  31. 2
      epmet-module/gov-project/gov-project-server/pom.xml
  32. 5
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  33. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java
  34. 11
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  35. 18
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml
  36. 2
      epmet-module/resi-hall/resi-hall-client/src/main/java/com/epmet/dto/IssueDTO.java
  37. 2
      epmet-module/resi-partymember/resi-partymember-server/deploy/docker-compose-test.yml
  38. 12
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/GovStaffRoleFormDTO.java
  39. 14
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  40. 11
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  41. 2
      epmet-user/epmet-user-server/deploy/docker-compose-dev.yml
  42. 2
      epmet-user/epmet-user-server/pom.xml
  43. 27
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/GovStaffRoleController.java
  44. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/dao/GovStaffRoleDao.java
  45. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/feign/AuthFeignClient.java
  46. 2
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/GovStaffRoleService.java
  47. 5
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/GovStaffRoleServiceImpl.java
  48. 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";
}

37
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
/**
* desc: 钉钉文本消息参数 实体类
*
* @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");

151
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;
@ -20,78 +21,96 @@ import java.text.SimpleDateFormat;
* @author: jianjun liu
*/
public class LogMsgSendFilter extends LevelFilter {
private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class);
@Override
public FilterReply decide(ILoggingEvent event) {
//如果日志级别等于设置的日志级别 则发送消息
if (event.getLevel().isGreaterOrEqual(Level.ERROR)) {
try {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("【日志告警】\n");
private static final Logger logger = LoggerFactory.getLogger(LogMsgSendFilter.class);
private DingdingMsgSender msgSender = new DingdingMsgSender();
private String webHook;
private String secret;
stringBuilder.append("\n");
@Override
public FilterReply decide(ILoggingEvent event) {
//如果日志级别等于设置的日志级别 则发送消息
if (event.getLevel().isGreaterOrEqual(Level.ERROR)) {
try {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("【日志告警】\n");
stringBuilder.append("告警级别:" + event.getLevel());
stringBuilder.append("\n");
stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp()));
stringBuilder.append("\n");
stringBuilder.append("TraceId:" + Thread.currentThread().getName());
stringBuilder.append("\n");
stringBuilder.append("告警信息:" + event.getFormattedMessage());
stringBuilder.append("\n");
stringBuilder.append("\n");
IThrowableProxy throwableProxy = event.getThrowableProxy();
//异常信息处理 暂时处理一级的5行数据
apendStackInfo(stringBuilder, throwableProxy);
stringBuilder.append("告警级别:" + event.getLevel());
stringBuilder.append("\n");
stringBuilder.append("故障时间:" + formatLongTime2Str(event.getTimeStamp()));
stringBuilder.append("\n");
stringBuilder.append("TraceId:" + Thread.currentThread().getName());
stringBuilder.append("\n");
stringBuilder.append("告警信息:" + event.getFormattedMessage());
stringBuilder.append("\n");
Result<String> flag = HttpClientManager.getInstance().sendAlarmMsg(stringBuilder.toString());
if (!flag.success()) {
logger.warn("msgSender.sendMsg fail,param:{}", stringBuilder.toString());
}
} catch (Exception e) {
logger.warn("decide exception", e);
}
}
//交给其他filter继续向下处理
return super.decide(event);
}
IThrowableProxy throwableProxy = event.getThrowableProxy();
//异常信息处理 暂时处理一级的5行数据
apendStackInfo(stringBuilder, throwableProxy);
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) {
logger.warn("decide exception", e);
}
}
//交给其他filter继续向下处理
return super.decide(event);
}
private void apendStackInfo(StringBuilder stringBuilder, IThrowableProxy throwableProxy) {
int defaultRowLine = 5;
if (throwableProxy != null) {
stringBuilder.append("异常信息:")
.append(throwableProxy.getClassName())
.append(" : ")
.append(throwableProxy.getMessage())
.append("\n");
private void apendStackInfo(StringBuilder stringBuilder, IThrowableProxy throwableProxy) {
int defaultRowLine = 5;
if (throwableProxy != null) {
stringBuilder.append("异常信息:")
.append(throwableProxy.getClassName())
.append(" : ")
.append(throwableProxy.getMessage())
.append("\n");
StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray();
StackTraceElementProxy stackTraceElementProxy = null;
StackTraceElementProxy[] stackTraceElementProxyArray = throwableProxy.getStackTraceElementProxyArray();
StackTraceElementProxy stackTraceElementProxy = null;
if (stackTraceElementProxyArray.length < defaultRowLine) {
defaultRowLine = stackTraceElementProxyArray.length;
}
for (int i = 0; i < defaultRowLine; i++) {
stackTraceElementProxy = stackTraceElementProxyArray[i];
StackTraceElement stackTraceElement = stackTraceElementProxy.getStackTraceElement();
stringBuilder.append("\t\tat ");
stringBuilder.append(stackTraceElement.getClassName());
stringBuilder.append(".");
stringBuilder.append(stackTraceElement.getMethodName());
stringBuilder.append("(");
stringBuilder.append(stackTraceElement.getFileName());
stringBuilder.append(":");
stringBuilder.append(stackTraceElement.getLineNumber());
stringBuilder.append(")");
stringBuilder.append("\n");
}
}
}
if (stackTraceElementProxyArray.length < defaultRowLine) {
defaultRowLine = stackTraceElementProxyArray.length;
}
for (int i = 0; i < defaultRowLine; i++) {
stackTraceElementProxy = stackTraceElementProxyArray[i];
StackTraceElement stackTraceElement = stackTraceElementProxy.getStackTraceElement();
stringBuilder.append("\t\tat ");
stringBuilder.append(stackTraceElement.getClassName());
stringBuilder.append(".");
stringBuilder.append(stackTraceElement.getMethodName());
stringBuilder.append("(");
stringBuilder.append(stackTraceElement.getFileName());
stringBuilder.append(":");
stringBuilder.append(stackTraceElement.getLineNumber());
stringBuilder.append(")");
stringBuilder.append("\n");
}
}
}
private String formatLongTime2Str(long timestamp) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
return dateFormat.format(timestamp);
}
private String formatLongTime2Str(long timestamp) {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
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);
}
}
}

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.9
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.9</version>
<artifactId>data-report-server</artifactId>
<parent>

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();

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>

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