Browse Source

Merge branch 'develop' of http://git.elinkit.com.cn:7070/r/epmet-cloud into develop

 Conflicts:
	epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
	epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
	epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
master
wxz 5 years ago
parent
commit
0cb9df24d3
  1. 2
      epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java
  2. 2
      epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java
  3. 3
      epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java
  4. 24
      epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java
  5. 9
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java
  6. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerAgencyCommonDTO.java
  7. 18
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridCommonDTO.java
  8. 5
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java
  9. 4
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java
  10. 14
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java
  11. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResult.java
  12. 15
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResultDTO.java
  13. 29
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java
  14. 2
      epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java
  15. 7
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java
  16. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java
  17. 6
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java
  18. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  19. 2
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java
  20. 3
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java
  21. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java
  22. 4
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java
  23. 5
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java
  24. 20
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java
  25. 86
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java
  26. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java
  27. 8
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java
  28. 37
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java
  29. 41
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java
  30. 135
      epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java
  31. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml
  32. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml
  33. 17
      epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml
  34. 104
      epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml
  35. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml
  36. 5
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml
  37. 78
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml
  38. 67
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml
  39. 4
      epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml
  40. 2
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java
  41. 8
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java
  42. 20
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/UpdateProjectSatisfactionScoreFormDTO.java
  43. 5
      epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java
  44. 29
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java
  45. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java
  46. 20
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java
  47. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java
  48. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java
  49. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java
  50. 9
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java
  51. 46
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java
  52. 13
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java
  53. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java
  54. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java
  55. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java
  56. 4
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java
  57. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java
  58. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java
  59. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java
  60. 1
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java
  61. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java
  62. 25
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java
  63. 2
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java
  64. 10
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java
  65. 12
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml
  66. 14
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml
  67. 5
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml
  68. 2
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml
  69. 4
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml
  70. 16
      epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml
  71. 21
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StaffPatrolService.java
  72. 33
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StaffPatrolServiceImpl.java
  73. 40
      epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EndPatrolTask.java
  74. 5
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java
  75. 15
      epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java
  76. 3
      epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java
  77. 24
      epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java
  78. 7
      epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml
  79. 2
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StartPatrolFormDTO.java
  80. 13
      epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java
  81. 10
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java
  82. 13
      epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java
  83. 14
      epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java
  84. 8
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java
  85. 32
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java
  86. 4
      epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

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

@ -290,7 +290,7 @@ public class SsoServiceImpl implements SsoService {
//3.根据华为openId查询用户是否存在历史登陆信息
Result<StaffLatestAgencyResultDTO> latestStaffWechat = epmetUserOpenFeignClient.getLatestStaffWechatLoginRecord(userInfo.getOpenId());
if (!latestStaffWechat.success() || null == latestStaffWechat.getData()) {
logger.error(String.format("没有获取到用户最近一次登录账户信息,code[%s],msg[%s]", EpmetErrorCode.PLEASE_LOGIN.getCode(), EpmetErrorCode.PLEASE_LOGIN.getMsg()));
logger.warn(String.format("没有获取到用户最近一次登录账户信息,code[%s],msg[%s]", EpmetErrorCode.PLEASE_LOGIN.getCode(), EpmetErrorCode.PLEASE_LOGIN.getMsg()));
throw new RenException(EpmetErrorCode.PLEASE_LOGIN.getCode());
}
StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData();

2
epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java

@ -164,7 +164,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol
//2.根据openid查询用户是否存在历史登陆信息
Result<StaffLatestAgencyResultDTO> latestStaffWechat = epmetUserOpenFeignClient.getLatestStaffWechatLoginRecord(userWechatDTO.getWxOpenId());
if (!latestStaffWechat.success() || null == latestStaffWechat.getData()) {
logger.error(String.format("没有获取到用户最近一次登录账户信息,code[%s],msg[%s]", EpmetErrorCode.PLEASE_LOGIN.getCode(), EpmetErrorCode.PLEASE_LOGIN.getMsg()));
logger.warn(String.format("没有获取到用户最近一次登录账户信息,code[%s],msg[%s]", EpmetErrorCode.PLEASE_LOGIN.getCode(), EpmetErrorCode.PLEASE_LOGIN.getMsg()));
throw new RenException(EpmetErrorCode.PLEASE_LOGIN.getCode());
}
StaffLatestAgencyResultDTO staffLatestAgencyResultDTO = latestStaffWechat.getData();

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

@ -190,7 +190,8 @@ public enum EpmetErrorCode {
NOTICE_BE_OVERDUE(8915,"通知已过期不允许再次变更"),
SAME_RULE_NAME(8916,"该积分事件已存在,请重新调整保存"),
UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存");
UP_LIMIT_POINT(8917,"积分上限需为单位积分倍数,请重新调整保存"),
BADGE_CHECK(8918,"");
private int code;

24
epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java

@ -11,10 +11,10 @@ import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao;
import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO;
import com.epmet.dataaggre.dto.datastats.form.*;
import com.epmet.dataaggre.dto.datastats.result.*;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO;
import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO;
import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO;
import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO;
import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO;
import com.epmet.dataaggre.entity.datastats.DimAgencyEntity;
@ -1412,17 +1412,6 @@ public class DataStatsServiceImpl implements DataStatsService {
return resultDTO;
}
private String getPercentage(Integer countInt, Integer totalInt) {
if (NumConstant.ZERO == totalInt) {
return "0%";
}
BigDecimal count = new BigDecimal(countInt);
BigDecimal total = new BigDecimal(totalInt);
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal ratio = count.multiply(hundred).divide(total, NumConstant.ONE, RoundingMode.HALF_UP);
return ratio.toString().concat("%");
}
@Override
public List<GridMemberDataAnalysisResultDTO> listGridMemberDataStats(List<String> gridIds,
String searchedStaffName,
@ -1439,4 +1428,15 @@ public class DataStatsServiceImpl implements DataStatsService {
public GridMemberDataAnalysisResultDTO getGridMemberIssueProjectStats(String staffId) {
return factGridMemberStatisticsDailyDao.getGridMemberIssueProjectStats( staffId);
}
private String getPercentage(Integer countInt, Integer totalInt) {
if (NumConstant.ZERO == totalInt) {
return "0%";
}
BigDecimal count = new BigDecimal(countInt);
BigDecimal total = new BigDecimal(totalInt);
BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED);
BigDecimal ratio = count.multiply(hundred).divide(total, NumConstant.ONE, RoundingMode.HALF_UP);
return ratio.toString().concat("%");
}
}

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

@ -13,8 +13,9 @@ import java.util.List;
*/
@Data
public class AgencyInfoDTO implements Serializable {
private String agencyId;
private String areaCode;
private List<String> subAgencyIds;
private List<String> subGridIds;
private String currentAgencyId;
private String currentAgencyName;
private String currentAreaCode;
private List<ScreenCustomerAgencyCommonDTO> subAgencies;
private List<ScreenCustomerGridCommonDTO> subGrids;
}

18
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerAgencyCommonDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* screen_customer_agency
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/13 15:31
*/
@Data
public class ScreenCustomerAgencyCommonDTO implements Serializable {
private static final long serialVersionUID = -6222325433226628163L;
private String agencyId;
private String agencyName;
}

18
epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridCommonDTO.java

@ -0,0 +1,18 @@
package com.epmet.dto;
import lombok.Data;
import java.io.Serializable;
/**
* screen_customer_grid
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/13 15:32
*/
@Data
public class ScreenCustomerGridCommonDTO implements Serializable {
private static final long serialVersionUID = -4405092094598416917L;
private String gridId;
private String gridName;
}

5
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java

@ -19,6 +19,7 @@ package com.epmet.evaluationindex.index.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
@ -37,20 +38,24 @@ public class IndexExplainFormDTO implements Serializable {
/**
* 客户id
*/
@NotBlank(message = "客户ID不能为空")
private String customerId;
/**
* 组织级别网格级grid;社区级community;街道:street;区县级: district;市级: city;省级:province
*/
@NotBlank(message = "组织级别不能为空")
private String orgLevel;
/**
* 组织id
*/
@NotBlank(message = "组织ID不能为空")
private String orgId;
/**
* 月份Id
*/
@NotBlank(message = "月份不能为空")
private String monthId;

4
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java

@ -1,5 +1,6 @@
package com.epmet.evaluationindex.index.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.util.ArrayList;
@ -49,5 +50,8 @@ public class IndexExplainResult {
*/
private String tableDesc;
@JsonIgnore
private String indexCode;
}

14
epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java

@ -23,6 +23,15 @@ public class IndexScoreResult implements Serializable {
*/
private BigDecimal score;
/**
* 本级分数
*/
private BigDecimal selfScore;
/**
* 下级分数
*/
private BigDecimal subScore;
/**
* 指标对应的权重
*/
@ -43,4 +52,9 @@ public class IndexScoreResult implements Serializable {
*/
private String valueType;
/**
* 是否是总分
*/
private Boolean isTotal;
}

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

@ -39,4 +39,19 @@ public class MonthBarchartResult implements Serializable {
* 治理能力分数权重
*/
private BigDecimal governAblityWeight;
/**
* 党建能力 原始得分
*/
private BigDecimal partyOriginScore = new BigDecimal(0.0);
/**
* 治理能力 原始得分
*/
private BigDecimal governOriginScore = new BigDecimal(0.0);
/**
* 服务能力 原始得分
*/
private BigDecimal serviceOriginScore = new BigDecimal(0.0);
}

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

@ -55,4 +55,19 @@ public class MonthBarchartResultDTO implements Serializable {
* 治理能力分数权重
*/
private List<BigDecimal> governAblityWeightData;
/**
* 党建能力 原始得分
*/
private List<BigDecimal> partyOriginScore;
/**
* 治理能力 原始得分
*/
private List<BigDecimal> governOriginScore;
/**
* 服务能力 原始得分
*/
private List<BigDecimal> serviceOriginScore;
}

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

@ -3,6 +3,7 @@ package com.epmet.evaluationindex.screen.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* @Author zxc
@ -28,6 +29,34 @@ public class MonthPieChartResultDTO implements Serializable {
*/
private Double governAbility = 0.0;
/**
* 党建能力 原始得分
*/
private BigDecimal partyOriginScore = new BigDecimal(0.0);
/**
* 治理能力 原始得分
*/
private BigDecimal governOriginScore = new BigDecimal(0.0);
/**
* 服务能力 原始得分
*/
private BigDecimal serviceOriginScore = new BigDecimal(0.0);
/**
* 服务能力权重(保留一位小数)
*/
private Double serviceAblityWeight=0.0;
/**
* 党建能力权重(保留一位小数)
*/
private Double partyDevWeight=0.0;
/**
* 治理能力权重(保留一位小数)
*/
private Double governAblityWeight=0.0;
/**
* 月份Id
*/

2
epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java

@ -31,4 +31,6 @@ public class WorkRecordSubRank implements Serializable {
* 组织次数
*/
private Integer participateTotal;
private String isDefault;
}

7
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java

@ -24,16 +24,21 @@ public class IndexConstant {
public static final String ZB_CN = "指标";
public static final String BEN_JI_CN = "本级";
public static final String XIA_JI_CN = "下级";
public static final String BEN_JI_EN = "self";
public static final String XIA_JI_EN = "sub";
public static final String ZI_SHEN = "zishen";
public static final String XIA_JI = "xiaji";
public static final String THRESHOLD_TEXT = "给定阈值%d%%,超过阈值不加分";
public static final String TABLE_DESC = "详见下表:";
public static final String INDEX_SCORE_TITLE = "当月指数";
public static final String INDEX_SCORE_DESC = "自然月周期内,当月指数得分=党建指数得分*相关权重+治理指数得分*相关权重+服务指数得分*相关权重";
public static final String INDEX_SCORE_DESC = "自然月周期内,当月指数得分(totalScore)=党建指数得分(dangjiannengli)*相关权重(dangjiannengliweight)+治理指数得分(zhilinengli)*相关权重(zhilinengliweight)+服务指数得分(fuwunengli)*相关权重(fuwunengliweight)";
public static final String INDEX_DISTRINCT_TABLE1_INDEX_CODE = "suoyoujiedaozlnlpjz";
public static final String INDEX_DISTRINCT_TABLE2_INDEX_CODE = "suoyouzhishubmzlnlpjz";
public static final String ZHI_LI_NENG_LI = "zhilinengli";
public static final String PATTERN_D = "d";
public static final String PATTERN_WEIGHT = "weight";
public static final String PATTERN_TOTAL = "totalScore";
public static final String QUAN_QU_ZHI_LI_INDEX_CODE = "quanquxiangguan:zhilinengli";

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java

@ -17,12 +17,15 @@
package com.epmet.datareport.controller.index;
import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.datareport.service.evaluationindex.index.IndexExplainService;
import com.epmet.evaluationindex.index.form.IndexExplainFormDTO;
import com.epmet.evaluationindex.index.form.IndexScoreFormDTO;
import com.epmet.evaluationindex.index.result.IndexExplainResult;
import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO;
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;
@ -56,6 +59,8 @@ public class IndexExplainController {
*/
@PostMapping("detail")
public Result<List<IndexExplainResult>> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){
formDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId());
ValidatorUtils.validateEntity(formDTO);
Result<List<IndexExplainResult>> ok = new Result<List<IndexExplainResult>>().ok(indexExplainService.getScoreDetail(formDTO));
return ok;
}

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

@ -17,8 +17,10 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.ScreenCustomerAgencyCommonDTO;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.result.ParentListResultDTO;
import com.epmet.dto.ScreenCustomerAgencyCommonDTO;
import com.epmet.dto.result.ScreenCustomerAgencyDTO;
import com.epmet.dto.result.plugins.AgencyNodeDTO;
import com.epmet.dto.result.plugins.DeptNodeDTO;
@ -163,7 +165,7 @@ public interface ScreenCustomerAgencyDao {
**/
List<String> getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
List<String> selectSubAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId);
List<ScreenCustomerAgencyCommonDTO> selectSubAgencyIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
/**
* @Description 根据agencyId查询网格
@ -203,4 +205,4 @@ public interface ScreenCustomerAgencyDao {
ScreenCustomerAgencyDTO selectCustomerRootAgency(String customerId);
ScreenCustomerAgencyDTO selectByAreaCode(String areaCode);
}
}

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

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.evaluationindex.screen;
import com.epmet.dto.ScreenCustomerGridCommonDTO;
import com.epmet.evaluationindex.screen.dto.result.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@ -81,5 +82,5 @@ public interface ScreenCustomerGridDao {
*/
List<TreeResultDTO> selectGridInfo(@Param("agencyId")String agencyId);
List<String> selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
List<ScreenCustomerGridCommonDTO> selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId);
}

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

@ -127,4 +127,6 @@ public interface ScreenIndexDataMonthlyDao{
@Param("yearId") String yearId,
@Param("areaCode") String areaCode,
@Param("topNum") int topNum);
List<AnNingSubAgencyIndexRankResultDTO> selectKczSubAgencyOrGridIndexMonthlyRank(SubAgencyIndexRankYMFormDTO formDTO);
}

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

@ -51,4 +51,7 @@ public interface ScreenIndexDataYearlyDao{
* @Date 09:38 2020-09-08
**/
List<AnNingSubAgencyIndexRankResultDTO> selectAnNingSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO);
List<AnNingSubAgencyIndexRankResultDTO> selectKczSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO);
}

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.index.result.IndexScoreResult;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
@ -24,6 +25,7 @@ import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
import java.util.List;
@ -57,4 +59,6 @@ public interface FactIndexAgencyScoreDao {
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectAgencyMonthWeightScoreList(MonthScoreListFormDTO formDTO);
List<IndexScoreResult> selectAgencyScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId);
}

