Browse Source

Merge branches 'dev' and 'dev_add_customer_id' of http://git.elinkit.com.cn:7070/r/epmet-cloud into dev_add_customer_id

master
wxz 5 years ago
parent
commit
2fc7a3bb9c
  1. 19
      epmet-auth/src/main/java/com/epmet/controller/SsoController.java
  2. 6
      epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginFormDTO.java
  3. 32
      epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java
  4. 57
      epmet-auth/src/main/java/com/epmet/dto/form/ThirdPlatFormDTO.java
  5. 1
      epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java
  6. 50
      epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java
  7. 11
      epmet-auth/src/main/java/com/epmet/service/SsoService.java
  8. 7
      epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java
  9. 6
      epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java
  10. 91
      epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java
  11. 5
      epmet-auth/src/main/resources/bootstrap.yml
  12. 1
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java
  13. 10
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java
  14. 123
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java
  15. 1
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java
  16. 18
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java
  17. 18
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/PyldUserInfoResultDTO.java
  18. 14
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/PyldThirdplatProps.java
  19. 8
      epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java
  20. 11
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java
  21. 17
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java
  22. 9
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java
  23. 20
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java
  24. 20
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java
  25. 142
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java
  26. 147
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java
  27. 21
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java
  28. 26
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java
  29. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java
  30. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java
  31. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java
  32. 1
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java
  33. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java
  34. 19
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java
  35. 21
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java
  36. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java
  37. 42
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java
  38. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java
  39. 124
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java
  40. 32
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java
  41. 31
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java
  42. 3
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java
  43. 46
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java
  44. 30
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java
  45. 23
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java
  46. 7
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java
  47. 56
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java
  48. 5
      epmet-module/data-report/data-report-server/pom.xml
  49. 38
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java
  50. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java
  51. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java
  52. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java
  53. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java
  54. 100
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java
  55. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCpcBaseDataDao.java
  56. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  57. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  58. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenDifficultyDataDao.java
  59. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenGovernRankDataDao.java
  60. 23
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  61. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenOrgRankDataDao.java
  62. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java
  63. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java
  64. 13
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPioneerDataDao.java
  65. 42
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java
  66. 24
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java
  67. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java
  68. 10
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserJoinDao.java
  69. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenUserTotalDataDao.java
  70. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java
  71. 37
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java
  72. 16
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java
  73. 12
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java
  74. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/GrassrootsPartyDevService.java
  75. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java
  76. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java
  77. 25
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  78. 110
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  79. 60
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassrootsPartyDevServiceImpl.java
  80. 44
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  81. 74
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/PartyMemberLeadServiceImpl.java
  82. 18
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java
  83. 67
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java
  84. 19
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java
  85. 1
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java
  86. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java
  87. 217
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java
  88. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java
  89. 9
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java
  90. 35
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml
  91. 8
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml
  92. 110
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml
  93. 61
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml
  94. 15
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml
  95. 47
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  96. 15
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
  97. 26
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml
  98. 60
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml
  99. 59
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  100. 32
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml

19
epmet-auth/src/main/java/com/epmet/controller/SsoController.java

@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.dto.form.SsoEnteOrgFormDTO;
import com.epmet.dto.form.SsoLoginFormDTO;
import com.epmet.dto.form.SsoLoginOperFormDTO;
import com.epmet.dto.result.SsoLoginResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.service.SsoService;
@ -30,19 +31,31 @@ public class SsoController {
private JcetApiService jcetApiService;
/**
* @Description 0入口得到token
* @Description 0泸州app登陆入口得到token
* @Param formDTO
* @author zxc
* @date 2021/1/18 下午4:59
*/
@PostMapping("resi/login")
public Result<SsoLoginResultDTO> ssoLogin(@RequestBody SsoLoginFormDTO formDTO){
public Result<SsoLoginResultDTO> ssoLogin(@RequestBody SsoLoginFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, SsoLoginFormDTO.SsoLoginForm.class);
return new Result<SsoLoginResultDTO>().ok(ssoService.ssoLogin(formDTO));
}
/**
* @Description 0第三方系统跳转至 运营平台登陆接口
* @Param formDTO
* @author zxc
* @date 2021/1/18 下午4:59
*/
@PostMapping("oper/third/login")
public Result<UserTokenResultDTO> thirdLoginOper(@RequestBody SsoLoginOperFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO, SsoLoginOperFormDTO.ThirdPlatformLoginForm.class);
return new Result<UserTokenResultDTO>().ok(ssoService.thirdLoginOperWork(formDTO));
}
@PostMapping("test")
public Result<ThirdPlatUserInfo> testssoLogin(){
public Result<ThirdPlatUserInfo> testssoLogin() {
ThirdPlatUserInfo userInfoByTicket = null;
try {
userInfoByTicket = jcetApiService.getUserInfoByTicket("ssoTicket-vYtMRuXAQZri3wpA2vyq5D8n3Q9oO7ui");

6
epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginFormDTO.java

@ -19,7 +19,7 @@ public class SsoLoginFormDTO implements Serializable {
/**
* sso票据有效期为300秒
*/
@NotBlank(message = "sso票据不能为空",groups = SsoLoginForm.class)
@NotBlank(message = "sso票据不能为空", groups = {SsoLoginForm.class})
private String ticket;
/**
@ -31,12 +31,12 @@ public class SsoLoginFormDTO implements Serializable {
/**
* app类型 resi居民段gov工作端
*/
@NotBlank(message = "app不能为空",groups = SsoLoginForm.class)
@NotBlank(message = "app不能为空", groups = SsoLoginForm.class)
private String app;
/**
* app居民段app工作端
*/
@NotBlank(message = "client不能为空",groups = SsoLoginForm.class)
@NotBlank(message = "client不能为空", groups = SsoLoginForm.class)
private String client;
}

32
epmet-auth/src/main/java/com/epmet/dto/form/SsoLoginOperFormDTO.java

@ -0,0 +1,32 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* @Author zxc
* @DateTime 2021/1/18 下午4:43
*/
@Data
public class SsoLoginOperFormDTO extends LoginCommonFormDTO {
private static final long serialVersionUID = -4215746830030486659L;
public interface ThirdPlatformLoginForm {
}
/**
* 上游系统token
*/
@NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class})
private String thirdToken;
/**
* 上游系统标识
*
* @see com.epmet.enums.ThirdPlatformEnum
*/
@NotBlank(message = "平台标识不能为空", groups = {ThirdPlatformLoginForm.class})
private String platform;
}

57
epmet-auth/src/main/java/com/epmet/dto/form/ThirdPlatFormDTO.java

@ -0,0 +1,57 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2021/1/18 下午4:43
*/
@Data
public class ThirdPlatFormDTO implements Serializable {
private static final long serialVersionUID = -6543952487970013031L;
public interface SsoLoginForm {
}
public interface ThirdPlatformLoginForm {
}
/**
* sso票据有效期为300秒
*/
@NotBlank(message = "sso票据不能为空", groups = {SsoLoginForm.class, ThirdPlatformLoginForm.class})
private String ticket;
/**
* 三方平台应用AppId
*/
@NotBlank(message = "三方平台应用AppId不能为空", groups = SsoLoginForm.class)
private String appId;
/**
* app类型 resi居民段work工作端
*/
@NotBlank(message = "app不能为空", groups = SsoLoginForm.class)
private String app;
@NotBlank(message = "client不能为空", groups = SsoLoginForm.class)
private String client;
/**
* 上游系统token
*/
@NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class})
private String thirdToken;
/**
* 上游系统token
*
* @see com.epmet.enums.ThirdPlatformEnum
*/
@NotBlank(message = "token不能为空", groups = {ThirdPlatformLoginForm.class})
private String platform;
}

1
epmet-auth/src/main/java/com/epmet/dto/result/UserTokenResultDTO.java

@ -17,4 +17,5 @@ public class UserTokenResultDTO implements Serializable {
* 令牌
*/
private String token;
private String customerId;
}

50
epmet-auth/src/main/java/com/epmet/enums/ThirdPlatformEnum.java

@ -0,0 +1,50 @@
package com.epmet.enums;
/**
* 系统环境变量枚举类
* dev|test|prod
*
* @author jianjun liu
* @date 2020-07-03 11:14
**/
public enum ThirdPlatformEnum {
/**
* 平阴联动指挥平台
*/
PINGYIN_LIANDONG("pyld", "平阴联动指挥平台", "pyldApiService"),
;
private String code;
private String name;
private String apiService;
ThirdPlatformEnum(String code, String name, String apiService) {
this.code = code;
this.name = name;
this.apiService = apiService;
}
public static ThirdPlatformEnum getEnum(String code) {
ThirdPlatformEnum[] values = ThirdPlatformEnum.values();
for (ThirdPlatformEnum value : values) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}
public String getCode() {
return code;
}
public String getName() {
return name;
}
public String getApiService() {
return apiService;
}
}

11
epmet-auth/src/main/java/com/epmet/service/SsoService.java

@ -2,6 +2,7 @@ package com.epmet.service;
import com.epmet.dto.form.SsoEnteOrgFormDTO;
import com.epmet.dto.form.SsoLoginFormDTO;
import com.epmet.dto.form.SsoLoginOperFormDTO;
import com.epmet.dto.result.SsoLoginResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
@ -32,4 +33,14 @@ public interface SsoService {
* @Description 4自动进入组织-返回token
**/
UserTokenResultDTO enterOrg(SsoEnteOrgFormDTO formDTO);
/**
* desc: sso登陆运营端
*
* @param formDTO
* @return com.epmet.dto.result.UserTokenResultDTO
* @author LiuJanJun
* @date 2021/2/24 1:28 下午
*/
UserTokenResultDTO thirdLoginOperWork(SsoLoginOperFormDTO formDTO);
}

7
epmet-auth/src/main/java/com/epmet/service/impl/GovWebServiceImpl.java

