Browse Source

Merge remote-tracking branch 'remotes/origin/dev'

master
jianjun 5 years ago
parent
commit
e0d6012d2e
  1. 2
      epmet-admin/epmet-admin-server/deploy/docker-compose-dev.yml
  2. 2
      epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml
  3. 2
      epmet-auth/deploy/docker-compose-dev.yml
  4. 2
      epmet-auth/deploy/docker-compose-test.yml
  5. 18
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java
  6. 4
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/AppClientConstant.java
  7. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java
  8. 96
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java
  9. 5
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenExceptionHandler.java
  10. 2
      epmet-gateway/deploy/docker-compose-dev.yml
  11. 2
      epmet-gateway/deploy/docker-compose-test.yml
  12. 3
      epmet-gateway/pom.xml
  13. 4
      epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java
  14. 4
      epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java
  15. 1
      epmet-gateway/src/main/resources/bootstrap.yml
  16. 43
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java
  17. 59
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java
  18. 34
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java
  19. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml
  20. 2
      epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml
  21. 5
      epmet-module/data-report/data-report-server/pom.xml
  22. 34
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java
  23. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java
  24. 22
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java
  25. 111
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  26. 41
      epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml
  27. 3
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
  28. 25
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java
  29. 114
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectOrgRelationDTO.java
  30. 3
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java
  31. 27
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java
  32. 2
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml
  33. 2
      epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml
  34. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  35. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java
  36. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  37. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java
  38. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java
  39. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java
  40. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java
  41. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java
  42. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java
  43. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java
  44. 12
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java
  45. 41
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java
  46. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java
  47. 33
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java
  48. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java
  49. 3
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java
  50. 14
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java
  51. 26
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java
  52. 11
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  53. 112
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java
  54. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  55. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml
  56. 62
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml
  57. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml
  58. 41
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  59. 90
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml
  60. 2
      epmet-module/epmet-activiti/epmet-activiti-server/deploy/docker-compose-dev.yml
  61. 35
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/CostDayFormDTO.java
  62. 41
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/TimestampIntervalFormDTO.java
  63. 47
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/WorkMinuteFormDTO.java
  64. 37
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/CostDayResultDTO.java
  65. 36
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java
  66. 35
      epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java
  67. 2
      epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-dev.yml
  68. 2
      epmet-module/epmet-common-service/common-service-server/deploy/docker-compose-test.yml
  69. 29
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java
  70. 44
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/WorkDayController.java
  71. 32
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/WorkDayService.java
  72. 347
      epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java
  73. 1
      epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/CalenderDao.xml
  74. 2
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-dev.yml
  75. 2
      epmet-module/epmet-ext/epmet-ext-server/deploy/docker-compose-test.yml
  76. 2
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java
  77. 29
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java
  78. 20
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java
  79. 30
      epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java
  80. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-dev.yml
  81. 2
      epmet-module/epmet-heart/epmet-heart-server/deploy/docker-compose-test.yml
  82. 3
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java
  83. 18
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java
  84. 38
      epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java
  85. 2
      epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-dev.yml
  86. 2
      epmet-module/epmet-job/epmet-job-server/deploy/docker-compose-test.yml
  87. 21
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ProjectSendMessageService.java
  88. 35
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ProjectSendMessageServiceImpl.java
  89. 43
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ProjectSendMessageTask.java
  90. 7
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/WxMsgTemplateSubscribeStatus.java
  91. 7
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java
  92. 9
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpMsgSendRecordDTO.java
  93. 2
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpTemplateMsgSubscribeStatusDTO.java
  94. 32
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ActivationSubscribeFormDTO.java
  95. 5
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java
  96. 24
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxMsgAuthInfoFormDTO.java
  97. 16
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java
  98. 72
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxmpMessagePushFormDTO.java
  99. 5
      epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/WxMsgAuthInfoResultDTO.java
  100. 2
      epmet-module/epmet-message/epmet-message-server/deploy/docker-compose-dev.yml

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-admin-server:
container_name: epmet-admin-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-admin-server:0.3.15
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-admin-server:version_placeholder
ports:
- "8082:8082"
network_mode: host # 使用现有网络

2
epmet-admin/epmet-admin-server/deploy/docker-compose-test.yml

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

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.69
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-auth:version_placeholder
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.68
image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/epmet-auth:version_placeholder
ports:
- "8081:8081"
network_mode: host # 使用现有网络

18
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/BaseRequestLogAspect.java