4
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.index.result.IndexScoreResult;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
@ -24,6 +25,7 @@ import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
import java.util.List;
@ -57,4 +59,6 @@ public interface FactIndexCommunityScoreDao {
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectCommunityMonthWeightScoreList(MonthScoreListFormDTO formDTO);
List<IndexScoreResult> selectComunityScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId);
}

5
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java

@ -17,6 +17,7 @@
package com.epmet.datareport.dao.fact;
import com.epmet.evaluationindex.index.result.IndexScoreResult;
import com.epmet.evaluationindex.screen.dto.form.AblityIndexFormDTO;
import com.epmet.evaluationindex.screen.dto.form.MonthScoreListFormDTO;
import com.epmet.evaluationindex.screen.dto.form.ScoreListFormDTO;
@ -24,6 +25,7 @@ import com.epmet.evaluationindex.screen.dto.result.AblityIndexResultDTO;
import com.epmet.evaluationindex.screen.dto.result.MonthScoreListResultDTO;
import com.epmet.evaluationindex.screen.dto.result.ScoreListResultDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.LinkedList;
import java.util.List;
@ -57,4 +59,7 @@ public interface FactIndexGridScoreDao {
* @author sun
*/
LinkedList<MonthScoreListResultDTO.ScoreListResultDTO> selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO);
List<IndexScoreResult> selectGridScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId);
}

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

@ -55,16 +55,14 @@ public interface ScreenWorkRecordOrgDailyDao extends BaseDao<ScreenWorkRecordOrg
@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);
WorkRecordSubRank selectCurrentAgency(@Param("agencyId") String agencyId,
@Param("dateId")String dateId,
@Param("typeCodeList")List<String> typeCodeList);
List<String> selectCustomerTypeCode(@Param("dataType")String dataType, @Param("customerId")String customerId);
WorkRecordSubRank selectUpToCalAgency(@Param("agencyId")String agencyId, @Param("dateId")String dateId,@Param("typeCodeList") List<String> typeCodeList);
List<WorkRecordSubRank> selectCurrentAgency(@Param("agencyId") String agencyId,
@Param("dataType")String dataType,
@Param("customerId")String customerId,
@Param("dateId")String dateId);
WorkRecordSubRank selectUpToCalGrid(@Param("gridId")String gridId, @Param("dateId")String dateId, @Param("typeCodeList")List<String> typeCodeList);
}

86
epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java