@ -10,10 +10,7 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.GovWebLoginFormDTO;
import com.epmet.dto.form.GovWebOperLoginFormDTO;
import com.epmet.dto.form.LoginByPassWordFormDTO;
import com.epmet.dto.form.PasswordLoginUserInfoFormDTO;
import com.epmet.dto.result.GovWebOperLoginResultDTO;
import com.epmet.dto.result.PasswordLoginUserInfoResultDTO;
import com.epmet.dto.result.UserTokenResultDTO;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.jwt.JwtTokenProperties;
@ -65,7 +62,7 @@ public class GovWebServiceImpl implements GovWebService {
//2.验证码校验
boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha());
if (!flag) {
logger.error(String.format("用户%s登录,验证码输入错误,暂时放行", formDTO.getPhone()));
logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone()));
//开启验证码校验
throw new RenException(EpmetErrorCode.ERR10019.getCode());
}
@ -84,7 +81,7 @@ public class GovWebServiceImpl implements GovWebService {
//4.密码是否正确
//密码错误
if (!PasswordUtils.matches(formDTO.getPassword(), resultDTO.getPassWord())) {
logger.error("登陆密码错误");
logger.warn("登陆密码错误");
throw new RenException(EpmetErrorCode.ERR10004.getCode());
}

6
epmet-auth/src/main/java/com/epmet/service/impl/LoginServiceImpl.java

@ -293,9 +293,9 @@ public class LoginServiceImpl implements LoginService {
//1、验证码是否正确
boolean flag = captchaService.validate(formDTO.getUuid(), formDTO.getCaptcha());
if (!flag) {
logger.error(String.format("用户%s登录,验证码输入错误,暂时放行",formDTO.getPhone()));
//2020-05-21去除验证码校验 TODO
//return new Result<UserTokenResultDTO>().error(EpmetErrorCode.ERR10019.getCode());
logger.warn(String.format("用户%s登录,验证码输入错误", formDTO.getPhone()));
//2020-05-21去除验证码校验
return new Result<UserTokenResultDTO>().error(EpmetErrorCode.ERR10019.getCode());
}
//2、账号是否存在
//获取用户信息

91
epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.epmet.common.token.constant.LoginConstant;
import com.epmet.commons.thirdplat.apiservice.AbstractApiService;
import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo;
import com.epmet.commons.thirdplat.constants.PyldConstants;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.ExceptionUtils;
import com.epmet.commons.tools.exception.RenException;
@ -14,6 +15,8 @@ import com.epmet.commons.tools.utils.*;
import com.epmet.dto.*;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
import com.epmet.enums.ThirdPlatformEnum;
import com.epmet.feign.EpmetUserFeignClient;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.feign.GovOrgOpenFeignClient;
import com.epmet.feign.OperCrmOpenFeignClient;
@ -22,6 +25,7 @@ import com.epmet.jwt.JwtTokenUtils;
import com.epmet.redis.SsoRedis;
import com.epmet.service.SsoService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -29,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@ -66,6 +71,9 @@ public class SsoServiceImpl implements SsoService {
@Autowired
private CpUserDetailRedis cpUserDetailRedis;
@Autowired
private EpmetUserFeignClient epmetUserFeignClient;
/**
* @Description 0入口得到token
* @Param formDTO
@ -114,16 +122,64 @@ public class SsoServiceImpl implements SsoService {
throw new RenException("【SSO登录】userId为空,生成token失败");
}
//生成业务token
String token = this.generateToken(formDTO.getApp(),formDTO.getClient(), userId);
String token = this.generateToken(formDTO.getApp(), formDTO.getClient(), userId);
//存放Redis
if (StringUtils.isBlank(customerId)){
if (StringUtils.isBlank(customerId)) {
throw new RenException("【SSO登录】customerId为空,缓存放置token失败");
}
this.disposeTokenDto(formDTO, userId, token, customerId);
this.disposeTokenDto(formDTO.getApp(), formDTO.getClient(), userId, token, customerId);
return new SsoLoginResultDTO(token);
}
@Override
public UserTokenResultDTO thirdLoginOperWork(SsoLoginOperFormDTO formDTO) {
ThirdPlatUserInfo thirdUser;
try {
ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum(formDTO.getPlatform());
String apiService = platformEnum.getApiService();
AbstractApiService apiServiceImpl = (AbstractApiService) SpringContextUtils.getBean(apiService);
thirdUser = apiServiceImpl.getUserInfoByTicket(formDTO.getThirdToken());
} catch (RenException e) {
throw new RenException(e.getCode(), e.getMessage());
} catch (Exception e) {
throw new RenException(e.getMessage());
}
if (thirdUser == null) {
throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), PyldConstants.REPONSE_USER_NOT_LOGIN);
}
//获取用户信息
GovWebOperLoginFormDTO form = new GovWebOperLoginFormDTO();
form.setCustomerId(thirdUser.getCustomerId());
form.setMobile(thirdUser.getMobile());
Result<GovWebOperLoginResultDTO> result = epmetUserFeignClient.getStaffIdAndPwd(form);
//todo userId 写死测试 3f7f852ce22c511aa67ecb695395295d start
GovWebOperLoginResultDTO demo = new GovWebOperLoginResultDTO();
demo.setUserId("3f7f852ce22c511aa67ecb695395295d");
result = new Result<>();
result.ok(demo);
//test end
if (!result.success() || null == result.getData() || null == result.getData().getUserId()) {
logger.error("根据手机号查询PC工作端登陆人员信息失败,返回10003账号不存在");
throw new RenException(EpmetErrorCode.ERR10003.getCode());
}
//4、生成token返回,且将TokenDto存到redis
//生成业务token
GovWebOperLoginResultDTO epmetUser = result.getData();
String token = this.generateToken(formDTO.getApp(), formDTO.getClient(), epmetUser.getUserId());
//存放Redis
this.disposeTokenDto(formDTO.getApp(), formDTO.getClient(), epmetUser.getUserId(), token, thirdUser.getCustomerId());
UserTokenResultDTO userTokenResultDTO = new UserTokenResultDTO();
userTokenResultDTO.setToken(token);
userTokenResultDTO.setCustomerId(thirdUser.getCustomerId());
return userTokenResultDTO;
}
/**
* @Description token放缓存
* @Param formDTO
@ -133,12 +189,12 @@ public class SsoServiceImpl implements SsoService {
* @author zxc
* @date 2021/1/18 下午5:32
*/
public void disposeTokenDto(SsoLoginFormDTO formDTO, String userId, String token, String customerId){
public void disposeTokenDto(String app, String client, String userId, String token, String customerId) {
int expire = jwtTokenProperties.getExpire();
TokenDto tokenDto = new TokenDto();
tokenDto.setCustomerId(customerId);
tokenDto.setApp(formDTO.getApp());
tokenDto.setClient(formDTO.getClient());
tokenDto.setApp(app);
tokenDto.setClient(client);
tokenDto.setUserId(userId);
tokenDto.setToken(token);
tokenDto.setUpdateTime(System.currentTimeMillis());
@ -155,7 +211,7 @@ public class SsoServiceImpl implements SsoService {
* @author zxc
* @date 2021/1/18 下午5:14
*/
private String generateToken(String app,String client, String userId) {
private String generateToken(String app, String client, String userId) {
Map<String, Object> map = new HashMap<>(16);
map.put("app", app);
map.put("client", client);
@ -466,4 +522,25 @@ public class SsoServiceImpl implements SsoService {
return userTokenResultDTO;
}
public static void main(String[] args) {
String url = "https://epmet-ext9.elinkservice.cn/platform/unifiedAuth/loginCheck";
String platformToken = "1348803062424166401_dd08e23b0d524879a5c67e7f2ffd1468";
String appId = "7a5aec009ba4eba8e254ee64fe3775e1";
String appKey = "14faef9af508d1c253b720ea5a43f9de";
String appSecret = "38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595";
long ts = System.currentTimeMillis();
String message = appId + appKey + appSecret + ts;
String accessToken = DigestUtils.md5Hex(message.getBytes(StandardCharsets.UTF_8));
//ThirdPlatformEnum platformEnum = ThirdPlatformEnum.getEnum("pyld");
JSONObject jsonObject = new JSONObject();
jsonObject.put("platformToken", platformToken);
Map<String, Object> headerMap = new HashMap<>(4);
headerMap.put("AppKey", appKey);
headerMap.put("Timestamp", ts);
headerMap.put("AccessToken", accessToken);
Result<String> stringResult = HttpClientManager.getInstance().sendPost(url, url.startsWith("https://"), jsonObject.toJSONString(), headerMap);
System.out.println(stringResult);
}
}

5
epmet-auth/src/main/resources/bootstrap.yml

@ -139,3 +139,8 @@ thirdplat:
domain: @thirdplat.jcet.domain@
appkey: @thirdplat.jcet.appkey@
appsecret: @thirdplat.jcet.appsecret@
pyld:
domain: https://epmet-ext9.elinkservice.cn/platform
appId: 7a5aec009ba4eba8e254ee64fe3775e1
appKey: 14faef9af508d1c253b720ea5a43f9de
appSecret: 38e7c2604c8dd33c445705d25eebbfc12a2f7ed8a87111e9e10a40312d3a1595

1
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/AbstractApiService.java

@ -32,7 +32,6 @@ public abstract class AbstractApiService {
throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(),
EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(thResult.getInternalMsg()));
}
JcetResult jcetResult = JSON.parseObject(thResult.getData(), JcetResult.class);
if (!jcetResult.isSuccess()) {
throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(),

10
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/jcet/JcetApiService.java

@ -13,11 +13,14 @@ import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
@Service
public class JcetApiService extends AbstractApiService {
Logger logger = LoggerFactory.getLogger(getClass());
@ -35,6 +38,7 @@ public class JcetApiService extends AbstractApiService {
* @author wxz
* @date 2021.01.19 10:26
*/
@Override
public ThirdPlatUserInfo getUserInfoByTicket(String ticket) throws UnsupportedEncodingException {
logger.info("【请求酒城e通第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>");
@ -98,10 +102,10 @@ public class JcetApiService extends AbstractApiService {
* @return
* @throws UnsupportedEncodingException
*/
private Map<String, String> getHeaders(Object contentObject) throws UnsupportedEncodingException {
int bodyLength = JSON.toJSONString(contentObject).getBytes("utf-8").length;
private Map<String, Object> getHeaders(Object contentObject) throws UnsupportedEncodingException {
int bodyLength = JSON.toJSONString(contentObject).getBytes(StandardCharsets.UTF_8).length;
Map<String, String> headers = new HashMap();
Map<String, Object> headers = new HashMap();
long timestamp = System.currentTimeMillis();
headers.put(JcetConstants.PLAT_HEADER_OPEN_TIMESTAMP, String.valueOf(timestamp));
headers.put(JcetConstants.PLAT_HEADER_OPEN_APP_ID, jcetThirdplatProps.getAppkey());

123
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/apiservice/pyld/PyldApiService.java

@ -0,0 +1,123 @@
package com.epmet.commons.thirdplat.apiservice.pyld;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.epmet.commons.thirdplat.apiservice.AbstractApiService;
import com.epmet.commons.thirdplat.bean.ThirdPlatUserInfo;
import com.epmet.commons.thirdplat.constants.PyldConstants;
import com.epmet.commons.thirdplat.dto.result.jcet.PyldUserInfoResultDTO;
import com.epmet.commons.thirdplat.properties.PyldThirdplatProps;
import com.epmet.commons.thirdplat.properties.ThirdplatProps;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.HttpClientManager;
import com.epmet.commons.tools.utils.Result;
import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
/**
* desc: 平阴联动指挥平台sso登陆服务类 接入文档http://note.youdao.com/noteshare?id=167ad65365f9eccf7925e8c2629d2021&sub=555AE50510344CB5AACD5C06B9AA3B3B
*
* @author LiuJanJun
* @date 2021/2/25 1:43 下午
*/
@Service
public class PyldApiService extends AbstractApiService {
Logger logger = LoggerFactory.getLogger(getClass());
private PyldThirdplatProps pyldThirdplatProps;
public PyldApiService(ThirdplatProps props) {
this.thirdplatProps = props;
pyldThirdplatProps = props.getPyld();
}
/**
* @return
* @Description 通过第三方平台ticket获取用户信息
* @author wxz
* @date 2021.01.19 10:26
*/
@Override
public ThirdPlatUserInfo getUserInfoByTicket(String platformToken) {
logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口开始>>>>>>>>>>>>");
logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口入参 platformToken:{}", platformToken);
JSONObject jsonParam = new JSONObject();
jsonParam.put(PyldConstants.PLAT_PARAM_TOKEN, platformToken);
jsonParam.put(PyldConstants.PLAT_PARAM_MANAGEMENTKEY, PyldConstants.PLAT_PARAM_MANAGEMENTKEY_VALUE);
String domain = pyldThirdplatProps.getDomain();
Result<String> result = HttpClientManager.getInstance().sendPost(
domain.concat(PyldConstants.METHOD_CHECK_LOGIN),
domain.startsWith("https://"),
jsonParam.toJSONString(),
buildHeaders());
logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口返回:{}", result.getData());
logger.info("【请求平阴联动指挥平台第三方平台】getUserInfoByTicket()接口结束<<<<<<<<<<<<");
PyldUserInfoResultDTO resultDTO = this.parseResult(result);
ThirdPlatUserInfo userInfo = new ThirdPlatUserInfo();
userInfo.setMobile(resultDTO.getMobile());
userInfo.setCustomerId(resultDTO.getReserved());
return userInfo;
}
/**
* 构建请求头信息
*
* @return
*/
private Map<String, Object> buildHeaders() {
Map<String, Object> headers = new HashMap();
long timestamp = System.currentTimeMillis();
headers.put(PyldConstants.PLAT_HEADER_TIMESTAMP, timestamp);
headers.put(PyldConstants.PLAT_HEADER_APP_KEY, pyldThirdplatProps.getAppkey());
String encryptContent = pyldThirdplatProps.getAppId() + pyldThirdplatProps.getAppkey() + pyldThirdplatProps.getAppSecret() + timestamp;
headers.put(PyldConstants.PLAT_HEADER_ACCESS_TOKEN, DigestUtils.md5Hex(encryptContent.getBytes(StandardCharsets.UTF_8)));
return headers;
}
/**
* desc: 解析结果
*
* @param thResult
* @return com.epmet.commons.thirdplat.dto.result.jcet.JcetUserInfoResultDTO
* @author LiuJanJun
* @date 2021/2/24 10:11 上午
*/
private PyldUserInfoResultDTO parseResult(Result<String> thResult) {
if (!thResult.success()) {
throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(),
EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(thResult.getInternalMsg()));
}
JSONObject jcetResult = JSON.parseObject(thResult.getData());
Integer code = jcetResult.getInteger("code");
String msg = jcetResult.getString("msg");
if (code == null || code != 0) {
throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), msg.concat(",错误码:") + code);
}
JSONObject data = jcetResult.getJSONObject("data");
if (data == null) {
throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(),
EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getMsg().concat(":").concat(PyldConstants.REPONSE_USER_NOT_LOGIN));
}
PyldUserInfoResultDTO userInfo = data.getObject("userInfo", PyldUserInfoResultDTO.class);
if (userInfo == null || StringUtils.isBlank(userInfo.getMobile()) || StringUtils.isBlank(userInfo.getReserved())) {
throw new RenException(EpmetErrorCode.THIRD_PLAT_REQUEST_ERROR.getCode(), PyldConstants.REPONSE_USER_NOT_LOGIN);
}
return userInfo;
}
}

1
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/bean/ThirdPlatUserInfo.java

@ -7,4 +7,5 @@ public class ThirdPlatUserInfo {
private String openId;
private String name;
private String mobile;
private String customerId;
}

18
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/constants/PyldConstants.java

@ -0,0 +1,18 @@
package com.epmet.commons.thirdplat.constants;
public interface PyldConstants {
String METHOD_CHECK_LOGIN = "/unifiedAuth/loginCheck";
String PLAT_HEADER_TIMESTAMP = "timestamp";
String PLAT_HEADER_APP_KEY = "appkey";
String PLAT_HEADER_ACCESS_TOKEN = "accessToken";
String PLAT_PARAM_TOKEN = "platformToken";
String PLAT_PARAM_MANAGEMENTKEY = "managementKey";
String PLAT_PARAM_MANAGEMENTKEY_VALUE = "epmet_work";
String REPONSE_USER_NOT_LOGIN = "token失效,请重新登陆";
}

18
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/dto/result/jcet/PyldUserInfoResultDTO.java

@ -0,0 +1,18 @@
package com.epmet.commons.thirdplat.dto.result.jcet;
import lombok.Data;
import java.io.Serializable;
@Data
public class PyldUserInfoResultDTO implements Serializable {
private static final long serialVersionUID = 6176427074670949388L;
/**
* 手机号
*/
private String mobile;
/**
* 客户Id
*/
private String reserved;
}

14
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/PyldThirdplatProps.java

@ -0,0 +1,14 @@
package com.epmet.commons.thirdplat.properties;
import lombok.Data;
/**
* 酒城e通三方平台配置
*/
@Data
public class PyldThirdplatProps {
private String domain;
private String appId;
private String appkey;
private String appSecret;
}

8
epmet-commons/epmet-commons-thirdplat/src/main/java/com/epmet/commons/thirdplat/properties/ThirdplatProps.java

@ -6,7 +6,13 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
@Data
@ConfigurationProperties(prefix = "thirdplat")
public class ThirdplatProps {
/**
* 泸州 酒城e通
*/
private JcetThirdplatProps jcet;
/**
* 平阴联动指挥平台
*/
private PyldThirdplatProps pyld;
}

11
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/aspect/RequirePermissionAspect.java

@ -11,9 +11,6 @@ package com.epmet.commons.tools.aspect;
import com.epmet.commons.tools.annotation.RequirePermission;
import com.epmet.commons.tools.constant.ThreadLocalConstant;
import com.epmet.commons.tools.dto.form.HasSpecifiedPermissionFormDTO;
import com.epmet.commons.tools.dto.form.LoginUserInfoFormDTO;
import com.epmet.commons.tools.dto.form.LoginUserInfoResultDTO;
import com.epmet.commons.tools.dto.form.RoleOpeScopeResultDTO;
import com.epmet.commons.tools.enums.RequirePermissionEnum;
import com.epmet.commons.tools.exception.EpmetErrorCode;
import com.epmet.commons.tools.exception.RenException;
@ -30,11 +27,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 每次请求过滤Api中配置的权限key出来并且判断是否具有该功能权限
* @Author wxz
@ -89,8 +81,9 @@ public class RequirePermissionAspect {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
Boolean data = result.getData();
if (data == null || !data) {
log.error("操作权限不足");
log.warn("操作权限不足,key:{}", requirePermission);
throw new RenException(EpmetErrorCode.REQUIRE_PERMISSION.getCode());
}
}

17
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/EnvEnum.java

@ -11,11 +11,14 @@ import org.springframework.core.env.Environment;
* @date 2020-07-03 11:14
**/
public enum EnvEnum {
LOCAL("local", "本地环境","http://localhost:8080/api/"),
DEV("dev", "开发环境","http://192.168.1.130:8080/api/"),
TEST("test", "体验环境","https://epmet-dev.elinkservice.cn/api/"),
PROD("prod", "生产环境","https://epmet-cloud.elinkservice.cn/api/"),
UN_KNOWN("un_known", "未知","https://epmet-dev.elinkservice.cn/api/"),
/**
* 环境变量枚举
*/
LOCAL("local", "本地环境", "http://localhost:8080/api/"),
DEV("dev", "开发环境", "http://192.168.1.130:8080/api/"),
TEST("test", "体验环境", "https://epmet-dev.elinkservice.cn/api/"),
PROD("prod", "生产环境", "https://epmet-cloud.elinkservice.cn/api/"),
UN_KNOWN("un_known", "未知", "https://epmet-dev.elinkservice.cn/api/"),
;
private String code;
@ -33,7 +36,7 @@ public enum EnvEnum {
public static EnvEnum getEnum(String code) {
EnvEnum[] values = EnvEnum.values();
for (EnvEnum value : values) {
if (code != null && value.getCode().equals(code)) {
if (value.getCode().equals(code)) {
return value;
}
}
@ -44,7 +47,7 @@ public enum EnvEnum {
try {
Environment environment = SpringContextUtils.getBean(Environment.class);
String[] activeProfiles = environment.getActiveProfiles();
if (activeProfiles != null && activeProfiles.length > 0) {
if (activeProfiles.length > 0) {
return getEnum(activeProfiles[0]);
}
} catch (Exception e) {

9
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/HttpClientManager.java

@ -188,15 +188,16 @@ public class HttpClientManager {
}
public Result<String> sendPost(String url, boolean isHttps, String jsonStrParam,Map<String,String> headerMap) {
public Result<String> sendPost(String url, boolean isHttps, String jsonStrParam, Map<String, Object> headerMap) {
try {
HttpPost httppost = new HttpPost(url);
httppost.setConfig(requestConfig);
httppost.addHeader(HEADER_CONTENT_TYPE, HEADER_APPLICATION_JSON);
if (null != headerMap){
headerMap.forEach((k,v) -> {
httppost.addHeader(k,v);
if (null != headerMap) {
headerMap.forEach((k, v) -> {
if (v != null)
httppost.addHeader(k, v.toString());
});
}
if (StringUtils.isNotEmpty(jsonStrParam)) {

20
epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/validator/IdCardNoValidatorUtils.java

@ -35,14 +35,14 @@ public class IdCardNoValidatorUtils {
try {
//判断号码的长度 15位或18位
if (idCardNo.length() != 15 && idCardNo.length() != 18) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证号码长度应该为15位或18位"));
return false;
}
if (idCardNo.length() == 18) {
String lastStr = idCardNo.substring(idCardNo.length() - 1);
if (!Character.isDigit(lastStr.charAt(0))) {
if (Character.isLowerCase(lastStr.charAt(0))) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "18身份证号最后一位字母需要大写"));
return false;
}
} else {
@ -55,7 +55,7 @@ public class IdCardNoValidatorUtils {
iDCardNo = idCardNo.substring(0, 6) + "19" + idCardNo.substring(6, 15);
}
if (isStrNum(iDCardNo) == false) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证15位号码都应为数字;18位号码除最后一位外,都应为数字"));
return false;
}
//判断出生年月
@ -63,27 +63,27 @@ public class IdCardNoValidatorUtils {
String strMonth = iDCardNo.substring(10, 12);// 月份
String strDay = iDCardNo.substring(12, 14);// 月份
if (isStrDate(strYear + "-" + strMonth + "-" + strDay) == false) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日无效"));
return false;
}
GregorianCalendar gc = new GregorianCalendar();
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
if ((gc.get(Calendar.YEAR) - Integer.parseInt(strYear)) > 150 || (gc.getTime().getTime() - s.parse(strYear + "-" + strMonth + "-" + strDay).getTime()) < 0) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证生日不在有效范围"));
return false;
}
if (Integer.parseInt(strMonth) > 12 || Integer.parseInt(strMonth) == 0) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证月份无效"));
return false;
}
if (Integer.parseInt(strDay) > 31 || Integer.parseInt(strDay) == 0) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证日期无效"));
return false;
}
//判断地区码
Hashtable h = GetAreaCode();
if (h.get(iDCardNo.substring(0, 2)) == null) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证地区编码错误"));
return false;
}
//判断最后一位
@ -96,12 +96,12 @@ public class IdCardNoValidatorUtils {
iDCardNo = iDCardNo + strVerifyCode;
if (idCardNo.length() == 18 && !iDCardNo.equals(idCardNo)) {
logger.error(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码"));
logger.warn(String.format("校验身份证号:%s错误:%s", idCardNo, "身份证无效,不是合法的身份证号码"));
return false;
}
} catch (Exception e) {
logger.error(String.format("校验身份证号方法异常"));
logger.warn(String.format("校验身份证号方法异常"));
e.printStackTrace();
}
return true;

20
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/27 17:52
*/
@Data
public class AgencyInfoDTO implements Serializable {
private String agencyId;
private String areaCode;
private List<String> subAgencyIds;
private List<String> subGridIds;
}

142
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java

@ -0,0 +1,142 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 项目(事件)分类按网格_按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenProjectCategoryGridDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 日期yyyyMMdd
*/
private String dateId;
/**
* 网格id
*/
private String gridId;
/**
* 网格所属的组织id
*/
private String pid;
/**
* 网格所有的父级id,以英文:或者英文,隔开
*/
private String pids;
/**
* e世通中的项目类别编码
*/
private String epmetCategoryCode;
/**
* 该分类下所有项目总数
*/
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
*/
private BigDecimal unResolvedRatio;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

147
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java

@ -0,0 +1,147 @@
/**
* 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;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
import java.math.BigDecimal;
/**
* 项目(事件)分类按组织_按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Data
public class ScreenProjectCategoryOrgDailyDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 日期yyyyMMdd
*/
private String dateId;
/**
* 组织id
*/
private String orgId;
/**
* 社区级community街道:street,区县级: district,市级: city省级:province
*/
private String orgType;
/**
* 当前orgId所属的上级id
*/
private String pid;
/**
* orgId所有的父级id,以英文:或者英文,隔开
*/
private String pids;
/**
* e世通中的项目类别编码
*/
private String epmetCategoryCode;
/**
* 该分类下所有项目总数
*/
private Integer projectTotal;
/**
* 该分类下正在处理中的项目总数
*/
private Integer pendingTotal;
/**
* 该分类下已结案的项目总数
*/
private Integer closedTotal;
/**
* 该分类下已结案无需解决的项目总数
*/
private Integer unResolvedTotal;
/**
* 该分类下已结案已解决的项目总数
*/
private Integer resolvedTotal;
/**
* 该分类下项目结案率
*/
private BigDecimal closedRatio;
/**
* 该分类下已结案项目解决率
*/
private BigDecimal resolvedRatio;
/**
* 该分类下已结案项目未解决率
*/
private BigDecimal unResolvedRatio;
/**
* 删除标识
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

21
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form.screen;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/2/23 15:26
*/
@Data
public class CategoryAnalysisFormDTO implements Serializable {
private static final long serialVersionUID = -3088762710988337423L;
public interface CategoryAnalysis{}
@NotBlank(message = "组织ID不能为空",groups = {CategoryAnalysis.class})
private String agencyId;
}

26
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java

@ -0,0 +1,26 @@
package com.epmet.dto.result.screen;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/2/23 15:28
*/
@NoArgsConstructor
@Data
public class CategoryAnalysisResultDTO implements Serializable {
private static final long serialVersionUID = 4500337306142206855L;
/**
* 类别名称
*/
private String categoryName;
/**
* 项目总数
*/
private Integer projectTotal;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyAndNumFormDTO.java

@ -25,4 +25,9 @@ public class AgencyAndNumFormDTO implements Serializable {
* */
@NotBlank(message = "机关Id不能为空" , groups = AgencyFormDTO.CommonAgencyIdGroup.class)
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124
*/
private String areaCode;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AgencyNumTypeParamFormDTO.java

@ -32,4 +32,9 @@ public class AgencyNumTypeParamFormDTO implements Serializable {
@NotBlank(message = "类型不能为空", groups = AgencyNumTypeParamGroup.class)
private String type;
/**
* 地区编码
*/
private String areaCode;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ContactMassLineChartFormDTO.java

@ -21,4 +21,9 @@ public class ContactMassLineChartFormDTO implements Serializable {
*/
@NotBlank(message = "机关ID不能为空",groups = {ContactMassLineChart.class})
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124
*/
private String areaCode;
}

1
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/FineExampleFormDTO.java

@ -3,6 +3,7 @@ package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ParymemberFormDTO.java

@ -21,4 +21,9 @@ public class ParymemberFormDTO implements Serializable {
*/
@NotBlank(message = "机关ID不能为空",groups = {Parymember.class})
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124
*/
private String areaCode;
}

19
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java

@ -0,0 +1,19 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 16:12
*/
@Data
public class ScreenProjectDetailFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
@NotBlank(message = "projectId不能为空")
private String projectId;
}

21
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java

@ -0,0 +1,21 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 15:22
*/
@Data
public class ScreenProjectDistributionFormDTO implements Serializable {
private static final long serialVersionUID = 1L;
private String areaCode;
private String level;
private String agencyId;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankFormDTO.java

@ -35,4 +35,9 @@ public class SubAgencyIndexRankFormDTO implements Serializable {
* area_code升级,新增此参数来源于当前token
*/
private String customerId;
/**
* 行政区域编码
*/
private String areaCode;
}

42
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/SubAgencyIndexRankPyFormDTO.java

@ -0,0 +1,42 @@
package com.epmet.evaluationindex.screen.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/28 14:29
*/
@Data
public class SubAgencyIndexRankPyFormDTO implements Serializable {
private static final long serialVersionUID = 8930332375421099186L;
/**
* 当前组织平阴大屏默认传跟组织
* */
@NotBlank(message = "agencyId不能为空")
private String agencyId;
/**
* 目前只有平阴在传默认赋值370124
* */
@NotBlank(message = "areaCode不能为空;平阴默认传:370124")
private String areaCode;
/**
* 默认查询前10条
* */
@NotNull(message = "topNum不能为空")
private Integer topNum;
@NotBlank(message = "type不能为空,街道:street;网格:grid")
private String type;
@NotBlank(message = "customerId不能为空")
private String customerId;
}

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/GovernCapacityResultDTO.java

@ -44,4 +44,6 @@ public class GovernCapacityResultDTO implements Serializable {
* 当前agencyName的上一级组织名称
*/
private String parentAgencyName;
private String orgId;
}

124
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java

@ -0,0 +1,124 @@
package com.epmet.evaluationindex.screen.dto.result;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 16:15
*/
@Data
public class ScreenProjectDetailResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目id
*/
private String projectId;
/**
* 议题内容其实就是项目内容
*/
private String projectContent;
/**
* 上报时间对应的是立项时间;格式yyyy-MM-dd HH:mm
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
private String reportTime;
/**
* 所属类别名称
*/
private String categoryName;
/**
* 上报人名
*/
private String reportUserName;
/**
* 上报人电话
*/
private String mobile;
/**
* 上报位置
*/
private String reportAddress;
/**
* 图片列表
*/
private List<String> imgList;
/**
* 处理进展列表(返回的是按时间升序的集合)
*/
private List<processDTO> processList;
@Data
public static class processDTO{
@JsonIgnore
private String processId;
/**
* 处理部门名称
*/
private String handleDeptName;
/**
* 公开处理意见
*/
private String suggestion;
/**
* 处理时间yyyy-MM-dd HH:mm:ss
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date reponseTime;
/**
* 关闭close; 回应 response结案closed_case退回return部门流转transfer创建项目created
*/
private String operation;
/**
* 被吹哨部门如果是多个以逗号隔开返给前端
*/
private String whistleDeptName;
private List<AttachmentDTO> attachments;
@Data
public static class AttachmentDTO{
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 文件名
*/
private String fileName;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 附件名uuid随机生成
*/
private String attachmentName;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 附件大小 字节为单位
*/
private String attachmentSize;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
@JsonInclude(JsonInclude.Include.NON_NULL)
/**
* 语音或视频时长
*/
private String duration;
}
}
}

32
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java

@ -0,0 +1,32 @@
package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
/**
* @description:
* @author: liushaowen
* @date: 2021/2/24 15:26
*/
@Data
public class ScreenProjectDistributionResultDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
private String id;
/**
* 项目标题
*/
private String projectTitle;
/**
* 项目等级 1:红色事件2黄色事件3绿色事件
*/
private String level;
/**
* 经纬度
*/
private String longitude;
private String latitude;
}

31
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/VoluntaryServiceTrendFormDTO.java

@ -0,0 +1,31 @@
package com.epmet.plugins.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
/**
* 7工作日志党员志愿者服务近12月趋势图
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/27 19:53
*/
@Data
public class VoluntaryServiceTrendFormDTO {
/**
* 当前组织id
*/
@NotBlank(message = "agencyId不能为空")
private String agencyId;
@NotBlank(message = "目前只有平阴在传,默认赋值:370124")
private String areaCode;
@NotBlank(message = "customerId不能为空")
private String customerId;
/**
* 截止到某月格式yyyyMM目前没有让大屏前端赋值代码默认为为上个月
*/
private String endMonthId;
}

3
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordRankFormDTO.java

@ -35,4 +35,7 @@ public class WorkRecordRankFormDTO implements Serializable {
@NotBlank(message = "customerId不能为空")
private String customerId;
@NotBlank(message = "areaCode不能为空,目前只有平阴在传,默认赋值:370124")
private String areaCode;
}

46
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/form/WorkRecordTrendFormDTO.java

@ -0,0 +1,46 @@
package com.epmet.plugins.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* 6工作日志近12月趋势图
*
* @author sun
*/
@Data
public class WorkRecordTrendFormDTO implements Serializable {
private static final long serialVersionUID = -2934835714413031036L;
/**
* party:支部建设; union:联建共建党员志愿服务voluntaryservice
*/
@NotBlank(message = "dataType不能为空;可选值:party:支部建设; union:联建共建")
private String dataType;
/**
* 当前组织id
*/
@NotBlank(message = "agencyId不能为空")
private String agencyId;
/**
* 组织次数organize参与人数joinuser平均参与人数avguser
*/
@NotBlank(message = "type不能为空")
private String type;
@NotBlank(message = "customerId不能为空")
private String customerId;
/**
* 查询数据起始月份Id
*/
private String startMonth;
/**
* 查询数据结束月份Id
*/
private String endMonth;
}

30
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendDTO.java

@ -0,0 +1,30 @@
package com.epmet.plugins.result;
import lombok.Data;
import java.io.Serializable;
/**
* 7工作日志党员志愿者服务近12月趋势图
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/28 13:41
*/
@Data
public class VoluntaryServiceTrendDTO implements Serializable {
private String monthId;
/**
* 组织次数
*/
private Integer organizeTotal;
/**
* 参与人数
*/
private Integer participateUserTotal;
/**
* 平均参与人数
*/
private Integer avgParticipateUserTotal;
}

23
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/VoluntaryServiceTrendResultDTO.java

@ -0,0 +1,23 @@
package com.epmet.plugins.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 7工作日志党员志愿者服务近12月趋势图
*
* @author yinzuomei@elink-cn.com
* @date 2021/2/27 19:55
*/
@Data
public class VoluntaryServiceTrendResultDTO implements Serializable {
private static final long serialVersionUID = -560895826884970305L;
private List<String> xAxis=new ArrayList<>();
//组织次数:organize;参与人数:joinuser;平均参与人数:avguser
private List<Integer> organizeList=new ArrayList<>();
private List<Integer> joinUserList=new ArrayList<>();
private List<Integer> avgUserList=new ArrayList<>();
}

7
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordRankResultDTO.java

@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
@ -29,4 +30,10 @@ public class WorkRecordRankResultDTO implements Serializable {
*下级排行列表
*/
private List<WorkRecordSubRank> subRankList;
public WorkRecordRankResultDTO() {
this.participateTotal=0;
this.participateUserTotal=0;
this.subRankList=new ArrayList<>();
}
}

56
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordTrendResultDTO.java

@ -0,0 +1,56 @@
package com.epmet.plugins.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* 6工作日志近12月趋势图
*
* @author sun
*/
@Data
public class WorkRecordTrendResultDTO implements Serializable {
/**
* 横轴 过去十二个月份
* ['1月', '2月', '3月', '4月', '5月','6月','7月','8月','9月','10月','11月','12月']
*/
private List<String> xAxis = new ArrayList<>();
/**
* 资源标签名
* ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀']
*/
private List<String> legend = new ArrayList<>();
/**
*各项资源对应数据对象
*/
private List<WorkRecordTrendResultDTO.SeriesResultDTO> series = new ArrayList<>();
@Data
public static class SeriesResultDTO {
/**
* 资源标签名
* ['三会一课', '主题党日', '三述专题', '志愿服务', '党内关怀']
*/
private String name;
/**
* 各项资源对应12月份数据
*/
private List<Integer> data = new ArrayList<>();
/**
* 数据对应的月份Id
*/
@JsonIgnore
private String monthId;
/**
* 各项资源对应某一月份数据
*/
@JsonIgnore
private Integer value;
}
}

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

@ -39,6 +39,11 @@
<artifactId>common-service-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>com.epmet</groupId>
<artifactId>oper-crm-client</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>

38
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/plugins/WorkRecordController.java

@ -3,8 +3,14 @@ package com.epmet.datareport.controller.plugins;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService;
import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO;
import com.epmet.plugins.form.WorkRecordRankFormDTO;
import com.epmet.plugins.form.WorkRecordTrendFormDTO;
import com.epmet.plugins.result.VoluntaryServiceTrendResultDTO;
import com.epmet.plugins.result.WorkRecordRankResultDTO;
import com.epmet.plugins.result.WorkRecordTrendResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@ -14,17 +20,16 @@ import org.springframework.web.bind.annotation.*;
* @author yinzuomei@elink-cn.com
* @date 2021/2/21 19:51
*/
@Slf4j
@RestController
@RequestMapping("plugins/workrecord")
@RequestMapping("screen/plugins/workrecord")
public class WorkRecordController {
@Autowired
private ScreenWorkRecordOrgDailyService screenWorkRecordOrgDailyService;
//todo 工作日志是否要添加area_code、parent_area_code、orgType;插件是否可以提供;也可以采集的时候赋值
//5、【工作日志】本机及下级排名
//NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348966
//返参中的当前组织的参与人数、组织次数 直接sum所有下级的值;
//下级根据当前组织的areaCode查询下级列表,再去查询screen_work_record_org_daily
//legend来源于screen_customer_work_record_dict表 level=2,dataType=party
@PostMapping("ranklist")
public Result<WorkRecordRankResultDTO> rankList(@RequestHeader("CustomerId")String customerId, @RequestBody WorkRecordRankFormDTO formDTO){
@ -37,4 +42,31 @@ public class WorkRecordController {
//6、【工作日志】近12月趋势图
//NEI接口地址:https://nei.netease.com/interface/detail/?pid=57068&id=348967
//可以下级组织+下级网格 orgId 直接 in
/**
* @Description 6工作日志近12月趋势图
* @author sun
*/
@PostMapping("trend")
public Result<WorkRecordTrendResultDTO> trend(@RequestHeader("CustomerId")String customerId, @RequestBody WorkRecordTrendFormDTO formDTO){
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<WorkRecordTrendResultDTO>().ok(screenWorkRecordOrgDailyService.trend(formDTO));
}
/**
* @param customerId
* @param formDTO
* @author yinzuomei
* @description 7工作日志党员志愿者服务近12月趋势图
* @Date 2021/2/27 19:56
**/
@PostMapping("voluntaryservicetrend")
public Result<VoluntaryServiceTrendResultDTO> voluntaryServiceTrend(@RequestHeader("CustomerId")String customerId, @RequestBody VoluntaryServiceTrendFormDTO formDTO){
formDTO.setCustomerId(customerId);
if (StringUtils.isBlank(formDTO.getEndMonthId())) {
formDTO.setEndMonthId(com.epmet.commons.tools.utils.DateUtils.getCurrentTimeBeforeMonthId());
}
ValidatorUtils.validateEntity(formDTO);
return new Result<VoluntaryServiceTrendResultDTO>().ok(screenWorkRecordOrgDailyService.voluntaryServiceTrend(formDTO));
}
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassRootsGovernController.java

@ -8,10 +8,7 @@ import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO;
import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;

12
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/GrassrootsPartyDevController.java

@ -10,11 +10,9 @@ import com.epmet.evaluationindex.screen.dto.result.BranchBuildRankResultDTO;
import com.epmet.evaluationindex.screen.dto.result.BranchBuildTrendResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO;
import com.epmet.evaluationindex.screen.dto.result.PartymemberPercentResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 基层党建相关各指标查询
@ -22,6 +20,7 @@ import org.springframework.web.bind.annotation.RestController;
* @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:11
*/
@Slf4j
@RestController
@RequestMapping("/screen/grassrootspartydev")
public class GrassrootsPartyDevController {
@ -52,9 +51,10 @@ public class GrassrootsPartyDevController {
* @date 2020.08.18 17:54
**/
@PostMapping("ageinfo")
public Result<PartymemberAgeDistributionResultDTO> ageInfo(@RequestBody ParymemberFormDTO param){
public Result<PartymemberAgeDistributionResultDTO> ageInfo(@RequestBody ParymemberFormDTO param,@RequestHeader("CustomerId") String customerId){
log.info("CustomerId"+customerId);
ValidatorUtils.validateEntity(param, ParymemberFormDTO.Parymember.class);
return new Result<PartymemberAgeDistributionResultDTO>().ok(grassrootsPartyDevService.partymemberAgeDistribution(param));
return new Result<PartymemberAgeDistributionResultDTO>().ok(grassrootsPartyDevService.partymemberAgeDistribution(param,customerId));
}
/**

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

@ -150,5 +150,16 @@ public class IndexController {
return new Result<List<IndexAdvanceBranchRankResultDTO>>().ok(indexService.advancedBranchRank(formDTO));
}
/**
* @param formDTO
* @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行
* @Date 2021/2/28 14:33
**/
@PostMapping("subagencyindexrank-py")
Result<List<SubAgencyIndexRankResultDTO>> subAgencyIndexRankPy(@RequestHeader("CustomerId") String customerId,@RequestBody SubAgencyIndexRankPyFormDTO formDTO) {
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<List<SubAgencyIndexRankResultDTO>>().ok(indexService.subAgencyIndexRankPy(formDTO));
}
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/PartyMemberLeadController.java

@ -6,10 +6,7 @@ import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadServic
import com.epmet.evaluationindex.screen.dto.form.*;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;

100
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java

@ -2,14 +2,27 @@ package com.epmet.datareport.controller.screen;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectOrgDailyService;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.form.screen.EfficiencyAnalysisFormDTO;
import com.epmet.dto.form.screen.QueryQuantityMonthlyFormDTO;
import com.epmet.dto.form.screen.ScreenCommonFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.dto.result.screen.EfficiencyAnalysisResultDTO;
import com.epmet.dto.result.screen.ProjectQuantityResultDTO;
import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 项目
@ -17,13 +30,17 @@ import org.springframework.web.bind.annotation.RestController;
* @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:16
*/
@Slf4j
@RestController
@RequestMapping("/screen/project")
public class ScreenProjectController {
@Autowired
private ScreenProjectService screenProjectService;
@Autowired
private ScreenProjectOrgDailyService projectOrgDailyService;
@Autowired
private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService;
/**
* @Description 3项目详情
* @param projectDetailFormDTO
@ -36,4 +53,77 @@ public class ScreenProjectController {
return new Result<ProjectDetailResultDTO>().ok(screenProjectService.projectDetail(projectDetailFormDTO));
}
/**
* @Description 中央区事件分析-项目分布
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2021/2/24 16:10
*/
@PostMapping("projectdistribution")
public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){
if (StringUtils.isBlank(formDTO.getAreaCode()) && StringUtils.isBlank(formDTO.getAgencyId())){
formDTO.setAreaCode("370124");
}
return screenProjectService.projectDistribution(formDTO);
}
@PostMapping("projectdetailv2")
public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){
return screenProjectService.projectDistributionDetail(formDTO);
}
/**
* 事件分析类型分析
* @author zhaoqifeng
* @date 2021/2/23 15:37
* @param customerId
* @param formDTO
* @return com.epmet.commons.tools.utils.Result<java.util.List<com.epmet.dto.result.screen.CategoryAnalysisResultDTO>>
*/
@PostMapping("category-analysis")
public Result<List<CategoryAnalysisResultDTO>> categoryAnalysis(@RequestHeader("CustomerId") String customerId,
@RequestBody CategoryAnalysisFormDTO formDTO) {
log.info("===================customerId"+customerId);
ValidatorUtils.validateEntity(formDTO, CategoryAnalysisFormDTO.CategoryAnalysis.class);
return new Result<List<CategoryAnalysisResultDTO>>().ok(screenProjectService.categoryAnalysis(customerId, formDTO));
}
/**
* @param customerId
* @param formDTO
* @description 事件分析数量统计查询 平阴大屏
**/
@PostMapping("queryquantity")
public Result<ProjectQuantityResultDTO> queryQuantity(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCommonFormDTO formDTO){
formDTO.setCustomerId(customerId);
return new Result().ok(projectOrgDailyService.queryQuantity(formDTO));
}
/**
* @param customerId
* @param formDTO
* @author yinzuomei
* @description 近12个月事件分析月度数量分析 平阴大屏
**/
@PostMapping("queryquantity-monthly")
public Result<QueryQuantityMonthlyResultDTO> queryQuantityMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody QueryQuantityMonthlyFormDTO formDTO) {
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<QueryQuantityMonthlyResultDTO>().ok(projectQuantityOrgMonthlyService.queryQuantityMonthly(formDTO));
}
/**
* @param customerId
* @param formDTO
* @author yinzuomei
* @description 事件分析效率分析 平阴大屏
**/
@PostMapping("efficiency-analysis")
public Result<List<EfficiencyAnalysisResultDTO>> efficiencyAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody EfficiencyAnalysisFormDTO formDTO){
formDTO.setCustomerId(customerId);
ValidatorUtils.validateEntity(formDTO);
return new Result<List<EfficiencyAnalysisResultDTO>>().ok(projectOrgDailyService.efficiencyAnalysis(formDTO));
}
}

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

@ -39,6 +39,7 @@ public interface ScreenCpcBaseDataDao{
* @date 2020.08.18 17:47
**/
PartymemberAgeDistributionResultDTO selectPartymemberAgeDistribution(@Param("agencyId") String agencyId);
PartymemberAgeDistributionResultDTO selectPartymemberAgeDistributionNew(@Param("agencyId") String agencyId);
}

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

@ -150,4 +150,7 @@ public interface ScreenCustomerAgencyDao {
**/
List<GridNodeDTO> selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId);
List<String> getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
List<String> selectSubAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
}

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

@ -81,4 +81,5 @@ public interface ScreenCustomerGridDao {
*/
List<TreeResultDTO> selectGridInfo(@Param("agencyId")String agencyId);
List<String> selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
}

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

@ -42,6 +42,14 @@ public interface ScreenDifficultyDataDao {
**/
List<DifficultProjectResultDTO> selectDifficulty(@Param("agencyId")String agencyId,@Param("type")String type);
/**
* @Description 查询难点赌点-耗时最长|涉及部门最多|处理次数new
* @Param type
* @author zxc
* @date 2021/2/25 下午6:41
*/
List<DifficultProjectResultDTO> selectDifficultyByAreaCode(@Param("areaCode")String areaCode,@Param("type")String type);
ProjectDetailResultDTO projectDetail(@Param("eventId")String projectId);
}

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

@ -41,4 +41,13 @@ public interface ScreenGovernRankDataDao{
* @date 2020.08.20 17:34
**/
List<GovernCapacityResultDTO> selectGovernCapacityRatio(@Param("monthId") String monthId,@Param("agencyId") String agencyId);
/**
* @Description 查询政府治理能力各项指标new
* @Param monthId
* @Param orgIds
* @author zxc
* @date 2021/2/26 上午9:22
*/
List<GovernCapacityResultDTO> selectGovernCapacityRatioNew(@Param("monthId") String monthId,@Param("orgIds") List<String> orgIds);
}

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

@ -56,6 +56,7 @@ public interface ScreenIndexDataMonthlyDao{
* @date 2020/8/20 10:04 上午
*/
List<SubAgencyIndexRankResultDTO> selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO);
List<SubAgencyIndexRankResultDTO> selectSubAgencyIndexRankNew(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO);
/**
* 5下级部门指数排行安宁数据段用 - (上一个月)
@ -102,4 +103,26 @@ public interface ScreenIndexDataMonthlyDao{
* @author sun
*/
List<PeerComparisonResultDTO> getSingleIndexRank(SubSingleIndexRankFormDTO formDTO);
/**
* @param yearId
* @param areaCode
* @Description 根据areaCode查询下级指数
* @author yinzuomei
*/
List<SubAgencyIndexRankResultDTO> selectSubStreetByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);
/**
* @param yearId
* @param areaCode
* @Description 根据areaCode查询网格指数
* @author yinzuomei
*/
List<SubAgencyIndexRankResultDTO> selectSubGridByAreaCode(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);
}

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

@ -42,4 +42,6 @@ public interface ScreenOrgRankDataDao{
**/
List<OrgRankDataResultDTO> selectGridDataMonthly(@Param("agencyId") String agencyId, @Param("monthId") String monthId);
List<OrgRankDataResultDTO> selectGridDataMonthlyAreaCode(@Param("monthId") String monthId,
@Param("areaCode")String areaCode);
}

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

@ -40,4 +40,5 @@ public interface ScreenPartyLinkMassesDataDao {
*/
List<ContactMassLineChartResult> selectContactMassLineChart(@Param("agencyId")String agencyId);
List<ContactMassLineChartResult> selectContactMassLineChartByAgencyIds(@Param("agencyIdList")List<String> agencyIdList);
}

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

@ -71,4 +71,8 @@ public interface ScreenPartyUserRankDataDao{
* @author sun
*/
List<PartIndexScroeRankResultDTO> selectPartymemberPointList(PartIndexScroeRankFormDTO formDTO);
List<PartyUserPointResultDTO> selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode);
List<UserPointResultDTO> selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode);
}

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

@ -21,6 +21,8 @@ import com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 党建引领-先锋模范数据
*
@ -38,4 +40,15 @@ public interface ScreenPioneerDataDao{
*/
FineExampleResultDTO selectFineExample(@Param("agencyId")String agencyId);
/**
* @Description 根据地区码查询先锋模范
* @param areaCode
* @param customerId
* @param customerIds - 子级客户列表
* @return com.epmet.evaluationindex.screen.dto.result.FineExampleResultDTO
* @author wangc
* @date 2021.02.24 15:39
*/
FineExampleResultDTO selectFineExampleByAreaCode(@Param("areaCode")String areaCode,@Param("customerId")String customerId,@Param("list") List<String> customerIds);
}

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

@ -0,0 +1,42 @@
/**
* 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.datareport.dao.evaluationindex.screen;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目(事件)分类按组织_按天统计
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2021-02-23
*/
@Mapper
public interface ScreenProjectCategoryOrgDailyDao {
/**
* 类型分析
* @author zhaoqifeng
* @date 2021/2/23 16:47
* @param agencyId
* @return java.util.List<com.epmet.dto.result.screen.CategoryAnalysisResultDTO>
*/
List<CategoryAnalysisResultDTO> selectCategoryAnalysis(@Param("agencyId") String agencyId);
}

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

@ -0,0 +1,24 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@Mapper
public interface ScreenProjectDataDao {
List<ScreenProjectDistributionResultDTO> projectDistribution(@Param("agencyId") String agencyId, @Param("ids") List<String> ids, @Param("level") String level);
List<String> selectIdsByAreaCode(@Param("areaCode") String areaCode);
List<ScreenProjectDetailResultDTO> projectDistributionDetail(@Param("projectId") String projectId);
List<String> selectProjectImgs(@Param("projectId") String projectId);
List<ScreenProjectDetailResultDTO.processDTO> selectProjectProcess(@Param("projectId") String projectId);
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> selectProjectProcessAttachments(@Param("processId") String processId);
}

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

@ -39,4 +39,14 @@ public interface ScreenPublicPartiTotalDataDao{
* @date 2020.08.20 16:00
**/
List<PublicPartiRankResultDTO> selectPublicPartiTotal(@Param("agencyId") String agencyId);
/**
* @Description 根据areaCode查询公众参与各类总数
* @param areaCode
* @return
* @author wangc
* @date 2020.08.20 16:00
**/
List<PublicPartiRankResultDTO> selectPublicPartiTotalByAreaCode(@Param("areaCode") String areaCode);
}

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

@ -42,6 +42,16 @@ public interface ScreenUserJoinDao {
**/
UserJoinIndicatorGrowthRateResultDTO selectUserJoinData(@Param("agencyId") String agencyId, @Param("monthId")String monthId);
/**
* @Description 根据地区码查询用户参与数据
* @param areaCode
* @return
* @author wangc
* @date 2020.08.20 15:07
**/
UserJoinIndicatorGrowthRateResultDTO selectUserJoinDataByAreaCode(@Param("areaCode") String areaCode, @Param("monthId")String monthId);
/**
* @Description 查询月度用户参与数据
* @param agencyId

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

@ -22,6 +22,8 @@ import com.epmet.evaluationindex.screen.dto.result.TopProfileResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 中央区-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数
*
@ -57,4 +59,5 @@ public interface ScreenUserTotalDataDao {
**/
int selectAvgIssue(@Param("agencyId")String agencyId);
PartymemberPercentResultDTO selectAgencyPartymemberPercentByIds(@Param("orgIds") List<String> orgIds);
}

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenCustomerWorkRecordDictDao.java

@ -20,6 +20,9 @@ package com.epmet.datareport.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工作日志资源字典表
@ -30,4 +33,5 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenCustomerWorkRecordDictDao extends BaseDao<ScreenCustomerWorkRecordDictEntity> {
List<String> selectListByDataType(@Param("customerId") String customerId, @Param("dataType") String dataType);
}

37
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java

@ -19,7 +19,6 @@ package com.epmet.datareport.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.plugins.result.WorkRecordRankResultDTO;
import com.epmet.plugins.result.WorkRecordSubRank;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -35,23 +34,37 @@ import java.util.List;
@Mapper
public interface ScreenWorkRecordOrgDailyDao extends BaseDao<ScreenWorkRecordOrgDailyEntity> {
/**
* @param areaCode 当前组织对应的areaCode;
* @param dataType
* @param topRow
* @return com.epmet.plugins.result.WorkRecordRankResultDTO
* @author yinzuomei
* @description 5工作日志本机及下级排名
* @description 5工作日志本机及下级排名- 下级组织
* @Date 2021/2/23 23:37
**/
List<WorkRecordSubRank> selectSubList(@Param("areaCode") String areaCode,
@Param("agencyId") String agencyId,
@Param("dataType") String dataType,
@Param("topRow") Integer topRow,
List<WorkRecordSubRank> selectSubList(@Param("subAgencyIds") List<String> subAgencyIds,
@Param("dataType")String dataType,
@Param("customerId")String customerId,
@Param("dateId")String dateId);
String selectLatestDateId(String customerId);
/**
* @param subGridIds 当前组织的指数网格ids
* @author yinzuomei
* @description
* @Date 2021/2/27 19:31
**/
List<WorkRecordSubRank> selectSubGridList(@Param("subGridIds")List<String> subGridIds,
@Param("dataType")String dataType,
@Param("customerId")String customerId,
@Param("dateId")String dateId);
/**
* @param customerIds 当前客户+所有子客户 列表
* @author yinzuomei
* @description 查询最近一次上传的日期
* @Date 2021/2/27 19:31
**/
String selectLatestDateId(@Param("customerIds")List<String> customerIds);
WorkRecordRankResultDTO selectCurrentAgency(@Param("areaCode") String areaCode,
@Param("dataType") String dataType,
List<WorkRecordSubRank> selectCurrentAgency(@Param("agencyId") String agencyId,
@Param("dataType")String dataType,
@Param("customerId")String customerId,
@Param("dateId")String dateId);
}

16
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgMonthlyDao.java

@ -19,7 +19,13 @@ package com.epmet.datareport.dao.plugins;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import com.epmet.plugins.form.WorkRecordTrendFormDTO;
import com.epmet.plugins.result.VoluntaryServiceTrendDTO;
import com.epmet.plugins.result.WorkRecordTrendResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 工作日志-组织按月统计(增量)
@ -30,4 +36,14 @@ import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface ScreenWorkRecordOrgMonthlyDao extends BaseDao<ScreenWorkRecordOrgMonthlyEntity> {
/**
* @Description 按组织查询某项数据近12月趋势图
* @author sun
*/
List<WorkRecordTrendResultDTO.SeriesResultDTO> selectMonthList(WorkRecordTrendFormDTO formDTO);
List<VoluntaryServiceTrendDTO> selectVoluntaryServiceTrendDTO(@Param("customerId")String customerId,
@Param("orgIds") List<String> orgIds,
@Param("startMonth")String startMonth,
@Param("endMonth")String endMonth);
}

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

@ -1,5 +1,6 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
@ -61,4 +62,15 @@ public interface AgencyService {
AgencyNodeDTO queryStaffAgencyTree(String agencyId);
ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId);
/**
* @return java.util.List<java.lang.String>
* @param agencyId
* @author yinzuomei
* @description 获取当前组织的下级组织集合
* @Date 2021/2/25 16:52
**/
List<String> getNextAgencyIds(String areaCode,String agencyId);
AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId);
}

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

@ -34,7 +34,7 @@ public interface GrassrootsPartyDevService {
* @author wangc
* @date 2020.08.18 17:54
**/
PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param);
PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId);
/**
* @Description 3支部建设情况|联建共建情况-折线图

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

@ -86,4 +86,12 @@ public interface IndexService {
* @date 2020/10/22 10:58 上午
*/
List<PeerComparisonResultDTO> getSubSingleIndexRank(SubSingleIndexRankFormDTO formDTO);
/**
* @param formDTO
* @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行
* @Date 2021/2/28 14:33
**/
List<SubAgencyIndexRankResultDTO> subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO);
}

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

@ -1,8 +1,15 @@
package com.epmet.datareport.service.evaluationindex.screen;
import com.epmet.commons.tools.utils.Result;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import java.util.List;
/**
* 项目
*
@ -19,4 +26,17 @@ public interface ScreenProjectService {
*/
ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO);
/**
* 事件分析类型分析
* @author zhaoqifeng
* @date 2021/2/23 15:37
* @param customerId
* @param formDTO
* @return java.util.List<com.epmet.dto.result.screen.CategoryAnalysisResultDTO>
*/
List<CategoryAnalysisResultDTO> categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO);
Result projectDistribution(ScreenProjectDistributionFormDTO formDTO);
Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO);
}

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

@ -10,6 +10,7 @@ import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.dto.form.AddAreaCodeDictFormDTO;
import com.epmet.dto.form.AreaCodeDictFormDTO;
import com.epmet.dto.result.AreaCodeDictResultDTO;
@ -297,4 +298,28 @@ public class AgencyServiceImpl implements AgencyService {
public ScreenCustomerAgencyDTO queryAgencyInfo(String agencyId) {
return screenCustomerAgencyDao.selectByAgencyId(agencyId);
}
/**
* @param agencyId
* @return java.util.List<java.lang.String>
* @author yinzuomei
* @description 获取当前组织的下级组织集合
* @Date 2021/2/25 16:52
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<String> getNextAgencyIds(String areaCode,String agencyId) {
return screenCustomerAgencyDao.getNextAgencyIds(areaCode,agencyId);
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public AgencyInfoDTO getAgencyInfoDTO(String areaCode, String agencyId) {
AgencyInfoDTO agencyInfoDTO=new AgencyInfoDTO();
agencyInfoDTO.setAgencyId(agencyId);
agencyInfoDTO.setAreaCode(areaCode);
agencyInfoDTO.setSubAgencyIds(screenCustomerAgencyDao.selectSubAgencyIds(areaCode,agencyId));
agencyInfoDTO.setSubGridIds(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId));
return agencyInfoDTO;
}
}

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

@ -3,17 +3,23 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.constant.StrConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.*;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.GrassRootsGovernService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO;
import com.epmet.evaluationindex.screen.dto.form.AgencyFormDTO;
import com.epmet.evaluationindex.screen.dto.form.AgencyNumTypeParamFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -32,6 +38,7 @@ import java.util.stream.Collectors;
* @author yinzuomei@elink-cn.com
* @date 2020/8/18 10:20
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@ -48,6 +55,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
private ScreenGovernRankDataDao screenGovernRankDataDao;
@Autowired
private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao;
@Autowired
private OperCrmOpenFeignClient crmClient;
@Autowired
private ScreenCustomerAgencyDao agencyDao;
@Autowired
private AgencyService screenCustomerAgencyService;
/**
* @Description 1热心市民积分排行
@ -65,7 +79,13 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
param.setTopNum(NumConstant.FIVE);
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<UserPointResultDTO> userPointList = screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId());
List<UserPointResultDTO> userPointList = new ArrayList<>();
if(StringUtils.isNotBlank(param.getAreaCode())){
log.info("热心市民积分排行按照areaCode查询"+param.getAreaCode());
userPointList=screenPartyUserRankDataDao.selectUserPointOrderByAreaCode(param.getAreaCode());
}else{
userPointList=screenPartyUserRankDataDao.selectUserPointOrder(param.getAgencyId());
}
UserPointRankResultDTO result = new UserPointRankResultDTO();
result.setNameData(userPointList.stream().map(UserPointResultDTO::getName).collect(Collectors.toList()));
result.setPointsData(userPointList.stream().map(UserPointResultDTO::getPoint).collect(Collectors.toList()));
@ -84,11 +104,16 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<DifficultProjectResultDTO> difficultProject(AgencyNumTypeParamFormDTO param) {
List<DifficultProjectResultDTO> result = new ArrayList<>();
if(null == param.getTopNum()){
param.setTopNum(NumConstant.TWO);
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<DifficultProjectResultDTO> result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType());
if (StringUtils.isNotEmpty(param.getAreaCode())){
result = screenDifficultyDataDao.selectDifficultyByAreaCode(param.getAreaCode(),param.getType());
}else {
result = screenDifficultyDataDao.selectDifficulty(param.getAgencyId(),param.getType());
}
for(DifficultProjectResultDTO resultDTO:result){
if (StringUtils.isNotBlank(resultDTO.getImgUrl()) && !resultDTO.getImgUrl().contains("http")) {
resultDTO.setImgUrl(StrConstant.EPMETY_STR);
@ -110,15 +135,24 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public PublicPartiProfileResultDTO publicPartiProfile(AgencyFormDTO param) {
ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId());
Result<List<String>> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId());
List<String> subCustomers;
if(null == crmResp || !crmResp.success()|| org.apache.commons.collections4.CollectionUtils.isEmpty(crmResp.getData())) {subCustomers = null ;}
else {subCustomers = crmResp.getData();}
String monthId = dateUtils.getCurrentMonthId();
UserJoinIndicatorGrowthRateResultDTO latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId);
UserJoinIndicatorGrowthRateResultDTO latest = CollectionUtils.isEmpty(subCustomers) ||StringUtils.isBlank(agencyInfo.getAreaCode())?
screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) :
screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId);
//保证获取公众参与概率数据的最大可能性
int time = NumConstant.TWELVE;
while (null == latest && time > NumConstant.ONE) {
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
latest = screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId);
latest = CollectionUtils.isEmpty(subCustomers)||StringUtils.isBlank(agencyInfo.getAreaCode()) ?
screenUserJoinDao.selectUserJoinData(param.getAgencyId(), monthId) :
screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId);
}
if (null == latest) return new PublicPartiProfileResultDTO();
@ -137,18 +171,30 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
* @author wangc
* @date 2020.08.20 15:32
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public List<PublicPartiRankResultDTO> publicPartiRank(AgencyAndNumFormDTO param) {
if(null == param.getTopNum()){
if (null == param.getTopNum()) {
param.setTopNum(NumConstant.TWO);
}
if(NumConstant.ZERO == param.getTopNum()){
if (NumConstant.ZERO == param.getTopNum()) {
param.setTopNum(NumConstant.MAX);
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<PublicPartiRankResultDTO> result = screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId());
if(null == result) {
ScreenCustomerAgencyDTO agencyInfo = agencyInfo(param.getAgencyId());
List<String> subCustomers;
Result<List<String>> crmResp = crmClient.getAllSubCustomerIds(agencyInfo.getCustomerId());
if (null == crmResp || !crmResp.success() || CollectionUtils.isEmpty(crmResp.getData())) {
subCustomers = null;
} else {
subCustomers = crmResp.getData();
}
PageHelper.startPage(NumConstant.ONE, param.getTopNum());
List<PublicPartiRankResultDTO> result =
CollectionUtils.isEmpty(subCustomers) || StringUtils.isBlank(agencyInfo.getAreaCode()) ?
screenPublicPartiTotalDataDao.selectPublicPartiTotal(param.getAgencyId())
: screenPublicPartiTotalDataDao.selectPublicPartiTotalByAreaCode(agencyInfo.getAreaCode());
if (null == result) {
return new ArrayList<>();
}
return result;
@ -165,19 +211,33 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<GovernCapacityRankResultDTO> governCapacityRank(AgencyAndNumFormDTO param) {
List<GovernCapacityResultDTO> orderList = new ArrayList<>();
if(null == param.getTopNum()) param.setTopNum(NumConstant.FIVE);
if(NumConstant.ZERO == param.getTopNum()) param.setTopNum(NumConstant.MAX);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
String monthId = dateUtils.getCurrentMonthId();
List<GovernCapacityResultDTO> orderList =
screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId());
if (StringUtils.isNotEmpty(param.getAreaCode())){
List<String> nextAgencyIds = screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(), param.getAgencyId());
if (CollectionUtils.isEmpty(nextAgencyIds)){
return new ArrayList<>();
}
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds);
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null ,monthId);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
orderList =
screenGovernRankDataDao.selectGovernCapacityRatio(monthId,param.getAgencyId());
orderList = screenGovernRankDataDao.selectGovernCapacityRatioNew(monthId,nextAgencyIds);
}
}else {
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId());
int time = NumConstant.TWELVE;
while (CollectionUtils.isEmpty(orderList) && time > NumConstant.ONE) {
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null, monthId);
PageHelper.startPage(NumConstant.ONE, param.getTopNum());
orderList = screenGovernRankDataDao.selectGovernCapacityRatio(monthId, param.getAgencyId());
}
}
if(null == orderList || orderList.isEmpty()) return new ArrayList<>();
List<GovernCapacityRankResultDTO> result = new LinkedList<>();
@ -207,7 +267,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
Map<String,String> Xaxis = dateUtils.getXpro();
List<UserJoinMonthlyResultDTO> monthlyData = screenUserJoinDao.selectUserJoinDataMonthly(param.getAgencyId(),Xaxis.keySet().iterator().next());
PublicPartiChartResultDTO result = new PublicPartiChartResultDTO();
result.setXAxis(Xaxis.values().stream().collect(Collectors.toList()));
result.setXAxis(new ArrayList<>(Xaxis.values()));
List<Integer> defaultData = new LinkedList<>();
for(int i = NumConstant.ZERO ; i < NumConstant.TWELVE ; i++){
defaultData.add(NumConstant.ZERO);
@ -222,17 +282,17 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
result.setJoinUserNumList(new ArrayList<>());
result.setAverageJoinNumList(new ArrayList<>());
Map<String,List<UserJoinMonthlyResultDTO>> dataMap = monthlyData.stream().collect(Collectors.groupingBy(UserJoinMonthlyResultDTO :: getMonthId));
Xaxis.keySet().stream().forEach(monthId -> {
Xaxis.keySet().forEach(monthId -> {
List<UserJoinMonthlyResultDTO> data = dataMap.get(monthId);
if(null == data || data.isEmpty()){
if (null == data || data.isEmpty()) {
result.getOrganizeNumList().add(NumConstant.ZERO);
result.getJoinUserNumList().add(NumConstant.ZERO);
result.getAverageJoinNumList().add(NumConstant.ZERO);
}else{
} else {
Integer o = NumConstant.ZERO;
Integer j = NumConstant.ZERO;
Integer a = NumConstant.ZERO;
for(UserJoinMonthlyResultDTO unit : data){
for (UserJoinMonthlyResultDTO unit : data) {
o = null == unit.getOrganizeNum() ? NumConstant.ZERO : o + unit.getOrganizeNum();
j = null == unit.getJoinUserNum() ? NumConstant.ZERO : o + unit.getJoinUserNum();
a = null == unit.getAverageJoinNum() ? NumConstant.ZERO : o + unit.getAverageJoinNum();
@ -254,6 +314,18 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
return percentStr.concat(ModuleConstant.SYMBOL_PERCENT);
}
/**
* @Description 通过agencyId获取机关信息
* @param agencyId
* @return java.lang.String
* @author wangc
* @date 2021.02.25 13:46
*/
private ScreenCustomerAgencyDTO agencyInfo(String agencyId){
ScreenCustomerAgencyDTO agencyInfo = agencyDao.selectByAgencyId(agencyId);
if(null == agencyInfo) throw new RenException("获取Agency信息失败");
return agencyInfo;
}
}

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

@ -2,17 +2,22 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenCpcBaseDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyBranchDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenUserTotalDataDao;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.GrassrootsPartyDevService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.BranchBuildRankFormDTO;
import com.epmet.evaluationindex.screen.dto.form.BranchBuildTrendFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ParymemberFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
@ -45,7 +50,10 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
private ScreenPartyBranchDataDao screenPartyBranchDataDao;
@Autowired
private DateUtils dateUtils;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private AgencyService screenCustomerAgencyService;
/**
* @Description 1党员基本情况-饼状图概况
* @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321324
@ -57,10 +65,29 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public PartymemberPercentResultDTO partymemberBaseInfo(ParymemberFormDTO param) {
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId());
if(StringUtils.isNotBlank(param.getAreaCode())){
logger.info(String.format("党员基本情况-饼状图概况按照areaCode查询:%s",param.getAreaCode()));
List<String> ids=screenCustomerAgencyService.getNextAgencyIds(param.getAreaCode(),param.getAgencyId());
if(org.apache.commons.collections4.CollectionUtils.isNotEmpty(ids)){
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercentByIds(ids);
if(null == result){
logger.warn("selectAgencyPartymemberPercentByIds is null");
result = new PartymemberPercentResultDTO();
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
return result;
}
if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
}else{
result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal()));
}
return result;
}
logger.warn("当前组织没有下级getNextAgencyIds is empty");
return new PartymemberPercentResultDTO();
}
PartymemberPercentResultDTO result = screenUserTotalDataDao.selectAgencyPartymemberPercent(param.getAgencyId());
if(null == result){
logger.warn("com.epmet.datareport.service.screen.impl.GrassrootsPartyDevServiceImpl.partymemberBaseInfo:未查询出指定agencyId下的党员基础信息数据,agencyId :: {}",param.getAgencyId());
result = new PartymemberPercentResultDTO();
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
@ -70,11 +97,21 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
if(null == result.getPlatFormTotal() || NumConstant.ZERO == result.getPlatFormTotal()){
result.setPercentInPlatForm(convertPercentStr(BigDecimal.ZERO));
}else{
result.setPercentInPlatForm(convertPercentStr(new BigDecimal((result.getPartyMemberTotal().doubleValue()/result.getPlatFormTotal().doubleValue()))));
result.setPercentInPlatForm(getRatio(result.getPartyMemberTotal(),result.getPlatFormTotal()));
}
return result;
}
public String getRatio(Integer partyMemberTotal, Integer platFormTotal){
if (null == partyMemberTotal || null == platFormTotal || partyMemberTotal == NumConstant.ZERO || platFormTotal == NumConstant.ZERO){
return "0.00%";
}
BigDecimal aDecimal = new BigDecimal(partyMemberTotal);
BigDecimal bDecimal = new BigDecimal(platFormTotal);
BigDecimal result = aDecimal.divide(bDecimal, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP);
return result.multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.TWO,BigDecimal.ROUND_HALF_UP).toPlainString().concat(ScreenConstant.RATIO);
}
/**
* @Description 2党员基本情况-年龄分布
* @NEI https://nei.netease.com/interface/detail/req/?pid=57068&id=321980
@ -85,8 +122,17 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param) {
PartymemberAgeDistributionResultDTO ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId());
public PartymemberAgeDistributionResultDTO partymemberAgeDistribution(ParymemberFormDTO param,String customerId) {
Result<List<String>> result = operCrmOpenFeignClient.getAllSubCustomerIds(customerId);
if (!result.success()){
throw new RenException("select subCustomerIds failure");
}
PartymemberAgeDistributionResultDTO ageInfo = new PartymemberAgeDistributionResultDTO();
if (!CollectionUtils.isEmpty(result.getData())) {
ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistributionNew(param.getAgencyId());
}else {
ageInfo = screenCpcBaseDataDao.selectPartymemberAgeDistribution(param.getAgencyId());
}
if(null == ageInfo){
ageInfo = new PartymemberAgeDistributionResultDTO();
}
@ -231,7 +277,7 @@ public class GrassrootsPartyDevServiceImpl implements GrassrootsPartyDevService
private String convertPercentStr(BigDecimal percent){
if(null == percent || BigDecimal.ZERO == percent) return "0.00%";
if (null == percent || BigDecimal.ZERO.equals(percent)) return "0.00%";
String percentStr = percent.setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
return percentStr.concat(ModuleConstant.SYMBOL_PERCENT);
}

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

@ -3,6 +3,7 @@ package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.enums.CommonOperateTypeEnum;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao;
@ -230,7 +231,12 @@ public class IndexServiceImpl implements IndexService {
LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE);
int yearId = now.getYear();
subAgencyIndexRankFormDTO.setYearId(String.valueOf(yearId));
List<SubAgencyIndexRankResultDTO> subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO);
List<SubAgencyIndexRankResultDTO> subAgencyIndexRankResultDTOS = new ArrayList<>();
if (StringUtils.isNotEmpty(subAgencyIndexRankFormDTO.getAreaCode())){
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRankNew(subAgencyIndexRankFormDTO);
}else {
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyIndexRank(subAgencyIndexRankFormDTO);
}
if (CollectionUtils.isEmpty(subAgencyIndexRankResultDTOS)){
return new ArrayList<>();
}
@ -380,4 +386,40 @@ public class IndexServiceImpl implements IndexService {
return list;
}
/**
* @param formDTO
* @author yinzuomei
* @description 8平阴大屏-下级街道or网格指数排行
* @Date 2021/2/28 14:33
**/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public List<SubAgencyIndexRankResultDTO> subAgencyIndexRankPy(SubAgencyIndexRankPyFormDTO formDTO) {
if (!"street".equals(formDTO.getType()) && !"grid".equals(formDTO.getType())) {
throw new RenException("type传参错误,街道:street;网格:grid");
}
LocalDate now = LocalDate.now().minusMonths(NumConstant.ONE);
String yearId = String.valueOf(now.getYear());
if("street".equals(formDTO.getType())){
List<SubAgencyIndexRankResultDTO> streetList = screenIndexDataMonthlyDao.selectSubStreetByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum());
// 小数四舍五入
streetList.forEach(indexRank -> {
indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility()));
indexRank.setGovernAbility(getRound(indexRank.getGovernAbility()));
indexRank.setServiceAbility(getRound(indexRank.getServiceAbility()));
indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility()));
});
return streetList;
}
List<SubAgencyIndexRankResultDTO> gridList = screenIndexDataMonthlyDao.selectSubGridByAreaCode(formDTO.getCustomerId(),yearId,formDTO.getAreaCode(),formDTO.getTopNum());
// 小数四舍五入
gridList.forEach(indexRank -> {
indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility()));
indexRank.setGovernAbility(getRound(indexRank.getGovernAbility()));
indexRank.setServiceAbility(getRound(indexRank.getServiceAbility()));
indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility()));
});
return gridList;
}
}

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