@ -66,7 +66,7 @@ public abstract class BaseRequestLogAspect {
resultInfoLog(transactionSerial, getExecPeriod(startTime), result);
} catch (RenException e) {
result = handleRenException(e);
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getMsg(), ExceptionUtils.getErrorStackTrace(e));
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getInternalMsg(), ExceptionUtils.getErrorStackTrace(e));
} catch (ValidateException e) {
result = handleValidateException(e);
resultErrorLog(transactionSerial, getExecPeriod(startTime), result, e.getMsg(), ExceptionUtils.getErrorStackTrace(e));
@ -142,7 +142,7 @@ public abstract class BaseRequestLogAspect {
*/
private Result handlerRuntimeException(RuntimeException ex) {
Result result=new Result().error();
result.setInternalMsg(ex.getMessage());
//result.setInternalMsg(ex.getMessage());
return result;
}
@ -174,14 +174,20 @@ public abstract class BaseRequestLogAspect {
*/
private Result handleRenException(RenException e) {
if (e.getCode() > 8000) {
// 原样返回
Result result=new Result().error(e.getCode());
result.setInternalMsg(e.getMsg());
Result result;
if (StringUtils.isNotBlank(e.getMsg())) {
// 抛出异常的时候填写了自定义显示信息,把显示信息返回
result = new Result().error(e.getCode(), e.getMsg());
} else {
// 没有填写显示信息,则根据code找固定的显示信息
result = new Result().error(e.getCode());
}
result.setInternalMsg(e.getInternalMsg());
return result;
}
// 转化成服务器开小差...
Result result=new Result().error();
result.setInternalMsg(e.getMsg());
result.setInternalMsg(e.getInternalMsg());
//result.setMsg(e.getMsg());
return result;
}

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

@ -50,4 +50,8 @@ public interface AppClientConstant {
* 事务流水号每次请求串起来的多个服务拥有相同的流水号,便于日志追踪
*/
String TRANSACTION_SERIAL_KEY = "Transaction-Serial";
/**
* app类型-工作端
*/
String APP_WORK = "work";
}

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

@ -26,10 +26,11 @@ public interface NumConstant {
int TEN = 10;
int ELEVEN = 11;
int TWELVE = 12;
int SEVENTEEN = 17;
int FIFTEEN = 15;
int FOURTEEN=14;
int TWENTY = 20;
int TWENTY_FOUR = 24;
int THIRTY = 30;
int THIRTY_ONE = 31;
int FORTY = 40;

96
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/RenException.java

@ -21,26 +21,67 @@ import org.apache.commons.lang3.StringUtils;
public class RenException extends RuntimeException {
private static final long serialVersionUID = 1L;
private int code;
/**
* 显示给客户的消息
*/
private String msg;
/**
* 内部消息用于服务之间传递错误信息排错用
*/
private String internalMsg;
public RenException(int code) {
this(code, "");
}
public RenException(int code, String internalMsg) {
super(internalMsg);
this.code = code;
if (StringUtils.isBlank(internalMsg)) {
this.internalMsg = EpmetErrorCode.getMsg(code);
if (StringUtils.isBlank(this.internalMsg)) {
this.internalMsg = MessageUtils.getMessage(code, internalMsg);
}
} else {
this.internalMsg = internalMsg;
}
}
public RenException(int code, String internalMsg, String msg) {
this(code, internalMsg);
this.msg = msg;
}
public RenException(String internalMsg) {
super(internalMsg);
// this.code = ErrorCode.INTERNAL_SERVER_ERROR;
this.code = EpmetErrorCode.SERVER_ERROR.getCode();
this.internalMsg = internalMsg;
}
public RenException(String internalMsg, String msg) {
this(internalMsg);
this.msg = msg;
}
public RenException(int code, String... params) {
this.code = code;
this.msg = EpmetErrorCode.getMsg(code);
if (StringUtils.isBlank(this.msg)) {
this.msg = MessageUtils.getMessage(code, params);
this.internalMsg = EpmetErrorCode.getMsg(code);
if (StringUtils.isBlank(this.internalMsg)) {
this.internalMsg = MessageUtils.getMessage(code, params);
}
}
public RenException(int code, Throwable e) {
super(e);
this.code = code;
this.msg = EpmetErrorCode.getMsg(code);
if (StringUtils.isBlank(this.msg)) {
this.msg = MessageUtils.getMessage(code);
this.internalMsg = EpmetErrorCode.getMsg(code);
if (StringUtils.isBlank(this.internalMsg)) {
this.internalMsg = MessageUtils.getMessage(code);
}
}
@ -50,40 +91,18 @@ public class RenException extends RuntimeException {
}
public RenException(int code, String msg) {
super(msg);
this.code = code;
if (StringUtils.isBlank(msg)) {
this.msg = EpmetErrorCode.getMsg(code);
if (StringUtils.isBlank(this.msg)) {
this.msg = MessageUtils.getMessage(code, msg);
}
} else {
this.msg = msg;
}
}
public RenException(String msg) {
super(msg);
// this.code = ErrorCode.INTERNAL_SERVER_ERROR;
public RenException(String internalMsg, Throwable e) {
super(internalMsg, e);
this.code = EpmetErrorCode.SERVER_ERROR.getCode();
this.msg = msg;
this.internalMsg = internalMsg;
}
public RenException(String msg, Throwable e) {
super(msg, e);
// this.code = ErrorCode.INTERNAL_SERVER_ERROR;
this.code = EpmetErrorCode.SERVER_ERROR.getCode();
this.msg = msg;
public String getInternalMsg() {
return internalMsg;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
public void setInternalMsg(String internalMsg) {
this.internalMsg = internalMsg;
}
public int getCode() {
@ -94,4 +113,11 @@ public class RenException extends RuntimeException {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
}

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

@ -24,7 +24,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.dao.DuplicateKeyException;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
@ -56,12 +55,12 @@ public class RenExceptionHandler {
public Result handleRRException(RenException ex){
if (ex.getCode() > 8000) {
Result result=new Result().error(ex.getCode());
result.setData(ex.getMsg());
result.setData(ex.getInternalMsg());
return result;
}
logger.error(ExceptionUtils.getErrorStackTrace(ex));
Result result=new Result().error();
result.setData(ex.getMsg());
result.setData(ex.getInternalMsg());
return result;
// return new Result().error();
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-gateway-server:
container_name: epmet-gateway-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:0.3.35
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-gateway:version_placeholder
ports:
- "8080:8080"
network_mode: host # 使用现有网络

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

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

3
epmet-gateway/pom.xml

@ -288,10 +288,11 @@
<!-- <gateway.routes.gov-issue-server.uri>http://localhost:8101</gateway.routes.gov-issue-server.uri>-->
<gateway.routes.gov-issue-server.uri>lb://gov-issue-server</gateway.routes.gov-issue-server.uri>
<!-- 23、政府工作端项目管理 -->
<!-- <gateway.routes.gov-project-server.uri>http://localhost:8102</gateway.routes.gov-project-server.uri>-->
<!-- <gateway.routes.gov-project-server.uri>http://localhost:8102</gateway.routes.gov-project-server.uri>-->
<gateway.routes.gov-project-server.uri>lb://gov-project-server</gateway.routes.gov-project-server.uri>
<!-- 24、公共服务 -->
<gateway.routes.common-service-server.uri>lb://common-service-server</gateway.routes.common-service-server.uri>
<!-- <gateway.routes.common-service-server.uri>http://localhost:8103</gateway.routes.common-service-server.uri>-->
<!-- 25、党建园地 -->
<gateway.routes.resi-home-server.uri>lb://resi-home-server</gateway.routes.resi-home-server.uri>
<!-- <gateway.routes.resi-home-server.uri>http://localhost:8104</gateway.routes.resi-home-server.uri>-->

4
epmet-gateway/src/main/java/com/epmet/auth/ExternalAuthProcessor.java

@ -3,7 +3,6 @@ package com.epmet.auth;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.filter.CpProperty;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -15,7 +14,6 @@ import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Component;
import org.springframework.util.AntPathMatcher;
import org.springframework.web.server.ServerWebExchange;
import reactor.core.publisher.Mono;
/**
* 外部应用认证
@ -93,7 +91,7 @@ public class ExternalAuthProcessor extends AuthProcessor {
}
} catch (RenException e) {
//return response(exchange, new Result<>().error(e.getCode(), e.getMsg()));
throw new RenException(e.getCode(),e.getMsg());
throw new RenException(e.getCode(),e.getInternalMsg());
} catch (Exception e) {
logger.error("外部应用请求认证发生未知错误:" + ExceptionUtils.getErrorStackTrace(e));
//return response(exchange, new Result<>().error("外部应用请求认证发生未知错误"));

4
epmet-gateway/src/main/java/com/epmet/auth/InternalAuthProcessor.java

@ -54,7 +54,7 @@ public class InternalAuthProcessor extends AuthProcessor {
baseTokenDto = getBaseTokenDto(token, jwtTokenUtils);
}catch(RenException e){
//return response(exchange,new Result<>().error(e.getCode(),e.getMsg()));
throw new RenException(e.getCode(), e.getMsg());
throw new RenException(e.getCode(), e.getInternalMsg());
}
}else{
baseTokenDto = null;
@ -97,7 +97,7 @@ public class InternalAuthProcessor extends AuthProcessor {
validateTokenDto(baseTokenDto, token);
} catch (RenException e) {
//return response(exchange, new Result<>().error(e.getCode(), e.getMsg()));
throw new RenException(e.getCode(), e.getMsg());
throw new RenException(e.getCode(), e.getInternalMsg());
}
}

1
epmet-gateway/src/main/resources/bootstrap.yml

@ -445,6 +445,7 @@ epmet:
- /data/stats/**
- /epmet/ext/**
- /epmetuser/customerstaff/customerlist
- /message/template/**
swaggerUrls:

43
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java

@ -0,0 +1,43 @@
package com.epmet.project.dto.form;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 数据改版-难点堵点项目排行--接口入参
* @Author jiangyy
*/
@Data
public class DifficultyRankFormDTO implements Serializable {
private static final long serialVersionUID = -2880432640584616651L;
public interface DifficultyRankInternalGroup {}
/**
* 组织Id
*/
@NotBlank(message = "组织ID不能为空",groups = {DifficultyRankInternalGroup.class})
private String agencyId;
/**
* 状态: 待处理: pending; 结案closed
*/
private String status;
/**
* 排序类型 耗时最长timelongest涉及部门最多mostdepts处理次数mosthandled
*/
@NotBlank(message = "排序类型不能为空", groups = {DifficultyRankInternalGroup.class})
private String type;
/**
* 获取数据个数 默认前10
*/
private Integer topNum = 10;
@Min(value = 1, groups = {DifficultyRankInternalGroup.class})
private Integer pageNo;
/**
* 组织类型: 网格grid 组织agency
*/
private String orgType;
}

59
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java

@ -0,0 +1,59 @@
package com.epmet.project.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数 返参DTO
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @ClassName DifficultProjectResultDTO
* @Auth jiangyy
* @Date 2020-08-20 13:43
*/
@Data
public class ProjectDifficultRankResultDTO implements Serializable {
private static final long serialVersionUID = -7338625142484943434L;
/**
* 项目id
* */
private String projectId;
/**
* 项目标题
* */
private String title;
/**
* 状态: 待处理: pending; 结案closed
* */
private String statusCode;
/**
* 社区-网格名
* */
private String gridName;
/**
* 图片列表
* */
private List<String> imgUrlList;
/**
* 耗时单位分钟
* */
private Integer totalHours;
/**
* 涉及多少个部门
* */
private Integer reOrg;
/**
* 处理次数
* */
private Integer handledCount;
}

34
epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java

@ -0,0 +1,34 @@
package com.epmet.project.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 难点赌点-当前登录人员本级一级下一级组织机构/网格 返参DTO
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @ClassName DifficultProjectResultDTO
* @Auth jiangyy
* @Date 2020-08-20 13:43
*/
@Data
public class ProjectNextAgencyResultDTO implements Serializable {
private static final long serialVersionUID = -7338625142484943434L;
/**
* 组织id
* */
private String orgId;
/**
* 组织名称
* */
private String orgName;
/**
* 网格grid 组织agency
* */
private String orgType;
}

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.36
image: 192.168.1.130:10080/epmet-cloud-dev/data-report-server:version_placeholder
ports:
- "8109:8109"
network_mode: host # 使用现有网络

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

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

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

@ -14,6 +14,11 @@
<modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>gov-org-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>data-report-client</artifactId>

34
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java

@ -1,13 +1,14 @@
package com.epmet.module.project.controller;
package com.epmet.datareport.controller.project;
import com.epmet.commons.tools.annotation.LoginUser;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.module.project.service.ProjectService;
import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
@ -91,4 +92,33 @@ public class ProjectController {
return new Result<ProjectDetailResultDTO>().ok(projectService.projectDetail(processListFormDTO));
}
/**
* @param param
* @return
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数 返回该组织下所有的难点堵点的 数据
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @author jiangyy
* @date 2020.10.19 16:38
**/
@PostMapping("difficultyrank")
public Result<List<ProjectDifficultRankResultDTO>> difficultyRank(@RequestBody DifficultyRankFormDTO param){
ValidatorUtils.validateEntity(param, DifficultyRankFormDTO.DifficultyRankInternalGroup.class);
return new Result<List<ProjectDifficultRankResultDTO>>().ok(projectService.getDifficultyRank(param));
}
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param tokenDto
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@PostMapping("mynextagency")
public Result<List<ProjectNextAgencyResultDTO>> myNextAgency(@LoginUser TokenDto tokenDto){
return new Result<List<ProjectNextAgencyResultDTO>>().ok(projectService.getMyNextAgency(tokenDto));
}
}

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java

@ -1,6 +1,7 @@
package com.epmet.datareport.dao.project;
import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -55,4 +56,22 @@ public interface ProjectDao {
* @Description 查询机关月统计近十二个月数据
**/
List<ProjectIncrTrendResultDTO> selectIncrTrendMonthly(@Param("agencyId") String agencyId);
/**
* @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数
* @param
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
List<ProjectDifficultRankResultDTO> difficultyRank(DifficultyRankFormDTO difficultyRankFormDTO);
/**
* @Description 查询难点堵点的图片list
* @param
* @return
* @author jiangyy
* @date 2020.10.20 10:13
**/
List<String> getDifficultyImgList(String eventId);
}

22
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java

@ -1,6 +1,7 @@
package com.epmet.module.project.service;
package com.epmet.datareport.service.project;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.*;
@ -50,4 +51,23 @@ public interface ProjectService {
* @date 2020/10/23 10:33 上午
*/
ProjectDetailResultDTO projectDetail( ProcessListFormDTO processListFormDTO);
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param param
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
List<ProjectDifficultRankResultDTO> getDifficultyRank(DifficultyRankFormDTO param);
/**
* @Description 难点赌点-获取组织下拉框
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
List<ProjectNextAgencyResultDTO> getMyNextAgency(TokenDto tokenDto);
}

111
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java

@ -1,25 +1,32 @@
package com.epmet.datareport.service.project.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.project.ProjectDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenDifficultyDataService;
import com.epmet.datareport.service.project.ProjectService;
import com.epmet.dto.CustomerAgencyDTO;
import com.epmet.dto.form.LoginUserDetailsFormDTO;
import com.epmet.dto.form.ProcessListFormDTO;
import com.epmet.dto.result.LoginUserDetailsResultDTO;
import com.epmet.dto.result.ProcessAndCurrentDeptResultDTO;
import com.epmet.dto.form.SubAgencyFormDTO;
import com.epmet.dto.result.*;
import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.module.project.service.ProjectService;
import com.epmet.project.constant.ProjectConstant;
import com.epmet.project.dto.FactAgencyProjectDailyDTO;
import com.epmet.project.dto.form.DifficultyRankFormDTO;
import com.epmet.project.dto.form.ProjectIncrTrendFormDTO;
import com.epmet.project.dto.result.ProjectDetailResultDTO;
import com.epmet.project.dto.result.*;
import com.github.pagehelper.PageHelper;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -47,6 +54,9 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired
private ScreenDifficultyDataService screenDifficultyDataService;
@Autowired
private GovOrgOpenFeignClient govOrgOpenFeignClient;
/**
* @Author sun
* @Description 数据-项目-获取汇总数据
@ -219,4 +229,99 @@ public class ProjectServiceImpl implements ProjectService {
return agencyId;
}
/**
* @author jiangyy
* @Description 获取userId
*/
private String getLoginUserUserId(TokenDto tokenDto) {
LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO();
BeanUtils.copyProperties(tokenDto, dto);
LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData();
String userId = data.getUserId();
if (null == userId || "".equals(userId)) {
throw new RenException(ProjectConstant.GET_AGENCYID);
}
return userId;
}
/**
* @Description 难点赌点-获取组织下拉框
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@Override
public List<ProjectNextAgencyResultDTO> getMyNextAgency(TokenDto tokenDto) {
List<ProjectNextAgencyResultDTO> resultList = new ArrayList<>();
//1、根据token获取本级agencyId、获取userId
String agencyId = getLoginUserDetails(tokenDto);
String userId=getLoginUserUserId(tokenDto);
//2、获取本级组织机构
Result<CustomerAgencyDTO> customerAgencyDTO = govOrgOpenFeignClient.getAgencyById(agencyId);
ProjectNextAgencyResultDTO angencyDto = new ProjectNextAgencyResultDTO();
angencyDto.setOrgId(agencyId);
angencyDto.setOrgName(customerAgencyDTO.getData().getOrganizationName());
angencyDto.setOrgType(customerAgencyDTO.getData().getLevel());
resultList.add(angencyDto);
//3、获取下一级组织机构\网格
if ("community".equals(customerAgencyDTO.getData().getLevel())) {
//取下级网格
Result<List<GridByStaffResultDTO>> gridListResult = govOrgOpenFeignClient.listGridsbystaffid(userId);
List<GridByStaffResultDTO> gridList = gridListResult.getData();
for (int i = 0; i < gridList.size(); i++) {
ProjectNextAgencyResultDTO subAgencyDto = new ProjectNextAgencyResultDTO();
subAgencyDto.setOrgId(gridList.get(i).getGridId());
subAgencyDto.setOrgName(gridList.get(i).getGridName());
subAgencyDto.setOrgType("grid");
resultList.add(subAgencyDto);
}
} else {
//取下级组织机构
SubAgencyFormDTO form = new SubAgencyFormDTO();
form.setAgencyId(agencyId);
form.setAgencyNum(100);
Result<SubAgencyResultDTO> SubAgencyResultDTO = govOrgOpenFeignClient.subAgencyList(form);
List<SubListResultDTO> subAgencyList = SubAgencyResultDTO.getData().getAgencyList();
for(int i=0;i<subAgencyList.size();i++){
ProjectNextAgencyResultDTO subAgencyDto = new ProjectNextAgencyResultDTO();
subAgencyDto.setOrgId(subAgencyList.get(i).getAgencyId());
subAgencyDto.setOrgName(subAgencyList.get(i).getAgencyName());
subAgencyDto.setOrgType(subAgencyList.get(i).getAgencyLevel());
resultList.add(subAgencyDto);
}
}
if(null == resultList) return new ArrayList<>();
return resultList;
}
/**
* @Description 难点赌点-耗时最长|涉及部门最多|处理次数
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614
* @param param
* @return
* @author jiangyy
* @date 2020.10.19 16:38
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<ProjectDifficultRankResultDTO> getDifficultyRank(DifficultyRankFormDTO param) {
PageHelper.startPage(null == param.getPageNo() ? NumConstant.ONE:param.getPageNo(),param.getTopNum());
List<ProjectDifficultRankResultDTO> result = projectDao.difficultyRank(param);
for (int i = 0; i < result.size (); i ++){
List<String> imgUrlList ;
imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId()) ;
result.get(i).setImgUrlList(imgUrlList);
}
if(null == result) return new ArrayList<>();
return result;
}
}

41
epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml

@ -234,4 +234,45 @@
)a ORDER BY a.month_id DESC,a.type ASC
</select>
<!-- 查询难点赌点-耗时最长|涉及部门最多|处理次数 -->
<select id="difficultyRank" resultType="com.epmet.project.dto.result.ProjectDifficultRankResultDTO">
SELECT
diff.EVENT_ID AS projectId,
diff.EVENT_CONTENT AS title,
diff.EVENT_STATUS_CODE AS statusCode,
diff.EVENT_SOURCE AS gridName,
diff.EVENT_IMG_URL AS imgUrl,
floor(diff.EVENT_COST_TIME/60) AS totalHours,
diff.EVENT_RE_ORG AS reOrg,
diff.EVENT_HANDLED_COUNT AS handledCount
FROM
screen_difficulty_data diff
WHERE
diff.DEL_FLAG = '0'
<choose>
<when test="orgType != null and orgType == 'grid'">
AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR}
</when>
<otherwise>
AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')
</otherwise>
</choose>
<if test="status!= null and status != ''">
AND diff.EVENT_STATUS_CODE = #{status}
</if>
ORDER BY
CASE #{type} WHEN 'timelongest' THEN diff.EVENT_COST_TIME
WHEN 'mosthandled' THEN diff.EVENT_HANDLED_COUNT
ELSE diff.EVENT_RE_ORG END
DESC
</select>
<!-- 查询难点赌点-耗时最长|涉及部门最多|处理次数 -->
<select id="getDifficultyImgList" resultType="string">
select EVENT_IMG_URL
FROM
screen_difficulty_img_data
WHERE EVENT_ID = #{eventId}
ORDER BY SORT
</select>
</mapper>

3
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml

@ -10,7 +10,6 @@
diff.EVENT_CONTENT AS title,
diff.EVENT_STATUS_CODE AS STATUS,
ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours,
DATE_FORMAT( eve.EVENT_CREATE_TIME, '%Y-%m-%d %H:%i' ) AS createDateTime,
diff.EVENT_SOURCE AS gridName,
diff.EVENT_IMG_URL AS imgUrl,
diff.EVENT_CATEGORY_NAME AS categoryName,
@ -18,8 +17,6 @@
diff.EVENT_RE_ORG AS handleCount
FROM
screen_difficulty_data diff
LEFT JOIN screen_event_data eve ON diff.EVENT_ID = eve.EVENT_ID
AND eve.DEL_FLAG = '0'
WHERE
diff.DEL_FLAG = '0'
AND diff.ALL_PARENT_IDS LIKE CONCAT('%',#{agencyId},'%')

25
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgResponseTimeResultDTO.java

@ -1,25 +0,0 @@
package com.epmet.dto.extract.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Description 各机关响应时间
* @ClassName OrgResponseTimeResultDTO
* @Auth wangc
* @Date 2020-09-21 02:03
*/
@Data
public class OrgResponseTimeResultDTO implements Serializable {
private static final long serialVersionUID = 6017440139236985959L;
private String agencyId;
private BigDecimal responseTime;
private BigDecimal projectTotal;
private BigDecimal distinctProjectTotal;
}

114
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectOrgRelationDTO.java

@ -0,0 +1,114 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
* <p>
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto.project;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 项目机关历时关系表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-10-19
*/
@Data
public class ProjectOrgRelationDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
*
*/
private String id;
/**
* 关联PROJECT_STAFF由此ID可以关联出PROJECT_IDCUSTOMER_IDPROCESS_ID
*/
private String projectStaffId;
/**
* 流转到的日期 同CREATED_TIME
*/
private Date informedDate;
/**
* 流转走或结案的日期
*/
private Date handledDate;
/**
* 节点耗时从流转到自己到流转走共耗时单位分钟如果项目还没有结案且该项目在这个组织下一直滞留这一项为空
* 8*60的倍数
*/
private Integer totalPeriod;
/**
* 第一次响应时间
*/
private Date firstDealtDate;
/**
* 首次响应时长单位分钟
* 8*60的倍数
*/
private Integer firstReplyPeriod;
/**
* 来源动作return(回退)transfer(流转)closed(结案)response(响应)created(立项时第一个流转到的)
*/
private String sourceOperation;
/**
* 处理动作return(回退)transfer(流转)closed(结案)response(响应)
*/
private String operation;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
*
*/
private Date createdTime;
/**
*
*/
private String createdBy;
/**
*
*/
private Date updatedTime;
/**
*
*/
private String updatedBy;
}

3
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectOrgPeriodResultDTO.java

@ -7,7 +7,6 @@ import java.util.Date;
/**
* @Description 从数据库中查询出的 项目 - 机关网格部门机关的响应时长
* FIXME 查询的全都是已经结案的项目如果查询流转中的项目需要修改逻辑较为复杂
* @ClassName ProjectOrgPeriodResultDTO
* @Auth wangc
* @Date 2020-09-16 15:28
@ -92,4 +91,6 @@ public class ProjectOrgPeriodResultDTO implements Serializable {
private String isResolved;
private String projectStaffId;
}

27
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/DifficultyIfExistedResultDTO.java

@ -1,27 +0,0 @@
package com.epmet.dto.screen.result;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Description 判断难点赌点是否有数据的返回DTO
* @ClassName DifficultyIfExistedResultDTO
* @Auth wangc
* @Date 2020-09-28 10:45
*/
@Data
public class DifficultyIfExistedResultDTO implements Serializable {
private static final long serialVersionUID = -2278401165059196896L;
/**
* 是否有数据 true false
*/
private boolean ifExisted = false;
/**
* 已经结案的项目Id集合
*/
private List<String> closedIds;
}

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.48
image: 192.168.1.130:10080/epmet-cloud-dev/data-statistical-server:version_placeholder
ports:
- "8108:8108"
network_mode: host # 使用现有网络

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

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

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

@ -7,7 +7,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.IndexCalConstant;
import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
@ -21,6 +20,7 @@ import com.epmet.dto.AgencySubTreeDto;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity;
@ -34,7 +34,6 @@ import com.epmet.entity.stats.DimDateEntity;
import com.epmet.entity.stats.DimMonthEntity;
import com.epmet.service.StatsDemoService;
import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService;
import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService;
import com.epmet.service.evaluationindex.extract.toscreen.*;
import com.epmet.service.evaluationindex.indexcal.*;
@ -742,4 +741,12 @@ public class DemoController {
return new Result();
}
@Autowired
private ScreenGrassrootsGovernDataAbsorptionService wc;
@PostMapping("wc")
public Result wc(@RequestBody ScreenCentralZoneDataFormDTO param){
wc.difficultyDataHub(param);
return new Result();
}
}

29
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java

@ -18,12 +18,10 @@
package com.epmet.dao.evaluationindex.extract;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.extract.result.OrgResponseTimeResultDTO;
import com.epmet.dto.extract.result.OrgStatisticsResultDTO;
import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.PostMapping;
import java.util.List;
@ -45,15 +43,6 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
**/
int selectIfExisted(@Param("customerId") String customerId);
/**
* @Description 在插入之前先删除所有与这个项目相关的历时信息
* @param list
* @return
* @author wangc
* @date 2020.09.17 14:43
**/
void deleteByProjectId(@Param("projectId") String projectId);
/**
* 获取项目响应度
* @author zhaoqifeng
@ -85,24 +74,6 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao<FactOriginPr
**/
void insertBatch(@Param("list") List<FactOriginProjectOrgPeriodDailyEntity> list);
/**
* @Description 查找网格部门对项目的办结系数
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:13
**/
List<OrgResponseTimeResultDTO> selectSubOrgResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
/**
* @Description 查找机关对项目的办结系数
* @param customerId
* @return
* @author wangc
* @date 2020.09.21 02:13
**/
List<OrgResponseTimeResultDTO> selectAgencyResponseCoefficient(@Param("customerId") String customerId,@Param("dimId") String dimId, @Param("dateType") String dateType);
/**
* 部门处理效率统计
* @author zhaoqifeng

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

@ -21,7 +21,6 @@ import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.ProjectInfoDTO;
import com.epmet.entity.project.ProjectEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -103,4 +102,15 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
* @return java.lang.String
*/
String selectParameterValueByKey(@Param("customerId") String customerId);
/**
* @Description 得到超过阈值滞留的项目Id集合
* 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
* @param customerId
* @param exclude
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.11.06 14:14
*/
List<String> selectOvertimeProjectIds(@Param("customerId") String customerId,@Param("exclude") List<String> exclude,@Param("value") Integer value);
}

33
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java

@ -20,6 +20,7 @@ package com.epmet.dao.project;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
@ -28,6 +29,7 @@ import com.epmet.entity.project.ProjectProcessEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
@ -106,6 +108,15 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
**/
List<ProjectOrgPeriodResultDTO> selectProjectOrgPeriod(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId);
/**
* @Description 根据项目业务改造在数据抽取时直接查询出项目节点的耗时
* @param
* @return java.util.List<com.epmet.dto.project.result.ProjectOrgPeriodResultDTO>
* @author wangc
* @date 2020.10.23 11:13
*/
List<ProjectOrgPeriodResultDTO> selectProjectOrgPeriodDirectly(@Param("customerId") String customerId,@Param("projectStatus")String projectStatus,@Param("dateId") String dateId);
/**
* @Description 查询项目-机关各个节点的响应列表
* @param projects
@ -115,6 +126,15 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
**/
List<ProjectOrgRelationWhenResponseResultDTO> selectResponseTrace(@Param("projects") List<String> projects);
/**
* @Description 查询项目的节点
* @param projects
* @return java.util.List<com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO>
* @author wangc
* @date 2020.10.23 17:02
*/
List<ProjectOrgRelationWhenResponseResultDTO> selectProjectProcess(@Param("projects") List<String> projects);
/**
* 获取办结组织
* @author zhaoqifeng
@ -132,5 +152,16 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @author wangc
* @date 2020.09.28 14:45
*/
List<ProjectLatestOperationResultDTO> selectLatestOperation(@Param("list") List<String> list);
List<ProjectLatestOperationResultDTO> selectLatestOperation(@Param("list") List<String> list,@Param("customerId") String customerId);
/**
* @Description 查找项目标题
* @param list
* @return java.util.List<com.epmet.dto.project.result.ProjectLatestOperationResultDTO>
* @author wangc
* @date 2020.09.28 14:45
*/
List<ProjectLatestOperationResultDTO> selectProjectTitle(@Param("list") List<String> list,@Param("customerId") String customerId);
}

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenDifficultyDataEntity.java

@ -80,6 +80,11 @@ public class ScreenDifficultyDataEntity extends BaseEpmetEntity {
*/
private String eventContent;
/**
* 事件标题
*/
private String eventTitle;
/**
* 事件耗时 单位分钟
*/

10
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java

@ -135,14 +135,14 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService
}
List<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
List<String> agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(Optional.ofNullable(agencyHandleCount.get(entity.getAgencyId())).orElse(NumConstant.ZERO));
//办结率

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollDistrictServiceImpl.java

@ -128,16 +128,16 @@ public class IndexCollDistrictServiceImpl implements IndexCollDistrictService {
}));
}
List<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
List<String> agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
//办结率
entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
//办结效率

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java

@ -126,16 +126,16 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService {
}));
}
List<String> agencies = agencyList.stream().map(DimAgencyDTO :: getId).distinct().collect(Collectors.toList());
List<String> agencies = agencyList.stream().map(DimAgencyDTO::getId).distinct().collect(Collectors.toList());
//办结数
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies,customerId,dimId.getMonthId(),"month");
Map<String, Integer> agencyHandleCount = factOriginProjectLogDailyService.getProjectHandledAgency(agencies, customerId, dimId.getMonthId());
//办结率
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies,customerId,dimId.getMonthId(),"month");
Map<String, BigDecimal> handlingRatioMap = factOriginProjectLogDailyService.getHandlingRatio(agencies, customerId, dimId.getMonthId());
//处理效率
Map<String,BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId,dimId.getMonthId(),"month");
list.forEach(entity ->{
Map<String, BigDecimal> efficiencyMap = factOriginProjectLogDailyService.getAgencyWorkPieceRatio(customerId, dimId.getMonthId());
list.forEach(entity -> {
//办结数
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
entity.setClosedProjectCount(agencyHandleCount.get(entity.getAgencyId()) == null ? NumConstant.ZERO : agencyHandleCount.get(entity.getAgencyId()));
//办结率
entity.setClosedProjectRatio(Optional.ofNullable(handlingRatioMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO));
//办结效率

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java

@ -2,11 +2,9 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.extract.form.ExtractIndexFormDTO;
import com.epmet.service.evaluationindex.extract.dataToIndex.*;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.util.DimIdGenerator;
import com.google.common.util.concurrent.ThreadFactoryBuilder;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -16,7 +14,6 @@ import org.springframework.util.CollectionUtils;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.concurrent.*;
@ -107,16 +104,19 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService
log.error("抽取【网格服务能力数据】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
//dimAgency
indexCollStreetService.saveStreetAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【街道治理能力-街道党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
//dimAgency
indexCollCommunityService.saveCommunityAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【社区治理能力-社区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);
}
try{
//dimAgency
indexCollDistrictService.saveDistrictAbility(customerId, monthId);
}catch (Exception e){
log.error("抽取【全区治理能力-全区党建能力-服务能力】发生异常,参数:" + JSON.toJSONString(param), e);

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java

@ -168,13 +168,13 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
List<OrgStatisticsResultDTO> getDepTransferCount(String customerId, String monthId, String level);
/**
* @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目
* @param agencies
* @return
* @Description 查询各机关办结(办结的含义指每个项目的结点中最高的机关)了多少项目
* @author wangc
* @date 2020.09.20 23:46
**/
Map<String,Integer> getProjectHandledAgency(List<String> agencies, String customerId, String dimId,String dateType);
Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId, String dimId);
/**
* @Description 办结率
@ -184,8 +184,8 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @return
* @author wangc
* @date 2020.09.23 10:06
**/
Map<String,BigDecimal> getHandlingRatio(List<String> agencies, String customerId,String dimId,String dateType);
**/
Map<String, BigDecimal> getHandlingRatio(List<String> agencies, String customerId, String dimId);
/**
* @Description 计算机关办结项目效率
@ -193,8 +193,8 @@ public interface FactOriginProjectLogDailyService extends BaseService<FactOrigin
* @return
* @author wangc
* @date 2020.09.21 02:16
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio( String customerId,String dimId,String dateType);
**/
Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId);
/**
* 网格项目响应度

12
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/ProjectExtractService.java

@ -2,6 +2,9 @@ package com.epmet.service.evaluationindex.extract.todata;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import java.util.List;
/**
* @author zhaoqifeng
@ -29,4 +32,13 @@ public interface ProjectExtractService {
* @date 2020.09.17 14:05
**/
void extractProjectPeriodData(ExtractOriginFormDTO param);
/**
* @Description 项目节点耗时数据补齐
* @param
* @return java.util.List<com.epmet.dto.project.result.ProjectOrgPeriodResultDTO>
* @author wangc
* @date 2020.10.26 10:18
*/
void projectProcessCostTimeDataCompensation();
}

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

@ -38,7 +38,6 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.naming.LinkLoopException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
@ -171,43 +170,43 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
}
/**
* @Description 查询各机关办结的项目数
* @param agencies
* @return
* @Description 查询各机关办结的项目数
* @author wangc
* @date 2020.09.20 23:46
**/
@Override
public Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId,String dimId, String dateType) {
public Map<String, Integer> getProjectHandledAgency(List<String> agencies, String customerId, String dimId) {
Map<String, Integer> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> countList = baseDao.selectAgencyHandledProjectCount(agencies,customerId,dimId);
if(!CollectionUtils.isEmpty(countList)){
result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
List<ProjectParticipatedAgencyResultDTO> countList = baseDao.selectAgencyHandledProjectCount(agencies, customerId, dimId);
if (!CollectionUtils.isEmpty(countList)) {
result = countList.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount));
}
return result;
}
/**
* @Description 办结率
* @param agencies
* @param dimId
* @param dateType - 日期维度类型 month date week quarter year
* @return
* @Description 办结率
* @author wangc
* @date 2020.09.23 10:06
**/
@Override
public Map<String, BigDecimal> getHandlingRatio(List<String> agencies, String customerId,String dimId, String dateType) {
public Map<String, BigDecimal> getHandlingRatio(List<String> agencies, String customerId, String dimId) {
//计算方式:“评价周期内被吹哨且办结(无论是哪一级办结)的项目数”/“评价周期内被吹哨的所有项目数”
Map<String,BigDecimal> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies,customerId,dimId);
if(!CollectionUtils.isEmpty(projectAgencyCount)){
Map<String,Integer> whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
List<ProjectParticipatedAgencyResultDTO> whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies,customerId,dimId);
Map<String,Integer> whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId,ProjectParticipatedAgencyResultDTO::getCount));
whistledAndHandledProjectTotalMap.forEach((agencyId,count) -> {
Map<String, BigDecimal> result = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectAgencyCount = baseDao.selectWhistledAgencyClosedProjectCount(agencies, customerId, dimId);
if (!CollectionUtils.isEmpty(projectAgencyCount)) {
Map<String, Integer> whistledAndHandledProjectTotalMap = projectAgencyCount.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount));
List<ProjectParticipatedAgencyResultDTO> whistledProjectTotal = baseDao.selectAgencyWhistledCount(agencies, customerId, dimId);
Map<String, Integer> whistledProjectTotalMap = whistledProjectTotal.stream().collect(Collectors.toMap(ProjectParticipatedAgencyResultDTO::getAgencyId, ProjectParticipatedAgencyResultDTO::getCount));
whistledAndHandledProjectTotalMap.forEach((agencyId, count) -> {
//分母 被吹哨项目数
Integer denominator = whistledProjectTotalMap.get(agencyId);
if(null == denominator || NumConstant.ZERO == denominator){
@ -222,22 +221,22 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl<FactOr
}
/**
* @Description 计算机关办结项目效率
* @param
* @return
* @Description 计算机关办结项目效率
* @author wangc
* @date 2020.09.21 02:16
**/
@Override
public Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId,String dimId, String dateType) {
public Map<String, BigDecimal> getAgencyWorkPieceRatio(String customerId, String dimId) {
//计算方法 : 评价周期内办结项目的平均处理时长的倒数
//1.评价周期内结案了的项目
List<ProjectParticipatedAgencyResultDTO> projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId,dimId);
Map<String,BigDecimal> efficiencyMap = new HashMap<>();
if(!CollectionUtils.isEmpty(projectsHandledByAgency)){
Map<String,List<String>> agencyProjectsMap = new HashMap<>();
List<ProjectParticipatedAgencyResultDTO> projectsHandledByAgency = baseDao.selectProjectIdHandledByAgency(customerId, dimId);
Map<String, BigDecimal> efficiencyMap = new HashMap<>();
if (!CollectionUtils.isEmpty(projectsHandledByAgency)) {
Map<String, List<String>> agencyProjectsMap = new HashMap<>();
projectsHandledByAgency.forEach(o -> {
String agencyId = o.getAgencyId();

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

@ -244,6 +244,7 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl<FactO
*/
@Override
public List<ScreenDifficultyDataEntity> getDifficultyBaseInfo(String customerId, List<String> list) {
if(CollectionUtils.isEmpty(list)) return null;
return baseDao.selectDifficultyBaseInfo(customerId,list);
}

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

@ -16,6 +16,7 @@ import com.epmet.dto.issue.IssueDTO;
import com.epmet.dto.party.PartyMemberDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.dto.topic.ResiTopicDTO;
@ -31,6 +32,7 @@ import com.epmet.service.evaluationindex.extract.todata.ProjectExtractService;
import com.epmet.service.partymember.PartyMemberService;
import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.stats.DimCustomerService;
import com.epmet.service.topic.TopicService;
import com.epmet.util.DimIdGenerator;
import lombok.extern.slf4j.Slf4j;
@ -40,10 +42,8 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
import java.util.stream.Collector;
import java.util.stream.Collectors;
/**
@ -73,6 +73,8 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient;
@Autowired
private FactOriginProjectOrgPeriodDailyDao factOriginProjectOrgPeriodDailyDao;
@Autowired
private DimCustomerService dimCustomerService;
private final static String ONE_DAY = "<1";
@ -398,7 +400,7 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
param.setDateId(DateUtils.getBeforeNDay(NumConstant.ONE));
}
List<ProjectOrgPeriodResultDTO> extractData =
projectProcessService.getProjectPeriod(isFirst, param.getCustomerId(), param.getDateId());
projectProcessService.getProjectPeriodDirectly(isFirst, param.getCustomerId(), param.getDateId());
List<FactOriginProjectOrgPeriodDailyEntity> formattingData = new LinkedList<>();
extractData.forEach(original -> {
FactOriginProjectOrgPeriodDailyEntity dest
@ -447,6 +449,27 @@ public class ProjectExtractServiceImpl implements ProjectExtractService {
}
}
/**
* @Description 项目节点耗时数据补齐
* @param
* @return java.util.List<com.epmet.dto.project.result.ProjectOrgPeriodResultDTO>
* @author wangc
* @date 2020.10.26 10:18
*/
@Override
public void projectProcessCostTimeDataCompensation() {
List<String> customers = dimCustomerService.getAllCustomerId();
if(CollectionUtils.isEmpty(customers)) return ;
customers.forEach(local -> {
// projectProcessService.getProjectPeriod(true, local,null);
});
System.out.println("-------------EndPointHere----------------");
}
/**
* 工作日计算

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

@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.dto.org.GridInfoDTO;
import com.epmet.dto.screen.form.ProjectSourceMapFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity;
@ -18,6 +17,7 @@ import com.epmet.service.evaluationindex.screen.ScreenPartyUserRankDataService;
import com.epmet.service.org.CustomerGridService;
import com.epmet.service.point.UserPointService;
import com.epmet.service.project.ProjectProcessService;
import com.epmet.service.project.ProjectService;
import com.epmet.service.topic.TopicService;
import com.epmet.service.user.UserService;
import lombok.extern.slf4j.Slf4j;
@ -63,6 +63,8 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
private ProjectProcessService projectProcessService;
@Autowired
private TopicService topicService;
@Autowired
private ProjectService projectService;
/**
* @Description 用户积分党员分值数据中转站
* @param param
@ -135,15 +137,20 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
**/
@Override
public void difficultyDataHub(ScreenCentralZoneDataFormDTO param) {
//验证是否存在
DifficultyIfExistedResultDTO existedMap = screenDifficultyDataService.selectExistedInfo(param.getCustomerId());
//查询难点赌点中有无已结案的项目,若有则保留
List<String> existed = screenDifficultyDataService.selectExistedInfo(param.getCustomerId());
//查询数据
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),existedMap.getClosedIds());
List<ScreenDifficultyDataEntity> difficulties = factOriginProjectMainDailyService.getDifficultyBaseInfo(param.getCustomerId(),projectService.getOvertimeProjectByParameter(param.getCustomerId(),existed));
if(CollectionUtils.isEmpty(difficulties)) return;
List<String> projectIds = difficulties.stream().map(ScreenDifficultyDataEntity :: getEventId).distinct().collect(Collectors.toList());
//最近一次操作
Map<String,String> latestOperationMap = projectProcessService.selectLatestOperation(projectIds,param.getCustomerId());
Map<String,String> latestOperationMap = projectProcessService.getLatestOperation(projectIds,param.getCustomerId());
//标题
Map<String,String> titleMap = projectProcessService.getProjectTitle(projectIds,param.getCustomerId());
boolean isOperationNull = CollectionUtils.isEmpty(latestOperationMap) ? true : false;
boolean isTitleNull = CollectionUtils.isEmpty(titleMap) ? true : false;
//图片
List<ProjectSourceMapFormDTO> projectSourceMap = factOriginProjectMainDailyService.getNewProject(param.getCustomerId(),projectIds);
@ -163,6 +170,9 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr
if(!isOperationNull){
diff.setLatestOperateDesc(latestOperationMap.get(diff.getEventId()));
}
if(!isTitleNull){
diff.setEventTitle(titleMap.get(diff.getEventId()));
}
diff.setDataEndTime(DateUtils.getBeforeNDay(NumConstant.ONE));
});
List<ScreenDifficultyImgDataEntity> imgList = new LinkedList<>();

3
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenDifficultyDataService.java

@ -18,7 +18,6 @@
package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
@ -39,7 +38,7 @@ public interface ScreenDifficultyDataService extends BaseService<ScreenDifficult
* @author wangc
* @date 2020.09.28 10:53
*/
DifficultyIfExistedResultDTO selectExistedInfo(String customerId);
List<String> selectExistedInfo(String customerId);
/**

14
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenDifficultyDataServiceImpl.java

@ -24,7 +24,6 @@ import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.evaluationindex.screen.ScreenDifficultyDataDao;
import com.epmet.dto.screen.result.DifficultyIfExistedResultDTO;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenDifficultyImgDataEntity;
import com.epmet.service.evaluationindex.screen.ScreenDifficultyDataService;
@ -47,16 +46,9 @@ public class ScreenDifficultyDataServiceImpl extends BaseServiceImpl<ScreenDiffi
@Override
public DifficultyIfExistedResultDTO selectExistedInfo(String customerId) {
int count = baseDao.selectCountByCustomerId(customerId);
DifficultyIfExistedResultDTO existedMap = new DifficultyIfExistedResultDTO();
if (count <= NumConstant.ZERO) {
existedMap.setIfExisted(true);
} else {
existedMap.setClosedIds(baseDao.selectClosedProjectId(customerId));
}
return existedMap;
public List<String> selectExistedInfo(String customerId) {
if (baseDao.selectCountByCustomerId(customerId) > NumConstant.ZERO) return baseDao.selectClosedProjectId(customerId);
return null;
}
@Override

26
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java

@ -93,16 +93,18 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
*/
List<ProjectProcessEntity> getClosedProjectList(String customerId, String date);
/**
* @Description 查询各机关项目节点历时
* @param isFirst 是否首次
* @Description 直接从项目业务改造获取项目节点耗时信息
* @param isFirst
* @param customerId
* @param date
* @return
* @return java.util.List<com.epmet.dto.project.result.ProjectOrgPeriodResultDTO>
* @author wangc
* @date 2020.09.18 13:38
**/
List<ProjectOrgPeriodResultDTO> getProjectPeriod(Boolean isFirst,String customerId,String date);
* @date 2020.10.23 09:10
*/
List<ProjectOrgPeriodResultDTO> getProjectPeriodDirectly(Boolean isFirst,String customerId, String date);
/**
* 获取办结组织
@ -122,6 +124,16 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
* @author wangc
* @date 2020.09.28 14:44
*/
Map<String,String> selectLatestOperation(List<String> list, String customerId);
Map<String,String> getLatestOperation(List<String> list, String customerId);
/**
* @Description 获取项目标题
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.10.27 14:34
*/
Map<String,String> getProjectTitle(List<String>list ,String customerId);
}

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

@ -99,4 +99,15 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @return java.lang.String
*/
String getParameterValueByKey(String customerId);
/**
* @Description 得到超过阈值滞留的项目Id集合
* 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
* @param customerId
* @param exclude
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.11.06 14:14
*/
List<String> getOvertimeProjectByParameter(String customerId,List<String> exclude);
}

112
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java

@ -20,11 +20,13 @@ package com.epmet.service.project.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectProcessDao;
import com.epmet.dto.form.CommonStaffIdFormDTO;
import com.epmet.dto.project.FinishOrgDTO;
import com.epmet.dto.project.ProcessInfoDTO;
import com.epmet.dto.project.ProjectOrgRelationDTO;
import com.epmet.dto.project.result.ProjectLatestOperationResultDTO;
import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO;
import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO;
@ -86,43 +88,24 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
return baseDao.selectClosedProjectList(customerId, date);
}
/**
* @Description 查询各机关项目节点历时
* @param isFirst 是否首次
* @Description 直接从项目业务改造获取项目节点耗时信息
* @param isFirst
* @param customerId
* @param date
* @return
* @return java.util.List<com.epmet.dto.project.result.ProjectOrgPeriodResultDTO>
* @author wangc
* @date 2020.09.18 13:38
**/
* @date 2020.10.23 09:10
*/
@Override
public List<ProjectOrgPeriodResultDTO> getProjectPeriod(Boolean isFirst,String customerId, String date) {
List<ProjectOrgPeriodResultDTO> projectNodePeriodPerOrgList;
public List<ProjectOrgPeriodResultDTO> getProjectPeriodDirectly(Boolean isFirst, String customerId, String date) {
if(isFirst){
projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,null);
return baseDao.selectProjectOrgPeriodDirectly(customerId,null,null);
}else{
projectNodePeriodPerOrgList = baseDao.selectProjectOrgPeriod(customerId,null,date);
}
if(!CollectionUtils.isEmpty(projectNodePeriodPerOrgList)){
Map<String,List<ProjectOrgPeriodResultDTO>> processMap
= projectNodePeriodPerOrgList.stream().collect(Collectors.groupingBy(ProjectOrgPeriodResultDTO :: getProcessId));
List<String> projects =
projectNodePeriodPerOrgList.stream().map(ProjectOrgPeriodResultDTO::getProjectId).distinct().collect(Collectors.toList());
if(!projects.isEmpty()){
List<ProjectOrgRelationWhenResponseResultDTO> responseList = baseDao.selectResponseTrace(projects);
Map<String,List<ProjectOrgRelationWhenResponseResultDTO>> sorted =
responseList.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getProjectId));
skipLevelGrouping(processMap,sorted);
List<ProjectOrgPeriodResultDTO> result = new LinkedList<>();
processMap.values().forEach(list -> {list.forEach(obj -> {result.add(obj);});});
return result;
}
return baseDao.selectProjectOrgPeriodDirectly(customerId,null,date);
}
return new ArrayList<>();
}
@Override
@ -139,74 +122,31 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
* @date 2020.09.28 14:44
*/
@Override
public Map<String, String> selectLatestOperation(List<String> list, String customerId) {
List<ProjectLatestOperationResultDTO> operations = baseDao.selectLatestOperation(list);
public Map<String, String> getLatestOperation(List<String> list, String customerId) {
List<ProjectLatestOperationResultDTO> operations = baseDao.selectLatestOperation(list,customerId);
if(CollectionUtils.isEmpty(operations)){
return Collections.EMPTY_MAP;
}else{
return operations.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName));
}
}
/**
* @Description 跨级分组 eg -> transfer ; response response transfer ; return ; response close.
* @param dest - Map<String,List<ProjectOrgPeriodResultDTO>> 需要填充的数据
* @param fillFactor - Map<String,List<ProjectOrgRelationWhenResponseResultDTO>> 填充因子
* @return
* @Description 获取项目标题
* @param list
* @param customerId
* @return java.util.Map<java.lang.String,java.lang.String>
* @author wangc
* @date 2020.09.18 15:27
**/
private void skipLevelGrouping(Map<String,List<ProjectOrgPeriodResultDTO>> dest,Map<String,List<ProjectOrgRelationWhenResponseResultDTO>> fillFactor){
for(String projectId : fillFactor.keySet()){
List<ProjectOrgRelationWhenResponseResultDTO> projectTraceUnit = fillFactor.get(projectId);
if(!projectTraceUnit.isEmpty()){
Map<String,List<ProjectOrgRelationWhenResponseResultDTO>> staffResponseTrace =
projectTraceUnit.stream().collect(Collectors.groupingBy(ProjectOrgRelationWhenResponseResultDTO::getStaffId));
if(!CollectionUtils.isEmpty(staffResponseTrace)){
staffResponseTrace.keySet().forEach( staffId -> {
if(!CollectionUtils.isEmpty(staffResponseTrace.get(staffId))){
List<ProjectOrgRelationWhenResponseResultDTO> staffResponseTraceUnit
= staffResponseTrace.get(staffId);
int lastEndCount = NumConstant.ONE_NEG;
for(int index = NumConstant.ZERO; index < staffResponseTraceUnit.size(); index ++){
if(StringUtils.equalsAny(staffResponseTraceUnit.get(index).getOperation(),
"transfer","return","close")){
replaceFirstResponseDate(dest,index,staffResponseTraceUnit,true);
lastEndCount = index;
}else{
if(lastEndCount == NumConstant.ONE_NEG) continue;
if(index - NumConstant.ONE == lastEndCount){
replaceFirstResponseDate(dest,index,staffResponseTraceUnit,false);
}else{continue;}
}
}
}
});
}
}
}
}
private void replaceFirstResponseDate(Map<String,List<ProjectOrgPeriodResultDTO>> dest, int index, List<ProjectOrgRelationWhenResponseResultDTO> staffResponseTraceUnit, boolean ifResponsed){
List<ProjectOrgPeriodResultDTO> processSingleList =
dest.get(staffResponseTraceUnit.get(index).getProcessId());
if(!CollectionUtils.isEmpty(processSingleList)){
//ProjectOrgPeriodResultDTO element = processSingleList.get(NumConstant.ZERO);
ProjectOrgPeriodResultDTO element = processSingleList.stream().filter(node ->
StringUtils.equals(node.getStaffId(),staffResponseTraceUnit.get(index).getStaffId())).findFirst().get();
if(!ifResponsed && null == element.getHandledDate()){
log.warn("com.epmet.service.project.impl.ProjectProcessServiceImpl.skipLevelGrouping::已流出节点没有办结日期,节点ID{}",element.getProcessId() );
}
element.setPeriodTillReplyFirstly(ifResponsed ? staffResponseTraceUnit.get(index).getCreatedTime() :element.getHandledDate());
* @date 2020.10.27 14:34
*/
@Override
public Map<String, String> getProjectTitle(List<String> list, String customerId) {
List<ProjectLatestOperationResultDTO> titles = baseDao.selectProjectTitle(list,customerId);
if(CollectionUtils.isEmpty(titles)){
return Collections.EMPTY_MAP;
}else{
return titles.stream().collect(Collectors.toMap(ProjectLatestOperationResultDTO :: getProjectId,ProjectLatestOperationResultDTO :: getOperationName));
}
}
}

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

@ -19,15 +19,15 @@ package com.epmet.service.project.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.constant.DataSourceConstant;
import com.epmet.dao.project.ProjectDao;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.project.ProjectAgencyDTO;
import com.epmet.dto.project.ProjectGridDTO;
import com.epmet.dto.project.ProjectInfoDTO;
import com.epmet.entity.project.ProjectEntity;
import com.epmet.service.project.ProjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@ -82,4 +82,20 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return baseDao.selectParameterValueByKey(customerId);
}
/**
* @Description 得到超过阈值滞留的项目Id集合
* 规定只要项目的任何一个负责人(被流转到的自始至终不管有没有处理)超过了自定义或默认的滞留时间就算难点赌点
* @param customerId
* @param exclude
* @return java.util.List<java.lang.String>
* @author wangc
* @date 2020.11.06 14:14
*/
@Override
public List<String> getOvertimeProjectByParameter(String customerId, List<String> exclude) {
String parameter = baseDao.selectParameterValueByKey(customerId);
if(StringUtils.isBlank(parameter)) parameter = baseDao.selectParameterValueByKey("default");
return baseDao.selectOvertimeProjectIds(customerId, exclude, StringUtils.isBlank(parameter) ? NumConstant.FIVE : Integer.parseInt(parameter));
}
}

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml

@ -406,8 +406,8 @@
project.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() != 0">
<foreach collection="list" item="projectId" open="AND " separator=" AND " >
project.ID <![CDATA[<>]]> #{projectId}
<foreach collection="list" item="projectId" open="AND " separator=" OR " >
project.ID = #{projectId}
</foreach>
</if>
</select>

62
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml

@ -119,69 +119,7 @@
</foreach>
</insert>
<!-- 查找网格、部门对项目的办结系数 -->
<select id="selectSubOrgResponseCoefficient" resultType="com.epmet.dto.extract.result.OrgResponseTimeResultDTO">
SELECT
PID AS agencyId,
SUM(timestampdiff(MINUTE , INFORMED_DATE ,IFNULL(HANDLED_DATE,NOW()))) AS responseTime,
COUNT(ID) projectTotal,
COUNT(DISTINCT PROJECT_ID) distinctProjectTotal
FROM
fact_origin_project_org_period_daily
WHERE
DEL_FLAG = '0'
AND
CUSTOMER_ID = #{customerId}
AND
(ORG_TYPE = 'grid' OR ORG_TYPE = 'dept')
AND
IS_RESOLVED = 'resolved'
<if test='null != dimId and "" != dimId'>
<choose>
<when test='"month" == dateType'>
AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m') = #{dimId}
</when>
<otherwise>
AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m%d') = #{dimId}
</otherwise>
</choose>
</if>
GROUP BY PID
</select>
<!-- 查找机关对项目的办结系数 -->
<select id="selectAgencyResponseCoefficient" resultType="com.epmet.dto.extract.result.OrgResponseTimeResultDTO">
SELECT
ORG_ID AS agencyId,
SUM(timestampdiff(MINUTE , INFORMED_DATE ,IFNULL(HANDLED_DATE,NOW()))) AS responseTime,
COUNT(ID) projectTotal,
COUNT(PROJECT_ID) distinctProjectTotal
FROM
fact_origin_project_org_period_daily
WHERE
DEL_FLAG = '0'
AND
CUSTOMER_ID = #{customerId}
AND
ORG_TYPE = 'agency'
AND
IS_RESOLVED = 'resolved'
<if test='null != dimId and "" != dimId'>
<choose>
<when test='"month" == dateType'>
AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m') = #{dimId}
</when>
<otherwise>
AND DATE_FORMAT(IFNULL(HANDLED_DATE,NOW()),'%Y%m%d') = #{dimId}
</otherwise>
</choose>
</if>
GROUP BY ORG_ID
</select>
<select id="selectDeptHandle" resultType="com.epmet.dto.extract.result.OrgStatisticsResultDTO">
SELECT
fp.ORG_ID,