@ -67,13 +67,19 @@ public class IndexExplainServiceImpl implements IndexExplainService {
@Autowired
private FactIndexGridSubScoreDao gridSubScoreDao;
@Autowired
private FactIndexGridScoreDao gridScoreDao;
@Autowired
private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao;
@Autowired
private FactIndexCommunitySubScoreDao communitySubScoreDao;
@Autowired
private FactIndexCommunityScoreDao communityScoreDao;
@Autowired
private FactIndexAgencySubScoreDao agencySubScoreDao;
@Autowired
private FactIndexDeptSubScoreDao deptSubScoreDao;
@Autowired
private FactIndexAgencyScoreDao agencyScoreDao;
@Override
@ -83,6 +89,8 @@ public class IndexExplainServiceImpl implements IndexExplainService {
first.setTitle(IndexConstant.INDEX_SCORE_TITLE);
first.setMeaning(IndexConstant.INDEX_SCORE_DESC);
results.add(first);
//获取该等级的分数及权重
List<IndexExplainTreeDTO> explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel());
if (CollectionUtils.isEmpty(explainDTOList)) {
return null;
@ -100,13 +108,22 @@ public class IndexExplainServiceImpl implements IndexExplainService {
results.add(result);
result.setTitle(explainDTO.getTitle());
result.setMeaning(explainDTO.getMeaning());
result.setIndexCode(explainDTO.getIndexCode());
//全区相关的服务能力的含义中 有权重 所以特殊处理下
if (explainDTO.getOrgLevel().equals(OrgLevelEnum.DISTRICT.getCode()) && IndexConstant.ZLZS_CN.equals(explainDTO.getTitle())) {
List<IndexGroupDetailResult> detailResults = detailEntityMap.get(IndexConstant.QUAN_QU_ZHI_LI_INDEX_CODE);
detailResults.forEach(index -> {
String newMeaning = result.getMeaning().replaceFirst(IndexConstant.PATTERN_D,
index.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString());
//获取分数 补充下
IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO();
ablityListFormDTO.setCustomerId(formDTO.getCustomerId());
ablityListFormDTO.setOrgId(formDTO.getOrgId());
ablityListFormDTO.setAllParentIndexCode(explainDTO.getIndexCode());
ablityListFormDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId());
List<IndexScoreResult> scoreResults = agencySubScoreDao.selectSubScore(ablityListFormDTO);
scoreResults.forEach(e->{
String newMeaning = result.getMeaning().replaceFirst(e.getIndexCode(),e.getScore().toString())
.replaceFirst(IndexConstant.PATTERN_D,
e.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString());;
result.setMeaning(newMeaning);
});
}
@ -114,6 +131,8 @@ public class IndexExplainServiceImpl implements IndexExplainService {
setTableData(formDTO, detailEntityMap, explainDTO, result);
//子节点
setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren());
//设置 新的含义 带分数的
setCurrentMonthScore(formDTO, first,result);
}
return results;
@ -124,6 +143,55 @@ public class IndexExplainServiceImpl implements IndexExplainService {
return indexDictDao.selectIndexDict(formDTO.getIndexCode());
}
private void setCurrentMonthScore(IndexExplainFormDTO formDTO, IndexExplainResult first, IndexExplainResult second) {
String orgLevel = formDTO.getOrgLevel();
OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel);
List<IndexScoreResult> list = null;
switch (anEnum) {
case GRID:
list = gridScoreDao.selectGridScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
case COMMUNITY:
list = communityScoreDao.selectComunityScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
case STREET:
list = agencyScoreDao.selectAgencyScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
case DISTRICT:
list = agencyScoreDao.selectAgencyScoreList(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getMonthId());
break;
default:
log.error("暂不支持更高级别的查询,level:{}", orgLevel);
}
if (CollectionUtils.isNotEmpty(list)) {
setNewMeaningWithScore(list, first,second);
}
}
private void setNewMeaningWithScore(List<IndexScoreResult> list, IndexExplainResult first, IndexExplainResult second) {
String firstMeaning = first.getMeaning();
String secondMeaning = second.getMeaning();
for (IndexScoreResult score : list) {
String indexCode = score.getIndexCode();
if (score.getIsTotal()) {
firstMeaning = firstMeaning.replaceFirst(IndexConstant.PATTERN_TOTAL, score.getScore().toString());
continue;
}
firstMeaning = firstMeaning.replaceFirst(indexCode, score.getScore().toString()).replaceFirst(indexCode.concat(IndexConstant.PATTERN_WEIGHT), score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString() + "%");
if (second.getIndexCode().contains(score.getIndexCode())){
secondMeaning = secondMeaning.replaceFirst(IndexConstant.PATTERN_TOTAL, score.getScore().toString())
.replaceFirst(IndexConstant.BEN_JI_EN, score.getSelfScore().toString())
.replaceFirst(IndexConstant.XIA_JI_EN, score.getSubScore().toString());
}
}
first.setMeaning(firstMeaning);
second.setMeaning(secondMeaning);
}
private void setTableData(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) {
if (NumConstant.ONE == explainDTO.getIsSearch()) {
List<IndexScoreResult> realScoreList = null;
@ -174,6 +242,9 @@ public class IndexExplainServiceImpl implements IndexExplainService {
List<IndexGroupDetailResult> indexGroupDetailEntities = new ArrayList<>();
for (IndexGroupDetailResult index : detailResults) {
if (IndexConstant.INDEX_DISTRINCT_TABLE1_INDEX_CODE.equals(index.getIndexCode())) {
String newMeaning = result.getMeaning().replaceFirst(IndexConstant.PATTERN_D,
index.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString());
result.setMeaning(newMeaning);
indexGroupDetailEntities.add(index);
setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, indexGroupDetailEntities);
//不下钻
@ -251,14 +322,14 @@ public class IndexExplainServiceImpl implements IndexExplainService {
}
}
private List<IndexScoreDetailResult> setDefaultTableData(String orgLevel, String type, Map<String, List<IndexGroupDetailResult>> detailEntityMap,
IndexExplainResult result, String allIndexCodePath, List<IndexGroupDetailResult> indexGroupDetailEntities) {
private void setDefaultTableData(String orgLevel, String type, Map<String, List<IndexGroupDetailResult>> detailEntityMap,
IndexExplainResult result, String allIndexCodePath, List<IndexGroupDetailResult> indexGroupDetailEntities) {
if (indexGroupDetailEntities == null) {
indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath);
}
if (CollectionUtils.isEmpty(indexGroupDetailEntities)) {
log.warn("setDefaultTableData allINdexCodePath:{} is config error", allIndexCodePath);
return null;
return;
}
List<IndexScoreDetailResult> tableList = new ArrayList<>();
List<String> threlodList = new ArrayList<>();
@ -287,7 +358,6 @@ public class IndexExplainServiceImpl implements IndexExplainService {
result.setTableDataList(tableList);
result.setThresholdList(threlodList);
result.setTableDesc(IndexConstant.TABLE_DESC);
return tableList;
}
private void setChildren(IndexExplainFormDTO formDTO, Map<String, List<IndexGroupDetailResult>> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List<IndexExplainTreeDTO> children) {

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

@ -334,10 +334,10 @@ public class AgencyServiceImpl implements AgencyService {
@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));
agencyInfoDTO.setCurrentAgencyId(agencyId);
agencyInfoDTO.setCurrentAreaCode(areaCode);
agencyInfoDTO.setSubAgencies(screenCustomerAgencyDao.selectSubAgencyIds(areaCode,agencyId));
agencyInfoDTO.setSubGrids(screenCustomerGridDao.selectSubGridIds(areaCode,agencyId));
return agencyInfoDTO;
}

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

@ -26,6 +26,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@ -147,27 +148,28 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService {
UserJoinIndicatorGrowthRateResultDTO beforeTwoMonth = screenUserJoinDao.selectUserJoinDataByAreaCode(param.getAreaCode(), dateUtils.getPreviousMonthId(NumConstant.TWO));
if (null == beforeTwoMonth) {
log.warn(String.format("平阴县查询screen_user_join表为空,monthId:%s",dateUtils.getPreviousMonthId(NumConstant.TWO)));
return new PublicPartiProfileResultDTO();
}else{
//举例,today is 20210707 , latest是06月份的数据,beforeTwoMonth是05月份的数据
// 总参与数6月份比5月份增加了?
int incrTotal = latest.getTotal() - beforeTwoMonth.getTotal();
// 总参与数月增长:增加的占5月份的占比???
BigDecimal monthIncr = BigDecimal.valueOf(incrTotal / beforeTwoMonth.getTotal());
BigDecimal monthIncr = NumConstant.ZERO == beforeTwoMonth.getTotal() ? BigDecimal.ZERO : BigDecimal.valueOf(incrTotal / beforeTwoMonth.getTotal());
latest.setMonthIncr(monthIncr);
latest.setMonthTrend(monthIncr.compareTo(BigDecimal.ZERO) > 0 ? "incr" : "decr");
//人均议题数6月份比五月份增加了?
BigDecimal issueIncrTotal = latest.getAverageIssue().subtract(beforeTwoMonth.getAverageIssue());
//人均议题数月增长:增加的占5月份的占比???
BigDecimal issueCompareLatestMonth = issueIncrTotal.divide(beforeTwoMonth.getAverageIssue());
BigDecimal issueCompareLatestMonth = BigDecimal.ZERO.compareTo(beforeTwoMonth.getAverageIssue()) == 0 ? BigDecimal.ZERO : issueIncrTotal.divide(beforeTwoMonth.getAverageIssue(), 2, RoundingMode.HALF_UP);
latest.setIssueCompareLatestMonth(issueCompareLatestMonth);
latest.setIssueCompareLatestTrend(issueCompareLatestMonth.compareTo(BigDecimal.ZERO) > 0 ? "incr" : "decr");
// 平均参与度6月份比5月份增加了?
BigDecimal incrJoinCompareLatestMonth=latest.getJoinCompareLatestMonth().subtract(beforeTwoMonth.getJoinCompareLatestMonth());
//平均参与度月增长:增加的占5月份的占比???
BigDecimal joinCompareLatestMonth=incrJoinCompareLatestMonth.divide(beforeTwoMonth.getJoinCompareLatestMonth());
BigDecimal joinCompareLatestMonth = BigDecimal.ZERO.compareTo(beforeTwoMonth.getJoinCompareLatestMonth()) == 0 ? BigDecimal.ZERO : incrJoinCompareLatestMonth.divide(beforeTwoMonth.getJoinCompareLatestMonth(), 2, RoundingMode.HALF_UP);
latest.setJoinCompareLatestMonth(joinCompareLatestMonth);
latest.setJoinCompareLatestTrend(joinCompareLatestMonth.compareTo(BigDecimal.ZERO) > 0 ? "incr" : "decr");
}

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

@ -112,6 +112,9 @@ public class IndexServiceImpl implements IndexService {
List<BigDecimal> serviceAblityWeightData = new ArrayList<>();
List<BigDecimal> partyDevWeightData = new ArrayList<>();
List<BigDecimal> governAblityWeightData = new ArrayList<>();
List<BigDecimal> serviceOriginData = new ArrayList<>();
List<BigDecimal> partyOriginData = new ArrayList<>();
List<BigDecimal> governOriginData = new ArrayList<>();
// 1. x轴
if(StringUtils.isNotBlank(monthBarchartFormDTO.getMonthId())){
result.setXAxis(partyMemberLeadServiceImpl.getXproEndMonth(monthBarchartFormDTO.getMonthId()));
@ -132,6 +135,9 @@ public class IndexServiceImpl implements IndexService {
serviceAblityWeightData.add(BigDecimal.ZERO);
partyDevWeightData.add(BigDecimal.ZERO);
governAblityWeightData.add(BigDecimal.ZERO);
serviceOriginData.add(BigDecimal.ZERO);
partyOriginData.add(BigDecimal.ZERO);
governOriginData.add(BigDecimal.ZERO);
}
result.setServiceAbilityData(serviceAbilityData);
result.setPartyDevAbilityData(partyDevAbilityData);
@ -141,6 +147,9 @@ public class IndexServiceImpl implements IndexService {
result.setServiceAblityWeightData(serviceAblityWeightData);
result.setPartyDevWeightData(partyDevWeightData);
result.setGovernAblityWeightData(governAblityWeightData);
result.setServiceOriginScore(serviceOriginData);
result.setPartyOriginScore(partyOriginData);
result.setGovernOriginScore(governOriginData);
return result;
}
// 处理小数四舍五入
@ -186,6 +195,10 @@ public class IndexServiceImpl implements IndexService {
serviceAblityWeightData.add(BigDecimal.ZERO);
partyDevWeightData.add(BigDecimal.ZERO);
governAblityWeightData.add(BigDecimal.ZERO);
//原始分数默认0
serviceOriginData.add(BigDecimal.ZERO);
partyOriginData.add(BigDecimal.ZERO);
governOriginData.add(BigDecimal.ZERO);
//保持cursor不变
}else{
MonthBarchartResult data = collect.get(cursor);
@ -198,6 +211,11 @@ public class IndexServiceImpl implements IndexService {
serviceAblityWeightData.add(null==data.getServiceAblityWeight()?BigDecimal.ZERO:data.getServiceAblityWeight());
partyDevWeightData.add(null==data.getPartyDevWeight()?BigDecimal.ZERO:data.getPartyDevWeight());
governAblityWeightData.add(null==data.getGovernAblityWeight()?BigDecimal.ZERO:data.getGovernAblityWeight());
//添加权重
serviceOriginData.add(null==data.getServiceOriginScore()?BigDecimal.ZERO:data.getServiceOriginScore());
partyOriginData.add(null==data.getPartyOriginScore()?BigDecimal.ZERO:data.getPartyOriginScore());
governOriginData.add(null==data.getGovernOriginScore()?BigDecimal.ZERO:data.getGovernOriginScore());
//统计日期一致后移动游标
cursor++;
}
@ -218,6 +236,11 @@ public class IndexServiceImpl implements IndexService {
result.setServiceAblityWeightData(serviceAblityWeightData);
result.setPartyDevWeightData(partyDevWeightData);
result.setGovernAblityWeightData(governAblityWeightData);
//添加返回原始值
//添加返回权重
result.setServiceOriginScore(serviceOriginData);
result.setPartyOriginScore(partyOriginData);
result.setGovernOriginScore(governOriginData);
return result;
}
@ -260,13 +283,23 @@ public class IndexServiceImpl implements IndexService {
List<AnNingSubAgencyIndexRankResultDTO> subAgencyIndexRankResultDTOS = new ArrayList<>();
if (ScreenConstant.YEAR_ID.equals(formDTO.getType())) {
// 年 指数排行
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO);
if("1234085031077498881".equals(formDTO.getAgencyId())){
// 孔村单独处理,查询下下级
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectKczSubAgencyIndexYearlyRank(formDTO);
}else{
subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO);
}
} else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())) {
// 月(上一个月) 指数排行
if (StringUtils.isBlank(formDTO.getMonthId())) {
formDTO.setMonthId(DateUtils.getBeforeNMonth(1));
}
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO);
if("1234085031077498881".equals(formDTO.getAgencyId())){
// 孔村单独处理,查询下下级
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectKczSubAgencyOrGridIndexMonthlyRank(formDTO);
}else{
subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectSubAgencyOrGridIndexMonthlyRank(formDTO);
}
subAgencyIndexRankResultDTOS.forEach(rank -> {
rank.setPartyDevAbility(getRound(rank.getPartyDevAbility()));
rank.setGovernAbility(getRound(rank.getGovernAbility()));

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

@ -18,7 +18,6 @@
package com.epmet.datareport.service.plugins;
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;
@ -39,16 +38,6 @@ import java.util.Map;
*/
public interface ScreenWorkRecordOrgDailyService extends BaseService<ScreenWorkRecordOrgDailyEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ScreenWorkRecordOrgDailyDTO>
* @author generator
* @date 2021-02-23
*/
PageData<ScreenWorkRecordOrgDailyDTO> page(Map<String, Object> params);
/**
* 默认查询
*
@ -69,36 +58,6 @@ public interface ScreenWorkRecordOrgDailyService extends BaseService<ScreenWorkR
*/
ScreenWorkRecordOrgDailyDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void save(ScreenWorkRecordOrgDailyDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2021-02-23
*/
void update(ScreenWorkRecordOrgDailyDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2021-02-23
*/
void delete(String[] ids);
WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO);
/**

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

@ -19,14 +19,11 @@ 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.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;
@ -36,8 +33,9 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService;
import com.epmet.datareport.service.plugins.ScreenWorkRecordOrgDailyService;
import com.epmet.datareport.utils.DateUtils;
import com.epmet.dto.AgencyInfoDTO;
import com.epmet.dto.ScreenCustomerAgencyCommonDTO;
import com.epmet.dto.ScreenCustomerGridCommonDTO;
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;
@ -48,7 +46,6 @@ 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.time.LocalDate;
import java.time.format.DateTimeFormatter;
@ -75,16 +72,6 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
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(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ScreenWorkRecordOrgDailyDTO.class);
}
@Override
public List<ScreenWorkRecordOrgDailyDTO> list(Map<String, Object> params) {
@ -108,65 +95,65 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
return ConvertUtils.sourceToTarget(entity, ScreenWorkRecordOrgDailyDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ScreenWorkRecordOrgDailyDTO dto) {
ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ScreenWorkRecordOrgDailyDTO dto) {
ScreenWorkRecordOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenWorkRecordOrgDailyEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true)
@Override
public WorkRecordRankResultDTO rankList(WorkRecordRankFormDTO formDTO) {
List<String> customerIds=new ArrayList<>();
Result<List<String>> result=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId());
// log.info("根据customerId查询其所有下级子客户id 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)){
dateId= com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE);
log.warn("dateId 赋值为"+dateId+" ; selectLatestDateId dateId is null customerIds" + JSON.toJSONString(customerIds));
}
//默认截止到前一天
String dateId= com.epmet.commons.tools.utils.DateUtils.getBeforeNDay(NumConstant.ONE);
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<>();
log.info("agencyInfoDTO: "+JSON.toJSONString(agencyInfoDTO));
//随手记类型编码;对应screen_customer_work_record_dict的资源编码
List<String> typeCodeList=baseDao.selectCustomerTypeCode(formDTO.getDataType(),formDTO.getCustomerId());
if(CollectionUtils.isEmpty(typeCodeList)){
log.warn(String.format("当前customerId=%s,screen_customer_work_record_dict 为空"));
}
//1)、当前组织的自身的数据
WorkRecordSubRank currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(),dateId,typeCodeList);
//2)、下级所有组织
List<WorkRecordSubRank> subAgencyRankList = new ArrayList<>();
for(ScreenCustomerAgencyCommonDTO agencyCommonDTO:agencyInfoDTO.getSubAgencies()){
WorkRecordSubRank agencyRes= baseDao.selectUpToCalAgency(agencyCommonDTO.getAgencyId(),dateId,typeCodeList);
if(null !=agencyRes){
subAgencyRankList.add(agencyRes);
}else{
WorkRecordSubRank agencyDefault=new WorkRecordSubRank();
agencyDefault.setOrgId(agencyCommonDTO.getAgencyId());
agencyDefault.setName(agencyCommonDTO.getAgencyName());
agencyDefault.setParticipateTotal(0);
agencyDefault.setParticipateUserTotal(0);
agencyDefault.setIsDefault("yes");
subAgencyRankList.add(agencyDefault);
}
}
//3)、直属网格
List<WorkRecordSubRank> subGridList=new ArrayList<>();
for(ScreenCustomerGridCommonDTO gridCommonDTO:agencyInfoDTO.getSubGrids()){
WorkRecordSubRank gridRes=baseDao.selectUpToCalGrid(gridCommonDTO.getGridId(),dateId,typeCodeList);
if (null != gridRes) {
subGridList.add(gridRes);
} else {
WorkRecordSubRank gridResDefault = new WorkRecordSubRank();
gridResDefault.setOrgId(gridCommonDTO.getGridId());
gridResDefault.setName(gridCommonDTO.getGridName());
gridResDefault.setParticipateTotal(0);
gridResDefault.setParticipateUserTotal(0);
gridResDefault.setIsDefault("yes");
subAgencyRankList.add(gridResDefault);
}
}
if(CollectionUtils.isNotEmpty(subAgencyRankList)){
returnDto.getSubRankList().addAll(subAgencyRankList);
}
if(CollectionUtils.isNotEmpty(subGridList)){
returnDto.getSubRankList().addAll(subGridList);
}
returnDto.getSubRankList().addAll(subAgencyRankList);
returnDto.getSubRankList().addAll(subGridList);
// log.info("returnDto.getSubRankList()="+returnDto.getSubRankList());
int participateUserTotal = 0;
int participateTotal = 0;
@ -174,11 +161,9 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
participateUserTotal += subAgency.getParticipateUserTotal();
participateTotal += subAgency.getParticipateTotal();
}
if (CollectionUtils.isNotEmpty(currentAgency)) {
for (WorkRecordSubRank m : currentAgency) {
participateUserTotal += m.getParticipateUserTotal();
participateTotal += m.getParticipateTotal();
}
if (null != currentAgency) {
participateUserTotal += currentAgency.getParticipateUserTotal();
participateTotal += currentAgency.getParticipateTotal();
}
returnDto.setParticipateTotal(participateTotal);
returnDto.setParticipateUserTotal(participateUserTotal);
@ -262,9 +247,9 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl<ScreenW
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());
orgIds.addAll(agencyInfoDTO.getSubAgencies().stream().map(agency->agency.getAgencyId()).collect(Collectors.toSet()));
orgIds.add(agencyInfoDTO.getCurrentAgencyId());
orgIds.addAll(agencyInfoDTO.getSubGrids().stream().map(grid->grid.getGridId()).collect(Collectors.toSet()));
List<VoluntaryServiceTrendDTO> list = screenWorkRecordOrgMonthlyDao.selectVoluntaryServiceTrendDTO(formDTO.getCustomerId(),
orgIds,
monthIdList.get(NumConstant.ZERO),

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml

@ -74,5 +74,22 @@
ORDER BY
fact.month_id ASC
</select>
<select id="selectAgencyScoreList" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult">
SELECT
ROUND(fact.score,1) AS "score",
fact.index_code ,
fact.WEIGHT,
fact.IS_TOTAL,
ROUND(fiasss.SELF_SCORE,1) AS "selfScore",
ROUND(fiasss.SUB_SCORE,1) AS "subScore"
FROM
fact_index_agency_score fact
LEFT JOIN fact_index_agency_self_sub_score fiasss ON fact.AGENCY_ID = fiasss.AGENCY_ID AND fact.INDEX_CODE = fiasss.PARENT_INDEX_CODE AND fact.MONTH_ID = fiasss.MONTH_ID
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.AGENCY_ID = #{orgId}
AND fact.month_id = #{monthId}
</select>
</mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml

@ -74,5 +74,22 @@
ORDER BY
fact.month_id ASC
</select>
<select id="selectComunityScoreList" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult">
SELECT
ROUND(fact.score,1) AS "score",
fact.index_code ,
fact.WEIGHT,
fact.IS_TOTAL,
ROUND(fiasss.SELF_SCORE,1) AS "selfScore",
ROUND(fiasss.SUB_SCORE,1) AS "subScore"
FROM
fact_index_community_score fact
LEFT JOIN fact_index_community_self_sub_score fiasss ON fact.AGENCY_ID = fiasss.AGENCY_ID AND fact.INDEX_CODE = fiasss.PARENT_INDEX_CODE AND fact.MONTH_ID = fiasss.MONTH_ID
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.AGENCY_ID = #{orgId}
AND fact.month_id = #{monthId}
</select>
</mapper>

17
epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml

@ -76,5 +76,22 @@
ORDER BY
fact.month_id ASC
</select>
<select id="selectGridScoreList" resultType="com.epmet.evaluationindex.index.result.IndexScoreResult">
SELECT
ROUND(fact.score,1) AS "score",
fact.index_code ,
fact.WEIGHT,
fact.IS_TOTAL,
ROUND(fiasss.SELF_SCORE,1) AS "selfScore",
ROUND(fiasss.SUB_SCORE,1) AS "subScore"
FROM
fact_index_grid_score fact
LEFT JOIN fact_index_grid_self_sub_score fiasss ON fact.GRID_ID = fiasss.GRID_ID AND fact.INDEX_CODE = fiasss.PARENT_INDEX_CODE AND fact.MONTH_ID = fiasss.MONTH_ID
WHERE
fact.del_flag = '0'
AND fact.customer_id = #{customerId}
AND fact.grid_id = #{orgId}
AND fact.month_id = #{monthId}
</select>
</mapper>

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

@ -3,19 +3,6 @@
<mapper namespace="com.epmet.datareport.dao.plugins.ScreenWorkRecordOrgDailyDao">
<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 in
<foreach item="customerId" collection="customerIds" open="(" separator="," close=")">
#{customerId}
</foreach>
</select>
<select id="selectSubList" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.AGENCY_ID AS orgId,
@ -91,33 +78,76 @@
</select>
<select id="selectCurrentAgency" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
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
IFNULL( sum( m.PARTICIPATE_USER_TOTAL ), 0 ) AS participateUserTotal,
IFNULL( sum( m.ORGANIZE_TOTAL ), 0 ) AS participateTotal
FROM
screen_customer_agency sca
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)
screen_work_record_org_daily m
inner join screen_customer_agency sca
on(m.ORG_ID=sca.AGENCY_ID)
WHERE
sca.DEL_FLAG = '0'
AND sca.AGENCY_ID=#{agencyId}
group by sca.AGENCY_ID,sca.AGENCY_NAME
ORDER BY
participateUserTotal DESC,
participateTotal DESC
m.DEL_FLAG = '0'
and sca.DEL_FLAG='0'
AND m.DATE_ID = #{dateId}
AND m.org_id = #{agencyId}
AND m.TYPE_CODE IN
<foreach item="typeCode" collection="typeCodeList" open="(" separator="," close=")">
#{typeCode}
</foreach>
</select>
<select id="selectCustomerTypeCode" parameterType="map" resultType="java.lang.String">
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}
</select>
<select id="selectUpToCalAgency" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.AGENCY_ID AS orgId,
sca.AGENCY_NAME AS `NAME`,
sum( m.PARTICIPATE_USER_TOTAL ) AS participateUserTotal,
sum( m.ORGANIZE_TOTAL ) AS participateTotal
FROM
screen_work_record_org_daily m
inner join screen_customer_agency sca
on(m.ORG_ID=sca.AGENCY_ID
and sca.DEL_FLAG='0'
AND sca.pids like concat('%',#{agencyId},'%')
)
WHERE
m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
AND m.TYPE_CODE IN
<foreach item="typeCode" collection="typeCodeList" open="(" separator="," close=")">
#{typeCode}
</foreach>
</select>
<select id="selectUpToCalGrid" parameterType="map" resultType="com.epmet.plugins.result.WorkRecordSubRank">
SELECT
sca.GRID_ID AS orgId,
sca.grid_name AS `NAME`,
sum( m.PARTICIPATE_USER_TOTAL ) AS participateUserTotal,
sum( m.ORGANIZE_TOTAL ) AS participateTotal
FROM
screen_work_record_org_daily m
inner join screen_customer_grid scg
on(m.ORG_ID=scg.grid_id
and scg.DEL_FLAG='0'
AND scg.ALL_PARENT_IDS like concat('%',#{agencyId},'%')
)
WHERE
m.DEL_FLAG = '0'
AND m.DATE_ID = #{dateId}
AND m.TYPE_CODE IN
<foreach item="typeCode" collection="typeCodeList" open="(" separator="," close=")">
#{typeCode}
</foreach>
</select>
</mapper>

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

@ -305,9 +305,10 @@
</choose>
</select>
<select id="selectSubAgencyIds" parameterType="map" resultType="java.lang.String">
<select id="selectSubAgencyIds" parameterType="map" resultType="com.epmet.dto.ScreenCustomerAgencyCommonDTO">
SELECT
sca.AGENCY_ID as orgId
sca.AGENCY_ID as agencyId,
sca.AGENCY_NAME as agencyName
FROM
screen_customer_agency sca
WHERE

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

@ -122,9 +122,10 @@
GROUP BY scg.PARENT_AGENCY_ID
</select>
<select id="selectSubGridIds" parameterType="map" resultType="java.lang.String">
<select id="selectSubGridIds" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridCommonDTO">
SELECT
m.GRID_ID as orgId
m.GRID_ID as gridId,
m.grid_name as gridName
FROM
screen_customer_grid m
where m.DEL_FLAG = '0'

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

@ -9,6 +9,12 @@
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility,
ROUND(service_ablity,1) serviceOriginScore,
ROUND(party_dev_ablity,1) partyOriginScore,
ROUND(govern_ablity,1) governOriginScore,
SERVICE_ABLITY_WEIGHT serviceAblityWeight,
PARTY_DEV_WEIGHT partyDevWeight,
GOVERN_ABLITY_WEIGHT governAblityWeight,
MONTH_ID
FROM
screen_index_data_monthly
@ -35,6 +41,9 @@
service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility,
party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility,
govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility,
ROUND(service_ablity,1) serviceOriginScore,
ROUND(party_dev_ablity,1) partyOriginScore,
ROUND(govern_ablity,1) governOriginScore,
SERVICE_ABLITY_WEIGHT as serviceAblityWeight,
PARTY_DEV_WEIGHT as partyDevWeight,
GOVERN_ABLITY_WEIGHT as governAblityWeight
@ -385,4 +394,73 @@
ORDER BY (sy.govern_ablity+sy.party_dev_ablity+sy.service_ablity) DESC
LIMIT #{topNum}
</select>
<select id="selectKczSubAgencyOrGridIndexMonthlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO"
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT
score.org_name AS `NAME`,
score.service_ablity * score.SERVICE_ABLITY_WEIGHT AS serviceAbility,
score.party_dev_ablity * score.PARTY_DEV_WEIGHT AS partyDevAbility,
score.govern_ablity * score.GOVERN_ABLITY_WEIGHT AS governAbility,
score.PARTY_DEV_WEIGHT AS partyWeight,
score.GOVERN_ABLITY_WEIGHT AS governWeight,
score.SERVICE_ABLITY_WEIGHT AS serviceWeight,
score.ORG_ID orgId,
score.ORG_TYPE orgType
FROM
screen_index_data_monthly score
WHERE score.del_flag = '0'
AND score.month_id = #{monthId,jdbcType=VARCHAR}
<if test="customerId != null and customerId != ''">
AND score.CUSTOMER_ID = #{customerId}
</if>
<if test="orgType != null and orgType != ''">
<choose>
<when test="orgType == 'grid'">
and score.ORG_ID in(
SELECT
scg.GRID_ID
FROM
screen_customer_grid scg
WHERE
scg.DEL_FLAG = '0'
AND scg.PARENT_AGENCY_ID = #{agencyId}
)
</when>
<when test="orgType == 'agency'">
and score.ORG_ID in(
SELECT
sca.AGENCY_ID
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
AND sca.PIDS LIKE concat(#{agencyId},'%')
AND sca.`LEVEL` = 'community'
)
</when>
<when test="orgType == 'department'">
and score.ORG_ID in(
SELECT
scd.DEPT_ID
FROM
screen_customer_dept scd
WHERE
scd.DEL_FLAG = '0'
AND scd.PARENT_AGENCY_ID = #{agencyId}
)
</when>
</choose>
</if>
<choose>
<when test="orgType != null and orgType != ''">
AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR}
</when>
<otherwise>
AND score.ORG_TYPE != 'department'
</otherwise>
</choose>
ORDER BY score.index_total ${sort}
LIMIT #{topNum}
</select>
</mapper>

67
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml

@ -65,4 +65,71 @@
ORDER BY index_total ${sort}
LIMIT #{topNum}
</select>
<select id="selectKczSubAgencyIndexYearlyRank" parameterType="com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankYMFormDTO"
resultType="com.epmet.evaluationindex.screen.dto.result.AnNingSubAgencyIndexRankResultDTO">
SELECT
score.org_name AS `NAME`,
score.govern_ablity AS governAbility,
score.party_dev_ablity AS partyDevAbility,
score.service_ablity AS serviceAbility,
score.ORG_ID orgId,
score.ORG_TYPE orgType
FROM
screen_index_data_yearly score
WHERE
score.del_flag = '0'
AND score.year_id = YEAR(CURDATE())
<if test="customerId != null and customerId != ''">
AND score.CUSTOMER_ID = #{customerId}
</if>
<if test="orgType != null and orgType != ''">
<choose>
<when test="orgType == 'grid'">
and score.ORG_ID in(
SELECT
scg.GRID_ID
FROM
screen_customer_grid scg
WHERE
scg.DEL_FLAG = '0'
AND scg.PARENT_AGENCY_ID = #{agencyId}
)
</when>
<when test="orgType == 'agency'">
and score.ORG_ID in(
SELECT
sca.AGENCY_ID
FROM
screen_customer_agency sca
WHERE
sca.DEL_FLAG = '0'
AND sca.PIDS LIKE concat(#{agencyId},'%')
AND sca.`LEVEL` = 'community'
)
</when>
<when test="orgType == 'department'">
and score.ORG_ID in(
SELECT
scd.DEPT_ID
FROM
screen_customer_dept scd
WHERE
scd.DEL_FLAG = '0'
AND scd.PARENT_AGENCY_ID = #{agencyId}
)
</when>
</choose>
</if>
<choose>
<when test="orgType != null and orgType != ''">
AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR}
</when>
<otherwise>
AND score.ORG_TYPE != 'department'
</otherwise>
</choose>
ORDER BY index_total ${sort}
LIMIT #{topNum}
</select>
</mapper>

4
epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml

@ -31,10 +31,10 @@
ifnull(sum(suj.JOIN_TOTAL),0) as total,
0 as monthIncr,
''as monthTrend,
round(IFNULL(sum(suj.avg_issue_fz)/sum(suj.avg_issue_fm),0)) as averageIssue,
round(IFNULL(sum(suj.avg_issue_fz)/sum(suj.avg_issue_fm),0),2) as averageIssue,
0 as issueCompareLatestMonth,
'' as issueCompareLatestTrend,
round(ifnull(sum(suj.avg_join_fz)/sum(suj.avg_join_fm),0))as averageJoin,
round(ifnull(sum(suj.avg_join_fz)/sum(suj.avg_join_fm),0),2)as averageJoin,
0 as joinCompareLatestMonth,
'' as joinCompareLatestTrend
FROM

2
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java

@ -1,6 +1,6 @@
package com.epmet.dto.indexcal;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import lombok.Data;
import java.io.Serializable;

8
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java

@ -18,6 +18,14 @@ public class ScreenWorkRecordCommonFormDTO implements Serializable {
* 组织Id或者网格id
*/
private String orgId;
/**
* org_id的上级
*/
private String pid;
/**
* org_id的所有上级英文冒号或者顿号隔开都可
*/
private String pids;
/**
* 组织名称或者网格名

20
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/UpdateProjectSatisfactionScoreFormDTO.java

@ -0,0 +1,20 @@
package com.epmet.dto.project.form;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 描述一下
*
* @author yinzuomei@elink-cn.com
* @date 2021/7/11 14:42
*/
@Data
public class UpdateProjectSatisfactionScoreFormDTO implements Serializable {
private static final long serialVersionUID = 8358341102854725024L;
private String projectId;
private String projectCustomerId;
private List<String> customerIdList;
}

5
epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java

@ -15,11 +15,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
package com.epmet.dto.screen;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**

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

@ -25,6 +25,7 @@ import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.extract.form.ExtractScreenFormDTO;
import com.epmet.dto.extract.form.SyncOrgInfoFormDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.project.form.UpdateProjectSatisfactionScoreFormDTO;
import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO;
import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO;
import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity;
@ -50,6 +51,7 @@ import com.epmet.service.stats.DimAgencyService;
import com.epmet.service.stats.DimCustomerPartymemberService;
import com.epmet.service.stats.DimCustomerService;
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.web.bind.annotation.*;
@ -127,9 +129,9 @@ public class DemoController {
@Autowired
private FactAgencyGovernDailyService factAgencyGovernDailyService;
@Autowired
private DimCustomerService dimCustomerService;
@Autowired
private FactGridMemberStatisticsDailyService factGridMemberStatisticsDailyService;
@Autowired
private DimCustomerService dimCustomerService;
@GetMapping("testAlarm")
public void testAlarm() {
@ -960,12 +962,23 @@ public class DemoController {
* @Date 2021/6/23 15:55
**/
@PostMapping("update-satisfaction-core")
public Result updateProjectSatisfactionScore(){
List<String> customerIds=dimCustomerService.getAllCustomerId();
customerIds.forEach(customerId->{
screenProjectSettleService.updateProjectSatisfactionScore(customerId,null,null);
log.info("更新完成");
});
public Result updateProjectSatisfactionScore(@RequestBody UpdateProjectSatisfactionScoreFormDTO formDTO){
if(StringUtils.isNotBlank(formDTO.getProjectId())){
screenProjectSettleService.updateProjectSatisfactionScore(formDTO.getProjectCustomerId(),null,formDTO.getProjectId());
return new Result().ok("项目满意度得分更新成功");
}
if(CollectionUtils.isNotEmpty(formDTO.getCustomerIdList())){
formDTO.getCustomerIdList().forEach(customerId->{
screenProjectSettleService.updateProjectSatisfactionScore(customerId,null,null);
log.info("更新完成");
});
}else{
List<String> customerIds=dimCustomerService.getAllCustomerId();
customerIds.forEach(customerId->{
screenProjectSettleService.updateProjectSatisfactionScore(customerId,null,null);
log.info("所有客户数据更新完成");
});
}
return new Result();
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java

@ -18,11 +18,11 @@
package com.epmet.dao.evaluationindex.screen;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.extract.result.OrgNameResultDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectGridDailyDTO;
import com.epmet.dto.screencoll.form.CustomerGridFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;

20
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java

@ -47,5 +47,23 @@ public interface ScreenProjectDataDao extends BaseDao<ScreenProjectDataEntity> {
void updateBatch(@Param("list") List<ScreenProjectDataDTO> list,@Param("dateId") String dateId);
int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score);
/**
* 根据项目ID删除数据
* @author zhaoqifeng
* @date 2021/7/9 17:33
* @param projectId
* @return int
*/
int deleteByProjectId(@Param("customerId") String customerId, @Param("projectId") String projectId);
/**
* 根据项目ID删除数据
* @author zhaoqifeng
* @date 2021/7/9 17:33
* @param list
* @return int
*/
void deleteByProjectIds(@Param("customerId") String customerId, @Param("list") List<String> list);
int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java

@ -37,4 +37,6 @@ public interface ScreenProjectImgDataDao extends BaseDao<ScreenProjectImgDataEnt
void deleteByProjectIds(@Param("list") List<String> list);
void insertBatch(@Param("list") List<ScreenProjectImgDataDTO> list);
int deleteByProjectId(@Param("customerId") String customerId, @Param("projectId") String projectId);
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java

@ -37,7 +37,6 @@ public interface ScreenUserJoinDao extends BaseDao<ScreenUserJoinEntity> {
* 11基层治理-公众参与
* 0) 查询上月的基础数据可用来计算本月的增长率
* @param customerId
* @param yearId
* @param monthId
* @param orgIds 组织Id集合
* @return java.util.List<com.epmet.entity.screen.ScreenUserJoinEntity>
@ -45,7 +44,6 @@ public interface ScreenUserJoinDao extends BaseDao<ScreenUserJoinEntity> {
* @Date 14:46 2020-08-21
**/
List<ScreenUserJoinEntity> selectLastMonthScreenUserJoinList(@Param("customerId") String customerId,
@Param("yearId") String yearId,
@Param("monthId") String monthId,
@Param("orgIds") String[] orgIds);

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

@ -163,6 +163,8 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
*/
String selectValueByKey(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey);
List<ProjectDTO> selectProjectListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("projectOrigin") String projectOrigin);
/**
* 计算某个项目的群满意度得分
*
@ -192,6 +194,4 @@ public interface ProjectDao extends BaseDao<ProjectEntity> {
List<String> selectClosedProjectIds(@Param("customerId")String customerId,
@Param("origin")String origin,
@Param("projectStatus")String projectStatus);
List<ProjectDTO> selectProjectListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("projectOrigin") String projectOrigin);
}

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

@ -363,14 +363,14 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (CollectionUtils.isNotEmpty(gridList)) {
list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getOrgId())).forEach(grid -> {
if (grid.getSum() != NumConstant.ZERO) {
entity.setGovernCount(grid.getCount());
entity.setClosedCount(grid.getSum());
BigDecimal resolveCount = new BigDecimal(grid.getSum());
BigDecimal selfCount = new BigDecimal(grid.getCount());
BigDecimal ratio = selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setGovernCount(grid.getCount());
entity.setClosedCount(grid.getSum());
entity.setGovernRatio(ratio);
}
}));
@ -543,13 +543,13 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
if (dto.getSum() != NumConstant.ZERO) {
BigDecimal sum = new BigDecimal(dto.getSum());
BigDecimal count = new BigDecimal(dto.getCount());
entity.setSatisfactionCount(dto.getCount());
entity.setClosedProjectCount(dto.getSum());
BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP);
if (ratio.compareTo(hundred) > 0) {
ratio = hundred;
}
entity.setSatisfactionRatio(ratio);
entity.setSatisfactionCount(dto.getCount());
entity.setClosedProjectCount(dto.getSum());
}
}));
}
@ -568,6 +568,7 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe
entity.setResponseRatio(ratio);
entity.setResponseCount(dto.getCount());
entity.setTransferCount(dto.getSum());
}
}));
}

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

@ -286,13 +286,13 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
entity.setJoinTotal(0);
entity.setJoinTotalUpRate(new BigDecimal("0"));
entity.setJoinTotalUpFlag("");
entity.setJoinTotalUpFlag(GovernConstant.EQ);
entity.setAvgIssue(new BigDecimal(0));
entity.setAvgIssueUpRate(new BigDecimal("0"));
entity.setAvgIssueUpFlag("");
entity.setAvgIssueUpFlag(GovernConstant.EQ);
entity.setAvgJoin(new BigDecimal(0));
entity.setAgvgJoinUpRate(new BigDecimal("0"));
entity.setAgvgJoinUpFlag("");
entity.setAgvgJoinUpFlag(GovernConstant.EQ);
entity.setAvgIssueFz(NumConstant.ZERO);
entity.setAvgIssueFm(NumConstant.ZERO);
entity.setAvgJoinFz(NumConstant.ZERO);
@ -536,10 +536,18 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
// 总的参与次数较上月增长率
if (l.getJoinTotal() > s.getJoinTotal()) {
l.setJoinTotalUpFlag(GovernConstant.INCR);
l.setJoinTotalUpRate(new BigDecimal(((l.getJoinTotal() - s.getJoinTotal()) / s.getJoinTotal()) * NumConstant.ONE_HUNDRED).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
if (s.getJoinTotal().compareTo(NumConstant.ZERO) == 0){
l.setJoinTotalUpRate(NumConstant.ONE_HUNDRED_DECIMAL);
}else {
l.setJoinTotalUpRate(new BigDecimal(((l.getJoinTotal() - s.getJoinTotal()) / s.getJoinTotal()) * NumConstant.ONE_HUNDRED).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
}
} else if (l.getJoinTotal() < s.getJoinTotal()) {
l.setJoinTotalUpFlag(GovernConstant.DECR);
l.setJoinTotalUpRate(new BigDecimal(((l.getJoinTotal() - s.getJoinTotal()) / s.getJoinTotal()) * NumConstant.ONE_HUNDRED).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
if (s.getJoinTotal().compareTo(NumConstant.ZERO) == 0){
l.setJoinTotalUpRate(NumConstant.ONE_HUNDRED_DECIMAL);
}else {
l.setJoinTotalUpRate(new BigDecimal(((l.getJoinTotal() - s.getJoinTotal()) / s.getJoinTotal()) * NumConstant.ONE_HUNDRED).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
}
} else {
l.setJoinTotalUpFlag(GovernConstant.EQ);
l.setJoinTotalUpRate(NumConstant.ZERO_DECIMAL);
@ -548,10 +556,18 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
Integer re = l.getAvgIssue().compareTo(s.getAvgIssue());
if (re.equals(NumConstant.ONE)) {
l.setAvgIssueUpFlag(GovernConstant.INCR);
l.setAvgIssueUpRate(l.getAvgIssue().subtract(s.getAvgIssue()).divide(s.getAvgIssue()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
if (s.getAvgIssue().compareTo(NumConstant.ZERO_DECIMAL) == 0){
l.setAvgIssueUpRate(NumConstant.ONE_HUNDRED_DECIMAL);
}else {
l.setAvgIssueUpRate(l.getAvgIssue().subtract(s.getAvgIssue()).divide(s.getAvgIssue(),NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
}
} else if (re.equals(NumConstant.ONE_NEG)) {
l.setAvgIssueUpFlag(GovernConstant.DECR);
l.setAvgIssueUpRate(l.getAvgIssue().subtract(s.getAvgIssue()).divide(s.getAvgIssue()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
if (s.getAvgIssue().compareTo(NumConstant.ZERO_DECIMAL) == 0){
l.setAvgIssueUpRate(NumConstant.ONE_HUNDRED_DECIMAL);
}else {
l.setAvgIssueUpRate(l.getAvgIssue().subtract(s.getAvgIssue()).divide(s.getAvgIssue(),NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
}
} else {
l.setAvgIssueUpFlag(GovernConstant.EQ);
l.setAvgIssueUpRate(NumConstant.ZERO_DECIMAL);
@ -560,12 +576,20 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService {
Integer avgJoinRe = l.getAvgJoin().compareTo(s.getAvgJoin());
if (avgJoinRe.equals(NumConstant.ONE)) {
l.setAgvgJoinUpFlag(GovernConstant.INCR);
l.setAgvgJoinUpRate(l.getAvgJoin().subtract(s.getAvgJoin()).divide(s.getAvgJoin()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
if (s.getAvgJoin().compareTo(NumConstant.ZERO_DECIMAL) == 0){
l.setAgvgJoinUpRate(NumConstant.ONE_HUNDRED_DECIMAL);
}else {
l.setAgvgJoinUpRate(l.getAvgJoin().subtract(s.getAvgJoin()).divide(s.getAvgJoin(),NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
}
} else if (avgJoinRe.equals(NumConstant.ONE_NEG)) {
l.setAvgIssueUpFlag(GovernConstant.DECR);
l.setAgvgJoinUpRate(l.getAvgJoin().subtract(s.getAvgJoin()).divide(s.getAvgJoin()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
l.setAgvgJoinUpFlag(GovernConstant.DECR);
if (s.getAvgJoin().compareTo(NumConstant.ZERO_DECIMAL) == 0){
l.setAgvgJoinUpRate(NumConstant.ONE_HUNDRED_DECIMAL);
}else {
l.setAgvgJoinUpRate(l.getAvgJoin().subtract(s.getAvgJoin()).divide(s.getAvgJoin(),NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP));
}
} else {
l.setAvgIssueUpFlag(GovernConstant.EQ);
l.setAgvgJoinUpFlag(GovernConstant.EQ);
l.setAgvgJoinUpRate(NumConstant.ZERO_DECIMAL);
}
}

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

@ -182,25 +182,32 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic
*/
@Override
public void updateProjectSatisfactionScore(String customerId, String dateId,String projectId) {
log.info("customerId="+customerId+";dateId="+dateId+";projectId="+projectId);
if(StringUtils.isNotBlank(projectId)){
projectService.calProjectSatisfactionScore(customerId,projectId);
BigDecimal calProjectSatisfactionScore = projectService.calProjectSatisfactionScore(customerId, projectId);
log.warn("单独计算projectId=" + projectId + "满意度得分:" + calProjectSatisfactionScore);
targetDbService.updateProjectSatisfactionScore(projectId,calProjectSatisfactionScore);
return;
}
List<String> projectIds=new ArrayList<>();
if(StringUtils.isNotBlank(dateId)){
log.warn("按日期计算");
List<String> list=projectService.selectEvaluateProjectIds(customerId,dateId);
if(!CollectionUtils.isEmpty(list)){
projectIds.addAll(list);
}
}else{
log.warn("计算当前客户下,来源于议题已结案的项目对应的满意度得分");
// 只有来源于议题的项目,才有分数
List<String> closedProjectIds=projectService.selectClosedProjectIds(customerId,"issue","closed");
if(!CollectionUtils.isEmpty(closedProjectIds)){
projectIds.addAll(closedProjectIds);
}
}
projectIds.forEach(id->{
targetDbService.updateProjectSatisfactionScore(id,projectService.calProjectSatisfactionScore(customerId,id));
projectIds.forEach(id -> {
BigDecimal calProjectSatisfactionScore = projectService.calProjectSatisfactionScore(customerId, id);
log.warn("projectId=" + id + "满意度得分:" + calProjectSatisfactionScore);
targetDbService.updateProjectSatisfactionScore(id, calProjectSatisfactionScore);
});
}

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java

@ -1,8 +1,8 @@
package com.epmet.service.evaluationindex.indexcal;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
import com.epmet.dto.indexcal.PageQueryGridFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.support.normalizing.batch.CalculateResult;
import com.epmet.support.normalizing.batch.IndexInputVO;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java

@ -19,8 +19,8 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDa
import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao;
import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.indexcal.*;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity;
import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity;

2
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java

@ -16,7 +16,6 @@ import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao;
import com.epmet.dao.evaluationindex.indexcal.GridScoreDao;
import com.epmet.dao.evaluationindex.indexcoll.*;
import com.epmet.dao.evaluationindex.screen.*;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.result.AgencyMonthCountResultDTO;
import com.epmet.dto.indexcal.AgencyScoreDTO;
import com.epmet.dto.indexcal.CalculateCommonFormDTO;
@ -24,6 +23,7 @@ import com.epmet.dto.indexcal.DeptScoreDTO;
import com.epmet.dto.indexcollect.form.*;
import com.epmet.dto.screen.FactIndexCommunityScoreDTO;
import com.epmet.dto.screen.FactIndexGridScoreDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO;
import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity;

4
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java

@ -19,10 +19,10 @@ package com.epmet.service.evaluationindex.screen;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectGridDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;
@ -102,7 +102,7 @@ public interface ScreenCustomerGridService extends BaseService<ScreenCustomerGri
* @author zxc
* @date 2021/3/23 下午4:02
*/
List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId,String level);
List<ScreenCustomerGridDTO> selectBelongGridInfo(String customerId, String level);
Integer updateCenterPointByName(String customerId, String title, List<Double> center);

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

@ -27,10 +27,10 @@ import com.epmet.commons.tools.utils.DateUtils;
import com.epmet.constant.DataSourceConstant;
import com.epmet.constant.OrgSourceTypeConstant;
import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.form.*;
import com.epmet.dto.extract.result.GridInfoResultDTO;
import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectGridDailyDTO;
import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity;
import com.epmet.entity.org.CustomerGridEntity;

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

@ -30,8 +30,8 @@ import com.epmet.constant.PingYinConstant;
import com.epmet.constant.ScreenConstant;
import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao;
import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao;
import com.epmet.dto.ScreenCustomerGridDTO;
import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO;
import com.epmet.dto.screen.ScreenCustomerGridDTO;
import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO;
import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO;
import com.epmet.dto.screen.result.CategoryProjectResultDTO;

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

@ -168,14 +168,8 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl<ScreenProjectD
}
}
//先删除该projectId对应的旧数据
QueryWrapper<ScreenProjectDataEntity> deleteWrapper = new QueryWrapper<>();
deleteWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId())
.eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId());
baseDao.delete(deleteWrapper);
QueryWrapper<ScreenProjectImgDataEntity> screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>();
screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId())
.eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId());
screenProjectImgDataDao.delete(screenProjectImgDataEntityQueryWrapper);
baseDao.deleteByProjectId(param.getCustomerId(), item.getProjectId());
screenProjectImgDataDao.deleteByProjectId(param.getCustomerId(), item.getProjectId());
//如果orgType未知,获取一下
// if ("unknown".equals(item.getOrgType())){

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

@ -72,7 +72,6 @@ public class ScreenUserJoinServiceImpl extends BaseServiceImpl<ScreenUserJoinDao
DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(DateUtils.addDateMonths(DateUtils.stringToDate(formDTO.getMonthId(), DateUtils.DATE_PATTERN_YYYYMM), -1));
// 获取上个月的基本数据
List<ScreenUserJoinEntity> lastMonthJoinList = baseDao.selectLastMonthScreenUserJoinList(formDTO.getCustomerId(),
dimIdBean.getYearId(),
dimIdBean.getMonthId(),
orgIds);

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

@ -22,6 +22,7 @@ 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.DateUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.constant.CompareConstant;
import com.epmet.constant.DataSourceConstant;
@ -35,6 +36,7 @@ import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity;
import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity;
import com.epmet.service.evaluationindex.screen.ScreenEventImgDataService;
import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.ListUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -54,6 +56,7 @@ import java.util.stream.Collectors;
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-05-11
*/
@Slf4j
@Service
@DataSource(DataSourceConstant.EVALUATION_INDEX)
public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
@ -374,34 +377,36 @@ public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService {
orgIds[i] = formDTO.getDataList().get(i).getOrgId();
}
String[] lastMonth = this.lastMonthDate();
/*String[] lastMonth = this.lastMonthDate();
// 获取上个月的基本数据
String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE];
String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE];*/
String monthId= DateUtils.getBeforeNMonthByMonth(1,formDTO.getMonthId());
List<ScreenUserJoinEntity> lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId,
lastMonth[NumConstant.ZERO],
moneth,
monthId,
orgIds);
// 定义本月待添加数据的集合
List<ScreenUserJoinEntity> curMonthJoinEntityList = new ArrayList<>();
// 增加率计算
if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO) {
log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId的上月已有数据集合长度="+lastMonthJoinList.size());
// 存在上个月的数据 (本月-上月)/上月 *100
for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) {
for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++) {
if (formDTO.getDataList().get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())) {
ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.getDataList().get(i), ScreenUserJoinEntity.class);
entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.getDataList().get(j).getJoinTotal()));
entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.getDataList().get(j).getJoinTotal()));
entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.getDataList().get(j).getAvgIssue()));
entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.getDataList().get(j).getAvgIssue()));
entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.getDataList().get(j).getAvgJoin()));
entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.getDataList().get(j).getAvgJoin()));
entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(j).getJoinTotal(), formDTO.getDataList().get(i).getJoinTotal()));
entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(j).getJoinTotal(), formDTO.getDataList().get(i).getJoinTotal()));
entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(j).getAvgIssue(), formDTO.getDataList().get(i).getAvgIssue()));
entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(j).getAvgIssue(), formDTO.getDataList().get(i).getAvgIssue()));
entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(j).getAvgJoin(), formDTO.getDataList().get(i).getAvgJoin()));
entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(j).getAvgJoin(), formDTO.getDataList().get(i).getAvgJoin()));
curMonthJoinEntityList.add(entity);
}
}
}
} else {
log.info("当前传入的monthId="+formDTO.getMonthId()+";数据集合长度="+formDTO.getDataList()+";当前monthId上月不存在数据。");
// 计算增长率后的 待新增数据
BigDecimal zero = new BigDecimal(NumConstant.ZERO);
// 不存在上个月的数据

25
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java

@ -34,6 +34,7 @@ import org.springframework.util.CollectionUtils;
import java.util.Calendar;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.concurrent.atomic.AtomicReference;
@ -170,9 +171,12 @@ public class StatsUserServiceImpl implements StatsUserService {
//3.分批处理上传数据
List<List<GmUploadEventFormDTO.DataList>> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
for (int i = 0; i < partition.size(); i++) {
List<GmUploadEventFormDTO.DataList> p = partition.get(i);
//4.封装数据并执行
p.forEach(m -> {
Iterator<GmUploadEventFormDTO.DataList> iterator = p.iterator();
while (iterator.hasNext()) {
GmUploadEventFormDTO.DataList m = iterator.next();
AtomicReference<Boolean> bl = new AtomicReference<>(false);
StringBuffer gridPids = new StringBuffer("");
agencyList.forEach(ag -> {
@ -190,13 +194,14 @@ public class StatsUserServiceImpl implements StatsUserService {
m.setLatestPatrolStatus("end");
} else {
log.warn(String.format("网格员事件总数上报,数据错误,根据agencyId未查询到组织信息,客户Id->%s,组织Id->%s", m.getCustomerId(), m.getAgencyId()));
iterator.remove();
}
});
}
//批量新增或修改数据
if (!CollectionUtils.isEmpty(p)) {
userService.saveOrUpGmUploadEvent(p);
}
});
}
}
@ -227,9 +232,12 @@ public class StatsUserServiceImpl implements StatsUserService {
//3.分批处理上传数据
List<List<GmUploadDataFormDTO.DataList>> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED);
partition.forEach(p -> {
for (int i = 0; i < partition.size(); i++) {
List<GmUploadDataFormDTO.DataList> p = partition.get(i);
//4.封装数据并执行
p.forEach(m -> {
Iterator<GmUploadDataFormDTO.DataList> iterator = p.iterator();
while (iterator.hasNext()) {
GmUploadDataFormDTO.DataList m = iterator.next();
AtomicReference<Boolean> bl = new AtomicReference<>(false);
StringBuffer pid = new StringBuffer("");
StringBuffer pids = new StringBuffer("");
@ -247,13 +255,14 @@ public class StatsUserServiceImpl implements StatsUserService {
m.setPids(pids.toString());
} else {
log.warn(String.format("网格员数据分析上报,数据错误,根据agencyId未查询到组织信息,客户Id->%s,组织Id->%s", m.getCustomerId(), m.getAgencyId()));
iterator.remove();
}
});
}
//批量新增或修改数据
if (!CollectionUtils.isEmpty(p)) {
dataStatsDao.saveOrUpGmUploadData(p);
}
});
}
}

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