@ -1,19 +1,25 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.*;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.evaluationindex.screen.PartyMemberLeadService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.datareport.utils.ModuleConstant;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.evaluationindex.screen.dto.form.AgencyAndNumFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ContactMassLineChartFormDTO;
import com.epmet.evaluationindex.screen.dto.form.FineExampleFormDTO;
import com.epmet.evaluationindex.screen.dto.form.VolunteerServiceFormDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.github.pagehelper.PageHelper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
@ -48,6 +54,12 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
private DateUtils dateUtils;
@Autowired
private ScreenPartyUserRankDataDao screenPartyUserRankDataDao;
@Autowired
private ScreenCustomerAgencyDao customerAgencyDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Autowired
private AgencyService screenCustomerAgencyService;
/**
* @Description 1先锋模范
@ -58,8 +70,24 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public FineExampleResultDTO fineExample(FineExampleFormDTO fineExampleFormDTO) {
FineExampleResultDTO fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId());
if (null == fineExampleResultDTO){
ScreenCustomerAgencyDTO agencyInfo = customerAgencyDao.selectByAgencyId(fineExampleFormDTO.getAgencyId());
if(null == agencyInfo) throw new RenException("未找到对应的机关");
String customerId = agencyInfo.getCustomerId();
String areaCode = agencyInfo.getAreaCode();
Result<List<String>> crmResponse = operCrmOpenFeignClient.getAllSubCustomerIds(customerId);
List<String> subCustomers;
if(null == crmResponse || !crmResponse.success())
{subCustomers = null;}
else
{subCustomers = crmResponse.getData();}
FineExampleResultDTO fineExampleResultDTO;
if(CollectionUtils.isEmpty(subCustomers))
fineExampleResultDTO = screenPioneerDataDao.selectFineExample(fineExampleFormDTO.getAgencyId());
else
fineExampleResultDTO = screenPioneerDataDao.selectFineExampleByAreaCode(areaCode,customerId,subCustomers);
if (null == fineExampleResultDTO) {
return new FineExampleResultDTO();
}
fineExampleResultDTO.setIssueRatio(this.getRatio(fineExampleResultDTO.getIssueRatioA()));
@ -91,8 +119,14 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public ContactMassLineChartResultDTO contactMassLineChart(ContactMassLineChartFormDTO contactMassLineChartFormDTO) {
List<String> subAgencyIdorGridIdList=screenCustomerAgencyService.getNextAgencyIds(contactMassLineChartFormDTO.getAreaCode(),contactMassLineChartFormDTO.getAgencyId());
log.info("当前组织的下级id:"+JSON.toJSONString(subAgencyIdorGridIdList));
ContactMassLineChartResultDTO result = new ContactMassLineChartResultDTO();
List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId());
// List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChart(contactMassLineChartFormDTO.getAgencyId());
//多客户版修改如下:
List<ContactMassLineChartResult> contactMassLineChartResults = screenPartyLinkMassesDataDao.selectContactMassLineChartByAgencyIds(subAgencyIdorGridIdList);
if (contactMassLineChartResults.size() == NumConstant.ZERO){
result.setXAxis(new ArrayList<>());
result.setGroupMemberData(new ArrayList<>());
@ -221,6 +255,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<AdvanceBranchRankResultDTO> advancedBranchRank(AgencyAndNumFormDTO param) {
List<AdvanceBranchRankResultDTO> result = new LinkedList<>();
if(null == param.getTopNum()){
param.setTopNum(NumConstant.FIVE);
}else if(NumConstant.ZERO == param.getTopNum()){
@ -228,6 +263,26 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
}
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
String monthId = dateUtils.getCurrentMonthId();
if(StringUtils.isNotBlank(param.getAreaCode())){
log.info("先进排行榜单-先进支部排行入参"+JSON.toJSONString(param));
//areaCode不为空,按照areaCode查询
List<OrgRankDataResultDTO> gridData =
screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode());
int time = NumConstant.TWELVE;
while(CollectionUtils.isEmpty(gridData) && time > NumConstant.ONE){
time--;
monthId = dateUtils.getPreviousMonthIdByDest(null,monthId);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
gridData = screenOrgRankDataDao.selectGridDataMonthlyAreaCode(monthId,param.getAreaCode());
}
if(null == gridData || gridData.isEmpty()) return result;
gridData.forEach( data -> {
AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class);
o.setClosedProjectRatio(convertPercentStr(data.getClosedProjectRatio()));
o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio()));
result.add(o);
});
}else{
List<OrgRankDataResultDTO> gridData =
screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId);
int time = NumConstant.TWELVE;
@ -237,7 +292,6 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
gridData = screenOrgRankDataDao.selectGridDataMonthly(param.getAgencyId(),monthId);
}
List<AdvanceBranchRankResultDTO> result = new LinkedList<>();
if(null == gridData || gridData.isEmpty()) return result;
gridData.forEach( data -> {
AdvanceBranchRankResultDTO o = ConvertUtils.sourceToTarget(data,AdvanceBranchRankResultDTO.class);
@ -245,7 +299,7 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
o.setSatisfactionRatio(convertPercentStr(data.getSatisfactionRatio()));
result.add(o);
});
}
return result;
}
@ -262,14 +316,20 @@ public class PartyMemberLeadServiceImpl implements PartyMemberLeadService {
public List<PartyUserPointResultDTO> advancedPartymemberRank(AgencyAndNumFormDTO param) {
if(null == param.getTopNum()) param.setTopNum(NumConstant.TEN);
PageHelper.startPage(NumConstant.ONE,param.getTopNum());
List<PartyUserPointResultDTO> result = screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId());
List<PartyUserPointResultDTO> result=new ArrayList<>();
if(StringUtils.isNotBlank(param.getAreaCode())){
log.info("先进排行榜单-先进党员排行按照areaCode查询入参:"+param.getAreaCode());
result=screenPartyUserRankDataDao.selectPartymemberPointOrderByAreaCode(param.getAreaCode());
}else{
result=screenPartyUserRankDataDao.selectPartymemberPointOrder(param.getAgencyId());
}
if(null == result) return new ArrayList<>();
return result;
}
private String convertPercentStr(BigDecimal percent){
if(null == percent || BigDecimal.ZERO == percent) return "0.0%";
if (null == percent || BigDecimal.ZERO.equals(percent)) return "0.0%";
String percentStr = percent.setScale(NumConstant.ONE, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString();
return percentStr.concat(ModuleConstant.SYMBOL_PERCENT);
}

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

@ -32,10 +32,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -74,20 +71,27 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl implements ScreenProject
Map<String, ScreenProjectQuantityOrgMonthlyDTO> dtoMap = new HashMap<>();
if (!CollectionUtils.isEmpty(dtoList)) {
dtoMap = dtoList.stream().collect(Collectors.toMap(ScreenProjectQuantityOrgMonthlyDTO::getMonthId, Function.identity(), (key1, key2) -> key2));
List<String> blank = dtoMap.keySet().stream().filter(query -> !monthIdList.contains(query)).collect(Collectors.toList());
if(!CollectionUtils.isEmpty(blank)){
for(int i = NumConstant.ZERO; i < blank.size(); i++){dtoMap.put(blank.get(i),null);}
}
}else{
for(int i = NumConstant.ZERO; i < monthIdList.size(); i++){dtoMap.put(monthIdList.get(i),null);}
}
for (String monthId : monthIdList) {
//202101=>01月
xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH));
if (!CollectionUtils.isEmpty(dtoList)) {
ScreenProjectQuantityOrgMonthlyDTO en = dtoMap.get(monthId);
if ("incr".equals(formDTO.getType())) {
yAxis.add(dtoMap.get(monthId).getProjectIncr());
yAxis.add( null == en ? NumConstant.ZERO : en.getProjectIncr());
} else if ("sum".equals(formDTO.getType())) {
yAxis.add(dtoMap.get(monthId).getProjectTotal());
yAxis.add( null == en ? NumConstant.ZERO : en.getProjectTotal() );
}
continue;
}
//没有数据默认赋值0
yAxis.add(0);
//yAxis.add(0);
}
resultDTO.setXAxis(xAxis);
resultDTO.setYAxis(yAxis);

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

@ -1,12 +1,22 @@
package com.epmet.datareport.service.evaluationindex.screen.impl;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao;
import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService;
import com.epmet.dto.form.screen.CategoryAnalysisFormDTO;
import com.epmet.dto.result.screen.CategoryAnalysisResultDTO;
import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO;
import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -26,6 +36,11 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
private ScreenEventDataDao screenEventDataDao;
@Autowired
private ScreenEventImgDataDao screenEventImgDataDao;
@Autowired
private ScreenProjectDataDao screenProjectDataDao;
@Autowired
private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao;
/**
* @Description 3项目详情
@ -44,4 +59,56 @@ public class ScreenProjectServiceImpl implements ScreenProjectService {
projectDetailResultDTO.setImgList(imgList);
return projectDetailResultDTO;
}
/**
* @Description 中央区事件分析-项目分布
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @Author liushaowen
* @Date 2021/2/24 15:25
*/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) {
List<String> areaIds = null;
if (StringUtils.isNotBlank(formDTO.getAreaCode())){
areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode());
}
List<ScreenProjectDistributionResultDTO> resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel());
return new Result().ok(resultDTOS);
}
@Override
public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) {
List<ScreenProjectDetailResultDTO> resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId());
resultDTOS.forEach(item -> {
//项目图片
List<String> imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId());
item.setImgList(imgList);
//项目处理流程
List<ScreenProjectDetailResultDTO.processDTO> processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId());
//流程附件
processDTOS.forEach(processDTO -> {
List<ScreenProjectDetailResultDTO.processDTO.AttachmentDTO> attachmentDTOS = screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId());
processDTO.setAttachments(attachmentDTOS);
});
item.setProcessList(processDTOS);
});
return new Result().ok(resultDTOS);
}
/**
* 事件分析类型分析
*
* @param customerId
* @param formDTO
* @return java.util.List<com.epmet.dto.result.screen.CategoryAnalysisResultDTO>
* @author zhaoqifeng
* @date 2021/2/23 15:37
*/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public List<CategoryAnalysisResultDTO> categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) {
return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId());
}
}