2
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenDifficultyDataDao.xml

@ -137,6 +137,7 @@
EVENT_IMG_URL,
EVENT_SOURCE,
EVENT_CONTENT,
EVENT_TITLE,
EVENT_COST_TIME,
EVENT_RE_ORG,
EVENT_HANDLED_COUNT,
@ -166,6 +167,7 @@
#{item.eventImgUrl},
#{item.eventSource},
#{item.eventContent},
#{item.eventTitle},
#{item.eventCostTime},
#{item.eventReOrg},
#{item.eventHandledCount},

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

@ -106,4 +106,45 @@
and PARAMETER_KEY ='detention_days'
</select>
<select id="selectOvertimeProjectIds" resultType="string">
SELECT
DISTINCT
project.ID
FROM
project project
WHERE
project.del_flag = '0'
AND project.customer_id = #{customerId}
<if test="null != exclude and exclude.size() > 0">
<foreach collection="exclude" item="id" open="AND ( " separator=" OR " close=" ) ">
project.ID <![CDATA[ <> ]]> #{id}
</foreach>
</if>
AND EXISTS (
SELECT
stff.ID
FROM
project_staff stff
LEFT JOIN project_org_relation period ON stff.ID = period.PROJECT_STAFF_ID
AND period.DEL_FLAG = '0'
WHERE
stff.DEL_FLAG = '0'
AND stff.CUSTOMER_ID = #{customerId}
AND project.ID = stff.PROJECT_ID
AND ABS(
TIMESTAMPDIFF(
DAY,
period.INFORMED_DATE,
IF
(
period.HANDLED_DATE IS NULL,
IF
( project.`STATUS` = 'closed', project.UPDATED_TIME, NOW( ) ),
period.HANDLED_DATE
)
)
) > #{value}
)
</select>
</mapper>

