From 188cc42b2c09c6dc02504a4cc94c0b1e43b4f1c2 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 8 Sep 2020 09:40:24 +0800 Subject: [PATCH 01/42] =?UTF-8?q?=E5=AE=89=E5=AE=81e=E5=AE=B6=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=95=B0=E6=8D=AE=E7=AB=AF=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.4__add_anningejia.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_anningejia.sql diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_anningejia.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__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.4__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 From f1ee1b45ee4658d8a6706b047a1cec626c7bda60 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 10:30:45 +0800 Subject: [PATCH 02/42] =?UTF-8?q?5=E3=80=81=E4=B8=8B=E7=BA=A7=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=8C=87=E6=95=B0=E6=8E=92=E8=A1=8C=EF=BC=88=E5=AE=89?= =?UTF-8?q?=E5=AE=81=E6=95=B0=E6=8D=AE=E6=AE=B5=E7=94=A8=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AnNingSubAgencyIndexRankFormDTO.java | 44 +++++++++++++++++++ .../controller/screen/IndexController.java | 20 +++++++-- .../screen/ScreenIndexDataMonthlyDao.java | 15 ++++++- .../screen/ScreenIndexDataYearlyDao.java | 17 ++++++- .../evaluationindex/screen/IndexService.java | 15 +++++-- .../screen/impl/IndexServiceImpl.java | 18 ++++++-- .../screen/ScreenIndexDataMonthlyDao.xml | 25 ++++++++++- .../screen/ScreenIndexDataYearlyDao.xml | 25 ++++++++++- 8 files changed, 161 insertions(+), 18 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AnNingSubAgencyIndexRankFormDTO.java 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/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..0dc845d3d8 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/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 22f6aa376b..04bae4abed 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,7 @@ 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.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -182,4 +179,17 @@ public class IndexServiceImpl implements IndexService { } return subAgencyIndexRankResultDTOS; } + + @Override + public List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) { + List subAgencyIndexRankResultDTOS = new ArrayList<>(); + if ("year".equals(formDTO.getType())){ + // 年 指数排行 + subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO); + } else if ("month".equals(formDTO.getType())){ + // 月 指数排行 + subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO); + } + return subAgencyIndexRankResultDTOS; + } } 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..37a8e0c33e 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 + + + + From 781f864e1809ad924cc2a0416d5cffb59c44963d Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 10:57:06 +0800 Subject: [PATCH 03/42] =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/constant/ScreenConstant.java | 3 +++ .../evaluationindex/screen/impl/IndexServiceImpl.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) 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-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 04bae4abed..89281ee674 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,6 +7,7 @@ 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.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.*; import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.commons.lang3.StringUtils; @@ -183,10 +184,10 @@ public class IndexServiceImpl implements IndexService { @Override public List anNingSubAgencyIndexRank(AnNingSubAgencyIndexRankFormDTO formDTO) { List subAgencyIndexRankResultDTOS = new ArrayList<>(); - if ("year".equals(formDTO.getType())){ + if (ScreenConstant.YEAR_ID.equals(formDTO.getType())){ // 年 指数排行 subAgencyIndexRankResultDTOS = screenIndexDataYearlyDao.selectAnNingSubAgencyIndexYearlyRank(formDTO); - } else if ("month".equals(formDTO.getType())){ + } else if (ScreenConstant.MONTH_ID.equals(formDTO.getType())){ // 月 指数排行 subAgencyIndexRankResultDTOS = screenIndexDataMonthlyDao.selectAnNingSubAgencyIndexMonthlyRank(formDTO); } From 71ac82d7a78c6f6c99970c16d7cb4227fd753920 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 8 Sep 2020 11:04:26 +0800 Subject: [PATCH 04/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B9=B3=E5=9D=87?= =?UTF-8?q?=E5=80=BC=EF=BC=8C=E4=BF=9D=E7=95=99=E5=B0=8F=E6=95=B0=E7=82=B9?= =?UTF-8?q?=E5=90=8E6=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/indexcal/CpcScoreDao.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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..fe374f941f 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 @@ -39,7 +39,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 @@ -70,7 +70,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 From 3d1868b40cde3dea470d57c68ccee27b4af8f404 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Sep 2020 11:21:03 +0800 Subject: [PATCH 05/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/DataStatsApplication.java | 3 --- .../indexcal/impl/CpcIndexCalculateServiceImpl.java | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) 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/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..120aa0d77d 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 @@ -285,7 +285,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(); } //分值计算器 From 06753532a09837c4c7c80d3d249c3748d62c966d Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 11:52:45 +0800 Subject: [PATCH 06/42] =?UTF-8?q?5=E3=80=81=E4=B8=8B=E7=BA=A7=E9=83=A8?= =?UTF-8?q?=E9=97=A8=E6=8C=87=E6=95=B0=E6=8E=92=E8=A1=8C=EF=BC=88=E5=AE=89?= =?UTF-8?q?=E5=AE=81=E6=95=B0=E6=8D=AE=E6=AE=B5=E7=94=A8=EF=BC=89,=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=98=AF=E6=9C=88=E4=BB=BD=EF=BC=8C=E5=8F=96?= =?UTF-8?q?=E4=B8=8A=E4=B8=80=E4=B8=AA=E6=9C=88=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/evaluationindex/screen/ScreenIndexDataMonthlyDao.java | 2 +- .../service/evaluationindex/screen/impl/IndexServiceImpl.java | 2 +- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 0dc845d3d8..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 @@ -61,7 +61,7 @@ public interface ScreenIndexDataMonthlyDao{ List selectSubAgencyIndexRank(SubAgencyIndexRankFormDTO subAgencyIndexRankFormDTO); /** - * 5、下级部门指数排行(安宁数据段用) - 月 + * 5、下级部门指数排行(安宁数据段用) - 月(上一个月) * * @param formDTO * @return com.epmet.commons.tools.utils.Result> 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 89281ee674..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 @@ -188,7 +188,7 @@ public class IndexServiceImpl implements IndexService { // 年 指数排行 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/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 37a8e0c33e..9a095e82d7 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 @@ -74,7 +74,7 @@ WHERE del_flag = '0' AND parent_id = #{agencyId} - AND month_id = date_format(CURDATE(), '%Y%m') + AND month_id = date_format(CURDATE(), '%Y%m') - 1 ORDER BY index_total ASC From cbcc5d809d1d93bd1e2bda66ff70a3d3ed1ae853 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 8 Sep 2020 12:54:14 +0800 Subject: [PATCH 07/42] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=8C=E6=9F=A5=E8=AF=A2=E6=9C=BA=E5=85=B3=E7=BB=93=E6=9E=84?= =?UTF-8?q?=E4=BB=8E=E8=AF=B7=E6=B1=82=E5=A4=B4=E4=B8=AD=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AE=A2=E6=88=B7Id=EF=BC=8C=E5=A6=82=E6=9E=9C=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E5=88=99=E9=BB=98=E8=AE=A4=E4=B8=BA=E5=B8=82=E5=8C=97?= =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E7=9A=84=E6=95=B0=E6=8D=AE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/controller/screen/AgencyController.java | 9 ++++++++- .../evaluationindex/screen/impl/AgencyServiceImpl.java | 9 +++++---- 2 files changed, 13 insertions(+), 5 deletions(-) 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/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(); From bbb4bdf762495fe83452c57ed4f637c5c46051f9 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 12:54:37 +0800 Subject: [PATCH 08/42] =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=B7=A8=E5=B9=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 9a095e82d7..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 @@ -74,7 +74,7 @@ WHERE del_flag = '0' AND parent_id = #{agencyId} - AND month_id = date_format(CURDATE(), '%Y%m') - 1 + AND month_id = left(replace(DATE_SUB( CURDATE(),INTERVAL 1 MONTH),'-',''),6) ORDER BY index_total ASC From 7aba68f0db4b0fb0328cb1f9d448ec364bd0ae95 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 14:31:07 +0800 Subject: [PATCH 09/42] =?UTF-8?q?AVG=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 2 +- .../evaluationindex/screen/FactIndexCommunityScoreDao.xml | 2 +- .../mapper/evaluationindex/screen/FactIndexGridScoreDao.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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..6ba627fd68 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 @@ -90,7 +90,7 @@ fics.month_id, fics.quarter_id, fics.year_id, - AVG( fics.score ) AS score, + ROUND(AVG( fics.score ),6) AS score, fics.customer_id, PARENT_AGENCY_ID AS parentId FROM 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/screen/FactIndexCommunityScoreDao.xml index 7978db5eee..919dec3b2b 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/screen/FactIndexCommunityScoreDao.xml @@ -69,7 +69,7 @@ fics.month_id, fics.quarter_id, fics.year_id, - AVG( fics.score ) AS score, + ROUND(AVG( fics.score ),6) AS score, fics.customer_id, sca.pid AS parentId FROM 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 index 010ac06798..05ae94667e 100644 --- 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 @@ -10,7 +10,7 @@ figc.month_id as monthId, figc.quarter_id as quarterId, figc.year_id as yearId, - AVG( figc.score ) AS score, + ROUND(AVG( figc.score ),6) AS score, figc.customer_id as customerId, sca.pid AS parentId FROM From d650ef1997366afc7c24c7f44502511d2b196819 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 15:09:47 +0800 Subject: [PATCH 10/42] =?UTF-8?q?=E5=8E=BB=E9=99=A4=20parent=5Fagency=5Fid?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=EF=BC=8CcommunityScore=E5=92=8CagencyScore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateCommunityServiceImpl.java | 45 +++++------------- .../IndexCalculateDistrictServiceImpl.java | 41 +++++------------ .../impl/IndexCalculateStreetServiceImpl.java | 46 +++++-------------- .../indexcal/AgencyScoreDao.xml | 12 ++--- .../screen/FactIndexCommunityScoreDao.xml | 9 +--- 5 files changed, 40 insertions(+), 113 deletions(-) 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..52cc9d836f 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 @@ -78,7 +78,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { @@ -87,8 +86,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -97,7 +95,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni subPartyAvgList.forEach( party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -118,8 +115,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (publishArticleCountList.size() > NumConstant.ONE) { List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); @@ -129,7 +125,6 @@ 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<>(); publish.forEach(c -> { - 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); }); @@ -143,7 +138,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -162,7 +157,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - 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()); @@ -171,8 +165,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -180,7 +173,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -196,8 +188,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -212,7 +203,6 @@ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -226,7 +216,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -245,14 +235,12 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); - 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); + sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -261,7 +249,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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()); index1SampleValues.add(s); }); @@ -275,8 +262,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -291,7 +277,6 @@ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -305,7 +290,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -340,7 +325,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); - score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -417,7 +401,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @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 getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); @@ -429,11 +413,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ - score.setParentAgencyId(parentAgency); - } - }); result.add(score); }); return result; @@ -447,10 +426,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ HashMap scoreCountOfSampleId = new HashMap<>(); scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); 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..559d79ec1f 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 @@ -99,7 +99,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -108,8 +107,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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); + sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -117,7 +115,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict subPartyAvgList.forEach( party -> { List index1SampleValues = new ArrayList<>(); party.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -138,8 +135,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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); + sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (publishArticleCountList.size() > NumConstant.ONE) { List decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); @@ -149,7 +145,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -161,7 +156,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -180,13 +175,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - 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); + sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (districtGovernAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -194,7 +187,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -206,8 +198,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } 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); + sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (deptScoreAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -215,7 +206,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -230,7 +220,7 @@ 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -249,14 +239,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); - 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); + sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (subStreetAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -265,7 +253,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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()); index1SampleValues.add(s); }); @@ -279,7 +266,7 @@ 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -315,7 +302,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); - score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -365,7 +351,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict * @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 getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -378,11 +364,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(indexCode); score.setScore(v); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ - score.setParentAgencyId(parentAgency); - } - }); result.add(score); }); return result; @@ -396,10 +377,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ HashMap scoreCountOfSampleId = new HashMap<>(); scoreCountOfSampleId.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, indexCode); deleteAndInsert(customerId, monthId, indexCode, result); } } 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..64e1f67591 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 @@ -105,7 +105,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -114,8 +113,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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); + sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (subCommPartyAvgScore.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -124,7 +122,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -145,8 +142,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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); + sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); return; }else if (mapList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(mapList.stream().map(m -> new BigDecimal(m.get(fieldName).toString())).collect(Collectors.toList())); @@ -155,7 +151,6 @@ 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<>(); publish.forEach(c -> { - 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); }); @@ -167,7 +162,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -186,13 +181,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - 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); + sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (subGridGovernAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -200,7 +193,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -216,8 +208,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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); + sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); return; } else if (communityGovernAbility.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -233,7 +224,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -245,7 +235,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); 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); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -264,14 +254,12 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); - 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); + sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (subCommServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -280,7 +268,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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()); index1SampleValues.add(s); }); @@ -294,8 +281,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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); + sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); return; } else if (communityActivityCountList.size() > NumConstant.ONE) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -310,7 +296,6 @@ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -322,8 +307,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); 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 - ); + List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -359,7 +343,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setDataType(IndexCalConstant.STREET_LEVEL); value.forEach(street -> { score.setScore(score.getScore().add(street.getScore())); - score.setParentAgencyId(street.getParentAgencyId()); }); result.add(score); }); @@ -409,7 +392,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @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 getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -421,11 +404,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); - pid.forEach((agency,parentAgency) -> { - if (k.equals(agency)){ - score.setParentAgencyId(parentAgency); - } - }); result.add(score); }); return result; @@ -439,10 +417,10 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode,Map pid){ + public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ HashMap scoreCountOfSample = new HashMap<>(); scoreCountOfSample.put(agencyId,new BigDecimal(NumConstant.FIFTY)); - List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode,pid); + List result = getResult(scoreCountOfSample, customerId, monthId, NumConstant.ZERO_STR, indexCode); deleteAndInsert(customerId, monthId, indexCode, result); } } 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 6ba627fd68..683a939b8a 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,14 +5,13 @@ - 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, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, IS_TOTAL, 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}, @@ -47,7 +46,6 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, - PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -71,8 +69,7 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE, - PARENT_AGENCY_ID + INDEX_CODE FROM fact_index_agency_score WHERE @@ -91,8 +88,7 @@ fics.quarter_id, fics.year_id, ROUND(AVG( fics.score ),6) AS score, - fics.customer_id, - PARENT_AGENCY_ID AS parentId + fics.customer_id FROM fact_index_agency_score fics WHERE @@ -111,7 +107,6 @@ CUSTOMER_ID, AGENCY_ID, - PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -132,7 +127,6 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, - #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, 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/screen/FactIndexCommunityScoreDao.xml index 919dec3b2b..09a2b752d7 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/screen/FactIndexCommunityScoreDao.xml @@ -5,14 +5,13 @@ - 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, YEAR_ID, QUARTER_ID, MONTH_ID, IS_TOTAL, 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}, @@ -50,8 +49,7 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE, - PARENT_AGENCY_ID + INDEX_CODE FROM fact_index_community_score WHERE @@ -88,7 +86,6 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, - PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -109,7 +106,6 @@ ID, CUSTOMER_ID, AGENCY_ID, - PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -128,7 +124,6 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, - #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, From f5585b4d894ad901fae83f42997bceb45f197190 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Sep 2020 15:19:07 +0800 Subject: [PATCH 11/42] =?UTF-8?q?Revert=20"=E5=8E=BB=E9=99=A4=20parent=5Fa?= =?UTF-8?q?gency=5Fid=E5=AD=97=E6=AE=B5=EF=BC=8CcommunityScore=E5=92=8Cage?= =?UTF-8?q?ncyScore"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d650ef19 --- .../IndexCalculateCommunityServiceImpl.java | 73 ++++++++++++------- .../IndexCalculateDistrictServiceImpl.java | 69 +++++++++++------- .../impl/IndexCalculateStreetServiceImpl.java | 70 ++++++++++++------ .../indexcal/AgencyScoreDao.xml | 12 ++- .../screen/FactIndexCommunityScoreDao.xml | 9 ++- 5 files changed, 153 insertions(+), 80 deletions(-) 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 52cc9d836f..50960abf52 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 @@ -78,6 +78,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { @@ -85,16 +86,18 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } 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.ONE) { 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()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -112,19 +115,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())); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } 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); return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } else if (publishArticleCountList.size() > NumConstant.ONE) { 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -138,7 +143,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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()); + 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); return true; } @@ -157,6 +162,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + 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()); @@ -165,7 +171,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return; } if (subGridGovernAvg.size() == NumConstant.ONE) { - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + 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) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -173,6 +180,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -188,7 +196,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + 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) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -203,6 +212,7 @@ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -216,7 +226,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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()); + 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); return true; } @@ -235,12 +245,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return false; } List indexInputVOS = new ArrayList<>(); + 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) { - sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + 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); return; } else if (subGridServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -249,6 +261,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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()); index1SampleValues.add(s); }); @@ -262,7 +275,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + 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) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -277,6 +291,7 @@ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -290,7 +305,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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()); + 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); return true; } @@ -325,6 +340,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -392,16 +408,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni } /** + * @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) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); @@ -413,23 +429,28 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + score.setParentAgencyId(parentAgency); + } + }); result.add(score); }); return result; } /** - * @Description 当查询结果为一条时,调用此方法 * @param agencyId * @param customerId * @param monthId + * @Description 当查询结果为一条时,调用此方法 * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + 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); + 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 559d79ec1f..dad92d33df 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 @@ -99,6 +99,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -106,15 +107,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); return; - }else if (subGridPartyAvgScore.size() == NumConstant.ONE){ - sizeOne(subGridPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } 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.ONE) { 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()); index1SampleValues.add(s); }); @@ -132,19 +135,21 @@ 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())); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (publishArticleCountList.size() == NumConstant.ONE){ - sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } 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); return; - }else if (publishArticleCountList.size() > NumConstant.ONE) { + } else if (publishArticleCountList.size() > NumConstant.ONE) { 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -156,7 +161,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + 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); return true; } @@ -175,11 +180,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); + 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) { - sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + 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); return; } else if (districtGovernAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -187,6 +194,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -198,7 +206,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } 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) { - sizeOne(deptScoreAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + 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); return; } else if (deptScoreAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -206,6 +215,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -220,7 +230,7 @@ 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()); + 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); return true; } @@ -239,12 +249,14 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return false; } List indexInputVOS = new ArrayList<>(); + 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) { - sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + 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); return; } else if (subStreetAvgList.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -253,6 +265,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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()); index1SampleValues.add(s); }); @@ -266,7 +279,7 @@ 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()); + 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); return true; } @@ -302,6 +315,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); + score.setParentAgencyId(community.getParentAgencyId()); }); result.add(score); }); @@ -342,16 +356,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } /** + * @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) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -364,23 +378,28 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setIndexCode(indexCode); score.setScore(v); score.setDataType(IndexCalConstant.DISTRICT_LEVEL); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + score.setParentAgencyId(parentAgency); + } + }); result.add(score); }); return result; } /** - * @Description 当查询结果为一条时,调用此方法 * @param agencyId * @param customerId * @param monthId + * @Description 当查询结果为一条时,调用此方法 * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + 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); + 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/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 64e1f67591..099c69c125 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 @@ -105,6 +105,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); + Map pid = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -112,16 +113,18 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); return; - }else if (subCommPartyAvgScore.size() == NumConstant.ONE){ - sizeOne(subCommPartyAvgScore.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } 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.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); Integer indexEnd = NumConstant.TEN; List> partition = ListUtils.partition(subCommPartyAvgScore, indexEnd); partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -139,18 +142,20 @@ 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())); + log.error(String.format(IndexCalConstant.INDEX_CODE_NULL, detail.getIndexCode())); return; - }else if (mapList.size() == NumConstant.ONE){ - sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + } 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); return; - }else if (mapList.size() > NumConstant.ONE) { + } else if (mapList.size() > NumConstant.ONE) { 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldName)))); index1SampleValues.add(s); }); @@ -162,7 +167,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + 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); return true; } @@ -181,11 +186,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); + 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) { - sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + 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) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -193,6 +200,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { + pid.put(c.getAgencyId(), c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -208,7 +216,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); return; }else if (communityGovernAbility.size() == NumConstant.ONE) { - sizeOne(communityGovernAbility.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + 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) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -224,6 +233,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -235,7 +245,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); + 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); return true; } @@ -254,12 +264,14 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ return false; } List indexInputVOS = new ArrayList<>(); + 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) { - sizeOne(subCommServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + 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); return; } else if (subCommServiceAvg.size() > NumConstant.ONE) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); @@ -268,6 +280,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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()); index1SampleValues.add(s); }); @@ -281,7 +294,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); return; }else if (communityActivityCountList.size() == NumConstant.ONE) { - sizeOne(communityActivityCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); + 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) { String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); @@ -296,6 +310,7 @@ 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()); SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); index1SampleValues.add(s); }); @@ -307,7 +322,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); - List result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode()); + 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); return true; } @@ -343,6 +359,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setDataType(IndexCalConstant.STREET_LEVEL); value.forEach(street -> { score.setScore(score.getScore().add(street.getScore())); + score.setParentAgencyId(street.getParentAgencyId()); }); result.add(score); }); @@ -383,16 +400,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } /** + * @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) { + public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, Map pid) { List result = new ArrayList<>(); scoreCountOfSampleId.forEach((k, v) -> { AgencyScoreDTO score = new AgencyScoreDTO(); @@ -404,23 +421,28 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setIsTotal(isTotal); score.setIndexCode(indexCode); score.setScore(v); + pid.forEach((agency, parentAgency) -> { + if (k.equals(agency)) { + score.setParentAgencyId(parentAgency); + } + }); result.add(score); }); return result; } /** - * @Description 当查询结果为一条时,调用此方法 * @param agencyId * @param customerId * @param monthId + * @Description 当查询结果为一条时,调用此方法 * @author zxc * @date 2020/9/2 2:40 下午 */ - public void sizeOne(String agencyId,String customerId,String monthId,String indexCode){ + 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); + 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/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 683a939b8a..6ba627fd68 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,13 +5,14 @@ - INSERT INTO fact_index_agency_score (ID, CUSTOMER_ID, 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, 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}, @@ -46,6 +47,7 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, + PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -69,7 +71,8 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE + INDEX_CODE, + PARENT_AGENCY_ID FROM fact_index_agency_score WHERE @@ -88,7 +91,8 @@ fics.quarter_id, fics.year_id, ROUND(AVG( fics.score ),6) AS score, - fics.customer_id + fics.customer_id, + PARENT_AGENCY_ID AS parentId FROM fact_index_agency_score fics WHERE @@ -107,6 +111,7 @@ CUSTOMER_ID, AGENCY_ID, + PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -127,6 +132,7 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, + #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, 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/screen/FactIndexCommunityScoreDao.xml index 09a2b752d7..919dec3b2b 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/screen/FactIndexCommunityScoreDao.xml @@ -5,13 +5,14 @@ - INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, 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, 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}, @@ -49,7 +50,8 @@ QUARTER_ID, YEAR_ID, SCORE, - INDEX_CODE + INDEX_CODE, + PARENT_AGENCY_ID FROM fact_index_community_score WHERE @@ -86,6 +88,7 @@ SELECT CUSTOMER_ID customerId, AGENCY_ID agencyId, + PARENT_AGENCY_ID parentAgencyId, YEAR_ID yearId, MONTH_ID monthId, IS_TOTAL isTotal, @@ -106,6 +109,7 @@ ID, CUSTOMER_ID, AGENCY_ID, + PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, @@ -124,6 +128,7 @@ (SELECT REPLACE(UUID(), '-', '') AS id), #{customerId}, #{item.agencyId}, + #{item.parentAgencyId}, #{item.yearId}, #{item.quarterId}, From b109e1ceaab3eaed7c21cb39af4c7174719de3e9 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 15:57:11 +0800 Subject: [PATCH 12/42] =?UTF-8?q?=E6=8C=87=E6=A0=87=E9=87=87=E9=9B=86?= =?UTF-8?q?=E3=80=81=E5=A4=A7=E5=B1=8F=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E6=9C=89=E6=8E=A5=E5=8F=A3=EF=BC=8C=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E4=BF=AE=E6=94=B9=EF=BC=9B=20=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=88=A0=E9=99=A4=EF=BC=8C=E6=96=B9=E5=BC=8F=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/DeptGovrnAbilityDataFormDTO.java | 30 ++ .../form/GridGovrnAbilityDataFormDTO.java | 30 ++ .../form/GridPartyAbilityDataFormDTO.java | 30 ++ .../form/GridPartyMemberDataFormDTO.java | 2 +- .../form/GridServiceAbilityDataFormDTO.java | 28 ++ .../form/OrgGovrnAbilityDataFormDTO.java | 30 ++ .../form/OrgPartyAbilityDataFormDTO.java | 30 ++ .../form/OrgServiceAbilityDataFormDTO.java | 29 ++ .../form/CpcBaseDataListFormDTO.java | 25 ++ .../form/CustomerAgencyListFormDTO.java | 25 ++ .../form/CustomerDeptListFormDTO.java | 24 + .../form/CustomerGridListFormDTO.java | 24 + .../form/DifficultyDataFormDTO.java | 2 +- .../screencoll/form/EventDataListFormDTO.java | 28 ++ .../form/GovernRankDataListFormDTO.java | 29 ++ .../form/IndexDataListMonthlyFormDTO.java | 29 ++ .../form/IndexDataListYearlyFormDTO.java | 29 ++ .../form/OrgRankDataListFormDTO.java | 29 ++ .../form/PartyBranchDataListFormDTO.java | 29 ++ .../form/PartyLinkMassesDataListFormDTO.java | 24 + .../form/PartyUserRankDataListFormDTO.java | 24 + .../form/PioneerDataListFormDTO.java | 25 ++ .../form/PublicPartiTotalDataListFormDTO.java | 25 ++ .../screencoll/form/UserJoinListFormDTO.java | 29 ++ .../form/UserTotalDataListFormDTO.java | 24 + .../FactIndexCollectController.java | 22 +- .../controller/ScreenCollController.java | 32 +- .../FactIndexGovrnAblityDeptMonthlyDao.java | 16 +- .../FactIndexGovrnAblityGridMonthlyDao.java | 11 +- .../FactIndexGovrnAblityOrgMonthlyDao.java | 13 +- .../FactIndexPartyAblityGridMonthlyDao.java | 15 +- .../FactIndexPartyAblityOrgMonthlyDao.java | 13 +- .../FactIndexServiceAblityGridMonthlyDao.java | 17 +- .../FactIndexServiceAblityOrgMonthlyDao.java | 13 +- .../screen/ScreenCpcBaseDataDao.java | 7 +- .../screen/ScreenCustomerAgencyDao.java | 7 +- .../screen/ScreenCustomerDeptDao.java | 7 +- .../screen/ScreenCustomerGridDao.java | 7 +- .../screen/ScreenDifficultyDataDao.java | 2 +- .../screen/ScreenEventDataDao.java | 9 +- .../screen/ScreenGovernRankDataDao.java | 11 +- .../screen/ScreenIndexDataMonthlyDao.java | 11 +- .../screen/ScreenIndexDataYearlyDao.java | 9 +- .../screen/ScreenOrgRankDataDao.java | 11 +- .../screen/ScreenPartyBranchDataDao.java | 11 +- .../screen/ScreenPartyLinkMassesDataDao.java | 7 +- .../screen/ScreenPartyUserRankDataDao.java | 9 +- .../screen/ScreenPioneerDataDao.java | 7 +- .../screen/ScreenPublicPartiTotalDataDao.java | 7 +- .../screen/ScreenUserJoinDao.java | 11 +- .../screen/ScreenUserTotalDataDao.java | 7 +- .../indexcoll/FactIndexCollectService.java | 22 +- .../impl/FactIndexCollectServiceImpl.java | 173 +++----- .../screen/ScreenCollService.java | 64 +-- .../screen/impl/ScreenCollServiceImpl.java | 413 +++++++++--------- .../FactIndexGovrnAblityDeptMonthlyDao.xml | 3 +- .../FactIndexGovrnAblityGridMonthlyDao.xml | 4 +- .../FactIndexGovrnAblityOrgMonthlyDao.xml | 7 +- .../FactIndexPartyAblityGridMonthlyDao.xml | 4 +- .../FactIndexPartyAblityOrgMonthlyDao.xml | 7 +- .../FactIndexServiceAblityGridMonthlyDao.xml | 4 +- .../FactIndexServiceAblityOrgMonthlyDao.xml | 7 +- .../screen/ScreenCpcBaseDataDao.xml | 5 +- .../screen/ScreenCustomerAgencyDao.xml | 5 +- .../screen/ScreenCustomerDeptDao.xml | 5 +- .../screen/ScreenCustomerGridDao.xml | 5 +- .../screen/ScreenEventDataDao.xml | 3 +- .../screen/ScreenGovernRankDataDao.xml | 7 +- .../screen/ScreenIndexDataMonthlyDao.xml | 7 +- .../screen/ScreenIndexDataYearlyDao.xml | 5 +- .../screen/ScreenOrgRankDataDao.xml | 7 +- .../screen/ScreenPartyBranchDataDao.xml | 7 +- .../screen/ScreenPartyLinkMassesDataDao.xml | 5 +- .../screen/ScreenPartyUserRankDataDao.xml | 3 +- .../screen/ScreenPioneerDataDao.xml | 5 +- .../screen/ScreenPublicPartiTotalDataDao.xml | 5 +- .../screen/ScreenUserJoinDao.xml | 7 +- .../screen/ScreenUserTotalDataDao.xml | 5 +- .../epmet/feign/EpmetUserOpenFeignClient.java | 4 +- 79 files changed, 1097 insertions(+), 626 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/DeptGovrnAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridGovrnAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridPartyAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/GridServiceAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgGovrnAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgPartyAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/form/OrgServiceAbilityDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListMonthlyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataListYearlyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyUserRankDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PublicPartiTotalDataListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinListFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataListFormDTO.java 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/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/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/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/ScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenCollController.java index d83f8df3c5..55e91e89d4 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/ScreenCollController.java @@ -37,7 +37,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partyuserrankdata") - public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -53,7 +53,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -69,7 +69,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -85,7 +85,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -101,7 +101,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -117,7 +117,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -149,7 +149,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -165,7 +165,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatamonthly") - public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -183,7 +183,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("indexdatayearly") - public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -199,7 +199,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -215,7 +215,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -231,7 +231,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -247,7 +247,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -263,7 +263,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -279,7 +279,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -296,7 +296,7 @@ public class ScreenCollController { **/ @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") - public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } 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..c2dc598bfa 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、组织层级 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/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 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..02cd42be2a 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,7 +1,6 @@ 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; @@ -27,8 +26,6 @@ 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 +45,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; @@ -96,118 +92,113 @@ 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); } } @@ -283,13 +274,9 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { 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,7 +311,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -382,13 +369,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,7 +407,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -478,13 +460,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 +490,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -564,13 +541,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 +575,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, getYearStr(monthId), monthId, orgIds); + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -872,12 +845,8 @@ 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); + screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); 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/ScreenCollService.java index 1e6dca0080..29be14a3d2 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/ScreenCollService.java @@ -13,7 +13,7 @@ public interface ScreenCollService { /** * 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 index 6018622deb..7afe8df0b0 100644 --- 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 @@ -87,110 +87,104 @@ public class ScreenCollServiceImpl implements ScreenCollService { @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); + 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(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); + 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(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); + 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(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); + 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(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); + 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(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); + 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); + } - 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); - } + // 处理图片 + 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,物理删除 - 事件数据图片数据 + screenEventImgDataDao.delEventImgDataByEventId(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()); + screenEventImgDataDao.insert(imgDataEntity); } } } @@ -204,178 +198,177 @@ public class ScreenCollServiceImpl implements ScreenCollService { //直接删除当前客户下所有的数据 screenDifficultyDataDao.deleteDifficultyData(customerId); } - if (null != formDTO && !CollectionUtils.isEmpty(formDTO.getDiffcultyDataList())){ - screenDifficultyDataDao.batchInsertDifficultyData(formDTO.getDiffcultyDataList(), 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(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); + 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(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); + 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(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); + 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(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); + 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(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); + 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(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); + 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(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); + 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(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); + 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(); + } - // 定义本月待添加数据的集合 - 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); + 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); + } } - } 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); } - screenUserJoinDao.batchInsertUserJoin(curMonthJoinEntityList, customerId); } } @@ -441,30 +434,30 @@ public class ScreenCollServiceImpl implements ScreenCollService { @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); + 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(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); + 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/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml index 67165f1bf7..c65c890f46 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,7 @@ 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} 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/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..21d0a572c1 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; 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/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-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 4e3da40627..962b8917e4 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -50,7 +50,7 @@ public interface EpmetUserOpenFeignClient { * @date 2020/6/2 16:11 */ @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") - Result> getStaffRoles(@PathVariable String staffId); + Result> getStaffRoles(@PathVariable("staffId") String staffId); /** * @param staffId @@ -300,7 +300,7 @@ public interface EpmetUserOpenFeignClient { /** * 更改角色所属组织 * @author zhaoqifeng - * @date 2020/8/31 10:36 + * @date 2020/8/31 10:36 * @param formDTO * @return com.epmet.commons.tools.utils.Result */ From c1e8b0f102d3968849ce970785dc948e5b57acc2 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Tue, 8 Sep 2020 16:05:18 +0800 Subject: [PATCH 13/42] =?UTF-8?q?=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4(?= =?UTF-8?q?=E6=81=A2=E5=A4=8D=20feignClient=E6=96=87=E4=BB=B6=E5=86=85?= =?UTF-8?q?=E5=AE=B9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/FactIndexGovrnAblityDeptMonthlyDao.xml | 1 + .../src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) 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 c65c890f46..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 @@ -28,6 +28,7 @@ delete from fact_index_govrn_ablity_dept_monthly where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + limit 1000; diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 962b8917e4..a1902d95c5 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -50,7 +50,7 @@ public interface EpmetUserOpenFeignClient { * @date 2020/6/2 16:11 */ @PostMapping("/epmetuser/staffrole/staffroles/{staffId}") - Result> getStaffRoles(@PathVariable("staffId") String staffId); + Result> getStaffRoles(@PathVariable String staffId); /** * @param staffId From 2a1674c13b577c1ee9af2b6a91e121f785c3583f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 17:38:18 +0800 Subject: [PATCH 14/42] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenCustomerAgencyDao.java | 8 ++++ .../IndexCalculateDistrictServiceImpl.java | 44 +++++++++---------- .../impl/IndexCalculateStreetServiceImpl.java | 29 ++++++------ .../indexcal/AgencyScoreDao.xml | 2 +- .../screen/FactIndexCommunityScoreDao.xml | 6 +-- .../screen/ScreenCustomerAgencyDao.xml | 11 +++++ 6 files changed, 56 insertions(+), 44 deletions(-) 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 c2dc598bfa..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 @@ -74,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/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 dad92d33df..3720a6cc4e 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; @@ -55,6 +56,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict private AgencyScoreDao agencyScoreDao; @Autowired private DeptScoreDao deptScoreDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; /** * @Description 计算全区相关总分 @@ -107,18 +110,14 @@ 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 -> { 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())); @@ -184,18 +183,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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 if (districtGovernAvgList.size() > NumConstant.ZERO) { 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())); @@ -205,17 +203,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } 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 if (deptScoreAvgList.size() > NumConstant.ZERO) { MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getAgencyId(), c.getParentId()); + pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); @@ -254,19 +251,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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 if (subStreetAvgList.size() > NumConstant.ZERO) { 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); 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 099c69c125..978473be33 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 @@ -12,6 +12,7 @@ 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.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -61,6 +62,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ private FactIndexCommunityScoreDao communityScoreDao; @Autowired private AgencyScoreDao agencyScoreDao; + @Autowired + private ScreenCustomerAgencyDao customerAgencyDao; /** * @Description 计算街道相关总分 @@ -113,18 +116,14 @@ 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); partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.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); }); @@ -190,17 +189,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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 -> { 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); }); @@ -269,18 +267,17 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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 -> { 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); }); 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 6ba627fd68..61f3db1f65 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 @@ -101,7 +101,7 @@ AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} AND fics.DATA_TYPE = #{dataType} - GROUP BY fics.agency_id + GROUP BY fics.parent_agency_id 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/screen/FactIndexCommunityScoreDao.xml index 919dec3b2b..e00f0b2c12 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/screen/FactIndexCommunityScoreDao.xml @@ -65,7 +65,7 @@ + + + From 1c77abf70329c491666262676bdb9d135f15d071 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 8 Sep 2020 17:51:07 +0800 Subject: [PATCH 15/42] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 1 - 1 file changed, 1 deletion(-) 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 978473be33..3c024c3ec4 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 @@ -228,7 +228,6 @@ 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()); From 7ff481c5b2a1f8cb8de476b366b8aa7bcaa82aaf Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Sep 2020 18:20:43 +0800 Subject: [PATCH 16/42] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E6=98=8E=E7=BB=86=E5=88=86=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../batch/BatchScoreCalculator.java | 48 ++++++++++++++++++- .../normalizing/batch/CalculateResult.java | 25 ++++++++++ .../stats/test/normalizing/DemoScoreCal.java | 12 +++-- 3 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/CalculateResult.java 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..d13eb8337a 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); + } + SampleScore sampleScore = new SampleScore(idx.getIndexId(), 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..8430149681 --- /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/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..3b41f1ff2f 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; @@ -237,12 +234,19 @@ public class DemoScoreCal { 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---------------"); } From c81447993151b97af5ef46e75cec056bbb3eb165 Mon Sep 17 00:00:00 2001 From: jianjun Date: Tue, 8 Sep 2020 22:06:04 +0800 Subject: [PATCH 17/42] =?UTF-8?q?=E6=B7=BB=E5=8A=A0allParentIndexCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/AgencyScoreDTO.java | 19 +++++++++------ .../com/epmet/dto/indexcal/DeptScoreDTO.java | 14 +++++++---- .../indexcal/CpcScoreEntity.java | 17 +++++++++----- .../indexcal/DeptScoreEntity.java | 9 ++++++-- .../indexcal/GridScoreEntity.java | 23 +++++++++++-------- .../screen/FactIndexCommunityScoreEntity.java | 9 ++++++-- .../screen/IndexDictEntity.java | 23 +++++++++++-------- .../epmet/model/IndexExcelDataListener.java | 5 ++++ 8 files changed, 80 insertions(+), 39 deletions(-) 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..f4f23d2611 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; 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-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/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/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/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..971a11074a 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"); + entity.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"); + entity.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"); + entity.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"); + entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); indexDicMap.put(data.getLevel5Index(), entity5); } } From ba605db6d813c6d3bd579a5ce4d8bc0e5e1f5ccd Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 09:54:36 +0800 Subject: [PATCH 18/42] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../normalizing/batch/CalculateResult.java | 2 +- .../normalizing/batch/IndexScoreVo.java | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java 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 index 8430149681..4765c023ba 100644 --- 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 @@ -21,5 +21,5 @@ public class CalculateResult implements Serializable { /** * 每项具体的分支 */ - private List details; + private List details; } 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..ee3605fb7d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/support/normalizing/batch/IndexScoreVo.java @@ -0,0 +1,25 @@ +package com.epmet.support.normalizing.batch; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author liujianjun + */ +@Data +public class IndexScoreVo implements Serializable { + + private static final long serialVersionUID = 65642416224721650L; + /** + * 指标code + */ + private String indexCode; + /** + * 分值 + */ + private BigDecimal score; + + +} From c2d6eecf385f19d1eba3cf6958b0efa807c1ed8d Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:05:30 +0800 Subject: [PATCH 19/42] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/support/normalizing/batch/BatchScoreCalculator.java | 2 +- .../java/com/epmet/support/normalizing/batch/IndexScoreVo.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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 d13eb8337a..5cc30af57a 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 @@ -67,7 +67,7 @@ public class BatchScoreCalculator { result.setDetails(new ArrayList<>()); scoreCountOfSamples.put(sampleId, result); } - SampleScore sampleScore = new SampleScore(idx.getIndexId(), score); + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), score); result.getDetails().add(sampleScore); result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); } 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 index ee3605fb7d..a46ec66c1d 100644 --- 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 @@ -9,6 +9,7 @@ import java.math.BigDecimal; * @author liujianjun */ @Data +@AllArgsConstructor public class IndexScoreVo implements Serializable { private static final long serialVersionUID = 65642416224721650L; From 04f6c16f45a16cc2320ceceaad6319c00415037f Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:08:28 +0800 Subject: [PATCH 20/42] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/support/normalizing/batch/IndexScoreVo.java | 1 + 1 file changed, 1 insertion(+) 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 index a46ec66c1d..e6d189045c 100644 --- 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 @@ -1,5 +1,6 @@ package com.epmet.support.normalizing.batch; +import lombok.AllArgsConstructor; import lombok.Data; import java.io.Serializable; From e250d40cf5f362b36fdfc5841dba5118db520fc6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Sep 2020 10:15:23 +0800 Subject: [PATCH 21/42] =?UTF-8?q?communityScore=E6=96=87=E4=BB=B6=E6=8C=AA?= =?UTF-8?q?=E5=8A=A8=EF=BC=8CgridScore=E5=90=88=E5=B9=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CommunityScoreDao.java} | 4 +- .../indexcal/GridScoreDao.java | 43 ++++++++ .../screen/FactIndexGridScoreDao.java | 77 ------------- .../IndexCalculateCommunityServiceImpl.java | 8 +- .../impl/IndexCalculateStreetServiceImpl.java | 4 +- .../impl/FactIndexCollectServiceImpl.java | 6 +- .../CommunityScoreDao.xml} | 2 +- .../evaluationindex/indexcal/GridScoreDao.xml | 101 +++++++++++++++++ .../screen/FactIndexGridScoreDao.xml | 103 ------------------ 9 files changed, 157 insertions(+), 191 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/{screen/FactIndexCommunityScoreDao.java => indexcal/CommunityScoreDao.java} (96%) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java rename epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/{screen/FactIndexCommunityScoreDao.xml => indexcal/CommunityScoreDao.xml} (98%) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml 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 96% 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..ba236c1192 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 【社区】中间表插入 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/screen/FactIndexGridScoreDao.java deleted file mode 100644 index 77c3f85366..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/FactIndexGridScoreDao.java +++ /dev/null @@ -1,77 +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.dao.evaluationindex.screen; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screen.FactIndexGridScoreDTO; -import com.epmet.dto.screen.result.SubGridAvgResultDTO; -import com.epmet.entity.evaluationindex.screen.FactIndexGridScoreEntity; -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-28 - */ -@Mapper -public interface FactIndexGridScoreDao extends BaseDao { - - /** - * @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); -} 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 50960abf52..07a14db8f4 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; @@ -59,9 +59,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 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 3c024c3ec4..6a672a88c7 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.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; @@ -59,7 +59,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ @Autowired private IndexCodeFieldReService indexCodeFieldReService; @Autowired - private FactIndexCommunityScoreDao communityScoreDao; + private CommunityScoreDao communityScoreDao; @Autowired private AgencyScoreDao agencyScoreDao; @Autowired 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 02cd42be2a..65e0afbf0d 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 @@ -7,7 +7,9 @@ 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; @@ -63,9 +65,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 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 98% 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 e00f0b2c12..66ea89b140 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,7 +1,7 @@ - + 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/screen/FactIndexGridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/FactIndexGridScoreDao.xml deleted file mode 100644 index 05ae94667e..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() - ) - - - - - From 76249a1abcfb5a0cce33ecdd53a2702a73bcc2d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 9 Sep 2020 10:23:15 +0800 Subject: [PATCH 22/42] KcScreenCollController --- .../epmet/controller/KcScreenCollController.java | 15 +++++++++++++++ ...oller.java => ShiBeiScreenCollController.java} | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/{ScreenCollController.java => ShiBeiScreenCollController.java} (99%) 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 99% 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 55e91e89d4..467bb63b2f 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 @@ -14,14 +14,14 @@ 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; From 286f501da3eb7eafeacbc767c9ee30f3f63a94ce Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 9 Sep 2020 10:29:30 +0800 Subject: [PATCH 23/42] =?UTF-8?q?=E5=A4=A7=E5=B1=8F=E9=87=87=E9=9B=86?= =?UTF-8?q?=E9=80=9A=E7=94=A8=E5=85=A5=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screencoll/ScreenCollFormDTO.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java 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..95167c65c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -0,0 +1,43 @@ +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; + + /** + * 数据集合 + */ + private List dataList; + + @Override + public String toString() { + return JSON.toJSONString(this); + } +} From 883b33208ac136dac4c9d79a99c26386f2e67f65 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:40:15 +0800 Subject: [PATCH 24/42] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/model/IndexExcelDataListener.java | 8 +++--- .../indexcal/impl/DeptScoreServiceImpl.java | 1 + .../impl/GridCorreLationServiceImpl.java | 9 +++--- .../IndexCalculateCommunityServiceImpl.java | 12 ++++---- .../IndexCalculateDistrictServiceImpl.java | 10 +++---- .../impl/IndexCalculateStreetServiceImpl.java | 12 ++++---- .../batch/BatchScoreCalculator.java | 2 +- .../normalizing/batch/IndexInputVO.java | 5 ++++ .../normalizing/batch/IndexScoreVo.java | 4 +++ .../stats/test/normalizing/DemoScoreCal.java | 28 +++++++++---------- 10 files changed, 51 insertions(+), 40 deletions(-) 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 971a11074a..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 @@ -274,7 +274,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity2.setIndexName(data.getLevel2Index()); entity2.setCorrelation(data.getCorrelation()); entity2.setLevel("2"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4)); + entity2.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel2Index(), false, 4)); indexDicMap.put(data.getLevel2Index(), entity2); } if (!indexDicMap.containsKey(data.getLevel3Index())) { @@ -282,7 +282,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity3.setIndexName(data.getLevel3Index()); entity3.setCorrelation(data.getCorrelation()); entity3.setLevel("3"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4)); + entity3.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel3Index(), false, 4)); indexDicMap.put(data.getLevel3Index(), entity3); } if (!indexDicMap.containsKey(data.getLevel4Index())) { @@ -290,7 +290,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity4.setIndexName(data.getLevel4Index()); entity4.setCorrelation(data.getCorrelation()); entity4.setLevel("4"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4)); + entity4.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel4Index(), false, 4)); indexDicMap.put(data.getLevel4Index(), entity4); } if (!indexDicMap.containsKey(data.getLevel5Index())) { @@ -298,7 +298,7 @@ public class IndexExcelDataListener extends AnalysisEventListener { entity5.setIndexName(data.getLevel5Index()); entity5.setCorrelation(data.getCorrelation()); entity5.setLevel("5"); - entity.setIndexCode(Pinyin4jUtil.getSpellPinYin(data.getLevel5Index(), false, 4)); + 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/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 07a14db8f4..cd2e036cf4 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 @@ -102,7 +102,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -133,7 +133,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -185,7 +185,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -216,7 +216,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -265,7 +265,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -295,7 +295,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } 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 3720a6cc4e..e8a50fabfe 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 @@ -121,7 +121,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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -152,7 +152,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -197,7 +197,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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -217,7 +217,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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -265,7 +265,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } 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 6a672a88c7..9cdd9fe536 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 @@ -128,7 +128,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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -158,7 +158,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -203,7 +203,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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -234,7 +234,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -280,7 +280,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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -310,7 +310,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } 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 5cc30af57a..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 @@ -67,7 +67,7 @@ public class BatchScoreCalculator { result.setDetails(new ArrayList<>()); scoreCountOfSamples.put(sampleId, result); } - IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), score); + IndexScoreVo sampleScore = new IndexScoreVo(idx.getIndexId(), idx.getAllParentIndexCode(), score); result.getDetails().add(sampleScore); result.setTotalScore(result.getTotalScore().add(score).setScale(6, RoundingMode.HALF_UP)); } 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 index e6d189045c..3b108999a1 100644 --- 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 @@ -18,6 +18,10 @@ public class IndexScoreVo implements Serializable { * 指标code */ private String indexCode; + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; /** * 分值 */ 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 3b41f1ff2f..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 @@ -75,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); @@ -101,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); @@ -160,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); @@ -224,13 +224,13 @@ 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); From 3411d59e6b2597ff70d33e671e4f61185f036028 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 10:55:05 +0800 Subject: [PATCH 25/42] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=8C=87=E6=A0=87code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CpcIndexCalculateServiceImpl.java | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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 120aa0d77d..5be3452230 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 @@ -23,6 +23,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; @@ -224,7 +225,7 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } } log.info("计算的参数:{}", JSON.toJSONString(indexMap)); - HashMap result = calculateScore(indexMap); + HashMap result = calculateScore(indexMap); log.info("计算的结果:{}", result); //处理结果 @@ -244,13 +245,20 @@ 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) -> { CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); - cpcScoreEntity.setScore(score); + cpcScoreEntity.setScore(score.getTotalScore()); list.add(cpcScoreEntity); + score.getDetails().forEach(o -> { + CpcScoreEntity child = ConvertUtils.sourceToTarget(o, CpcScoreEntity.class); + child.setIndexCode(o.getIndexCode()); + child.setScore(o.getScore()); + list.add(child); + }); + }); this.deleteAndInsertBatch(formDTO, list, parentIndexCode); } @@ -295,7 +303,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 +315,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); } From 2d01a8faaf7357005982899c747f11f49a6f9981 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 9 Sep 2020 12:18:44 +0800 Subject: [PATCH 26/42] =?UTF-8?q?04=E3=80=81=E4=BA=8B=E4=BB=B6=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=20-=20=E5=9B=BE=E7=89=87=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E6=89=B9=E9=87=8F=E5=88=A0=E9=99=A4=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E3=80=82=2002=E3=80=81=E5=85=9A=E5=BB=BA=E8=83=BD?= =?UTF-8?q?=E5=8A=9B-=E7=BD=91=E6=A0=BC=E7=9B=B8=E5=85=B3=E6=8C=87?= =?UTF-8?q?=E6=A0=87=E4=B8=8A=E6=8A=A5=EF=BC=8C=E6=8E=A5=E5=8F=A3=E5=85=A5?= =?UTF-8?q?=E5=8F=82=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/GridPartyAbilityFormDTO.java | 4 +- .../screen/ScreenEventImgDataDao.java | 8 +++- .../screen/impl/ScreenCollServiceImpl.java | 35 +++++++++++------- .../screen/ScreenEventImgDataDao.xml | 37 ++++++++++++++++++- 4 files changed, 65 insertions(+), 19 deletions(-) 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-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/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 index 7afe8df0b0..bc064d7cd8 100644 --- 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 @@ -171,22 +171,31 @@ public class ScreenCollServiceImpl implements ScreenCollService { } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { screenEventDataDao.batchInsertEventData(formDTO.getDataList(), customerId); - } - // 处理图片 - 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,物理删除 - 事件数据图片数据 - screenEventImgDataDao.delEventImgDataByEventId(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()); - screenEventImgDataDao.insert(imgDataEntity); + // 处理图片 + 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); + } + } } 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() + ) + + From 4a9b734ceb279f09179af87acabb872d99c54608 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 9 Sep 2020 12:50:08 +0800 Subject: [PATCH 27/42] =?UTF-8?q?=E5=B8=82=E5=8C=97=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86=E4=BF=AE=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ShiBeiScreenCollController.java | 39 +++++++++---------- ...vice.java => ShiBeiScreenCollService.java} | 2 +- ....java => ShiBeiScreenCollServiceImpl.java} | 4 +- 3 files changed, 22 insertions(+), 23 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/{ScreenCollService.java => ShiBeiScreenCollService.java} (99%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/{ScreenCollServiceImpl.java => ShiBeiScreenCollServiceImpl.java} (99%) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java index 467bb63b2f..73d6db7bb6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ShiBeiScreenCollController.java @@ -4,14 +4,13 @@ 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 @@ -24,7 +23,7 @@ import java.util.List; public class ShiBeiScreenCollController { @Autowired - private ScreenCollService screenCollService; + private ShiBeiScreenCollService shiBeiScreenCollService; /** * 9、党建引领|基层治理-居民(党员)积分排行榜 @@ -38,7 +37,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("partyuserrankdata") public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyUserRankDataListFormDTO formDTO) { - screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -54,7 +53,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyLinkMassesDataListFormDTO formDTO) { - screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -70,7 +69,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("meetdata") public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PartyBranchDataListFormDTO formDTO) { - screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -86,7 +85,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("orgrankdata") public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody OrgRankDataListFormDTO formDTO) { - screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -102,7 +101,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("governrankdata") public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody GovernRankDataListFormDTO formDTO) { - screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -118,7 +117,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("eventdata") public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody EventDataListFormDTO formDTO) { - screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -134,7 +133,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("difficultydata") public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody DifficultyDataFormDTO formDTO) { - screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -150,7 +149,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("cpcbasedata") public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody CpcBaseDataListFormDTO formDTO) { - screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -166,7 +165,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("indexdatamonthly") public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListMonthlyFormDTO formDTO) { - screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -184,7 +183,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("indexdatayearly") public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody IndexDataListYearlyFormDTO formDTO) { - screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -200,7 +199,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("customerdept") public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerDeptListFormDTO formDTO) { - screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -216,7 +215,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("customergrid") public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerGridListFormDTO formDTO) { - screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -232,7 +231,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("customeragency") public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody CustomerAgencyListFormDTO formDTO) { - screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -248,7 +247,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("usertotaldata") public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserTotalDataListFormDTO formDTO) { - screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -264,7 +263,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("userjoin") public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody UserJoinListFormDTO formDTO) { - screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -280,7 +279,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("pioneerdata") public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PioneerDataListFormDTO formDTO) { - screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } @@ -297,7 +296,7 @@ public class ShiBeiScreenCollController { @ExternalAppRequestAuth @PostMapping("publicpartitotaldata") public Result publicPartiTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody PublicPartiTotalDataListFormDTO formDTO) { - screenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); + shiBeiScreenCollService.insertPublicPartiTotalData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } } 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 99% 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 29be14a3d2..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,7 +9,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/8/18 10:25 */ -public interface ScreenCollService { +public interface ShiBeiScreenCollService { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 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/ShiBeiScreenCollServiceImpl.java similarity index 99% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenCollServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ShiBeiScreenCollServiceImpl.java index bc064d7cd8..bbb0585d44 100644 --- 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/ShiBeiScreenCollServiceImpl.java @@ -26,7 +26,7 @@ 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 com.epmet.service.evaluationindex.screen.ShiBeiScreenCollService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -45,7 +45,7 @@ import java.util.List; */ @Service @DataSource(DataSourceConstant.EVALUATION_INDEX) -public class ScreenCollServiceImpl implements ScreenCollService { +public class ShiBeiScreenCollServiceImpl implements ShiBeiScreenCollService { @Autowired private ScreenPartyUserRankDataDao screenPartyUserRankDataDao; From c46d36ab0d983553e01fb11ebdafbaf155445e93 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Sep 2020 13:45:41 +0800 Subject: [PATCH 28/42] =?UTF-8?q?=E7=A4=BE=E5=8C=BA=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/indexcal/AgencyScoreDTO.java | 1 + .../screen/FactIndexCommunityScoreDTO.java | 6 ++ .../indexcal/CommunityScoreDao.java | 3 +- .../IndexCalculateCommunityServiceImpl.java | 79 +++++++++++++++---- .../indexcal/CommunityScoreDao.xml | 8 +- 5 files changed, 76 insertions(+), 21 deletions(-) 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 f4f23d2611..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 @@ -132,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/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-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java index ba236c1192..ab1439481e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunityScoreDao.java @@ -47,11 +47,10 @@ public interface CommunityScoreDao extends BaseDao 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); + 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(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); return true; } @@ -185,7 +187,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -216,7 +218,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -224,9 +226,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); +// HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + 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(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); return true; } @@ -265,7 +268,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -295,7 +298,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -303,9 +306,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); +// HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); + 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(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); return true; } @@ -338,6 +342,7 @@ 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()); @@ -402,7 +407,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni @Transactional(rollbackFor = Exception.class) public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllGridList) { if (!CollectionUtils.isEmpty(subAllGridList)) { - factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); } } @@ -439,6 +443,49 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni return result; } + 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(); + score.setCustomerId(customerId); + score.setAgencyId(k); + score.setMonthId(monthId); + score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setYearId(DateUtils.getYearId(monthId)); + score.setIsTotal(isTotal); + score.setIndexCode(indexCode); + 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; + } + /** * @param agencyId * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index 66ea89b140..5de328fa92 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -5,7 +5,7 @@ - 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,7 +59,9 @@ 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" From b3d5e275fa0f87e6e8041e1ec5989f30fd241ff0 Mon Sep 17 00:00:00 2001 From: wangchao Date: Wed, 9 Sep 2020 13:47:49 +0800 Subject: [PATCH 29/42] =?UTF-8?q?=E7=A7=AF=E5=88=86=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/UserPointStatisticalDailyServiceImpl.java | 4 ++++ .../com/epmet/service/impl/UserPointTotalServiceImpl.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) 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; @@ -145,6 +148,8 @@ public class UserPointTotalServiceImpl extends BaseServiceImpl opt = rankList.stream().filter(obj -> StringUtils.equals(obj.getUserId(), pointRankFormDTO.getUserId())).findFirst(); From 30e3dea4619f67d2dbd52b871f35d37a0d2e1386 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 14:39:28 +0800 Subject: [PATCH 30/42] =?UTF-8?q?=E8=AE=A1=E7=AE=975=E7=BA=A7=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/indexcal/CpcScoreDao.java | 2 +- .../impl/CpcIndexCalculateServiceImpl.java | 23 +++++++++++++------ .../evaluationindex/indexcal/CpcScoreDao.xml | 7 +++++- 3 files changed, 23 insertions(+), 9 deletions(-) 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/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 5be3452230..666736310c 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 @@ -73,7 +73,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("客户四级指标分值记录不存在"); @@ -83,11 +83,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%算 @@ -160,8 +165,8 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { //如果是第一页且仅有一条数据 则直接给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))); + for (String indexCode : groupIndexDetailsMap.keySet()) { + insertList.add(handleOneGridScene(formDTO, indexCode, list.get(0))); } if (CollectionUtils.isEmpty(insertList)) { deleteAndInsertBatch(formDTO, insertList, null); @@ -169,9 +174,9 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { } else { //遍历指标分组 计算分数 for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { - String parentIndexCode = entry.getKey(); + String indexCode = entry.getKey(); List details = entry.getValue(); - calculateScore(formDTO, details, list, minAndMaxMap, parentIndexCode); + calculateScore(formDTO, details, list, minAndMaxMap, indexCode); } } } @@ -216,7 +221,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); //构造样本值对象 @@ -251,10 +256,14 @@ public class CpcIndexCalculateServiceImpl implements CpcIndexCalculateService { result.forEach((userId, score) -> { CpcScoreEntity cpcScoreEntity = indexDetails.get(userId); cpcScoreEntity.setScore(score.getTotalScore()); + String 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 -> { - CpcScoreEntity child = ConvertUtils.sourceToTarget(o, CpcScoreEntity.class); + CpcScoreEntity child = ConvertUtils.sourceToTarget(parent, CpcScoreEntity.class); child.setIndexCode(o.getIndexCode()); + child.setAllParentIndexCode(o.getAllParentIndexCode()); child.setScore(o.getScore()); list.add(child); }); 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 fe374f941f..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,7 +32,10 @@ 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' @@ -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', From b60c2a2d4c51a8649964d763ff5e0d9a35e89a30 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Wed, 9 Sep 2020 15:02:46 +0800 Subject: [PATCH 31/42] =?UTF-8?q?=E5=B0=86=E6=95=B0=E6=8D=AE=E6=8A=BD?= =?UTF-8?q?=E5=8F=96=E5=88=B0=20=E6=8C=87=E6=95=B0-=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE(=E6=AF=8F=E6=9C=88=E6=95=B0=E5=80=BC)=20=20?= =?UTF-8?q?=E6=8C=87=E6=95=B0-=E6=8C=87=E6=95=B0=E6=95=B0=E6=8D=AE(?= =?UTF-8?q?=E6=8C=89=E5=B9=B4=E7=BB=9F=E8=AE=A1)=EF=BC=8C=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screencoll/ScreenCollFormDTO.java | 5 + .../impl/FactIndexCollectServiceImpl.java | 365 +++++++----------- 2 files changed, 139 insertions(+), 231 deletions(-) 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 index 95167c65c3..760e48b3da 100644 --- 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 @@ -31,6 +31,11 @@ public class ScreenCollFormDTO implements Serializable { */ private String monthId; + /** + * yyyy + */ + private String yearId; + /** * 数据集合 */ 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 65e0afbf0d..66201d3efb 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 @@ -226,7 +226,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { /** * 目标:将网格的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,在插入网格相关分值表。 一对四 + * 如果网格相关分值表 中的网格数量不全,需要从 网格(党支部)信息表 中,先查询到缺少的网格信息,赋上默认值后,插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -235,6 +235,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){ @@ -244,25 +245,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 网格相关分值记录表 当前客户所属月份数据集 @@ -270,7 +303,7 @@ 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)); @@ -313,14 +346,19 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); + if (delFlag){ + int deleteNum; + do { + deleteNum = screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId,monthId); + } while (deleteNum != NumConstant.ZERO); + } screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } /** * 目标:将社区的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入社区相关分值表。 一对四 + * 如果社区相关分值表 中的社区数量不全,需要从 组织机构信息 中,先查询到缺少的社区信息,赋上默认值后,在插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -329,6 +367,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){ @@ -338,23 +377,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 * @@ -409,14 +473,13 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } /** * 目标:将区直部门的 党建能力、治理能力、服务能力、总指数 得分。 整理后(4条合1条) 插入 指数-指数数据(月表) - * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 区直部门分值表。 一对四 + * 如果 区直部门分值表 中的部门数量不全,需要从 部门信息表 中,先查询到缺少的部门信息,赋上默认值后,在插入 指数-指数数据(月表) * * @param monthId * @param customerId @@ -425,6 +488,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){ @@ -432,21 +496,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 * @@ -492,7 +583,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -508,23 +598,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); } @@ -577,7 +667,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { monthlyFormDTOList.add(monthlyFormDTO); } if (monthlyFormDTOList.size() > NumConstant.ZERO){ - screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, monthId); screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(monthlyFormDTOList, customerId); } } @@ -647,195 +736,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 * @@ -848,7 +748,10 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { private void insertIndexDataYear(String monthId, String customerId){ List monthlyFormList = screenIndexDataMonthlyDao.selectListIndexDataMonthlyByYear(customerId, getYearStr(monthId), getMonthStr(monthId)); if (monthlyFormList.size() > NumConstant.ZERO){ - screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); + int deleteNum; + do { + deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); + } while (deleteNum != NumConstant.ZERO); List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); } From df55e4a6cf22cff1a747b2bd2568d40d35f6fcaf Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 15:19:26 +0800 Subject: [PATCH 32/42] =?UTF-8?q?=E5=B0=86=E8=AE=A1=E7=AE=97=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E6=8A=BD=E5=8F=96=E5=88=B0=20=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IndexCalculateController.java | 18 ++- .../indexcal/IndexCalculateService.java | 5 +- .../impl/IndexCalculateServiceImpl.java | 125 ++++++++++-------- 3 files changed, 91 insertions(+), 57 deletions(-) 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/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/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; From 743df9757b07aa5f78e304c10e0d5abd95796f8f Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 15:31:22 +0800 Subject: [PATCH 33/42] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E4=B8=80=E6=9D=A1?= =?UTF-8?q?=E6=97=B6=E7=BB=9950=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/CpcIndexCalculateServiceImpl.java | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) 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 666736310c..0bc398ce91 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 @@ -162,22 +162,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 indexCode : groupIndexDetailsMap.keySet()) { - insertList.add(handleOneGridScene(formDTO, indexCode, list.get(0))); - } - if (CollectionUtils.isEmpty(insertList)) { - deleteAndInsertBatch(formDTO, insertList, null); - } - } else { - //遍历指标分组 计算分数 - for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { - String indexCode = entry.getKey(); - List details = entry.getValue(); - calculateScore(formDTO, details, list, minAndMaxMap, indexCode); - } + //遍历指标分组 计算分数 + for (Map.Entry> entry : groupIndexDetailsMap.entrySet()) { + String indexCode = entry.getKey(); + List details = entry.getValue(); + calculateScore(formDTO, details, list, minAndMaxMap, indexCode); } } pageNo++; From 9f73a61cfb1fe1d1263f2acae495819ffcf620bd Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 15:40:55 +0800 Subject: [PATCH 34/42] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=86=E6=95=B0?= =?UTF-8?q?=E5=AD=90=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcal/AgencySubScoreDao.java | 107 ++++++++++ .../indexcal/CommunitySubScoreDao.java | 105 ++++++++++ .../indexcal/CpcSubScoreDao.java | 86 ++++++++ .../indexcal/DeptSubScoreDao.java | 92 +++++++++ .../indexcal/GridSubScoreDao.java | 114 +++++++++++ .../indexcal/AgencySubScoreEntity.java | 90 +++++++++ .../indexcal/CpcSubScoreEntity.java | 90 +++++++++ .../indexcal/DeptSubScoreEntity.java | 90 +++++++++ .../indexcal/GridSubScoreEntity.java | 95 +++++++++ .../indexcal/AgencySubScoreDao.xml | 160 +++++++++++++++ .../indexcal/CommunitySubScoreDao.xml | 156 +++++++++++++++ .../indexcal/CpcSubScoreDao.xml | 144 ++++++++++++++ .../indexcal/DeptSubScoreDao.xml | 103 ++++++++++ .../indexcal/GridSubScoreDao.xml | 188 ++++++++++++++++++ 14 files changed, 1620 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencySubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/DeptSubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/CpcSubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/DeptSubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/DeptSubScoreDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml 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/indexcal/CommunitySubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java new file mode 100644 index 0000000000..9caf146b4d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CommunitySubScoreDao.java @@ -0,0 +1,105 @@ +/** + * 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.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/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..8865f93609 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcSubScoreDao.java @@ -0,0 +1,86 @@ +/** + * 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 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("indexCode") String indexCode); + + 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/GridSubScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java new file mode 100644 index 0000000000..e0cf724899 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/GridSubScoreDao.java @@ -0,0 +1,114 @@ +/** + * 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.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; + +import java.util.List; + +/** + * 网格相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-31 + */ +@Mapper +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); + + /** + * @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); + + /** + * 根据入参查询 网格相关分值记录 + * + * @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/entity/evaluationindex/indexcal/AgencySubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.java new file mode 100644 index 0000000000..a3e18f4b4f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/AgencySubScoreEntity.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_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/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/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/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/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/indexcal/CommunitySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml new file mode 100644 index 0000000000..48b171c119 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml @@ -0,0 +1,156 @@ + + + + + + + + INSERT INTO fact_index_community_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, SCORE, INDEX_CODE,ALL_PARENT_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.score}, + #{item.indexCode}, + #{item.allParentIndexCode}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + + + + DELETE + FROM + fact_index_community_score + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND month_id = #{monthId} + + + + + + + + + + + + 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/CpcSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml new file mode 100644 index 0000000000..8372a60608 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcSubScoreDao.xml @@ -0,0 +1,144 @@ + + + + + + + delete from fact_index_cpc_score + where + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + and MONTH_ID = #{monthId,jdbcType=VARCHAR} + + and INDEX_CODE = #{indexCode,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO `fact_index_cpc_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/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 From e89ef5bbce2abaef05dfd3a2fea6ecd68f450831 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Sep 2020 15:43:30 +0800 Subject: [PATCH 35/42] youhua --- .../indexcal/AgencyScoreDao.java | 3 +- .../IndexCalculateCommunityServiceImpl.java | 90 +++------------ .../IndexCalculateDistrictServiceImpl.java | 93 ++++++++-------- .../impl/IndexCalculateStreetServiceImpl.java | 105 ++++++++---------- .../indexcal/AgencyScoreDao.xml | 10 +- 5 files changed, 116 insertions(+), 185 deletions(-) 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/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 c034ce47e2..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 @@ -87,11 +87,7 @@ 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); @@ -118,11 +114,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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); - 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); @@ -146,7 +138,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); + deleteAndInsert(result); return true; } @@ -171,12 +163,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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 -> { @@ -197,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())); @@ -226,11 +209,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); -// HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); 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(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); + deleteAndInsert(result); return true; } @@ -253,11 +235,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni 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 -> { @@ -277,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())); @@ -306,11 +283,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); -// HashMap scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); 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(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); + deleteAndInsert(result); return true; } @@ -349,7 +325,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); result.add(score); }); - deleteAndInsert(customerId, monthId, IndexCalConstant.COMMUNITY_RELATE, result); + deleteAndInsert(result); return true; } @@ -396,16 +372,13 @@ 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.insertCommunityPartyRecord(subAllGridList); } @@ -421,28 +394,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni * @author zxc * @date 2020/9/2 2:37 下午 */ - public List getResult(HashMap scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode, Map pid) { - List result = new ArrayList<>(); - scoreCountOfSampleId.forEach((k, v) -> { - FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); - score.setCustomerId(customerId); - score.setAgencyId(k); - score.setMonthId(monthId); - score.setQuarterId(DateUtils.getQuarterId(monthId)); - score.setYearId(DateUtils.getYearId(monthId)); - score.setIsTotal(isTotal); - score.setIndexCode(indexCode); - score.setScore(v); - pid.forEach((agency, parentAgency) -> { - if (k.equals(agency)) { - score.setParentAgencyId(parentAgency); - } - }); - result.add(score); - }); - return result; - } - 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) -> { @@ -485,19 +436,4 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni }); return result; } - - /** - * @param agencyId - * @param customerId - * @param monthId - * @Description 当查询结果为一条时,调用此方法 - * @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 e8a50fabfe..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 @@ -24,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; @@ -121,7 +122,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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -136,11 +137,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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); - 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); @@ -152,16 +149,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict 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(), detail.getAllParentIndexCode(), 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; } @@ -186,7 +184,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(districtGovernAvgList)) { log.error("查询所有街道治理能力平均值集合为空"); return; - } else if (districtGovernAvgList.size() > NumConstant.ZERO) { + } 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 -> { @@ -197,7 +195,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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -206,18 +204,18 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(deptScoreAvgList)) { log.error("查询所有直属部门治理能力平均值集合为空"); return; - } else if (deptScoreAvgList.size() > NumConstant.ZERO) { + } 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 -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - pid.put(c.getParentId(),customerAgencyDao.selectPid(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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -226,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; } @@ -254,7 +252,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(subStreetAvgList)) { log.error("查询区下属街道服务能力汇总平均值集合为空"); return; - } else if (subStreetAvgList.size() > NumConstant.ZERO) { + } 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 -> { @@ -265,7 +263,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }); - IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -274,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; } @@ -309,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; } @@ -335,18 +334,14 @@ 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); } } @@ -361,7 +356,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict * @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(); @@ -372,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)) { 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; } - /** - * @param agencyId - * @param customerId - * @param monthId - * @Description 当查询结果为一条时,调用此方法 - * @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/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index 9cdd9fe536..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 @@ -12,7 +12,6 @@ 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.ScreenCustomerAgencyDao; import com.epmet.dto.indexcal.AgencyScoreDTO; import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; @@ -26,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; @@ -62,8 +62,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ private CommunityScoreDao communityScoreDao; @Autowired private AgencyScoreDao agencyScoreDao; - @Autowired - private ScreenCustomerAgencyDao customerAgencyDao; /** * @Description 计算街道相关总分 @@ -128,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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -143,11 +141,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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); - 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 -> { @@ -158,16 +152,17 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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(), detail.getAllParentIndexCode(), 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; } @@ -203,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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); indexInputVOS.add(index1VO); }); } @@ -213,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())); @@ -234,16 +225,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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(), detail.getAllParentIndexCode(), 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; } @@ -280,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(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); + IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); indexInputVOS.add(index1VO); }); } @@ -289,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,17 +297,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ 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(), detail.getAllParentIndexCode(), 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; } @@ -353,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; } @@ -379,18 +366,14 @@ 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); } } @@ -405,7 +388,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ * @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(); @@ -416,29 +399,37 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ score.setYearId(DateUtils.getYearId(monthId)); score.setIsTotal(isTotal); score.setIndexCode(indexCode); - score.setScore(v); + 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; } - - /** - * @param agencyId - * @param customerId - * @param monthId - * @Description 当查询结果为一条时,调用此方法 - * @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/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 61f3db1f65..b6dab6b1a5 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" - SELECT - USER_ID, + SELECT + verify.USER_ID, '积分兑换' AS TITLE, - concat( '兑换', EXCHANGED_ITEM ) AS REMARK, - concat( '-', POINT ) AS point, - DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) AS DATE, - DATE_FORMAT( CREATED_TIME, '%H:%i' ) AS TIME + concat( '兑换', verify.EXCHANGED_ITEM ) AS REMARK, + concat( '-', verify.POINT ) AS point, + DATE_FORMAT( verify.CREATED_TIME, '%Y-%m-%d' ) AS DATE, + DATE_FORMAT( verify.CREATED_TIME, '%H:%i' ) AS TIME FROM - POINT_VERIFICATION_LOG + POINT_VERIFICATION_LOG verify + LEFT JOIN + USER_POINT_ACTION_LOG action + ON verify.ACTION_ID = action.ID AND action.DEL_FLAG = '0' WHERE - DEL_FLAG = '0' - AND USER_ID = #{userId} + verify.DEL_FLAG = '0' + AND verify.USER_ID = #{userId} + AND action.CUSTOMER_ID = #{customerId} ORDER BY - CREATED_TIME DESC + verify.CREATED_TIME DESC 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} + + + select - CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_score + CUSTOMER_ID,AGENCY_ID,GRID_ID,YEAR_ID,MONTH_ID,USER_ID,SCORE,INDEX_CODE FROM fact_index_cpc_sub_score WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and MONTH_ID = #{monthId,jdbcType=VARCHAR} @@ -43,7 +42,7 @@ SELECT round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE FROM - fact_index_cpc_score m + fact_index_cpc_sub_score m WHERE m.DEL_FLAG = '0' AND m.CUSTOMER_ID =#{customerId} @@ -59,7 +58,7 @@ SELECT round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE FROM - fact_index_cpc_score m + fact_index_cpc_sub_score m WHERE m.DEL_FLAG = '0' AND m.CUSTOMER_ID =#{customerId} @@ -74,7 +73,7 @@ SELECT round(AVG( SCORE ),6) AS AVG_JOIN_ISSUE_SCORE FROM - fact_index_cpc_score m + fact_index_cpc_sub_score m WHERE m.DEL_FLAG = '0' AND m.CUSTOMER_ID =#{customerId} @@ -89,7 +88,7 @@ SELECT round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE FROM - fact_index_cpc_score m + fact_index_cpc_sub_score m WHERE m.DEL_FLAG = '0' AND m.CUSTOMER_ID =#{customerId} @@ -101,7 +100,7 @@ - INSERT INTO `fact_index_cpc_score` ( + INSERT INTO `fact_index_cpc_sub_score` ( `ID`, `CUSTOMER_ID`, `GRID_ID`, From c93af332c6a11e434f7b231b9a52e69e8cc479ef Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 9 Sep 2020 17:47:00 +0800 Subject: [PATCH 39/42] =?UTF-8?q?=E6=8C=87=E6=A0=87=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 4 ++-- .../mapper/evaluationindex/indexcal/CommunityScoreDao.xml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 b6dab6b1a5..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 @@ -81,9 +81,9 @@ AND MONTH_ID = #{monthId} AND data_type = #{dataType} AND IS_TOTAL = "0" - AND INDEX_CODE = "zhilinengli" + AND (INDEX_CODE = "zhilinengli" OR INDEX_CODE = "dangjiannengli" - OR INDEX_CODE = "fuwunengli" + OR INDEX_CODE = "fuwunengli") From 92c18e04a36ae8259913159a9864c4efc062d4f3 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 17:56:19 +0800 Subject: [PATCH 40/42] =?UTF-8?q?=E6=8C=87=E6=A0=87=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=87=87=E9=9B=86=E5=8F=AA=E5=86=99=E5=85=A5?= =?UTF-8?q?=E5=88=B0index=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../indexcoll/impl/FactIndexCollectServiceImpl.java | 13 ------------- 1 file changed, 13 deletions(-) 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 66201d3efb..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 @@ -3,7 +3,6 @@ package com.epmet.service.evaluationindex.indexcoll.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.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; @@ -20,9 +19,6 @@ 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; @@ -83,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) { @@ -99,7 +94,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridPartyAbility(GridPartyAbilityDataFormDTO formDTO, String customerId) { @@ -114,7 +108,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgPartyAbility(OrgPartyAbilityDataFormDTO formDTO, String customerId) { @@ -129,7 +122,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridServiceAbility(GridServiceAbilityDataFormDTO formDTO, String customerId) { @@ -144,7 +136,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgServiceAbility(OrgServiceAbilityDataFormDTO formDTO, String customerId) { @@ -159,7 +150,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertGridGovrnAbility(GridGovrnAbilityDataFormDTO formDTO, String customerId) { @@ -174,7 +164,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertOrgGovrnAbility(OrgGovrnAbilityDataFormDTO formDTO, String customerId) { @@ -189,7 +178,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertDeptGovrnAbility(DeptGovrnAbilityDataFormDTO formDTO, String customerId) { @@ -204,7 +192,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { } } - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) public void insertScreenIndexDataMonthlyAndYearly(String monthId, String customerId) { From 9624b05e7bfe49e0a2ebd25a0556314dac3df882 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 18:09:10 +0800 Subject: [PATCH 41/42] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{V0.0.4__add_anningejia.sql => V0.0.5__add_anningejia.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/{V0.0.4__add_anningejia.sql => V0.0.5__add_anningejia.sql} (100%) diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_anningejia.sql b/epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql similarity index 100% rename from epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.4__add_anningejia.sql rename to epmet-module/epmet-common-service/common-service-server/src/main/resources/db/migration/V0.0.5__add_anningejia.sql From b1a42ab250ed4b691a8ac985a4c263856ef7e778 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 9 Sep 2020 18:19:10 +0800 Subject: [PATCH 42/42] =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-admin/epmet-admin-server/src/main/resources/bootstrap.yml | 2 +- epmet-gateway/src/main/resources/bootstrap.yml | 2 +- .../data-report-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-activiti-server/src/main/resources/bootstrap.yml | 2 +- .../common-service-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-demo-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-ext/epmet-ext-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-message-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-oss/epmet-oss-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-third-server/src/main/resources/bootstrap.yml | 2 +- .../gov-access-server/src/main/resources/bootstrap.yml | 2 +- .../gov-grid/gov-grid-server/src/main/resources/bootstrap.yml | 2 +- .../gov-issue/gov-issue-server/src/main/resources/bootstrap.yml | 2 +- .../gov-mine/gov-mine-server/src/main/resources/bootstrap.yml | 2 +- .../gov-org/gov-org-server/src/main/resources/bootstrap.yml | 2 +- .../gov-project-server/src/main/resources/bootstrap.yml | 2 +- .../gov-voice/gov-voice-server/src/main/resources/bootstrap.yml | 2 +- .../oper-access-server/src/main/resources/bootstrap.yml | 2 +- .../oper-crm/oper-crm-server/src/main/resources/bootstrap.yml | 2 +- .../oper-customize-server/src/main/resources/bootstrap.yml | 2 +- .../resi-group-server/src/main/resources/bootstrap.yml | 2 +- .../resi-guide-server/src/main/resources/bootstrap.yml | 2 +- .../resi-hall/resi-hall-server/src/main/resources/bootstrap.yml | 2 +- .../resi-home/resi-home-server/src/main/resources/bootstrap.yml | 2 +- .../resi-mine/resi-mine-server/src/main/resources/bootstrap.yml | 2 +- .../resi-partymember-server/src/main/resources/bootstrap.yml | 2 +- .../resi-voice-server/src/main/resources/bootstrap.yml | 2 +- .../epmet-openapi-scan/src/main/resources/bootstrap.yml | 2 +- epmet-user/epmet-user-server/src/main/resources/bootstrap.yml | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) 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-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/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-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-third/epmet-third-server/src/main/resources/bootstrap.yml b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml index 4a3e82e619..fb128323d5 100644 --- a/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml +++ b/epmet-module/epmet-third/epmet-third-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-third-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/gov-access/gov-access-server/src/main/resources/bootstrap.yml b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml index 9aaa3e9556..e8a2685e37 100644 --- a/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-access/gov-access-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-access-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/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml index c56eefd656..6b8729cd4e 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-grid/gov-grid-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-grid-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml index 93f2568a4b..e523016b91 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-issue-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/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml index 372d057000..f19d228c96 100644 --- a/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-mine/gov-mine-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-mine-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/gov-org/gov-org-server/src/main/resources/bootstrap.yml b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml index 123fa48ad4..4657c30354 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-org-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml index ddd3113ac5..31d7d1ef6d 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-project-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/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml index 8504cb2d5a..8e85f694ed 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/gov-voice/gov-voice-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: gov-voice-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/oper-access/oper-access-server/src/main/resources/bootstrap.yml b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml index b57b255fe6..b7cbcbe1af 100644 --- a/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-access/oper-access-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: oper-access-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/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml index c434e9de81..422a4459a9 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: oper-crm-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/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml index f65f7d24eb..14755776eb 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: oper-customize-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/resi-group/resi-group-server/src/main/resources/bootstrap.yml b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml index dd17343ed3..6f73407d1a 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-group-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/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml index 1108340bce..ed94f661c3 100644 --- a/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-guide/resi-guide-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-guide-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/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml index 00e752f20a..58e251be5b 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-hall/resi-hall-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-hall-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml index 78690a6d9f..afb7ab3e38 100644 --- a/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-home/resi-home-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-home-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml index ad3ec82fe3..6e5eb54cc2 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-mine/resi-mine-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-mine-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/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml index 9a2b17a333..a2118ff3a3 100644 --- a/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-partymember-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/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml index e77e88368d..03891ed01a 100644 --- a/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml +++ b/epmet-module/resi-voice/resi-voice-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: resi-voice-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-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml index 6c9dba5543..84000daee9 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml +++ b/epmet-openapi/epmet-openapi-scan/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-openapi-scan #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common diff --git a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml index 00a9025891..4f732d5ac9 100644 --- a/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml +++ b/epmet-user/epmet-user-server/src/main/resources/bootstrap.yml @@ -10,7 +10,7 @@ spring: name: epmet-user-server #环境 dev|test|prod profiles: - active: dev + active: @spring.profiles.active@ messages: encoding: UTF-8 basename: i18n/messages_common