@ -163,6 +163,7 @@ public interface ProjectService extends BaseService<ProjectEntity> {
*/
List<FactOriginProjectMainDailyEntity> getProjectSatisfaction(String customerId);
List<ProjectDTO> selectProjectListByDateId(String customerId, String yesterdayStr, String projectOriginAgency);
/**
* 计算某个项目的群满意度得分
*
@ -190,5 +191,4 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @return
*/
List<String> selectClosedProjectIds(String customerId,String origin ,String projectStatus);
List<ProjectDTO> selectProjectListByDateId(String customerId, String yesterdayStr, String projectOriginAgency);
}

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

@ -197,6 +197,11 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
}).collect(Collectors.toList());
}
@Override
public List<ProjectDTO> selectProjectListByDateId(String customerId, String dateId, String projectOrigin) {
return baseDao.selectProjectListByDateId(customerId,dateId,projectOrigin);
}
/**
* 计算某个项目的群满意度得分
*
@ -234,10 +239,5 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
return baseDao.selectClosedProjectIds(customerId,origin,projectStatus);
}
@Override
public List<ProjectDTO> selectProjectListByDateId(String customerId, String dateId, String projectOrigin) {
return baseDao.selectProjectListByDateId(customerId,dateId,projectOrigin);
}
}

12
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml

@ -65,7 +65,7 @@
</select>
<!-- 查询客户下网格信息 -->
<select id="selectListByCustomerId" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectListByCustomerId" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
m.GRID_ID,
m.CUSTOMER_ID,
@ -78,7 +78,7 @@
</select>
<!-- 分页查询网格列表 -->
<select id="pageListByCustomerId" resultType="com.epmet.dto.ScreenCustomerGridDTO" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO">
<select id="pageListByCustomerId" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO" parameterType="com.epmet.dto.indexcal.PageQueryGridFormDTO">
SELECT
m.GRID_ID,
m.CUSTOMER_ID,
@ -93,7 +93,7 @@
</select>
<!-- -->
<select id="selectParentAgencyId" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectParentAgencyId" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
PARENT_AGENCY_ID,
ALL_PARENT_IDS
@ -104,7 +104,7 @@
AND m.GRID_ID = #{gridId}
</select>
<select id="selectListMismatchGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectListMismatchGridInfo" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
GRID_ID gridId,
GRID_NAME gridName,
@ -130,7 +130,7 @@
</if>
</select>
<select id="selectListGridInfo" parameterType="map" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectListGridInfo" parameterType="map" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
GRID_ID gridId,
GRID_NAME gridName,
@ -361,7 +361,7 @@
</select>
<!-- 查询直属网格信息 -->
<select id="selectBelongGridInfo" resultType="com.epmet.dto.ScreenCustomerGridDTO">
<select id="selectBelongGridInfo" resultType="com.epmet.dto.screen.ScreenCustomerGridDTO">
SELECT
sca.AGENCY_ID AS PID,
sca.PIDS,

14
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml

@ -46,6 +46,20 @@
and DATE_FORMAT(PROJECT_CREATE_TIME,'%Y%m%d') = #{dateId}
limit 1000
</delete>
<delete id="deleteByProjectId">
delete from screen_project_data
where PROJECT_ID = #{projectId}
AND customer_id = #{customerId}
</delete>
<delete id="deleteByProjectIds">
delete from screen_project_data
where 1=1
AND customer_id = #{customerId}
<foreach collection="list" item="projectId" open="AND (" separator=" OR " close=" )">
PROJECT_ID = #{projectId}
</foreach>
</delete>
<select id="checkIfExisted" resultType="int">
select count(id) from screen_project_data

5
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml

@ -26,6 +26,11 @@
</foreach>
</where>
</delete>
<delete id="deleteByProjectId">
delete from screen_project_img_data
where PROJECT_ID = #{projectId}
and customer_id = #{customerId}
</delete>
<insert id="insertBatch" parameterType="java.util.List">

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

@ -13,7 +13,7 @@
AVG_ISSUE avgIssue,
AVG_JOIN avgJoin
from screen_user_join
where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId}
where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId}
AND ORG_ID IN
<foreach item="item" collection="orgIds" open="(" separator="," close=")">
#{item}

4
epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml

@ -17,6 +17,8 @@
customer_id,
DATE_ID,
org_id,
pid,
pids,
org_name,
meeting_code,
type_code,
@ -36,6 +38,8 @@
#{customerId},
#{dateId},
#{item.orgId},
#{item.pid},
#{item.pids},
#{item.orgName},
#{item.meetingCode},
#{item.typeCode},

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

@ -163,6 +163,13 @@
and CUSTOMER_ID = #{customerId}
and PARAMETER_KEY = #{parameterKey}
</select>
<select id="selectProjectListByDateId" resultType="com.epmet.dto.ProjectDTO">
SELECT * FROM project
WHERE customer_id = #{customerId}
AND ORIGIN = #{projectOrigin}
AND del_flag = '0'
AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
<!-- 计算某个项目的群满意度得分 -->
<select id="selectProjectSatisfactionScore" parameterType="map" resultType="java.math.BigDecimal">
@ -188,7 +195,7 @@
<!-- 查询当天(dateId)有评价记录的项目id -->
<select id="selectEvaluateProjectIds" parameterType="map" resultType="java.lang.String">
SELECT
psd.PROJECT_ID
distinct psd.PROJECT_ID
FROM
project_satisfaction_detail psd
WHERE
@ -213,11 +220,4 @@
AND p.ORIGIN =#{origin}
</if>
</select>
<select id="selectProjectListByDateId" resultType="com.epmet.dto.ProjectDTO">
SELECT * FROM project
WHERE customer_id = #{customerId}
AND ORIGIN = #{projectOrigin}
AND del_flag = '0'
AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId}
</select>
</mapper>

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

@ -0,0 +1,21 @@
package com.epmet.service;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.StartPatrolFormDTO;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/7/12 17:39
*/
public interface StaffPatrolService {
/**
* 结束巡查
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2021/7/12 17:40
*/
Result endPatrol(StartPatrolFormDTO formDTO);
}