90
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml

@ -98,6 +98,7 @@
<!-- 查询项目-机关各个节点历时详情 -->
<select id="selectProjectOrgPeriod" resultType="com.epmet.dto.project.result.ProjectOrgPeriodResultDTO">
SELECT
staff.ID AS projectStaffId,
project.CUSTOMER_ID,
process.ID AS processId,
process.PROJECT_ID,
@ -107,7 +108,7 @@
staff.ORG_ID,
staff.DEPARTMENT_ID,
staff.GRID_ID,
staff.CREATED_BY AS staffId,
staff.STAFF_ID AS staffId,
staff.ORG_ID_PATH,
IF(staff.IS_HANDLE='handle',timestampdiff(MINUTE , staff.CREATED_TIME , staff.UPDATED_TIME),0) AS TOTAL_PERIOD,
@ -119,7 +120,9 @@
FROM PROJECT_STAFF staff
LEFT JOIN PROJECT project ON staff.PROJECT_ID = project.ID AND project.DEL_FLAG = '0'
LEFT JOIN PROJECT_PROCESS process ON staff.PROCESS_ID = process.ID AND process.DEL_FLAG = '0'
LEFT JOIN PROJECT_PROCESS selfAction ON staff.PROJECT_ID = selfAction.PROJECT_ID AND selfAction.DEL_FLAG = '0' AND staff.UPDATED_TIME = selfAction.CREATED_TIME AND staff.STAFF_ID = selfAction.STAFF_ID
LEFT JOIN PROJECT_PROCESS selfAction ON staff.PROJECT_ID = selfAction.PROJECT_ID AND selfAction.DEL_FLAG = '0'
AND ABS(TIMESTAMPDIFF(SECOND,staff.UPDATED_TIME,selfAction.CREATED_TIME)) <![CDATA[ <= ]]> 30
AND staff.STAFF_ID = selfAction.STAFF_ID
WHERE staff.DEL_FLAG = '0'
AND project.CUSTOMER_ID = #{customerId}
@ -137,6 +140,45 @@
ORDER BY process.PROJECT_ID,staff.CREATED_TIME ASC
</select>
<select id="selectProjectOrgPeriodDirectly" resultType="com.epmet.dto.project.result.ProjectOrgPeriodResultDTO">
SELECT
staff.CUSTOMER_ID,
staff.PROCESS_ID,
staff.PROJECT_ID,
relation.SOURCE_OPERATION AS lastAction,
relation.OPERATION,
staff.DEPARTMENT_NAME,
staff.ORG_ID,
staff.DEPARTMENT_ID,
staff.GRID_ID,
staff.ORG_ID_PATH,
staff.STAFF_ID,
relation.TOTAL_PERIOD,
relation.INFORMED_DATE,
IF(staff.IS_HANDLE='handle','resolved','unresolved') AS isResolved,
relation.HANDLED_DATE,
relation.FIRST_DEALT_DATE AS periodTillReplyFirstly
FROM PROJECT_STAFF staff
INNER JOIN PROJECT_ORG_RELATION relation ON staff.ID = relation.PROJECT_STAFF_ID AND relation.DEL_FLAG = '0'
WHERE staff.DEL_FLAG = '0'
AND staff.CUSTOMER_ID = #{customerId}
<if test='null != projectStatus and "" != projectStatus'>
AND project.STATUS = #{projectStatus}
</if>
<if test='null != dateId and "" != dateId'>
AND (
DATE_FORMAT(relation.UPDATED_TIME , '%Y%m%d') = #{dateId}
)
</if>
ORDER BY staff.PROJECT_ID,staff.CREATED_TIME ASC
</select>
<!-- 查询项目-机关各个节点的响应列表 -->
<select id="selectResponseTrace" resultType="com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO">
SELECT
@ -159,8 +201,32 @@
SELECT * FROM PROJECT_PROCESS WHERE DEL_FLAG = '0' AND PROJECT_ID = process.PROJECT_ID AND OPERATION = 'response'
AND STAFF_ID = process.STAFF_ID AND DEPARTMENT_NAME = process.DEPARTMENT_NAME
)
ORDER BY process.STAFF_ID , process.CREATED_TIME ASC
ORDER BY process.PROJECT_ID , process.STAFF_ID , process.CREATED_TIME ASC
</select>
<!-- 查询项目的节点 -->
<select id="selectProjectProcess" resultType="com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO">
SELECT
ID AS processId,
PROJECT_ID,
STAFF_ID,
OPERATION,
CREATED_TIME
FROM
PROJECT_PROCESS
WHERE
DEL_FLAG = '0'
AND
PROJECT_ID
IN(
SELECT DISTINCT ID
)
<foreach collection="projects" item="id" open="AND (" close=")" separator=" OR ">
PROJECT_ID = #{id}
</foreach>
ORDER BY PROJECT_ID,STAFF_ID,CREATED_TIME ASC
</select>
<select id="selectFinishOrg" resultType="com.epmet.dto.project.FinishOrgDTO">
SELECT
a.GRID_ID,
@ -207,6 +273,7 @@
project_process process
WHERE
process.DEL_FLAG = '0'
AND process.CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() > 0">
<foreach collection="list" item="projectId" open="AND (" separator=" OR " close=" )">
process.PROJECT_ID = #{projectId}
@ -239,4 +306,21 @@
AND DATE_FORMAT(pp.CREATED_TIME,'%Y%m%d') = #{date}
</if>
</select>
<!-- 查找项目标题 -->
<select id="selectProjectTitle" resultType="com.epmet.dto.project.result.ProjectLatestOperationResultDTO">
SELECT
ID AS projectId,
TITLE AS operationName
FROM
project
WHERE
DEL_FLAG = '0'
AND CUSTOMER_ID = #{customerId}
<if test="null != list and list.size() > 0">
<foreach collection="list" item="projectId" open="AND (" separator=" OR " close=" )">
ID = #{projectId}
</foreach>
</if>
</select>
</mapper>

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-activiti-server:
container_name: epmet-activiti-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-activiti-server:0.3.0
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-activiti-server:version_placeholder
ports:
- "8086:8086"
network_mode: host # 使用现有网络

35
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/CostDayFormDTO.java

@ -0,0 +1,35 @@
package com.epmet.dto.form;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/10/21 17:34
*/
@Data
public class CostDayFormDTO implements Serializable {
private static final long serialVersionUID = -1002961480112906533L;
/**
* 项目ID
*/
private String id;
/**
* 工作人员ID
*/
private String staffId;
/**
* 起始日期
*/
private Date startDate;
/**
* 终止日期
*/
private Date endDate;
}

41
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/TimestampIntervalFormDTO.java

@ -0,0 +1,41 @@
package com.epmet.dto.form;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @Description 时间区间
* @ClassName TimestampIntervalFormDTO
* @Auth wangc
* @Date 2020-10-21 15:55
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class TimestampIntervalFormDTO implements Serializable {
private static final long serialVersionUID = 8404199047657424778L;
/***
* 可以是任意的标志Id用来区分多组传参的返回值
*/
@NotNull(message = "时间区间标识Id不能为空",groups = WorkMinuteFormDTO.WorkTimeGroup.class)
private String id;
/**
* 区间左段点
*/
@NotNull(message = "开始时间不能为空",groups = WorkMinuteFormDTO.WorkTimeGroup.class)
private Date left;
/***
* 去边右段点
*/
private Date right;
}

47
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/WorkMinuteFormDTO.java

