diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java index 41f9469ec2..29283f6b01 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/SsoServiceImpl.java @@ -290,7 +290,7 @@ public class SsoServiceImpl implements SsoService { //3.根据华为openId查询用户是否存在历史登陆信息 Result 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(); diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index 4d848f2dcf..aae5697447 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -164,7 +164,7 @@ public class ThirdLoginServiceImpl implements ThirdLoginService, ResultDataResol //2.根据openid查询用户是否存在历史登陆信息 Result 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(); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 80885587be..43c5468cc3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/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; diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java index 82d38837f5..bfa9a29710 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java +++ b/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 listGridMemberDataStats(List 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("%"); + } + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java index 04d4896995..e2d3f77953 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/AgencyInfoDTO.java +++ b/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 subAgencyIds; - private List subGridIds; + private String currentAgencyId; + private String currentAgencyName; + private String currentAreaCode; + private List subAgencies; + private List subGrids; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerAgencyCommonDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerAgencyCommonDTO.java new file mode 100644 index 0000000000..3a1078fd69 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridCommonDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridCommonDTO.java new file mode 100644 index 0000000000..2578a6c482 --- /dev/null +++ b/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; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java index b97139c8ff..245d3f7d04 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java +++ b/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; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java index 1ade73b168..1d5f837199 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java +++ b/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; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java index d6ca46a913..1186e7ff70 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java +++ b/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; + } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResult.java index 051af134ba..5a010ea45b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResult.java +++ b/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); } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResultDTO.java index 8a8da975f1..c86efe0c28 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthBarchartResultDTO.java +++ b/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 governAblityWeightData; + + /** + * 党建能力 原始得分 + */ + private List partyOriginScore; + + /** + * 治理能力 原始得分 + */ + private List governOriginScore; + + /** + * 服务能力 原始得分 + */ + private List serviceOriginScore; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java index de0b16022b..b9abf888d1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/MonthPieChartResultDTO.java +++ b/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 */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java index 91f3d027e9..84776cf8b1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/plugins/result/WorkRecordSubRank.java +++ b/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; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java index dd34c3c42d..27facb34f2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java +++ b/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"; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java index abac68a416..e248a6ac35 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java +++ b/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> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){ + formDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId()); + ValidatorUtils.validateEntity(formDTO); Result> ok = new Result>().ok(indexExplainService.getScoreDetail(formDTO)); return ok; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index a951b18406..1750090754 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/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 getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); - List selectSubAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); + List 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); -} \ No newline at end of file +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java index e0484794e6..abf21dd119 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/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 selectGridInfo(@Param("agencyId")String agencyId); - List selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId); + List selectSubGridIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 976c3c85b4..18a3795b05 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/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 selectKczSubAgencyOrGridIndexMonthlyRank(SubAgencyIndexRankYMFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java index 6735487317..2fb33f60d5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenIndexDataYearlyDao.java +++ b/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 selectAnNingSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO); + + + List selectKczSubAgencyIndexYearlyRank(SubAgencyIndexRankYMFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java index 57a9829f1d..147d12ef3f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencyScoreDao.java +++ b/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 selectAgencyMonthWeightScoreList(MonthScoreListFormDTO formDTO); + + List selectAgencyScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java index d0bfc62ac5..f5784b5a56 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunityScoreDao.java +++ b/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 selectCommunityMonthWeightScoreList(MonthScoreListFormDTO formDTO); + + List selectComunityScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java index c94fdb23a3..c98582ec77 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridScoreDao.java +++ b/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 selectGridMonthWeightScoreList(MonthScoreListFormDTO formDTO); + + List selectGridScoreList(@Param("customerId") String customerId, @Param("orgId") String orgId, @Param("monthId") String monthId); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java index d27a4eee75..734d8d938b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/plugins/ScreenWorkRecordOrgDailyDao.java +++ b/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 customerIds); + WorkRecordSubRank selectCurrentAgency(@Param("agencyId") String agencyId, + @Param("dateId")String dateId, + @Param("typeCodeList")List typeCodeList); + + List selectCustomerTypeCode(@Param("dataType")String dataType, @Param("customerId")String customerId); + + + WorkRecordSubRank selectUpToCalAgency(@Param("agencyId")String agencyId, @Param("dateId")String dateId,@Param("typeCodeList") List typeCodeList); - List 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 typeCodeList); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java index 572fb3b4b8..cdde8c050d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java +++ b/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 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 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 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 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 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> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { if (NumConstant.ONE == explainDTO.getIsSearch()) { List realScoreList = null; @@ -174,6 +242,9 @@ public class IndexExplainServiceImpl implements IndexExplainService { List 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 setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, - IndexExplainResult result, String allIndexCodePath, List indexGroupDetailEntities) { + private void setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, + IndexExplainResult result, String allIndexCodePath, List indexGroupDetailEntities) { if (indexGroupDetailEntities == null) { indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); } if (CollectionUtils.isEmpty(indexGroupDetailEntities)) { log.warn("setDefaultTableData allINdexCodePath:{} is config error", allIndexCodePath); - return null; + return; } List tableList = new ArrayList<>(); List 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> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List children) { diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index 538df72f10..c6dc8deba2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/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; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index c3b61385e6..ecae6064a9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/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"); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 993c590f05..d945b93460 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/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 serviceAblityWeightData = new ArrayList<>(); List partyDevWeightData = new ArrayList<>(); List governAblityWeightData = new ArrayList<>(); + List serviceOriginData = new ArrayList<>(); + List partyOriginData = new ArrayList<>(); + List 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 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())); diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java index 0991305f4f..3c3cc0419b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/plugins/ScreenWorkRecordOrgDailyService.java +++ b/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 { - /** - * 默认分页 - * - * @param params - * @return PageData - * @author generator - * @date 2021-02-23 - */ - PageData page(Map params); - /** * 默认查询 * @@ -69,36 +58,6 @@ public interface ScreenWorkRecordOrgDailyService extends BaseService page(Map params) { - IPage page = baseDao.selectPage( - getPage(params, FieldConstant.CREATED_TIME, false), - getWrapper(params) - ); - return getPageData(page, ScreenWorkRecordOrgDailyDTO.class); - } @Override public List list(Map params) { @@ -108,65 +95,65 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl customerIds=new ArrayList<>(); - Result> 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 currentAgency = baseDao.selectCurrentAgency(formDTO.getAgencyId(), - formDTO.getDataType(), - formDTO.getCustomerId(), - dateId); - //下级所有组织 - List subAgencyRankList = CollectionUtils.isNotEmpty(agencyInfoDTO.getSubAgencyIds()) ? baseDao.selectSubList( - agencyInfoDTO.getSubAgencyIds(), - formDTO.getDataType(), - formDTO.getCustomerId(), - dateId) : new ArrayList<>(); - //直属网格 - List 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 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 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 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 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 list = screenWorkRecordOrgMonthlyDao.selectVoluntaryServiceTrendDTO(formDTO.getCustomerId(), orgIds, monthIdList.get(NumConstant.ZERO), diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml index 68f17dd26c..5662edfaf7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencyScoreDao.xml @@ -74,5 +74,22 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index bd45c22bc4..7c6be5ab92 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -74,5 +74,22 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml index 0458665057..a177451112 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -76,5 +76,22 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml index 3f43d05337..7d6a14c085 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/plugins/ScreenWorkRecordOrgDailyDao.xml @@ -3,19 +3,6 @@ - - + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 83770370b5..183e74bb02 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -305,9 +305,10 @@ - SELECT - sca.AGENCY_ID as orgId + sca.AGENCY_ID as agencyId, + sca.AGENCY_NAME as agencyName FROM screen_customer_agency sca WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 2d9f8e5deb..a700e40792 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/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 - 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' diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 5b573343e2..ce83c8e058 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/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} + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 35bf90d165..78c494648b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/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} + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 2818ea0714..5f6b3ab061 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/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 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java index 16ede875bb..88968cf57e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/CustomerGridInfoDTO.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java index f72d2f3667..ef83c2160b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/plugins/ScreenWorkRecordCommonFormDTO.java +++ b/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; /** * 组织名称或者网格名 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/UpdateProjectSatisfactionScoreFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/UpdateProjectSatisfactionScoreFormDTO.java new file mode 100644 index 0000000000..f7b43d8e2f --- /dev/null +++ b/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 customerIdList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java index 65e98b940b..2a707f9540 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenCustomerGridDTO.java +++ b/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 . */ -package com.epmet.dto; +package com.epmet.dto.screen; + +import lombok.Data; import java.io.Serializable; import java.util.Date; -import lombok.Data; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 3001b4eb2c..ca81ce0ba7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/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 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 customerIds=dimCustomerService.getAllCustomerId(); + customerIds.forEach(customerId->{ + screenProjectSettleService.updateProjectSatisfactionScore(customerId,null,null); + log.info("所有客户数据更新完成"); + }); + } return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java index 90875a233a..f45ebc06e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerGridDao.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index e36868829c..4083242997 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/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 { void updateBatch(@Param("list") List 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 list); + + int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java index 4904f32724..ff563a9f6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java +++ b/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 list); void insertBatch(@Param("list") List list); + + int deleteByProjectId(@Param("customerId") String customerId, @Param("projectId") String projectId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java index ada3123821..02757feb13 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java +++ b/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 { * 11、基层治理-公众参与 * 0) 查询上月的基础数据,可用来计算本月的增长率 * @param customerId - * @param yearId * @param monthId * @param orgIds 组织Id集合 * @return java.util.List @@ -45,7 +44,6 @@ public interface ScreenUserJoinDao extends BaseDao { * @Date 14:46 2020-08-21 **/ List selectLastMonthScreenUserJoinList(@Param("customerId") String customerId, - @Param("yearId") String yearId, @Param("monthId") String monthId, @Param("orgIds") String[] orgIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 2ed89b61b4..704aa3ee26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/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 { */ String selectValueByKey(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey); + List selectProjectListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("projectOrigin") String projectOrigin); + /** * 计算某个项目的群满意度得分 * @@ -192,6 +194,4 @@ public interface ProjectDao extends BaseDao { List selectClosedProjectIds(@Param("customerId")String customerId, @Param("origin")String origin, @Param("projectStatus")String projectStatus); - - List selectProjectListByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("projectOrigin") String projectOrigin); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index c18a0e4c08..93ab6289a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/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()); + } })); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index 9260f204e5..c8080039cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/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); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 16d073b953..0b4a519efe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/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 projectIds=new ArrayList<>(); if(StringUtils.isNotBlank(dateId)){ + log.warn("按日期计算"); List list=projectService.selectEvaluateProjectIds(customerId,dateId); if(!CollectionUtils.isEmpty(list)){ projectIds.addAll(list); } }else{ + log.warn("计算当前客户下,来源于议题已结案的项目对应的满意度得分"); // 只有来源于议题的项目,才有分数 List 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); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java index 994f8818fb..2f3edf7951 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/GridCorreLationService.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index bd9a5c8b5a..0b29ad3c72 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 127479f37e..57c4a8370f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java index 358b102ea6..1fb59aa3b5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCustomerGridService.java +++ b/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 selectBelongGridInfo(String customerId,String level); + List selectBelongGridInfo(String customerId, String level); Integer updateCenterPointByName(String customerId, String title, List center); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java index 42cbb44da0..54833eeebd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCustomerGridServiceImpl.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java index 7430c1abe7..14402b1f86 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java +++ b/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; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index ac49a4aecc..5e14db736e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/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 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 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())){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java index a402ac4370..d2e5dfcdb0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java +++ b/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 lastMonthJoinList = baseDao.selectLastMonthScreenUserJoinList(formDTO.getCustomerId(), - dimIdBean.getYearId(), dimIdBean.getMonthId(), orgIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index 5bb05989fe..3b96365fbe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java +++ b/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 lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, - lastMonth[NumConstant.ZERO], - moneth, + monthId, orgIds); // 定义本月待添加数据的集合 List 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); // 不存在上个月的数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java index 041fcf74d4..dc082b44ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java +++ b/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> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); - partition.forEach(p -> { + for (int i = 0; i < partition.size(); i++) { + List p = partition.get(i); //4.封装数据并执行 - p.forEach(m -> { + Iterator iterator = p.iterator(); + while (iterator.hasNext()) { + GmUploadEventFormDTO.DataList m = iterator.next(); AtomicReference 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> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); - partition.forEach(p -> { + for (int i = 0; i < partition.size(); i++) { + List p = partition.get(i); //4.封装数据并执行 - p.forEach(m -> { + Iterator iterator = p.iterator(); + while (iterator.hasNext()) { + GmUploadDataFormDTO.DataList m = iterator.next(); AtomicReference 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); } - }); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index ccbe9fd81b..e826c9f9e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/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 { */ List getProjectSatisfaction(String customerId); + List selectProjectListByDateId(String customerId, String yesterdayStr, String projectOriginAgency); /** * 计算某个项目的群满意度得分 * @@ -190,5 +191,4 @@ public interface ProjectService extends BaseService { * @return */ List selectClosedProjectIds(String customerId,String origin ,String projectStatus); - List selectProjectListByDateId(String customerId, String yesterdayStr, String projectOriginAgency); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index caf1e58fa7..f67bff807c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/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 selectProjectListByDateId(String customerId, String dateId, String projectOrigin) { + return baseDao.selectProjectListByDateId(customerId,dateId,projectOrigin); + } + /** * 计算某个项目的群满意度得分 * @@ -234,10 +239,5 @@ public class ProjectServiceImpl extends BaseServiceImpl selectProjectListByDateId(String customerId, String dateId, String projectOrigin) { - return baseDao.selectProjectListByDateId(customerId,dateId,projectOrigin); - } - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml index 3838261c45..71ae010181 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerGridDao.xml @@ -65,7 +65,7 @@ - SELECT m.GRID_ID, m.CUSTOMER_ID, @@ -78,7 +78,7 @@ - SELECT m.GRID_ID, m.CUSTOMER_ID, @@ -93,7 +93,7 @@ - SELECT PARENT_AGENCY_ID, ALL_PARENT_IDS @@ -104,7 +104,7 @@ AND m.GRID_ID = #{gridId} - SELECT GRID_ID gridId, GRID_NAME gridName, @@ -130,7 +130,7 @@ - SELECT GRID_ID gridId, GRID_NAME gridName, @@ -361,7 +361,7 @@ - SELECT sca.AGENCY_ID AS PID, sca.PIDS, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index bb8ae9a28f..db38763cb5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/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 from screen_project_data + where PROJECT_ID = #{projectId} + AND customer_id = #{customerId} + + + + delete from screen_project_data + where 1=1 + AND customer_id = #{customerId} + + PROJECT_ID = #{projectId} + + + SELECT - psd.PROJECT_ID + distinct psd.PROJECT_ID FROM project_satisfaction_detail psd WHERE @@ -213,11 +220,4 @@ AND p.ORIGIN =#{origin} - diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StaffPatrolService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StaffPatrolService.java new file mode 100644 index 0000000000..905a424c21 --- /dev/null +++ b/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); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StaffPatrolServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StaffPatrolServiceImpl.java new file mode 100644 index 0000000000..43ffff5ad5 --- /dev/null +++ b/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); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EndPatrolTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/EndPatrolTask.java new file mode 100644 index 0000000000..b0f06c377a --- /dev/null +++ b/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()); + } + } +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java index 5b7fbdf89f..3e1f982716 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/controller/ResiPartyMemberController.java +++ b/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 auditingDetail(@RequestBody AuditingDetailFromDTO fromDTO) { + ValidatorUtils.validateEntity(fromDTO); return resiPartyMemberService.auditingDetail(fromDTO); } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java index d2f4ccc899..8f7c751f19 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/ResiPartyMemberServiceImpl.java +++ b/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> 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> 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); diff --git a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java b/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java index 387c68772c..2a6ab054fb 100644 --- a/epmet-module/resi-partymember/resi-partymember-client/src/main/java/com/epmet/resi/partymember/dto/partymember/form/AuditingDetailFromDTO.java +++ b/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; /** diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java index 1b52c7e1cc..ac4ac14ff4 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/modules/partymember/service/impl/PartyMemberConfirmServiceImpl.java +++ b/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 failedReason = new ArrayList<>(); diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml index 1b2ea4f5ee..b14b3fefe6 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/mapper/partymember/PartymemberBaseInfoDao.xml +++ b/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 diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StartPatrolFormDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StartPatrolFormDTO.java index 1bf9d55e25..2c723e6177 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/form/StartPatrolFormDTO.java +++ b/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; } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java index 95670ba7e8..63783adc2c 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/CertificationDetailResultDTO.java +++ b/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 = ""; + } } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index fcf24efc39..6cfb21aa99 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/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 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); } diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java index db88733c0e..b0b8723f01 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/fallback/EpmetUserOpenFeignClientFallback.java +++ b/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); + } + } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java index 4d510c5996..6708db5b5d 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/controller/StaffPatrolController.java +++ b/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(); + + } + /** * 上传巡查记录 * diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java index 7eae381718..e9cbb44ce7 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/StaffPatrolRecordService.java @@ -72,6 +72,14 @@ public interface StaffPatrolRecordService extends BaseService wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(StaffPatrolRecordEntity :: getStatus, PatrolConstant.PATROLLING); + wrapper.eq(StringUtils.isNotBlank(formDTO.getCustomerId()), StaffPatrolRecordEntity :: getCustomerId, formDTO.getCustomerId()); + List 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 diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java index a2b08568e7..0716978c1c 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBadgeServiceImpl.java +++ b/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 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 authField(AuthFieldFormDTO authFieldFormDTO) { + // 查询徽章要显示的认证信息字段 List authFieldResultDTOS = userBadgeDao.selectAuthField(authFieldFormDTO); if (CollectionUtils.isEmpty(authFieldResultDTOS)){ authFieldFormDTO.setCustomerId(BadgeConstant.DEFAULT_CUSTOMER);