diff --git a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml index 0275695054..6b4803d4d8 100644 --- a/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml +++ b/epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-admin-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 5af513a4a4..de94f499a2 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -11,7 +11,7 @@ spring: name: epmet-gateway-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java index e3ac468fcf..96005bfcc3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/constant/ScreenConstant.java @@ -16,4 +16,7 @@ public interface ScreenConstant { String COMMA = ","; + String MONTH_ID = "month"; + + String YEAR_ID = "year"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java new file mode 100644 index 0000000000..683aebbe7c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 5、下级部门指数排行(安宁数据段用) 入参 + * @Author zhangyong + * @DateTime 2020/09/08 9:54 + */ +@Data +public class AnNingSubAgencyIndexRankFormDTO implements Serializable { + + private static final long serialVersionUID = -2920561669035794486L; + + public interface SubAgencyIndexRank{} + + /** + * 机关ID + */ + @NotBlank(message = "组织id不能为空",groups = {SubAgencyIndexRank.class}) + private String agencyId; + + /** + * 默认查询前几名 + */ + @NotNull(message = "默认查询名次不能为空",groups = {SubAgencyIndexRank.class}) + private Integer topNum; + + /** + * asc 正序, desc 降序 + */ + @NotNull(message = "排序方式不能为空",groups = {SubAgencyIndexRank.class}) + private String sort; + + /** + * 年度:year 月度:month + */ + @NotNull(message = "年度、月度不能为空",groups = {SubAgencyIndexRank.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 1b063dd470..c6d6de4ce3 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -7,12 +7,15 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import javax.servlet.http.HttpServletRequest; + /** * 组织相关api * @@ -34,7 +37,11 @@ public class AgencyController { */ //@ExternalAppRequestAuth @PostMapping("tree") - public Result tree(ExternalAppRequestParam externalAppRequestParam){ + public Result tree(HttpServletRequest request, ExternalAppRequestParam externalAppRequestParam){ + String customerId = request.getHeader("CustomerId"); + if(StringUtils.isBlank(externalAppRequestParam.getCustomerId())){ + externalAppRequestParam.setCustomerId(customerId); + } return new Result().ok(agencyService.tree(externalAppRequestParam)); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java index d670c65b1c..fea6239953 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/IndexController.java @@ -3,10 +3,7 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.IndexService; -import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; @@ -84,4 +81,19 @@ public class IndexController { return new Result>().ok(indexService.subAgencyIndexRank(subAgencyIndexRankFormDTO)); } + /** + * 5、下级部门指数排行(安宁数据段用) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 09:38 2020-09-08 + **/ + //@ExternalAppRequestAuth + @PostMapping("dataclient/subagencyindexrank") + public Result> anNingSubAgencyIndexRank(@RequestBody AnNingSubAgencyIndexRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, AnNingSubAgencyIndexRankFormDTO.SubAgencyIndexRank.class); + return new Result>().ok(indexService.anNingSubAgencyIndexRank(formDTO)); + } + } 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 372dacf9dd..8f1e472b18 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 @@ -17,6 +17,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; +import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResult; import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; @@ -58,5 +59,15 @@ public interface ScreenIndexDataMonthlyDao{ * @date 2020/8/20 10:04 上午 */ List selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); - -} \ No newline at end of file + + /** + * 5、下级部门指数排行(安宁数据段用) - 月(上一个月) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 09:38 2020-09-08 + **/ + List selectAnNingSubAgencyIndexMonthlyRank(AnNingSubAgencyIndexRankFormDTO 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 c63c17fa57..eced6fc1ff 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 @@ -17,10 +17,14 @@ package com.epmet.datareport.dao.evaluationindex.screen; +import com.epmet.evaluationindex.screen.dto.form.AnNingSubAgencyIndexRankFormDTO; +import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.YearAverageIndexResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 指数-指数数据(按年统计) * @@ -37,5 +41,14 @@ public interface ScreenIndexDataYearlyDao{ * @date 2020/8/19 3:43 下午 */ YearAverageIndexResultDTO selectYearAverageIndex(@Param("agencyId")String agencyId); - -} \ No newline at end of file + + /** + * 5、下级部门指数排行(安宁数据段用) - 年 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 09:38 2020-09-08 + **/ + List selectAnNingSubAgencyIndexYearlyRank(AnNingSubAgencyIndexRankFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java index 266898530d..e2191e20ec 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/IndexService.java @@ -1,9 +1,6 @@ package com.epmet.datareport.service.evaluationindex.screen; -import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.MonthBarchartResultDTO; import com.epmet.evaluationindex.screen.dto.result.MonthPieChartResultDTO; import com.epmet.evaluationindex.screen.dto.result.SubAgencyIndexRankResultDTO; @@ -51,4 +48,14 @@ public interface IndexService { */ List subAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); + /** + * 5、下级部门指数排行(安宁数据段用) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 09:38 2020-09-08 + **/ + List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO); + } 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 6eef8b2387..6d6632dbdf 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 @@ -12,6 +12,7 @@ import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -43,13 +44,13 @@ public class AgencyServiceImpl implements AgencyService { @Override public TreeResultDTO tree(ExternalAppRequestParam externalAppRequestParam) { // 1. 查询客户根组织ID -// String customerId = externalAppRequestParam.getCustomerId(); + String customerId = externalAppRequestParam.getCustomerId(); // 验签关闭,customerId无法获取,暂时写死 - String customerId = "b09527201c4409e19d1dbc5e3c3429a1"; - - + if(StringUtils.isBlank(customerId)){ + customerId = "b09527201c4409e19d1dbc5e3c3429a1"; + } TreeResultDTO rootAgency = screenCustomerAgencyDao.selectRootAgencyId(customerId); if (null == rootAgency){ return new TreeResultDTO(); 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 22f6aa376b..4d23ca4bca 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 @@ -7,10 +7,8 @@ import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataMonthlyDao import com.epmet.datareport.dao.evaluationindex.screen.ScreenIndexDataYearlyDao; import com.epmet.datareport.service.evaluationindex.screen.IndexService; import com.epmet.datareport.utils.DateUtils; -import com.epmet.evaluationindex.screen.dto.form.MonthBarchartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.MonthPieChartFormDTO; -import com.epmet.evaluationindex.screen.dto.form.SubAgencyIndexRankFormDTO; -import com.epmet.evaluationindex.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.evaluationindex.screen.constant.ScreenConstant; +import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -182,4 +180,17 @@ public class IndexServiceImpl implements IndexService { } return subAgencyIndexRankResultDTOS; } + + @Override + public List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) { + List subAgencyIndexRankResultDTOS = new ArrayList<>(); + if (ScreenConstant.YEAR_ID.equals(formDTO.getType())){ + // 年 指数排行 + subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO); + } else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){ + // 月(上一个月) 指数排行 + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO); + } + return subAgencyIndexRankResultDTOS; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml index 5899ead6dd..d3ebec947d 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-report/data-report-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: data-report-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss 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 37f45b8084..7dcb6c526b 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 @@ -60,4 +60,27 @@ ORDER BY index_total DESC LIMIT #{topNum} - \ No newline at end of file + + + + 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 d224b92d4e..60dc82b24b 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 @@ -18,4 +18,27 @@ AND org_id = #{agencyId} AND year_id = DATE_FORMAT(NOW(),'%Y') - \ No newline at end of file + + + + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java index a9abd3411f..dabf459123 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -17,14 +17,13 @@ package com.epmet.dto.indexcal; -import java.io.Serializable; -import java.util.Date; - import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.IndexCalConstant; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 区/街道相关分数表 @@ -80,20 +79,26 @@ public class AgencyScoreDTO implements Serializable { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** - * 数据类型 district :全区;street:街道 + * 数据类型 district :全区;street:街道 */ private String dataType; /** - * + * */ private Integer delFlag; @@ -127,6 +132,7 @@ public class AgencyScoreDTO implements Serializable { this.score = new BigDecimal(NumConstant.ZERO); this.indexCode = ""; this.dataType = IndexCalConstant.STREET_LEVEL; + this.allParentIndexCode = ""; this.delFlag = 0; this.revision = 0; this.createdBy = "APP_USER"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java index 5051aa3d82..f61ab58957 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/DeptScoreDTO.java @@ -17,11 +17,11 @@ package com.epmet.dto.indexcal; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * 区直部门分值表 @@ -77,12 +77,18 @@ public class DeptScoreDTO implements Serializable { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 治理能力:zhilinengli; */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..fec0ca391a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 8、治理能力-部门相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class DeptGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..0e845a808f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 6、治理能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java new file mode 100644 index 0000000000..d6f2e68d5c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 2、党建能力-网格相关指标上报(按照月份) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridPartyAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java index 8738c5c3f2..3aa816cafd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityFormDTO.java @@ -48,7 +48,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格党员人均提出的议题转项目数 */ - private Integer partyAvgShiftProjectCount; + private BigDecimal partyAvgShiftProjectCount; /** * 网格活跃群众用户数 @@ -78,7 +78,7 @@ public class GridPartyAbilityFormDTO implements Serializable { /** * 网格群众人均提出的议题转项目数 */ - private Integer userAvgShiftProjectCount; + private BigDecimal userAvgShiftProjectCount; /** * 建群党员数(累计值) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java index 5a0a9fb3c8..6e6eccd2e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyMemberDataFormDTO.java @@ -29,5 +29,5 @@ public class GridPartyMemberDataFormDTO implements Serializable { */ private String monthId; - private List partyMemberDataList; + private List dataList; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java new file mode 100644 index 0000000000..1931275dd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 4、服务能力-网格相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GridServiceAbilityDataFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java new file mode 100644 index 0000000000..59e03a058c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 7、治理能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgGovrnAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java new file mode 100644 index 0000000000..2d018cf394 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 3、党建能力-街道及社区相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgPartyAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java new file mode 100644 index 0000000000..e29c218a20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.indexcollect.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 5、服务能力-组织(街道|社区|全区)相关指标 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgServiceAbilityDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java index 8ad2ec6658..026b92084b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -84,6 +84,11 @@ public class FactIndexCommunityScoreDTO implements Serializable { */ private String indexCode; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * 删除状态 */ @@ -124,6 +129,7 @@ public class FactIndexCommunityScoreDTO implements Serializable { this.isTotal = "0"; this.score = new BigDecimal(0); this.indexCode = ""; + this.allParentIndexCode = ""; this.delFlag = 0; this.revision = 0; this.createdBy = "APP_USER"; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java new file mode 100644 index 0000000000..760e48b3da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dto.screencoll; + +import com.alibaba.fastjson.JSON; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 大屏采集通用入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/9 10:25 + */ +@Data +public class ScreenCollFormDTO implements Serializable { + + private static final long serialVersionUID = 4605543711669000348L; + /** + * 当为true时后台将先删除当前维度的数据,后新增 + */ + private Boolean isFirst; + + /** + * 日期Id, 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * yyyyMM + */ + private String monthId; + + /** + * yyyy + */ + private String yearId; + + /** + * 数据集合 + */ + private List dataList; + + @Override + public String toString() { + return JSON.toJSONString(this); + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java new file mode 100644 index 0000000000..1eb4f41225 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 2、党员基本情况 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CpcBaseDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java new file mode 100644 index 0000000000..bd9d9feaaa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 14、组织层级 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerAgencyListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java new file mode 100644 index 0000000000..3a10027b55 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 16、部门信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerDeptListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java new file mode 100644 index 0000000000..ea7ec06874 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 15、网格信息上传 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class CustomerGridListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java index a0de181acb..edac6a656e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/DifficultyDataFormDTO.java @@ -21,6 +21,6 @@ public class DifficultyDataFormDTO implements Serializable { /** * 难点堵点数据 */ - private List diffcultyDataList; + private List dataList; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java new file mode 100644 index 0000000000..a84a217b60 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.screencoll.form; + +import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; +import com.epmet.dto.screencoll.ImgDataListDTO; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 4、事件数据(中央区-事件数据) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class EventDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java new file mode 100644 index 0000000000..8372ba293e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 5、基层治理-治理能力数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class GovernRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java new file mode 100644 index 0000000000..f9a4ad6f48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 1、指数_按月统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataListMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java new file mode 100644 index 0000000000..186f5eb007 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 17、指数_按年统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataListYearlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyy + */ + private String yearId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java new file mode 100644 index 0000000000..0d3238ae2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 6、党建引领-组织排行 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class OrgRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java new file mode 100644 index 0000000000..8c6a92e7b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 7、基层党建-建设情况数据(支部、联建、志愿) 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyBranchDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java new file mode 100644 index 0000000000..da0630fad1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 8、党建引领-党员联系群众数据 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PartyLinkMassesDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java new file mode 100644 index 0000000000..c1784728ae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 9、党建引领|基层治理-居民(党员)积分排行榜 入参 + * @Auther: zhangyong + * @Date: 2020-08-21 09:59 + */ +@Data +public class PartyUserRankDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java new file mode 100644 index 0000000000..b8a6086721 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +/** + * 10、党建引领-先锋模范数据 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PioneerDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java new file mode 100644 index 0000000000..4e2bcaca51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 18、公众参与各类总数 入参 + * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class PublicPartiTotalDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java new file mode 100644 index 0000000000..3550be21ad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 11、基层治理-公众参与 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserJoinListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + /** + * yyyyMM + */ + private String monthId; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java new file mode 100644 index 0000000000..ebdcc2822a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 12、中央区各类总数 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class UserTotalDataListFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当为true时后台将删除本月数据 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java index eee1f3bca7..3b93ce39a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/DataStatsApplication.java @@ -1,7 +1,5 @@ package com.epmet; -import com.epmet.commons.tools.enums.EnvEnum; -import com.epmet.commons.tools.utils.HttpClientManager; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; @@ -17,6 +15,5 @@ public class DataStatsApplication { public static void main(String[] args) { SpringApplication.run(DataStatsApplication.class ,args); - HttpClientManager.getInstance().sendAlarmMsg(EnvEnum.getCurrentEnv().getName() +" DataStatsApplication started!"); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java index 138ab5cbb7..0a8740c63b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactIndexCollectController.java @@ -4,12 +4,12 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcollect.form.*; -import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.List; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 指标采集相关api @@ -51,7 +51,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridpartyability") - public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridPartyAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -67,7 +67,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orgpartyability") - public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgPartyAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgPartyAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgPartyAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -83,7 +83,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridserviceability") - public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridServiceAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -99,7 +99,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orgserviceability") - public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgServiceAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgServiceAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgServiceAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -115,7 +115,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("gridgovrnability") - public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result gridGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody GridGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertGridGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -131,7 +131,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("orggovrnability") - public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertOrgGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -147,7 +147,7 @@ public class FactIndexCollectController { **/ @ExternalAppRequestAuth @PostMapping("deptgovrnability") - public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result deptGovrnAbility(ExternalAppRequestParam externalAppRequestParam, @RequestBody DeptGovrnAbilityDataFormDTO formDTO) { factIndexCollectService.insertDeptGovrnAbility(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 978181b3a4..003813df2b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -1,9 +1,10 @@ package com.epmet.controller; +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.service.evaluationindex.indexcal.CpcIndexCalculateService; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; import com.epmet.util.DimIdGenerator; @@ -40,10 +41,21 @@ public class IndexCalculateController { * @Author zhangyong * @Date 10:52 2020-08-20 **/ + @ExternalAppRequestAuth @PostMapping("all") - public Result indexCalculate(@RequestBody IndexCalculateForm formDTO) { + public Result indexCalculate(ExternalAppRequestParam externalAppRequestParam, @RequestBody CalculateCommonFormDTO formDTO) { + formDTO.setCustomerId(externalAppRequestParam.getCustomerId()); + Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); + if (aBoolean) { + return new Result().ok(true); + } + return new Result().error("指标计算失败"); + } + + @PostMapping("reAll") + public Result calculateAll(@RequestBody CalculateCommonFormDTO formDTO) { Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); - if (aBoolean){ + if (aBoolean) { return new Result().ok(true); } return new Result().error("指标计算失败"); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java new file mode 100644 index 0000000000..766db2294b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 孔村大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/9 10:18 + */ +@RestController +@RequestMapping("kcscreencoll") +public class KcScreenCollController { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java similarity index 73% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java index d83f8df3c5..73d6db7bb6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java @@ -4,27 +4,26 @@ import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.form.*; -import com.epmet.service.evaluationindex.screen.ScreenCollService; +import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import java.util.List; /** - * 大屏数据采集api + * 市北大屏数据采集api * * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:25 */ @RestController @RequestMapping("screencoll") -public class ScreenCollController { +public class ShiBeiScreenCollController { @Autowired - private ScreenCollService screenCollService; + private ShiBeiScreenCollService shiBeiScreenCollService; /** * 9、党建引领|基层治理-居民(党员)积分排行榜 @@ -37,8 +36,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partyuserrankdata") - public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -53,8 +52,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -69,8 +68,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -85,8 +84,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -101,8 +100,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { + shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -117,8 +116,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { + shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -134,7 +133,7 @@ public class ScreenCollController { @ExternalAppRequestAuth @PostMapping("difficultydata") public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { - screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -149,8 +148,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { + shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -165,8 +164,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatamonthly") - public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -183,8 +182,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatayearly") - public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { + shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -199,8 +198,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -215,8 +214,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -231,8 +230,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { + shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -247,8 +246,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -263,8 +262,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { + shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -279,8 +278,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -296,8 +295,8 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") - public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { + shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 5cbcfb20e2..d97a697f7b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -48,11 +48,10 @@ public interface AgencyScoreDao extends BaseDao { * @Description 删除旧记录 * @param customerId * @param monthId - * @param indexCode * @author zxc * @date 2020/9/2 15:47 */ - void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); + void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("dataType")String dataType); /** * @Description 查询【fact_index_agency_score】相关信息 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java new file mode 100644 index 0000000000..959b5649c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.AgencyScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface AgencySubScoreDao extends BaseDao { + + /** + * @param lists + * @Description 【街道】中间表插入 + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertStreetRecord(@Param("lists") List lists); + + /** + * @param customerId + * @param monthId + * @param indexCode + * @Description 删除旧记录 + * @author zxc + * @date 2020/9/2 15:47 + */ + void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("dataType") String dataType); + + /** + * @param customerId + * @param monthId + * @Description 查询【fact_index_agency_score】相关信息 + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectAgencyScoreInfo(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("dataType") String dataType); + + /** + * @param customerId + * @param monthId + * @Description 区下级街道得分平均值 + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectAgencyScoreAvg(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("dataType") String dataType); + + + /** + * 根据入参查询 区/街道相关分数表 记录 + * + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListAgencyScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 批量插入区/街道相关分数表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertAgencyScoreData(@Param("list") List list, @Param("customerId") String customerId); + + /** + * 根据入参查询 区/街道相关分数表id + * + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListAgencyId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java similarity index 93% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index 40fd49e6ab..ab1439481e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexCommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.dao.evaluationindex.screen; +package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; @@ -33,7 +33,7 @@ import java.util.List; * @since v1.0.0 2020-08-31 */ @Mapper -public interface FactIndexCommunityScoreDao extends BaseDao { +public interface CommunityScoreDao extends BaseDao { /** * @Description 【社区】中间表插入 @@ -47,11 +47,10 @@ public interface FactIndexCommunityScoreDao extends BaseDao + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; +import com.epmet.dto.screen.FactIndexCommunityScoreDTO; +import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 社区相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Mapper +public interface CommunitySubScoreDao extends BaseDao { + + /** + * @param lists + * @Description 【社区】中间表插入 + * @author zxc + * @date 2020/8/27 5:05 下午 + */ + void insertCommunityPartyRecord(@Param("lists") List lists); + + /** + * @param customerId + * @param monthId + * @Description 删除旧记录 + * @author zxc + * @date 2020/9/1 9:03 上午 + */ + void deleteOldRecord(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @param customerId + * @param monthId + * @Description 查询社区相关信息 + * @author zxc + * @date 2020/9/1 9:41 上午 + */ + List selectCommunityInfo(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 根据入参查询 查询社区相关信息 + * + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @param customerId + * @param monthId + * @Description 街道下级所有社区得分平均值 + * @author zxc + * @date 2020/8/31 1:51 下午 + */ + List selectSubCommAvgScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + + /** + * 批量插入 社区相关分数表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertCommunityScoreData(@Param("list") List list, @Param("customerId") String customerId); + + /** + * 根据入参查询 查询社区id + * + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListCommunityId(@Param("customerId") String customerId, @Param("monthId") String monthId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java index 9c3d339ae8..f4aac59361 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java @@ -80,7 +80,7 @@ public interface CpcScoreDao extends BaseDao { int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); - List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode); int insertBatch(@Param("list") Collection values); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java new file mode 100644 index 0000000000..54226d0cc7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.math.BigDecimal; +import java.util.Collection; +import java.util.List; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Mapper +public interface CpcSubScoreDao extends BaseDao { + + /** + * @param customerId + * @param monthId + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值) + * @Date 2020/8/31 10:56 + **/ + BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("gridId") String gridId); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description 获取网格内党员的联系群众能力考评分(平均值)的最大值,最小值 + * @Date 2020/8/31 12:10 + **/ + List selectListGridContactMassesAvgValue(CalculateCommonFormDTO formDTO); + + /** + * @param calculateCommonFormDTO + * @return java.util.List + * @author yinzuomei + * @description 网格内党员的参与议事能力考评分(平均值) 最大值最小值 + * @Date 2020/8/31 14:42 + **/ + List selectListJoinIssueAvgValue(CalculateCommonFormDTO calculateCommonFormDTO); + + /** + * @param customerId + * @param monthId + * @param gridId + * @return java.math.BigDecimal + * @author yinzuomei + * @description 组织内党员的参与议事能力考评分(平均值) + * @Date 2020/8/31 15:51 + **/ + BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode); + + List getPartScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("allParentCode") String allParentCode); + + int insertBatch(@Param("list") Collection values); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java new file mode 100644 index 0000000000..e084506452 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java @@ -0,0 +1,92 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.indexcal; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.DeptScoreDTO; +import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface DeptSubScoreDao extends BaseDao { + + /** + * 根据入参查询 区直部门分值表 记录 + * + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListDeptScore(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 批量插入 区直部门分值表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertDeptScoreData(@Param("list") List list, @Param("customerId") String customerId); + + /** + * 根据入参查询 区直部门分值表id + * + * @param customerId + * @param monthId + * @return java.lang.String + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListDeptId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + + /** + * @param customerId + * @param monthId + * @param indexCode + * @Description 所有直属部门治理能力平均值 + * @author zxc + * @date 2020/9/4 10:53 上午 + */ + List selectGovernDeptScoreAvg(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); + + /** + * @param customerId + * @param monthId + * @param deptId + * @return int + * @author yinzuomei + * @description + * @Date 2020/9/7 14:30 + **/ + int deleteByDeptIdAndMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("deptId") String deptId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java index 2e4a10cde2..b4db5f05f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridScoreDao.java @@ -20,6 +20,8 @@ package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.GridScoreDTO; +import com.epmet.dto.screen.FactIndexGridScoreDTO; +import com.epmet.dto.screen.result.SubGridAvgResultDTO; import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -66,4 +68,45 @@ public interface GridScoreDao extends BaseDao { * @Date 2020/8/31 16:42 **/ List selectList(CalculateCommonFormDTO formDTO); + + /** + * @Description 下属所有网格的平均值 + * @param customerId + * @param monthId + * @author zxc + * @date 2020/8/28 3:20 下午 + */ + List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + + /** + * 根据入参查询 网格相关分值记录 + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 根据入参查询 网格id + * @param customerId + * @param monthId + * @return java.util.List + * @Author zhangyong + * @Date 10:43 2020-09-03 + **/ + List selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 批量插入 网格相关分值表 + * + * @param list + * @param customerId + * @return void + * @Author zhangyong + * @Date 11:11 2020-09-04 + **/ + void batchInsertGridScoreData(@Param("list") List list,@Param("customerId")String customerId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java similarity index 54% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java index 77c3f85366..e0cf724899 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java @@ -15,12 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.dao.evaluationindex.screen; +package com.epmet.dao.evaluationindex.indexcal; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.indexcal.GridScoreDTO; import com.epmet.dto.screen.FactIndexGridScoreDTO; import com.epmet.dto.screen.result.SubGridAvgResultDTO; -import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.GridScoreEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -30,39 +32,73 @@ import java.util.List; * 网格相关分值 * * @author generator generator@elink-cn.com - * @since v1.0.0 2020-08-28 + * @since v1.0.0 2020-08-31 */ @Mapper -public interface FactIndexGridScoreDao extends BaseDao { +public interface GridSubScoreDao extends BaseDao { + /** + * @param customerId + * @param monthId + * @param indexCode + * @param isTotal 1:总分;0不是 + * @return int + * @author yinzuomei + * @description + * @Date 2020/8/31 14:00 + **/ + int deleteByCusAndMonthId(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("indexCode") String indexCode, + @Param("isTotal") String isTotal); + + /** + * @param gridScoreEntityList + * @return int + * @author yinzuomei + * @description + * @Date 2020/8/31 14:01 + **/ + int insertBatches(List gridScoreEntityList); + + /** + * @param formDTO + * @return java.util.List + * @author yinzuomei + * @description + * @Date 2020/8/31 16:42 + **/ + List selectList(CalculateCommonFormDTO formDTO); /** - * @Description 下属所有网格的平均值 * @param customerId * @param monthId + * @Description 下属所有网格的平均值 * @author zxc * @date 2020/8/28 3:20 下午 */ - List selectSubGridAvgScore(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectSubGridAvgScore(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode); /** * 根据入参查询 网格相关分值记录 + * * @param customerId * @param monthId * @return java.util.List * @Author zhangyong * @Date 10:43 2020-09-03 **/ - List selectListGridScore(@Param("customerId")String customerId, @Param("monthId")String monthId); + List selectListGridScore(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * 根据入参查询 网格id + * * @param customerId * @param monthId * @return java.util.List * @Author zhangyong * @Date 10:43 2020-09-03 **/ - List selectListGridId(@Param("customerId")String customerId, @Param("monthId")String monthId); + List selectListGridId(@Param("customerId") String customerId, @Param("monthId") String monthId); /** * 批量插入 网格相关分值表 @@ -73,5 +109,6 @@ public interface FactIndexGridScoreDao extends BaseDao * @Author zhangyong * @Date 11:11 2020-09-04 **/ - void batchInsertGridScoreData(@Param("list") List list,@Param("customerId")String customerId); -} + void batchInsertGridScoreData(@Param("list") List list, @Param("customerId") String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java index 5a9350a63e..b4f79644d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.java @@ -37,24 +37,16 @@ import java.util.Map; public interface FactIndexGovrnAblityDeptMonthlyDao extends BaseDao { /** * 8、治理能力-部门相关指标 - * 据CUSTOMER_ID、AGENCY_ID、DEPT_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyId - * @param deptId - * @param yearId * @param monthId - * @param quarterId - * @param customerId + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, - @Param("agencyId") String agencyId, - @Param("deptId") String deptId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId); + Integer deleteFactIndexGovrnAblityDeptMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 8、治理能力-部门相关指标 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index 55d0e5730b..5e0c308c5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -47,15 +47,12 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao { /** * 7、治理能力-街道及社区相关指标 - * 据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param quarterId - * @param agencyIds + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId, - @Param("agencyIds") String[] agencyIds); + Integer deleteFactIndexGovrnAblityOrgMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 7、治理能力-街道及社区相关指标 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java index aeaf65e6b5..6e2dbcaee5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.java @@ -39,23 +39,16 @@ public interface FactIndexPartyAblityGridMonthlyDao extends BaseDao { /** * 4、服务能力-网格相关指标 - * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyId - * @param gridId - * @param yearId * @param monthId - * @param quarterId + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, - @Param("agencyId") String agencyId, - @Param("gridId") String gridId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("quarterId") String quarterId); + Integer deleteFactIndexServiceAblityGridMonthly(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 4、服务能力-网格相关指标 @@ -91,7 +84,7 @@ public interface FactIndexServiceAblityGridMonthlyDao extends BaseDao { /** * 2、党员基本情况 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCpcBaseData(@Param("customerId") String customerId, - @Param("orgIds") String[] orgIds); + Integer deleteCpcBaseData(@Param("customerId") String customerId); /** * 2、党员基本情况 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 4912171860..0d1acd8cf6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -35,15 +35,14 @@ import java.util.List; public interface ScreenCustomerAgencyDao extends BaseDao { /** *14、组织层级 - * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param agencyIds 组织id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerAgency(@Param("customerId") String customerId, - @Param("agencyIds") String[] agencyIds); + Integer deleteCustomerAgency(@Param("customerId") String customerId); /** * 14、组织层级 @@ -75,4 +74,12 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectListAgencyInfo(@Param("customerId")String customerId); + + /** + * @Description 根据agencyId查询上级组织Id + * @param agencyId + * @author zxc + * @date 2020/9/8 3:36 下午 + */ + String selectPid(@Param("agencyId")String agencyId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java index 53a5fcf042..cbe11d059c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerDeptDao.java @@ -36,15 +36,14 @@ public interface ScreenCustomerDeptDao extends BaseDao /** *16、部门信息上传 - * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param deptIds 部门Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerDept(@Param("customerId") String customerId, - @Param("deptIds") String[] deptIds); + Integer deleteCustomerDept(@Param("customerId") String customerId); /** * 16、部门信息上传 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 005f69289b..c6aac179af 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 @@ -37,15 +37,14 @@ import java.util.List; public interface ScreenCustomerGridDao extends BaseDao { /** *15、网格信息上传 - * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param gridIds 网格Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteCustomerGrid(@Param("customerId") String customerId, - @Param("gridIds") String[] gridIds); + Integer deleteCustomerGrid(@Param("customerId") String customerId); /** * 15、网格信息上传 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java index 412ab70225..d6dfeac5f8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenDifficultyDataDao.java @@ -36,7 +36,7 @@ import java.util.List; public interface ScreenDifficultyDataDao extends BaseDao { /** * 3、难点赌点 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除 * @param customerId 一 * @Author zhangyong diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java index 14c0153f62..71c0f203e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventDataDao.java @@ -35,17 +35,14 @@ import java.util.List; public interface ScreenEventDataDao extends BaseDao { /** * 4、事件数据 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId 一 - * @param eventId 多 - * @param orgId 多 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteEventData(@Param("customerId")String customerId, - @Param("eventId")String eventId, - @Param("orgId")String orgId); + Integer deleteEventData(@Param("customerId")String customerId); /** * 4、事件数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java index 835b1f112d..fed3048bba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenEventImgDataDao.java @@ -22,6 +22,8 @@ import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-事件数据图片数据 * @@ -34,10 +36,12 @@ public interface ScreenEventImgDataDao extends BaseDao /** * 根据原始事件Id,进行物理删除 * - * @param eventId + * @param eventIds * @return void * @Author zhangyong * @Date 16:47 2020-08-18 **/ - void delEventImgDataByEventId(@Param("eventId") String eventId); + void delEventImgDataByEvent(@Param("eventIds") String[] eventIds); + + void batchInsertEventImgData(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java index 3dca5cc281..24e3d65a09 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDao.java @@ -35,19 +35,16 @@ import java.util.List; public interface ScreenGovernRankDataDao extends BaseDao { /** * 5、基层治理-治理能力数据 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteGovernRankData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteGovernRankData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 5、基层治理-治理能力数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java index 4ebfc825e4..760e7abc5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java @@ -36,19 +36,16 @@ public interface ScreenIndexDataMonthlyDao extends BaseDao { /** * 6、党建引领-组织排行 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteOrgRankData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteOrgRankData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 6、党建引领-组织排行 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java index 3f2de14703..385f27d2f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyBranchDataDao.java @@ -35,19 +35,16 @@ import java.util.List; public interface ScreenPartyBranchDataDao extends BaseDao { /** * 7、基层党建-建设情况数据(支部、联建、志愿) - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deletePartyBranchData(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deletePartyBranchData(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 7、基层党建-建设情况数据(支部、联建、志愿) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java index 931c05c6bf..857958ad1c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPartyLinkMassesDataDao.java @@ -36,15 +36,14 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao { /** * 10、党建引领-先锋模范数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deletePioneerData(@Param("customerId") String customerId, - @Param("orgIds") String[] orgIds); + Integer deletePioneerData(@Param("customerId") String customerId); /** * 10、党建引领-先锋模范数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java index 5bc9ea4130..fd2fdac941 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenPublicPartiTotalDataDao.java @@ -37,15 +37,14 @@ public interface ScreenPublicPartiTotalDataDao extends BaseDao { /** * 11、基层治理-公众参与 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param customerId - * @param yearId * @param monthId - * @param orgIds 组织Id集合 + * @return java.util.Integer * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteUserJoin(@Param("customerId") String customerId, - @Param("yearId") String yearId, - @Param("monthId") String monthId, - @Param("orgIds") String[] orgIds); + Integer deleteUserJoin(@Param("customerId") String customerId, + @Param("monthId") String monthId); /** * 11、基层治理-公众参与 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java index 5595259af6..f09189dce0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserTotalDataDao.java @@ -36,15 +36,14 @@ public interface ScreenUserTotalDataDao extends BaseDao + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 区/街道相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_sub_agency_score") +public class AgencySubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织id(eg:社区或者街道id) + */ + private String agencyId; + + /** + * 上级组织id + */ + private String parentAgencyId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan + */ + private String indexCode; + + /** + * 数据类型 district :全区;street:街道 + */ + private String dataType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java index 0b21c5de92..30eb9fb66a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcScoreEntity.java @@ -71,15 +71,20 @@ public class CpcScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 指标code */ - private String indexCode; + private String indexCode; - /** - * 是否是总分 1是0不是 - */ - private String isTotal; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java new file mode 100644 index 0000000000..e69c222258 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_sub_cpc_score") +public class CpcSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + + /** + * 年维度Id: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 指标code + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 是否是总分 1是0不是 + */ + private String isTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java index 29857fdc2c..7a5dcce754 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptScoreEntity.java @@ -75,11 +75,16 @@ public class DeptScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 治理能力:zhilinengli; */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java new file mode 100644 index 0000000000..476f3c2568 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 区直部门分值表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_sub_dept_score") +public class DeptSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 部门id + */ + private String deptId; + + /** + * 部门所属的组织id + */ + private String agencyId; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是;默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 治理能力:zhilinengli; + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java index 781dca54bf..2fc442c0be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridScoreEntity.java @@ -77,14 +77,19 @@ public class GridScoreEntity extends BaseEpmetEntity { */ private String isTotal; - /** - * 分值 - */ - private BigDecimal score; - - /** - * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan - */ - private String indexCode; + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java new file mode 100644 index 0000000000..ad99f92586 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.indexcal; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("fact_index_sub_grid_score") +public class GridSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String quarterId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 1:总分;0不是 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;网格相关:wanggexiangguan + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java index d99cd7b506..5fee9d7cb3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/FactIndexCommunityScoreEntity.java @@ -75,11 +75,16 @@ public class FactIndexCommunityScoreEntity extends BaseEpmetEntity { /** * 分值 */ - private BigDecimal score; + private BigDecimal score; /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;社区相关:shequxiangguan */ - private String indexCode; + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java index e0932daeef..149c4c128c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/IndexDictEntity.java @@ -35,19 +35,24 @@ public class IndexDictEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; - /** - * 指标名 - */ + /** + * 指标名 + */ private String indexName; - /** - * 指标描述 - */ + /** + * 指标编码 + */ + private String indexCode; + + /** + * 指标描述 + */ private String indexDesc; - /** - * 指标级别(1,2,3,4,5) - */ + /** + * 指标级别(1,2,3,4,5) + */ private String level; /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java index 3fec1a9132..b172852d63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/IndexExcelDataListener.java @@ -266,6 +266,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity.setIndexName(data.getLevel1Index()); entity.setCorrelation(data.getCorrelation()); entity.setLevel("1"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel1Index(), false, 4)); indexDicMap.put(data.getLevel1Index(), entity); } if (!indexDicMap.containsKey(data.getLevel2Index())) { @@ -273,6 +274,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity2.setIndexName(data.getLevel2Index()); entity2.setCorrelation(data.getCorrelation()); entity2.setLevel("2"); + entity2.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4)); indexDicMap.put(data.getLevel2Index(), entity2); } if (!indexDicMap.containsKey(data.getLevel3Index())) { @@ -280,6 +282,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity3.setIndexName(data.getLevel3Index()); entity3.setCorrelation(data.getCorrelation()); entity3.setLevel("3"); + entity3.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4)); indexDicMap.put(data.getLevel3Index(), entity3); } if (!indexDicMap.containsKey(data.getLevel4Index())) { @@ -287,6 +290,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity4.setIndexName(data.getLevel4Index()); entity4.setCorrelation(data.getCorrelation()); entity4.setLevel("4"); + entity4.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4)); indexDicMap.put(data.getLevel4Index(), entity4); } if (!indexDicMap.containsKey(data.getLevel5Index())) { @@ -294,6 +298,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setIndexName(data.getLevel5Index()); entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); + entity5.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); indexDicMap.put(data.getLevel5Index(), entity5); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java index a1ab0ad1bf..7866473d6f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/IndexCalculateService.java @@ -1,6 +1,6 @@ package com.epmet.service.evaluationindex.indexcal; -import com.epmet.dto.screen.form.IndexCalculateForm; +import com.epmet.dto.indexcal.CalculateCommonFormDTO; /** * 指标计算service @@ -11,8 +11,9 @@ import com.epmet.dto.screen.form.IndexCalculateForm; public interface IndexCalculateService { /** * desc:按照客户计算所有指标(按照月份) + * * @param formDTO * @return */ - Boolean indexCalculate(IndexCalculateForm formDTO); + Boolean indexCalculate(CalculateCommonFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java index 52cb4e3fc6..139353e83c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/CpcIndexCalculateServiceImpl.java @@ -9,9 +9,11 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.CpcScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CpcSubScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.entity.evaluationindex.indexcal.CpcSubScoreEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; @@ -23,6 +25,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -48,6 +51,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { private IndexCodeFieldReService indexCodeFieldReService; @Autowired private CpcScoreDao cpcScoreDao; + @Autowired + private CpcSubScoreDao cpcSubScoreDao; @Override public Boolean cpcIndexCalculate(CalculateCommonFormDTO formDTO) { @@ -72,7 +77,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { Map indexWeightMap = parentIndexDetails.stream().collect(Collectors.toMap(IndexGroupDetailEntity::getIndexCode, o -> o)); //获取数据 - List list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId()); + List list = cpcScoreDao.getPartScore(formDTO.getCustomerId(), formDTO.getMonthId(), IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); if (CollectionUtils.isEmpty(list)) { log.error("calculateTotalScore cpcScoreDao.getPartScore return empty,customerId:{},monthId:{}", formDTO.getCustomerId(), formDTO.getMonthId()); throw new RenException("客户四级指标分值记录不存在"); @@ -82,11 +87,16 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { CpcScoreEntity totalEntity = null; for (CpcScoreEntity part : partScoreList) { IndexGroupDetailEntity indexGroupDetailEntity = indexWeightMap.get(part.getIndexCode()); + if (indexGroupDetailEntity == null) { + log.error(" indexCode:{} 在指标明细中不存在", part.getIndexCode()); + continue; + } if (totalEntity == null) { totalEntity = ConvertUtils.sourceToTarget(part, CpcScoreEntity.class); totalEntity.setIsTotal(NumConstant.ONE_STR); totalEntity.setIndexCode(IndexCodeEnum.DANG_YUAN_XIANG_GUAN.getCode()); totalEntity.setScore(new BigDecimal(0)); + totalEntity.setAllParentIndexCode(indexGroupDetailEntity.getAllParentIndexCode()); cpcScoreTotalMap.put(userId, totalEntity); } //自建群活跃度——议题转项目率 有阈值 >60%按60%算 @@ -130,6 +140,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param indexCode 指标code 非必填 * @param values */ + @Transactional(rollbackFor = Exception.class) private void deleteAndInsertBatch(CalculateCommonFormDTO formDTO, Collection values, String indexCode) { cpcScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), indexCode); cpcScoreDao.insertBatch(values); @@ -156,22 +167,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { do { list = factIndexPartyAblityCpcMonthlyDao.getCountByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), (pageNo - 1) * pageSize, pageSize); if (!CollectionUtils.isEmpty(list)) { - //如果是第一页且仅有一条数据 则直接给50分 - if (pageNo == NumConstant.ONE && list.size() == NumConstant.ONE) { - List insertList = new ArrayList<>(); - for (String parentIndexCode : groupIndexDetailsMap.keySet()) { - insertList.add(handleOneGridScene(formDTO, parentIndexCode, list.get(0))); - } - if (CollectionUtils.isEmpty(insertList)) { - deleteAndInsertBatch(formDTO, insertList, null); - } - } else { - //遍历指标分组 计算分数 - for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { - String parentIndexCode = entry.getKey(); - List details = entry.getValue(); - calculateScore(formDTO, details, list, minAndMaxMap, parentIndexCode); - } + //遍历指标分组 计算分数 + for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { + String indexCode = entry.getKey(); + List details = entry.getValue(); + calculateScore(formDTO, details, list, minAndMaxMap, indexCode); } } pageNo++; @@ -215,7 +215,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { cpcScoreEntity.setMonthId(formDTO.getMonthId()); cpcScoreEntity.setScore(new BigDecimal(0)); cpcScoreEntity.setIndexCode(parentIndexCode); - + cpcScoreEntity.setAllParentIndexCode(value.getAllParentIndexCode()); scoreEntityMap.put(userId, cpcScoreEntity); //构造样本值对象 @@ -224,7 +224,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } } log.info("计算的参数:{}", JSON.toJSONString(indexMap)); - HashMap result = calculateScore(indexMap); + HashMap result = calculateScore(indexMap); log.info("计算的结果:{}", result); //处理结果 @@ -244,15 +244,45 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param result */ @Transactional(rollbackFor = Exception.class) - public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { + public void saveCpcScore(CalculateCommonFormDTO formDTO, Map indexDetails, String parentIndexCode, HashMap result) { List list = new ArrayList<>(); - result.forEach((userId, score) -> { + List subList = new ArrayList<>(); + String allParentIndexCode = null; + for (Map.Entry entry : result.entrySet()) { + String userId = entry.getKey(); + CalculateResult score = entry.getValue(); CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); - cpcScoreEntity.setScore(score); + cpcScoreEntity.setScore(score.getTotalScore()); + allParentIndexCode = score.getDetails().get(0).getAllParentIndexCode(); + cpcScoreEntity.setAllParentIndexCode(allParentIndexCode.substring(0, allParentIndexCode.lastIndexOf(StrConstant.COLON))); list.add(cpcScoreEntity); - }); + CpcScoreEntity parent = ConvertUtils.sourceToTarget(cpcScoreEntity, CpcScoreEntity.class); + score.getDetails().forEach(o -> { + CpcSubScoreEntity child = ConvertUtils.sourceToTarget(parent, CpcSubScoreEntity.class); + child.setIndexCode(o.getIndexCode()); + child.setAllParentIndexCode(o.getAllParentIndexCode()); + child.setScore(o.getScore()); + subList.add(child); + }); + + } + System.out.println("value:" + JSON.toJSONString(list)); this.deleteAndInsertBatch(formDTO, list, parentIndexCode); + this.deleteAndInsertSubBatch(formDTO, subList, allParentIndexCode); + } + + /** + * desc:根据客户id和月份Id 指标code 非必填 删除数据 + * + * @param formDTO + * @param subList + * @param parentIndexCode 指标code 非必填 + */ + @Transactional(rollbackFor = Exception.class) + public void deleteAndInsertSubBatch(CalculateCommonFormDTO formDTO, List subList, String parentIndexCode) { + cpcSubScoreDao.deleteByMonthId(formDTO.getCustomerId(), formDTO.getMonthId(), parentIndexCode); + cpcSubScoreDao.insertBatch(subList); } @@ -285,7 +315,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { minValue = new BigDecimal(String.valueOf(minAndMaxMap.get(minValueKey))); //如果最大值超过阈值 则最大值为阈值 if (new BigDecimal(NumConstant.ONE_NEG).compareTo(index.getThreshold()) != NumConstant.ZERO - && maxValue.compareTo(new BigDecimal(NumConstant.ONE_NEG)) == NumConstant.ONE) { + && maxValue.compareTo(index.getThreshold()) == NumConstant.ONE) { maxValue = index.getThreshold(); } //分值计算器 @@ -295,7 +325,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { ScoreConstants.MAX_SCORE, Correlation.getCorrelation(index.getCorrelation()) ); - IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); + IndexInputVO indexInputVO = new IndexInputVO(index.getIndexCode(), index.getAllParentIndexCode(), new ArrayList<>(), index.getThreshold(), index.getWeight(), scoreCalculator); map.put(index.getIndexCode(), indexInputVO); } return map; @@ -307,11 +337,11 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { * @param indexMap * @return */ - private HashMap calculateScore(Map> indexMap) { + private HashMap calculateScore(Map> indexMap) { //构造入参 List indexInputVOS = indexMap.values().stream().collect(Collectors.toList()); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - return batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + return batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java index 959f3caa64..dba7178f96 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/DeptScoreServiceImpl.java @@ -249,6 +249,7 @@ public class DeptScoreServiceImpl extends BaseServiceImpl> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), + index.getAllParentIndexCode(), sampleValueList, index.getThreshold(), // new BigDecimal("-1"), //FOR TEST 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 abbe326a81..1db443914c 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 @@ -454,11 +454,12 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { ); List> sampleValueList = new ArrayList<>(); IndexInputVO indexInputVO1 = new IndexInputVO(index.getIndexCode(), - sampleValueList, - index.getThreshold(), + index.getAllParentIndexCode(), + sampleValueList, + index.getThreshold(), // new BigDecimal("-1"),//FOR TEST - index.getWeight(), - scoreCalculator); + index.getWeight(), + scoreCalculator); map.put(index.getIndexCode(), indexInputVO1); } return map; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index f25e27deb6..d98981e803 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -8,11 +8,11 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; +import com.epmet.dao.evaluationindex.indexcal.GridScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; -import com.epmet.dao.evaluationindex.screen.FactIndexGridScoreDao; import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.dto.screen.result.SubGridAvgResultDTO; @@ -26,6 +26,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -59,9 +60,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + private CommunityScoreDao factIndexCommunityScoreDao; @Autowired - private FactIndexGridScoreDao factIndexGridScoreDao; + private GridScoreDao factIndexGridScoreDao; /** * @param customerId @@ -78,7 +79,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { @@ -86,23 +87,19 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - return; - }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd); - subPartyAvgList.forEach( party -> { + subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -115,25 +112,21 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); - return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } else { List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach( publish -> { + publishArticleList.forEach(publish -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -141,10 +134,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId); + deleteAndInsert(result); return true; } @@ -162,30 +156,25 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.error("社区下级治理能力平均分集合为空"); return; - } - if (subGridGovernAvg.size() == NumConstant.ONE) { - pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (subGridGovernAvg.size() > NumConstant.ONE) { + }else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -195,11 +184,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (CollectionUtils.isEmpty(communityGovernAbility)){ log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); return; - }else if (communityGovernAbility.size() == NumConstant.ONE) { - pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (communityGovernAbility.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -212,11 +197,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); governAbility.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -224,10 +209,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -245,27 +230,26 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (subGridServiceAvg.size() == NumConstant.ONE) { - pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + if (CollectionUtils.isEmpty(subGridServiceAvg)) { + log.error("查询社区下级所有网格服务能力得分平均值集合为空"); return; - } else if (subGridServiceAvg.size() > NumConstant.ONE) { + } else { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -274,11 +258,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (CollectionUtils.isEmpty(communityActivityCountList)) { log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); return; - }else if (communityActivityCountList.size() == NumConstant.ONE) { - pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - return; - } else if (communityActivityCountList.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -291,11 +271,11 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -303,10 +283,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -338,13 +318,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setYearId(DateUtils.getYearId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); + score.setAllParentIndexCode(NumConstant.ZERO_STR); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); - deleteAndInsert(customerId, monthId, IndexCalConstant.COMMUNITY_RELATE, result); + deleteAndInsert(result); return true; } @@ -391,33 +372,29 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } /** - * @param customerId - * @param monthId - * @param indexCode * @param subAllGridList * @Description 先删除记录,在插入 * @author zxc * @date 2020/9/1 4:24 下午 */ @Transactional(rollbackFor = Exception.class) - public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllGridList) { + public void deleteAndInsert(List subAllGridList) { if (!CollectionUtils.isEmpty(subAllGridList)) { - factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } } /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + public List getResultB(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,String allParentIndexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); @@ -428,29 +405,35 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setYearId(DateUtils.getYearId(monthId)); score.setIsTotal(isTotal); score.setIndexCode(indexCode); - score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ + score.setScore(v.getTotalScore()); + score.setAllParentIndexCode(allParentIndexCode); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); + if (!CollectionUtils.isEmpty(v.getDetails())) { + v.getDetails().forEach(fiveDetail -> { + FactIndexCommunityScoreDTO s = new FactIndexCommunityScoreDTO(); + s.setCustomerId(customerId); + s.setAgencyId(k); + s.setMonthId(monthId); + s.setQuarterId(DateUtils.getQuarterId(monthId)); + s.setYearId(DateUtils.getYearId(monthId)); + s.setIsTotal(isTotal); + s.setIndexCode(fiveDetail.getIndexCode()); + s.setScore(fiveDetail.getScore()); + s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode()); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + s.setParentAgencyId(parentAgency); + } + }); + result.add(s); + }); + } result.add(score); }); return result; } - - /** - * @Description 当查询结果为一条时,调用此方法 - * @param agencyId - * @param customerId - * @param monthId - * @author zxc - * @date 2020/9/2 2:40 下午 - */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ - HashMap scoreCountOfSampleId = new HashMap<>(); - scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); - deleteAndInsert(customerId, monthId, indexCode, result); - } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 9baa63df36..652958151d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; +import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -23,6 +24,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -55,6 +57,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private AgencyScoreDao agencyScoreDao; @Autowired private DeptScoreDao deptScoreDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; /** * @Description 计算全区相关总分 @@ -99,7 +103,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -107,22 +111,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subGridPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - return; - }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { + } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); - subPartyAvgList.forEach( party -> { + subPartyAvgList.forEach(party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -135,34 +135,31 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); - return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } else{ List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); List>> publishArticleList = ListUtils.partition(publishArticleCountList, IndexCalConstant.PAGE_SIZE); - publishArticleList.forEach( publish -> { + publishArticleList.forEach(publish -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + agencyScoreDao.deleteOldRecord(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); + deleteAndInsert(result); return true; } @@ -180,36 +177,34 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); - if (districtGovernAvgList.size() == NumConstant.ONE) { - pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + if (CollectionUtils.isEmpty(districtGovernAvgList)) { + log.error("查询所有街道治理能力平均值集合为空"); return; - } else if (districtGovernAvgList.size() > NumConstant.ONE) { + } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (deptScoreAvgList.size() == NumConstant.ONE) { - pid.put(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),deptScoreAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + if (CollectionUtils.isEmpty(deptScoreAvgList)) { + log.error("查询所有直属部门治理能力平均值集合为空"); return; - } else if (deptScoreAvgList.size() > NumConstant.ONE) { + } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { @@ -220,7 +215,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -229,9 +224,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -249,27 +244,26 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); - if (subStreetAvgList.size() == NumConstant.ONE) { - pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); - sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + if (CollectionUtils.isEmpty(subStreetAvgList)) { + log.error("查询区下属街道服务能力汇总平均值集合为空"); return; - } else if (subStreetAvgList.size() > NumConstant.ONE) { + } else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); - SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); + pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -278,9 +272,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -313,13 +307,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); + score.setAllParentIndexCode(NumConstant.ZERO_STR); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); - deleteAndInsert(customerId, monthId, IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), result); + deleteAndInsert(result); return true; } @@ -339,33 +334,29 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } /** - * @param customerId - * @param monthId - * @param indexCode * @param subAllDistrict * @Description 先删除记录,在插入 * @author zxc * @date 2020/9/1 4:24 下午 */ @Transactional(rollbackFor = Exception.class) - public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllDistrict) { + public void deleteAndInsert(List subAllDistrict) { if (!CollectionUtils.isEmpty(subAllDistrict)) { - agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL); agencyScoreDao.insertStreetRecord(subAllDistrict); } } /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + public List getResultB(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, String allParentIndexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -376,30 +367,38 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setYearId(DateUtils.getYearId(monthId)); score.setIsTotal(isTotal); score.setIndexCode(indexCode); - score.setScore(v); + score.setScore(v.getTotalScore()); + score.setAllParentIndexCode(allParentIndexCode); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); + if (!CollectionUtils.isEmpty(v.getDetails())){ + v.getDetails().forEach(streetScore -> { + AgencyScoreDTO s = new AgencyScoreDTO(); + s.setCustomerId(customerId); + s.setAgencyId(k); + s.setMonthId(monthId); + s.setQuarterId(DateUtils.getQuarterId(monthId)); + s.setYearId(DateUtils.getYearId(monthId)); + s.setIsTotal(isTotal); + s.setIndexCode(streetScore.getIndexCode()); + s.setScore(streetScore.getScore()); + s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); + s.setDataType(IndexCalConstant.DISTRICT_LEVEL); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + s.setParentAgencyId(parentAgency); + } + }); + result.add(s); + }); + } result.add(score); }); return result; } - /** - * @Description 当查询结果为一条时,调用此方法 - * @param agencyId - * @param customerId - * @param monthId - * @author zxc - * @date 2020/9/2 2:40 下午 - */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ - HashMap scoreCountOfSampleId = new HashMap<>(); - scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); - deleteAndInsert(customerId, monthId, indexCode, result); - } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java index 9385c1f121..5ab74faadf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateServiceImpl.java @@ -2,21 +2,22 @@ package com.epmet.service.evaluationindex.indexcal.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.screen.form.IndexCalculateForm; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.redis.IndexCodeFieldReRedis; import com.epmet.service.evaluationindex.indexcal.*; +import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -44,78 +45,98 @@ public class IndexCalculateServiceImpl implements IndexCalculateService { private IndexCalculateDistrictService indexCalculateDistrictService; @Autowired private DeptScoreService deptScoreService; + @Autowired + private FactIndexCollectService factIndexCollectService; + @Override - public Boolean indexCalculate(IndexCalculateForm formDTO) { + public Boolean indexCalculate(CalculateCommonFormDTO formDTO) { try { if (StringUtils.isBlank(formDTO.getMonthId())) { //默认 当前月份-1 formDTO.setMonthId(DimIdGenerator.getMonthDimId(DateUtils.addDateMonths(new Date(), -1))); } //按照客户分组 - if (CollectionUtils.isEmpty(formDTO.getCustomerIds())) { + List customerIds = new ArrayList<>(); + if (StringUtils.isBlank(formDTO.getCustomerId())) { Result> externalCustomerIdsResult = epmetCommonServiceOpenFeignClient.getExternalCustomerIds(); if (!externalCustomerIdsResult.success()) { log.error("indexCalculate epmetCommonServiceOpenFeignClient.getExternalCustomerIds return fail"); return false; } - formDTO.setCustomerIds(externalCustomerIdsResult.getData()); + customerIds = externalCustomerIdsResult.getData(); + } else { + customerIds.add(formDTO.getCustomerId()); } Boolean flag = false; - for (String customerId : formDTO.getCustomerIds()) { + for (String customerId : customerIds) { CalculateCommonFormDTO calculateCommonFormDTO = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); - //计算党员相关的 try { - CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); - flag = cpcIndexCalculateService.cpcIndexCalculate(param); - log.info("indexCalculate cpcIndexCalculate return result:{}", flag); - } catch (Exception e) { - log.error("indexCalculate cpcIndexCalculate exception", e); - break; - } + //计算党员相关的 + try { + CalculateCommonFormDTO param = new CalculateCommonFormDTO(customerId, formDTO.getMonthId()); + flag = cpcIndexCalculateService.cpcIndexCalculate(param); + log.info("indexCalculate cpcIndexCalculate return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate cpcIndexCalculate exception", e); + throw new RenException("indexCalculate cpcIndexCalculate exception", e); + } - //计算网格 - try { - flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); - log.info("indexCalculate calculateGridCorreLation return result:{}", flag); - } catch (Exception e) { - log.error("indexCalculate calculateGridCorreLation exception", e); - break; - } - //计算社区 - try { - indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); - log.info("indexCalculate calAll return result:{}", flag); - } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; - } + //计算网格 + try { + flag = gridCorreLationService.calculateGridCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calculateGridCorreLation return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calculateGridCorreLation exception", e); + throw new RenException("indexCalculate calculateGridCorreLation exception", e); + } + //计算社区 + try { + flag = indexCalculateCommunityService.calCommunityAll(customerId, formDTO.getMonthId()); + log.info("indexCalculate calCommunityAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calCommunityAll exception", e); + throw new RenException("indexCalculate calAll exception", e); + } - //计算街道 - try { - indexCalculateStreetService.calStreetAll(customerId,formDTO.getMonthId()); - log.info("indexCalculate calAll return result:{}", flag); - } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; - } + //计算街道 + try { + flag = indexCalculateStreetService.calStreetAll(customerId, formDTO.getMonthId()); + log.info("indexCalculate calStreetAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calStreetAll exception", e); + throw new RenException("indexCalculate calStreetAll exception", e); + } - //计算区直属 - try { - deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); - log.info("indexCalculate calAll return result:{}", flag); - } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; + //计算区直属 + try { + flag = deptScoreService.calculateDeptCorreLation(calculateCommonFormDTO); + log.info("indexCalculate calculateDeptCorreLation return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calculateDeptCorreLation exception", e); + throw new RenException("indexCalculate calculateDeptCorreLation exception", e); + } + + //计算全区 + try { + indexCalculateDistrictService.calDistrictAll(customerId, formDTO.getMonthId()); + log.info("indexCalculate calDistrictAll return result:{}", flag); + } catch (Exception e) { + log.error("indexCalculate calDistrictAll exception", e); + throw new RenException("indexCalculate calDistrictAll exception", e); + } + } catch (RenException e) { + flag = false; } - //计算全区 - try { - indexCalculateDistrictService.calDistrictAll(customerId,formDTO.getMonthId()); - log.info("indexCalculate calAll return result:{}", flag); - } catch (Exception e) { - log.error("indexCalculate calAll exception", e); - break; + //计算完毕后 将结果插入大屏相关数据表 + if (flag) { + try { + factIndexCollectService.insertScreenIndexDataMonthlyAndYearly(formDTO.getMonthId(), formDTO.getCustomerId()); + } catch (Exception e) { + log.error("indexCalculate insertScreenIndexDataMonthlyAndYearly exception", e); + flag = false; + } } } return flag; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index e18de69bb2..8efe24bbed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -8,10 +8,10 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.IndexCalConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -25,6 +25,7 @@ import com.epmet.support.normalizing.Correlation; import com.epmet.support.normalizing.ScoreCalculator; import com.epmet.support.normalizing.ScoreConstants; import com.epmet.support.normalizing.batch.BatchScoreCalculator; +import com.epmet.support.normalizing.batch.CalculateResult; import com.epmet.support.normalizing.batch.IndexInputVO; import com.epmet.support.normalizing.batch.SampleValue; import lombok.extern.slf4j.Slf4j; @@ -58,7 +59,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityScoreDao communityScoreDao; + private CommunityScoreDao communityScoreDao; @Autowired private AgencyScoreDao agencyScoreDao; @@ -105,7 +106,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -113,11 +114,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); return; - }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ - pid.put(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),subCommPartyAvgScore.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - return; - }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { + } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); @@ -129,7 +126,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -142,33 +139,30 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldName)) { - log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); - return; - }else if (mapList.size() == NumConstant.ONE){ - pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (mapList.size() > NumConstant.ONE) { + }else{ MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); List>> publishArticleList = ListUtils.partition(mapList, IndexCalConstant.PAGE_SIZE); publishArticleList.forEach(publish -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + agencyScoreDao.deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL); + deleteAndInsert(result); return true; } @@ -186,15 +180,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - if (subGridGovernAvg.size() == NumConstant.ONE) { - pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); + if (CollectionUtils.isEmpty(subGridGovernAvg)){ + log.error("查询街道下属所有社区治理能力汇总为空"); return; - } else if (subGridGovernAvg.size() > NumConstant.ONE) { + }else if (subGridGovernAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { @@ -205,7 +198,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ index1SampleValues.add(s); }); BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -215,11 +208,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (CollectionUtils.isEmpty(communityGovernAbility)){ log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); return; - }else if (communityGovernAbility.size() == NumConstant.ONE) { - pid.put(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - return; - } else if (communityGovernAbility.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -230,23 +219,22 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List>> governAbilityList = ListUtils.partition(communityGovernAbility, IndexCalConstant.PAGE_SIZE); governAbilityList.forEach(governAbility -> { ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); - System.err.println(detail.getCorrelation()); List index1SampleValues = new ArrayList<>(); governAbility.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); - deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -264,16 +252,15 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); + Map pid = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); - if (subCommServiceAvg.size() == NumConstant.ONE) { - pid.put(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),subCommServiceAvg.get(NumConstant.ZERO).getParentId()); - sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); + if (CollectionUtils.isEmpty(subCommServiceAvg)) { + log.error("查询街道下属社区服务能力得分平均值为空"); return; - } else if (subCommServiceAvg.size() > NumConstant.ONE) { + } else if (subCommServiceAvg.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE); serviceAvgList.forEach(serviceAvg -> { @@ -284,7 +271,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -293,11 +280,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (CollectionUtils.isEmpty(communityActivityCountList)) { log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); return; - }else if (communityActivityCountList.size() == NumConstant.ONE) { - pid.put(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); - return; - } else if (communityActivityCountList.size() > NumConstant.ONE) { + }else{ String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); if (StringUtils.isEmpty(fieldNameByIndexCode)) { log.error(String.format(IndexCalConstant.INDEX_CODE_NULL,detail.getIndexCode())); @@ -310,21 +293,20 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); communityActivity.forEach(c -> { - pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(),c.get(IndexCalConstant.PARENT_ID).toString()); + pid.put(c.get(IndexCalConstant.AGENCY_ID).toString(), c.get(IndexCalConstant.PARENT_ID).toString()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } } }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); - HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid - ); - deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); + List result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + deleteAndInsert(result); return true; } @@ -357,13 +339,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setQuarterId(DateUtils.getQuarterId(monthId)); score.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); score.setDataType(IndexCalConstant.STREET_LEVEL); + score.setAllParentIndexCode(NumConstant.ZERO_STR); value.forEach(street -> { score.setScore(score.getScore().add(street.getScore())); score.setParentAgencyId(street.getParentAgencyId()); }); result.add(score); }); - deleteAndInsert(customerId, monthId, IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), result); + deleteAndInsert(result); return true; } @@ -383,33 +366,29 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } /** - * @param customerId - * @param monthId - * @param indexCode * @param subAllCommunityList * @Description 先删除记录,在插入 * @author zxc * @date 2020/9/1 4:24 下午 */ @Transactional(rollbackFor = Exception.class) - public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllCommunityList) { + public void deleteAndInsert(List subAllCommunityList) { if (!CollectionUtils.isEmpty(subAllCommunityList)) { - agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.STREET_LEVEL); agencyScoreDao.insertStreetRecord(subAllCommunityList); } } /** + * @param scoreCountOfSampleId 指标计算结果 + * @param customerId 客户ID + * @param monthId 月份ID + * @param isTotal 是否 总分【党建+治理+服务】 + * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @Description - * @param scoreCountOfSampleId 指标计算结果 - * @param customerId 客户ID - * @param monthId 月份ID - * @param isTotal 是否 总分【党建+治理+服务】 - * @param indexCode 党建能力:dangjiannengli,治理能力:zhilinengli,服务能力:fuwunengli,xx相关:xx相关 * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,Map pid) { + public List getResultB(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, String allParentIndexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -420,29 +399,37 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setYearId(DateUtils.getYearId(monthId)); score.setIsTotal(isTotal); score.setIndexCode(indexCode); - score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ + score.setScore(v.getTotalScore()); + score.setAllParentIndexCode(allParentIndexCode); + score.setDataType(IndexCalConstant.STREET_LEVEL); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { score.setParentAgencyId(parentAgency); } }); + if (!CollectionUtils.isEmpty(v.getDetails())){ + v.getDetails().forEach(streetScore -> { + AgencyScoreDTO s = new AgencyScoreDTO(); + s.setCustomerId(customerId); + s.setAgencyId(k); + s.setMonthId(monthId); + s.setQuarterId(DateUtils.getQuarterId(monthId)); + s.setYearId(DateUtils.getYearId(monthId)); + s.setIsTotal(isTotal); + s.setIndexCode(streetScore.getIndexCode()); + s.setScore(streetScore.getScore()); + s.setDataType(IndexCalConstant.STREET_LEVEL); + s.setAllParentIndexCode(streetScore.getAllParentIndexCode()); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + s.setParentAgencyId(parentAgency); + } + }); + result.add(s); + }); + } result.add(score); }); return result; } - - /** - * @Description 当查询结果为一条时,调用此方法 - * @param agencyId - * @param customerId - * @param monthId - * @author zxc - * @date 2020/9/2 2:40 下午 - */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ - HashMap scoreCountOfSample = new HashMap<>(); - scoreCountOfSample.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); - deleteAndInsert(customerId, monthId, indexCode, result); - } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java index e88e5d55a3..98d0fc95af 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexCollectService.java @@ -26,7 +26,7 @@ public interface FactIndexCollectService { /** * 2、党建能力-网格相关指标上报(按照月份) - * 根据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -34,11 +34,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridPartyAbility(List formDTO, String customerId); + void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId); /** * 3、党建能力-街道及社区相关指标 - * 根据CUSTOMER_ID、AGENCY_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -46,11 +46,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgPartyAbility(List formDTO, String customerId); + void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId); /** * 4、服务能力-网格相关指标 - * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -58,11 +58,11 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridServiceAbility(List formDTO, String customerId); + void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId); /** * 5、服务能力-组织(街道|社区|全区)相关指标 - * 据CUSTOMER_ID、AGENCY_ID、GRID_ID、YEAR_ID、MONTH_ID、QUARTER_ID进行查询,如果有数据,则先进行物理删除 + * 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * * @param formDTO * @param customerId @@ -70,7 +70,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgServiceAbility(List formDTO, String customerId); + void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId); /** * 6、治理能力-网格相关指标 @@ -82,7 +82,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertGridGovrnAbility(List formDTO, String customerId); + void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId); /** * 7、治理能力-街道及社区相关指标 @@ -94,7 +94,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertOrgGovrnAbility(List formDTO, String customerId); + void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId); /** * 8、治理能力-部门相关指标 @@ -106,7 +106,7 @@ public interface FactIndexCollectService { * @Author zhangyong * @Date 10:52 2020-08-20 **/ - void insertDeptGovrnAbility(List formDTO, String customerId); + void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId); /** * 将网格、社区、区直部门、区/街道分支记录表中的数据,抽取到 指数-指数数据(每月数值) 指数-指数数据(按年统计) 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 2d6a2c48ed..ce32b2ff4d 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 @@ -1,14 +1,14 @@ package com.epmet.service.evaluationindex.indexcoll.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; +import com.epmet.dao.evaluationindex.indexcal.CommunityScoreDao; 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; @@ -19,16 +19,11 @@ import com.epmet.dto.screen.FactIndexCommunityScoreDTO; import com.epmet.dto.screen.FactIndexGridScoreDTO; import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; -import com.epmet.entity.evaluationindex.indexcal.AgencyScoreEntity; -import com.epmet.entity.evaluationindex.indexcal.DeptScoreEntity; -import com.epmet.entity.evaluationindex.screen.FactIndexCommunityScoreEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerDeptEntity; import com.epmet.eum.IndexCodeEnum; import com.epmet.service.evaluationindex.indexcoll.FactIndexCollectService; import lombok.extern.slf4j.Slf4j; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -48,7 +43,6 @@ import java.util.stream.Collectors; @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) public class FactIndexCollectServiceImpl implements FactIndexCollectService { - private static final Logger log = LoggerFactory.getLogger(FactIndexCollectServiceImpl.class); @Autowired private FactIndexPartyAblityCpcMonthlyDao factIndexPartyAblityCpcMonthlyDao; @@ -67,9 +61,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private FactIndexGovrnAblityDeptMonthlyDao factIndexGovrnAblityDeptMonthlyDao; @Autowired - private FactIndexGridScoreDao factIndexGridScoreDao; + private GridScoreDao factIndexGridScoreDao; @Autowired - private FactIndexCommunityScoreDao factIndexCommunityScoreDao; + private CommunityScoreDao factIndexCommunityScoreDao; @Autowired private DeptScoreDao deptScoreDao; @Autowired @@ -85,7 +79,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { @Autowired private ScreenCustomerAgencyDao screenCustomerAgencyDao; - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridPartyMemberData(GridPartyMemberDataFormDTO formDTO, String customerId) { @@ -96,122 +89,109 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deleteNum = factIndexPartyAblityCpcMonthlyDao.deleteFactIndexPartyAblityCpcMonthly(customerId, formDTO.getMonthId()); } while (deleteNum != NumConstant.ZERO); } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getPartyMemberDataList())) { - factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getPartyMemberDataList(), customerId); + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityCpcMonthlyDao.batchInsertFactIndexPartyAblityCpcMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridPartyAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO, customerId); + public void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexPartyAblityGridMonthlyDao.deleteFactIndexPartyAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if ( !CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityGridMonthlyDao.batchInsertFactIndexPartyAblityGridMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgPartyAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO, customerId); + public void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexPartyAblityOrgMonthlyDao.deleteFactIndexPartyAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexPartyAblityOrgMonthlyDao.batchInsertFactIndexPartyAblityOrgMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridServiceAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO, customerId); + public void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexServiceAblityGridMonthlyDao.deleteFactIndexServiceAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexServiceAblityGridMonthlyDao.batchInsertFactIndexServiceAblityGridMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgServiceAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO, customerId); + public void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexServiceAblityOrgMonthlyDao.deleteFactIndexServiceAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexServiceAblityOrgMonthlyDao.batchInsertFactIndexServiceAblityOrgMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGridGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getGridId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO, customerId); + public void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityGridMonthlyDao.deleteFactIndexGovrnAblityGridMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityGridMonthlyDao.batchInsertFactIndexGovrnAblityGridMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertOrgGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - formDTO.get(NumConstant.ZERO).getQuarterId(), - agencyIds); - factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO, customerId); + public void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityOrgMonthlyDao.deleteFactIndexGovrnAblityOrgMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityOrgMonthlyDao.batchInsertFactIndexGovrnAblityOrgMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertDeptGovrnAbility(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, - formDTO.get(i).getAgencyId(), formDTO.get(i).getDeptId(), formDTO.get(i).getYearId(), - formDTO.get(i).getMonthId(), formDTO.get(i).getQuarterId()); - } - factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO, customerId); + public void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = factIndexGovrnAblityDeptMonthlyDao.deleteFactIndexGovrnAblityDeptMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + factIndexGovrnAblityDeptMonthlyDao.batchInsertFactIndexGovrnAblityDeptMonthly(formDTO.getDataList(), customerId); } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { @@ -233,7 +213,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { /** * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,在插入网格相关分值表。 一对四 + * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -242,6 +222,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexGridScore(String monthId, String customerId){ + List mismatchGridList = new ArrayList<>(); // 查询网格相关分值记录 表已经存在的网格id List indexGridIds = factIndexGridScoreDao.selectListGridId(customerId, monthId); if (indexGridIds.size() > NumConstant.ZERO){ @@ -251,25 +232,57 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { gridIds[i] = indexGridIds.get(i); } // 进行不匹配查询(即返回网格相关分值表 中不存在的网格信息)。 - List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); - // 将 网格相关分值表 中,本月份没有的网格信息,按照 4种类型,各新增一遍,赋默认值 0 - if (mismatchGridList.size() > NumConstant.ZERO){ - this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); - } + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, gridIds); } else { - // 将所有的网格按照 4种类型,各赋一遍默认值 - List mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); - this.insertIndexGridScoreDefaultValue(monthId, customerId, mismatchGridList); + mismatchGridList = screenCustomerGridDao.selectListMismatchGridInfo(customerId, null); + } + boolean delFlag = true; + if (!CollectionUtils.isEmpty(mismatchGridList)){ + // 如果进行不匹配查询,查到了其他网格信息,一律赋默认值 + this.insertIndexMonthlyByGridDefaultScore(monthId, customerId, mismatchGridList); + delFlag = false; } - // 开始处理实际分数 // fact_index_grid_score 网格相关分值记录表 grid List gridScoreDTOS = factIndexGridScoreDao.selectListGridScore(customerId, monthId); - this.insertIndexDataMonthlyByGridScore(monthId, customerId, gridScoreDTOS); + // 开始处理实际分数 + this.insertIndexDataMonthlyByGridScore(delFlag, monthId, customerId, gridScoreDTOS); + } + + /** + * 将网格相关分值记录表中缺少的网格 数据,赋默认值 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param gridScoreDTOS 网格相关分值记录表 当前客户不存在的网格数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexMonthlyByGridDefaultScore(String monthId, String customerId, List gridScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (int i = NumConstant.ZERO; i < gridScoreDTOS.size(); i++){ + IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); + monthlyDTO.setIndexTotal(zero); + monthlyDTO.setPartyDevAblity(zero); + monthlyDTO.setServiceAblity(zero); + monthlyDTO.setGovernAblity(zero); + // 补充表中其他字段 + monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, gridScoreDTOS.get(i).getGridId(), + gridScoreDTOS.get(i).getParentAgencyId(), gridScoreDTOS.get(i).getGridName(), monthlyDTO); + monthlyFormDTOList.add(monthlyDTO); + } + int deleteNum; + do { + deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId,monthId); + } while (deleteNum != NumConstant.ZERO); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } /** * 将网格相关分值记录表 数据 插入月表 screenIndexDataMonthlyDao * + * @param delFlag true: 执行删除语句;false:已经删过一次了,本次只添加不删除 * @param monthId 202008 * @param customerId 客户id * @param gridScoreDTOS 网格相关分值记录表 当前客户所属月份数据集 @@ -277,19 +290,15 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Author zhangyong * @Date 14:17 2020-09-03 **/ - private void insertIndexDataMonthlyByGridScore(String monthId, String customerId, List gridScoreDTOS){ + private void insertIndexDataMonthlyByGridScore(boolean delFlag, String monthId, String customerId, List gridScoreDTOS){ List monthlyFormDTOList = new ArrayList<>(); // 根据网格id进行分组,最后组装一条数据 一个网格 对应 4条数据 Map> collect = gridScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexGridScoreDTO::getGridId)); // 查询网格的 上级组织id 和 组织名称 List parentGridList = screenCustomerGridDao.selectListGridInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> gridScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 网格id - orgIds[j] = gridScore.getKey(); - j++; + // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < gridScore.getValue().size(); i++){ @@ -324,14 +333,19 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + if (delFlag){ + int deleteNum; + do { + deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId,monthId); + } while (deleteNum != NumConstant.ZERO); + } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } /** * 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入社区相关分值表。 一对四 + * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -340,6 +354,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexCommunityScore(String monthId, String customerId){ + List mismatchAgencyList = new ArrayList<>(); // 查询社区相关分值记录id List indexCommunityIds = factIndexCommunityScoreDao.selectListCommunityId(customerId, monthId); if (indexCommunityIds.size() > NumConstant.ZERO){ @@ -349,23 +364,48 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { communityIds[i] = indexCommunityIds.get(i); } // 进行不匹配查询(即返回社区相关分值表 中不存在的社区信息)。 - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); - // 将 社区相关分数表 中,本月份没有的社区信息,按照 4种类型,各新增一遍,赋默认值 0 - if (mismatchAgencyList.size() > NumConstant.ZERO){ - this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); - } + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, communityIds); } else { - // 将所有的社区按照 4种类型,各赋一遍默认值 - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); - this.insertIndexCommunityScoreDefaultValue(monthId, customerId, mismatchAgencyList); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + } + if (!CollectionUtils.isEmpty(mismatchAgencyList)){ + // 如果进行不匹配查询,查到了其他社区信息,一律赋默认值 + this.insertIndexMonthlyByAgencyDefaultScore(monthId, customerId, mismatchAgencyList); } - // 开始处理实际分数 // fact_index_community_score 社区相关分数表 agency // 查询社区相关分值记录 List communityScoreDTOS = factIndexCommunityScoreDao.selectListCommunityScore(customerId, monthId); + // 开始处理实际分数 this.insertIndexDataMonthlyByCommunityScore(monthId, customerId, communityScoreDTOS); } + /** + * 将 社区相关分数表 中缺少的部门 数据,赋默认值 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param communityScoreDTOS 社区相关分数表 当前客户不存在的网格数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexMonthlyByAgencyDefaultScore(String monthId, String customerId, List communityScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (int i = NumConstant.ZERO; i < communityScoreDTOS.size(); i++){ + IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); + monthlyDTO.setIndexTotal(zero); + monthlyDTO.setPartyDevAblity(zero); + monthlyDTO.setServiceAblity(zero); + monthlyDTO.setGovernAblity(zero); + // 补充表中其他字段 + monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, communityScoreDTOS.get(i).getAgencyId(), + communityScoreDTOS.get(i).getPid(), communityScoreDTOS.get(i).getAgencyName(), monthlyDTO); + monthlyFormDTOList.add(monthlyDTO); + } + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + /** * 社区相关分数表 数据 插入月表 screenIndexDataMonthlyDao * @@ -382,13 +422,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { Map> collect = communityScoreDTOS.stream().collect(Collectors.groupingBy(FactIndexCommunityScoreDTO::getAgencyId)); // 根据客户id,查询区/街道 组织名称、id List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> communityScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 组织id - orgIds[j] = communityScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < communityScore.getValue().size(); i++){ @@ -425,14 +460,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } /** * 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 区直部门分值表。 一对四 + * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -441,6 +475,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexDeptScore(String monthId, String customerId){ + List mismatchDeptList = new ArrayList<>(); // 查询社 区直部门分值表 List indexDeptIds = deptScoreDao.selectListDeptId(customerId, monthId); if (indexDeptIds.size() > NumConstant.ZERO){ @@ -448,21 +483,48 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { for (int i = NumConstant.ZERO; i < indexDeptIds.size(); i++){ depeIds[i] = indexDeptIds.get(i); } - List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); - if (mismatchDeptList.size() > NumConstant.ZERO){ - this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); - } + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, depeIds); } else { - List mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); - this.insertIndexDeptScoreDefaultValueFor(monthId, customerId, mismatchDeptList); + mismatchDeptList = screenCustomerDeptDao.selectListMismatchDeptInfo(customerId, null); + } + if (!CollectionUtils.isEmpty(mismatchDeptList)){ + // 如果进行不匹配查询,查到了其他部门信息,一律赋默认值 + this.insertIndexMonthlyByDeptDefaultScore(monthId, customerId, mismatchDeptList); } - // 开始处理实际分数 // fact_index_dept_score 区直部门分值表 department // 查询社 区直部门分值表 List deptScoreDTOS = deptScoreDao.selectListDeptScore(customerId, monthId); + // 开始处理实际分数 this.insertIndexDataMonthlyByDeptScore(monthId, customerId, deptScoreDTOS); } + /** + * 将 区直部门分值表 中缺少的部门 数据,赋默认值 插入月表 screenIndexDataMonthlyDao + * + * @param monthId 202008 + * @param customerId 客户id + * @param deptScoreDTOS 区直部门分值表 当前客户不存在的部门数据集 + * @return void + * @Author zhangyong + * @Date 14:17 2020-09-03 + **/ + private void insertIndexMonthlyByDeptDefaultScore(String monthId, String customerId, List deptScoreDTOS){ + List monthlyFormDTOList = new ArrayList<>(); + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + for (int i = NumConstant.ZERO; i < deptScoreDTOS.size(); i++){ + IndexDataMonthlyFormDTO monthlyDTO = new IndexDataMonthlyFormDTO(); + monthlyDTO.setIndexTotal(zero); + monthlyDTO.setPartyDevAblity(zero); + monthlyDTO.setServiceAblity(zero); + monthlyDTO.setGovernAblity(zero); + // 补充表中其他字段 + monthlyDTO = this.supplementIndexDataMonthlyTable(monthId, OrgTypeConstant.GRID, deptScoreDTOS.get(i).getDeptId(), + deptScoreDTOS.get(i).getParentAgencyId(), deptScoreDTOS.get(i).getDeptName(), monthlyDTO); + monthlyFormDTOList.add(monthlyDTO); + } + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); + } + /** * 将区直部门分值表 数据 插入月表 screenIndexDataMonthlyDao * @@ -478,13 +540,8 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据部门id 进行分组,最后组装一条数据 一个部门id 对应 4条数据 Map> collect = deptScoreDTOS.stream().collect(Collectors.groupingBy(DeptScoreDTO::getDeptId)); List parentDeptList = screenCustomerDeptDao.selectListDeptInfo(customerId); - String[] orgIds = new String[collect.size()]; - int j = 0; for(Map.Entry> deptScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 部门id - orgIds[j] = deptScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < deptScore.getValue().size(); i++){ @@ -513,7 +570,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -529,23 +585,23 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { * @Date 13:44 2020-09-04 **/ private void startHandleIndexAgencyScore(String monthId, String customerId){ + List mismatchAgencyList = new ArrayList<>(); List indexAgencyIds = agencyScoreDaol.selectListAgencyId(customerId, monthId); if (indexAgencyIds.size() > NumConstant.ZERO){ String[] agencyIds = new String[indexAgencyIds.size()]; for (int i = NumConstant.ZERO; i < indexAgencyIds.size(); i++){ agencyIds[i] = indexAgencyIds.get(i); } - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds); - if (mismatchAgencyList.size() > NumConstant.ZERO){ - this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); - } + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, agencyIds); } else { - List mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); - this.insertIndexAgencyScoreDefaultValueFor(monthId, customerId, mismatchAgencyList); + mismatchAgencyList = screenCustomerAgencyDao.selectListMismatcAgencyInfo(customerId, null); + } + if (!CollectionUtils.isEmpty(mismatchAgencyList)){ + this.insertIndexMonthlyByAgencyDefaultScore(monthId, customerId, mismatchAgencyList); } - // 开始处理实际分数 // fact_index_agency_score 区/街道相关分数表 agency List agencyScoreDTOS = agencyScoreDaol.selectListAgencyScore(customerId, monthId); + // 开始处理实际分数 this.insertIndexDataMonthlyByAgencyScore(monthId, customerId, agencyScoreDTOS); } @@ -564,13 +620,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { // 根据组织id(eg:社区或者街道id) 进行分组,最后组装一条数据 一个组织id 对应 4条数据 Map> collect = agencyScoreDTOS.stream().collect(Collectors.groupingBy(AgencyScoreDTO::getAgencyId)); List parentAgencyList = screenCustomerAgencyDao.selectListAgencyInfo(customerId); - String[] orgIds = new String[collect.size()]; int j = 0; for(Map.Entry> agencyScore : collect.entrySet()){ IndexDataMonthlyFormDTO monthlyFormDTO = new IndexDataMonthlyFormDTO(); - // 组织id(eg:社区或者街道id) - orgIds[j] = agencyScore.getKey(); - j++; // 给4个指数 赋默认值 monthlyFormDTO = this.setIndexDefaultValueFor(monthlyFormDTO); for ( int i = 0; i < agencyScore.getValue().size(); i++){ @@ -602,7 +654,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -672,195 +723,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { return monthlyFormDTO; } - /** - * 新增 网格相关分值记录表 默认值,一条网格,按照组织类别的不同 需要插入4次 - * - * @param monthId 例:202008 - * @param customerId - * @param mismatchGridList 网格相关分值记录表 中缺少的网格集合 - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexGridScoreDefaultValue(String monthId, String customerId, List mismatchGridList){ - List insertIndexGridScoreDTOS = new ArrayList<>(); - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - for (ScreenCustomerGridDTO gridDTO : mismatchGridList){ - FactIndexGridScoreDTO indexGridScoreDTO = new FactIndexGridScoreDTO(); - // 赋默认值 - 党建能力指数 - indexGridScoreDTO.setGridId(gridDTO.getGridId()); - indexGridScoreDTO.setAgencyId(gridDTO.getParentAgencyId()); - indexGridScoreDTO.setAllParentIds(gridDTO.getAllParentIds()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - indexGridScoreDTO.setQuarterId(DateUtils.getQuarterId(monthId)); - indexGridScoreDTO.setYearId(getYearStr(monthId)); - indexGridScoreDTO.setMonthId(monthId); - // 0 or 1 - indexGridScoreDTO.setIsTotal(NumConstant.ZERO_STR); - indexGridScoreDTO.setScore(zero); - indexGridScoreDTO.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - indexGridScoreDTO.setDelFlag(NumConstant.ZERO_STR); - insertIndexGridScoreDTOS.add(indexGridScoreDTO); - - FactIndexGridScoreDTO indexGridScoreDTO1 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); - // 赋默认值 - 治理能力 - indexGridScoreDTO1.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - insertIndexGridScoreDTOS.add(indexGridScoreDTO1); - - FactIndexGridScoreDTO indexGridScoreDTO2 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); - // 赋默认值 - 服务能力 - indexGridScoreDTO2.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - insertIndexGridScoreDTOS.add(indexGridScoreDTO2); - - FactIndexGridScoreDTO indexGridScoreDTO3 = ConvertUtils.sourceToTarget(indexGridScoreDTO, FactIndexGridScoreDTO.class); - indexGridScoreDTO3.setIsTotal(NumConstant.ONE_STR); - // 赋默认值 - 网格相关 - indexGridScoreDTO3.setIndexCode(IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode()); - insertIndexGridScoreDTOS.add(indexGridScoreDTO3); - } - factIndexGridScoreDao.batchInsertGridScoreData(insertIndexGridScoreDTOS, customerId); - } - - /** - * 新增 社区相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 - * - * @param monthId - * @param customerId - * @param mismatchAgencyList - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexCommunityScoreDefaultValue(String monthId, String customerId, List mismatchAgencyList){ - List insertIndexCommunityScore = new ArrayList<>(); - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ - FactIndexCommunityScoreEntity communityScore1 = new FactIndexCommunityScoreEntity(); - // 赋默认值 - 党建能力指数 - communityScore1.setAgencyId(agencyDTO.getAgencyId()); - communityScore1.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - communityScore1.setQuarterId(DateUtils.getQuarterId(monthId)); - communityScore1.setYearId(getYearStr(monthId)); - communityScore1.setMonthId(monthId); - // 0 or 1 - communityScore1.setIsTotal(NumConstant.ZERO_STR); - communityScore1.setScore(zero); - communityScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - insertIndexCommunityScore.add(communityScore1); - - // 赋默认值 - 治理能力 - FactIndexCommunityScoreEntity communityScore2 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); - communityScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - insertIndexCommunityScore.add(communityScore2); - - // 赋默认值 - 服务能力 - FactIndexCommunityScoreEntity communityScore3 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); - communityScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - insertIndexCommunityScore.add(communityScore3); - - // 赋默认值 - 社区相关 - FactIndexCommunityScoreEntity communityScore4 = ConvertUtils.sourceToTarget(communityScore1, FactIndexCommunityScoreEntity.class); - communityScore4.setIsTotal(NumConstant.ONE_STR); - communityScore4.setIndexCode(IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); - insertIndexCommunityScore.add(communityScore4); - } - factIndexCommunityScoreDao.batchInsertCommunityScoreData(insertIndexCommunityScore, customerId); - } - - /** - * 新增 区直部门分值表 默认值,一条部门id,按照组织类别的不同 需要插入1次 - * - * @param monthId - * @param customerId - * @param mismatchDeptList - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexDeptScoreDefaultValueFor(String monthId, String customerId, List mismatchDeptList){ - List insertIndexDeptScore = new ArrayList<>(); - for (ScreenCustomerDeptEntity deptDTO : mismatchDeptList){ - DeptScoreEntity deptScore2 = new DeptScoreEntity(); - // 赋默认值 - 治理能力 - deptScore2.setDeptId(deptDTO.getDeptId()); - deptScore2.setAgencyId(deptDTO.getParentAgencyId()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - deptScore2.setQuarterId(DateUtils.getQuarterId(monthId)); - deptScore2.setYearId(getYearStr(monthId)); - deptScore2.setMonthId(monthId); - deptScore2.setIsTotal(NumConstant.ZERO_STR); - deptScore2.setScore(new BigDecimal(NumConstant.ZERO)); - deptScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - deptScore2.setDelFlag(NumConstant.ZERO_STR); - insertIndexDeptScore.add(deptScore2); - } - deptScoreDao.batchInsertDeptScoreData(insertIndexDeptScore, customerId); - } - - /** - * 新增 区/街道相关分数表 默认值,一条组织id,按照组织类别的不同 需要插入4次 - * - * @param monthId - * @param customerId - * @param mismatchAgencyList - * @return void - * @Author zhangyong - * @Date 14:02 2020-09-04 - **/ - private void insertIndexAgencyScoreDefaultValueFor(String monthId, String customerId, List mismatchAgencyList){ - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - List insertIndexAgencyScore = new ArrayList<>(); - for (ScreenCustomerAgencyEntity agencyDTO : mismatchAgencyList){ - if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel()) || OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) - || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ - AgencyScoreEntity agencyScore1 = new AgencyScoreEntity(); - // 赋默认值 - 党建能力指数 - agencyScore1.setAgencyId(agencyDTO.getAgencyId()); - agencyScore1.setParentAgencyId(agencyDTO.getPid()); - //季度id: yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 - agencyScore1.setQuarterId(DateUtils.getQuarterId(monthId)); - agencyScore1.setYearId(getYearStr(monthId)); - agencyScore1.setMonthId(monthId); - // 0 or 1 - agencyScore1.setIsTotal(NumConstant.ZERO_STR); - agencyScore1.setScore(zero); - agencyScore1.setIndexCode(IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); - - AgencyScoreEntity agencyScore2 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); - // 赋默认值 - 治理能力 - agencyScore2.setIndexCode(IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); - - AgencyScoreEntity agencyScore3 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); - // 赋默认值 - 服务能力 - agencyScore3.setIndexCode(IndexCodeEnum.FU_WU_NENG_LI.getCode()); - - AgencyScoreEntity agencyScore4 = ConvertUtils.sourceToTarget(agencyScore1, AgencyScoreEntity.class); - agencyScore4.setIsTotal(NumConstant.ONE_STR); - if (OrgTypeConstant.COMMUNITY.equals(agencyDTO.getLevel())){ - // 赋默认值 - 全区相关 - agencyScore4.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); - agencyScore4.setDataType(OrgTypeConstant.DISTRICT); - agencyScore1.setDataType(OrgTypeConstant.DISTRICT); - agencyScore2.setDataType(OrgTypeConstant.DISTRICT); - agencyScore3.setDataType(OrgTypeConstant.DISTRICT); - } else if (OrgTypeConstant.STREET.equals(agencyDTO.getLevel()) || OrgTypeConstant.DISTRICT.equals(agencyDTO.getLevel())){ - // 赋默认值 - 街道相关 - agencyScore4.setIndexCode(IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode()); - agencyScore4.setDataType(OrgTypeConstant.STREET); - agencyScore1.setDataType(OrgTypeConstant.STREET); - agencyScore2.setDataType(OrgTypeConstant.STREET); - agencyScore3.setDataType(OrgTypeConstant.STREET); - } - insertIndexAgencyScore.add(agencyScore1); - insertIndexAgencyScore.add(agencyScore2); - insertIndexAgencyScore.add(agencyScore3); - insertIndexAgencyScore.add(agencyScore4); - } - } - agencyScoreDaol.batchInsertAgencyScoreData(insertIndexAgencyScore, customerId); - } - /** * 根据年,汇总今年各项得到,计算平均值后 插入年表 screen_index_data_yearly * @@ -872,12 +734,11 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { **/ private void insertIndexDataYear(String monthId, String customerId){ List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId)); - String[] orgIds = new String[monthlyFormList.size()]; - for (int i = NumConstant.ZERO; i < monthlyFormList.size(); i++){ - orgIds[i] = monthlyFormList.get(i).getOrgId(); - } if (monthlyFormList.size() > NumConstant.ZERO){ - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId), orgIds); + int deleteNum; + do { + deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); + } while (deleteNum != NumConstant.ZERO); List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java similarity index 61% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java index 1e6dca0080..12d46a16f9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ShiBeiScreenCollService.java @@ -9,11 +9,11 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:25 */ -public interface ScreenCollService { +public interface ShiBeiScreenCollService { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 - * 1) 根据CUSTOMER_ID、GRID_ID、USER_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -22,11 +22,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyUserRankData(List formDTO, String customerId); + void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO, String customerId); /** * 8、党建引领-党员联系群众数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -35,11 +35,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyLinkMassesData(List formDTO, String customerId); + void insertPartyLinkMassesData(PartyLinkMassesDataListFormDTO formDTO, String customerId); /** * 7、基层党建-建设情况数据(支部、联建、志愿) - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -48,11 +48,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyBranchData(List formDTO, String customerId); + void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId); /** * 6、党建引领-组织排行 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -61,11 +61,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertOrgRankData(List formDTO, String customerId); + void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId); /** * 5、基层治理-治理能力数据 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -74,11 +74,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertGovernRankData(List formDTO, String customerId); + void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId); /** * 4、事件数据 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -87,11 +87,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertEventData(List formDTO, String customerId); + void insertEventData(EventDataListFormDTO formDTO, String customerId); /** * 3、难点赌点 - * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除 * 2) 在新增 * * @param formDTO @@ -104,7 +104,7 @@ public interface ScreenCollService { /** * 2、党员基本情况 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -113,11 +113,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCpcbaseData(List formDTO, String customerId); + void insertCpcbaseData(CpcBaseDataListFormDTO formDTO, String customerId); /** * 1、指数_按月统计 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -126,11 +126,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertIndexDataMonthly(List formDTO, String customerId); + void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId); /** * 17、指数_按年统计 - * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、YEAR_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -139,11 +139,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertIndexDataYearly(List formDTO, String customerId); + void insertIndexDataYearly(IndexDataListYearlyFormDTO formDTO, String customerId); /** * 16、部门信息上传 - * 1) 根据CUSTOMER_ID、DEPT_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -152,11 +152,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerDept(List formDTO, String customerId); + void insertCustomerDept(CustomerDeptListFormDTO formDTO, String customerId); /** * 15、网格信息上传 - * 1) 根据CUSTOMER_ID、GRID_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -165,11 +165,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerGrid(List formDTO, String customerId); + void insertCustomerGrid(CustomerGridListFormDTO formDTO, String customerId); /** * 14、组织层级 - * 1) 根据CUSTOMER_ID、AGENCY_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID 进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -178,7 +178,7 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertCustomerAgency(List formDTO, String customerId); + void insertCustomerAgency(CustomerAgencyListFormDTO formDTO, String customerId); /** * 12、中央区各类总数 @@ -191,11 +191,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertUserTotalData(List formDTO, String customerId); + void insertUserTotalData(UserTotalDataListFormDTO formDTO, String customerId); /** * 11、基层治理-公众参与 - * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID、MONTH_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -204,11 +204,11 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertUserJoin(List formDTO, String customerId); + void insertUserJoin(UserJoinListFormDTO formDTO, String customerId); /** * 10、党建引领-先锋模范数据 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * * @param formDTO @@ -217,12 +217,12 @@ public interface ScreenCollService { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPioneerData(List formDTO, String customerId); + void insertPioneerData(PioneerDataListFormDTO formDTO, String customerId); /** * 18、公众参与各类总数 * 公众参与-各类(用户|党员|党群|话题|议题|项目|注册人数|参与人数)总数 - * 1) 根据CUSTOMER_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 1) 根据CUSTOMER_ID进行查询,如果有数据,则先进行物理删除, 一次删除1000条 * 2) 在新增 * @param formDTO * @param formDTO @@ -230,5 +230,5 @@ public interface ScreenCollService { * @Author zhangyong * @Date 09:44 2020-08-25 **/ - void insertPublicPartiTotalData(List formDTO, String customerId); + void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java deleted file mode 100644 index 6018622deb..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java +++ /dev/null @@ -1,470 +0,0 @@ -/** - * Copyright 2018 人人开源 https://www.renren.io - *

- * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - *

- * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - *

- * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package com.epmet.service.evaluationindex.screen.impl; - -import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.constant.CompareConstant; -import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.*; -import com.epmet.dto.screencoll.form.*; -import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; -import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; -import com.epmet.service.evaluationindex.screen.ScreenCollService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; - -/** - * 大屏数据采集 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-05-11 - */ -@Service -@DataSource(DataSourceConstant.EVALUATION_INDEX) -public class ScreenCollServiceImpl implements ScreenCollService { - - @Autowired - private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; - @Autowired - private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; - @Autowired - private ScreenPartyBranchDataDao screenPartyBranchDataDao; - @Autowired - private ScreenOrgRankDataDao screenOrgRankDataDao; - @Autowired - private ScreenGovernRankDataDao screenGovernRankDataDao; - @Autowired - private ScreenEventDataDao screenEventDataDao; - @Autowired - private ScreenEventImgDataDao screenEventImgDataDao; - @Autowired - private ScreenDifficultyDataDao screenDifficultyDataDao; - @Autowired - private ScreenCpcBaseDataDao screenCpcBaseDataDao; - @Autowired - private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; - @Autowired - private ScreenCustomerDeptDao screenCustomerDeptDao; - @Autowired - private ScreenCustomerGridDao screenCustomerGridDao; - @Autowired - private ScreenCustomerAgencyDao screenCustomerAgencyDao; - @Autowired - private ScreenUserTotalDataDao screenUserTotalDataDao; - @Autowired - private ScreenUserJoinDao screenUserJoinDao; - @Autowired - private ScreenPioneerDataDao screenPioneerDataDao; - @Autowired - private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; - @Autowired - private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPartyUserRankData(List formDTO,String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenPartyUserRankDataDao.deletePartyUserRankData(customerId, - formDTO.get(NumConstant.ZERO).getGridId(), - formDTO.get(NumConstant.ZERO).getUserId()); - } - - screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO,customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPartyLinkMassesData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId, orgIds); - - screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPartyBranchData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPartyBranchDataDao.deletePartyBranchData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertOrgRankData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenOrgRankDataDao.deleteOrgRankData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenOrgRankDataDao.batchInsertOrgRankData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertGovernRankData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenGovernRankDataDao.deleteGovernRankData(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenGovernRankDataDao.batchInsertGovernRankData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertEventData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenEventDataDao.deleteEventData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); - } - - screenEventDataDao.batchInsertEventData(formDTO, customerId); - - for (int i = NumConstant.ZERO; i < formDTO.size(); i++) { - if (null != formDTO.get(i).getImgDataList() && formDTO.get(i).getImgDataList().size() > NumConstant.ZERO) { - // 根据原始事件ID,物理删除 - 事件数据图片数据 - screenEventImgDataDao.delEventImgDataByEventId(formDTO.get(i).getEventId()); - for (int j = NumConstant.ZERO; j < formDTO.get(i).getImgDataList().size(); j++){ - // 新增 中央区-事件数据图片数据 表 - ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); - imgDataEntity.setEventId(formDTO.get(i).getImgDataList().get(j).getEventId()); - imgDataEntity.setEventImgUrl(formDTO.get(i).getImgDataList().get(j).getImgUrl()); - imgDataEntity.setSort(formDTO.get(i).getImgDataList().get(j).getSort()); - screenEventImgDataDao.insert(imgDataEntity); - } - } - } - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId) { - if(formDTO.getIsFirst()){ - //直接删除当前客户下所有的数据 - screenDifficultyDataDao.deleteDifficultyData(customerId); - } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDiffcultyDataList())){ - screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDiffcultyDataList(), customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCpcbaseData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenCpcBaseDataDao.deleteCpcBaseData(customerId, orgIds); - - screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertIndexDataMonthly(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertIndexDataYearly(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - orgIds); - - screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCustomerDept(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] deptIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - deptIds[i] = formDTO.get(i).getDeptId(); - } - screenCustomerDeptDao.deleteCustomerDept(customerId, deptIds); - - screenCustomerDeptDao.batchInsertCustomerDept(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCustomerGrid(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] gridIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - gridIds[i] = formDTO.get(i).getGridId(); - } - screenCustomerGridDao.deleteCustomerGrid(customerId, gridIds); - - screenCustomerGridDao.batchInsertCustomerGrid(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertCustomerAgency(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] agencyIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - agencyIds[i] = formDTO.get(i).getAgencyId(); - } - screenCustomerAgencyDao.deleteCustomerAgency(customerId, agencyIds); - - screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertUserTotalData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenUserTotalDataDao.deleteUserTotalData(customerId, orgIds); - - screenUserTotalDataDao.batchInsertUserTotalData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertUserJoin(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenUserJoinDao.deleteUserJoin(customerId, - formDTO.get(NumConstant.ZERO).getYearId(), - formDTO.get(NumConstant.ZERO).getMonthId(), - orgIds); - - String[] lastMonth = this.lastMonthDate(); - // 获取上个月的基本数据 - String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; - List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, - lastMonth[NumConstant.ZERO], - moneth, - orgIds); - - // 定义本月待添加数据的集合 - List curMonthJoinEntityList = new ArrayList<>(); - // 增加率计算 - if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ - // 存在上个月的数据 (本月-上月)/上月 *100 - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - for (int j = NumConstant.ZERO; j < lastMonthJoinList.size(); j++){ - if (formDTO.get(i).getOrgId().equals(lastMonthJoinList.get(j).getOrgId())){ - ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); - entity.setJoinTotalUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); - entity.setJoinTotalUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getJoinTotal(), formDTO.get(j).getJoinTotal())); - entity.setAvgIssueUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); - entity.setAvgIssueUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgIssue(), formDTO.get(j).getAvgIssue())); - entity.setAgvgJoinUpRate(this.calculateGrowthRateNumber(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); - entity.setAgvgJoinUpFlag(this.calculateGrowthRateFlag(lastMonthJoinList.get(i).getAvgJoin(), formDTO.get(j).getAvgJoin())); - curMonthJoinEntityList.add(entity); - } - } - } - } else { - // 计算增长率后的 待新增数据 - BigDecimal zero = new BigDecimal(NumConstant.ZERO); - // 不存在上个月的数据 - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.get(i), ScreenUserJoinEntity.class); - entity.setJoinTotalUpRate(zero); - entity.setJoinTotalUpFlag(""); - entity.setAvgIssueUpRate(zero); - entity.setAvgIssueUpFlag(""); - entity.setAgvgJoinUpRate(zero); - entity.setAgvgJoinUpFlag(""); - curMonthJoinEntityList.add(entity); - } - } - screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); - } - } - - /** - * 获取当前日期的前一个月的日期 - * @param - * @return java.lang.String[] - * @Author zhangyong - * @Date 15:33 2020-08-21 - **/ - private String[] lastMonthDate(){ - String[] date = new String[NumConstant.TWO]; - //Java获取当前日期的前一个月的日期 - Calendar calendar = Calendar.getInstance(); - calendar.add(Calendar.MONTH, NumConstant.ONE_NEG); - int year = calendar.get(Calendar.YEAR); - int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; - date[NumConstant.ZERO] = String.valueOf(year); - date[NumConstant.ONE] = String.valueOf(month);; - if (NumConstant.TEN >= month){ - date[NumConstant.ONE] = NumConstant.ZERO_STR + month; - } - return date; - } - - /** - * 计算 本月数值 相较于 上月数值,的增长率 - * - * @param old 上月数值 - * @param now 本月数值 - * @return java.math.BigDecimal - * @Author zhangyong - * @Date 15:38 2020-08-21 - **/ - private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ - if (NumConstant.ZERO == old){ - return new BigDecimal(now * NumConstant.ONE_HUNDRED); - } - BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); - BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); - return bignum2; - } - - /** - * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 - * - * @param old 上月数值 - * @param now 本月数值 - * @return java.util.String - * @Author zhangyong - * @Date 15:38 2020-08-21 - **/ - private String calculateGrowthRateFlag(Integer old, Integer now){ - if (old > now){ - return CompareConstant.DECR_STR; - } else if (old < now){ - return CompareConstant.INCR_STR; - } else { - return CompareConstant.EQ_STR; - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPioneerData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPioneerDataDao.deletePioneerData(customerId, orgIds); - - screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); - } - } - - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) - @Override - @Transactional(rollbackFor = Exception.class) - public void insertPublicPartiTotalData(List formDTO, String customerId) { - if (null != formDTO && formDTO.size() > NumConstant.ZERO){ - String[] orgIds = new String[formDTO.size()]; - for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - orgIds[i] = formDTO.get(i).getOrgId(); - } - screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId, orgIds); - - screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(formDTO, customerId); - } - } -} 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 new file mode 100644 index 0000000000..bbb0585d44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java @@ -0,0 +1,472 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.CompareConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.*; +import com.epmet.dto.screencoll.form.*; +import com.epmet.entity.evaluationindex.screen.ScreenEventImgDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenUserJoinEntity; +import com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.List; + +/** + * 大屏数据采集 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { + + @Autowired + private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; + @Autowired + private ScreenPartyLinkMassesDataDao screenPartyLinkMassesDataDao; + @Autowired + private ScreenPartyBranchDataDao screenPartyBranchDataDao; + @Autowired + private ScreenOrgRankDataDao screenOrgRankDataDao; + @Autowired + private ScreenGovernRankDataDao screenGovernRankDataDao; + @Autowired + private ScreenEventDataDao screenEventDataDao; + @Autowired + private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenDifficultyDataDao screenDifficultyDataDao; + @Autowired + private ScreenCpcBaseDataDao screenCpcBaseDataDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + @Autowired + private ScreenCustomerDeptDao screenCustomerDeptDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private ScreenCustomerAgencyDao screenCustomerAgencyDao; + @Autowired + private ScreenUserTotalDataDao screenUserTotalDataDao; + @Autowired + private ScreenUserJoinDao screenUserJoinDao; + @Autowired + private ScreenPioneerDataDao screenPioneerDataDao; + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenPublicPartiTotalDataDao screenPublicPartiTotalDataDao; + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyUserRankData(PartyUserRankDataListFormDTO formDTO,String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyUserRankDataDao.deletePartyUserRankData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyUserRankDataDao.batchInsertPartyUserRankData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyLinkMassesData(PartyLinkMassesDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPartyBranchData(PartyBranchDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPartyBranchDataDao.deletePartyBranchData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertOrgRankData(OrgRankDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenOrgRankDataDao.deleteOrgRankData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenOrgRankDataDao.batchInsertOrgRankData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertGovernRankData(GovernRankDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenGovernRankDataDao.deleteGovernRankData(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenGovernRankDataDao.batchInsertGovernRankData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertEventData(EventDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenEventDataDao.deleteEventData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId); + + // 处理图片 + String[] events = new String[formDTO.getDataList().size()]; + List eventImgDataList = new ArrayList<>(); + Boolean isImgUrl = false; + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++) { + if (null != formDTO.getDataList().get(i).getImgDataList() && formDTO.getDataList().get(i).getImgDataList().size() > NumConstant.ZERO) { + // 根据原始事件ID,物理删除 - 事件数据图片数据 + events[i] = formDTO.getDataList().get(i).getEventId(); + for (int j = NumConstant.ZERO; j < formDTO.getDataList().get(i).getImgDataList().size(); j++){ + // 新增 中央区-事件数据图片数据 表 + ScreenEventImgDataEntity imgDataEntity = new ScreenEventImgDataEntity(); + imgDataEntity.setEventId(formDTO.getDataList().get(i).getImgDataList().get(j).getEventId()); + imgDataEntity.setEventImgUrl(formDTO.getDataList().get(i).getImgDataList().get(j).getImgUrl()); + imgDataEntity.setSort(formDTO.getDataList().get(i).getImgDataList().get(j).getSort()); + eventImgDataList.add(imgDataEntity); + isImgUrl = true; + } + } + } + if (isImgUrl){ + screenEventImgDataDao.delEventImgDataByEvent(events); + screenEventImgDataDao.batchInsertEventImgData(eventImgDataList); + } + + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertDifficultyData(DifficultyDataFormDTO formDTO, String customerId) { + if(formDTO.getIsFirst()){ + //直接删除当前客户下所有的数据 + screenDifficultyDataDao.deleteDifficultyData(customerId); + } + if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDataList())){ + screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCpcbaseData(CpcBaseDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCpcBaseDataDao.deleteCpcBaseData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataMonthly(IndexDataListMonthlyFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertIndexDataYearly(IndexDataListYearlyFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, formDTO.getYearId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenIndexDataYearlyDao.batchInsertIndexDataYearly(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerDept(CustomerDeptListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerDeptDao.deleteCustomerDept(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerDeptDao.batchInsertCustomerDept(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerGrid(CustomerGridListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerGridDao.deleteCustomerGrid(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerGridDao.batchInsertCustomerGrid(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertCustomerAgency(CustomerAgencyListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenCustomerAgencyDao.deleteCustomerAgency(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserTotalData(UserTotalDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenUserTotalDataDao.deleteUserTotalData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenUserTotalDataDao.batchInsertUserTotalData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUserJoin(UserJoinListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenUserJoinDao.deleteUserJoin(customerId, formDTO.getMonthId()); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + if (formDTO.getDataList().size() > NumConstant.ZERO){ + String[] orgIds = new String[formDTO.getDataList().size()]; + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ + orgIds[i] = formDTO.getDataList().get(i).getOrgId(); + } + + String[] lastMonth = this.lastMonthDate(); + // 获取上个月的基本数据 + String moneth = lastMonth[NumConstant.ZERO] + lastMonth[NumConstant.ONE]; + List lastMonthJoinList = screenUserJoinDao.selectLastMonthScreenUserJoinList(customerId, + lastMonth[NumConstant.ZERO], + moneth, + orgIds); + + // 定义本月待添加数据的集合 + List curMonthJoinEntityList = new ArrayList<>(); + // 增加率计算 + if (null != lastMonthJoinList && lastMonthJoinList.size() > NumConstant.ZERO){ + // 存在上个月的数据 (本月-上月)/上月 *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())); + curMonthJoinEntityList.add(entity); + } + } + } + } else { + // 计算增长率后的 待新增数据 + BigDecimal zero = new BigDecimal(NumConstant.ZERO); + // 不存在上个月的数据 + for (int i = NumConstant.ZERO; i < formDTO.getDataList().size(); i++){ + ScreenUserJoinEntity entity = ConvertUtils.sourceToTarget(formDTO.getDataList().get(i), ScreenUserJoinEntity.class); + entity.setJoinTotalUpRate(zero); + entity.setJoinTotalUpFlag(""); + entity.setAvgIssueUpRate(zero); + entity.setAvgIssueUpFlag(""); + entity.setAgvgJoinUpRate(zero); + entity.setAgvgJoinUpFlag(""); + curMonthJoinEntityList.add(entity); + } + } + screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); + } + } + } + + /** + * 获取当前日期的前一个月的日期 + * @param + * @return java.lang.String[] + * @Author zhangyong + * @Date 15:33 2020-08-21 + **/ + private String[] lastMonthDate(){ + String[] date = new String[NumConstant.TWO]; + //Java获取当前日期的前一个月的日期 + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.MONTH, NumConstant.ONE_NEG); + int year = calendar.get(Calendar.YEAR); + int month = calendar.get(Calendar.MONTH) + NumConstant.ONE; + date[NumConstant.ZERO] = String.valueOf(year); + date[NumConstant.ONE] = String.valueOf(month);; + if (NumConstant.TEN >= month){ + date[NumConstant.ONE] = NumConstant.ZERO_STR + month; + } + return date; + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.math.BigDecimal + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private BigDecimal calculateGrowthRateNumber(Integer old, Integer now){ + if (NumConstant.ZERO == old){ + return new BigDecimal(now * NumConstant.ONE_HUNDRED); + } + BigDecimal bignum1 = new BigDecimal((now - old) * NumConstant.ONE_HUNDRED); + BigDecimal bignum2 = bignum1.divide(new BigDecimal(old),2,BigDecimal.ROUND_HALF_UP); + return bignum2; + } + + /** + * 计算 本月数值 相较于 上月数值,的增长率, 得出标识 + * + * @param old 上月数值 + * @param now 本月数值 + * @return java.util.String + * @Author zhangyong + * @Date 15:38 2020-08-21 + **/ + private String calculateGrowthRateFlag(Integer old, Integer now){ + if (old > now){ + return CompareConstant.DECR_STR; + } else if (old < now){ + return CompareConstant.INCR_STR; + } else { + return CompareConstant.EQ_STR; + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPioneerData(PioneerDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPioneerDataDao.deletePioneerData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPioneerDataDao.batchInsertPioneerData(formDTO.getDataList(), customerId); + } + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + @Transactional(rollbackFor = Exception.class) + public void insertPublicPartiTotalData(PublicPartiTotalDataListFormDTO formDTO, String customerId) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = screenPublicPartiTotalDataDao.deletePublicPartiTotalData(customerId); + } while (deleteNum != NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + screenPublicPartiTotalDataDao.batchInsertPublicPartiTotalData(formDTO.getDataList(), customerId); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java index 1ede9a4aae..1ca86d8faf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/BatchScoreCalculator.java @@ -4,6 +4,7 @@ import com.epmet.support.normalizing.ScoreCalculator; import java.math.BigDecimal; import java.math.RoundingMode; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.stream.Collectors; @@ -12,6 +13,7 @@ public class BatchScoreCalculator { /** * 执行计算,每个指标中每个样本的得分明细 + * * @return 每一条都是一个指标的,所有样本对应的,得分值 */ public List getScoreDetailOfIndexId(List indexInputVOS) { @@ -26,7 +28,7 @@ public class BatchScoreCalculator { // 循环同一个指标内的多个样本值的SampleValue列表 List scores4OneIndex = indexValueVOs.stream().map(vo -> { - BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP);; + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); return new SampleScore(vo.getSampleId(), score); }).collect(Collectors.toList()); @@ -34,8 +36,49 @@ public class BatchScoreCalculator { }).collect(Collectors.toList()); } + /** + * 执行计算,以样本的所有指标总得分及明细分数值 + * + * @param indexInputVOS + * @return + */ + public HashMap getScoreTotalOfSampleId(List indexInputVOS) { + + // 每个样本的总得分 + HashMap scoreCountOfSamples = new HashMap<>(); + //遍历指标 + for (IndexInputVO idx : indexInputVOS) { + // 每个指标循环一次 + List indexValueVOs = idx.getIndexValueVOs(); + BigDecimal weight = idx.getWeight(); + ScoreCalculator scoreCalculator = idx.getScoreCalculator(); + BigDecimal threshold = idx.getThreshold(); + //遍历该指标下的每个数据 + for (SampleValue vo : indexValueVOs) { + String sampleId = vo.getSampleId(); + BigDecimal score = scoreCalculator.normalize(getFinalSampleValue(vo.getSampleValue(), threshold), weight).setScale(6, RoundingMode.HALF_UP); + CalculateResult result = scoreCountOfSamples.get(sampleId); + + if (result == null) { + score.setScale(6, RoundingMode.HALF_UP); + result = new CalculateResult(); + result.setSampleId(sampleId); + result.setTotalScore(new BigDecimal(0)); + result.setDetails(new ArrayList<>()); + scoreCountOfSamples.put(sampleId, result); + } + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), score); + result.getDetails().add(sampleScore); + result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); + } + } + + return scoreCountOfSamples; + } + /** * 执行计算,以样本的所有指标总得分 + * * @param indexInputVOS * @return */ @@ -69,6 +112,7 @@ public class BatchScoreCalculator { /** * 获取最终样本值 + * * @param realValue * @param threshold * @return @@ -81,6 +125,6 @@ public class BatchScoreCalculator { } return (bdRealValue.compareTo(threshold) < 0) || (bdRealValue.equals(threshold)) ? bdRealValue - : threshold ; + : threshold; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java new file mode 100644 index 0000000000..4765c023ba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java @@ -0,0 +1,25 @@ +package com.epmet.support.normalizing.batch; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.List; + +@Data +public class CalculateResult implements Serializable { + private static final long serialVersionUID = -7966247924916816940L; + + /** + * 样本Id 对应inputVO中的sampleId + */ + private String sampleId; + /** + * 总得分 + */ + private BigDecimal totalScore; + /** + * 每项具体的分支 + */ + private List details; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java index 57c6fbc396..0c805af16c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexInputVO.java @@ -19,6 +19,11 @@ public class IndexInputVO implements Serializable { */ private String indexId; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** * 指标的样本值 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java new file mode 100644 index 0000000000..3b108999a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -0,0 +1,31 @@ +package com.epmet.support.normalizing.batch; + +import lombok.AllArgsConstructor; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author liujianjun + */ +@Data +@AllArgsConstructor +public class IndexScoreVo implements Serializable { + + private static final long serialVersionUID = 65642416224721650L; + /** + * 指标code + */ + private String indexCode; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** + * 分值 + */ + private BigDecimal score; + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 211e573c3c..45768cdde6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( @@ -20,6 +20,7 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, + #{item.allParentIndexCode}, #{item.delFlag}, #{item.revision}, #{item.createdBy}, @@ -39,7 +40,6 @@ del_flag = '0' AND customer_id = #{customerId} AND month_id = #{monthId} - AND index_code = #{indexCode} AND data_type = #{dataType} @@ -79,9 +79,11 @@ del_flag = 0 AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} - AND IS_TOTAL = "0" - AND INDEX_CODE != "jiedaoxiangguan" AND data_type = #{dataType} + AND IS_TOTAL = "0" + AND (INDEX_CODE = "zhilinengli" + OR INDEX_CODE = "dangjiannengli" + OR INDEX_CODE = "fuwunengli") diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml new file mode 100644 index 0000000000..57bb0cd700 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml @@ -0,0 +1,160 @@ + + + + + + + + INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_agency_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + AND index_code = #{indexCode} + AND data_type = #{dataType} + + + + + + + + + + + insert into fact_index_agency_score + ( + ID, + CUSTOMER_ID, + + AGENCY_ID, + PARENT_AGENCY_ID, + YEAR_ID, + QUARTER_ID, + MONTH_ID, + DATA_TYPE, + SCORE, + INDEX_CODE, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.dataType}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml similarity index 89% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index 7978db5eee..0b038f6a88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -1,11 +1,11 @@ - + - INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES ( @@ -19,6 +19,7 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, + #{item.allParentIndexCode}, #{item.delFlag}, #{item.revision}, #{item.createdBy}, @@ -38,7 +39,6 @@ del_flag = '0' AND customer_id = #{customerId} AND month_id = #{monthId} - AND index_code = #{indexCode} @@ -59,29 +59,31 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} AND IS_TOTAL = "0" - AND INDEX_CODE != "shequxiangguan" + AND (INDEX_CODE = "dangjiannengli" + OR INDEX_CODE = "zhilinengli" + OR INDEX_CODE = "fuwunengli") + SELECT + CUSTOMER_ID, + AGENCY_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + SCORE, + INDEX_CODE, + PARENT_AGENCY_ID + FROM + fact_index_community_score + WHERE + del_flag = 0 + AND CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND INDEX_CODE = "dangjiannengli" + OR INDEX_CODE = "zhilinengli" + OR INDEX_CODE = "fuwunengli" + + + + + + + + + insert into fact_index_community_score + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PARENT_AGENCY_ID, + YEAR_ID, + QUARTER_ID, + MONTH_ID, + SCORE, + INDEX_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.agencyId}, + #{item.parentAgencyId}, + #{item.yearId}, + #{item.quarterId}, + #{item.monthId}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml index 3c6fb2ea55..13c69b8957 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -32,14 +32,17 @@ select CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_score WHERE - CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} AND IS_TOTAL = '0' + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + and ALL_PARENT_INDEX_CODE = #{allParentCode,jdbcType=VARCHAR} + AND IS_TOTAL = '0' SELECT - AVG( SCORE ) AS AVG_CONTACT_MASSES_SCORE + round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE FROM fact_index_cpc_score m WHERE @@ -70,7 +73,7 @@ SELECT - AVG( SCORE ) AS AVG_CONTACT_MASSES_SCORE + round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE FROM fact_index_cpc_score m WHERE @@ -110,6 +113,7 @@ `IS_TOTAL`, `SCORE`, `INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, @@ -130,6 +134,7 @@ #{item.isTotal}, #{item.score}, #{item.indexCode}, + #{item.allParentIndexCode}, 0, 0, 'APP_USER', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml new file mode 100644 index 0000000000..b1e069bab2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml @@ -0,0 +1,143 @@ + + + + + + + delete from fact_index_cpc_sub_score + where + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + and ALL_PARENT_INDEX_CODE = #{allParentCode,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `fact_index_cpc_sub_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `YEAR_ID`, + `MONTH_ID`, + `USER_ID`, + `SCORE`, + `INDEX_CODE`, + `ALL_PARENT_INDEX_CODE`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.yearId}, + #{item.monthId}, + #{item.userId}, + #{item.score}, + #{item.indexCode}, + #{item.allParentIndexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml new file mode 100644 index 0000000000..f75bed424b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml @@ -0,0 +1,103 @@ + + + + + + + + + + + + insert into fact_index_dept_score + ( + ID, + CUSTOMER_ID, + DEPT_ID, + AGENCY_ID, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + SCORE, + INDEX_CODE, + + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.deptId}, + #{item.agencyId}, + #{item.quarterId}, + #{item.yearId}, + + #{item.monthId}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + delete from fact_index_dept_score where CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + and DEPT_ID=#{deptId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index e45dcb04ef..d42d063e35 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -112,4 +112,105 @@ AND m.CUSTOMER_ID =#{customerId} AND m.MONTH_ID =#{monthId} + + + + + + + + + + insert into fact_index_grid_score + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + ALL_PARENT_IDS, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + IS_TOTAL, + SCORE, + INDEX_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + + #{item.yearId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml new file mode 100644 index 0000000000..54d36b195e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -0,0 +1,188 @@ + + + + + + + DELETE + FROM + fact_index_grid_score + WHERE + CUSTOMER_ID = #{customerId} + AND MONTH_ID = #{monthId} + AND INDEX_CODE = #{indexCode} + + + + INSERT INTO `fact_index_grid_score` ( + `ID`, + `CUSTOMER_ID`, + `GRID_ID`, + `AGENCY_ID`, + `ALL_PARENT_IDS`, + `QUARTER_ID`, + `YEAR_ID`, + `MONTH_ID`, + `SCORE`, + `INDEX_CODE`, + `DEL_FLAG`, + `REVISION`, + `CREATED_BY`, + `CREATED_TIME`, + `UPDATED_BY`, + `UPDATED_TIME` + ) + VALUES + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + #{item.yearId}, + #{item.monthId}, + #{item.isTotal}, + #{item.score}, + #{item.indexCode}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into fact_index_grid_score + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + ALL_PARENT_IDS, + QUARTER_ID, + YEAR_ID, + MONTH_ID, + SCORE, + INDEX_CODE, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.allParentIds}, + #{item.quarterId}, + + #{item.yearId}, + #{item.monthId}, + #{item.score}, + #{item.indexCode}, + #{item.delFlag}, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index 67165f1bf7..b4475c72cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml @@ -27,8 +27,8 @@ delete from fact_index_govrn_ablity_dept_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND DEPT_ID = #{deptId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 870e2596ec..a84dff6a5c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -29,8 +29,8 @@ delete from fact_index_govrn_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index a703174aee..eb9a582759 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -30,11 +30,8 @@ delete from fact_index_govrn_ablity_org_monthly where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - AND AGENCY_ID IN - - #{item} - + AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml index 2d8b199022..5f94b54fba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityGridMonthlyDao.xml @@ -34,8 +34,8 @@ delete from fact_index_party_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index df7e750147..4aacf64da8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -24,11 +24,8 @@ delete from fact_index_party_ablity_org_monthly where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - AND AGENCY_ID IN - - #{item} - + AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml index 467bba7667..f3ec6462f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityGridMonthlyDao.xml @@ -24,8 +24,8 @@ delete from fact_index_service_ablity_grid_monthly - where CUSTOMER_ID = #{customerId} AND AGENCY_ID = #{agencyId} AND GRID_ID = #{gridId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml index 03bc8a2b10..e87e17874f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml @@ -24,11 +24,8 @@ delete from fact_index_service_ablity_org_monthly where CUSTOMER_ID = #{customerId} - AND MONTH_ID = #{monthId} AND QUARTER_ID = #{quarterId} AND YEAR_ID = #{yearId} - AND AGENCY_ID IN - - #{item} - + AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml deleted file mode 100644 index 010ac06798..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml +++ /dev/null @@ -1,103 +0,0 @@ - - - - - - - - - - - - insert into fact_index_grid_score - ( - ID, - CUSTOMER_ID, - GRID_ID, - AGENCY_ID, - ALL_PARENT_IDS, - QUARTER_ID, - YEAR_ID, - MONTH_ID, - IS_TOTAL, - SCORE, - INDEX_CODE, - DEL_FLAG, - REVISION, - CREATED_BY, - CREATED_TIME, - UPDATED_BY, - UPDATED_TIME - ) values - - ( - (SELECT REPLACE(UUID(), '-', '') AS id), - #{customerId}, - #{item.gridId}, - #{item.agencyId}, - #{item.allParentIds}, - #{item.quarterId}, - - #{item.yearId}, - #{item.monthId}, - #{item.isTotal}, - #{item.score}, - #{item.indexCode}, - #{item.delFlag}, - 0, - 'APP_USER', - now(), - 'APP_USER', - now() - ) - - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml index 1059fe5518..03270712ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCpcBaseDataDao.xml @@ -6,10 +6,7 @@ delete from screen_cpc_base_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index 36ac049262..452d1ec34b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -6,10 +6,7 @@ delete from screen_customer_agency where CUSTOMER_ID = #{customerId} - AND AGENCY_ID IN - - #{item} - + limit 1000; @@ -90,4 +87,15 @@ DEL_FLAG = '0' AND CUSTOMER_ID =#{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml index 31717d6dd2..1533203d14 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerDeptDao.xml @@ -6,10 +6,7 @@ delete from screen_customer_dept where CUSTOMER_ID = #{customerId} - AND DEPT_ID IN - - #{item} - + limit 1000; 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 c85dc0af60..92486a3f10 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 @@ -6,10 +6,7 @@ delete from screen_customer_grid where CUSTOMER_ID = #{customerId} - AND GRID_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml index fa22c8ad79..f395b4bdce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventDataDao.xml @@ -5,7 +5,8 @@ delete from screen_event_data - where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} + where CUSTOMER_ID = #{customerId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml index 9623ede0b9..bc5228b426 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenEventImgDataDao.xml @@ -3,9 +3,42 @@ - + delete from screen_event_img_data - where DEL_FLAG = '0' AND EVENT_ID = #{eventId} + where DEL_FLAG = '0' + AND EVENT_ID IN + + #{item} + + + insert into screen_event_img_data + ( + ID, + EVENT_ID, + EVENT_IMG_URL, + SORT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.eventId}, + #{item.eventImgUrl}, + #{item.sort}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml index 9a8da4e40e..f569cb89a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDao.xml @@ -5,11 +5,8 @@ delete from screen_govern_rank_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml index 4c8369dd0a..11a990aa9c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataMonthlyDao.xml @@ -5,11 +5,8 @@ delete from screen_index_data_monthly - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml index 75eb13d280..aed08ebfed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenIndexDataYearlyDao.xml @@ -6,10 +6,7 @@ delete from screen_index_data_yearly where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml index 64c79965e9..2cf5f7dc33 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenOrgRankDataDao.xml @@ -5,11 +5,8 @@ delete from screen_org_rank_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml index 12bc3a4755..a7058e4a08 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyBranchDataDao.xml @@ -5,11 +5,8 @@ delete from screen_party_branch_data - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml index c9e4e65e5f..f6760538d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyLinkMassesDataDao.xml @@ -6,10 +6,7 @@ delete from screen_party_link_masses_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml index fe88da6d76..d4089fcc30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPartyUserRankDataDao.xml @@ -5,7 +5,8 @@ delete from screen_party_user_rank_data - where CUSTOMER_ID = #{customerId} AND GRID_ID = #{gridId} AND USER_ID = #{userId} + where CUSTOMER_ID = #{customerId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml index ceff6812fb..91d8537c19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPioneerDataDao.xml @@ -6,10 +6,7 @@ delete from screen_pioneer_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml index 69701d3f17..0c2bfa9c51 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenPublicPartiTotalDataDao.xml @@ -27,10 +27,7 @@ delete from screen_public_parti_total_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml index 678b2b960c..e4e5b7ac0f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml @@ -22,11 +22,8 @@ delete from screen_user_join - where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} - AND ORG_ID IN - - #{item} - + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml index 032739c71c..ecf0039810 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserTotalDataDao.xml @@ -6,10 +6,7 @@ delete from screen_user_total_data where CUSTOMER_ID = #{customerId} - AND ORG_ID IN - - #{item} - + limit 1000; diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java index d573765b6b..57969c12e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java +++ b/epmet-module/data-statistical/data-statistical-server/src/test/java/com/epmet/stats/test/normalizing/DemoScoreCal.java @@ -1,10 +1,7 @@ package com.epmet.stats.test.normalizing; import com.epmet.support.normalizing.*; -import com.epmet.support.normalizing.batch.BatchScoreCalculator; -import com.epmet.support.normalizing.batch.IndexInputVO; -import com.epmet.support.normalizing.batch.IndexOutputVO; -import com.epmet.support.normalizing.batch.SampleValue; +import com.epmet.support.normalizing.batch.*; import org.junit.Test; import java.math.BigDecimal; @@ -78,8 +75,8 @@ public class DemoScoreCal { List> index2SampleValues = Arrays.asList(new SampleValue<>("id1", 1), new SampleValue<>("id2", 8), new SampleValue<>("id3", 3)); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO<>("aaa", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO<>("bbb", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO<>("aaa", "a:bbb2", index1SampleValues, new BigDecimal(10), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO<>("bbb", "a:bbb2", index2SampleValues, new BigDecimal(10), new BigDecimal(1), sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -104,8 +101,8 @@ public class DemoScoreCal { List index2SampleValues = Arrays.asList(new SampleValue<>("id1", new BigDecimal(1)), new SampleValue<>("id2", new BigDecimal(8)), new SampleValue<>("id3", new BigDecimal(3))); // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), sc1); - IndexInputVO index2VO = new IndexInputVO("bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), sc2); + IndexInputVO index1VO = new IndexInputVO("aaa", "a:aaa", index1SampleValues, new BigDecimal(6), new BigDecimal(1), sc1); + IndexInputVO index2VO = new IndexInputVO("bbb", "b:bbb", index2SampleValues, new BigDecimal(6), new BigDecimal(1), sc2); List indexInputVOS = Arrays.asList(index1VO, index2VO); @@ -163,13 +160,13 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.2), sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.15), sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.15), sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(-1), new BigDecimal(0.5), sc4); - List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); @@ -227,22 +224,29 @@ public class DemoScoreCal { // 每个指标的信息,包括样本列表,权重,指标标记 - IndexInputVO index1VO = new IndexInputVO("aaa1", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.3), sc1); - IndexInputVO index2VO = new IndexInputVO("aaa2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.2), sc2); - IndexInputVO index3VO = new IndexInputVO("aaa3", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.2), sc3); - IndexInputVO index4VO = new IndexInputVO("aaa4", index1SampleValues4, new BigDecimal(0.6), new BigDecimal(0.3), sc4); + IndexInputVO index1VO = new IndexInputVO("aaa1", "a:bbb2", index1SampleValues, new BigDecimal(-1), new BigDecimal(0.3), sc1); + IndexInputVO index2VO = new IndexInputVO("aaa2", "a:bbb2", index1SampleValues2, new BigDecimal(-1), new BigDecimal(0.2), sc2); + IndexInputVO index3VO = new IndexInputVO("aaa3", "a:bbb2", index1SampleValues3, new BigDecimal(-1), new BigDecimal(0.2), sc3); + IndexInputVO index4VO = new IndexInputVO("aaa4", "a:bbb2", index1SampleValues4, new BigDecimal(0.6), new BigDecimal(0.3), sc4); - List indexInputVOS = Arrays.asList(index1VO, index2VO,index3VO,index4VO); + List indexInputVOS = Arrays.asList(index1VO, index2VO, index3VO, index4VO); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap result = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + HashMap result2 = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); System.err.println("----------------1----------------"); result.forEach((key, value) -> { System.out.println(key.concat("的得分为:").concat(value.toString())); }); System.err.println("-----------------2---------------"); + + System.err.println("----------------11111111----------------"); + result2.forEach((key, value) -> { + System.out.println(key.concat("的得分为:").concat(value.toString())); + }); + System.err.println("-----------------2222222222---------------"); } diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml index d0f69c2502..f9a372c94e 100644 --- a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/resources/bootstrap.yml @@ -8,7 +8,7 @@ spring: name: epmet-activiti-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml index ec2f2c7a2b..e521fd36ff 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: common-service-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql new file mode 100644 index 0000000000..2b6542405d --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql @@ -0,0 +1,9 @@ +INSERT INTO `external_customer` ( `ID`, `CUSTOMER_NAME`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) +VALUES + ( '6c67e54f0ce4ba92a33f503082c92fc9', '安宁e家', 0, 0, 'APP_USER', '2020-09-08 09:11:56', 'APP_USER', '2020-09-08 09:11:56' ); +INSERT INTO `external_app` ( `ID`, `APP_NAME`, `CUSTOMER_ID`, `CUSTOMER_TYPE`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`, `DEL_FLAG` ) +VALUES + ( 'c67d2bb17112e9aabdf137cb4f8072fe', '安宁e家数据端', '6c67e54f0ce4ba92a33f503082c92fc9', 'external', 0, 'APP_USER', '2020-09-08 09:13:32', 'APP_USER', '2020-09-08 09:13:32', 0 ); +INSERT INTO `external_app_secret` ( `ID`, `APP_ID`, `SECRET`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME` ) +VALUES + ( '3e7d65039e25570777216cecfadfa304', 'c67d2bb17112e9aabdf137cb4f8072fe', '8c3e52923720460093b59184ffbdcb44a7f9e752991348aba861e8b43e109836', 0, 0, 'APP_USER', '2020-09-08 09:13:32', 'APP_USER', '2020-09-08 09:13:32' ); \ No newline at end of file diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml index c34d1822b8..1352c66f87 100644 --- a/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: allow-bean-definition-overriding: true #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml index 8f43acbf19..a1948620e3 100644 --- a/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-ext-server # dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ jackson: time-zone: GMT+8 date-format: yyyy-MM-dd HH:mm:ss diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml index 0f7b365814..0f9afbef03 100644 --- a/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-message/epmet-message-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-message-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml index 390608e0f4..115f991f57 100644 --- a/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-oss-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages,i18n/messages_common diff --git a/epmet-module/epmet-point/epmet-point-client/pom.xml b/epmet-module/epmet-point/epmet-point-client/pom.xml index c43496fa40..479b51156e 100644 --- a/epmet-module/epmet-point/epmet-point-client/pom.xml +++ b/epmet-module/epmet-point/epmet-point-client/pom.xml @@ -27,6 +27,12 @@ io.springfox springfox-swagger-ui + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java index 3dd0e34ac9..c37afa2921 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/CommonPageUserFormDTO.java @@ -26,4 +26,7 @@ public class CommonPageUserFormDTO implements Serializable { private Integer pageNo = 1; private Integer pageSize = 10; + + @NotBlank(message = "获取不到用户Id" , groups = PageUserGroup.class) + private String customerId; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java index 7920d68c66..8726a2659b 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/form/PointVerificationFormDTO.java @@ -52,4 +52,6 @@ public class PointVerificationFormDTO implements Serializable { @NotBlank(message = "缺失地址信息" , groups = PointVerificationGroup.class) private String address; + + private String customerId; } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java index 749b9eefe0..d5b9edd6c6 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/EpmetPointOpenFeignClient.java @@ -2,10 +2,11 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.fallback.EpmetPointOpenFeignClientFallback; import org.springframework.cloud.openfeign.FeignClient; -import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; /** * 本服务对外开放的API,其他服务通过引用此client调用该服务 @@ -23,6 +24,6 @@ public interface EpmetPointOpenFeignClient { * @author wangc * @date 2020.07.22 15:58 **/ - @GetMapping("/point/resi/point/mypoint") - Result myPoint(); + @PostMapping("/point/resi/point/mypoint") + Result myPoint(CommonUserFormDTO param); } diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java index 845c105b50..7d5cda718f 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/feign/fallback/EpmetPointOpenFeignClientFallback.java @@ -3,6 +3,7 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; import com.epmet.feign.EpmetPointOpenFeignClient; import org.springframework.stereotype.Component; @@ -16,7 +17,7 @@ import org.springframework.stereotype.Component; @Component public class EpmetPointOpenFeignClientFallback implements EpmetPointOpenFeignClient { @Override - public Result myPoint() { - return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint"); + public Result myPoint(CommonUserFormDTO param) { + return ModuleUtils.feignConError(ServiceConstant.EPMET_POINT_SERVER, "myPoint",param); } } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java index 21336dccb2..535b717e0c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/AdjustmentController.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.enums.RequirePermissionEnum; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.CustomerUserFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.PointAdjustmentFormDTO; @@ -59,7 +60,8 @@ public class AdjustmentController { **/ @PostMapping("userdetail") @RequirePermission(requirePermission = RequirePermissionEnum.MORE_POINT_USER_MANAGE_DETAIL_VIEW) - public Result userDetail(@RequestBody IssueInitiatorFormDTO param){ + public Result userDetail(@LoginUser TokenDto staffToken,@RequestBody CommonUserFormDTO param){ + param.setCustomerId(staffToken.getCustomerId()); ValidatorUtils.validateEntity(param,IssueInitiatorFormDTO.UserIdGroup.class); return new Result().ok(pointAdjustmentLogService.userDetail(param)); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java index ff4bdd2285..8bb1d31cc5 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ExchangeController.java @@ -39,6 +39,7 @@ public class ExchangeController { @PostMapping("execute") public Result execute(@LoginUser TokenDto token, @RequestBody PointVerificationFormDTO verificationParam){ verificationParam.setOperatorId(token.getUserId()); + verificationParam.setCustomerId(token.getCustomerId()); ValidatorUtils.validateEntity(verificationParam, PointVerificationFormDTO.PointVerificationGroup.class); return new Result().ok(pointVerificationLogService.verifyPoint(verificationParam)); } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java index bca69b050a..f4e5ce6bb4 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/controller/ResiPointController.java @@ -5,7 +5,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.form.CommonPageUserFormDTO; -import com.epmet.dto.form.ResiCommonUserIdFormDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.ResiPointRankFormDTO; import com.epmet.dto.result.PointExchangeResponseResultDTO; import com.epmet.dto.result.ResiPointDetailResultDTO; @@ -46,12 +46,11 @@ public class ResiPointController { * @author wangc * @date 2020.07.22 15:58 **/ - @GetMapping("mypoint") - public Result myPoint(@LoginUser TokenDto dto){ - ResiCommonUserIdFormDTO param = new ResiCommonUserIdFormDTO(); - param.setUserId(dto.getUserId()); - ValidatorUtils.validateEntity(param,ResiCommonUserIdFormDTO.UserIdGroup.class); - return new Result().ok(userPointTotalService.getMyPoint(param)); + @PostMapping("mypoint") + public Result myPoint(@LoginUser TokenDto dto, @RequestBody CommonUserFormDTO userParam){ + userParam.setUserId(dto.getUserId()); + ValidatorUtils.validateEntity(userParam, CommonUserFormDTO.CustomerId_UserIdGroup.class); + return new Result().ok(userPointTotalService.getMyPoint(userParam)); } /** diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java index 5b90380b88..52c76a7c4c 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/PointVerificationLogDao.java @@ -43,7 +43,7 @@ public interface PointVerificationLogDao extends BaseDao selectVerificationLog(@Param("userId") String userId); + List selectVerificationLog(@Param("userId") String userId,@Param("customerId")String customerId); /** * @Description 获取工作人员月度核销记录 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java index a16ce26c67..42d7cb404b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointActionLogDao.java @@ -42,7 +42,8 @@ public interface UserPointActionLogDao extends BaseDao * @author wangc * @date 2020.07.22 13:56 **/ - List selectPointActionLogList(@Param("userId") String userId); + List selectPointActionLogList(@Param("userId") String userId,@Param("customerId")String customerId); + /** * @Description 查询指定用户在某条规则下所得的积分总和 diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java index 36b2540ac1..c78d265734 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/dao/UserPointTotalDao.java @@ -44,6 +44,15 @@ public interface UserPointTotalDao extends BaseDao { **/ ResiPointDetailResultDTO selectPointByUserId(@Param("userId")String userId); + /** + * @Description 根据用户Id和客户Id查询他的累计积分以及可用积分 + * @param userId + * @return + * @author wangc + * @date 2020.07.21 13:38 + **/ + ResiPointDetailResultDTO selectPointByCustomerUserId(@Param("userId")String userId,@Param("customerId")String customerId); + /** * @Description 查询客户下的用户累计积分排名榜 * @param customerId diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java index 02df12d652..6e77b0f7c8 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/PointAdjustmentLogService.java @@ -20,6 +20,7 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.PointAdjustmentLogDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.PointAdjustmentFormDTO; import com.epmet.dto.result.CustomerUserDetailResultDTO; @@ -113,7 +114,7 @@ public interface PointAdjustmentLogService extends BaseService /** * @Description 获取指定居民的积分信息 - * @param userId + * @param param * @return * @author wangc * @date 2020.07.22 15:58 **/ - ResiPointDetailResultDTO getMyPoint(ResiCommonUserIdFormDTO userId); + ResiPointDetailResultDTO getMyPoint(CommonUserFormDTO param); /** * @Description 获取客户下用户积分排名榜 @@ -125,4 +126,13 @@ public interface UserPointTotalService extends BaseService void insertOrUpdate(UserPointTotalEntity entity); void testInsertOrUpdate(UserPointTotalEntity entity); + + /** + * @Description 获取指定居民的积分信息 - 使用客户Id匹配,兼容多客户情况 + * @param customerUserParam + * @return + * @author wangc + * @date 2020.07.22 15:58 + **/ + ResiPointDetailResultDTO getMyPointGroupByCustomer(CommonUserFormDTO customerUserParam); } \ No newline at end of file diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java index a78e6f70bf..cdbf4e882b 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointAdjustmentLogServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.PointAdjustmentLogDao; import com.epmet.dao.UserPointActionLogDao; import com.epmet.dto.PointAdjustmentLogDTO; +import com.epmet.dto.form.CommonUserFormDTO; import com.epmet.dto.form.IssueInitiatorFormDTO; import com.epmet.dto.form.PointAdjustmentFormDTO; import com.epmet.dto.form.ResiCommonUserIdFormDTO; @@ -150,13 +151,14 @@ public class PointAdjustmentLogServiceImpl extends BaseServiceImpl detailResult = epmetUserOpenFeignClient.customerUserDetail(param); + public CustomerUserDetailResultDTO userDetail(CommonUserFormDTO param) { + IssueInitiatorFormDTO userParam = new IssueInitiatorFormDTO(); + userParam.setUserId(param.getUserId()); + Result detailResult = epmetUserOpenFeignClient.customerUserDetail(userParam); if(!detailResult.success()){ throw new RenException(detailResult.getCode()); } - ResiCommonUserIdFormDTO userParam = ConvertUtils.sourceToTarget(param,ResiCommonUserIdFormDTO.class); - ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPoint(userParam); + ResiPointDetailResultDTO pointDto = userPointTotalService.getMyPointGroupByCustomer(param); if(null != detailResult.getData()){ CustomerUserDetailResultDTO result = new CustomerUserDetailResultDTO(); result.setPoint(null != pointDto ? pointDto.getUsablePoint() : NumConstant.ZERO); diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java index f8f3974e80..8dec019109 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/PointVerificationLogServiceImpl.java @@ -147,7 +147,7 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl getMyExchangeRecord(CommonPageUserFormDTO pageUser) { PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize()); - List logList = baseDao.selectVerificationLog(pageUser.getUserId()); + List logList = baseDao.selectVerificationLog(pageUser.getUserId(),pageUser.getCustomerId()); List result = new LinkedList<>(); if(null != logList && !logList.isEmpty()){ Map> map = @@ -256,9 +256,10 @@ public class PointVerificationLogServiceImpl extends BaseServiceImpl getMyPointRecord(CommonPageUserFormDTO pageUser) { PageHelper.startPage(pageUser.getPageNo(),pageUser.getPageSize()); - List logList = baseDao.selectPointActionLogList(pageUser.getUserId()); + List logList = baseDao.selectPointActionLogList(pageUser.getUserId(),pageUser.getCustomerId()); List result = new LinkedList<>(); if(null != logList && !logList.isEmpty()){ Map> map = diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 6be4ae538e..a36a0c39d9 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -38,6 +38,7 @@ import com.epmet.service.UserPointStatisticalDailyService; import com.epmet.utils.DimIdGenerator; import com.epmet.utils.ModuleConstant; import com.github.pagehelper.PageHelper; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -53,6 +54,7 @@ import java.util.stream.Collectors; * @since v1.0.0 2020-07-20 */ @Service +@Slf4j public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointStatisticalDailyService { @Autowired @@ -131,6 +133,8 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl implements UserPointTotalService { + @Autowired EpmetUserOpenFeignClient epmetUserOpenFeignClient; @@ -111,14 +115,14 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst(); @@ -244,4 +250,20 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml index 9777f506d3..994bca4ad4 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointActionLogDao.xml @@ -36,6 +36,8 @@ DEL_FLAG = '0' AND USER_ID = #{userId} + AND + CUSTOMER_ID = #{customerId} ORDER BY CREATED_TIME DESC diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml index d84b1b02ed..e64d984a00 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml +++ b/epmet-module/epmet-point/epmet-point-server/src/main/resources/mapper/UserPointTotalDao.xml @@ -31,6 +31,21 @@ USER_ID = #{userId} + + +