@ -0,0 +1,47 @@
package com.epmet.dto.form;
import com.epmet.commons.tools.validator.group.CustomerClientShowGroup;
import lombok.Data;
import javax.validation.Valid;
import java.io.Serializable;
import java.util.List;
/**
* @Description 计算经历的多少分钟(只计算工作日)
* @ClassName WorkMinuteFromDTO
* @Auth wangc
* @Date 2020-10-21 15:48
*/
@Data
public class WorkMinuteFormDTO implements Serializable {
private static final long serialVersionUID = -7777345488803895645L;
public interface WorkTimeGroup extends CustomerClientShowGroup{}
/**
* 是否使用自定义起止时间 default - 24小时制计 custom - 使用自定义但是一定要传递起止时间(目前只支持在同一天)
*/
private String ifCustom;
/**
* 是否精准计算 默认不精准计算 Imprecise - 不精准 precise - 精准
*/
private String ifPrecise;
/***
* 每天的计算起始时间
* HH:mm:ss
*/
private String startTemplate;
/***
* 每天的计算截止时间
* HH:mm:ss
*/
private String endTemplate;
@Valid
private List<TimestampIntervalFormDTO> timeList;
}

37
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/CostDayResultDTO.java

@ -0,0 +1,37 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/10/21 17:53
*/
@Data
public class CostDayResultDTO implements Serializable {
private static final long serialVersionUID = -1575208332115510050L;
/**
* 项目ID
*/
private String id;
/**
* 工作人员ID
*/
private String staffId;
/**
* 已滞留工作日
*/
private Integer detentionDays;
/**
* 起始日期
*/
private Date startDate;
}

36
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/EpmetCommonServiceOpenFeignClient.java

@ -2,9 +2,12 @@ package com.epmet.feign;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.form.GetJwtAccessTokenFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
@ -14,6 +17,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -22,7 +26,7 @@ import java.util.List;
* @date 2020/6/4 10:28
*/
@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class)
//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "localhost:8103")
//@FeignClient(name = ServiceConstant.EPMET_COMMON_SERVICE, fallback = EpmetCommonServiceOpenFeignClientFallback.class, url = "http://localhost:8103")
public interface EpmetCommonServiceOpenFeignClient {
/**
* @param formDTO
@ -67,4 +71,34 @@ public interface EpmetCommonServiceOpenFeignClient {
@PostMapping("/commonservice/externalapp/appidinfo")
Result<AppIdInfoResultDTO> appIdInfo(@RequestBody String appId);
/**
* 工作日计算
* @author zhaoqifeng
* @date 2020/10/22 9:25
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.CostDayResultDTO>>
*/
@PostMapping("commonservice/workday/workdays")
Result<List<CostDayResultDTO>> costWorkDays(@RequestBody List<CostDayFormDTO> formDTO);
/**
* 日历天计算
* @author zhaoqifeng
* @date 2020/10/22 9:25
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.CostDayResultDTO>>
*/
@PostMapping("commonservice/workday/calendardays")
Result<List<CostDayResultDTO>> costCalendarDays(@RequestBody List<CostDayFormDTO> formDTO);
/**
* @Description 计算经历的多少分钟(只计算工作日)
* @param param
* @return com.epmet.commons.tools.utils.Result<java.util.Map<java.lang.String,java.lang.Integer>>
* @author wangc
* @date 2020.10.21 16:34
*/
@PostMapping("commonservice/workday/workminutes")
Result<Map<String,Integer>> workMinutes(@RequestBody WorkMinuteFormDTO param);
}

35
epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/feign/fallback/EpmetCommonServiceOpenFeignClientFallback.java

@ -3,9 +3,12 @@ package com.epmet.feign.fallback;
import com.epmet.commons.tools.constant.ServiceConstant;
import com.epmet.commons.tools.utils.ModuleUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.ExternalAppAuthFormDTO;
import com.epmet.dto.form.GetJwtAccessTokenFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.result.AppIdInfoResultDTO;
import com.epmet.dto.result.ExternalAppAuthResultDTO;
import com.epmet.dto.result.WorkDayResultDTO;
@ -13,6 +16,7 @@ import com.epmet.feign.EpmetCommonServiceOpenFeignClient;
import org.springframework.stereotype.Component;
import java.util.List;
import java.util.Map;
/**
* 本服务对外开放的API,其他服务通过引用此client调用该服务
@ -51,4 +55,35 @@ public class EpmetCommonServiceOpenFeignClientFallback implements EpmetCommonSer
public Result getAccessToken(GetJwtAccessTokenFormDTO form) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "getAccessToken", form);
}
/**
* 工作日计算
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.CostDayResultDTO>>
* @author zhaoqifeng
* @date 2020/10/22 9:25
*/
@Override
public Result<List<CostDayResultDTO>> costWorkDays(List<CostDayFormDTO> formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "costWorkDays", formDTO);
}
/**
* 日历天计算
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List < com.epmet.dto.result.CostDayResultDTO>>
* @author zhaoqifeng
* @date 2020/10/22 9:25
*/
@Override
public Result<List<CostDayResultDTO>> costCalendarDays(List<CostDayFormDTO> formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "costCalendarDays", formDTO);
}
@Override
public Result<Map<String, Integer>> workMinutes(WorkMinuteFormDTO param) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_COMMON_SERVICE, "workMinutes", param);
}
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
common-service-server:
container_name: common-service-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:0.3.16
image: 192.168.1.130:10080/epmet-cloud-dev/common-service-server:version_placeholder
ports:
- "8103:8103"
network_mode: host # 使用现有网络

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

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

29
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -8,4 +8,33 @@ public interface ProjectConstant {
* 时间已存在
*/
/**
* 日期类型 工作日
*/
String DAY_TYPE_WORK = "1";
/**
* 日期类型 周末
*/
String DAY_TYPE_WEEKEND = "2";
/**
* 日期类型 假日
*/
String DAY_TYPE_HOLIDAY = "3";
/***
* 计算方式 使用自定应
*/
String CALCULATION_TYPE_CUSTOM = "custom";
/**
* 计算方式 使用默认24小时制
*/
String CALCULATION_TYPE_DEFAULT = "default";
/**
* 精准计算
*/
String PRECISE_CALCULATION = "precise";
}

44
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/WorkDayController.java

@ -1,7 +1,10 @@
package com.epmet.controller;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.service.WorkDayService;
import org.springframework.beans.factory.annotation.Autowired;
@ -11,6 +14,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
* @Description 工作日计算
@ -36,5 +40,45 @@ public class WorkDayController {
List<WorkDayResultDTO> list = workDayService.detentionDays(formDTO);
return new Result<List<WorkDayResultDTO>>().ok(list);
}
/**
* 工作日计算
* @author zhaoqifeng
* @date 2020/10/22 9:23
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.CostDayResultDTO>>
*/
@PostMapping("workdays")
public Result<List<CostDayResultDTO>> costWorkDays(@RequestBody List<CostDayFormDTO> formDTO) {
List<CostDayResultDTO> list = workDayService.costWorkDays(formDTO);
return new Result<List<CostDayResultDTO>>().ok(list);
}
/**
* 日历天计算
* @author zhaoqifeng
* @date 2020/10/22 9:23
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.CostDayResultDTO>>
*/
@PostMapping("calendardays")
public Result<List<CostDayResultDTO>> costCalendarDays(@RequestBody List<CostDayFormDTO> formDTO) {
List<CostDayResultDTO> list = workDayService.costCalendarDays(formDTO);
return new Result<List<CostDayResultDTO>>().ok(list);
}
/**
* @Description 计算经历的多少分钟(只计算工作日)
* @param param
* @return com.epmet.commons.tools.utils.Result<java.util.Map<java.lang.String,java.lang.Integer>>
* @author wangc
* @date 2020.10.21 16:34
*/
@PostMapping("workminutes")
public Result<Map<String,Integer>> workMinutes(@RequestBody WorkMinuteFormDTO param){
return new Result<Map<String,Integer>>().ok(workDayService.workMinutes(param));
}
}

32
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/WorkDayService.java

@ -1,9 +1,14 @@
package com.epmet.service;
import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import java.util.List;
import java.util.Map;
import java.util.Set;
/**
@ -13,4 +18,31 @@ import java.util.Set;
*/
public interface WorkDayService {
List<WorkDayResultDTO> detentionDays(List<WorkDayFormDTO> formDTO);
/**
* 工作日计算
* @author zhaoqifeng
* @date 2020/10/21 17:56
* @param formDTO
* @return java.util.List<com.epmet.dto.result.CostDayResultDTO>
*/
List<CostDayResultDTO> costWorkDays(List<CostDayFormDTO> formDTO);
/**
* 日历日计算
* @author zhaoqifeng
* @date 2020/10/21 17:56
* @param formDTO
* @return java.util.List<com.epmet.dto.result.CostDayResultDTO>
*/
List<CostDayResultDTO> costCalendarDays(List<CostDayFormDTO> formDTO);
/**
* @Description 计算经历的多少分钟(只计算工作日)
* @param param
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @author wangc
* @date 2020.10.21 16:14
*/
Map<String,Integer> workMinutes(WorkMinuteFormDTO param);
}

347
epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/WorkDayServiceImpl.java