19
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java

@ -21,8 +21,12 @@ import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO;
import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO;
import com.epmet.plugins.form.WorkRecordRankFormDTO;
import com.epmet.plugins.form.WorkRecordTrendFormDTO;
import com.epmet.plugins.result.VoluntaryServiceTrendResultDTO;
import com.epmet.plugins.result.WorkRecordRankResultDTO;
import com.epmet.plugins.result.WorkRecordTrendResultDTO;
import java.util.List;
import java.util.Map;
@ -96,4 +100,19 @@ public interface ScreenWorkRecordOrgDailyService extends BaseService<ScreenWorkR
void delete(String[] ids);
WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO);
/**
* @Description 6工作日志近12月趋势图
* @author sun
*/
WorkRecordTrendResultDTO trend(WorkRecordTrendFormDTO formDTO);
/**
* @return com.epmet.plugins.result.VoluntaryServiceTrendResultDTO
* @param formDTO
* @author yinzuomei
* @description 7工作日志党员志愿者服务近12月趋势图
* @Date 2021/2/27 19:56
**/
VoluntaryServiceTrendResultDTO voluntaryServiceTrend(VoluntaryServiceTrendFormDTO formDTO);
}

1
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/OfsServiceImpl.java

@ -52,6 +52,7 @@ public class OfsServiceImpl implements OfsService {
* @description 146体系竞标管理-列表
* @Date 2021/1/22 13:38
**/
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
@Override
public List<BidInfoResultDTO> queryBidList(String customerId) {
return screenBidInfoDao.selectList(customerId);

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java

@ -19,10 +19,12 @@ package com.epmet.datareport.service.plugins.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao;
import com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity;
import com.epmet.datareport.service.plugins.ScreenCustomerWorkRecordDictService;
@ -44,6 +46,7 @@ import java.util.Map;
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl<ScreenCustomerWorkRecordDictDao, ScreenCustomerWorkRecordDictEntity> implements ScreenCustomerWorkRecordDictService {
@Override

217
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java

@ -17,31 +17,45 @@
package com.epmet.datareport.service.plugins.impl;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.constant.NumConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao;
import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao;
import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgDailyEntity;
import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.evaluationindex.screen.constant.ScreenConstant;
import com.epmet.feign.OperCrmOpenFeignClient;
import com.epmet.plugins.ScreenWorkRecordOrgDailyDTO;
import com.epmet.plugins.form.VoluntaryServiceTrendFormDTO;
import com.epmet.plugins.form.WorkRecordRankFormDTO;
import com.epmet.plugins.result.WorkRecordRankResultDTO;
import com.epmet.plugins.form.WorkRecordTrendFormDTO;
import com.epmet.plugins.result.*;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.*;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 工作日志-组织按日统计(累计值)
@ -51,10 +65,18 @@ import java.util.Map;
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenWorkRecordOrgDailyDao, ScreenWorkRecordOrgDailyEntity> implements ScreenWorkRecordOrgDailyService {
@Autowired
private AgencyService agencyService;
@Autowired
private DateUtils dateUtils;
@Autowired
private ScreenCustomerWorkRecordDictDao screenCustomerWorkRecordDictDao;
@Autowired
private ScreenWorkRecordOrgMonthlyDao screenWorkRecordOrgMonthlyDao;
@Autowired
private OperCrmOpenFeignClient operCrmOpenFeignClient;
@Override
public PageData<ScreenWorkRecordOrgDailyDTO> page(Map<String, Object> params) {
IPage<ScreenWorkRecordOrgDailyEntity> page = baseDao.selectPage(
@ -107,25 +129,174 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO) {
////todo 待完善 直属网格是否显示?
ScreenCustomerAgencyDTO agencyDTO = agencyService.queryAgencyInfo(formDTO.getAgencyId());
if (null == agencyDTO) {
throw new RenException(String.format("获取组织信息异常,agencyId:%s", formDTO.getAgencyId()));
}
String dateId = baseDao.selectLatestDateId(formDTO.getCustomerId());
log.info(String.format("最近一次上传dateId:%s", dateId));
if (agencyDTO.getLevel().equals("community")) {
log.warn("【工作日志】本机及下级排名接口待完善");
//todo
return new WorkRecordRankResultDTO(0, 0, new ArrayList<>());
} else {
//非社区的
WorkRecordRankResultDTO resultDTO = baseDao.selectCurrentAgency(agencyDTO.getAreaCode(), formDTO.getDataType(), dateId);
resultDTO.setSubRankList(baseDao.selectSubList(agencyDTO.getAreaCode(), agencyDTO.getAgencyId(), formDTO.getDataType(), formDTO.getTopRow(), dateId));
List<String> customerIds=new ArrayList<>();
Result<List<String>> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());
// log.info("result: "+JSON.toJSONString(result));
if (result.success() && CollectionUtils.isNotEmpty(result.getData())) {
customerIds.addAll(result.getData());
}
customerIds.add(formDTO.getCustomerId());
String dateId= baseDao.selectLatestDateId(customerIds);
if(StringUtils.isBlank(dateId)){
log.warn("selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds));
}
WorkRecordRankResultDTO returnDto = new WorkRecordRankResultDTO();
AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId());
// log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO));
//当前组织的自身的数据
List<WorkRecordSubRank> currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(),
formDTO.getDataType(),
formDTO.getCustomerId(),
dateId);
//下级所有组织
List<WorkRecordSubRank> subAgencyRankList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? baseDao.selectSubList(
agencyInfoDTO.getSubAgencyIds(),
formDTO.getDataType(),
formDTO.getCustomerId(),
dateId) : new ArrayList<>();
//直属网格
List<WorkRecordSubRank> subGridList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubGridIds()) ? baseDao.selectSubGridList(
agencyInfoDTO.getSubGridIds(),
formDTO.getDataType(),
formDTO.getCustomerId(),
dateId) : new ArrayList<>();
returnDto.getSubRankList().addAll(subAgencyRankList);
returnDto.getSubRankList().addAll(subGridList);
int participateUserTotal = 0;
int participateTotal = 0;
for (WorkRecordSubRank subAgency : returnDto.getSubRankList()) {
participateUserTotal += subAgency.getParticipateUserTotal();
participateTotal += subAgency.getParticipateTotal();
}
if (CollectionUtils.isNotEmpty(currentAgency)) {
for (WorkRecordSubRank m : currentAgency) {
participateUserTotal += m.getParticipateUserTotal();
participateTotal += m.getParticipateTotal();
}
}
returnDto.setParticipateTotal(participateTotal);
returnDto.setParticipateUserTotal(participateUserTotal);
returnDto.setSubRankList(CollectionUtils.isNotEmpty(returnDto.getSubRankList()) && returnDto.getSubRankList().size() >= formDTO.getTopRow() ?
returnDto.getSubRankList().subList(NumConstant.ZERO, formDTO.getTopRow()) : returnDto.getSubRankList());
return returnDto;
}
/**
* @Description 6工作日志近12月趋势图
* 查询当前组织及所有下级某项数据(组织次数参与人数平均参与人数)的某个资源(支部建设联建共建党员志愿服务)对应的每个类型的指标过去12个月的汇总数据,某个月份没数据的补0
* @author sun
*/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public WorkRecordTrendResultDTO trend(WorkRecordTrendFormDTO formDTO) {
WorkRecordTrendResultDTO resultDTO = new WorkRecordTrendResultDTO();
//1.根据资源编码查询资源名称集合,按sort升序
List<String> legendList = screenCustomerWorkRecordDictDao.selectListByDataType(formDTO.getCustomerId(), formDTO.getDataType());
resultDTO.setLegend(legendList);
if (null == legendList || legendList.size() < NumConstant.ONE) {
return resultDTO;
}
//2.查询当前月过去12个月份
Map<String, String> map = dateUtils.getXpro();
resultDTO.setXAxis(map.values().stream().collect(Collectors.toList()));
List<String> monthIdList = map.keySet().stream().collect(Collectors.toList());
//3-1.查询当前组织及所有下级过去12个月份某项数据所有资源的统计数据
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyyMM");
LocalDate today = LocalDate.now();
formDTO.setStartMonth(today.minusMonths(NumConstant.TWELVE).format(fmt));
formDTO.setEndMonth(today.minusMonths(NumConstant.ZERO).format(fmt));
List<WorkRecordTrendResultDTO.SeriesResultDTO> list = screenWorkRecordOrgMonthlyDao.selectMonthList(formDTO);
//3-2.遍历封装数据并返回
LinkedList<WorkRecordTrendResultDTO.SeriesResultDTO> seriesList = new LinkedList<>();
//按资源类型封装每一个资源类型对应的过去12个月的汇总数据,某个月份没有数据的补0
legendList.forEach(le -> {
WorkRecordTrendResultDTO.SeriesResultDTO dto = new WorkRecordTrendResultDTO.SeriesResultDTO();
dto.setName(le);
LinkedList<Integer> dataList = new LinkedList<>();
monthIdList.forEach(m->{
AtomicInteger num = new AtomicInteger(0);
list.forEach(l -> {
if (m.equals(l.getMonthId())&&le.equals(l.getName())) {
//dataList.add(l.getValue());
num.set(l.getValue());
}
});
dataList.add(num.get());
});
dto.setData(dataList);
seriesList.add(dto);
});
resultDTO.setSeries(seriesList);
return resultDTO;
}
/**
* @param formDTO
* @return com.epmet.plugins.result.VoluntaryServiceTrendResultDTO
* @author yinzuomei
* @description 7工作日志党员志愿者服务近12月趋势图
* @Date 2021/2/27 19:56
**/
@Override
@DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true)
public VoluntaryServiceTrendResultDTO voluntaryServiceTrend(VoluntaryServiceTrendFormDTO formDTO) {
VoluntaryServiceTrendResultDTO resultDTO = new VoluntaryServiceTrendResultDTO();
//近12个月的monthId集合,["202002","202003","202004","202005","202006","202007","202008","202009","202010","202011","202012","202101"]
List<String> monthIdList = com.epmet.commons.tools.utils.DateUtils.getMonthIdList(formDTO.getEndMonthId(), NumConstant.ELEVEN);
// log.info(JSON.toJSONString(monthIdList));
AgencyInfoDTO agencyInfoDTO = agencyService.getAgencyInfoDTO(formDTO.getAreaCode(), formDTO.getAgencyId());
List<String> orgIds = new ArrayList<>();
orgIds.addAll(agencyInfoDTO.getSubAgencyIds());
orgIds.add(agencyInfoDTO.getAgencyId());
orgIds.addAll(agencyInfoDTO.getSubGridIds());
List<VoluntaryServiceTrendDTO> list = screenWorkRecordOrgMonthlyDao.selectVoluntaryServiceTrendDTO(formDTO.getCustomerId(),
orgIds,
monthIdList.get(NumConstant.ZERO),
monthIdList.get(NumConstant.ELEVEN));
Map<String, VoluntaryServiceTrendDTO> dtoMap = new HashMap<>();
if (!org.springframework.util.CollectionUtils.isEmpty(list)) {
dtoMap = list.stream().collect(Collectors.toMap(VoluntaryServiceTrendDTO::getMonthId, Function.identity(), (key1, key2) -> key2));
}
//要返回的横坐标:["02月","03月","04月","05月","06月","07月","08月","09月","10月","11月","12月","01月"]
List<String> xAxis = new ArrayList<>();
List<Integer> organizeList = new ArrayList<>();
List<Integer> joinUserList = new ArrayList<>();
List<Integer> avgUserList = new ArrayList<>();
for (String monthId : monthIdList) {
xAxis.add(monthId.substring(NumConstant.FOUR, NumConstant.SIX).concat(ScreenConstant.MONTH));
if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getOrganizeTotal()) {
organizeList.add(dtoMap.get(monthId).getOrganizeTotal());
} else {
organizeList.add(NumConstant.ZERO);
}
if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getParticipateUserTotal()) {
joinUserList.add(dtoMap.get(monthId).getParticipateUserTotal());
} else {
joinUserList.add(NumConstant.ZERO);
}
if (null != dtoMap.get(monthId) && null != dtoMap.get(monthId).getAvgParticipateUserTotal()) {
avgUserList.add(dtoMap.get(monthId).getAvgParticipateUserTotal());
} else {
avgUserList.add(NumConstant.ZERO);
}
}
resultDTO.setXAxis(xAxis);
resultDTO.setOrganizeList(organizeList);
resultDTO.setJoinUserList(joinUserList);
resultDTO.setAvgUserList(avgUserList);
return resultDTO;
}
}