33
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StaffPatrolServiceImpl.java

@ -0,0 +1,33 @@
package com.epmet.service.impl;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.StartPatrolFormDTO;
import com.epmet.feign.EpmetUserOpenFeignClient;
import com.epmet.service.StaffPatrolService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/7/12 17:40
*/
@Service
public class StaffPatrolServiceImpl implements StaffPatrolService {
@Resource
private EpmetUserOpenFeignClient epmetUserOpenFeignClient;
/**
* 结束巡查
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2021/7/12 17:40
*/
@Override
public Result endPatrol(StartPatrolFormDTO formDTO) {
return epmetUserOpenFeignClient.endPatrolJob(formDTO);
}
}

40
epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EndPatrolTask.java

@ -0,0 +1,40 @@
package com.epmet.task;
import com.alibaba.fastjson.JSON;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.extract.form.ExtractOriginFormDTO;
import com.epmet.dto.form.StartPatrolFormDTO;
import com.epmet.service.StaffPatrolService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
/**
* @author zhaoqifeng
* @dscription
* @date 2021/7/12 17:36
*/
@Component("endPatrolTask")
@Slf4j
public class EndPatrolTask implements ITask {
@Resource
private StaffPatrolService staffPatrolService;
@Override
public void run(String params) {
log.info("EndPatrolTask定时任务正在执行,参数为:{}", params);
ExtractOriginFormDTO dto = new ExtractOriginFormDTO();
StartPatrolFormDTO formDTO = new StartPatrolFormDTO();
if (StringUtils.isNotBlank(params)) {
dto = JSON.parseObject(params, ExtractOriginFormDTO.class);
formDTO.setCustomerId(dto.getCustomerId());
}
Result result = staffPatrolService.endPatrol(formDTO);
if (result.success()) {
log.info("EndPatrolTask定时任务执行成功");
} else {
log.error("EndPatrolTask定时任务执行失败:" + result.getMsg());
}
}
}