@ -1,17 +1,30 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.CalenderDao;
import com.epmet.dto.form.CostDayFormDTO;
import com.epmet.dto.form.TimestampIntervalFormDTO;
import com.epmet.dto.form.WorkDayFormDTO;
import com.epmet.dto.result.CostDayResultDTO;
import com.epmet.dto.form.WorkMinuteFormDTO;
import com.epmet.dto.result.WorkDayResultDTO;
import com.epmet.entity.CalenderEntity;
import com.epmet.service.WorkDayService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.text.SimpleDateFormat;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;
/**
@ -25,6 +38,8 @@ public class WorkDayServiceImpl implements WorkDayService {
@Autowired
private CalenderDao calenderDao;
private static SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN);
private static SimpleDateFormat formatMinute = new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN);
@Override
public List<WorkDayResultDTO> detentionDays(List<WorkDayFormDTO> workDayFormDTO) {
List<WorkDayResultDTO> list = new ArrayList<>();
@ -44,6 +59,95 @@ public class WorkDayServiceImpl implements WorkDayService {
return list;
}
/**
* 工作日计算
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.CostDayResultDTO>
* @author zhaoqifeng
* @date 2020/10/21 17:56
*/
@Override
public List<CostDayResultDTO> costWorkDays(List<CostDayFormDTO> formDTO) {
List<CostDayResultDTO> list = new ArrayList<>();
if (formDTO.isEmpty()) {
throw new RenException("起始时间、终止时间不能为空");
}
for (CostDayFormDTO form : formDTO) {
CostDayResultDTO result = new CostDayResultDTO();
result.setId(form.getId());
result.setStaffId(form.getStaffId());
result.setDetentionDays(this.getWorkDays(form.getStartDate(), form.getEndDate()));
result.setStartDate(form.getStartDate());
list.add(result);
}
return list;
}
/**
* 日历日计算
*
* @param formDTO
* @return java.util.List<com.epmet.dto.result.CostDayResultDTO>
* @author zhaoqifeng
* @date 2020/10/21 17:56
*/
@Override
public List<CostDayResultDTO> costCalendarDays(List<CostDayFormDTO> formDTO) {
List<CostDayResultDTO> list = new ArrayList<>();
if (formDTO.isEmpty()) {
throw new RenException("起始时间、终止时间不能为空");
}
for (CostDayFormDTO form : formDTO) {
CostDayResultDTO result = new CostDayResultDTO();
result.setId(form.getId());
result.setStaffId(form.getStaffId());
result.setDetentionDays(this.getCalendarDays(form.getStartDate(), form.getEndDate()));
result.setStartDate(form.getStartDate());
list.add(result);
}
return list;
}
/**
* @Description 计算经历的多少分钟(只计算工作日)
* @param param
* @return java.util.Map<java.lang.String,java.lang.Integer>
* @author wangc
* @date 2020.10.21 16:14
*/
@Override
public Map<String,Integer> workMinutes(WorkMinuteFormDTO param) {
List<TimestampIntervalFormDTO> params = param.getTimeList();
if(CollectionUtils.isEmpty(params)) return null;
Map<String,Integer> result = new LinkedHashMap<>();
//默认非精准计算
if(StringUtils.isBlank(param.getIfPrecise()) || !StringUtils.equals(ProjectConstant.PRECISE_CALCULATION,param.getIfPrecise())){
params.forEach(local -> {
result.put(local.getId(),calculateImpreciseDetentionMinutes(local.getLeft(),local.getRight()));
});
return result;
}
//精准计算
if(StringUtils.isBlank(param.getIfCustom()) || !StringUtils.equals(ProjectConstant.CALCULATION_TYPE_CUSTOM,param.getIfCustom())){
//默认
params.forEach(local -> {
result.put(local.getId(),calculateDetentionMinutes(local.getLeft(),local.getRight()));
});
}else{
//自定义
params.forEach(local -> {
try {
result.put(local.getId(), calculateDetentionMinutesWithStartEnd(local.getLeft(), local.getRight(), param.getStartTemplate(), param.getEndTemplate()));
}catch (Exception e){
throw new RenException(e.getMessage());
}
});
}
return result;
}
//公式: 当前日期 - 被吹日期 - 期间的节假日
private String caculateDetentionDays(String startDateStr, String endDateStr) {
if (startDateStr.equals(endDateStr)) {
@ -77,6 +181,249 @@ public class WorkDayServiceImpl implements WorkDayService {
return "-1";
}
/***
* @Description 计算两个日期之间的非准确时间差(只包括工作日)单位分钟 不足一天按照一天计算
* @param left
* @param right
* @return java.lang.Integer
* @author wangc
* @date 2020.10.21 17:09
*/
private Integer calculateImpreciseDetentionMinutes(Date left, Date right){
if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;}
//给右区间赋值,默认当前时间
if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date();
List<CalenderEntity> list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right));
if(!CollectionUtils.isEmpty(list)){
//集合中只有一个元素,说明两个时间在同一天
if(list.size() == NumConstant.ONE){
return NumConstant.EIGHT * NumConstant.SIXTY;
}
//集合中有两个元素,说明两个时间是相连的
//集合中有两个元素以上,说明两个时间存在跨度
else{
int costMin = NumConstant.ZERO;
if(NumConstant.TWO == list.size()) return costMin;
for(int index = NumConstant.ZERO ; index < list.size() ; index++)
if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType()))
costMin += NumConstant.TWENTY_FOUR * NumConstant.SIXTY;
return costMin;
}
}
logger.warn("计算工作日,没有找到开始日期和结束日期,可能数据库中没有存储对应时段的数据,开始时间:{},结束时间:{}",left,right);
return null;
}
/**
* @Description 计算两个日期之间的时间差(只包括工作日)单位分钟
* @param left
* @param right
* @return java.lang.Integer
* @author wangc
* @date 2020.10.21 14:00
*/
private Integer calculateDetentionMinutes(Date left ,Date right){
if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;}
//给右区间赋值,默认当前时间
if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date();
List<CalenderEntity> list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right));
if(!CollectionUtils.isEmpty(list)){
//集合中只有一个元素,说明两个时间在同一天
if(list.size() == NumConstant.ONE){
if(ProjectConstant.DAY_TYPE_WORK.equals(list.get(NumConstant.ZERO).getType()))
return (int)((right.getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY);
else {
logger.warn("计算工作日,传入的起始时间都在同一天且是在节假日,开始时间:{},结束时间:{},节日类型:{}(1工作日、2周末、3、节假日)",left,right);
return NumConstant.ZERO;
}
}
//集合中有两个元素,说明两个时间是相连的
//集合中有两个元素以上,说明两个时间存在跨度
else{
String leftType = list.get(NumConstant.ZERO).getType();
String rightType = list.get(list.size() - NumConstant.ONE).getType();
int costMin = NumConstant.ZERO;
if(ProjectConstant.DAY_TYPE_WORK.equals(leftType)){
LocalDateTime localDateTime = LocalDateTime.ofInstant(left.toInstant(), ZoneId.systemDefault());
//获取第第二天零点时刻的实例
LocalDateTime tomorrowTime = LocalDateTime.ofInstant(left.toInstant(), ZoneId.systemDefault())
.plusDays(NumConstant.ONE).withHour(NumConstant.ZERO).withMinute(NumConstant.ZERO).withSecond(NumConstant.ZERO).withNano(NumConstant.ZERO);
//ChronoUnit日期枚举类,between方法计算两个时间对象之间的时间量
costMin += ChronoUnit.SECONDS.between(localDateTime, tomorrowTime)/NumConstant.SIXTY;
}
if(ProjectConstant.DAY_TYPE_WORK.equals(rightType)){
LocalDateTime localDateTime = LocalDateTime.ofInstant(right.toInstant(), ZoneId.systemDefault());
//获取第第二天零点时刻的实例
LocalDateTime initialTime = LocalDateTime.ofInstant(right.toInstant(), ZoneId.systemDefault())
.withHour(NumConstant.ZERO).withMinute(NumConstant.ZERO).withSecond(NumConstant.ZERO).withNano(NumConstant.ZERO);
//ChronoUnit日期枚举类,between方法计算两个时间对象之间的时间量
costMin += ChronoUnit.SECONDS.between(localDateTime, initialTime)/NumConstant.SIXTY;
}
if(NumConstant.TWO == list.size()) return costMin;
for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++)
if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType()))
costMin += NumConstant.TWENTY_FOUR * NumConstant.SIXTY;
return costMin;
}
}
logger.warn("计算工作日,没有找到开始日期和结束日期,可能数据库中没有存储对应时段的数据,开始时间:{},结束时间:{}",left,right);
return null;
}
/***
* @Description 根据可配置的工作起始时间计算两个日期之间的差
* @param left
* @param right
* @param start 格式为 HH:mm:ss
* @param end 格式为 HH:mm:ss
* @return java.lang.Integer
* @author wangc
* @date 2020.10.20 18:05
*/
private Integer calculateDetentionMinutesWithStartEnd(Date left ,Date right, String start, String end)throws Exception{
if(null == left){ logger.error("计算工作日,传入的开始日期为空!");return null;}
if(null == start || null == end){start = "9:00:00"; end = "17:00:00";}
//给右区间赋值,默认当前时间
if(null == right || right.compareTo(left) < NumConstant.ZERO) right = new Date();
//自定义起始时间
String standardStartDateStr = format.format(left).concat(" ").concat(start);
//自定义截至时间
String standardEndDateStr = format.format(right).concat(" ").concat(end);
Date standardStartDate = formatMinute.parse(standardStartDateStr);
Date standardEndDate = formatMinute.parse(standardEndDateStr);
if(standardEndDate.compareTo(standardStartDate) < NumConstant.ZERO){ logger.error("计算工作日,自定义截止日期小于自定义起始日期!");return null;}
//单位时间内规定起止时间的时间差
Integer delta_T = (int)(standardEndDate.getTime() - formatMinute.parse(format.format(right).concat(" ").concat(start)).getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
List<CalenderEntity> list = calenderDao.selectByStartAndEnd(format.format(left),format.format(right));
if(!CollectionUtils.isEmpty(list)){
//集合中只有一个元素,说明两个时间在同一天
if(list.size() == NumConstant.ONE){
if(ProjectConstant.DAY_TYPE_WORK.equals(list.get(NumConstant.ZERO).getType())){
//开始时间早于当天规定开始时间
if(left.before(standardStartDate)){
if(right.before(standardStartDate)){
//结束时间早于当天规定开始时间
logger.warn("计算工作日,开始时间与结数时间均早于当天规定的起止计算时间,开始时间:{},结束时间:{},当天开始时间:{}",left,right,standardStartDate);
return NumConstant.ZERO;
}else if(right.before(standardEndDate)){
return (int)(right.getTime() - standardStartDate.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
}else{
//结束时间晚于当天规定截止时间
return delta_T;
}
}else if(left.before(standardEndDate)){
//开始时间在当天规定起止时间之间
if(right.before(standardEndDate)){
return (int)(right.getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
}else{
return (int)(standardEndDate.getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
}
}else{
logger.warn("计算工作日,开始时间与结数时间晚于当天规定的截止计算时间,开始时间:{},结束时间:{},当天截止时间:{}",left,right,standardEndDate);
return NumConstant.ZERO;
}
}else {
logger.warn("计算工作日,传入的起始时间都在同一天且是在节假日,开始时间:{},结束时间:{},节日类型:{}(1工作日、2周末、3、节假日)",left,right);
return NumConstant.ZERO;
}
}
//集合中有两个元素,说明两个时间是相连的
//集合中有两个元素以上,说明两个时间存在跨度
else{
String leftType = list.get(NumConstant.ZERO).getType();
String rightType = list.get(list.size() - NumConstant.ONE).getType();
int costMin = NumConstant.ZERO;
if(ProjectConstant.DAY_TYPE_WORK.equals(leftType)){
if(left.before(standardStartDate)){
costMin += delta_T;
}else if(left.before(standardEndDate)){
costMin += (formatMinute.parse(format.format(left).concat(" ").concat(end)).getTime() - left.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
}else{
}
}
if(ProjectConstant.DAY_TYPE_WORK.equals(rightType)){
Date leftStandardStartDate = formatMinute.parse(format.format(right).concat(" ").concat(end));
if(right.before(leftStandardStartDate)){
}else if(right.before(standardEndDate)){
costMin += (left.getTime() - leftStandardStartDate.getTime())/NumConstant.ONE_THOUSAND/NumConstant.SIXTY;
}else{
costMin += delta_T;
}
}
if(NumConstant.TWO == list.size()) return costMin;
for(int index = NumConstant.ONE ; index < list.size() - NumConstant.ONE ; index++)
if(StringUtils.equals(ProjectConstant.DAY_TYPE_WORK,list.get(index).getType()))
costMin += delta_T * NumConstant.SIXTY;
return costMin;
}
}
logger.warn("计算工作日,没有找到开始日期和结束日期,可能数据库中没有存储对应时段的数据,开始时间:{},结束时间:{}",left,right);
return null;
}
private Integer getWorkDays(Date start, Date end) {
String startDateStr = DateUtils.format(start, DateUtils.DATE_PATTERN_YYYYMMDD);
String endDateStr = DateUtils.format(end, DateUtils.DATE_PATTERN_YYYYMMDD);
if (startDateStr.equals(endDateStr)) {
logger.info(String.format("%s-%s起止时间一致,返回<1,",startDateStr,endDateStr));
return 0;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
try {
Date startDate = simpleDateFormat.parse(startDateStr);
Date endDate = simpleDateFormat.parse(endDateStr);
long day = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000);
logger.info(String.format("当前日期[%s]-被吹日期[%s]=%s", endDateStr, startDateStr, day));
List<CalenderEntity> list = calenderDao.selectByStartAndEnd(startDateStr, endDateStr);
long totalHoliday = 0;
for (CalenderEntity calenderEntity : list) {
if (!"1".equals(calenderEntity.getType())) {
totalHoliday += 1;
}
}
logger.info(String.format("期间的节假日[%s-%s]=%s", endDateStr, startDateStr, totalHoliday));
long detentionDay = day - totalHoliday;
logger.info(String.format("当前日期[%s]-被吹日期[%s]-期间的节假日[%s]=%s", endDateStr, startDateStr, totalHoliday, detentionDay));
return (int)detentionDay;
} catch (Exception e) {
e.printStackTrace();
}
return -1;
}
private Integer getCalendarDays(Date start, Date end) {
String startDateStr = DateUtils.format(start, DateUtils.DATE_PATTERN_YYYYMMDD);
String endDateStr = DateUtils.format(end, DateUtils.DATE_PATTERN_YYYYMMDD);
if (startDateStr.equals(endDateStr)) {
logger.info(String.format("%s-%s起止时间一致,返回<1,",startDateStr,endDateStr));
return 0;
}
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
try {
Date startDate = simpleDateFormat.parse(startDateStr);
Date endDate = simpleDateFormat.parse(endDateStr);
long day = (endDate.getTime() - startDate.getTime()) / (24 * 60 * 60 * 1000);
return (int)day;
} catch (Exception e) {
e.printStackTrace();
}
return -1;
}
}

1
epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/CalenderDao.xml

@ -61,4 +61,5 @@
AND QUERY_DATE BETWEEN #{begin}
AND #{end}
</select>
</mapper>

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-ext-server:
container_name: epmet-ext-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:0.0.6
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-ext-server:version_placeholder
ports:
- "8113:8113"
network_mode: host # 使用现有网络

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

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

2
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/constant/ModuleConstant.java

@ -14,4 +14,6 @@ public interface ModuleConstant {
String ERROR_EPMET_USER = "调用epmet_user服务查询网格下的所有工作人员失败";
String ERROR_AGENCY = "调用gov_org服务查询组织基本信息失败";
}

29
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/controller/OpenUpController.java

@ -11,8 +11,10 @@ import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.OpenUpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -100,5 +102,28 @@ public class OpenUpController {
return govOrgOpenFeignClient.staffPermissionExt(commonStaffIdFormDTO.getStaffId());
}
/**
* @Description 对外接口-根据组织Id获取组织信息
* @author sun
**/
@PostMapping("agencyinfo")
Result<AgencyInfoResultDTO> agencyInfo(@RequestBody AgencyInfoFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, AgencyInfoFormDTO.StaffIdGroup.class);
if (!"agency".equals(formDTO.getOrgType()) && !"grid".equals(formDTO.getOrgType())) {
return new Result<AgencyInfoResultDTO>().error("参数错误,orgType值类型错误!");
}
return new Result<AgencyInfoResultDTO>().ok(openUpService.agencyInfo(formDTO));
}
/**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun
**/
@PostMapping("organizetree")
Result<OrganizeTreeResultDTO> organizeTree(@RequestBody OrganizeTreeFormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, OrganizeTreeFormDTO.StaffIdGroup.class);
return new Result<OrganizeTreeResultDTO>().ok(openUpService.organizeTree(formDTO));
}
}

20
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/OpenUpService.java

@ -1,11 +1,7 @@
package com.epmet.service;
import com.epmet.dto.form.StaffSinAgencyFormDTO;
import com.epmet.dto.form.StaffSinDeptFormDTO;
import com.epmet.dto.form.StaffSinGridFormDTO;
import com.epmet.dto.result.StaffSinAgencyResultDTO;
import com.epmet.dto.result.StaffSinDeptResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import java.util.List;
@ -38,4 +34,16 @@ public interface OpenUpService {
* @date 2020/8/17 9:59 上午
*/
List<StaffSinAgencyResultDTO> staffSinAgency(StaffSinAgencyFormDTO formDTO);
/**
* @Description 对外接口-根据组织Id获取组织信息
* @author sun
**/
AgencyInfoResultDTO agencyInfo(AgencyInfoFormDTO formDTO);
/**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun
**/
OrganizeTreeResultDTO organizeTree(OrganizeTreeFormDTO formDTO);
}

30
epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/service/impl/OpenUpServiceImpl.java

@ -6,9 +6,7 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ModuleConstant;
import com.epmet.dto.form.*;
import com.epmet.dto.result.StaffSinAgencyResultDTO;
import com.epmet.dto.result.StaffSinDeptResultDTO;
import com.epmet.dto.result.StaffSinGridResultDTO;
import com.epmet.dto.result.*;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.OpenUpService;
@ -123,4 +121,30 @@ public class OpenUpServiceImpl implements OpenUpService {
return staffInfoList.getData();
}
/**
* @Description 对外接口-根据组织Id获取组织信息
* @author sun
**/
@Override
public AgencyInfoResultDTO agencyInfo(AgencyInfoFormDTO formDTO) {
Result<AgencyInfoResultDTO> result = govOrgOpenFeignClient.agencyInfo(formDTO);
if (!result.success()){
throw new RenException(result.getInternalMsg());
}
return result.getData();
}
/**
* @Description 外挂-获取当前组织及部门网格数据递归查询所有下级数据
* @author sun
**/
@Override
public OrganizeTreeResultDTO organizeTree(OrganizeTreeFormDTO formDTO) {
Result<OrganizeTreeResultDTO> result = govOrgOpenFeignClient.organizeTree(formDTO.getAgencyId());
if (!result.success()){
throw new RenException(result.getInternalMsg());
}
return result.getData();
}
}

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

@ -2,7 +2,7 @@ version: "3.7"
services:
epmet-heart-server:
container_name: epmet-heart-server-dev
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:0.0.52
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-heart-server:version_placeholder
ports:
- "8111:8111"
network_mode: host # 使用现有网络

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

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

3
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/constant/ActMessageConstant.java