3
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java

@ -19,10 +19,12 @@ package com.epmet.datareport.service.plugins.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.epmet.commons.dynamic.datasource.annotation.DataSource;
import com.epmet.commons.mybatis.service.impl.BaseServiceImpl;
import com.epmet.commons.tools.constant.FieldConstant;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ConvertUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao;
import com.epmet.datareport.entity.plugins.ScreenWorkRecordOrgMonthlyEntity;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgMonthlyService;
@ -44,6 +46,7 @@ import java.util.Map;
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl<ScreenWorkRecordOrgMonthlyDao, ScreenWorkRecordOrgMonthlyEntity> implements ScreenWorkRecordOrgMonthlyService {
@Override

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

@ -209,17 +209,16 @@ public class ProjectServiceImpl implements ProjectService {
return new ProjectDetailResultDTO();
}*/
ProjectDetailResultDTO projectDetailResultDTO=new ProjectDetailResultDTO();
//todo
Result<ProjectInfoDTO> result=govProjectOpenFeignClient.queryProjectInfoByProjectId(processListFormDTO.getProjectId());
if(result.success()&&null!=result.getData()){
if(!result.success()||null==result.getData()){
log.warn(String.format("项目信息查询失败(该接口目前只支持e事通内的客户),projectId:%s", processListFormDTO.getProjectId()));
return projectDetailResultDTO;
}
ProjectInfoDTO projectInfoDTO=result.getData();
projectDetailResultDTO.setImgUrlList(projectInfoDTO.getImgUrlList());
projectDetailResultDTO.setEventSource(projectInfoDTO.getGridName());
projectDetailResultDTO.setEventTitle(projectInfoDTO.getEventTitle());
projectDetailResultDTO.setEventContent(projectInfoDTO.getEventContent());
}else{
log.warn(String.format("项目信息查询失败,projectId:%s",processListFormDTO.getProjectId()));
}
Result<ProcessAndCurrentDeptResultDTO> processList = govProjectOpenFeignClient.getProcessList(processListFormDTO);
if (!processList.success()) {
throw new RenException(ProjectConstant.PROCESS_FAILURE);

35
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenCustomerWorkRecordDictDao.xml

@ -2,27 +2,18 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.datareport.dao.plugins.ScreenCustomerWorkRecordDictDao">
<resultMap type="com.epmet.datareport.entity.plugins.ScreenCustomerWorkRecordDictEntity" id="screenCustomerWorkRecordDictMap">
<result property="id" column="ID"/>
<result property="customerId" column="CUSTOMER_ID"/>
<result property="dateId" column="DATE_ID"/>
<result property="dictId" column="DICT_ID"/>
<result property="pid" column="PID"/>
<result property="resourceType" column="RESOURCE_TYPE"/>
<result property="resourceCode" column="RESOURCE_CODE"/>
<result property="resourceLabel" column="RESOURCE_LABEL"/>
<result property="showFlag" column="SHOW_FLAG"/>
<result property="sort" column="SORT"/>
<result property="dataType" column="DATA_TYPE"/>
<result property="level" column="LEVEL"/>
<result property="delFlag" column="DEL_FLAG"/>
<result property="revision" column="REVISION"/>
<result property="createdBy" column="CREATED_BY"/>
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
</resultMap>
<select id="selectListByDataType" resultType="java.lang.String">
SELECT
resource_label
FROM
screen_customer_work_record_dict
WHERE
del_flag = '0'
AND customer_id = #{customerId}
AND data_type = #{dataType}
and level='2'
ORDER BY
sort ASC, resource_label DESC
</select>
</mapper>

8
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenListInfoDao.xml

@ -3,15 +3,19 @@
<mapper namespace="com.epmet.datareport.dao.plugins.ScreenListInfoDao">
<select id="selectList" parameterType="java.lang.String" resultType="com.epmet.dto.result.plugins.OneListResultDTO">
SELECT * FROM (
SELECT
sli.LIST_ID AS listId,
sli.LIST_NAME AS listName
concat(@rank,'.',sli.LIST_NAME) AS listName,
@rank := @rank + 1
FROM
screen_list_info sli
screen_list_info sli, ( SELECT @rank := 1 ) a
WHERE
sli.DEL_FLAG = '0'
AND sli.CUSTOMER_ID = #{customerId}
ORDER BY
sli.SORT ASC
)temp
</select>
</mapper>

110
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

@ -3,51 +3,121 @@
<mapper namespace="com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao">
<select id="selectLatestDateId" resultType="java.lang.String" parameterType="java.lang.String">
<select id="selectLatestDateId" resultType="java.lang.String" parameterType="map">
SELECT
max( m.DATE_ID ) AS maxDateId
FROM
screen_work_record_org_daily m
WHERE
m.DEL_FLAG = '0'
AND m.CUSTOMER_ID = #{customerId}
AND m.CUSTOMER_ID in
<foreach item="customerId" collection="customerIds" open="(" separator="," close=")">
#{customerId}
</foreach>
</select>
<!-- 按照area_code查询当前组织的下级对应的数值,不包含本级 -->
<select id="selectSubList" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.AGENCY_ID AS orgId,
sca.AGENCY_NAME AS `NAME`,
IFNULL( sum( m.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( m.ORGANIZE_TOTAL ), 0 ) AS participateTotal
IFNULL( sum( temp.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( temp.ORGANIZE_TOTAL ), 0 ) AS participateTotal
FROM
screen_customer_agency sca
LEFT JOIN screen_work_record_org_daily m ON ( sca.AGENCY_ID = m.ORG_ID AND m.DEL_FLAG = '0' AND m.DATE_ID = #{dateId} )
LEFT JOIN screen_customer_work_record_dict dict ON ( m.TYPE_CODE = dict.RESOURCE_CODE AND dict.DEL_FLAG = '0' AND dict.DATA_TYPE = #{dataType} )
left join (
select m.* from screen_work_record_org_daily m
where m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
and m.TYPE_CODE in(
select distinct dict.RESOURCE_CODE
from screen_customer_work_record_dict dict
where dict.DEL_FLAG = '0'
and dict.`LEVEL`='1'
AND dict.DATA_TYPE =#{dataType}
and dict.CUSTOMER_ID=#{customerId}
)
and org_id in
<foreach item="agencyId" collection="subAgencyIds" open="(" separator="," close=")">
#{agencyId}
</foreach>
)temp on(sca.AGENCY_ID = temp.ORG_ID)
WHERE
sca.DEL_FLAG = '0'
AND sca.PARENT_AREA_CODE like concat( #{areaCode},'%')
and sca.AGENCY_ID !=#{agencyId}
GROUP BY
sca.AGENCY_ID,
sca.AGENCY_NAME
AND sca.AGENCY_ID in
<foreach item="agencyId" collection="subAgencyIds" open="(" separator="," close=")">
#{agencyId}
</foreach>
group by sca.AGENCY_ID,sca.AGENCY_NAME
ORDER BY
participateUserTotal DESC,
participateTotal DESC
LIMIT #{topRow}
</select>
<select id="selectCurrentAgency" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordRankResultDTO">
<select id="selectSubGridList" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
IFNULL( sum( m.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( m.ORGANIZE_TOTAL ), 0 ) AS participateTotal
scg.GRID_ID AS orgId,
scg.GRID_NAME AS `NAME`,
IFNULL( sum( temp.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( temp.ORGANIZE_TOTAL ), 0 ) AS participateTotal
FROM
screen_customer_grid scg
left join (
select m.* from screen_work_record_org_daily m
where m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
and m.TYPE_CODE in(
select distinct dict.RESOURCE_CODE
from screen_customer_work_record_dict dict
where dict.DEL_FLAG = '0'
and dict.`LEVEL`='1'
AND dict.DATA_TYPE =#{dataType}
and dict.CUSTOMER_ID=#{customerId}
)
and org_id in
<foreach item="gridId" collection="subGridIds" open="(" separator="," close=")">
#{gridId}
</foreach>
)temp on(scg.GRID_ID = temp.ORG_ID)
WHERE
scg.DEL_FLAG = '0'
AND scg.GRID_ID in
<foreach item="gridId" collection="subGridIds" open="(" separator="," close=")">
#{gridId}
</foreach>
group by scg.GRID_ID,scg.GRID_NAME
ORDER BY
participateUserTotal DESC,
participateTotal DESC
</select>
<select id="selectCurrentAgency" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.AGENCY_ID AS orgId,
sca.AGENCY_NAME AS `NAME`,
IFNULL( sum( temp.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( temp.ORGANIZE_TOTAL ), 0 ) AS participateTotal
FROM
screen_customer_agency sca
inner JOIN screen_work_record_org_daily m ON ( sca.AGENCY_ID = m.ORG_ID AND m.DEL_FLAG = '0' AND m.DATE_ID = #{dateId} )
inner JOIN screen_customer_work_record_dict dict ON ( m.TYPE_CODE = dict.RESOURCE_CODE AND dict.DEL_FLAG = '0' AND dict.DATA_TYPE = #{dataType} )
left join (
select m.* from screen_work_record_org_daily m
where m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
and m.TYPE_CODE in(
select distinct dict.RESOURCE_CODE
from screen_customer_work_record_dict dict
where dict.DEL_FLAG = '0'
and dict.`LEVEL`='1'
AND dict.DATA_TYPE =#{dataType}
and dict.CUSTOMER_ID=#{customerId}
)
and org_id =#{agencyId}
)temp on(sca.AGENCY_ID = temp.ORG_ID)
WHERE
sca.DEL_FLAG = '0'
AND sca.PARENT_AREA_CODE like concat( #{areaCode},'%')
AND sca.AGENCY_ID=#{agencyId}
group by sca.AGENCY_ID,sca.AGENCY_NAME
ORDER BY
participateUserTotal DESC,
participateTotal DESC
</select>
</mapper>

61
epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgMonthlyDao.xml

@ -3,6 +3,65 @@
<mapper namespace="com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgMonthlyDao">
<select id="selectMonthList" resultType="com.epmet.plugins.result.WorkRecordTrendResultDTO$SeriesResultDTO">
SELECT
sw.MONTH_ID AS monthId,
(select resource_label from screen_customer_work_record_dict where resource_code = sw.type_code and customer_id = #{customerId})`name`
<if test="type != null and type.trim() != ''">
<if test="type == 'organize' ">
,SUM(sw.organize_total) as `value`
</if>
<if test="type == 'joinuser' ">
,SUM(sw.participate_user_total) as `value`
</if>
<if test="type == 'avguser' ">
,SUM(sw.avg_participate_user_total) as `value`
</if>
</if>
FROM screen_work_record_org_monthly sw
LEFT JOIN screen_customer_agency sca ON sw.org_id = sca.agency_id
LEFT JOIN screen_customer_work_record_dict wrd ON sw.type_code = wrd.resource_code
WHERE
sw.del_flag = '0'
AND sca.del_flag = '0'
AND sw.customer_id = #{customerId}
AND sca.area_code LIKE CONCAT('%',(select area_code from screen_customer_agency where agency_id = #{agencyId}),'%')
AND sw.month_id > #{startMonth}
AND sw.month_id <![CDATA[ <= ]]> #{endMonth}
AND wrd.data_type = #{dataType}
GROUP BY
sw.month_id,sw.type_code
ORDER BY
sw.month_id ASC
</select>
<select id="selectVoluntaryServiceTrendDTO" parameterType="map" resultType="com.epmet.plugins.result.VoluntaryServiceTrendDTO">
SELECT
m.MONTH_ID,
sum( m.ORGANIZE_TOTAL ) AS organizeTotal,
sum( m.PARTICIPATE_USER_TOTAL ) AS participateUserTotal,
sum( m.AVG_PARTICIPATE_USER_TOTAL ) AS avgParticipateUserTotal
FROM
screen_work_record_org_monthly m
WHERE m.DEL_FLAG = '0'
AND m.TYPE_CODE =(
SELECT
dict.RESOURCE_CODE
FROM
screen_customer_work_record_dict dict
WHERE
dict.DEL_FLAG = '0'
AND dict.`LEVEL` = '1'
AND dict.DATA_TYPE = 'voluntaryservice'
AND dict.CUSTOMER_ID = #{customerId}
)
AND m.ORG_ID IN
<foreach item="orgId" collection="orgIds" open="(" separator="," close=")">
#{orgId}
</foreach>
AND m.MONTH_ID &gt;= #{startMonth}
AND m.MONTH_ID &lt;= #{endMonth}
GROUP BY
m.MONTH_ID
</select>
</mapper>

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

@ -18,5 +18,20 @@
DEL_FLAG = '0'
AND ORG_ID = #{agencyId}
</select>
<select id="selectPartymemberAgeDistributionNew" resultType="com.epmet.evaluationindex.screen.dto.result.PartymemberAgeDistributionResultDTO">
SELECT
SUM( bd.AGE_LEVEL_1 ) + SUM( bd.AGE_LEVEL_2 ) AS under30Count,
SUM( bd.AGE_LEVEL_3 ) + SUM( bd.AGE_LEVEL_4 ) AS between31And50Count,
SUM( bd.AGE_LEVEL_5 ) AS between51And60Count,
SUM( bd.AGE_LEVEL_6 ) AS above61Count,
SUM( bd.PARTY_MEMBER_COUNT) AS partyMemberCount,
SUM( bd.AGE_LEVEL_1 ) + SUM( bd.AGE_LEVEL_2 )+SUM( bd.AGE_LEVEL_3 ) + SUM( bd.AGE_LEVEL_4 )+SUM( bd.AGE_LEVEL_5 )+SUM( bd.AGE_LEVEL_6 ) as partyTotal
FROM
screen_cpc_base_data bd
LEFT JOIN screen_customer_agency ca ON ca.AGENCY_ID = bd.ORG_ID
WHERE
bd.DEL_FLAG = '0'
AND ca.AREA_CODE LIKE CONCAT((SELECT AREA_CODE FROM screen_customer_agency WHERE AGENCY_ID = #{agencyId} AND DEL_FLAG = 0),'%')
</select>
</mapper>

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

@ -272,4 +272,51 @@
and grid.PARENT_AGENCY_ID=#{agencyId}
</select>
<select id="getNextAgencyIds" parameterType="map" resultType="java.lang.String">
SELECT
sca.AGENCY_ID as orgId
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
AND sca.PARENT_AREA_CODE = #{areaCode}
</when>
<otherwise>
and sca.PID=#{agencyId}
</otherwise>
</choose>
union
SELECT
m.GRID_ID as orgId
FROM
screen_customer_grid m
where m.DEL_FLAG = '0'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
and m.AREA_CODE=#{areaCode}
</when>
<otherwise>
and m.PARENT_AGENCY_ID=#{agencyId}
</otherwise>
</choose>
</select>
<select id="selectSubAgencyIds" parameterType="map" resultType="java.lang.String">
SELECT
sca.AGENCY_ID as orgId
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
AND sca.PARENT_AREA_CODE = #{areaCode}
</when>
<otherwise>
and sca.PID=#{agencyId}
</otherwise>
</choose>
</select>
</mapper>

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

@ -122,4 +122,19 @@
GROUP BY scg.PARENT_AGENCY_ID
</select>
<select id="selectSubGridIds" parameterType="map" resultType="java.lang.String">
SELECT
m.GRID_ID as orgId
FROM
screen_customer_grid m
where m.DEL_FLAG = '0'
<choose>
<when test="areaCode != null and areaCode.trim() != ''">
and m.AREA_CODE=#{areaCode}
</when>
<otherwise>
and m.PARENT_AGENCY_ID=#{agencyId}
</otherwise>
</choose>
</select>
</mapper>

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

@ -52,4 +52,30 @@
AND dd.EVENT_ID = #{eventId}
</select>
<!-- 查询难点赌点-耗时最长|涉及部门最多|处理次数【new】 -->
<select id="selectDifficultyByAreaCode" resultType="com.epmet.evaluationindex.screen.dto.result.DifficultProjectResultDTO">
SELECT
diff.EVENT_ID AS projectId,
diff.EVENT_CONTENT AS title,
diff.EVENT_STATUS_CODE AS STATUS,
ROUND(diff.EVENT_COST_TIME/60,0) AS totalHours,
diff.EVENT_SOURCE AS gridName,
diff.EVENT_IMG_URL AS imgUrl,
IFNULL(diff.EVENT_CATEGORY_NAME,'') AS categoryName,
diff.EVENT_RE_ORG AS handleDepts,
diff.EVENT_RE_ORG AS handleCount
FROM
screen_difficulty_data diff
left join screen_customer_grid scg
on(diff.ORG_ID=scg.GRID_ID and scg.DEL_FLAG='0')
WHERE
diff.DEL_FLAG = '0'
AND scg.AREA_CODE like concat(#{areaCode},'%')
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>
</mapper>

60
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml

@ -6,6 +6,7 @@
<!-- 查询政府治理能力各项指标 -->
<select id="selectGovernCapacityRatio" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
SELECT
rankData.org_id as orgId,
rankData.ORG_NAME AS agencyName,
rankData.RESPONSE_RATIO,
rankData.RESOLVED_RATIO,
@ -25,4 +26,63 @@
(rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC
</select>
<!-- 基层治理-治理能力榜单 多客户版,调用此sql -->
<select id="selectGovernCapacityRatioNew" resultType="com.epmet.evaluationindex.screen.dto.result.GovernCapacityResultDTO">
(SELECT
agency.agency_id as orgId,
agency.AGENCY_NAME AS agencyName,
IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO,
IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
pa.AGENCY_NAME AS parentAgencyName
FROM screen_customer_agency agency
left join screen_customer_agency pa
on(agency.PARENT_AREA_CODE=pa.AREA_CODE
and pa.DEL_FLAG='0')
left join screen_govern_rank_data rankData
ON (agency.AGENCY_ID =rankData.org_id
AND rankData.DEL_FLAG = '0'
and rankData.org_type='agency')
WHERE
agency.DEL_FLAG = '0'
AND agency.agency_id in
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
#{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
ORDER BY
(rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,
rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO DESC
)
union
(
SELECT
grid.grid_id as orgId,
grid.GRID_NAME AS agencyName,
IFNULL(rankData.RESPONSE_RATIO,0) AS RESPONSE_RATIO,
IFNULL(rankData.RESOLVED_RATIO,0) AS RESOLVED_RATIO,
IFNULL(rankData.GOVERN_RATIO,0) AS GOVERN_RATIO,
IFNULL(rankData.SATISFACTION_RATIO,0) AS SATISFACTION_RATIO,
ca.agency_name AS parentAgencyName
FROM screen_customer_grid grid
left join screen_customer_agency ca
on (ca.agency_id = grid.parent_agency_id)
left join screen_govern_rank_data rankData
ON (grid.grid_id=rankData.org_id
AND grid.DEL_FLAG = 0
and rankData.org_type='grid')
WHERE grid.DEL_FLAG = '0'
AND grid.GRID_ID in
<foreach collection="orgIds" item="orgId" open="(" close=")" separator=",">
#{orgId}
</foreach>
AND rankData.MONTH_ID =#{monthId}
ORDER BY
(rankData.RESPONSE_RATIO + rankData.RESOLVED_RATIO + rankData.GOVERN_RATIO + rankData.SATISFACTION_RATIO) DESC,
rankData.RESPONSE_RATIO DESC,rankData.RESOLVED_RATIO DESC,rankData.GOVERN_RATIO DESC,rankData.SATISFACTION_RATIO
DESC
)
</select>
</mapper>

59
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml

@ -265,4 +265,63 @@
${sort}
LIMIT #{topNum}
</select>
<select id="selectSubAgencyIndexRankNew" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
y.org_name AS NAME,
y.govern_ablity AS governAbility,
y.party_dev_ablity AS partyDevAbility,
y.service_ablity AS serviceAbility
FROM
screen_index_data_yearly y
LEFT JOIN screen_customer_agency ca ON ca.AGENCY_ID = y.ORG_ID
WHERE
y.del_flag = '0'
AND ca.AREA_CODE LIKE CONCAT(#{areaCode},'%')
AND y.year_id = #{yearId}
AND y.ORG_TYPE != 'department'
ORDER BY y.index_total DESC
LIMIT #{topNum}
</select>
<select id="selectSubStreetByAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
sca.AGENCY_NAME AS NAME,
sy.govern_ablity AS governAbility,
sy.party_dev_ablity AS partyDevAbility,
sy.service_ablity AS serviceAbility
FROM screen_customer_agency sca
left join screen_index_data_yearly sy
on(sca.AGENCY_ID=sy.ORG_ID
and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department'
and sy.YEAR_ID=#{yearId}
)
WHERE
sca.del_flag = '0'
AND sca.PARENT_AREA_CODE=#{areaCode}
and sy.CUSTOMER_ID=#{customerId}
ORDER BY index_total DESC
LIMIT #{topNum}
</select>
<select id="selectSubGridByAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO">
SELECT
scg.GRID_NAME AS NAME,
sy.govern_ablity AS governAbility,
sy.party_dev_ablity AS partyDevAbility,
sy.service_ablity AS serviceAbility
FROM screen_customer_grid scg
left join screen_index_data_yearly sy
on(scg.GRID_ID=sy.ORG_ID
and sy.DEL_FLAG='0'
and sy.ORG_TYPE != 'department'
and sy.YEAR_ID=#{yearId}
)
WHERE
scg.del_flag = '0'
AND scg.AREA_CODE like CONCAT(#{areaCode},'%')
and sy.CUSTOMER_ID=#{customerId}
ORDER BY index_total DESC
LIMIT #{topNum}
</select>
</mapper>

32
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml

@ -34,4 +34,36 @@
</select>
<select id="selectGridDataMonthlyAreaCode" parameterType="map" resultType="com.epmet.evaluationindex.screen.dto.result.OrgRankDataResultDTO">
SELECT
rankData.ORG_NAME AS NAME,
rankData.PARTY_TOTAL AS partyMemberNum,
rankData.GROUP_TOTAL AS branchNum,
rankData.ISSUE_TOTAL AS issueNum,
rankData.PROJECT_TOTAL AS projectNum,
rankData.CLOSE_PROJECT_RATIO AS closedProjectRatio,
rankData.SATISFACTION_RATIO AS satisfactionRatio,
agency.AGENCY_NAME AS parentAgencyName
FROM
screen_org_rank_data rankData
left join screen_customer_grid scg on(
rankData.ORG_ID=scg.GRID_ID
and scg.DEL_FLAG='0'
)
LEFT JOIN screen_customer_agency agency
ON (scg.PARENT_AGENCY_ID = agency.AGENCY_ID AND agency.DEL_FLAG = '0')
WHERE
rankData.DEL_FLAG = '0'
AND rankData.ORG_TYPE = 'grid'
and scg.AREA_CODE like CONCAT('%',#{areaCode},'%')
AND rankData.MONTH_ID = #{monthId}
ORDER BY
(rankData.PARTY_TOTAL + rankData.GROUP_TOTAL + rankData.ISSUE_TOTAL + rankData.PROJECT_TOTAL + rankData.CLOSE_PROJECT_RATIO + rankData.SATISFACTION_RATIO) DESC,
rankData.PARTY_TOTAL DESC,
rankData.GROUP_TOTAL DESC,
rankData.ISSUE_TOTAL DESC,
rankData.PROJECT_TOTAL DESC,
rankData.CLOSE_PROJECT_RATIO DESC,
rankData.SATISFACTION_RATIO DESC
</select>
</mapper>

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

Loading…
Cancel
Save