5
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java

@ -10,10 +10,10 @@ import com.epmet.dto.form.AuditedPartyMemberFormDTO;
import com.epmet.dto.form.AuditingPartyMemberFormDTO;
import com.epmet.dto.form.CertifiedDetailFormDTO;
import com.epmet.dto.form.CertifiedFormDTO;
import com.epmet.dto.result.CertifiedDetailResultDTO;
import com.epmet.dto.result.CertifiedResultDTO;
import com.epmet.dto.result.AuditedPartyMemberResultDTO;
import com.epmet.dto.result.AuditingPartyMemberResultDTO;
import com.epmet.dto.result.CertifiedDetailResultDTO;
import com.epmet.dto.result.CertifiedResultDTO;
import com.epmet.resi.partymember.dto.partymember.form.AuditingDetailFromDTO;
import com.epmet.resi.partymember.dto.partymember.form.AutoFailedDetailFromDTO;
import com.epmet.resi.partymember.dto.partymember.form.PartyMemberConfirmFromDTO;
@ -122,6 +122,7 @@ public class ResiPartyMemberController {
@PostMapping("auditingdetail")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PARTYAUTH_AUDITING_DETAIL)
public Result<AuditingDetailResultDTO> auditingDetail(@RequestBody AuditingDetailFromDTO fromDTO) {
ValidatorUtils.validateEntity(fromDTO);
return resiPartyMemberService.auditingDetail(fromDTO);
}