@ -8,6 +8,7 @@ package com.epmet.constant;
*/
public interface ActMessageConstant {
String TITLE="您有一条活动消息";
String WXMP_TITLE="活动消息";
/**
* 报名审核成功给居民端用户发送消息
*/
@ -29,5 +30,5 @@ public interface ActMessageConstant {
/**
* 工作端-重新发布活动通知待审核+已经审核通过的用户
*/
String RE_PUBLISH_ACT="您好,您参与的%s活动,%s,请注意查看";
String RE_PUBLISH_ACT="您参与的%s活动,%s,请注意查看";
}

18
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActServiceImpl.java

@ -24,6 +24,7 @@ import com.epmet.constant.ReadFlagConstant;
import com.epmet.dao.*;
import com.epmet.dto.*;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.work.*;
import com.epmet.dto.result.ActSponsorResultDTO;
import com.epmet.dto.result.work.*;
@ -31,6 +32,7 @@ import com.epmet.entity.*;
import com.epmet.feign.EpmetMessageOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.service.*;
import com.epmet.utils.ModuleConstant;
import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
@ -680,6 +682,7 @@ public class WorkActServiceImpl implements WorkActService {
List<String> userIdList=actUserRelationDao.selectUserIdList(formDTO.getActId(),ActConstant.ACT_USER_STATUS_PASSED);
if(null!=userIdList&&userIdList.size()>0){
List<UserMessageFormDTO> userMessageFormDTOS=new ArrayList<>();
List<WxSubscribeMessageFormDTO> msgList = new ArrayList<>();
for(String userId:userIdList){
UserMessageFormDTO userMessageFormDTO = new UserMessageFormDTO();
userMessageFormDTO.setCustomerId(actInfoDTO.getCustomerId());
@ -692,11 +695,26 @@ public class WorkActServiceImpl implements WorkActService {
actInfoDTO.getTitle(),
formDTO.getCancelReason()));
userMessageFormDTOS.add(userMessageFormDTO);
//2020.10.26 添加发送微信订阅消息功能 sun
WxSubscribeMessageFormDTO dto = new WxSubscribeMessageFormDTO();
dto.setCustomerId(actInfoDTO.getCustomerId());
dto.setClientType(AppClientConstant.APP_RESI);
dto.setUserId(userId);
dto.setBehaviorType(ActMessageConstant.WXMP_TITLE);
dto.setMessageContent(String.format(ActMessageConstant.ACT_CANCELED, actInfoDTO.getTitle(), formDTO.getCancelReason()));
dto.setMessageTime(new Date());
dto.setGridId("*");
msgList.add(dto);
}
Result sendMessageRes= epmetMessageOpenFeignClient.saveUserMessageList(userMessageFormDTOS);
if(sendMessageRes.success()){
logger.info("给审核通过的用户发送消息成功");
}
logger.info("取消活动,开始推送微信订阅消息");
Result wxmpMsg = epmetMessageOpenFeignClient.sendWxSubscribeMessage(msgList);
if (wxmpMsg.success()) {
logger.info("给审核通过的用户推送微信订阅消息成功");
}
}
}

38
epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/service/impl/WorkActUserServiceImpl.java

@ -19,6 +19,7 @@ import com.epmet.dto.ActUserLogDTO;
import com.epmet.dto.ActUserRelationDTO;
import com.epmet.dto.HeartUserInfoDTO;
import com.epmet.dto.form.UserMessageFormDTO;
import com.epmet.dto.form.WxSubscribeMessageFormDTO;
import com.epmet.dto.form.work.AactUserDetailFormDTO;
import com.epmet.dto.form.work.ActIdFormDTO;
import com.epmet.dto.form.work.AuditUserFormDTO;
@ -464,6 +465,8 @@ public class WorkActUserServiceImpl implements WorkActUserService {
actUserLogDao.insert(actUserLogEntity);
//给居民发消息
this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_PASSED,actInfo);
//给居民发送微信订阅消息 sun
this.saveWxmpMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_PASSED,actInfo);
}
/**
@ -511,6 +514,8 @@ public class WorkActUserServiceImpl implements WorkActUserService {
actUserLogDao.insert(actUserLogEntity);
//给居民发消息
this.saveUserMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_REFUSED,actInfo);
//给居民发送微信订阅消息 sun
this.saveWxmpMessage(actUserRelationEntity,ActConstant.ACT_USER_STATUS_REFUSED,actInfo);
}
/**
@ -645,6 +650,39 @@ public class WorkActUserServiceImpl implements WorkActUserService {
}
}
/**
* @param actUserRelationEntity type actInfo
* @author sun
* @description 报名审核--给报名申请人发送微信订阅消息
**/
private void saveWxmpMessage(ActUserRelationEntity actUserRelationEntity, String type, ActInfoEntity actInfo) {
List<WxSubscribeMessageFormDTO> list = new ArrayList<>();
try {
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(actInfo.getCustomerId());
msg.setClientType(AppClientConstant.APP_RESI);
msg.setUserId(actUserRelationEntity.getUserId());
msg.setBehaviorType(ActMessageConstant.WXMP_TITLE);
msg.setMessageTime(new Date());
msg.setGridId("*");
if (ActConstant.ACT_USER_STATUS_PASSED.equals(type)) {
msg.setMessageContent(String.format(ActMessageConstant.AUDIT_PASSED, actInfo.getTitle()));
} else if (ActConstant.ACT_USER_STATUS_REFUSED.equals(type)) {
msg.setMessageContent(String.format(ActMessageConstant.AUDIT_REFUSED, actInfo.getTitle(), actUserRelationEntity.getFailureReason()));
}
list.add(msg);
logger.info("活动报名审核,开始推送微信订阅消息");
Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(list);
if (result.success()) {
logger.info("审核成功,已成功发送微信订阅消息");
} else {
logger.error("审核成功,发送微信订阅消息失败" + JSON.toJSONString(result));
}
} catch (Exception e) {
logger.error("审核结果,发送微信订阅消息异常", e.getMessage());
}
}
/**
* @return com.epmet.dto.result.work.HistoricalActInfo
* @param userId

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.25
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-job-server:version_placeholder
ports:
- "8084:8084"
network_mode: host # 使用现有网络

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

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

21
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/ProjectSendMessageService.java

@ -0,0 +1,21 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/10/26 15:19
*/
public interface ProjectSendMessageService {
/**
* 滞留提醒
* @author zhaoqifeng
* @date 2020/10/26 15:21
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
Result projectSendMessage(ExtractOriginFormDTO formDTO);
}

35
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/ProjectSendMessageServiceImpl.java

@ -0,0 +1,35 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.ProjectDTO;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.feign.GovProjectOpenFeignClient;
import com.epmet.service.ProjectSendMessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/10/26 15:22
*/
@Service
public class ProjectSendMessageServiceImpl implements ProjectSendMessageService {
@Autowired
private GovProjectOpenFeignClient govProjectOpenFeignClient;
/**
* 滞留提醒
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2020/10/26 15:21
*/
@Override
public Result projectSendMessage(ExtractOriginFormDTO formDTO) {
ProjectDTO projectDTO = new ProjectDTO();
projectDTO.setCustomerId(formDTO.getCustomerId());
return govProjectOpenFeignClient.sendMessageJob(projectDTO);
}
}

43
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/ProjectSendMessageTask.java

@ -0,0 +1,43 @@
package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.service.ProjectSendMessageService;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/10/26 15:26
*/
@Component("projectSendMessageTask")
public class ProjectSendMessageTask implements ITask {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
private ProjectSendMessageService projectSendMessageService;
/**
* 执行定时任务接口
*
* @param params 参数多参数使用JSON数据
*/
@Override
public void run(String params) {
logger.info("ProjectSendMessageTask定时任务正在执行,参数为:{}", params);
ExtractOriginFormDTO formDTO = new ExtractOriginFormDTO();
if (StringUtils.isNotBlank(params)) {
formDTO = JSON.parseObject(params, ExtractOriginFormDTO.class);
}
Result result = projectSendMessageService.projectSendMessage(formDTO);
if (result.success()) {
logger.info("ProjectSendMessageTask定时任务执行成功");
} else {
logger.error("ProjectSendMessageTask定时任务执行失败:" + result.getMsg());
}
}
}

7
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/constant/WxMsgTemplateSubscribeStatus.java

@ -0,0 +1,7 @@
package com.epmet.constant;
public interface WxMsgTemplateSubscribeStatus {
//wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)
String SUBSCRIBE = "subscribe";
String UNSUBSCRIBE = "unsubscribe";
}

7
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/UserMessageDTO.java

@ -59,6 +59,11 @@ public class UserMessageDTO implements Serializable {
*/
private String app;
/**
* 调用者
*/
private String referer;
/**
* 消息标题
*/
@ -104,4 +109,4 @@ public class UserMessageDTO implements Serializable {
*/
private Date updatedTime;
}
}

9
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpMsgSendRecordDTO.java

@ -42,6 +42,10 @@ public class WxmpMsgSendRecordDTO implements Serializable {
* 客户Id 客户Id
*/
private String customerId;
/**
* 网格Id居民端跟网格有关的则有值工作端以及一些居民端和网格没关的存*
*/
private String gridId;
/**
* 所属端类型 居民端:resi 工作端:work
@ -93,6 +97,11 @@ public class WxmpMsgSendRecordDTO implements Serializable {
*/
private String reason;
/**
* 调用方
*/
private String referer;
/**
* 删除标识
*/

2
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/WxmpTemplateMsgSubscribeStatusDTO.java

@ -103,4 +103,6 @@ public class WxmpTemplateMsgSubscribeStatusDTO implements Serializable {
*/
private Date updatedTime;
private Date templateId;
}

32
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/ActivationSubscribeFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Description 居民端工作端-重新激活授权页-接口入参
* @author sun
*/
@Data
public class ActivationSubscribeFormDTO {
@NotBlank(message = "客户id不能为空", groups = { UpdateWxSubscribeInfoGroup.class })
private String customerId;
@NotBlank(message = "客户端类型不能为空", groups = { UpdateWxSubscribeInfoGroup.class })
private String clientType;
@NotBlank(message = "模板ID不能为空", groups = { UpdateWxSubscribeInfoGroup.class })
private String templateId;
@NotBlank(message = "'是否总是允许'选项不能为空", groups = { UpdateWxSubscribeInfoGroup.class })
private String alwaysVisit;
/**
* token中用户Id
*/
private String userId;
/**
* 用户对应的openId(居民端一对一工作端一对多)
*/
private String openId;
public interface UpdateWxSubscribeInfoGroup {}
}

5
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/UserMessageFormDTO.java

@ -56,4 +56,9 @@ public class UserMessageFormDTO implements Serializable {
*/
@NotBlank(message = "readFlag不能为空")
private String readFlag;
/**
* 调用者
*/
private String referer;
}

24
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxMsgAuthInfoFormDTO.java

@ -8,17 +8,35 @@ import javax.validation.constraints.NotBlank;
public class WxMsgAuthInfoFormDTO {
public interface SaveSysAuthInfoGroup {}
public interface GetAuthInfoGroup {}
public interface SaveWxSubscribeInfoGroup {}
@NotBlank(message = "客户id不能为空", groups = { SaveSysAuthInfoGroup.class })
@NotBlank(message = "客户id不能为空", groups = { SaveSysAuthInfoGroup.class, GetAuthInfoGroup.class, SaveWxSubscribeInfoGroup.class })
private String customerId;
@NotBlank(message = "客户端类型不能为空", groups = { SaveSysAuthInfoGroup.class })
@NotBlank(message = "客户端类型不能为空", groups = { SaveSysAuthInfoGroup.class, GetAuthInfoGroup.class, SaveWxSubscribeInfoGroup.class })
private String clientType;
@NotBlank(message = "是否总是字段不能为空", groups = { SaveSysAuthInfoGroup.class })
@NotBlank(message = "'是否总是允许'选项不能为空", groups = { SaveSysAuthInfoGroup.class })
private String alwaysVisit;
@NotBlank(message = "是否去订阅字段不能为空", groups = { SaveSysAuthInfoGroup.class })
private String subscribeStatus;
@NotBlank(message = "模板ID不能为空", groups = { SaveWxSubscribeInfoGroup.class, GetAuthInfoGroup.class, SaveSysAuthInfoGroup.class })
private String templateId;
@NotBlank(message = "微信'是否总是允许'选项不能为空", groups = { SaveWxSubscribeInfoGroup.class })
private String wxAlwaysVisit;
@NotBlank(message = "微信'是否订阅字段不能为空'", groups = { SaveWxSubscribeInfoGroup.class })
private String wxSubscribeStatus;
@NotBlank(message = "动作类型不能为空", groups = { SaveWxSubscribeInfoGroup.class })
private String behaviorType;
}

16
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxSubscribeMessageFormDTO.java

@ -48,4 +48,20 @@ public class WxSubscribeMessageFormDTO implements Serializable {
@NotBlank(message = "消息内容不能为空")
private String messageContent;
/**
* 消息时间
*/
@NotNull(message = "消息时间不能为空")
private Date messageTime;
/**
* 网格id-居民端用
*/
private String gridId;
/**
* 调用方
*/
private String referer;
}

72
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/form/WxmpMessagePushFormDTO.java

@ -0,0 +1,72 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
/**
* @description: 微信订阅消息FormDTO
* @author: liushaowen
* @date: 2020/10/21 14:29
*/
@Data
public class WxmpMessagePushFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 客户id
*/
@NotBlank(message = "客户id不能为空")
private String customerId;
/**
* 客户端类型 居民端:resi 工作端:work
*/
@NotBlank(message = "客户端类型不能为空")
private String app;
/**
* 接收者用户 userId
*/
@NotBlank(message = "接收用户id不能为空")
private String userId;
/**
* 行为类型(存title字段的中间值) 入组申请党员认证等
*/
@NotBlank(message = "行为类型不能为空")
private String title;
/**
* 消息内容
*/
@NotBlank(message = "消息内容不能为空")
private String messageContent;
/**
* 网格id-居民端用
*/
@NotBlank(message = "网格id不能为空")
private String gridId;
/**
* 已读标记
*/
@NotBlank(message = "已读标记不能为空")
private String readFlag;
/**
* 调用方
*/
@NotBlank(message = "调用方不能为空")
private String referer;
/**
* 推送微信订阅Flag
*/
@NotBlank(message = "是否推送订阅Flag不能为空")
private String pushWxmpFlag;
}

5
epmet-module/epmet-message/epmet-message-client/src/main/java/com/epmet/dto/result/WxMsgAuthInfoResultDTO.java

@ -38,4 +38,9 @@ public class WxMsgAuthInfoResultDTO {
* wx订阅状态 订阅状态(订阅:subscribe 取消订阅:unsubscribe)
*/
private String wxSubscribeStatus;
/**
* 微信openId
*/
private String wxOpenId;
}

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.28
image: 192.168.1.130:10080/epmet-cloud-dev/epmet-message-server:version_placeholder
ports:
- "8085:8085"
network_mode: host # 使用现有网络

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

Loading…
Cancel
Save