diff --git a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java index db9dc79da3..b4cfd11c27 100644 --- a/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java +++ b/epmet-commons/epmet-commons-extapp-auth/src/main/java/com/epmet/commons/extappauth/aspect/ExternalAppRequestAuthAspect.java @@ -35,7 +35,7 @@ public class ExternalAppRequestAuthAspect { private static Logger logger = LoggerFactory.getLogger(ExternalAppRequestAuthAspect.class); - public static final String ACCESS_TOKEN_HEADER_KEY = "access_token"; + public static final String ACCESS_TOKEN_HEADER_KEY = "AccessToken"; public static final String APP_ID_HEADER_KEY = "appId"; @Autowired @@ -64,7 +64,7 @@ public class ExternalAppRequestAuthAspect { form.setToken(token); Result result = commonServiceOpenFeignClient.externalAppAuth(form); if (result == null) { - throw new RenException("调用external鉴权服务,返回null"); + throw new RenException("调用服务进行外部应用认证,返回null"); } if (!result.success()) { throw new RenException(result.getInternalMsg()); diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 716dc7f885..e86296856e 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -99,7 +99,7 @@ public enum EpmetErrorCode { OPER_ADD_CUSTOMER_MANAGER_ERROR(8706, "新增客户管理员失败"), OPER_UPLOAD_FILE_OVER_SIZE(8707, "文件体积过大"), OPER_UPLOAD_FILE_TYPE_ERROR(8708, "文件类型错误"), - OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用鉴权失败"), + OPER_EXTERNAL_APP_AUTH_ERROR(8709, "外部应用认证失败"), // 党建声音 前端提示 88段 DRAFT_CONTENT_IS_NULL(8801, "至少需要添加一个段落"), diff --git a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java index 7aec3a7f6f..43fbf6d0cb 100644 --- a/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java +++ b/epmet-gateway/src/main/java/com/epmet/filter/CpAuthGatewayFilterFactory.java @@ -208,11 +208,19 @@ public class CpAuthGatewayFilterFactory extends AbstractGatewayFilterFactory urls; + /** + * 白名单 + */ + private List urlWhiteList; + /** * 不处理token,直接通过 */ diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index c2105542bb..0e8c054d2e 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -427,6 +427,12 @@ epmet: - /gov/issue/** - /gov/project/** - /resi/home/** + - /data/report/** + + # url认证白名单,先判断白名单,在白名单中的url直接放行,不再判断上述需要认证的名单 + urlWhiteList: + - /data/report/test/test + swaggerUrls: jwt: diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java new file mode 100644 index 0000000000..0c188f427e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/MonthPieChartFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 3:10 下午 + */ +@Data +public class MonthPieChartFormDTO implements Serializable { + + private static final long serialVersionUID = -3163410637094615814L; + + public interface MonthPieChart{} + + /** + * 机关ID + */ + @NotBlank(message = "机关ID不能为空",groups = {MonthPieChart.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java new file mode 100644 index 0000000000..80d526bd48 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/form/YearAverageIndexFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 2:40 下午 + */ +@Data +public class YearAverageIndexFormDTO implements Serializable { + + private static final long serialVersionUID = -2389432085360116229L; + + public interface YearAverageIndex{} + + /** + * 机关Id + */ + @NotBlank(message = "机关ID不能为空",groups = {YearAverageIndex.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java new file mode 100644 index 0000000000..248f69d5ce --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/MonthPieChartResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 3:12 下午 + */ +@Data +public class MonthPieChartResultDTO implements Serializable { + + private static final long serialVersionUID = 8399158251970739021L; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; + + /** + * 党建能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 治理能力 + */ + private Double governAbility = 0.0; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java new file mode 100644 index 0000000000..d05479d5d2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/screen/dto/result/YearAverageIndexResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/8/19 2:45 下午 + */ +@Data +public class YearAverageIndexResultDTO implements Serializable { + + private static final long serialVersionUID = 6453379153616899440L; + + /** + * 年度平均指数 + */ + private Double yearAverageIndex = 0.0; + + /** + * 服务能力 + */ + private Double serviceAbility = 0.0; + + /** + * 党建能力 + */ + private Double partyDevAbility = 0.0; + + /** + * 治理能力 + */ + private Double governAbility = 0.0; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java index 648d1e088b..b0b7c1f7a8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/DistributionController.java @@ -72,7 +72,7 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:29 下午 */ -// @ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("project") public Result> project(@RequestBody ProjectFormDTO projectFormDTO){ ValidatorUtils.validateEntity(projectFormDTO, ProjectFormDTO.Project.class); @@ -85,7 +85,7 @@ public class DistributionController { * @author zxc * @date 2020/8/19 1:52 下午 */ -// @ExternalAppRequestAuth + @ExternalAppRequestAuth @PostMapping("topprofile") public Result topProfile(@RequestBody TopProfileFormDTO topProfileFormDTO){ ValidatorUtils.validateEntity(topProfileFormDTO, TopProfileFormDTO.TopProfile.class); 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 d8417ddcdb..ce74b4b766 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 @@ -1,5 +1,16 @@ package com.epmet.datareport.controller.screen; +import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.datareport.service.screen.IndexService; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +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; @@ -12,4 +23,35 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("/screen/index") public class IndexController { + + @Autowired + private IndexService indexService; + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + @ExternalAppRequestAuth + @PostMapping("yearaverageindex") + public Result yearAverageIndex(@RequestBody YearAverageIndexFormDTO yearAverageIndexFormDTO){ + ValidatorUtils.validateEntity(yearAverageIndexFormDTO, YearAverageIndexFormDTO.YearAverageIndex.class); + return new Result().ok(indexService.yearAverageIndex(yearAverageIndexFormDTO)); + } + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + @ExternalAppRequestAuth + @PostMapping("monthindexanalysis/piechart") + public Result monthPieChart(@RequestBody MonthPieChartFormDTO monthPieChartFormDTO){ + ValidatorUtils.validateEntity(monthPieChartFormDTO, MonthPieChartFormDTO.MonthPieChart.class); + return new Result().ok(indexService.monthPieChart(monthPieChartFormDTO)); + } + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java similarity index 70% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java index 1f038fd5b3..f27f9f4fb8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataMonthlyDao.java @@ -17,7 +17,9 @@ package com.epmet.datareport.dao.screen; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 指数-指数数据 @@ -26,6 +28,14 @@ import org.apache.ibatis.annotations.Mapper; * @since v1.0.0 2020-08-18 */ @Mapper -public interface ScreenIndexDataDao{ +public interface ScreenIndexDataMonthlyDao{ + + /** + * @Description 2、月度指数分析-饼状图 + * @param agencyId + * @author zxc + * @date 2020/8/19 3:43 下午 + */ + MonthPieChartResultDTO selectMonthPieChart(@Param("agencyId")String agencyId); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..304351b3b7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/screen/ScreenIndexDataYearlyDao.java @@ -0,0 +1,41 @@ +/** + * 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.datareport.dao.screen; + +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 指数-指数数据(按年统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface ScreenIndexDataYearlyDao{ + + /** + * @Description 1、年度平均指数 + * @param agencyId + * @author zxc + * @date 2020/8/19 3:43 下午 + */ + YearAverageIndexResultDTO selectYearAverageIndex(@Param("agencyId")String agencyId); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java index 069534f7b8..4eba79bd88 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/IndexService.java @@ -1,5 +1,10 @@ package com.epmet.datareport.service.screen; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; + /** * 指数相关相关各指标查询 * @@ -7,4 +12,21 @@ package com.epmet.datareport.service.screen; * @date 2020/8/18 10:21 */ public interface IndexService { + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO); + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java index 042e9b2229..9db0ebca3c 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/screen/impl/IndexServiceImpl.java @@ -1,6 +1,13 @@ package com.epmet.datareport.service.screen.impl; +import com.epmet.datareport.dao.screen.ScreenIndexDataMonthlyDao; +import com.epmet.datareport.dao.screen.ScreenIndexDataYearlyDao; import com.epmet.datareport.service.screen.IndexService; +import com.epmet.screen.dto.form.MonthPieChartFormDTO; +import com.epmet.screen.dto.form.YearAverageIndexFormDTO; +import com.epmet.screen.dto.result.MonthPieChartResultDTO; +import com.epmet.screen.dto.result.YearAverageIndexResultDTO; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** @@ -11,4 +18,39 @@ import org.springframework.stereotype.Service; */ @Service public class IndexServiceImpl implements IndexService { + + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; + @Autowired + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; + + /** + * @Description 1、年度平均指数 + * @param yearAverageIndexFormDTO + * @author zxc + * @date 2020/8/19 2:53 下午 + */ + @Override + public YearAverageIndexResultDTO yearAverageIndex(YearAverageIndexFormDTO yearAverageIndexFormDTO) { + YearAverageIndexResultDTO yearAverageIndexResultDTO = screenIndexDataYearlyDao.selectYearAverageIndex(yearAverageIndexFormDTO.getAgencyId()); + if (null == yearAverageIndexResultDTO){ + return new YearAverageIndexResultDTO(); + } + return yearAverageIndexResultDTO; + } + + /** + * @Description 2、月度指数分析-饼状图 + * @param monthPieChartFormDTO + * @author zxc + * @date 2020/8/19 3:17 下午 + */ + @Override + public MonthPieChartResultDTO monthPieChart(MonthPieChartFormDTO monthPieChartFormDTO) { + MonthPieChartResultDTO monthPieChartResultDTO = screenIndexDataMonthlyDao.selectMonthPieChart(monthPieChartFormDTO.getAgencyId()); + if (null == monthPieChartFormDTO){ + return new MonthPieChartResultDTO(); + } + return monthPieChartResultDTO; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml deleted file mode 100644 index f5e693fd42..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file 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 new file mode 100644 index 0000000000..bee1716ec6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ 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 new file mode 100644 index 0000000000..3d9329846d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -0,0 +1,21 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java index 0efee2a896..3ff8c4446a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CpcBaseDataFormDTO.java @@ -14,11 +14,6 @@ public class CpcBaseDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织类别 agency:组织;部门:department;网格:grid */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java index 7baff54308..de5dc8abdd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerAgencyFormDTO.java @@ -14,11 +14,6 @@ public class CustomerAgencyFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织id */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java index 5566ea3ad7..19f5f3fecd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerDeptFormDTO.java @@ -14,11 +14,6 @@ public class CustomerDeptFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 部门id */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java index 13345ffaad..8935eaa156 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/CustomerGridFormDTO.java @@ -14,11 +14,6 @@ public class CustomerGridFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 网格id */ 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 3053fe955a..14ef258fb8 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 @@ -14,11 +14,6 @@ public class DifficultyDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织类别 agency:组织;部门:department;网格:grid */ @@ -88,4 +83,9 @@ public class DifficultyDataFormDTO implements Serializable { * 事件状态描述 */ private String eventStatusDesc; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java index 81800701c8..5be17787cf 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/EventDataFormDTO.java @@ -17,11 +17,6 @@ public class EventDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织类别 agency:组织;部门:department;网格:grid */ @@ -116,4 +111,9 @@ public class EventDataFormDTO implements Serializable { * 事件状态key */ private String eventStatusCode; + + /** + * 最近一次操作说明 eg: 转项目,结案,流转 + */ + private String latestOperateDesc; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java index 3976647f24..f12e196ab7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/GovernRankDataFormDTO.java @@ -15,11 +15,6 @@ public class GovernRankDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 年Id :yyyy */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java similarity index 86% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataFormDTO.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java index d6d3065992..9c9ca798a5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataMonthlyFormDTO.java @@ -5,20 +5,15 @@ import lombok.Data; import java.io.Serializable; /** - * 1、指数相关 入参 + * 1、指数_按月统计 入参 * @Auther: zhangyong * @Date: 2020-08-18 09:59 */ @Data -public class IndexDataFormDTO implements Serializable { +public class IndexDataMonthlyFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * yyyy */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java new file mode 100644 index 0000000000..bd360a63fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/IndexDataYearlyFormDTO.java @@ -0,0 +1,61 @@ +package com.epmet.dto.screencoll.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 17、指数_按年统计 入参 + * @Auther: zhangyong + * @Date: 2020-08-18 09:59 + */ +@Data +public class IndexDataYearlyFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyy + */ + private String yearId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private Integer indexTotal; + + /** + * 党建能力指数 + */ + private Integer partyDevAblity; + + /** + * 服务能力指数 + */ + private Integer serviceAblity; + + /** + * 治理能力指数 + */ + private Integer governAblity; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java index 37386fcc6b..8b0a753839 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/OrgRankDataFormDTO.java @@ -15,11 +15,6 @@ public class OrgRankDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 年Id :yyyy */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java index f05bd7bc80..21144c89ab 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyBranchDataFormDTO.java @@ -14,11 +14,6 @@ public class PartyBranchDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 年Id :yyyy */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java index bacca22874..8d1ae654a9 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PartyLinkMassesDataFormDTO.java @@ -14,11 +14,6 @@ public class PartyLinkMassesDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织类别 agency:组织;部门:department;网格:grid */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java index bde79f0baf..cdad61be67 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/PioneerDataFormDTO.java @@ -14,11 +14,6 @@ public class PioneerDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织类别 agency:组织;部门:department;网格:grid */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java index d474115972..48802ff6d1 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserJoinFormDTO.java @@ -14,11 +14,6 @@ public class UserJoinFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织类别 agency:组织;部门:department;网格:grid */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java index 3cf171e6f7..42722f7111 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/UserTotalDataFormDTO.java @@ -14,11 +14,6 @@ public class UserTotalDataFormDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * 客户id - */ - private String customerId; - /** * 组织类别 agency:组织;部门:department;网格:grid */ 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 ad4e2110fa..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 @@ -3,8 +3,12 @@ package com.epmet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; import org.springframework.scheduling.annotation.EnableAsync; +@EnableDiscoveryClient +@EnableFeignClients @SpringBootApplication (exclude = {DataSourceAutoConfiguration.class}) @EnableAsync public class DataStatsApplication { 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 bb0e64b694..080ba5384b 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 @@ -1,7 +1,5 @@ package com.epmet.controller; -import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; -import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.extappauth.annotation.ExternalAppRequestAuth; import com.epmet.commons.extappauth.bean.ExternalAppRequestParam; import com.epmet.commons.tools.utils.Result; @@ -31,6 +29,7 @@ public class ScreenCollController { /** * 9、党建引领|基层治理-居民(党员)积分排行榜 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong @@ -39,191 +38,249 @@ public class ScreenCollController { @ExternalAppRequestAuth @PostMapping("partyuserrankdata") public Result partyUserRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { - screenCollService.insertPartyUserRankData(formDTO,externalAppRequestParam.getCustomerId()); + screenCollService.insertPartyUserRankData(formDTO, externalAppRequestParam.getCustomerId()); return new Result(); } /** * 8、党建引领-党员联系群众数据 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("partylinkmassesdata") - public Result partyLinkMassesData(@RequestBody List formDTO) { - return screenCollService.insertPartyLinkMassesData(formDTO); + public Result partyLinkMassesData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyLinkMassesData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 7、基层党建-建设情况数据(支部、联建、志愿) * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("meetdata") - public Result meetData(@RequestBody List formDTO) { - return screenCollService.insertPartyBranchData(formDTO); + public Result meetData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPartyBranchData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 6、党建引领-组织排行 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("orgrankdata") - public Result orgRankData(@RequestBody List formDTO) { - return screenCollService.insertOrgRankData(formDTO); + public Result orgRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertOrgRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 5、基层治理-治理能力数据 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("governrankdata") - public Result governRankData(@RequestBody List formDTO) { - return screenCollService.insertGovernRankData(formDTO); + public Result governRankData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertGovernRankData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 4、事件数据 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("eventdata") - public Result eventData(@RequestBody List formDTO) { - return screenCollService.insertEventData(formDTO); + public Result eventData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertEventData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 3、难点赌点 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("difficultydata") - public Result difficultyData(@RequestBody List formDTO) { - return screenCollService.insertDifficultyData(formDTO); + public Result difficultyData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertDifficultyData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 2、党员基本情况 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("cpcbasedata") - public Result cpcbaseData(@RequestBody List formDTO) { - return screenCollService.insertCpcbaseData(formDTO); + public Result cpcbaseData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCpcbaseData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** - * 1、指数相关 + * 1、指数_按月统计 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - @PostMapping("indexdata") - public Result indexData(@RequestBody List formDTO) { - return screenCollService.insertIndexData(formDTO); + @ExternalAppRequestAuth + @PostMapping("indexdatamonthly") + public Result indexDataMonthly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertIndexDataMonthly(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } // -- + /** + * 17、指数_按年统计 + * + * @param externalAppRequestParam + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + @ExternalAppRequestAuth + @PostMapping("indexdatayearly") + public Result indexDataYearly(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertIndexDataYearly(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); + } + /** * 16、部门信息上传 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("customerdept") - public Result customerDept(@RequestBody List formDTO) { - return screenCollService.insertCustomerDept(formDTO); + public Result customerDept(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerDept(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 15、网格信息上传 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("customergrid") - public Result customerGrid(@RequestBody List formDTO) { - return screenCollService.insertCustomerGrid(formDTO); + public Result customerGrid(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerGrid(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 14、组织层级 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("customeragency") - public Result customerAgency(@RequestBody List formDTO) { - return screenCollService.insertCustomerAgency(formDTO); + public Result customerAgency(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertCustomerAgency(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 12、中央区各类总数 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("usertotaldata") - public Result userTotalData(@RequestBody List formDTO) { - return screenCollService.insertUserTotalData(formDTO); + public Result userTotalData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertUserTotalData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 11、基层治理-公众参与 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("userjoin") - public Result userJoin(@RequestBody List formDTO) { - return screenCollService.insertUserJoin(formDTO); + public Result userJoin(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertUserJoin(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } /** * 10、党建引领-先锋模范数据 * + * @param externalAppRequestParam * @param formDTO * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ + @ExternalAppRequestAuth @PostMapping("pioneerdata") - public Result pioneerData(@RequestBody List formDTO) { - return screenCollService.insertPioneerData(formDTO); + public Result pioneerData(ExternalAppRequestParam externalAppRequestParam, @RequestBody List formDTO) { + screenCollService.insertPioneerData(formDTO, externalAppRequestParam.getCustomerId()); + return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java index fa30fdef44..12271b8e3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCpcBaseDataDao.java @@ -51,8 +51,9 @@ public interface ScreenCpcBaseDataDao extends BaseDao { * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertCpcBaseData(@Param("list") List list); + void batchInsertCpcBaseData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java index 240c48e041..d7851cd754 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerAgencyDao.java @@ -51,8 +51,9 @@ public interface ScreenCustomerAgencyDao extends BaseDao list); + void batchInsertCustomerAgency(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java index 84e641b47b..53f37049a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerDeptDao.java @@ -51,8 +51,9 @@ public interface ScreenCustomerDeptDao extends BaseDao * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertCustomerDept(@Param("list") List list); + void batchInsertCustomerDept(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java index cfc0c7092c..3925d0ad6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenCustomerGridDao.java @@ -50,8 +50,9 @@ public interface ScreenCustomerGridDao extends BaseDao * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertCustomerGrid(@Param("list") List list); + void batchInsertCustomerGrid(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java index 503f070506..5379eeb893 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenDifficultyDataDao.java @@ -36,23 +36,25 @@ public interface ScreenDifficultyDataDao extends BaseDao list); + void batchInsertDifficultyData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java index 20250bc7ff..ec80809c55 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenEventDataDao.java @@ -36,23 +36,25 @@ public interface ScreenEventDataDao extends BaseDao { /** * 4、事件数据 * 1) 根据CUSTOMER_ID、EVENT_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 - * CUSTOMER_ID 一 - * EVENT_ID 多 - * ORG_ID 多 * - * @param list + * @param customerId 一 + * @param eventId 多 + * @param orgId 多 * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteEventData(EventDataFormDTO list); + void deleteEventData(@Param("customerId")String customerId, + @Param("eventId")String eventId, + @Param("orgId")String orgId); /** * 4、事件数据 * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertEventData(@Param("list") List list); + void batchInsertEventData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java index 295538b085..ea3d67aa68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenGovernRankDataDao.java @@ -54,8 +54,9 @@ public interface ScreenGovernRankDataDao extends BaseDao list); + void batchInsertGovernRankData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java similarity index 79% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java index 53a413b048..e97406febf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataMonthlyDao.java @@ -18,8 +18,8 @@ package com.epmet.dao.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screencoll.form.IndexDataFormDTO; -import com.epmet.entity.screen.ScreenIndexDataEntity; +import com.epmet.dto.screencoll.form.IndexDataMonthlyFormDTO; +import com.epmet.entity.screen.ScreenIndexDataMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -32,7 +32,7 @@ import java.util.List; * @since v1.0.0 2020-08-18 */ @Mapper -public interface ScreenIndexDataDao extends BaseDao { +public interface ScreenIndexDataMonthlyDao extends BaseDao { /** *1、指数相关 @@ -45,7 +45,7 @@ public interface ScreenIndexDataDao extends BaseDao { * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void deleteIndexData(@Param("customerId") String customerId, + void deleteIndexDataMonthly(@Param("customerId") String customerId, @Param("yearId") String yearId, @Param("monthId") String monthId, @Param("orgIds") String[] orgIds); @@ -55,8 +55,9 @@ public interface ScreenIndexDataDao extends BaseDao { * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertIndexData(@Param("list") List list); + void batchInsertIndexDataMonthly(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java new file mode 100644 index 0000000000..4ca64f6944 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenIndexDataYearlyDao.java @@ -0,0 +1,61 @@ +/** + * 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.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screencoll.form.IndexDataYearlyFormDTO; +import com.epmet.entity.screen.ScreenIndexDataYearlyEntity; +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-19 + */ +@Mapper +public interface ScreenIndexDataYearlyDao extends BaseDao { + + /** + * 17、指数_按年统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * + * @param customerId + * @param yearId + * @param orgIds 组织Id集合 + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void deleteIndexDataYearly(@Param("customerId") String customerId, + @Param("yearId") String yearId, + @Param("orgIds") String[] orgIds); + + /** + * 17、指数_按年统计 + * 2) 在批量新增 + * + * @param list + * @param customerId + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void batchInsertIndexDataYearly(@Param("list") List list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java index 110d37c618..4eabfd508a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenOrgRankDataDao.java @@ -54,8 +54,9 @@ public interface ScreenOrgRankDataDao extends BaseDao { * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertOrgRankData(@Param("list") List list); + void batchInsertOrgRankData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java index 00b9f0df8d..3cae4a160d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyBranchDataDao.java @@ -54,8 +54,9 @@ public interface ScreenPartyBranchDataDao extends BaseDao list); + void batchInsertPartyBranchData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java index d100742ec8..276b08e356 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPartyLinkMassesDataDao.java @@ -51,8 +51,9 @@ public interface ScreenPartyLinkMassesDataDao extends BaseDao list); + void batchInsertPartyLinkMassesData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java index ba6bfa532a..202fc4aa59 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenPioneerDataDao.java @@ -51,8 +51,9 @@ public interface ScreenPioneerDataDao extends BaseDao { * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertPioneerData(@Param("list") List list); + void batchInsertPioneerData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java index 0b6f09f58c..46d19682ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserJoinDao.java @@ -55,8 +55,9 @@ public interface ScreenUserJoinDao extends BaseDao { * 2) 在批量新增 * * @param list + * @param customerId * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void batchInsertUserJoin(@Param("list") List list); + void batchInsertUserJoin(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java index ef7543555a..ec449f1352 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/screen/ScreenUserTotalDataDao.java @@ -51,8 +51,9 @@ public interface ScreenUserTotalDataDao extends BaseDao list); + void batchInsertUserTotalData(@Param("list") List list, @Param("customerId")String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java index 76af0410c0..3a49498dca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenDifficultyDataEntity.java @@ -113,4 +113,8 @@ public class ScreenDifficultyDataEntity extends BaseEpmetEntity { */ private String eventStatusDesc; + /** + * 最近一次操作说明 + */ + private String latestOperateDesc; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java index 9e605802f3..a007794682 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenEventDataEntity.java @@ -133,4 +133,9 @@ public class ScreenEventDataEntity extends BaseEpmetEntity { * 事件状态描述 */ private String eventStatusDesc; + + /** + * 最近一次操作说明 + */ + private String latestOperateDesc; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java similarity index 94% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java index ed9ac7fb97..f0f3ef1fed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataMonthlyEntity.java @@ -34,8 +34,8 @@ import java.util.Date; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("screen_index_data") -public class ScreenIndexDataEntity extends BaseEpmetEntity { +@TableName("screen_index_data_monthly") +public class ScreenIndexDataMonthlyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.java new file mode 100644 index 0000000000..8f8063c0db --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/screen/ScreenIndexDataYearlyEntity.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.entity.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 指数-指数数据(按年统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_index_data_yearly") +public class ScreenIndexDataYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id: yyyy + */ + private String yearId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 总指数 + */ + private BigDecimal indexTotal; + + /** + * 党建能力指数 + */ + private BigDecimal partyDevAblity; + + /** + * 服务能力指数 + */ + private BigDecimal serviceAblity; + + /** + * 治理能力指数 + */ + private BigDecimal governAblity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java index dcb9268db3..8ee702178d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/ScreenCollService.java @@ -4,7 +4,12 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.screencoll.form.*; import java.util.List; - +/** + * 大屏数据采集api + * + * @author yinzuomei@elink-cn.com + * @date 2020/8/18 10:25 + */ public interface ScreenCollService { /** @@ -13,11 +18,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - void insertPartyUserRankData(List formDTO,String customerId); + void insertPartyUserRankData(List formDTO, String customerId); /** * 8、党建引领-党员联系群众数据 @@ -25,11 +31,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertPartyLinkMassesData(List formDTO); + void insertPartyLinkMassesData(List formDTO, String customerId); /** * 7、基层党建-建设情况数据(支部、联建、志愿) @@ -37,11 +44,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertPartyBranchData(List formDTO); + void insertPartyBranchData(List formDTO, String customerId); /** * 6、党建引领-组织排行 @@ -49,11 +57,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertOrgRankData(List formDTO); + void insertOrgRankData(List formDTO, String customerId); /** * 5、基层治理-治理能力数据 @@ -61,11 +70,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertGovernRankData(List formDTO); + void insertGovernRankData(List formDTO, String customerId); /** * 4、事件数据 @@ -73,11 +83,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertEventData(List formDTO); + void insertEventData(List formDTO, String customerId); /** * 3、难点赌点 @@ -85,11 +96,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertDifficultyData(List formDTO); + void insertDifficultyData(List formDTO, String customerId); /** * 2、党员基本情况 @@ -97,23 +109,38 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertCpcbaseData(List formDTO); + void insertCpcbaseData(List formDTO, String customerId); /** - * 1、指数相关 + * 1、指数_按月统计 * 1) 根据CUSTOMER_ID、YEAR_ID、MONTH_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 * 2) 在新增 * * @param formDTO + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 10:52 2020-08-18 + **/ + void insertIndexDataMonthly(List formDTO, String customerId); + + /** + * 17、指数_按年统计 + * 1) 根据CUSTOMER_ID、YEAR_ID、ORG_ID进行查询,如果有数据,则先进行物理删除 + * 2) 在新增 + * + * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertIndexData(List formDTO); + void insertIndexDataYearly(List formDTO, String customerId); /** * 16、部门信息上传 @@ -121,11 +148,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertCustomerDept(List formDTO); + void insertCustomerDept(List formDTO, String customerId); /** * 15、网格信息上传 @@ -133,11 +161,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertCustomerGrid(List formDTO); + void insertCustomerGrid(List formDTO, String customerId); /** * 14、组织层级 @@ -145,11 +174,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertCustomerAgency(List formDTO); + void insertCustomerAgency(List formDTO, String customerId); /** * 12、中央区各类总数 @@ -157,11 +187,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertUserTotalData(List formDTO); + void insertUserTotalData(List formDTO, String customerId); /** * 11、基层治理-公众参与 @@ -169,11 +200,12 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertUserJoin(List formDTO); + void insertUserJoin(List formDTO, String customerId); /** * 10、党建引领-先锋模范数据 @@ -181,9 +213,10 @@ public interface ScreenCollService { * 2) 在新增 * * @param formDTO + * @param customerId * @return com.epmet.commons.tools.utils.Result * @Author zhangyong * @Date 10:52 2020-08-18 **/ - Result insertPioneerData(List formDTO); + void insertPioneerData(List formDTO, String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java index 14787a6762..899ebac605 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/screen/impl/ScreenCollServiceImpl.java @@ -57,7 +57,7 @@ public class ScreenCollServiceImpl implements ScreenCollService { @Autowired private ScreenCpcBaseDataDao screenCpcBaseDataDao; @Autowired - private ScreenIndexDataDao screenIndexDataDao; + private ScreenIndexDataMonthlyDao screenIndexDataMonthlyDao; @Autowired private ScreenCustomerDeptDao screenCustomerDeptDao; @Autowired @@ -70,7 +70,8 @@ public class ScreenCollServiceImpl implements ScreenCollService { private ScreenUserJoinDao screenUserJoinDao; @Autowired private ScreenPioneerDataDao screenPioneerDataDao; - + @Autowired + private ScreenIndexDataYearlyDao screenIndexDataYearlyDao; @Override @Transactional(rollbackFor = Exception.class) public void insertPartyUserRankData(List formDTO,String customerId) { @@ -90,81 +91,78 @@ public class ScreenCollServiceImpl implements ScreenCollService { @Override @Transactional(rollbackFor = Exception.class) - public Result insertPartyLinkMassesData(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), orgIds); + screenPartyLinkMassesDataDao.deletePartyLinkMassesData(customerId, orgIds); - screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO); + screenPartyLinkMassesDataDao.batchInsertPartyLinkMassesData(formDTO, customerId); } - return new Result(); } @Override - public Result insertPartyBranchData(List formDTO) { + @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(formDTO.get(NumConstant.ZERO).getCustomerId(), + screenPartyBranchDataDao.deletePartyBranchData(customerId, formDTO.get(NumConstant.ZERO).getYearId(), formDTO.get(NumConstant.ZERO).getMonthId(), orgIds); - screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO); + screenPartyBranchDataDao.batchInsertPartyBranchData(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertOrgRankData(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), + screenOrgRankDataDao.deleteOrgRankData(customerId, formDTO.get(NumConstant.ZERO).getYearId(), formDTO.get(NumConstant.ZERO).getMonthId(), orgIds); - screenOrgRankDataDao.batchInsertOrgRankData(formDTO); + screenOrgRankDataDao.batchInsertOrgRankData(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertGovernRankData(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), + screenGovernRankDataDao.deleteGovernRankData(customerId, formDTO.get(NumConstant.ZERO).getYearId(), formDTO.get(NumConstant.ZERO).getMonthId(), orgIds); - screenGovernRankDataDao.batchInsertGovernRankData(formDTO); + screenGovernRankDataDao.batchInsertGovernRankData(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertEventData(List formDTO) { + 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(formDTO.get(i)); + screenEventDataDao.deleteEventData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); } - screenEventDataDao.batchInsertEventData(formDTO); + screenEventDataDao.batchInsertEventData(formDTO, customerId); for (int i = NumConstant.ZERO; i < formDTO.size(); i++) { if (null != formDTO.get(i).getImgDataList() && formDTO.get(i).getImgDataList().size() > NumConstant.ZERO) { @@ -181,147 +179,151 @@ public class ScreenCollServiceImpl implements ScreenCollService { } } } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertDifficultyData(List formDTO) { + public void insertDifficultyData(List formDTO, String customerId) { if (null != formDTO && formDTO.size() > NumConstant.ZERO){ for (int i = NumConstant.ZERO; i < formDTO.size(); i++){ - screenDifficultyDataDao.deleteDifficultyData(formDTO.get(i)); + screenDifficultyDataDao.deleteDifficultyData(customerId, formDTO.get(i).getEventId(), formDTO.get(i).getOrgId()); } - screenDifficultyDataDao.batchInsertDifficultyData(formDTO); + screenDifficultyDataDao.batchInsertDifficultyData(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertCpcbaseData(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), orgIds); + screenCpcBaseDataDao.deleteCpcBaseData(customerId, orgIds); - screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO); + screenCpcBaseDataDao.batchInsertCpcBaseData(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertIndexData(List formDTO) { + 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(); } - screenIndexDataDao.deleteIndexData(formDTO.get(NumConstant.ZERO).getCustomerId(), + screenIndexDataMonthlyDao.deleteIndexDataMonthly(customerId, formDTO.get(NumConstant.ZERO).getYearId(), formDTO.get(NumConstant.ZERO).getMonthId(), orgIds); - screenIndexDataDao.batchInsertIndexData(formDTO); + screenIndexDataMonthlyDao.batchInsertIndexDataMonthly(formDTO, customerId); + } + } + + @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); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertCustomerDept(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), deptIds); + screenCustomerDeptDao.deleteCustomerDept(customerId, deptIds); - screenCustomerDeptDao.batchInsertCustomerDept(formDTO); + screenCustomerDeptDao.batchInsertCustomerDept(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertCustomerGrid(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), gridIds); + screenCustomerGridDao.deleteCustomerGrid(customerId, gridIds); - screenCustomerGridDao.batchInsertCustomerGrid(formDTO); + screenCustomerGridDao.batchInsertCustomerGrid(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertCustomerAgency(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), agencyIds); + screenCustomerAgencyDao.deleteCustomerAgency(customerId, agencyIds); - screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO); + screenCustomerAgencyDao.batchInsertCustomerAgency(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertUserTotalData(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), - orgIds); + screenUserTotalDataDao.deleteUserTotalData(customerId, orgIds); - screenUserTotalDataDao.batchInsertUserTotalData(formDTO); + screenUserTotalDataDao.batchInsertUserTotalData(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertUserJoin(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), + screenUserJoinDao.deleteUserJoin(customerId, formDTO.get(NumConstant.ZERO).getYearId(), formDTO.get(NumConstant.ZERO).getMonthId(), orgIds); - screenUserJoinDao.batchInsertUserJoin(formDTO); + screenUserJoinDao.batchInsertUserJoin(formDTO, customerId); } - return new Result(); } @Override @Transactional(rollbackFor = Exception.class) - public Result insertPioneerData(List formDTO) { + 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(formDTO.get(NumConstant.ZERO).getCustomerId(), - orgIds); + screenPioneerDataDao.deletePioneerData(customerId, orgIds); - screenPioneerDataDao.batchInsertPioneerData(formDTO); + screenPioneerDataDao.batchInsertPioneerData(formDTO, customerId); } - return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml index de6f379dc4..a0adcc3b70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCpcBaseDataDao.xml @@ -12,7 +12,7 @@ - + insert into screen_cpc_base_data ( ID, @@ -40,7 +40,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.orgType}, #{item.orgId}, #{item.parentId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index c01c3dcc95..923a8410f0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -12,7 +12,7 @@ - + insert into screen_customer_agency ( ID, @@ -37,7 +37,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.agencyId}, #{item.agencyName}, #{item.pid}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml index 267a118cd8..627b3b39c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerDeptDao.xml @@ -12,7 +12,7 @@ - + insert into screen_customer_dept ( ID, @@ -33,7 +33,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.deptId}, #{item.deptName}, #{item.parentAgencyId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml index 5c96ed4ae8..7a36507ce7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenCustomerGridDao.xml @@ -12,7 +12,7 @@ - + insert into screen_customer_grid ( ID, @@ -33,7 +33,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.gridId}, #{item.gridName}, #{item.parentAgencyId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml index 5ec18b6c7b..11451dc3ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenDifficultyDataDao.xml @@ -8,7 +8,7 @@ where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} - + insert into screen_difficulty_data ( ID, @@ -32,12 +32,13 @@ CREATED_BY, CREATED_TIME, UPDATED_BY, - UPDATED_TIME + UPDATED_TIME, + LATEST_OPERATE_DESC ) values ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.orgType}, #{item.orgId}, #{item.parentId}, @@ -57,7 +58,8 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.latestOperateDesc} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml index a6cdd87a2e..1df8e0a068 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenEventDataDao.xml @@ -8,7 +8,7 @@ where CUSTOMER_ID = #{customerId} AND EVENT_ID = #{eventId} AND ORG_ID = #{orgId} - + insert into screen_event_data ( ID, @@ -36,12 +36,13 @@ UPDATED_BY, UPDATED_TIME, EVENT_STATUS_CODE, - EVENT_STATUS_DESC + EVENT_STATUS_DESC, + LATEST_OPERATE_DESC ) values ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.orgType}, #{item.orgId}, #{item.parentId}, @@ -65,7 +66,8 @@ 'APP_USER', now(), #{item.eventStatusCode}, - #{item.eventStatusDesc} + #{item.eventStatusDesc}, + #{item.latestOperateDesc} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml index 48d98970ce..9a6e6c3c44 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenGovernRankDataDao.xml @@ -12,7 +12,7 @@ - + insert into screen_govern_rank_data ( ID, @@ -39,7 +39,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.yearId}, #{item.monthId}, #{item.orgType}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml similarity index 82% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 045bf7926e..721c4e0af3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -1,10 +1,10 @@ - + - - delete from screen_index_data + + delete from screen_index_data_monthly where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} AND MONTH_ID = #{monthId} AND ORG_ID IN @@ -12,8 +12,8 @@ - - insert into screen_index_data + + insert into screen_index_data_monthly ( ID, CUSTOMER_ID, @@ -37,7 +37,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.yearId}, #{item.monthId}, #{item.orgType}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml new file mode 100644 index 0000000000..8747e1219a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -0,0 +1,60 @@ + + + + + + + delete from screen_index_data_yearly + where CUSTOMER_ID = #{customerId} AND YEAR_ID = #{yearId} + AND ORG_ID IN + + #{item} + + + + + insert into screen_index_data_yearly + ( + ID, + CUSTOMER_ID, + YEAR_ID, + ORG_TYPE, + ORG_ID, + PARENT_ID, + ORG_NAME, + INDEX_TOTAL, + PARTY_DEV_ABLITY, + SERVICE_ABLITY, + GOVERN_ABLITY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + #{item.yearId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + + #{item.indexTotal}, + #{item.partyDevAblity}, + #{item.serviceAblity}, + #{item.governAblity}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml index be2ff1fb67..4ebe5e2c28 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenOrgRankDataDao.xml @@ -12,7 +12,7 @@ - + insert into screen_org_rank_data ( ID, @@ -40,7 +40,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.yearId}, #{item.monthId}, #{item.orgType}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml index 05c5d92066..afeaca9651 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyBranchDataDao.xml @@ -12,7 +12,7 @@ - + insert into screen_party_branch_data ( ID, @@ -39,7 +39,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.yearId}, #{item.monthId}, #{item.type}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml index b5f7770bfd..01a63f3a53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPartyLinkMassesDataDao.xml @@ -12,7 +12,7 @@ - + insert into screen_party_link_masses_data ( ID, @@ -33,7 +33,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.orgType}, #{item.orgId}, #{item.parentId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml index c31c51fe78..73e703ae25 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenPioneerDataDao.xml @@ -12,7 +12,7 @@ - + insert into screen_pioneer_data ( ID, @@ -36,7 +36,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.orgType}, #{item.orgId}, #{item.parentId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index b09c3e6690..db7b626e27 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -12,7 +12,7 @@ - + insert into screen_user_join ( ID, @@ -36,7 +36,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.yearId}, #{item.monthId}, #{item.orgType}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml index 51257d5837..a582bedbb7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/screen/ScreenUserTotalDataDao.xml @@ -12,7 +12,7 @@ - + insert into screen_user_total_data ( ID, @@ -37,7 +37,7 @@ ( (SELECT REPLACE(UUID(), '-', '') AS id), - #{item.customerId}, + #{customerId}, #{item.orgType}, #{item.orgId}, #{item.parentId}, diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalCustomerFormDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalCustomerFormDTO.java new file mode 100644 index 0000000000..da8c394aea --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/form/ExternalCustomerFormDTO.java @@ -0,0 +1,15 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.Min; + +@Data +public class ExternalCustomerFormDTO { + + @Min(0) + private Integer pageNo; + + @Min(0) + private Integer pageSize; +} diff --git a/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java new file mode 100644 index 0000000000..79e58686fe --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-client/src/main/java/com/epmet/dto/result/ExternalCustomerResultDTO.java @@ -0,0 +1,46 @@ +/** + * 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.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +public class ExternalCustomerResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String id; + + /** + * 客户名称 + */ + private String customerName; + +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java index 98fa8e9fc9..1e627e5de8 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalAppController.java @@ -23,6 +23,11 @@ public class ExternalAppController { @Autowired private ExternalAppAuthService externalAppAuthService; + /** + * 外部请求认证 + * @param formDTO + * @return + */ @PostMapping("/auth") public Result auth(@RequestBody ExternalAppAuthFormDTO formDTO) { String appId = formDTO.getAppId(); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java new file mode 100644 index 0000000000..e5ae0ae464 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/controller/ExternalCustomerController.java @@ -0,0 +1,47 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.ExternalAppAuthFormDTO; +import com.epmet.dto.form.ExternalCustomerFormDTO; +import com.epmet.dto.result.ExternalAppAuthResultDTO; +import com.epmet.service.ExternalAppAuthService; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +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.validation.constraints.Min; + +/** + * 外部客户管理 + */ +@RestController +@RequestMapping("/externalcustomer") +public class ExternalCustomerController { + + private static Logger logger = LoggerFactory.getLogger(ExternalCustomerController.class); + + @Autowired + private ExternalAppAuthService externalAppAuthService; + + /** + * 外部客户管理 + * @return + */ + @PostMapping("/list") + public Result list(@RequestBody ExternalCustomerFormDTO form) { + ValidatorUtils.validateEntity(form); + Integer pageNo = form.getPageNo(); + Integer pageSize = form.getPageSize(); + + + return null; + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalCustomerDao.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalCustomerDao.java new file mode 100644 index 0000000000..b22be4caf9 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/dao/ExternalCustomerDao.java @@ -0,0 +1,41 @@ +/** + * 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; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.ExternalCustomerResultDTO; +import com.epmet.entity.ExternalCustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Mapper +public interface ExternalCustomerDao extends BaseDao { + + /** + * 列出客户基本信息 + * @return + */ + List listBaseInfo(); +} \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalCustomerEntity.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalCustomerEntity.java new file mode 100644 index 0000000000..fccfbbb6a1 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/entity/ExternalCustomerEntity.java @@ -0,0 +1,46 @@ +/** + * 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; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-08-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("external_customer") +public class ExternalCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java new file mode 100644 index 0000000000..bcc8d10cc6 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/ExternalCustomerService.java @@ -0,0 +1,11 @@ +package com.epmet.service; + +import com.epmet.dto.result.ExternalCustomerResultDTO; + +import java.util.List; + +public interface ExternalCustomerService { + + public List list(Integer pageNo, Integer pageSize); + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java index 52b82011c9..822e654cbb 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalAppAuthServiceImpl.java @@ -29,6 +29,8 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { @Autowired private ExternalAppSecretDao externalAppSecretDao; + private int diffMillins = 1000 * 60 * 5; + @Override public ExternalAppAuthResultDTO auth(String appId, String token) { String secret; @@ -47,6 +49,19 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { String appIdIn = (String)claim.get("appId"); String customerId = (String)claim.get("customerId"); + Long timestamp = (Long)claim.get("ts"); + + //校验时间戳,允许5分钟误差 + if (StringUtils.isAnyBlank(appIdIn, customerId) || timestamp == null) { + logger.error("access token不完整。{},{},{}", appIdIn, customerId, timestamp); + return fillAuthResult(false, "access token不完整。", null); + } + + // TODO +// if (!validTimeStamp(timestamp)) { +// logger.error("服务器存在时差过大,请求被拒绝", appId, appIdIn); +// return fillAuthResult(false, "服务器存在时差过大,请求被拒绝", null); +// } if (!appId.equals(appIdIn)) { logger.error("AppId不对应,token外部的:{}, token内部解析出来的:{}", appId, appIdIn); @@ -55,6 +70,15 @@ public class ExternalAppAuthServiceImpl implements ExternalAppAuthService { return fillAuthResult(true, "解析成功", customerId); } + private boolean validTimeStamp(Long timestamp) { + long now = System.currentTimeMillis(); +// System.out.println(new Date(timestamp)); + if (Math.abs(now - timestamp) > diffMillins) { + return false; + } + return true; + } + /** * 通过APP ID查询对应的秘钥 * @param appId diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java new file mode 100644 index 0000000000..9925841b0f --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/service/impl/ExternalCustomerServiceImpl.java @@ -0,0 +1,26 @@ +package com.epmet.service.impl; + +import com.epmet.dao.ExternalCustomerDao; +import com.epmet.dto.result.ExternalCustomerResultDTO; +import com.epmet.service.ExternalCustomerService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Service +public class ExternalCustomerServiceImpl implements ExternalCustomerService { + + @Autowired + private ExternalCustomerDao externalCustomerDao; + + @Override + public List list(Integer pageNo, Integer pageSize) { + PageHelper.startPage(pageNo, pageSize); + List customers = externalCustomerDao.listBaseInfo(); + PageInfo pageInfo = new PageInfo<>(customers); + return null; + } +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 8ef9a4cde4..a1639646a2 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -75,8 +75,9 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); - claim.put("appId", "1"); -// claim.put("customerId", "c1"); + claim.put("appId", "dbfad3110c124c89948d16e8b06a8888"); + claim.put("customerId", "c1"); + claim.put("ts", System.currentTimeMillis() - 1000 * 60 * 4); String abc = new ExtAppJwtTokenUtils().createToken(claim, "4a762660254c57996343f8ee42fbc0a6"); System.out.println(abc); diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml new file mode 100644 index 0000000000..9d59a01224 --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/resources/mapper/ExternalCustomerDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file