15
epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java

@ -9,11 +9,10 @@ import com.epmet.dto.form.AuditedPartyMemberFormDTO;
import com.epmet.dto.form.AuditingPartyMemberFormDTO;
import com.epmet.dto.form.CertifiedDetailFormDTO;
import com.epmet.dto.form.CertifiedFormDTO;
import com.epmet.dto.result.CertifiedDetailResultDTO;
import com.epmet.dto.result.CertifiedResultDTO;
import com.epmet.feign.ResiPartymemberFeignClient;
import com.epmet.dto.result.AuditedPartyMemberResultDTO;
import com.epmet.dto.result.AuditingPartyMemberResultDTO;
import com.epmet.dto.result.CertifiedDetailResultDTO;
import com.epmet.dto.result.CertifiedResultDTO;
import com.epmet.feign.ResiPartymemberFeignClient;
import com.epmet.resi.partymember.dto.partymember.form.*;
import com.epmet.resi.partymember.dto.partymember.result.*;
@ -23,8 +22,6 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.ArrayList;
import java.util.List;
@ -45,11 +42,11 @@ public class ResiPartyMemberServiceImpl implements ResiPartyMemberService {
UnderReviewParyMemberFormDTO underReviewParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, UnderReviewParyMemberFormDTO.class);
Result<List<UnderReviewParyMemberResultDTO>> result = resiPartymemberFeignClient.auditingPartyMember(underReviewParyMemberFormDTO);
if (!result.success()) {
logger.error(String.format("调用%s服务查询单元认证-待审核列表失败,入参网格id[%s],错误码%s,错误提示%s", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId(), result.getCode(), result.getMsg()));
logger.warn(String.format("调用%s服务查询单元认证-待审核列表失败,入参网格id[%s],错误码%s,错误提示%s", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId(), result.getCode(), result.getMsg()));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
if (null == result.getData() || result.getData().isEmpty()) {
logger.info(String.format("调用%s服务查询党员认证-待审核列表,入参网格id[%s],待审核党员列表查询为空", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId()));
logger.warn(String.format("调用%s服务查询党员认证-待审核列表,入参网格id[%s],待审核党员列表查询为空", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId()));
return list;
}
list = ConvertUtils.sourceToTarget(result.getData(), AuditingPartyMemberResultDTO.class);
@ -62,11 +59,11 @@ public class ResiPartyMemberServiceImpl implements ResiPartyMemberService {
ReviewedParyMemberFormDTO reviewedParyMemberFormDTO = ConvertUtils.sourceToTarget(formDTO, ReviewedParyMemberFormDTO.class);
Result<List<ReviewedParyMemberResultDTO>> result = resiPartymemberFeignClient.auditedPartyMember(reviewedParyMemberFormDTO);
if (!result.success()) {
logger.error(String.format("调用%s服务查询党员认证-审核历史列表失败,入参网格id[%s],错误码%s,错误提示%s", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId(), result.getCode(), result.getMsg()));
logger.warn(String.format("调用%s服务查询党员认证-审核历史列表失败,入参网格id[%s],错误码%s,错误提示%s", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId(), result.getCode(), result.getMsg()));
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
}
if (null == result.getData() || result.getData().isEmpty()) {
logger.info(String.format("调用%s服务查询党员认证-审核历史列表为空,入参网格id[%s],待审核党员列表查询为空", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId()));
logger.warn(String.format("调用%s服务查询党员认证-审核历史列表为空,入参网格id[%s],待审核党员列表查询为空", ServiceConstant.RESI_PARTYMEMBER_SERVER, formDTO.getGridId()));
return list;
}
list = ConvertUtils.sourceToTarget(result.getData(), AuditedPartyMemberResultDTO.class);

3
epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java

@ -2,6 +2,7 @@ package com.epmet.resi.partymember.dto.partymember.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
@ -12,9 +13,11 @@ import java.io.Serializable;
@Data
public class AuditingDetailFromDTO implements Serializable {
private static final long serialVersionUID = 1L;
public interface AddUserInternalGroup {}
/**
* 党员认证信息表ID
*/
@NotBlank(message = "党员认证信息表ID",groups =AddUserInternalGroup.class)
private String partyMemberId;
/**

24
epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java

@ -374,17 +374,6 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
resultDTO.setAutoId(fromDTO.getAutoId());
resultDTO.setManualId(fromDTO.getManualId());
//获取人工审核信息
PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId());
if(null!=manualEntity){
//人工审核信息设为已读
manualEntity.setReadFlag(PartyMemberConstant.READ);
partymemberConfirmManualService.updateById(manualEntity);
}else{
log.error(String.format("入参%s,查询partymember_confirm_manual为空", JSON.toJSONString(fromDTO)));
throw new RenException("数据异常,根据manualId查询partymember_confirm_manual为空");
}
//获取党员认证信息
PartymemberInfoEntity partyMemberInfoEntity = partymemberInfoService.selectById(fromDTO.getPartyMemberId());
resultDTO.setUserId(partyMemberInfoEntity.getUserId());
@ -392,8 +381,19 @@ public class PartyMemberConfirmServiceImpl implements PartyMemberConfirmService
resultDTO.setIdCard(partyMemberInfoEntity.getIdCard());
resultDTO.setMobile(partyMemberInfoEntity.getMobile());
resultDTO.setAddress(partyMemberInfoEntity.getStreet() + partyMemberInfoEntity.getEstate() + partyMemberInfoEntity.getBuilding());
resultDTO.setCertifyTime(manualEntity.getCreatedTime().getTime()/1000);
resultDTO.setCertifyTime(partyMemberInfoEntity.getCreatedTime().getTime() / 1000);
//获取人工审核信息
PartymemberConfirmManualEntity manualEntity = partymemberConfirmManualService.selectById(fromDTO.getManualId());
if(null!=manualEntity){
//人工审核信息设为已读
manualEntity.setReadFlag(PartyMemberConstant.READ);
resultDTO.setCertifyTime(manualEntity.getCreatedTime().getTime()/1000);
partymemberConfirmManualService.updateById(manualEntity);
}else{
log.warn(String.format("入参%s,查询partymember_confirm_manual为空", JSON.toJSONString(fromDTO)));
// throw new RenException("数据异常,根据manualId("+fromDTO.getManualId()+")查询partymember_confirm_manual为空");
}
//获取党员自动认证信息
List<String> failedReason = new ArrayList<>();

7
epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml

@ -82,17 +82,18 @@
pi.USER_ID AS userId,
concat( pi.SURNAME, pi.NAME ) AS realName,
unix_timestamp(pi.CREATED_TIME) AS applyTime,
pcm.READ_FLAG AS readFlag,
IFNULL(pcm.READ_FLAG,'') AS readFlag,
pi.id as partyMemberId,
pca.id as autoId,
pcm.id as manualId
IFNULL(pcm.id,'') as manualId
FROM
partymember_info pi
LEFT JOIN partymember_confirm_manual pcm ON ( pi.id = pcm.PARTYMEMBER_INFO_ID AND pcm.DEL_FLAG = '0'and pcm.AUDIT_STATUS='under_auditting')
LEFT JOIN partymember_confirm_manual pcm ON ( pi.id = pcm.PARTYMEMBER_INFO_ID AND pcm.DEL_FLAG = '0')
LEFT JOIN partymember_confirm_auto pca ON(pi.id=pca.PARTYMEMBER_INFO_ID AND pca.del_flag='0')
WHERE
pi.DEL_FLAG = '0'
AND pi.CONFIRM_RESULT = 'auto_confirm_failed'
AND pcm.AUDIT_STATUS='under_auditting'
AND pi.EXTRA_ORGANIZATION IS NOT NULL
AND pi.GRID_ID = #{gridId}
ORDER BY

2
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StartPatrolFormDTO.java

@ -39,4 +39,6 @@ public class StartPatrolFormDTO implements Serializable {
private String staffPatrolRecId;
private String patrolEndTime;
private String customerId;
}

13
epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java

@ -62,4 +62,17 @@ public class CertificationDetailResultDTO implements Serializable {
* 审核记录ID
*/
private String recordId;
public CertificationDetailResultDTO() {
this.surname = "";
this.name = "";
this.idcard = "";
this.isCertificated = "";
this.mobile = "";
this.certificationImg = "";
this.remark = "";
this.authResult = "";
this.authReason = "";
this.recordId = "";
}
}

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

@ -595,4 +595,14 @@ public interface EpmetUserOpenFeignClient {
*/
@PostMapping("/epmetuser/staffrole/getroles")
Result<CustomerAgencyUserRoleDTO> getUserRoles(@RequestBody CustomerAgencyUserRoleFormDTO formDTO);
/**
* 结束巡查 定时任务
* @author zhaoqifeng
* @date 2021/7/12 17:32
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("/epmetuser/staffpatrol/endpatrolJob")
Result endPatrolJob(@RequestBody StartPatrolFormDTO formDTO);
}

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

@ -409,4 +409,17 @@ public class EpmetUserOpenFeignClientFallback implements EpmetUserOpenFeignClien
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "getUserRoles", formDTO);
}
/**
* 结束巡查 定时任务
*
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2021/7/12 17:32
*/
@Override
public Result endPatrolJob(StartPatrolFormDTO formDTO) {
return ModuleUtils.feignConError(ServiceConstant.EPMET_USER_SERVER, "endPatrolJob", formDTO);
}
}

14
epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java

@ -87,6 +87,20 @@ public class StaffPatrolController {
}
/**
* 结束巡查 定时任务
* @author zhaoqifeng
* @date 2021/7/12 17:00
* @param formDTO
* @return com.epmet.commons.tools.utils.Result
*/
@PostMapping("endpatrolJob")
public Result endPatrolJob(@RequestBody StartPatrolFormDTO formDTO) {
staffPatrolRecordService.endPatrolJob(formDTO);
return new Result();
}
/**
* 上传巡查记录
*

8
epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java

@ -72,6 +72,14 @@ public interface StaffPatrolRecordService extends BaseService<StaffPatrolRecordE
*/
void endPatrol(TokenDto tokenDto, StartPatrolFormDTO formDTO);
/**
* 结束巡查 定时任务
* @author zhaoqifeng
* @date 2021/7/12 16:59
* @param formDTO
* @return void
*/
void endPatrolJob(StartPatrolFormDTO formDTO);
/**
* 上传巡查记录
*

32
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/StaffPatrolRecordServiceImpl.java

@ -276,6 +276,38 @@ public class StaffPatrolRecordServiceImpl extends BaseServiceImpl<StaffPatrolRec
statsPatrolUpdateEnd(tokenDto.getUserId(),totalTime,record.getPatrolStartTime(),patrolEndTime,record.getGrid());
}
/**
* 结束巡查 定时任务
*
* @param formDTO
* @return void
* @author zhaoqifeng
* @date 2021/7/12 16:59
*/
@Override
public void endPatrolJob(StartPatrolFormDTO formDTO) {
LambdaQueryWrapper<StaffPatrolRecordEntity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(StaffPatrolRecordEntity :: getStatus, PatrolConstant.PATROLLING);
wrapper.eq(StringUtils.isNotBlank(formDTO.getCustomerId()), StaffPatrolRecordEntity :: getCustomerId, formDTO.getCustomerId());
List<StaffPatrolRecordEntity> list = baseDao.selectList(wrapper);
if (CollectionUtils.isNotEmpty(list)) {
list.forEach(item -> {
String endTimeStr = DateUtils.format(item.getPatrolStartTime(), DateUtils.DATE_PATTERN_YYYYMMDD);
endTimeStr = endTimeStr.concat("235959");
Date endTime = DateUtils.parse(endTimeStr, DateUtils.DATE_TIME_NO_SPLIT);
item.setPatrolEndTime(endTime);
item.setActrualEndTime(endTime);
item.setStatus(PatrolConstant.END);
Integer totalTime = DateUtils.calculateSecond(item.getPatrolStartTime(), endTime) + 59;
item.setTotalTime(totalTime);
item.setUpdatedTime(null);
statsPatrolUpdateEnd(item.getStaffId(),totalTime, item.getPatrolStartTime(), endTime, item.getGrid());
});
updateBatchById(list);
}
}
/**
* @Description 巡查结束时添加巡查统计表逻辑
* @Param userId

4
epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java

@ -247,6 +247,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
@Override
@Transactional(rollbackFor = Exception.class)
public Result authBadgeRecord(CertificationAddFormDTO certificationAddFormDTO) {
// 校验这个徽章此人有没有
Integer recordCount = userBadgeCertificateRecordDao.selectIsExist(certificationAddFormDTO.getBadgeId(), certificationAddFormDTO.getUserId());
if (recordCount>NumConstant.ZERO){
throw new RenException("不允许重复提交审核");
@ -296,6 +297,8 @@ public class UserBadgeServiceImpl implements UserBadgeService {
.map(AuthFieldResultDTO::getEnName).collect(Collectors.toSet());
List<String> missColumns = ValidatorUtils.hasAllRequired(JSON.toJSONString(certificationAddFormDTO), requiredColumns);
if (!CollectionUtils.isEmpty(missColumns)) {
/*EpmetErrorCode.BADGE_CHECK.setMsg(JSON.toJSONString(missColumns).concat("不能为空"));
throw new RenException(EpmetErrorCode.BADGE_CHECK.getCode());*/
throw new RenException(JSON.toJSONString(missColumns).concat("不能为空"));
}
}
@ -360,6 +363,7 @@ public class UserBadgeServiceImpl implements UserBadgeService {
*/
@Override
public List<AuthFieldResultDTO> authField(AuthFieldFormDTO authFieldFormDTO) {
// 查询徽章要显示的认证信息字段
List<AuthFieldResultDTO> authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO);
if (CollectionUtils.isEmpty(authFieldResultDTOS)){
authFieldFormDTO.setCustomerId(BadgeConstant.DEFAULT_CUSTOMER);

Loading…
Cancel
Save