diff --git a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java index 00770d82bb..144e18d024 100644 --- a/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java +++ b/epmet-auth/src/main/java/com/epmet/controller/ThirdLoginController.java @@ -104,4 +104,16 @@ public class ThirdLoginController { return new Result().ok(""); } + /** + * @param formDTO + * @author sun + * @description 单客户-工作端微信小程序登录-发送验证码 + **/ + @PostMapping(value = "sendsmscode") + public Result sendSmsCode(@RequestBody ThirdSendSmsCodeFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO,ThirdSendSmsCodeFormDTO.AddUserShowGroup.class); + thirdLoginService.sendSmsCode(formDTO); + return new Result(); + } + } diff --git a/epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java new file mode 100644 index 0000000000..d2588a27bb --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/dto/form/ThirdSendSmsCodeFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 单客户-工作端微信小程序登录-发送验证码 + * @Author sun + */ +@Data +public class ThirdSendSmsCodeFormDTO implements Serializable { + private static final long serialVersionUID = -1852541457359282018L; + /** + * 小程序appId + */ + @NotBlank(message = "appId不能为空", groups = {AddUserShowGroup.class}) + private String appId; + /** + * 手机号 + */ + @NotBlank(message = "手机号不能为空", groups = {AddUserShowGroup.class}) + private String mobile; + public interface AddUserShowGroup extends CustomerClientShowGroup {} +} diff --git a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java index 3d9c60cc64..c79a67d41c 100644 --- a/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java +++ b/epmet-auth/src/main/java/com/epmet/service/ThirdLoginService.java @@ -1,9 +1,6 @@ package com.epmet.service; -import com.epmet.dto.form.GetResiWxPhoneFormDTO; -import com.epmet.dto.form.LoginFormDTO; -import com.epmet.dto.form.ThirdStaffOrgsFormDTO; -import com.epmet.dto.form.ThirdWxmpEnteOrgFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.StaffOrgsResultDTO; import com.epmet.dto.result.UserTokenResultDTO; @@ -62,4 +59,11 @@ public interface ThirdLoginService { * @description 单客户-获取微信用户手机号 **/ String getResiWxPhone(GetResiWxPhoneFormDTO formDTO); + + /** + * @param formDTO + * @author sun + * @description 单客户-工作端微信小程序登录-发送验证码 + **/ + void sendSmsCode(ThirdSendSmsCodeFormDTO formDTO); } diff --git a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java index c9a6addb29..8dd958fe36 100644 --- a/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java +++ b/epmet-auth/src/main/java/com/epmet/service/impl/ThirdLoginServiceImpl.java @@ -14,10 +14,13 @@ import com.epmet.commons.tools.security.dto.GovTokenDto; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.security.password.PasswordUtils; import com.epmet.commons.tools.utils.*; +import com.epmet.commons.tools.validator.PhoneValidatorUtils; import com.epmet.constant.AuthHttpUrlConstant; +import com.epmet.constant.SmsTemplateConstant; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.jwt.JwtTokenProperties; @@ -56,6 +59,8 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @Autowired private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private EpmetMessageOpenFeignClient epmetMessageOpenFeignClient; /** * @param formDTO @@ -589,4 +594,45 @@ public class ThirdLoginServiceImpl implements ThirdLoginService { return phone; } + /** + * @param formDTO + * @author sun + * @description 单客户-工作端微信小程序登录-发送验证码 + **/ + @Override + public void sendSmsCode(ThirdSendSmsCodeFormDTO formDTO) { + String str = "发送短信验证码异常,手机号[%s],code[%s],msg[%s]"; + //1.校验手机号是否符合规范 + if (!PhoneValidatorUtils.isMobile(formDTO.getMobile())) { + logger.warn(String.format(str, formDTO.getMobile(), EpmetErrorCode.ERROR_PHONE.getCode(), EpmetErrorCode.ERROR_PHONE.getMsg())); + throw new RenException(EpmetErrorCode.ERROR_PHONE.getCode()); + } + //2.根据手机号校验用户是否存在 + //2-1.根据appId查询对应客户Id + PaCustomerDTO customer = this.getCustomerInfo(formDTO.getAppId()); + //2-2.根据手机号查询到用户信息 + ThirdCustomerStaffFormDTO dto = new ThirdCustomerStaffFormDTO(); + dto.setCustomerId(customer.getId()); + dto.setMobile(formDTO.getMobile()); + Result> customerStaffResult = epmetUserOpenFeignClient.getCustsomerStaffByIdAndPhone(dto); + if (!customerStaffResult.success()) { + logger.warn(String.format(str, formDTO.getMobile(), customerStaffResult.getCode(), customerStaffResult.getMsg())); + throw new RenException(customerStaffResult.getCode()); + } + //3.发送短信验证码 + SendVerificationCodeFormDTO sendVerificationCodeFormDTO = new SendVerificationCodeFormDTO(); + sendVerificationCodeFormDTO.setMobile(formDTO.getMobile()); + sendVerificationCodeFormDTO.setAliyunTemplateCode(SmsTemplateConstant.LGOIN_CONFIRM); + Result smsCodeResult = epmetMessageOpenFeignClient.sendVerificationCode(sendVerificationCodeFormDTO); + if (!smsCodeResult.success()) { + logger.warn(String.format(str, formDTO.getMobile(), smsCodeResult.getCode(), smsCodeResult.getMsg())); + throw new RenException(smsCodeResult.getCode()); + } + //4.保存短信验证码(删除现有短信验证码 将新的短信验证码存入Redis) + SendSmsCodeFormDTO sendSmsCodeFormDTO = new SendSmsCodeFormDTO(); + sendSmsCodeFormDTO.setMobile(formDTO.getMobile()); + captchaRedis.saveSmsCode(sendSmsCodeFormDTO, smsCodeResult.getData().getCode()); + logger.info(String.format("发送短信验证码成功,手机号[%s]", formDTO.getMobile())); + } + } diff --git a/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java b/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java index 143c4bda3a..caad8b0869 100644 --- a/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java +++ b/epmet-cloud-generator/src/main/java/io/renren/GeneratorApplication.java @@ -8,5 +8,6 @@ public class GeneratorApplication { public static void main(String[] args) { SpringApplication.run(GeneratorApplication.class, args); + System.out.println("http://localhost:8070/epmet-cloud-generator/#generator.html"); } } diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index 5a36af7c15..76cfc7865d 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_third?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_data_statistical?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java index 3636e2942d..9ff138efe7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/Constant.java @@ -8,6 +8,7 @@ package com.epmet.commons.tools.constant; + /** * 常量 * @@ -133,4 +134,6 @@ public interface Constant { * 创建时间字段名 */ String CREATED_TIME = "created_time"; + + String DEFAULT_CUSTOMER = "default"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index 8cdcc9c0a2..2010b316d3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -48,6 +48,10 @@ public interface NumConstant { int MAX = 99999999; int EIGHTY_EIGHT = 88; int EIGHTY = 80; + int NINETY = 90; + int ONE_HUNDRED_AND_EIGHTY = 180; + int THREE_HUNDRED_AND_SIXTY_FIVE = 365; + int SEVENTY_FIVE = 75; double ZERO_DOT_ZERO = 0.0; diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java new file mode 100644 index 0000000000..3462ad772b --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/OrgLevelEnum.java @@ -0,0 +1,51 @@ +package com.epmet.commons.tools.enums; + +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; + +/** + * 组织级别枚举类 + * dev|test|prod + * + * @author jianjun liu + * @date 2020-07-03 11:14 + **/ +public enum OrgLevelEnum { + /** + * 组织等级枚举 + */ + GRID("grid"), + COMMUNITY("community"), + STREET("street"), + DISTRICT("district"), + CITY("city"), + PROVINCE("province"), + ; + + private String code; + + + + + OrgLevelEnum(String code) { + this.code = code; + + } + + public static OrgLevelEnum getEnum(String code) { + OrgLevelEnum[] values = OrgLevelEnum.values(); + for (OrgLevelEnum value : values) { + if (value.getCode().equals(code)) { + return value; + } + } + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode()); + } + + + + + public String getCode() { + return code; + } +} 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 b7b70c5159..a38c4cbb0e 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 @@ -150,6 +150,7 @@ public enum EpmetErrorCode { TOPIC_ALREADY_SHIFTED_TO_ISSUE(9005,"该话题已被转为议题,请勿重复操作"), TOPIC_IS_HIDDEN(9006,"该话题已被屏蔽,请先解除屏蔽"), TOPIC_IS_CLOSED(9008,"该话题已关闭,无法转为议题"), + TOPIC_SHIFT_ISSUE(9008,"该话题已转议题,不允许关闭或屏蔽"), CUSTOMER_CATEGORY(9101,"分类已使用,不允许删除"), CATEGORY_NAME(9102,"分类名称已存在,不允许重复"), diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 1886bd8300..a2f88e4133 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -17,6 +17,7 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.ZoneId; @@ -781,4 +782,40 @@ public class DateUtils { Date nowDate = c.getTime(); return com.epmet.commons.tools.utils.DateUtils.format(nowDate, com.epmet.commons.tools.utils.DateUtils.DATE_PATTERN_YYYYMM); } + + /** + * @Author sun + * @Description 获取当前日期的前一天日期(yyyy-mm-dd) + **/ + public static Date yesterDay() { + Date date = new Date(); + try { + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, -24); + String str = sdf.format(calendar.getTime()); + date = sdf.parse(str); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } + + /** + * 格式化日期 + * @param dateStr String 字符型日期 + * @param format String 格式 + * @return Date 日期 + */ + public static Date parseDate(String dateStr, String format) { + Date date = null; + try { + DateFormat dateFormat = new SimpleDateFormat(format); + date = dateFormat.parse(dateStr); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java index 07604c401d..ce186bfffc 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/DataSourceConstant.java @@ -26,4 +26,8 @@ public interface DataSourceConstant { String EPMET_COMMON_SERVICE="commonservice"; String OPER_CRM="opercrm"; + + String DATA_STATISTICAL="datastatistical"; + + String EVALUATION_INDEX = "evaluationIndex"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java index 987c2a2697..a7da3d564b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/constant/OrgConstant.java @@ -5,4 +5,6 @@ package com.epmet.dataaggre.constant; * @DateTime 2020/12/25 上午10:55 */ public interface OrgConstant { + String AGENCY = "agency"; + String GRID = "grid"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/FactGroupActDailyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/FactGroupActDailyDTO.java new file mode 100644 index 0000000000..a4f834fbb2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/FactGroupActDailyDTO.java @@ -0,0 +1,96 @@ +/** + * 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.dataaggre.dto.datastats; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +public class FactGroupActDailyDTO implements Serializable { + + private static final long serialVersionUID = 4411632223804355342L; + /** + * 客户ID + */ + private String customerId; + + /** + * 数据更新至日期Id:yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String orgId; + + /** + * 网格:grid;组织:agency + */ + private String orgType; + + /** + * 1)orgType=grid: pid=网格所属组织id; +2)orgType=agency: pid=当前组织的上级组织 + */ + private String pid; + + /** + * 1)orgType=grid: pids=网格所有上级组织,包括pid; +2)orgType=agency: pids=当前组织的所有上级组织,包括pid. + */ + private String pids; + + /** + * 活动分类编码 + */ + private String categoryCode; + + /** + * 上级分类编码 + */ + private String parentCode; + + /** + * 分类等级 + */ + private Integer level; + + /** + * 截止到dateId: 组织次数;包含dateId这一天的数据 + */ + private Integer organizeTotal; + + /** + * 截止到dateId: 参加人数;包含dateId这一天的数据 + */ + private Integer participateUserTotal; + + /** + * 截止到dateId: 平均参加人数;包含dateId这一天的数据 + */ + private Integer avgParticipateUserTotal; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java new file mode 100644 index 0000000000..9f8c5fd1b1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织各种数据汇总-接口入参 + * @Auth sun + */ +@Data +public class AgenctBasicDataFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = AgenctBasicDataFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + public interface Agency extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java new file mode 100644 index 0000000000..82315c125f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgencyGovrnFormDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 治理实况-当前组织治理指数-接口入参 + * @Auth sun + */ +@Data +public class AgencyGovrnFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = AgencyGovrnFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + /** + * 排序类型字段 + * 问题解决总数:problem + * 党群自治占比:party + * 网格自治占比:grid + * 社区解决占比:community + * 区直部门解决占比:department + * 街道解决占比:street + */ + private String type; + public interface Agency extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java new file mode 100644 index 0000000000..7e5407a8ef --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GovrnRatioFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 治理实况-组织/网格下响应解决满意自治率-接口入参 + * @Auth sun + */ +@Data +public class GovrnRatioFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织或网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) + private String orgId; + /** + * 组织:agency 网格:grid + */ + @NotBlank(message = "网格Id不能为空", groups = GovrnRatioFormDTO.AgencyGrid.class) + private String orgType; + /** + * 日维度Id[日期,不传值默认查前一天的【格式:20210101】] + */ + private String dateId; + public interface AgencyGrid extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java new file mode 100644 index 0000000000..eb1b981134 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridBasicDataFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-网格各种数据汇总-接口入参 + * @Auth sun + */ +@Data +public class GridBasicDataFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 网格Id + */ + @NotBlank(message = "网格ID不能为空",groups = GridBasicDataFormDTO.Grid.class) + private String gridId; + /** + * 日维度Id + */ + private String dateId; + public interface Grid extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java new file mode 100644 index 0000000000..aaa2828173 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/GridGovrnFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 治理实况-当前网格治理指数-接口入参 + * @Auth sun + */ +@Data +public class GridGovrnFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "机关Id不能为空",groups = GridGovrnFormDTO.Agency.class) + private String agencyId; + /** + * 网格Id + */ + @NotBlank(message = "网格Id不能为空",groups = GridGovrnFormDTO.Grid.class) + private String gridId; + /** + * 日维度Id + */ + private String dateId; + /** + * 排序类型字段 + * 问题解决总数:problem + * 党群自治占比:party + * 网格自治占比:grid + * 社区解决占比:community + * 区直部门解决占比:department + * 街道解决占比:street + */ + private String type; + public interface Agency extends CustomerClientShowGroup {} + public interface Grid extends CustomerClientShowGroup {} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java new file mode 100644 index 0000000000..2b70bbeaa0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/PartyMemberVanguardFormDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:25 + */ +@Data +public class PartyMemberVanguardFormDTO implements Serializable { + private static final long serialVersionUID = -4331281350678714877L; + private String agencyId; + private String orgId; + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java new file mode 100644 index 0000000000..4789d534dd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织直属下级数据汇总-接口入参 + * @Auth sun + */ +@Data +public class SubAgencyFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = SubAgencyFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + /** + * 排序类型字段 + * 用户【用户:user 党员:party 居民:resi】 + * 党群【党群:group 楼院小组:ordinary 支部小组:branch】 + * 话题【话题:topic 热议中:discussing 已处理:closed 已转议题:shiftIssue】 + * 议题【议题:issue 表决中:voting 已转项目:shiftProject 已处理:closed】 + * 项目【项目:project 处理中:pending 已结案:closed】 + */ + private String type; + public interface Agency extends CustomerClientShowGroup{} + + @Data + public static class Topic implements Serializable { + //组织Id + private String agencyId; + //话题总量 + private Integer topicTotal; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java new file mode 100644 index 0000000000..51e790560c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubGridFormDTO.java @@ -0,0 +1,51 @@ +package com.epmet.dataaggre.dto.datastats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Description 基础数据-组织直属网格数据汇总-接口入参 + * @Auth sun + */ +@Data +public class SubGridFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = SubGridFormDTO.Agency.class) + private String agencyId; + /** + * 日维度Id + */ + private String dateId; + /** + * 排序类型字段 + * 用户【用户:user 党员:party 居民:resi】 + * 党群【党群:group 楼院小组:ordinary 支部小组:branch】 + * 话题【话题:topic 热议中:discussing 已处理:closed 已转议题:shiftIssue】 + * 议题【议题:issue 表决中:voting 已转项目:shiftProject 已处理:closed】 + * 项目【项目:project 处理中:pending 已结案:closed】 + */ + private String type; + public interface Agency extends CustomerClientShowGroup{} + + @Data + public static class Topic implements Serializable { + //网格Id + private String gridId; + //话题总量 + private Integer topicTotal; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java new file mode 100644 index 0000000000..d2202643c8 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyBasicDataResultDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-组织各种数据汇总-接口返参 + * @Auth sun + */ +@Data +public class AgencyBasicDataResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + /** + * 组织Id + */ + private String agencyId; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + + + @Data + public static class Topic implements Serializable { + //话题总量 + private Integer topicTotal; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + //数据更新至 时间 + private String deadline; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java new file mode 100644 index 0000000000..bb5448e7da --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/AgencyGovrnResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 治理实况-当前组织治理指数-接口返参 + * @Auth sun + */ +@Data +public class AgencyGovrnResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName = ""; + //agency_id所属的机关级别(社区级:community,乡(镇、街道)级:street, 区县级: district, 市级: city, 省级:province) + private String level = ""; + //问题解决总数 + private Integer problemResolvedCount = 0; + //党群自治占比 + private String groupSelfGovernRatio = "0%"; + //网格自治占比 + private String gridSelfGovernRatio = "0%"; + //社区解决占比 + private String communityResolvedRatio = "0%"; + //区直部门解决占比 + private String districtDeptResolvedRatio = "0%"; + //街道解决占比 + private String streetResolvedRatio = "0%"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java new file mode 100644 index 0000000000..75a6f5ee1b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GovrnRatioResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 治理实况-组织/网格下响应解决满意自治率-接口返参 + * @Auth sun + */ +@Data +public class GovrnRatioResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + //组织或网格Id + private String orgId; + //组织:agency 网格:grid + private String orgType; + //响应率 + private String responseRatio = "0%"; + //解决率 + private String resolvedRatio = "0%"; + //自治率 + private String governRatio = "0%"; + //满意率 + private String satisfactionRatio = "0%"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java new file mode 100644 index 0000000000..1ee5dc9b8a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridBasicDataResultDTO.java @@ -0,0 +1,96 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-网格各种数据汇总-接口返参 + * @Auth sun + */ +@Data +public class GridBasicDataResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + /** + * 网格Id + */ + private String gridId; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + + + @Data + public static class Topic implements Serializable { + //话题总量 + private Integer topicTotal; + //话题数量 + private Integer topicCount; + //话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + private String topicStatus; + //话题已转议题数量 + private Integer shiftedIssueTotal; + //数据更新至 时间 + private String deadline; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java new file mode 100644 index 0000000000..a7c71f1b69 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/GridGovrnResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 治理实况-当前网格治理指数-接口返参 + * @Auth sun + */ +@Data +public class GridGovrnResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName = ""; + //问题解决总数 + private Integer problemResolvedCount = 0; + //党群自治占比 + private String groupSelfGovernRatio = "0%"; + //网格自治占比 + private String gridSelfGovernRatio = "0%"; + //社区解决占比 + private String communityResolvedRatio = "0%"; + //区直部门解决占比 + private String districtDeptResolvedRatio = "0%"; + //街道解决占比 + private String streetResolvedRatio = "0%"; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java new file mode 100644 index 0000000000..39e833c4b1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardDetailResultDTO.java @@ -0,0 +1,78 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:27 + */ +@NoArgsConstructor +@Data +public class PartyMemberVanguardDetailResultDTO implements Serializable { + private static final long serialVersionUID = 8315392246739995430L; + /** + * 组织ID + */ + private String orgId; + /** + * 组织名 + */ + private String orgName; + /** + * 组织类型 机关 agency 网格 grid + */ + private String orgType; + /** + * 党员建组数 + */ + private Integer groupCount = 0; + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + /** + * 组内党员人数 + */ + private Integer groupMemberCount = 0; + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + /** + * 党员发布话题数 + */ + private Integer topicCount = 0; + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + /** + * 党员发布话题转议题数 + */ + private Integer issueCount = 0; + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + /** + * 党员发布话题转项目数 + */ + private Integer projectCount = 0; + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount = 0; + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java new file mode 100644 index 0000000000..57640eea9a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/PartyMemberVanguardRankResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:30 + */ +@Data +public class PartyMemberVanguardRankResultDTO implements Serializable { + private static final long serialVersionUID = -3103242333633668412L; + /** + * + * 组织级别 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city,省级:province + */ + private String agencyLevel; + private List agencyRank; + private List gridRank; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java new file mode 100644 index 0000000000..144368c26e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织群组数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyGroupResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java new file mode 100644 index 0000000000..5bece9dab4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织议题数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyIssueResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java new file mode 100644 index 0000000000..33aa889ad4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织项目数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyProjectResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java new file mode 100644 index 0000000000..bad0896389 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织话题数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyTopicResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java new file mode 100644 index 0000000000..a60c3ad76b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织的直属下级组织用户数据-接口返参 + * @Auth sun + */ +@Data +public class SubAgencyUserResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //组织Id + private String agencyId; + //组织名称 + private String agencyName; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java new file mode 100644 index 0000000000..eff29276d7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridGroupResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表群组数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridGroupResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //党群小组总数 + private Integer groupTotal = 0; + //楼院小组总数 + private Integer ordinaryTotal = 0; + //楼院小组总数占比 + private BigDecimal ordinaryRatio = bi; + //支部小组总数 + private Integer branchTotal = 0; + //支部小组总数占比 + private BigDecimal branchRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java new file mode 100644 index 0000000000..e6131de173 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridIssueResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表议题数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridIssueResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //议题总数 + private Integer issueTotal = 0; + //表决中总数 + private Integer votingTotal = 0; + //表决中总数占比 + private BigDecimal votingRatio = bi; + //已处理总数 + private Integer closedIssueTotal = 0; + //已处理总数占比 + private BigDecimal closedIssueRatio = bi; + //已转项目总数 + private Integer shiftProjectTotal = 0; + //已转项目总数占比 + private BigDecimal shiftProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java new file mode 100644 index 0000000000..d548cbe0a0 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridProjectResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表项目数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridProjectResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //项目总数 + private Integer projectTotal = 0; + //处理中总数 + private Integer pendingTotal = 0; + //处理中总数占比 + private BigDecimal pendingRatio = bi; + //已结案总数 + private Integer closedProjectTotal = 0; + //已结案总数占比 + private BigDecimal closedProjectRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java new file mode 100644 index 0000000000..88d4850f13 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridTopicResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表话题数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridTopicResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //话题总数 + private Integer topicTotal = 0; + //热议中总数 + private Integer discussingTotal = 0; + //热议中总数占比 + private BigDecimal discussingRatio = bi; + //已处理总数 + private Integer closedTopicTotal = 0; + //已处理总数占比 + private BigDecimal closedTopicRatio = bi; + //转议题总数 + private Integer shiftIssueTotal = 0; + //转议题总数占比 + private BigDecimal shiftIssueRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java new file mode 100644 index 0000000000..243ae23961 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubGridUserResultDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @Description 基础数据-查询当前组织下直属网格列表用户数据-接口返参 + * @Auth sun + */ +@Data +public class SubGridUserResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + @JsonIgnore + BigDecimal bi = new BigDecimal(0); + //网格Id + private String gridId; + //网格名称 + private String gridName; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + //党员总数占比 + private BigDecimal partyMemberRatio = bi; + //居民总数 + private Integer resiTotal = 0; + //居民总数占比 + private BigDecimal resiRatio = bi; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ActCategoryDictDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ActCategoryDictDTO.java new file mode 100644 index 0000000000..3cee85b0bd --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/ActCategoryDictDTO.java @@ -0,0 +1,76 @@ +/** + * 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.dataaggre.dto.resigroup; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + + +/** + * 活动类别字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-04-16 + */ +@Data +public class ActCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + @JsonIgnore + private String id; + + /** + * 客户id + */ + @JsonIgnore + private String customerId; + + /** + * 类别编码 + */ + private String categoryCode; + + /** + * 活动类别名称;eg:支部建设、联建共建 + */ + private String categoryName; + + /** + * 等级1,2...... + */ + @JsonIgnore + private Integer level; + + /** + * 排序 + */ + @JsonIgnore + private Integer sort; + + /** + * 上级类别编码 + */ + @JsonIgnore + private String parentCode; +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/BranchConAnalysisFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/BranchConAnalysisFormDTO.java new file mode 100644 index 0000000000..7090008a4f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/BranchConAnalysisFormDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 001、【支建+联建】统计分析 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 9:16 + */ +@Data +public class BranchConAnalysisFormDTO implements Serializable { + public interface AddUserInternalGroup { + } + + /** + * 支部建设:100;联建共建:101 + */ + @NotBlank(message = "firstCategoryCode必传,支部建设:100;联建共建:101", groups = AddUserInternalGroup.class) + private String firstCategoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 当前组织或者网格id + */ + @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class) + private String orgId; + + /** + * 默认传组织:agency; 网格:grid + */ + @NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class) + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActCategoryQueryFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActCategoryQueryFormDTO.java new file mode 100644 index 0000000000..63bb6b1771 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActCategoryQueryFormDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 002、【支建+联建】二级分类字典查询 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 13:42 + */ +@Data +public class GroupActCategoryQueryFormDTO implements Serializable { + private static final long serialVersionUID = 8373780230315448396L; + + public interface AddUserInternalGroup { + } + + /** + * 支部建设:100;联建共建:101 + */ + @NotBlank(message = "firstCategoryCode必传,支部建设:100;联建共建:101", groups = AddUserInternalGroup.class) + private String firstCategoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String customerId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java new file mode 100644 index 0000000000..58a029661b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/GroupActRankFormDTO.java @@ -0,0 +1,48 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 005、【支建+联建】下级组织排行列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 17:30 + */ +@Data +public class GroupActRankFormDTO implements Serializable { + private static final long serialVersionUID = 2293552582281839132L; + public interface AddUserInternalGroup { + } + + /** + * 支部建设:100;联建共建:101 + */ + @NotBlank(message = "firstCategoryCode必传,支部建设:100;联建共建:101", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String firstCategoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String customerId; + + /** + * 当前组织或者网格id + */ + @NotBlank(message = "orgId不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String orgId; + + /** + * 默认传组织:agency; 网格:grid + */ + @NotBlank(message = "orgType不能为空", groups = BranchConAnalysisFormDTO.AddUserInternalGroup.class) + private String orgType; + + /** + * 排序编码;可以不传,前端自己处理。 + */ + private String rankCode; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/SubAnalysisByCodeFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/SubAnalysisByCodeFormDTO.java new file mode 100644 index 0000000000..5f92ede5cb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/form/SubAnalysisByCodeFormDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dataaggre.dto.resigroup.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 003、【支建+联建】下级组织折线图 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 13:52 + */ +@Data +public class SubAnalysisByCodeFormDTO implements Serializable { + private static final long serialVersionUID = -4132250208377993452L; + + public interface AddUserInternalGroup { + } + + /** + * 分类编码;002接口返回的 + */ + @NotBlank(message = "categoryCode不能为空", groups = AddUserInternalGroup.class) + private String categoryCode; + + /** + * 当前客户id + */ + @NotBlank(message = "客户id不能为空", groups = AddUserInternalGroup.class) + private String customerId; + + /** + * 当前组织或者网格id + */ + @NotBlank(message = "orgId不能为空", groups = AddUserInternalGroup.class) + private String orgId; + + /** + * 默认传组织:agency; 网格:grid + */ + @NotBlank(message = "orgType不能为空", groups = AddUserInternalGroup.class) + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisDetailDTO.java new file mode 100644 index 0000000000..da57f1f74f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisDetailDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 001、【支建+联建】统计分析 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 15:12 + */ +@Data +public class BranchConAnalysisDetailDTO implements Serializable { + private String name; + private String type; + private Integer value; + private Integer avg; + private String categoryCode; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisResultDTO.java new file mode 100644 index 0000000000..7b25d8d8fc --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/BranchConAnalysisResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 001、【支建+联建】统计分析 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 10:01 + */ +@Data +public class BranchConAnalysisResultDTO implements Serializable { + private static final long serialVersionUID = -4998343002705222898L; + + /** + * 组织活动次数 + */ + private Integer organizeTotal; + + /** + * 参加活动人数 + */ + private Integer participateUserTotal; + + private List dataList; + + public BranchConAnalysisResultDTO() { + this.organizeTotal = NumConstant.ZERO; + this.participateUserTotal = NumConstant.ZERO; + this.dataList=new ArrayList<>(); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java new file mode 100644 index 0000000000..60be83657e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankDetailDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 005、【支建+联建】下级组织排行列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/19 9:31 + */ +@Data +public class GroupActRankDetailDTO implements Serializable { + private static final long serialVersionUID = 7738751412518098478L; + + private String categoryCode; + private String categoryName; + private Integer organizeTotal; + private Integer participateUserTotal; + private String organizeName; + private String participateUserName; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java new file mode 100644 index 0000000000..bb27ea7436 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/GroupActRankResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 005、【支建+联建】下级组织排行列表 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 17:33 + */ +@Data +public class GroupActRankResultDTO implements Serializable { + private String orgId; + private String orgType; + private String orgName; + private Integer organizeTotal; + private String organizeName; + private Integer participateUserTotal; + private String participateUserName; + private List categoryList; + + // @JsonIgnore + private Integer sortValue; + + public GroupActRankResultDTO() { + this.orgId = ""; + this.orgType = ""; + this.orgName = ""; + this.organizeTotal = NumConstant.ZERO; + this.organizeName = "组织总次数"; + this.participateUserTotal = NumConstant.ZERO; + this.participateUserName = "参加总人数"; + this.categoryList = new ArrayList<>(); + } + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/OrgInfoCommonDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/OrgInfoCommonDTO.java new file mode 100644 index 0000000000..79b6460be4 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/OrgInfoCommonDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 组织或者网格基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 14:36 + */ +@Data +public class OrgInfoCommonDTO implements Serializable { + private static final long serialVersionUID = -2191521364070476999L; + + private String orgId; + private String orgName; + private String orgType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/RankCodeResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/RankCodeResultDTO.java new file mode 100644 index 0000000000..50d8531978 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/RankCodeResultDTO.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 004、【支建+联建】排序方式下拉框 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 17:01 + */ +@Data +public class RankCodeResultDTO implements Serializable { + private static final long serialVersionUID = 7991057885312015889L; + private String rankCode; + private String rankName; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/SubAnalysisByCodeResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/SubAnalysisByCodeResultDTO.java new file mode 100644 index 0000000000..4b4ec0fe06 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/resigroup/result/SubAnalysisByCodeResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dataaggre.dto.resigroup.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 003、【支建+联建】下级组织折线图 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 14:09 + */ +@Data +public class SubAnalysisByCodeResultDTO implements Serializable { + private static final long serialVersionUID = -6025482721295705372L; + + /** + * 横坐标名称:组织名或者网格名 + */ + private String name; + + /** + * 参加人数、组织次数、平均参加人数 + */ + private String type; + + private Integer value; + + private String orgId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index 6380b3118e..71880e1591 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -157,6 +157,20 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -238,6 +252,20 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -319,6 +347,20 @@ epmet elink@833066 + + + + + epmet + elink@833066 + + + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -400,6 +442,20 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical + EpmEt-db-UsEr + + + + + + epmet_evaluation_index_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java new file mode 100644 index 0000000000..a56d769119 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/DataStatsController.java @@ -0,0 +1,218 @@ +package com.epmet.dataaggre.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.dataaggre.dto.datastats.form.*; +import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@RestController +@RequestMapping("datastats") +public class DataStatsController { + + @Autowired + private DataStatsService dataStatsService; + + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + @PostMapping("agencybasicdata") + public Result agencyBasicData(@RequestBody AgenctBasicDataFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgenctBasicDataFormDTO.Agency.class); + return new Result().ok(dataStatsService.agencyBasicData(formDTO)); + } + + /** + * @Param formDTO + * @Description 网格下五项基础数据汇总 + * @author sun + */ + @PostMapping("gridbasicdata") + public Result gridBasicData(@RequestBody GridBasicDataFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridBasicDataFormDTO.Grid.class); + return new Result().ok(dataStatsService.gridBasicData(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + @PostMapping("subagencyuser") + public Result> subAgencyUser(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyUser(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + @PostMapping("subgriduser") + public Result> subGridUser(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridUser(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + @PostMapping("subagencygroup") + public Result> subAgencyGroup(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyGroup(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + @PostMapping("subgridgroup") + public Result> subGridGroup(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridGroup(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + */ + @PostMapping("subagencytopic") + public Result> subAgencyTopic(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyTopic(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + */ + @PostMapping("subgridtopic") + public Result> subGridTopic(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridTopic(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + @PostMapping("subagencyissue") + public Result> subAgencyIssue(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyIssue(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + @PostMapping("subgridissue") + public Result> subGridIssue(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridIssue(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + @PostMapping("subagencyproject") + public Result> subAgencyProject(@RequestBody SubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubAgencyFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyProject(formDTO)); + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + @PostMapping("subgridproject") + public Result> subGridProject(@RequestBody SubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, SubGridFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridProject(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-当前组织治理指数 + * @author sun + */ + @PostMapping("agencygovrn") + public Result agencyGovrn(@RequestBody AgencyGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyGovrnFormDTO.Agency.class); + return new Result().ok(dataStatsService.agencyGovrn(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属下级治理指数列表 + * @author sun + */ + @PostMapping("subagencygovrnlist") + public Result> subAgencyGovrnList(@RequestBody AgencyGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyGovrnFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subAgencyGovrnList(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-当前网格治理指数 + * @author sun + */ + @PostMapping("gridgovrn") + public Result gridGovrn(@RequestBody GridGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Grid.class); + return new Result().ok(dataStatsService.gridGovrn(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属网格治理指数列表 + * @author sun + */ + @PostMapping("subgridgovrnlist") + public Result> subGridGovrnList(@RequestBody GridGovrnFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridGovrnFormDTO.Agency.class); + return new Result>().ok(dataStatsService.subGridGovrnList(formDTO)); + } + + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + @PostMapping("governratio") + public Result governRatio(@RequestBody GovrnRatioFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GovrnRatioFormDTO.AgencyGrid.class); + if (!"agency".equals(formDTO.getOrgType()) && !"grid".equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + return new Result().ok(dataStatsService.governRatio(formDTO)); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java new file mode 100644 index 0000000000..ee86d8c1d1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/GroupActController.java @@ -0,0 +1,104 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.form.BranchConAnalysisFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.GroupActCategoryQueryFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.GroupActRankFormDTO; +import com.epmet.dataaggre.dto.resigroup.form.SubAnalysisByCodeFormDTO; +import com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO; +import com.epmet.dataaggre.service.resigroup.ResiGroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * 专项组-组织活动相关API放这 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/18 9:08 + */ +@RestController +@RequestMapping("groupact") +public class GroupActController { + + @Autowired + private ResiGroupService resiGroupService; + + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 001、【支建+联建】统计分析 + * @Date 2021/5/18 10:17 + **/ + @PostMapping("branchconanalysis") + public Result branchConAnalysis(@RequestBody BranchConAnalysisFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,BranchConAnalysisFormDTO.AddUserInternalGroup.class); + return new Result().ok(resiGroupService.branchConAnalysis(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 002、【支建+联建】二级分类字典查询 + * @Date 2021/5/18 13:49 + **/ + @PostMapping("categorydictlist") + public Result> queryCategoryDictList(@RequestBody GroupActCategoryQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActCategoryQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.queryActCategoryDictList(formDTO.getCustomerId(),formDTO.getFirstCategoryCode())); + } + + + /** + * @return com.epmet.commons.tools.utils.Result + * @param formDTO + * @author yinzuomei + * @description 003、【支建+联建】下级组织折线图 + * @Date 2021/5/18 14:31 + **/ + @PostMapping("subanalysisbycode") + public Result> querySubAnalysisByCode(@RequestBody SubAnalysisByCodeFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActCategoryQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.querySubAnalysisByCode(formDTO)); + } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 004、【支建+联建】排序方式下拉框 + * @Date 2021/5/18 17:14 + **/ + @PostMapping("rankcodelist") + public Result> queryRankCodeList(@RequestBody GroupActCategoryQueryFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActCategoryQueryFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.queryRankCodeList(formDTO)); + } + + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 005、【支建+联建】下级组织排行列表 + * @Date 2021/5/18 17:46 + **/ + @PostMapping("subranklist") + public Result> querySubRankList(@RequestBody GroupActRankFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,GroupActRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(resiGroupService.querySubRankList(formDTO)); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PartyMemberVanguardController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PartyMemberVanguardController.java new file mode 100644 index 0000000000..6acf23d69e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/PartyMemberVanguardController.java @@ -0,0 +1,51 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dataaggre.dto.datastats.form.PartyMemberVanguardFormDTO; +import com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO; +import com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardRankResultDTO; +import com.epmet.dataaggre.service.datastats.DataStatsService; +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.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 14:19 + */ +@RestController +@RequestMapping("vanguard") +public class PartyMemberVanguardController { + @Resource + private DataStatsService dataStatsService; + + /** + * 党员先锋--组织/网格详情 + * @author zhaoqifeng + * @date 2021/5/18 15:16 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("detail") + public Result vanguardDetail(@RequestBody PartyMemberVanguardFormDTO formDTO) { + PartyMemberVanguardDetailResultDTO result = dataStatsService.vanguardDetail(formDTO); + return new Result().ok(result); + } + + /** + * 党员先锋--下级组织排行 + * @author zhaoqifeng + * @date 2021/5/18 15:16 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("orgrank") + public Result vanguardRank(@RequestBody PartyMemberVanguardFormDTO formDTO) { + PartyMemberVanguardRankResultDTO result = dataStatsService.vanguardRank(formDTO); + return new Result().ok(result); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java new file mode 100644 index 0000000000..b49b16fc0c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/datastats/DataStatsDao.java @@ -0,0 +1,245 @@ +/** + * 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.dataaggre.dao.datastats; + +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; +import com.epmet.dataaggre.dto.datastats.form.SubAgencyFormDTO; +import com.epmet.dataaggre.dto.datastats.form.SubGridFormDTO; +import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; +import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; +import com.epmet.dataaggre.entity.datastats.DimGridEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@Mapper +public interface DataStatsDao { + + /** + * @Description 查询组织下注册用户最新日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgnecyRegUser(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + + /** + * @Description 查询组织下最新群组日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgnecyGroup(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + + /** + * @Description 查询组织下最新状态话题-机关日统计数据表 + * @author sun + */ + List getAgencyTopic(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + + /** + * @Description 查询组织下最新转议题话题-机关日统计数据表 + * @author sun + */ + AgencyBasicDataResultDTO.Topic getAgencyTopicShiftIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + + /** + * @Description 热议中话题-机关日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO.Topic getAgencyTopicHotDiscuss(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + + /** + * @Description 查询组织下最新议题日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgencyIssue(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + + /** + * @Description 查询组织下最新项目日统计数据 + * @author sun + */ + AgencyBasicDataResultDTO getAgencyProject(@Param("agencyId") String agencyId, @Param("dateId") String dateId); + + /** + * @Description 查询当前组织的直属下级组织信息 + * @author sun + */ + List getSubAgencyList(@Param("pid") String pid); + + /** + * @Description 查询直属下级组织注册用户日统计数据,默认按用户总数降序 + * @author sun + */ + List getSubAgencyUser(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询组织下网格列表 + * @author sun + */ + List getSubGridList(@Param("agencyId") String agencyId); + + /** + * @Description 查询网格层级注册用户日统计数据 + * @author sun + */ + List getSubGridUser(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织小组日统计数据,默认按群组总数降序 + * @author sun + */ + List getSubAgencyGroup(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级小组日统计数据,默认按群组总数降序 + * @author sun + */ + List getSubGridGroup(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织状态话题-日统计数据 + * @author sun + */ + List getSubAgencyTopic(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织转议题话题-日统计数据表 + * @author sun + */ + List getSubAgencyTopicShiftIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织热议中话题-机关日统计数据 + * @author sun + */ + List getSubAgencyTopicHotDiscuss(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级状态话题-日统计数据 + * @author sun + */ + List getSubGridTopic(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级转议题话题-日统计数据表 + * @author sun + */ + List getSubGridTopicShiftIssue(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级热议中话题-日统计数据 + * @author sun + */ + List getSubGridTopicHotDiscuss(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织议题日统计数据,默认按议题总数降序 + * @author sun + */ + List getSubAgencyIssue(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级议题日统计数据,默认按议题总数降序 + * @author sun + */ + List getSubGridIssue(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * @Description 查询直属下级组织项目日统计数据,默认按项目总数降序 + * @author sun + */ + List getSubAgencyProject(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Description 查询网格层级项目日统计数据,默认按项目总数降序 + * @author sun + */ + List getSubGridProject(@Param("gridIds") List gridIds, @Param("dateId") String dateId); + + /** + * 查询组织党员先锋详情 + * @author zhaoqifeng + * @date 2021/5/18 14:40 + * @param agencyId + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardDetailResultDTO selectAgencyVanguardDetail(@Param("agencyId") String agencyId); + + /** + * 查询网格党员先锋详情 + * @author zhaoqifeng + * @date 2021/5/18 14:40 + * @param grid + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardDetailResultDTO selectGridVanguardDetail(@Param("grid") String grid); + + /** + * 查询组织党员先锋排行 + * @author zhaoqifeng + * @date 2021/5/18 15:02 + * @param agencyId + * @return java.util.List + */ + List selectAgencyVanguardRank(@Param("agencyId") String agencyId); + + /** + * 查询网格党员先锋排行 + * @author zhaoqifeng + * @date 2021/5/18 15:03 + * @param agencyId + * @return java.util.List + */ + List selectGridVanguardRank(@Param("agencyId") String agencyId); + + List branchConAnalysis(@Param("customerId")String customerId, + @Param("orgId")String orgId, + @Param("orgType")String orgType, + @Param("dateId")String dateId, + @Param("parentCode")String parentCode); + + List querySubAnalysisByCode(@Param("customerId")String customerId, + @Param("pid")String pid, + @Param("dateId")String dateId, + @Param("categoryCode")String categoryCode); + + List selectGroupActRankDetail(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("orgId") String orgId, + @Param("actCategoryDictDTOList") List actCategoryDictDTOList); + + DimAgencyEntity getAgencyInfo(@Param("agencyId") String agencyId); + + /** + * @Param formDTO + * @Description 根据组织Id查询事件治理指数 + * @author sun + */ + List getAgencyGovern(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * @Param formDTO + * @Description 根据网格Id查询事件治理指数 + * @author sun + */ + List getGridGovern(@Param("gridIds") List gridIds, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java new file mode 100644 index 0000000000..c9084a0b4b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -0,0 +1,37 @@ +/** + * 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.dataaggre.dao.evaluationindex; + +import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @Author sun + * @Description 指标统计服务 + */ +@Mapper +public interface EvaluationIndexDao { + + /** + * @Param formDTO + * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率 + * @author sun + */ + GovrnRatioResultDTO getAgnecyOrGridGoverRatio(@Param("orgId") String orgId, @Param("orgType") String orgType, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java index fc33ce00bb..7d705c2aa3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/govorg/CustomerAgencyDao.java @@ -49,4 +49,7 @@ public interface CustomerAgencyDao extends BaseDao { String getAgencyIdByUserId(@Param("userId") String userId); List selectUsedAreaCodeList(@Param("parentAreaCode") String parentAreaCode); + + + List selectNextAgency(@Param("customerId")String customerId, @Param("pid")String pid); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java index f297a4f82f..0632f8bbf8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/resigroup/ResiGroupDao.java @@ -18,6 +18,7 @@ package com.epmet.dataaggre.dao.resigroup; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; import com.epmet.dataaggre.entity.resigroup.ResiGroupEntity; import org.apache.ibatis.annotations.Mapper; @@ -41,5 +42,7 @@ public interface ResiGroupDao extends BaseDao { * @date 2021/3/30 上午10:13 */ List candidateList(@Param("groupId")String groupId); - + + List selectActCategoryDictDTOByPcode(@Param("customerId")String customerId, + @Param("categoryCode")String firstCategoryCode); } \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java new file mode 100644 index 0000000000..efec2115db --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimAgencyEntity.java @@ -0,0 +1,78 @@ +/** + * 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.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_agency") +public class DimAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等 + */ + private String agencyDimType; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + private String level; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java new file mode 100644 index 0000000000..7037fe122a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimCustomerEntity.java @@ -0,0 +1,49 @@ +/** + * 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.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_customer") +public class DimCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 客户所属行政地区编码,取值来自客户根组织的area_code(01.14 add) + */ + private String areaCode; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java new file mode 100644 index 0000000000..fcb170a9e2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/datastats/DimGridEntity.java @@ -0,0 +1,59 @@ +/** + * 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.dataaggre.entity.datastats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_grid") +public class DimGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java new file mode 100644 index 0000000000..8b08a765d2 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/DataStatsService.java @@ -0,0 +1,162 @@ +package com.epmet.dataaggre.service.datastats; + +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; +import com.epmet.dataaggre.dto.datastats.form.*; +import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; + +import java.util.List; + +/** + * @Author sun + * @Description 数据统计服务 + */ +public interface DataStatsService { + + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO); + + /** + * @Param formDTO + * @Description 网格下五项基础数据汇总 + * @author sun + */ + GridBasicDataResultDTO gridBasicData(GridBasicDataFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + List subAgencyUser(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + List subGridUser(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + List subAgencyGroup(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + List subGridGroup(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + * @return + */ + List subAgencyTopic(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + * @return + */ + List subGridTopic(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + List subAgencyIssue(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + List subGridIssue(SubGridFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + List subAgencyProject(SubAgencyFormDTO formDTO); + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + List subGridProject(SubGridFormDTO formDTO); + + /** + * 党员先锋--组织/网格详情 + * @author zhaoqifeng + * @date 2021/5/18 14:35 + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardDetailResultDTO vanguardDetail(PartyMemberVanguardFormDTO formDTO); + + /** + * 党员先锋--下级组织排行 + * @author zhaoqifeng + * @date 2021/5/18 14:36 + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + */ + PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO); + + + List branchConAnalysis(String customerId, String orgId, String orgType, String dateId, String parentCode); + + List querySubAnalysisByCode(String customerId, String pid, String dateId, String categoryCode); + + List selectGroupActRankDetail(String customerId, String dateId, String orgId, List actCategoryDictDTOList); + + /** + * @Param formDTO + * @Description 治理实况-当前组织治理指数 + * @author sun + */ + AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-组织直属下级治理指数列表 + * @author sun + */ + List subAgencyGovrnList(AgencyGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-当前网格治理指数 + * @author sun + */ + GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-组织直属网格治理指数列表 + * @author sun + */ + List subGridGovrnList(GridGovrnFormDTO formDTO); + + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java new file mode 100644 index 0000000000..b61338b163 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -0,0 +1,1305 @@ + package com.epmet.dataaggre.service.datastats.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.constant.OrgConstant; +import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; +import com.epmet.dataaggre.dto.datastats.form.*; +import com.epmet.dataaggre.dto.datastats.result.*; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; +import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; +import com.epmet.dataaggre.entity.datastats.DimAgencyEntity; +import com.epmet.dataaggre.entity.datastats.DimGridEntity; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import java.util.stream.Collectors; + +/** + * @Author sun + * @Description 数据统计服务 + */ +@Service +@DataSource(DataSourceConstant.DATA_STATISTICAL) +@Slf4j +public class DataStatsServiceImpl implements DataStatsService { + @Autowired + private DataStatsDao dataStatsDao; + @Autowired + private EvaluationIndexService indexService; + + + /** + * @Param formDTO + * @Description 组织下五项基础数据汇总 + * @author sun + */ + @Override + public AgencyBasicDataResultDTO agencyBasicData(AgenctBasicDataFormDTO formDTO) { + AgencyBasicDataResultDTO resultDTO = new AgencyBasicDataResultDTO(); + resultDTO.setAgencyId(formDTO.getAgencyId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 + AgencyBasicDataResultDTO user = dataStatsDao.getAgnecyRegUser(formDTO.getAgencyId(), formDTO.getDateId()); + if (null != user) { + resultDTO.setUserTotal(user.getUserTotal()); + resultDTO.setResiTotal(user.getResiTotal()); + resultDTO.setResiRatio(user.getResiTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getResiTotal() / (float) user.getUserTotal()))); + resultDTO.setPartyMemberTotal(user.getPartyMemberTotal()); + resultDTO.setPartyMemberRatio(user.getPartyMemberTotal() == 0 || user.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) user.getPartyMemberTotal() / (float) user.getUserTotal()))); + } + + //2.查询组织下最新群组日统计数据 + AgencyBasicDataResultDTO group = dataStatsDao.getAgnecyGroup(formDTO.getAgencyId(), formDTO.getDateId()); + if (null != group) { + resultDTO.setGroupTotal(group.getGroupTotal()); + resultDTO.setOrdinaryTotal(group.getOrdinaryTotal()); + resultDTO.setOrdinaryRatio(group.getOrdinaryTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getOrdinaryTotal() / (float) group.getGroupTotal()))); + resultDTO.setBranchTotal(group.getBranchTotal()); + resultDTO.setBranchRatio(group.getBranchTotal() == 0 || group.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) group.getBranchTotal() / (float) group.getGroupTotal()))); + } + + //3.查询组织下最新话题日统计数据 + //状态话题-机关日统计数据表最新日期三种状态数据 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念 + List topic = dataStatsDao.getAgencyTopic(formDTO.getAgencyId(), formDTO.getDateId()); + //转议题话题-机关日统计数据表 + AgencyBasicDataResultDTO.Topic topicSHiftIssue = dataStatsDao.getAgencyTopicShiftIssue(formDTO.getAgencyId(), formDTO.getDateId()); + //热议中话题-机关日统计数据 + AgencyBasicDataResultDTO.Topic hotdiscuss = dataStatsDao.getAgencyTopicHotDiscuss(formDTO.getAgencyId(), formDTO.getDateId()); + AtomicReference closedTotal = new AtomicReference<>(0); + if (topic.size() > NumConstant.ZERO) { + resultDTO.setTopicTotal(topic.stream().collect(Collectors.summingInt(AgencyBasicDataResultDTO.Topic::getTopicCount))); + topic.forEach(t -> { + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + }); + } + //转议题 + if (null != topicSHiftIssue) { + resultDTO.setShiftIssueTotal(topicSHiftIssue.getShiftedIssueTotal()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + } + //热议中 + if (null != hotdiscuss) { + resultDTO.setDiscussingTotal(hotdiscuss.getTopicCount()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + } + //已处理 + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + + //4.查询组织下最新议题日统计数据 + AgencyBasicDataResultDTO issue = dataStatsDao.getAgencyIssue(formDTO.getAgencyId(), formDTO.getDateId()); + if (null != issue) { + resultDTO.setIssueTotal(issue.getIssueTotal()); + resultDTO.setVotingTotal(issue.getVotingTotal()); + resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setClosedIssueTotal(issue.getClosedIssueTotal()); + resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setShiftProjectTotal(issue.getShiftProjectTotal()); + resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); + } + + //5.查询组织下最新项目日统计数据 + AgencyBasicDataResultDTO project = dataStatsDao.getAgencyProject(formDTO.getAgencyId(), formDTO.getDateId()); + if (null != project) { + resultDTO.setProjectTotal(project.getProjectTotal()); + resultDTO.setPendingTotal(project.getPendingTotal()); + resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); + resultDTO.setClosedProjectTotal(project.getClosedProjectTotal()); + resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); + } + + return resultDTO; + } + + /** + * @Param formDTO + * @Description 网格下五项基础数据汇总 + * @author sun + */ + @Override + public GridBasicDataResultDTO gridBasicData(GridBasicDataFormDTO formDTO) { + GridBasicDataResultDTO resultDTO = new GridBasicDataResultDTO(); + resultDTO.setGridId(formDTO.getGridId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.查询网格下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 + List gridIds = new ArrayList<>(); + gridIds.add(formDTO.getGridId()); + List userList = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); + if (userList.size() > NumConstant.ZERO) { + resultDTO.setUserTotal(userList.get(0).getUserTotal()); + resultDTO.setResiTotal(userList.get(0).getResiTotal()); + resultDTO.setResiRatio(resultDTO.getResiTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getResiTotal() / (float) resultDTO.getUserTotal()))); + resultDTO.setPartyMemberTotal(userList.get(0).getPartyMemberTotal()); + resultDTO.setPartyMemberRatio(resultDTO.getPartyMemberTotal() == 0 || resultDTO.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPartyMemberTotal() / (float) resultDTO.getUserTotal()))); + } + + //2.查询网格下最新群组日统计数据 + List groupList = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); + if (groupList.size() > NumConstant.ZERO) { + resultDTO.setGroupTotal(groupList.get(0).getGroupTotal()); + resultDTO.setOrdinaryTotal(groupList.get(0).getOrdinaryTotal()); + resultDTO.setOrdinaryRatio(resultDTO.getOrdinaryTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getOrdinaryTotal() / (float) resultDTO.getGroupTotal()))); + resultDTO.setBranchTotal(groupList.get(0).getBranchTotal()); + resultDTO.setBranchRatio(resultDTO.getBranchTotal() == 0 || resultDTO.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getBranchTotal() / (float) resultDTO.getGroupTotal()))); + } + + //3.查询网格下最新话题日统计数据 + //状态话题-网格日统计数据表最新日期三种状态数据 + //网格日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念 + List topicList = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); + //转议题话题-网格日统计数据表 + List topicShiftIssueList = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); + //热议中话题-网格日统计数据 + List hotdiscussList = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId()); + AtomicReference closedTotal = new AtomicReference<>(0); + if (topicList.size() > NumConstant.ZERO) { + resultDTO.setTopicTotal(topicList.stream().collect(Collectors.summingInt(SubGridFormDTO.Topic::getTopicCount))); + topicList.forEach(t -> { + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + }); + } + //转议题 + if (topicShiftIssueList.size() > NumConstant.ZERO) { + resultDTO.setShiftIssueTotal(topicShiftIssueList.get(0).getShiftedIssueTotal()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + } + //热议中 + if (hotdiscussList.size() > NumConstant.ZERO) { + resultDTO.setDiscussingTotal(hotdiscussList.get(0).getTopicCount()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + } + //已处理 + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + + //4.查询网格下最新议题日统计数据 + List issueList = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); + if (issueList.size() > NumConstant.ZERO) { + resultDTO.setIssueTotal(issueList.get(0).getIssueTotal()); + resultDTO.setVotingTotal(issueList.get(0).getVotingTotal()); + resultDTO.setVotingRatio(resultDTO.getVotingTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getVotingTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setClosedIssueTotal(issueList.get(0).getClosedIssueTotal()); + resultDTO.setClosedIssueRatio(resultDTO.getClosedIssueTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedIssueTotal() / (float) resultDTO.getIssueTotal()))); + resultDTO.setShiftProjectTotal(issueList.get(0).getShiftProjectTotal()); + resultDTO.setShiftProjectRatio(resultDTO.getShiftProjectTotal() == 0 || resultDTO.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftProjectTotal() / (float) resultDTO.getIssueTotal()))); + } + + //5.查询网格下最新项目日统计数据 + List projectList = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); + if (projectList.size() > NumConstant.ZERO) { + resultDTO.setProjectTotal(projectList.get(0).getProjectTotal()); + resultDTO.setPendingTotal(projectList.get(0).getPendingTotal()); + resultDTO.setPendingRatio(resultDTO.getPendingTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getPendingTotal() / (float) resultDTO.getProjectTotal()))); + resultDTO.setClosedProjectTotal(projectList.get(0).getClosedProjectTotal()); + resultDTO.setClosedProjectRatio(resultDTO.getClosedProjectTotal() == 0 || resultDTO.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedProjectTotal() / (float) resultDTO.getProjectTotal()))); + } + + return resultDTO; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织用户数据 + * @author sun + */ + @Override + public List subAgencyUser(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("user"); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 + List list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); + + //3.封装数据 + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyUserResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setUserTotal(u.getUserTotal()); + dto.setPartyMemberTotal(u.getPartyMemberTotal()); + dto.setResiTotal(u.getResiTotal()); + } + } + dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal()))); + dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyUserResultDTO o1, SubAgencyUserResultDTO o2) { + if ("party".equals(formDTO.getType())) { + //升序 + //return o1.getPartyMemberTotal().compareTo(o2.getPartyMemberTotal()); + //降序 + return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); + } else if ("resi".equals(formDTO.getType())) { + return o2.getResiTotal().compareTo(o1.getResiTotal()); + } else { + return o2.getUserTotal().compareTo(o1.getUserTotal()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表用户数据 + * @author sun + */ + @Override + public List subGridUser(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("user"); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级注册用户日统计数据,默认按用户总数降序 + List list = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); + + //3.封装数据 + for (DimGridEntity gr : gridList) { + SubGridUserResultDTO dto = new SubGridUserResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridUserResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setUserTotal(re.getUserTotal()); + dto.setPartyMemberTotal(re.getPartyMemberTotal()); + dto.setResiTotal(re.getResiTotal()); + } + } + dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal()))); + dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridUserResultDTO o1, SubGridUserResultDTO o2) { + if ("party".equals(formDTO.getType())) { + //降序 + return o2.getPartyMemberTotal().compareTo(o1.getPartyMemberTotal()); + } else if ("resi".equals(formDTO.getType())) { + return o2.getResiTotal().compareTo(o1.getResiTotal()); + } else { + return o2.getUserTotal().compareTo(o1.getUserTotal()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织群组数据 + * @author sun + */ + @Override + public List subAgencyGroup(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("group"); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织小组日统计数据,默认按群组总数降序 + List list = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); + + //3.封装数据 + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyGroupResultDTO dto = new SubAgencyGroupResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyGroupResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setGroupTotal(u.getGroupTotal()); + dto.setOrdinaryTotal(u.getOrdinaryTotal()); + dto.setBranchTotal(u.getBranchTotal()); + } + } + dto.setOrdinaryRatio(dto.getOrdinaryTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getOrdinaryTotal() / (float) dto.getGroupTotal()))); + dto.setBranchRatio(dto.getBranchTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getBranchTotal() / (float) dto.getGroupTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyGroupResultDTO o1, SubAgencyGroupResultDTO o2) { + if ("ordinary".equals(formDTO.getType())) { + return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); + } else if ("branch".equals(formDTO.getType())) { + return o2.getBranchTotal().compareTo(o1.getBranchTotal()); + } else { + return o2.getGroupTotal().compareTo(o1.getGroupTotal()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表群组数据 + * @author sun + */ + @Override + public List subGridGroup(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("group"); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级小组日统计数据,默认按群组总数降序 + List list = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); + + //3.封装数据并返回 + for (DimGridEntity gr : gridList) { + SubGridGroupResultDTO dto = new SubGridGroupResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridGroupResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setGroupTotal(re.getGroupTotal()); + dto.setOrdinaryTotal(re.getOrdinaryTotal()); + dto.setBranchTotal(re.getBranchTotal()); + } + } + dto.setOrdinaryRatio(dto.getOrdinaryTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getOrdinaryTotal() / (float) dto.getGroupTotal()))); + dto.setBranchRatio(dto.getBranchTotal() == 0 || dto.getGroupTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getBranchTotal() / (float) dto.getGroupTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridGroupResultDTO o1, SubGridGroupResultDTO o2) { + if ("ordinary".equals(formDTO.getType())) { + return o2.getOrdinaryTotal().compareTo(o1.getOrdinaryTotal()); + } else if ("branch".equals(formDTO.getType())) { + return o2.getBranchTotal().compareTo(o1.getBranchTotal()); + } else { + return o2.getGroupTotal().compareTo(o1.getGroupTotal()); + } + } + }); + + return resultList; + } + + /** + * @return + * @Param formDTO + * @Description 查询当前组织的直属下级组织话题数据 + * @author sun + */ + @Override + public List subAgencyTopic(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("topic"); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织状态话题-日统计数据 + //机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念 + List topic = dataStatsDao.getSubAgencyTopic(agencyIds, formDTO.getDateId()); + //查询直属下级组织转议题话题-日统计数据表 + List topicShiftIssue = dataStatsDao.getSubAgencyTopicShiftIssue(agencyIds, formDTO.getDateId()); + //查询直属下级组织热议中话题-机关日统计数据 + List hotdiscuss = dataStatsDao.getSubAgencyTopicHotDiscuss(agencyIds, formDTO.getDateId()); + subAgencyList.forEach(sub -> { + SubAgencyTopicResultDTO resultDTO = new SubAgencyTopicResultDTO(); + AtomicInteger topicTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicInteger hotdiscussTotal = new AtomicInteger(0); + topic.forEach(t -> { + if (t.getAgencyId().equals(sub.getId())) { + topicTotal.addAndGet(t.getTopicCount()); + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + } + }); + topicShiftIssue.forEach(t -> { + if (t.getAgencyId().equals(sub.getId())) { + shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); + } + }); + hotdiscuss.forEach(t -> { + if (t.getAgencyId().equals(sub.getId())) { + hotdiscussTotal.addAndGet(t.getTopicCount()); + } + }); + + resultDTO.setAgencyId(sub.getId()); + resultDTO.setAgencyName(sub.getAgencyName()); + resultDTO.setTopicTotal(topicTotal.get()); + resultDTO.setDiscussingTotal(hotdiscussTotal.get()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + + resultList.add(resultDTO); + }); + + //3.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyTopicResultDTO o1, SubAgencyTopicResultDTO o2) { + if ("discussing".equals(formDTO.getType())) { + return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); + } else if ("shiftIssue".equals(formDTO.getType())) { + return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); + } else { + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } + } + }); + + return resultList; + } + + /** + * @return + * @Param formDTO + * @Description 查询当前组织下直属网格列表话题数据 + * @author sun + */ + @Override + public List subGridTopic(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("topic"); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级话题数据 + //查询网格层级状态话题-日统计数据 机关日表里三种类型数据之和就是话题总量,讨论中数量与热议中不是一个概念,热议中=总量-关闭数-屏蔽数-转议题数 + List topic = dataStatsDao.getSubGridTopic(gridIds, formDTO.getDateId()); + //查询网格层级转议题话题-日统计数据表 + List topicShiftIssue = dataStatsDao.getSubGridTopicShiftIssue(gridIds, formDTO.getDateId()); + //查询网格层级热议中话题-日统计数据 + List hotdiscuss = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId()); + gridList.forEach(gr -> { + SubGridTopicResultDTO resultDTO = new SubGridTopicResultDTO(); + AtomicInteger topicTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger shiftIssueTotal = new AtomicInteger(0); + AtomicInteger hotdiscussTotal = new AtomicInteger(0); + topic.forEach(t -> { + if (t.getGridId().equals(gr.getId())) { + topicTotal.addAndGet(t.getTopicCount()); + if (t.getTopicStatus().equals("closed")) { + closedTotal.set(t.getTopicCount()); + } + } + }); + topicShiftIssue.forEach(t -> { + if (t.getGridId().equals(gr.getId())) { + shiftIssueTotal.addAndGet(t.getShiftedIssueTotal()); + } + }); + hotdiscuss.forEach(t -> { + if (t.getGridId().equals(gr.getId())) { + hotdiscussTotal.addAndGet(t.getTopicCount()); + } + }); + + resultDTO.setGridId(gr.getId()); + resultDTO.setGridName(gr.getGridName()); + resultDTO.setTopicTotal(topicTotal.get()); + resultDTO.setDiscussingTotal(hotdiscussTotal.get()); + resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setClosedTopicTotal(closedTotal.get()); + resultDTO.setClosedTopicRatio(resultDTO.getClosedTopicTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getClosedTopicTotal() / (float) resultDTO.getTopicTotal()))); + resultDTO.setShiftIssueTotal(shiftIssueTotal.get()); + resultDTO.setShiftIssueRatio(resultDTO.getShiftIssueTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getShiftIssueTotal() / (float) resultDTO.getTopicTotal()))); + + resultList.add(resultDTO); + }); + + //3.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridTopicResultDTO o1, SubGridTopicResultDTO o2) { + if ("discussing".equals(formDTO.getType())) { + return o2.getDiscussingTotal().compareTo(o1.getDiscussingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedTopicTotal().compareTo(o1.getClosedTopicTotal()); + } else if ("shiftIssue".equals(formDTO.getType())) { + return o2.getShiftIssueTotal().compareTo(o1.getShiftIssueTotal()); + } else { + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织议题数据 + * @author sun + */ + @Override + public List subAgencyIssue(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("issue"); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织议题日统计数据,默认按议题总数降序 + List list = dataStatsDao.getSubAgencyIssue(agencyIds, formDTO.getDateId()); + + //3.封装数据 + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyIssueResultDTO dto = new SubAgencyIssueResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyIssueResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setIssueTotal(u.getIssueTotal()); + dto.setVotingTotal(u.getVotingTotal()); + dto.setClosedIssueTotal(u.getClosedIssueTotal()); + dto.setShiftProjectTotal(u.getShiftProjectTotal()); + } + } + dto.setVotingRatio(dto.getVotingTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getVotingTotal() / (float) dto.getIssueTotal()))); + dto.setClosedIssueRatio(dto.getClosedIssueTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedIssueTotal() / (float) dto.getIssueTotal()))); + dto.setShiftProjectRatio(dto.getShiftProjectTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getShiftProjectTotal() / (float) dto.getIssueTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyIssueResultDTO o1, SubAgencyIssueResultDTO o2) { + if ("voting".equals(formDTO.getType())) { + return o2.getVotingTotal().compareTo(o1.getVotingTotal()); + } else if ("shiftProject".equals(formDTO.getType())) { + return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); + } else { + return o2.getIssueTotal().compareTo(o1.getIssueTotal()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表议题数据 + * @author sun + */ + @Override + public List subGridIssue(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("issue"); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级议题日统计数据,默认按议题总数降序 + List list = dataStatsDao.getSubGridIssue(gridIds, formDTO.getDateId()); + + //3.封装数据 + for (DimGridEntity gr : gridList) { + SubGridIssueResultDTO dto = new SubGridIssueResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridIssueResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setIssueTotal(re.getIssueTotal()); + dto.setVotingTotal(re.getVotingTotal()); + dto.setClosedIssueTotal(re.getClosedIssueTotal()); + dto.setShiftProjectTotal(re.getShiftProjectTotal()); + } + } + dto.setVotingRatio(dto.getVotingTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getVotingTotal() / (float) dto.getIssueTotal()))); + dto.setClosedIssueRatio(dto.getClosedIssueTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedIssueTotal() / (float) dto.getIssueTotal()))); + dto.setShiftProjectRatio(dto.getShiftProjectTotal() == 0 || dto.getIssueTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getShiftProjectTotal() / (float) dto.getIssueTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridIssueResultDTO o1, SubGridIssueResultDTO o2) { + if ("voting".equals(formDTO.getType())) { + return o2.getVotingTotal().compareTo(o1.getVotingTotal()); + } else if ("shiftProject".equals(formDTO.getType())) { + return o2.getShiftProjectTotal().compareTo(o1.getShiftProjectTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedIssueTotal().compareTo(o1.getClosedIssueTotal()); + } else { + return o2.getIssueTotal().compareTo(o1.getIssueTotal()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织的直属下级组织项目数据 + * @author sun + */ + @Override + public List subAgencyProject(SubAgencyFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("project"); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.查询直属下级组织项目日统计数据,默认按项目总数降序 + List list = dataStatsDao.getSubAgencyProject(agencyIds, formDTO.getDateId()); + + //3.封装数据 + for (DimAgencyEntity sub : subAgencyList) { + SubAgencyProjectResultDTO dto = new SubAgencyProjectResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + for (SubAgencyProjectResultDTO u : list) { + if (sub.getId().equals(u.getAgencyId())) { + dto.setProjectTotal(u.getProjectTotal()); + dto.setPendingTotal(u.getPendingTotal()); + dto.setClosedProjectTotal(u.getClosedProjectTotal()); + } + } + dto.setPendingRatio(dto.getPendingTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPendingTotal() / (float) dto.getProjectTotal()))); + dto.setClosedProjectRatio(dto.getClosedProjectTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedProjectTotal() / (float) dto.getProjectTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubAgencyProjectResultDTO o1, SubAgencyProjectResultDTO o2) { + if ("pending".equals(formDTO.getType())) { + return o2.getPendingTotal().compareTo(o1.getPendingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); + } else { + return o2.getProjectTotal().compareTo(o1.getProjectTotal()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 查询当前组织下直属网格列表项目数据 + * @author sun + */ + @Override + public List subGridProject(SubGridFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按用户总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("project"); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.查询网格层级项目日统计数据,默认按项目总数降序 + List list = dataStatsDao.getSubGridProject(gridIds, formDTO.getDateId()); + + //3.封装数据 + for (DimGridEntity gr : gridList) { + SubGridProjectResultDTO dto = new SubGridProjectResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (SubGridProjectResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setProjectTotal(re.getProjectTotal()); + dto.setPendingTotal(re.getPendingTotal()); + dto.setClosedProjectTotal(re.getClosedProjectTotal()); + } + } + dto.setPendingRatio(dto.getPendingTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPendingTotal() / (float) dto.getProjectTotal()))); + dto.setClosedProjectRatio(dto.getClosedProjectTotal() == 0 || dto.getProjectTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getClosedProjectTotal() / (float) dto.getProjectTotal()))); + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubGridProjectResultDTO o1, SubGridProjectResultDTO o2) { + if ("pending".equals(formDTO.getType())) { + return o2.getPendingTotal().compareTo(o1.getPendingTotal()); + } else if ("closed".equals(formDTO.getType())) { + return o2.getClosedProjectTotal().compareTo(o1.getClosedProjectTotal()); + } else { + return o2.getProjectTotal().compareTo(o1.getProjectTotal()); + } + } + }); + + return resultList; + } + + /** + * 党员先锋--组织/网格详情 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + * @author zhaoqifeng + * @date 2021/5/18 14:35 + */ + @Override + public PartyMemberVanguardDetailResultDTO vanguardDetail(PartyMemberVanguardFormDTO formDTO) { + PartyMemberVanguardDetailResultDTO result; + if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { + result = dataStatsDao.selectAgencyVanguardDetail(formDTO.getOrgId()); + } else { + result = dataStatsDao.selectGridVanguardDetail(formDTO.getOrgId()); + } + if (null == result) { + result = new PartyMemberVanguardDetailResultDTO(); + result.setGroupRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setGroupMemberRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setTopicRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setIssueRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setProjectRatio(transform(new BigDecimal(NumConstant.ZERO))); + result.setProjectClosedRatio(transform(new BigDecimal(NumConstant.ZERO))); + return result; + } + result.setGroupRatio(transform(result.getGroupRatio())); + result.setGroupMemberRatio(transform(result.getGroupMemberRatio())); + result.setTopicRatio(transform(result.getTopicRatio())); + result.setIssueRatio(transform(result.getIssueRatio())); + result.setProjectRatio(transform(result.getProjectRatio())); + result.setProjectClosedRatio(transform(result.getProjectClosedRatio())); + return result; + } + + /** + * 党员先锋--下级组织排行 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + * @author zhaoqifeng + * @date 2021/5/18 14:36 + */ + @Override + public PartyMemberVanguardRankResultDTO vanguardRank(PartyMemberVanguardFormDTO formDTO) { + //获取组织级别 + DimAgencyEntity agency = dataStatsDao.getAgencyInfo(formDTO.getAgencyId()); + if (null == agency) { + return new PartyMemberVanguardRankResultDTO(); + } + //组织排行 + List agencyRank = dataStatsDao.selectAgencyVanguardRank(formDTO.getAgencyId()); + //网格排行 + List gridRank = dataStatsDao.selectGridVanguardRank(formDTO.getAgencyId()); + PartyMemberVanguardRankResultDTO result = new PartyMemberVanguardRankResultDTO(); + result.setAgencyRank(CollectionUtils.isNotEmpty(agencyRank)?agencyRank:Collections.emptyList()); + result.setGridRank(CollectionUtils.isNotEmpty(gridRank)?gridRank:Collections.emptyList()); + result.getAgencyRank().forEach(item -> { + item.setGroupRatio(transform(item.getGroupRatio())); + item.setGroupMemberRatio(transform(item.getGroupMemberRatio())); + item.setTopicRatio(transform(item.getTopicRatio())); + item.setIssueRatio(transform(item.getIssueRatio())); + item.setProjectRatio(transform(item.getProjectRatio())); + item.setProjectClosedRatio(transform(item.getProjectClosedRatio())); + item.setOrgType(OrgConstant.AGENCY); + }); + result.getGridRank().forEach(item -> { + item.setGroupRatio(transform(item.getGroupRatio())); + item.setGroupMemberRatio(transform(item.getGroupMemberRatio())); + item.setTopicRatio(transform(item.getTopicRatio())); + item.setIssueRatio(transform(item.getIssueRatio())); + item.setProjectRatio(transform(item.getProjectRatio())); + item.setProjectClosedRatio(transform(item.getProjectClosedRatio())); + item.setOrgType(OrgConstant.GRID); + }); + result.setAgencyLevel(agency.getLevel()); + return result; + } + + private BigDecimal transform(BigDecimal count) { + if (count == null){ + count = NumConstant.ZERO_DECIMAL; + } + return count.multiply(new BigDecimal(NumConstant.ONE_HUNDRED) ).setScale(NumConstant.ONE, + RoundingMode.HALF_UP); + } + + @Override + public List branchConAnalysis(String customerId, String orgId, String orgType, String dateId, String parentCode) { + return dataStatsDao.branchConAnalysis(customerId,orgId,orgType,dateId,parentCode); + } + + @Override + public List querySubAnalysisByCode(String customerId, String pid, String dateId, String categoryCode) { + return dataStatsDao.querySubAnalysisByCode(customerId,pid,dateId,categoryCode); + } + + @Override + public List selectGroupActRankDetail(String customerId, String dateId, String orgId, List actCategoryDictDTOList) { + if(CollectionUtils.isNotEmpty(actCategoryDictDTOList)){ + return dataStatsDao.selectGroupActRankDetail(customerId,dateId,orgId,actCategoryDictDTOList); + } + return new ArrayList<>(); + } + + /** + * @Param formDTO + * @Description 治理实况-当前组织治理指数 + * @author sun + */ + @Override + public AgencyGovrnResultDTO agencyGovrn(AgencyGovrnFormDTO formDTO) { + AgencyGovrnResultDTO resultDTO = new AgencyGovrnResultDTO(); + resultDTO.setAgencyId(formDTO.getAgencyId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //1.按日期查询当前组织事件治理指数 + List agencyIds = new ArrayList<>(); + agencyIds.add(formDTO.getAgencyId()); + List list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId()); + if (list.size() > NumConstant.ZERO) { + resultDTO = list.get(NumConstant.ZERO); + } + return resultDTO; + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属下级治理指数列表 + * @author sun + */ + @Override + public List subAgencyGovrnList(AgencyGovrnFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按问题解决总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("problem"); + } + + //1.查询当前组织的直属下级组织信息【机关维度】 + List subAgencyList = dataStatsDao.getSubAgencyList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); + + //2.按日期查询所有下级组织的事件治理指数 + List list = dataStatsDao.getAgencyGovern(agencyIds, formDTO.getDateId()); + + //3.封装数据 + for (DimAgencyEntity sub : subAgencyList) { + AgencyGovrnResultDTO dto = new AgencyGovrnResultDTO(); + dto.setAgencyId(sub.getId()); + dto.setAgencyName(sub.getAgencyName()); + dto.setLevel(sub.getLevel()); + for (AgencyGovrnResultDTO re : list) { + if (sub.getId().equals(re.getAgencyId())) { + dto.setProblemResolvedCount(re.getProblemResolvedCount()); + dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); + dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); + dto.setCommunityResolvedRatio(re.getCommunityResolvedRatio()); + dto.setStreetResolvedRatio(re.getStreetResolvedRatio()); + dto.setDistrictDeptResolvedRatio(re.getDistrictDeptResolvedRatio()); + } + } + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(AgencyGovrnResultDTO o1, AgencyGovrnResultDTO o2) { + if ("party".equals(formDTO.getType())) { + return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); + } else if ("grid".equals(formDTO.getType())) { + return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); + } else if ("community".equals(formDTO.getType())) { + return o2.getCommunityResolvedRatio().compareTo(o1.getCommunityResolvedRatio()); + } else if ("department".equals(formDTO.getType())) { + return o2.getDistrictDeptResolvedRatio().compareTo(o1.getDistrictDeptResolvedRatio()); + } else if ("street".equals(formDTO.getType())) { + return o2.getStreetResolvedRatio().compareTo(o1.getStreetResolvedRatio()); + } else { + return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 治理实况-当前网格治理指数 + * @author sun + */ + @Override + public GridGovrnResultDTO gridGovrn(GridGovrnFormDTO formDTO) { + GridGovrnResultDTO resultDTO = new GridGovrnResultDTO(); + resultDTO.setGridId(formDTO.getGridId()); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.按日期查询网格事件治理指数 + List gridIds = new ArrayList<>(); + gridIds.add(formDTO.getGridId()); + List list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId()); + if (list.size() > NumConstant.ZERO) { + resultDTO = list.get(NumConstant.ZERO); + } + return resultDTO; + } + + /** + * @Param formDTO + * @Description 治理实况-组织直属网格治理指数列表 + * @author sun + */ + @Override + public List subGridGovrnList(GridGovrnFormDTO formDTO) { + List resultList = new ArrayList<>(); + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.THREE); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + //排序类型,默认按问题解决总数降序 + if (StringUtils.isBlank(formDTO.getDateId())) { + formDTO.setType("problem"); + } + + //1.查询组织直属网格列表【网格维度】 + List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + + //2.按日期查找组织直属网格事件治理指数列表 + List list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId()); + + //3.封装数据 + for (DimGridEntity gr : gridList) { + GridGovrnResultDTO dto = new GridGovrnResultDTO(); + dto.setGridId(gr.getId()); + dto.setGridName(gr.getGridName()); + for (GridGovrnResultDTO re : list) { + if (gr.getId().equals(re.getGridId())) { + dto.setProblemResolvedCount(re.getProblemResolvedCount()); + dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); + dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); + dto.setCommunityResolvedRatio(re.getCommunityResolvedRatio()); + dto.setDistrictDeptResolvedRatio(re.getDistrictDeptResolvedRatio()); + dto.setStreetResolvedRatio(re.getStreetResolvedRatio()); + } + } + resultList.add(dto); + } + + //4.按要求排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(GridGovrnResultDTO o1, GridGovrnResultDTO o2) { + if ("party".equals(formDTO.getType())) { + return o2.getGroupSelfGovernRatio().compareTo(o1.getGroupSelfGovernRatio()); + } else if ("grid".equals(formDTO.getType())) { + return o2.getGridSelfGovernRatio().compareTo(o1.getGridSelfGovernRatio()); + } else if ("community".equals(formDTO.getType())) { + return o2.getCommunityResolvedRatio().compareTo(o1.getCommunityResolvedRatio()); + } else if ("department".equals(formDTO.getType())) { + return o2.getDistrictDeptResolvedRatio().compareTo(o1.getDistrictDeptResolvedRatio()); + } else if ("street".equals(formDTO.getType())) { + return o2.getStreetResolvedRatio().compareTo(o1.getStreetResolvedRatio()); + } else { + return o2.getProblemResolvedCount().compareTo(o1.getProblemResolvedCount()); + } + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + @Override + public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) { + GovrnRatioResultDTO resultDTO = new GovrnRatioResultDTO(); + resultDTO.setOrgId(formDTO.getOrgId()); + resultDTO.setOrgType(formDTO.getOrgType()); + + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getDateId())) { + Date yesterday = DateUtils.addDateDays(new Date(), -1); + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + + //1.按类型、日期查询治理指数下响应解决满意自治四个统计率 + GovrnRatioResultDTO dto = indexService.governRatio(formDTO); + if (null != dto) { + resultDTO.setResponseRatio(dto.getResponseRatio()); + resultDTO.setResolvedRatio(dto.getResolvedRatio()); + resultDTO.setGovernRatio(dto.getGovernRatio()); + resultDTO.setSatisfactionRatio(dto.getSatisfactionRatio()); + } + return resultDTO; + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java new file mode 100644 index 0000000000..909a3dc208 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -0,0 +1,18 @@ +package com.epmet.dataaggre.service.evaluationindex; + +import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; +import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; + +/** + * @Author sun + * @Description 指标统计服务 + */ +public interface EvaluationIndexService { + + /** + * @Param formDTO + * @Description 治理实况-组织/网格下响应解决满意自治率 + * @author sun + */ + GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java new file mode 100644 index 0000000000..bec7bafd90 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/impl/EvaluationIndexServiceImpl.java @@ -0,0 +1,40 @@ +package com.epmet.dataaggre.service.evaluationindex.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.datastats.DataStatsDao; +import com.epmet.dataaggre.dao.evaluationindex.EvaluationIndexDao; +import com.epmet.dataaggre.dto.datastats.form.GovrnRatioFormDTO; +import com.epmet.dataaggre.dto.datastats.result.GovrnRatioResultDTO; +import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.text.SimpleDateFormat; +import java.util.Date; + +/** + * @Author sun + * @Description 指标统计服务 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Slf4j +public class EvaluationIndexServiceImpl implements EvaluationIndexService { + @Autowired + private EvaluationIndexDao evaluationIndexDao; + + /** + * @Param formDTO + * @Description 按类型、日期查询治理指数下响应解决满意自治四个统计率 + * @author sun + */ + @Override + public GovrnRatioResultDTO governRatio(GovrnRatioFormDTO formDTO) { + return evaluationIndexDao.getAgnecyOrGridGoverRatio(formDTO.getOrgId(),formDTO.getOrgType(),formDTO.getDateId()); + } + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java index 7d9fc8f339..916044b1f3 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/GovOrgService.java @@ -5,6 +5,7 @@ import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.dto.govorg.result.NextAreaCodeResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import java.util.List; @@ -45,4 +46,6 @@ public interface GovOrgService { String getAgencyIdByUserId(String userId); List queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO); + + List queryNextOrgInfoDTO(String customerId, String orgId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index b09414f1bd..ec45f0419f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.dataaggre.dto.govorg.result.AgencyGridResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridInfoResultDTO; import com.epmet.dataaggre.dto.govorg.result.GridsInfoListResultDTO; import com.epmet.dataaggre.dto.govorg.result.NextAreaCodeResultDTO; +import com.epmet.dataaggre.dto.resigroup.result.OrgInfoCommonDTO; import com.epmet.dataaggre.entity.govorg.CustomerAgencyEntity; import com.epmet.dataaggre.service.commonservice.AreaCodeService; import com.epmet.dataaggre.service.govorg.GovOrgService; @@ -162,6 +163,33 @@ public class GovOrgServiceImpl implements GovOrgService { return allList; } + @Override + public List queryNextOrgInfoDTO(String customerId, String orgId) { + List result=new ArrayList<>(); + List customerAgencyEntityList = customerAgencyDao.selectNextAgency(customerId, orgId); + if(CollectionUtils.isNotEmpty(customerAgencyEntityList)){ + customerAgencyEntityList.forEach(agencyEntity->{ + OrgInfoCommonDTO agecnyInfo=new OrgInfoCommonDTO(); + agecnyInfo.setOrgId(agencyEntity.getId()); + agecnyInfo.setOrgName(agencyEntity.getOrganizationName()); + agecnyInfo.setOrgType("agency"); + result.add(agecnyInfo); + }); + return result; + } + List gridInfoResultDTOList=customerGridDao.selectGridListByAgencyId(orgId); + if(CollectionUtils.isNotEmpty(gridInfoResultDTOList)){ + gridInfoResultDTOList.forEach(grid->{ + OrgInfoCommonDTO gridInfo=new OrgInfoCommonDTO(); + gridInfo.setOrgId(grid.getGridId()); + gridInfo.setOrgName(grid.getGridName()); + gridInfo.setOrgType("grid"); + result.add(gridInfo); + }); + } + return result; + } + public static void main(String[] args) { List allList = new ArrayList<>(); NextAreaCodeResultDTO m1 = new NextAreaCodeResultDTO(); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java index abc34e5c5c..d48c31f2d7 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govproject/impl/GovProjectServiceImpl.java @@ -116,10 +116,10 @@ public class GovProjectServiceImpl implements GovProjectService { List resultDTOList = new ArrayList<>(); List issueInfoDTOList = govIssueService.selectShiftProjectIssueList(formDTO.getCustomerId(), formDTO.getGridId(),formDTO.getPageNo(),formDTO.getPageSize()); if (CollectionUtils.isNotEmpty(issueInfoDTOList)) { - List topicIds = issueInfoDTOList.stream().map(data -> data.getTopicId()).collect(Collectors.toList()); + List topicIds = issueInfoDTOList.stream().map(IssueInfoDTO::getTopicId).collect(Collectors.toList()); // log.info("话题id集合:" + JSON.toJSONString(topicIds, true)); List topicInfoDTOList = resiGroupService.selectTopicInfoByIds(topicIds); - List issueIds = issueInfoDTOList.stream().map(data -> data.getIssueId()).collect(Collectors.toList()); + List issueIds = issueInfoDTOList.stream().map(IssueInfoDTO::getIssueId).collect(Collectors.toList()); // log.info("议题id集合:" + JSON.toJSONString(issueIds, true)); resultDTOList = projectDao.selectList(formDTO.getCustomerId(),issueIds); for (ProjectDistributionResultDTO project : resultDTOList) { diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java index 5b163c4f5d..68f4afb4ee 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/ResiGroupService.java @@ -1,9 +1,9 @@ package com.epmet.dataaggre.service.resigroup; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; -import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; -import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; -import org.apache.ibatis.annotations.Param; +import com.epmet.dataaggre.dto.resigroup.form.*; +import com.epmet.dataaggre.dto.resigroup.result.*; import java.util.List; @@ -20,4 +20,45 @@ public interface ResiGroupService { */ List candidateList(CandidateListFormDTO formDTO); List selectTopicInfoByIds(List topicIds); + + /** + * 001、【支建+联建】统计分析 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.BranchConAnalysisResultDTO + */ + BranchConAnalysisResultDTO branchConAnalysis(BranchConAnalysisFormDTO formDTO); + + /** + * 002、【支建+联建】二级分类字典查询 + * + * @param customerId + * @param firstCategoryCode + * @return com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO + */ + List queryActCategoryDictList(String customerId, String firstCategoryCode); + + /** + * 003、【支建+联建】下级组织折线图 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.DataCommonDTO + */ + List querySubAnalysisByCode(SubAnalysisByCodeFormDTO formDTO); + + /** + * 004、【支建+联建】排序方式下拉框 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO + */ + List queryRankCodeList(GroupActCategoryQueryFormDTO formDTO); + + /** + * 005、【支建+联建】下级组织排行列表 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO + */ + List querySubRankList(GroupActRankFormDTO formDTO); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java index 253d42f78b..a2f853dd2f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/resigroup/impl/ResiGroupServiceImpl.java @@ -1,17 +1,23 @@ package com.epmet.dataaggre.service.resigroup.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.resigroup.ResiGroupDao; import com.epmet.dataaggre.dao.resigroup.ResiTopicDao; +import com.epmet.dataaggre.dto.datastats.FactGroupActDailyDTO; import com.epmet.dataaggre.dto.epmetuser.result.UserInfosResultDTO; -import com.epmet.dataaggre.dto.resigroup.ResiGroupDTO; +import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.ResiTopicDTO; -import com.epmet.dataaggre.dto.resigroup.form.CandidateListFormDTO; -import com.epmet.dataaggre.dto.resigroup.result.CandidateListResultDTO; +import com.epmet.dataaggre.dto.resigroup.form.*; +import com.epmet.dataaggre.dto.resigroup.result.*; import com.epmet.dataaggre.entity.resigroup.ResiGroupEntity; import com.epmet.dataaggre.redis.ResiGroupRedis; +import com.epmet.dataaggre.service.datastats.DataStatsService; import com.epmet.dataaggre.service.epmetuser.EpmetUserService; +import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.resigroup.ResiGroupService; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -19,9 +25,12 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import org.springframework.util.StringUtils; import java.util.ArrayList; +import java.util.Comparator; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; /** @@ -40,6 +49,10 @@ public class ResiGroupServiceImpl implements ResiGroupService { private EpmetUserService epmetUserService; @Autowired private ResiGroupRedis resiGroupRedis; + @Autowired + private DataStatsService dataStatsService; + @Autowired + private GovOrgService govOrgService; @Override public List selectTopicInfoByIds(List topicIds) { @@ -92,4 +105,243 @@ public class ResiGroupServiceImpl implements ResiGroupService { showUsers.forEach(u -> result.stream().filter(r -> u.equals(r.getUserId())).forEach(r -> disResult.add(r))); return disResult; } + + + /** + * 001、【支建+联建】统计分析 + * + * @param formDTO + * @return Result + */ + @Override + public BranchConAnalysisResultDTO branchConAnalysis(BranchConAnalysisFormDTO formDTO) { + List categoryList = queryActCategoryDictList(formDTO.getCustomerId(), formDTO.getFirstCategoryCode()); + if (CollectionUtils.isEmpty(categoryList)) { + return new BranchConAnalysisResultDTO(); + } + String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + List factGroupActDailyDTOList = dataStatsService.branchConAnalysis(formDTO.getCustomerId(), formDTO.getOrgId(), formDTO.getOrgType(), + dateId, formDTO.getFirstCategoryCode()); + /** + * List -> Map + * 需要注意的是: + * toMap 如果集合对象有重复的key,会报错Duplicate key .... * apple1,apple12的id都为1。 + * 可以用 (k1,k2)->k1 来设置,如果有重复的key,则保留key1,舍弃key2 + */ + Map map = factGroupActDailyDTOList.stream().collect(Collectors.toMap(FactGroupActDailyDTO::getCategoryCode, a -> a,(k1,k2)->k1)); + + // 组织活动次数 + int organizeTotal=0; + // 参加活动人数 + int participateUserTotal=0; + List dataList=new ArrayList<>(); + + for (ActCategoryDictDTO categoryDictDTO : categoryList) { + + BranchConAnalysisDetailDTO participateUserTotalObject=new BranchConAnalysisDetailDTO(); + participateUserTotalObject.setName(categoryDictDTO.getCategoryName()); + participateUserTotalObject.setType("参加人数"); + participateUserTotalObject.setCategoryCode(categoryDictDTO.getCategoryCode()); + + BranchConAnalysisDetailDTO organizeTotalObject=new BranchConAnalysisDetailDTO(); + organizeTotalObject.setName(categoryDictDTO.getCategoryName()); + organizeTotalObject.setType("组织次数"); + organizeTotalObject.setCategoryCode(categoryDictDTO.getCategoryCode()); + + + /*DataCommonDTO avgParticipateUserTotalObject=new DataCommonDTO(); + avgParticipateUserTotalObject.setName(categoryDictDTO.getCategoryName()); + avgParticipateUserTotalObject.setType("平均参加人数");*/ + + if (map.containsKey(categoryDictDTO.getCategoryCode())) { + + participateUserTotalObject.setValue(map.get(categoryDictDTO.getCategoryCode()).getParticipateUserTotal()); + organizeTotalObject.setValue(map.get(categoryDictDTO.getCategoryCode()).getOrganizeTotal()); + // avgParticipateUserTotalObject.setValue(map.get(categoryDictDTO.getCategoryCode()).getAvgParticipateUserTotal()); + participateUserTotalObject.setAvg(map.get(categoryDictDTO.getCategoryCode()).getAvgParticipateUserTotal()); + organizeTotalObject.setAvg(map.get(categoryDictDTO.getCategoryCode()).getAvgParticipateUserTotal()); + + + organizeTotal += map.get(categoryDictDTO.getCategoryCode()).getOrganizeTotal(); + participateUserTotal += map.get(categoryDictDTO.getCategoryCode()).getParticipateUserTotal(); + + } else { + participateUserTotalObject.setValue(NumConstant.ZERO); + organizeTotalObject.setValue(NumConstant.ZERO); + participateUserTotalObject.setAvg(NumConstant.ZERO); + organizeTotalObject.setAvg(NumConstant.ZERO); + // avgParticipateUserTotalObject.setValue(NumConstant.ZERO); + } + dataList.add(participateUserTotalObject); + dataList.add(organizeTotalObject); + // dataList.add(avgParticipateUserTotalObject); + } + BranchConAnalysisResultDTO resultDTO = new BranchConAnalysisResultDTO(); + resultDTO.setOrganizeTotal(organizeTotal); + resultDTO.setParticipateUserTotal(participateUserTotal); + resultDTO.setDataList(dataList); + return resultDTO; + } + + @Override + public List queryActCategoryDictList(String customerId, String firstCategoryCode) { + List categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(customerId,firstCategoryCode); + if(CollectionUtils.isEmpty(categoryList)){ + categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(Constant.DEFAULT_CUSTOMER,firstCategoryCode); + } + return categoryList; + } + + /** + * 003、【支建+联建】下级组织折线图 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.SubAnalysisByCodeResultDTO + */ + @Override + public List querySubAnalysisByCode(SubAnalysisByCodeFormDTO formDTO) { + List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId()); + if (CollectionUtils.isEmpty(orgInfoDTOList)) { + return new ArrayList<>(); + } + + String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + List factGroupActDailyDTOList = dataStatsService.querySubAnalysisByCode(formDTO.getCustomerId(), formDTO.getOrgId(), + dateId, formDTO.getCategoryCode()); + Map map = factGroupActDailyDTOList.stream().collect(Collectors.toMap(FactGroupActDailyDTO::getOrgId, a -> a, (k1, k2) -> k1)); + List resultList = new ArrayList<>(); + for (OrgInfoCommonDTO orgInfo : orgInfoDTOList) { + + SubAnalysisByCodeResultDTO participateUserTotalObject=new SubAnalysisByCodeResultDTO(); + participateUserTotalObject.setName(orgInfo.getOrgName()); + participateUserTotalObject.setType("参加人数"); + participateUserTotalObject.setOrgId(orgInfo.getOrgId()); + + SubAnalysisByCodeResultDTO organizeTotalObject=new SubAnalysisByCodeResultDTO(); + organizeTotalObject.setName(orgInfo.getOrgName()); + organizeTotalObject.setType("组织次数"); + organizeTotalObject.setOrgId(orgInfo.getOrgId()); + + + SubAnalysisByCodeResultDTO avgParticipateUserTotalObject=new SubAnalysisByCodeResultDTO(); + avgParticipateUserTotalObject.setName(orgInfo.getOrgName()); + avgParticipateUserTotalObject.setType("平均参加人数"); + avgParticipateUserTotalObject.setOrgId(orgInfo.getOrgId()); + + if (map.containsKey(orgInfo.getOrgId())) { + participateUserTotalObject.setValue(map.get(orgInfo.getOrgId()).getParticipateUserTotal()); + organizeTotalObject.setValue(map.get(orgInfo.getOrgId()).getOrganizeTotal()); + avgParticipateUserTotalObject.setValue(map.get(orgInfo.getOrgId()).getAvgParticipateUserTotal()); + } else { + participateUserTotalObject.setValue(NumConstant.ZERO); + organizeTotalObject.setValue(NumConstant.ZERO); + avgParticipateUserTotalObject.setValue(NumConstant.ZERO); + } + resultList.add(participateUserTotalObject); + resultList.add(organizeTotalObject); + resultList.add(avgParticipateUserTotalObject); + + } + return resultList; + } + + /** + * 004、【支建+联建】排序方式下拉框 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.RankCodeResultDTO + */ + @Override + public List queryRankCodeList(GroupActCategoryQueryFormDTO formDTO) { + List resultList=new ArrayList<>(); + RankCodeResultDTO defaultResult=new RankCodeResultDTO(); + defaultResult.setRankCode("orgtotal"); + defaultResult.setRankName("组织活动总次数"); + resultList.add(defaultResult); + List categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(formDTO.getCustomerId(),formDTO.getFirstCategoryCode()); + if(CollectionUtils.isEmpty(categoryList)){ + categoryList=resiGroupDao.selectActCategoryDictDTOByPcode(Constant.DEFAULT_CUSTOMER,formDTO.getFirstCategoryCode()); + } + categoryList.forEach(category->{ + RankCodeResultDTO result=new RankCodeResultDTO(); + result.setRankCode(category.getCategoryCode()); + result.setRankName(category.getCategoryName().concat("-组织次数")); + resultList.add(result); + }); + return resultList; + } + + /** + * 005、【支建+联建】下级组织排行列表 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.resigroup.result.GroupActRankResultDTO + */ + @Override + public List querySubRankList(GroupActRankFormDTO formDTO) { + List orgInfoDTOList = govOrgService.queryNextOrgInfoDTO(formDTO.getCustomerId(), formDTO.getOrgId()); + if (CollectionUtils.isEmpty(orgInfoDTOList)) { + return new ArrayList<>(); + } + List resultDTOList=new ArrayList<>(); + String dateId = DateUtils.getBeforeNDay(NumConstant.ONE); + // 1、根据以及编码查询出二级编码列表 + List actCategoryDictDTOList=queryActCategoryDictList(formDTO.getCustomerId(),formDTO.getFirstCategoryCode()); + for(OrgInfoCommonDTO orgInfo:orgInfoDTOList){ + GroupActRankResultDTO resultDTO=new GroupActRankResultDTO(); + resultDTO.setOrgId(orgInfo.getOrgId()); + resultDTO.setOrgName(orgInfo.getOrgName()); + resultDTO.setOrgType(orgInfo.getOrgType()); + if(!CollectionUtils.isEmpty(actCategoryDictDTOList)){ + + List detailList=new ArrayList<>(); + List detailRecords=dataStatsService.selectGroupActRankDetail(formDTO.getCustomerId(),dateId,orgInfo.getOrgId(),actCategoryDictDTOList); + Map map = detailRecords.stream().collect(Collectors.toMap(GroupActRankDetailDTO::getCategoryCode, a -> a, (k1, k2) -> k1)); + + for(ActCategoryDictDTO actCategoryDictDTO:actCategoryDictDTOList){ + GroupActRankDetailDTO temp=new GroupActRankDetailDTO(); + temp.setCategoryCode(actCategoryDictDTO.getCategoryCode()); + temp.setCategoryName(actCategoryDictDTO.getCategoryName()); + temp.setOrganizeName("组织总次数"); + temp.setParticipateUserName("参加总人数"); + if(map.containsKey(actCategoryDictDTO.getCategoryCode())){ + temp.setOrganizeTotal(map.get(actCategoryDictDTO.getCategoryCode()).getOrganizeTotal()); + temp.setParticipateUserTotal(map.get(actCategoryDictDTO.getCategoryCode()).getParticipateUserTotal()); + }else{ + temp.setOrganizeTotal(NumConstant.ZERO); + temp.setParticipateUserTotal(NumConstant.ZERO); + } + detailList.add(temp); + } + resultDTO.setCategoryList(detailList); + + int organizeTotal = NumConstant.ZERO; + int participateUserTotal = NumConstant.ZERO; + for(GroupActRankDetailDTO deatil:detailList){ + organizeTotal+=deatil.getOrganizeTotal(); + participateUserTotal+=deatil.getParticipateUserTotal(); + } + resultDTO.setOrganizeTotal(organizeTotal); + resultDTO.setParticipateUserTotal(participateUserTotal); + + } + resultDTOList.add(resultDTO); + } + + if(StringUtils.isEmpty(formDTO.getRankCode())||"orgtotal".equals(formDTO.getRankCode())){ + //按照 组织总次数降序排列 + resultDTOList.sort(Comparator.comparing(GroupActRankResultDTO::getOrganizeTotal).reversed()); + }else{ + resultDTOList.forEach(m->{ + for(GroupActRankDetailDTO categoryDto:m.getCategoryList()){ + if(formDTO.getRankCode().equals(categoryDto.getCategoryCode())){ + m.setSortValue(categoryDto.getOrganizeTotal()); + break; + } + } + }); + resultDTOList.sort(Comparator.comparing(GroupActRankResultDTO::getSortValue).reversed()); + } + return resultDTOList; + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml index 6e27140e97..ab888fc91c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/bootstrap.yml @@ -129,6 +129,16 @@ dynamic: url: @datasource.druid.opercrm.url@ username: @datasource.druid.opercrm.username@ password: @datasource.druid.opercrm.password@ + datastatistical: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.stats.url@ + username: @datasource.druid.stats.username@ + password: @datasource.druid.stats.password@ + evaluationIndex: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.evaluationIndex.url@ + username: @datasource.druid.evaluationIndex.username@ + password: @datasource.druid.evaluationIndex.password@ feign: hystrix: enabled: true diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml new file mode 100644 index 0000000000..fb5757da88 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -0,0 +1,657 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml new file mode 100644 index 0000000000..a0c2e0c245 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/evaluationindex/EvaluationIndexDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml index fda4f7245c..3033937191 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerAgencyDao.xml @@ -31,4 +31,18 @@ ca.DEL_FLAG = '0' AND ca.PARENT_AREA_CODE = #{parentAreaCode} + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml index 8a350ceec9..1549b66d21 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/resigroup/ResiGroupDao.xml @@ -15,4 +15,17 @@ AND rgm.GROUP_LEADER_FLAG != 'leader' AND rgm.RESI_GROUP_ID = #{groupId} + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java new file mode 100644 index 0000000000..d48084d3df --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainDTO.java @@ -0,0 +1,117 @@ +/** + * 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.evaluationindex.index.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 指标code + */ + private String indexCode; + + /** + * 含义 + */ + private String meaning; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 父ID + */ + private String pid; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否需要查询;1有;0:无; + */ + private Integer isSearch; + + /** + * 数据类型:none;本级:self;下级:sub + */ + private String type; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.java new file mode 100644 index 0000000000..d812953500 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/dto/IndexExplainTreeDTO.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.evaluationindex.index.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainTreeDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 标题 + */ + private String title; + + /** + * 含义 + */ + private String meaning; + + /** + * 指标code + */ + private String indexCode; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 父ID + */ + private String pid; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否需要查询;1有;0:无; + */ + private Integer isSearch; + + /** + * 数据类型:none;本级:self;下级:sub + */ + private String type; + + /** + * 子节点 + */ + List children; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java new file mode 100644 index 0000000000..b97139c8ff --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexExplainFormDTO.java @@ -0,0 +1,58 @@ +/** + * 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.evaluationindex.index.form; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 指标说明文案查询参数 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class IndexExplainFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 客户id + */ + private String customerId; + + /** + * 组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province) + */ + private String orgLevel; + + /** + * 组织id + */ + private String orgId; + /** + * 月份Id + */ + private String monthId; + + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java new file mode 100644 index 0000000000..f2f7f98a01 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/form/IndexScoreFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.evaluationindex.index.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 指标分数 返回结果 + * @Author sun + */ +@Data +public class IndexScoreFormDTO implements Serializable { + + + private static final long serialVersionUID = 6225580299239889980L; + + private String customerId; + /** + * 组织或网格Id + */ + private String orgId; + /** + * 组织或网格类型 + */ + private String orgType; + + /** + * 月份Id(格式:202009) + */ + private String monthId; + /** + * 类型(党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;) + */ + private String indexCode; + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + /** + * pid + */ + private String pid; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java new file mode 100644 index 0000000000..261c8b775d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainChildResult.java @@ -0,0 +1,25 @@ +package com.epmet.evaluationindex.index.result; + +import com.epmet.evaluationindex.index.dto.IndexExplainDTO; +import lombok.Data; + +import java.util.List; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexExplainChildResult extends IndexExplainDTO { + + private static final long serialVersionUID = -3997821113617472317L; + + + + + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java new file mode 100644 index 0000000000..1ade73b168 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexExplainResult.java @@ -0,0 +1,53 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexExplainResult { + + /** + * 标题 + */ + private String title; + + /** + * 含义 + */ + private String meaning; + + /** + * 子节点 list + */ + private List children = new ArrayList<>(); + + /** + * 子节点data list + */ + private List tableDataList = new ArrayList<>(); + /** + * 子节点标题 list + */ + private List tableTileList = new ArrayList<>(); + + /** + * 阈值说明列表 + */ + private List thresholdList = new ArrayList<>(); + + /** + * 表格说明 + */ + private String tableDesc; + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.java new file mode 100644 index 0000000000..170aed8ec9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexGroupDetailResult.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.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data + +public class IndexGroupDetailResult implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 指标名称 + */ + private String indexName; + + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 + */ + private BigDecimal threshold; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java new file mode 100644 index 0000000000..cdec4cc3e9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreDetailResult.java @@ -0,0 +1,51 @@ +package com.epmet.evaluationindex.index.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:得分明细说明结果类 + * + * @author: LiuJanJun + * @date: 2021/5/12 4:19 下午 + * @version: 1.0 + */ +@Data +public class IndexScoreDetailResult implements Serializable { + + private static final long serialVersionUID = -3997821113617472317L; + /** + * 指标code + */ + private String indexCode; + /** + * 指标名称 + */ + private String indexName; + + /** + * 原始值(如果是平均分的话 则为 参与平均的个数) + */ + private String originValue; + + /** + * 分值 + */ + private String score; + + /** + * 分值 + */ + private String weight; + + /** + * 类型 取原始值 还是数量 + */ + @JsonIgnore + private String type; + + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java new file mode 100644 index 0000000000..d6ca46a913 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/index/result/IndexScoreResult.java @@ -0,0 +1,46 @@ +package com.epmet.evaluationindex.index.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 指标分数 返回结果 + * @Author sun + */ +@Data +public class IndexScoreResult implements Serializable { + + + private static final long serialVersionUID = -8458272574625683349L; + /** + * 指标code + */ + private String indexCode; + /** + * 指标对应值(数值或百分比)原始值 + */ + private BigDecimal score; + + /** + * 指标对应的权重 + */ + private BigDecimal weight; + + /** + * 原始值 + */ + private String originValue; + + /** + * 数量 + */ + private String sampleCount; + + /** + * 值类型 + */ + private String valueType; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java index a6e5ecb9b3..27f638f3d2 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/AdvancedBranchRankFormDTO.java @@ -27,5 +27,10 @@ public class AdvancedBranchRankFormDTO implements Serializable { * 月份Id * */ private String monthId; + + /** + * 组织类型 agency grid + */ + private String orgType; public interface AddUserInternalGroup {} } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java new file mode 100644 index 0000000000..5e4d3e9cc4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/PartyPointRankFormDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.form; + + +import lombok.Data; + +import javax.validation.constraints.Min; +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 党员(积分)排行--接口入参 + * @Author sun + */ +@Data +public class PartyPointRankFormDTO implements Serializable { + private static final long serialVersionUID = -2880432640584616651L; + /** + * 组织或网格Id + */ + @NotBlank(message = "组织或网格ID不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class}) + private String orgId; + /** + * 类型(组织:agency 网格:grid) + */ + @NotBlank(message = "数据类型不能为空",groups = {PartyPointRankFormDTO.AddUserInternalGroup.class}) + private String orgType; + /** + * 默认显示前5名 + */ + @Min(value = 1, message = "查询条数必须大于0", groups = {PartyPointRankFormDTO.AddUserInternalGroup.class }) + private Integer topNum; + public interface AddUserInternalGroup {} + + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java index 2c8c7b6d00..d25c99c678 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/AblityListResultDTO.java @@ -36,6 +36,13 @@ public class AblityListResultDTO implements Serializable { */ private BigDecimal weight; + /** + * 原始分数 + */ private Double score; + /** + * 加权分数(乘以权重后得分) + */ + private BigDecimal weightedScore; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java index 196837f220..bf3670b11f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexDictResultDTO.java @@ -3,7 +3,6 @@ package com.epmet.evaluationindex.screen.dto.result; import lombok.Data; import java.io.Serializable; -import java.util.List; /** * 评价指标字典表数据--接口返参 @@ -18,6 +17,10 @@ public class IndexDictResultDTO implements Serializable { * 指标名 */ private String indexName; + /** + * 指标名 + */ + private String indexDesc; /** * 指标code */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java index 33ffff9c5d..4f145e3d8a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/IndexScoreResultDTO.java @@ -26,7 +26,14 @@ public class IndexScoreResultDTO implements Serializable { */ @JsonIgnore private String party; + /** + * 党建能力 乘以权重后得分 + */ private BigDecimal partyDevAbility; + /** + * 党建能力 原始得分 + */ + private BigDecimal partyOriginScore; /** * 党建能力权重(保留一位小数) */ @@ -36,7 +43,14 @@ public class IndexScoreResultDTO implements Serializable { */ @JsonIgnore private String govern; + /** + * 治理能力 乘以权重后得分 + */ private BigDecimal governAbility; + /** + * 治理能力 原始得分 + */ + private BigDecimal governOriginScore; /** * 治理能力权重(保留一位小数) */ @@ -46,7 +60,14 @@ public class IndexScoreResultDTO implements Serializable { */ @JsonIgnore private String service; + /** + * 服务能力 乘以权重后得分 + */ private BigDecimal serviceAbility; + /** + * 服务能力 原始得分 + */ + private BigDecimal serviceOriginScore; /** * 服务能力权重(保留一位小数) */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java new file mode 100644 index 0000000000..c6a11b1ea3 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/PartyPointRankResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +@Data +public class PartyPointRankResultDTO { + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名称 + */ + private String agencyName; + /** + * 用户Id + */ + private String userId; + /** + * 用户名称 + */ + private String userName; + /** + * 网格Id + */ + private String gridId; + /** + * 网格名称 + */ + private String gridName; + /** + * 党员积分 + */ + private Double pointTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java index c72c561c07..94e4f20546 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/UserJoinIndicatorGrowthRateResultDTO.java @@ -15,6 +15,8 @@ import java.math.BigDecimal; public class UserJoinIndicatorGrowthRateResultDTO implements Serializable { private static final long serialVersionUID = -8830240350298414599L; + private String id; + private Integer total; private BigDecimal monthIncr; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java new file mode 100644 index 0000000000..e6a4b3bfac --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/constant/IndexConstant.java @@ -0,0 +1,85 @@ +package com.epmet.datareport.constant; + +import org.apache.commons.lang3.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author sun + * @dscription 数据 + */ +public class IndexConstant { + + /** + * 评价指标类型-百分比 + */ + public static final List ScoreLastHeader = Arrays.asList("指标值", "得分", "权重"); + public static final List QuantityLastHeader = Arrays.asList("数量", "平均值", "权重"); + + public static final String DJZS_CN = "党建指数"; + public static final String FWZS_CN = "服务指数"; + public static final String ZLZS_CN = "治理指数"; + public static final String ZB_CN = "指标"; + public static final String BEN_JI_CN = "本级"; + public static final String XIA_JI_CN = "下级"; + + public static final String ZI_SHEN = "zishen"; + public static final String XIA_JI = "xiaji"; + public static final String THRESHOLD_TEXT = "给定阈值%d%%,超过阈值不加分"; + public static final String TABLE_DESC = "详见下表:"; + public static final String INDEX_SCORE_TITLE = "当月指数"; + public static final String INDEX_SCORE_DESC = "含义:自然月周期内,当月指数得分=党建指数得分*相关权重+治理指数得分*相关权重+服务指数得分*相关权重"; + public static final String INDEX_DISTRINCT_TABLE1_INDEX_CODE = "suoyoujiedaozlnlpjz"; + public static final String ZHI_LI_NENG_LI = "zhilinengli"; + public static final String PATTERN_D = "d"; + public static final String QUAN_QU_ZHI_LI_INDEX_CODE = "quanquxiangguan:zhilinengli"; + + + /** + * desc: 根据indexCode 获取表格表头 + * + * @param allIndexCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 11:06 上午 + */ + public static List getStandardSelfHeaders(String allIndexCode) { + List result = new ArrayList<>(8); + if (StringUtils.isBlank(allIndexCode)) { + return null; + } + + if (allIndexCode.contains(FactConstant.DJNL)) { + result.add(BEN_JI_CN + DJZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.FWNL)) { + result.add(BEN_JI_CN + FWZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.ZLNL)) { + result.add(BEN_JI_CN + ZLZS_CN + ZB_CN); + } + result.addAll(ScoreLastHeader); + return result; + } + + /** + * desc: 根据indexCode 获取表格表头 + * + * @param allIndexCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 11:06 上午 + */ + public static List getStandardSubHeaders(String allIndexCode) { + List result = new ArrayList<>(8); + if (allIndexCode.contains(FactConstant.DJNL)) { + result.add(XIA_JI_CN + DJZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.FWNL)) { + result.add(XIA_JI_CN + FWZS_CN + ZB_CN); + } else if (allIndexCode.contains(FactConstant.ZLNL)) { + result.add(XIA_JI_CN + ZLZS_CN + ZB_CN); + } + result.addAll(QuantityLastHeader); + return result; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java new file mode 100644 index 0000000000..abac68a416 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/index/IndexExplainController.java @@ -0,0 +1,77 @@ +/** + * 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.controller.index; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; +import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@RestController +@RequestMapping("indexexplain") +public class IndexExplainController { + + @Autowired + private IndexExplainService indexExplainService; + + + /** + * desc: 获取得分说明明细 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/5/12 4:12 下午 + */ + @PostMapping("detail") + public Result> getScoreDetail(@RequestBody IndexExplainFormDTO formDTO){ + Result> ok = new Result>().ok(indexExplainService.getScoreDetail(formDTO)); + return ok; + } + + /** + * desc: 指标字典项 + * + * @param formDTO + * @author LiuJanJun + * @date 2021/5/12 4:12 下午 + */ + @PostMapping("indexdict") + public Result getIndexMeaning(@RequestBody IndexScoreFormDTO formDTO){ + IndexDictResultDTO result = indexExplainService.getIndexMeaning(formDTO); + return new Result().ok(result); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java index 84d586306f..9add2dd4d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenUserController.java @@ -1,13 +1,13 @@ package com.epmet.datareport.controller.screen; -import com.epmet.commons.tools.annotation.LoginUser; -import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -40,6 +40,18 @@ public class ScreenUserController { return new Result>().ok(screenUserService.userPointRank(formDTO)); } + /** + * 热心市民积分排行列表(不包含党员) + * @param formDTO + * @return + * @author wxz + */ + @PostMapping("userpointrank/withoutpartymember") + public Result> userPointRankWithoutPartyMem(@RequestBody UserPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, UserPointRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.userPointRankWithoutPartyMem(formDTO)); + } + /** * @param formDTO * @Description 党员(指标得分)排行 @@ -52,5 +64,17 @@ public class ScreenUserController { } + /** + * @param formDTO + * @Description 党员(积分)排行 + * @author wxz + */ + @PostMapping("partypointrank") + public Result> partyPointRank(@RequestBody PartyPointRankFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, PartIndexScroeRankFormDTO.AddUserInternalGroup.class); + return new Result>().ok(screenUserService.partyPointRank(formDTO)); + } + + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java new file mode 100644 index 0000000000..64fc30bac1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexExplainDao.java @@ -0,0 +1,36 @@ +/** + * 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.evaluationindex.index; + +import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; +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 2021-05-12 + */ +@Mapper +public interface IndexExplainDao { + + List getIndexExplainTreeByOrgType(@Param("orgLevel") String orgLevel); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java new file mode 100644 index 0000000000..31a4dd6030 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDao.java @@ -0,0 +1,33 @@ +/** + * 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.evaluationindex.index; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.IndexGroupEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexGroupDao extends BaseDao { + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java new file mode 100644 index 0000000000..06cfac4493 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/index/IndexGroupDetailDao.java @@ -0,0 +1,45 @@ +/** + * 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.evaluationindex.index; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.IndexGroupDetailEntity; +import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface IndexGroupDetailDao extends BaseDao { + + /** + * desc: 根据客户Id获取客户所有指标数据 + * + * @param customerId + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/13 2:41 下午 + */ + List getAllIndexByCId(String customerId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java index fe5adc1a77..9dff1c7f68 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenPartyUserRankDataDao.java @@ -19,11 +19,9 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.result.user.KcUserPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; -import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; -import com.epmet.evaluationindex.screen.dto.result.PartyUserPointResultDTO; -import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; -import com.epmet.evaluationindex.screen.dto.result.UserPointResultDTO; +import com.epmet.evaluationindex.screen.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -65,6 +63,13 @@ public interface ScreenPartyUserRankDataDao{ */ List selectAgencyUserPointList(UserPointRankFormDTO formDTO); + /** + * 查询组织下居民(不包含党员)积分排行,按积分值降序 + * @param formDTO + * @return + */ + List selectAgencyResiPointListWithoutPartyMem(UserPointRankFormDTO formDTO); + /** * @param formDTO * @Description 查询组织下党员的积分排行,按积分值降序 @@ -75,4 +80,11 @@ public interface ScreenPartyUserRankDataDao{ List selectPartymemberPointOrderByAreaCode(@Param("areaCode") String areaCode); List selectUserPointOrderByAreaCode(@Param("areaCode") String areaCode); + + /** + * 党员积分排行 + * @param formDTO + * @return + */ + List listPartymemberPointRank(PartyPointRankFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java index 0fd8e29c06..5347867afc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexAgencySubScoreDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; @@ -48,4 +50,6 @@ public interface FactIndexAgencySubScoreDao { * @author sun */ LinkedList selectMonthAblityList(MonthAblityListFormDTO formDTO); + + List selectSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java index 1689ab0b3c..5c38d0985e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCommunitySubScoreDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; @@ -48,4 +50,14 @@ public interface FactIndexCommunitySubScoreDao { * @author sun */ LinkedList selectCommunityMonthAblityList(MonthAblityListFormDTO formDTO); + + /** + * desc: 查询分数 + * + * @param ablityListFormDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/14 2:07 下午 + */ + List selectSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java new file mode 100644 index 0000000000..1bd10bd84c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcScoreDao.java @@ -0,0 +1,33 @@ +/** + * 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.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.FactIndexCpcScoreEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Mapper +public interface FactIndexCpcScoreDao extends BaseDao { + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java new file mode 100644 index 0000000000..cc59f410ba --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexCpcSubScoreDao.java @@ -0,0 +1,38 @@ +/** + * 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.fact; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.datareport.entity.evaluationindex.FactIndexCpcSubScoreEntity; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Mapper +public interface FactIndexCpcSubScoreDao extends BaseDao { + + List selecCpcAvgScore(IndexScoreFormDTO ablityListFormDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexDeptSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexDeptSubScoreDao.java new file mode 100644 index 0000000000..7d84dd87e7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexDeptSubScoreDao.java @@ -0,0 +1,36 @@ +/** + * 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.fact; + +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 部门相关分数表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-02 + */ +@Mapper +public interface FactIndexDeptSubScoreDao { + + List selecDeptAvgScore(IndexScoreFormDTO ablityListFormDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java index 8900171322..8a64352187 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/fact/FactIndexGridSubScoreDao.java @@ -17,6 +17,8 @@ package com.epmet.datareport.dao.fact; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexScoreResult; import com.epmet.evaluationindex.screen.dto.form.AblityListFormDTO; import com.epmet.evaluationindex.screen.dto.form.MonthAblityListFormDTO; import com.epmet.evaluationindex.screen.dto.result.AblityListResultDTO; @@ -48,4 +50,14 @@ public interface FactIndexGridSubScoreDao { * @author sun */ LinkedList selectGridMonthAblityList(MonthAblityListFormDTO formDTO); + + /** + * desc: 查询分数 + * + * @param ablityListFormDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/14 2:07 下午 + */ + List selectSubScore(IndexScoreFormDTO ablityListFormDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java new file mode 100644 index 0000000000..5a4455b069 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcScoreEntity.java @@ -0,0 +1,98 @@ +/** + * 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.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_score") +public class FactIndexCpcScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 1:总分;0不是 默认0 + */ + private String isTotal; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 参与议事分值:canyuyishi; +党务活动分值:dangwuhuodong; +联系群众分值:lianxiqunzhong; +党建能力分值:dangjiannengli + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java new file mode 100644 index 0000000000..737633648c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/FactIndexCpcSubScoreEntity.java @@ -0,0 +1,98 @@ +/** + * 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.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 党员相关分值 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_index_cpc_sub_score") +public class FactIndexCpcSubScoreEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 网格所属的机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + /** + * 年度ID: yyyy + */ + private String yearId; + + /** + * 月维度Id: yyyyMM + */ + private String monthId; + + /** + * 用户id + */ + private String userId; + + /** + * 计算指标时的原始值 字符串类型 + */ + private String originValue; + + /** + * 分值 + */ + private BigDecimal score; + + /** + * 参与议事分值:canyuyishi; +党务活动分值:dangwuhuodong; +联系群众分值:lianxiqunzhong; +党建能力分值:dangjiannengli + */ + private String indexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java new file mode 100644 index 0000000000..9e73f700a7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupDetailEntity.java @@ -0,0 +1,90 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 客户指标详情 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group_detail") +public class IndexGroupDetailEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * index_group.id + */ + private String indexGroupId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 所有有权重的指标code拼接的字符串 冒号隔开 + */ + private String allParentIndexCode; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + + /** + * 权重(同一组权重总和=1) + */ + private BigDecimal weight; + + /** + * 计算阈值,-1:没有阈值;如果是百分数则 为0.00几;如果为数据则直接填数值 + */ + private BigDecimal threshold; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 正相关:positive;负相关:negative + */ + private String correlation; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java new file mode 100644 index 0000000000..31716ee9ec --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/entity/evaluationindex/IndexGroupEntity.java @@ -0,0 +1,68 @@ +/** + * 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.entity.evaluationindex; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户指标分组 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("index_group") +public class IndexGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 指标id + */ + private String indexId; + + /** + * 指标code + */ + private String indexCode; + + /** + * 是否启用:启用:enable 禁用:disabled + */ + private String status; + + /** + * 当前指标关联的上一级指标分组,如果没有上一级,则为0 + */ + private String parentIndexGroupId; + + /** + * 所有指标code拼接的字符串 冒号隔开 + */ + private String allIndexCodePath; + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java new file mode 100644 index 0000000000..c028422cd4 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/IndexExplainService.java @@ -0,0 +1,54 @@ +/** + * 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.service.evaluationindex.index; + +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; +import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; + +import java.util.List; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface IndexExplainService { + + /** + * desc: 获取指标得分说明 + * + * @param formDTO + * @return java.util.List + * @author LiuJanJun + * @date 2021/5/12 4:38 下午 + */ + List getScoreDetail(IndexExplainFormDTO formDTO); + + /** + * desc: 条件获取指标 + * + * @param formDTO + * @return com.epmet.evaluationindex.index.result.IndexDictResultDTO + * @author LiuJanJun + * @date 2021/5/20 10:20 上午 + */ + IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java new file mode 100644 index 0000000000..572fb3b4b8 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/index/impl/IndexExplainServiceImpl.java @@ -0,0 +1,354 @@ +/** + * 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.service.evaluationindex.index.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.constant.FactConstant; +import com.epmet.datareport.constant.IndexConstant; +import com.epmet.datareport.dao.evaluationindex.index.IndexExplainDao; +import com.epmet.datareport.dao.evaluationindex.index.IndexGroupDetailDao; +import com.epmet.datareport.dao.fact.*; +import com.epmet.datareport.service.evaluationindex.index.IndexExplainService; +import com.epmet.evaluationindex.index.dto.IndexExplainTreeDTO; +import com.epmet.evaluationindex.index.form.IndexExplainFormDTO; +import com.epmet.evaluationindex.index.form.IndexScoreFormDTO; +import com.epmet.evaluationindex.index.result.IndexExplainResult; +import com.epmet.evaluationindex.index.result.IndexGroupDetailResult; +import com.epmet.evaluationindex.index.result.IndexScoreDetailResult; +import com.epmet.evaluationindex.index.result.IndexScoreResult; +import com.epmet.evaluationindex.screen.dto.result.IndexDictResultDTO; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * 指标说明文案 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class IndexExplainServiceImpl implements IndexExplainService { + @Autowired + private IndexDictDao indexDictDao; + @Autowired + private IndexExplainDao indexExplainDao; + @Autowired + private IndexGroupDetailDao indexGroupDetailDao; + @Autowired + private FactIndexGridSubScoreDao gridSubScoreDao; + @Autowired + private FactIndexCpcSubScoreDao factIndexCpcSubScoreDao; + @Autowired + private FactIndexCommunitySubScoreDao communitySubScoreDao; + @Autowired + private FactIndexAgencySubScoreDao agencySubScoreDao; + @Autowired + private FactIndexDeptSubScoreDao deptSubScoreDao; + + + @Override + public List getScoreDetail(IndexExplainFormDTO formDTO) { + List results = new ArrayList<>(); + IndexExplainResult first = new IndexExplainResult(); + first.setTitle(IndexConstant.INDEX_SCORE_TITLE); + first.setMeaning(IndexConstant.INDEX_SCORE_DESC); + results.add(first); + List explainDTOList = indexExplainDao.getIndexExplainTreeByOrgType(formDTO.getOrgLevel()); + if (CollectionUtils.isEmpty(explainDTOList)) { + return null; + } + List groupDetailEntities = indexGroupDetailDao.getAllIndexByCId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(groupDetailEntities)) { + return null; + } + + Map> detailEntityMap = groupDetailEntities.stream().collect(Collectors.groupingBy(IndexGroupDetailResult::getAllParentIndexCode)); + + for (IndexExplainTreeDTO explainDTO : explainDTOList) { + //根节点 + IndexExplainResult result = new IndexExplainResult(); + results.add(result); + result.setTitle(explainDTO.getTitle()); + result.setMeaning(explainDTO.getMeaning()); + + //全区相关的服务能力的含义中 有权重 所以特殊处理下 + if (explainDTO.getOrgLevel().equals(OrgLevelEnum.DISTRICT.getCode()) && IndexConstant.ZLZS_CN.equals(explainDTO.getTitle())) { + List detailResults = detailEntityMap.get(IndexConstant.QUAN_QU_ZHI_LI_INDEX_CODE); + detailResults.forEach(index -> { + String newMeaning = result.getMeaning().replaceFirst(IndexConstant.PATTERN_D, + index.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(NumConstant.ZERO, BigDecimal.ROUND_HALF_UP).toString()); + result.setMeaning(newMeaning); + }); + } + //设置表格数据 + setTableData(formDTO, detailEntityMap, explainDTO, result); + //子节点 + setChildren(formDTO, detailEntityMap, result, explainDTO, explainDTO.getChildren()); + } + + return results; + } + + @Override + public IndexDictResultDTO getIndexMeaning(IndexScoreFormDTO formDTO) { + return indexDictDao.selectIndexDict(formDTO.getIndexCode()); + } + + private void setTableData(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainTreeDTO explainDTO, IndexExplainResult result) { + if (NumConstant.ONE == explainDTO.getIsSearch()) { + List realScoreList = null; + + String type = explainDTO.getType(); + String orgLevel = formDTO.getOrgLevel(); + String allIndexCodePath = explainDTO.getIndexCode(); + + //设置表头 + List tableHeaders = getTableHeaders(type, allIndexCodePath, orgLevel); + result.setTableTileList(tableHeaders); + + IndexScoreFormDTO ablityListFormDTO = new IndexScoreFormDTO(); + ablityListFormDTO.setCustomerId(formDTO.getCustomerId()); + ablityListFormDTO.setOrgId(formDTO.getOrgId()); + ablityListFormDTO.setAllParentIndexCode(allIndexCodePath); + ablityListFormDTO.setMonthId(StringUtils.isBlank(formDTO.getMonthId()) ? DateUtils.getCurrentTimeBeforeMonthId() : formDTO.getMonthId()); + OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel); + switch (anEnum) { + case GRID: + if (IndexConstant.ZI_SHEN.equals(type)) { + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + //不下钻 + realScoreList = gridSubScoreDao.selectSubScore(ablityListFormDTO); + + + } else if (IndexConstant.XIA_JI.equals(type)) { + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + //下钻到党员 + realScoreList = factIndexCpcSubScoreDao.selecCpcAvgScore(ablityListFormDTO); + } + + break; + case COMMUNITY: + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + //不下钻 + realScoreList = communitySubScoreDao.selectSubScore(ablityListFormDTO); + break; + case STREET: + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + //不下钻 + realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); + break; + case DISTRICT: + if (allIndexCodePath.contains(IndexConstant.ZHI_LI_NENG_LI)) { + List detailResults = detailEntityMap.get(allIndexCodePath); + + List indexGroupDetailEntities = new ArrayList<>(); + for (IndexGroupDetailResult index : detailResults) { + if (IndexConstant.INDEX_DISTRINCT_TABLE1_INDEX_CODE.equals(index.getIndexCode())) { + indexGroupDetailEntities.add(index); + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, indexGroupDetailEntities); + //不下钻 + realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); + break; + } else { + //下钻到区直部门 + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + ablityListFormDTO.setPid(formDTO.getOrgId()); + realScoreList = deptSubScoreDao.selecDeptAvgScore(ablityListFormDTO); + } + } + } else { + setDefaultTableData(orgLevel, type, detailEntityMap, result, allIndexCodePath, null); + //不下钻 + realScoreList = agencySubScoreDao.selectSubScore(ablityListFormDTO); + } + + break; + default: + log.error("暂不支持更高级别的查询,level:{}", orgLevel); + } + + setRealValue(result.getTableDataList(), realScoreList, tableHeaders); + } + } + + /** + * desc: 设置实际值 + * + * @param tableList + * @param scoreList + * @param tableHeaders + * @return void + * @author LiuJanJun + * @date 2021/5/19 2:07 下午 + */ + private void setRealValue(List tableList, List scoreList, List tableHeaders) { + if (CollectionUtils.isEmpty(tableList) || CollectionUtils.isEmpty(scoreList)) { + return; + } + for (IndexScoreResult score : scoreList) { + for (IndexScoreDetailResult tb : tableList) { + if (!tb.getIndexCode().equals(score.getIndexCode())) { + continue; + } + tb.setScore(String.valueOf(score.getScore())); + tb.setWeight(score.getWeight().multiply(new BigDecimal(NumConstant.ONE_HUNDRED)).setScale(0, BigDecimal.ROUND_HALF_UP) + "%"); + if (tableHeaders.contains("平均值")) { + if (StringUtils.isNotBlank(score.getSampleCount())) { + tb.setOriginValue(score.getSampleCount()); + } + } else { + tb.setOriginValue(score.getOriginValue()); + formatOriginValue(score, tb); + } + } + } + } + + private void formatOriginValue(IndexScoreResult score, IndexScoreDetailResult index) { + //小数类型,四舍五入保留小数点后一位 + if (FactConstant.INTEGER.equals(score.getValueType())) { + BigDecimal num = new BigDecimal(index.getOriginValue()).setScale(0, BigDecimal.ROUND_HALF_UP); + index.setOriginValue(num.toString()); + } + if (FactConstant.DECIMAL.equals(score.getValueType())) { + BigDecimal num = new BigDecimal(index.getOriginValue()).setScale(1, BigDecimal.ROUND_HALF_UP); + index.setOriginValue(num.toString()); + } + //百分数类型,四舍五入保留小数点后一位并转成百分比 + if (FactConstant.PERCENT.equals(score.getValueType())) { + BigDecimal num = new BigDecimal(index.getOriginValue()).setScale(1, BigDecimal.ROUND_HALF_UP); + index.setOriginValue(num + "%"); + } + } + + private List setDefaultTableData(String orgLevel, String type, Map> detailEntityMap, + IndexExplainResult result, String allIndexCodePath, List indexGroupDetailEntities) { + if (indexGroupDetailEntities == null) { + indexGroupDetailEntities = detailEntityMap.get(allIndexCodePath); + } + if (CollectionUtils.isEmpty(indexGroupDetailEntities)) { + log.warn("setDefaultTableData allINdexCodePath:{} is config error", allIndexCodePath); + return null; + } + List tableList = new ArrayList<>(); + List threlodList = new ArrayList<>(); + indexGroupDetailEntities.forEach(index -> { + IndexScoreDetailResult table = new IndexScoreDetailResult(); + if (OrgLevelEnum.GRID.getCode().equals(orgLevel) && IndexConstant.ZI_SHEN.equals(type) && index.getAllIndexCodePath().contains(IndexConstant.XIA_JI)) { + return; + } + if (OrgLevelEnum.DISTRICT.getCode().equals(orgLevel) && !index.getAllIndexCodePath().contains(type) && !index.getAllIndexCodePath().contains(IndexConstant.ZHI_LI_NENG_LI)) { + return; + } + if (!OrgLevelEnum.GRID.getCode().equals(orgLevel) && !OrgLevelEnum.DISTRICT.getCode().equals(orgLevel) && !index.getAllIndexCodePath().contains(type)) { + return; + } + table.setIndexCode(index.getIndexCode()); + table.setIndexName(index.getIndexName()); + table.setOriginValue(NumConstant.ZERO_STR); + table.setScore(NumConstant.ZERO_STR); + table.setWeight(index.getWeight().multiply(new BigDecimal(100)).setScale(0, BigDecimal.ROUND_HALF_UP) + "%"); + table.setType(type); + tableList.add(table); + if (new BigDecimal(-1).compareTo(index.getThreshold()) != 0) { + threlodList.add(index.getIndexName().concat(String.format(IndexConstant.THRESHOLD_TEXT, index.getThreshold().intValue()))); + } + }); + result.setTableDataList(tableList); + result.setThresholdList(threlodList); + result.setTableDesc(IndexConstant.TABLE_DESC); + return tableList; + } + + private void setChildren(IndexExplainFormDTO formDTO, Map> detailEntityMap, IndexExplainResult result, IndexExplainTreeDTO parentNode, List children) { + List childrenList = new ArrayList<>(); + children.forEach(child -> { + IndexExplainResult ch = new IndexExplainResult(); + ch.setTitle(child.getTitle()); + ch.setMeaning(child.getMeaning()); + if (CollectionUtils.isNotEmpty(child.getChildren())) { + setChildren(formDTO, detailEntityMap, ch, child, child.getChildren()); + } + setTableData(formDTO, detailEntityMap, child, ch); + childrenList.add(ch); + }); + result.setChildren(childrenList); + } + + public static void main(String[] args) { + + } + + private List getTableHeaders(String type, String allIndexCode, String orgLevel) { + List headers = new ArrayList<>(); + OrgLevelEnum anEnum = OrgLevelEnum.getEnum(orgLevel); + switch (anEnum) { + case GRID: + //还没确定怎么搞 + if (IndexConstant.ZI_SHEN.equals(type)) { + headers = IndexConstant.getStandardSelfHeaders(allIndexCode); + + } else if (IndexConstant.XIA_JI.equals(type)) { + headers = new ArrayList<>(IndexConstant.QuantityLastHeader); + if (allIndexCode.contains("canyuyishi")) { + headers.add(0, "组织内党员的参与议事指数考评分(平均值)"); + } else if (allIndexCode.contains("lianxiqunzhong")) { + headers.add(0, "组织内党员的联系群众指数考评分(平均值)"); + } + break; + } + case DISTRICT: + if (IndexConstant.ZI_SHEN.equals(type)) { + headers = IndexConstant.getStandardSelfHeaders(allIndexCode); + + } else if (IndexConstant.XIA_JI.equals(type)) { + headers = new ArrayList<>(IndexConstant.QuantityLastHeader); + if (allIndexCode.contains("quzhibumen")) { + headers.add(0, "区直部门各项治理指数指标"); + } else { + headers.add(0, "所有街道治理指数指标"); + } + } + break; + default: + if (IndexConstant.ZI_SHEN.equals(type)) { + headers = IndexConstant.getStandardSelfHeaders(allIndexCode); + + } else if (IndexConstant.XIA_JI.equals(type)) { + headers = IndexConstant.getStandardSubHeaders(allIndexCode); + } + } + + return headers; + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java index f5e2428f09..85366a3db6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenUserService.java @@ -1,8 +1,10 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import java.util.List; @@ -21,10 +23,19 @@ public interface ScreenUserService { */ List userPointRank(UserPointRankFormDTO formDTO); + List userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO); + /** * @param formDTO * @Description 党员(指标得分)排行 * @author sun */ List partIndexScroeRank(PartIndexScroeRankFormDTO formDTO); + + /** + * 党员积分排行 + * @param formDTO + * @return + */ + List partyPointRank(PartyPointRankFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java index e427ad9e3b..b74a777bd5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/GrassRootsGovernServiceImpl.java @@ -147,7 +147,7 @@ public class GrassRootsGovernServiceImpl implements GrassRootsGovernService { screenUserJoinDao.selectUserJoinDataByAreaCode(agencyInfo.getAreaCode(),monthId); //保证获取公众参与概率数据的最大可能性 int time = NumConstant.TWELVE; - while (null == latest && time > NumConstant.ONE) { + while ((null == latest || latest.getId() == null) && time > NumConstant.ONE) { time--; monthId = dateUtils.getPreviousMonthIdByDest(null, monthId); latest = CollectionUtils.isEmpty(subCustomers)||StringUtils.isBlank(agencyInfo.getAreaCode()) ? diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java index 7721876c58..31f3ee8d3e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenUserServiceImpl.java @@ -7,8 +7,10 @@ import com.epmet.datareport.constant.FactConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenPartyUserRankDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenUserService; import com.epmet.evaluationindex.screen.dto.form.PartIndexScroeRankFormDTO; +import com.epmet.evaluationindex.screen.dto.form.PartyPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.form.UserPointRankFormDTO; import com.epmet.evaluationindex.screen.dto.result.PartIndexScroeRankResultDTO; +import com.epmet.evaluationindex.screen.dto.result.PartyPointRankResultDTO; import com.epmet.evaluationindex.screen.dto.result.UserPointRankListResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -43,6 +45,22 @@ public class ScreenUserServiceImpl implements ScreenUserService { return screenPartyUserRankDataDao.selectAgencyUserPointList(formDTO); } + /** + * @param formDTO + * @Description 热心市民积分排行列表(不包含党员) + * @author sun + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List userPointRankWithoutPartyMem(UserPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + //2.查询组织下居民积分排行,按积分值降序 screen_party_user_rank_data + return screenPartyUserRankDataDao.selectAgencyResiPointListWithoutPartyMem(formDTO); + } + /** * @param formDTO * @Description 党员(指标得分)排行 @@ -59,4 +77,14 @@ public class ScreenUserServiceImpl implements ScreenUserService { return screenPartyUserRankDataDao.selectPartymemberPointList(formDTO); } + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public List partyPointRank(PartyPointRankFormDTO formDTO) { + //1.参数校验 + if (!FactConstant.AGENCY.equals(formDTO.getOrgType()) && !FactConstant.GRID.equals(formDTO.getOrgType())) { + throw new RenException(String.format("入参格式错误,错误的组织或网格类型:%s", formDTO.getOrgType())); + } + return screenPartyUserRankDataDao.listPartymemberPointRank(formDTO); + } + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 596b1e9dd6..7a5eeee0d1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -335,6 +335,11 @@ public class FactIndexServiceImpl implements FactIndexService { resultList.forEach(result -> { list.stream().filter(dto -> dto.getIndexCode().equals(result.getKey())).forEach(l -> { result.setShowType(l.getValueType()); + //整数 + if (FactConstant.DECIMAL.equals(l.getValueType())) { + BigDecimal num = new BigDecimal(result.getValue()).setScale(0, BigDecimal.ROUND_HALF_UP); + result.setValue(num.toString()); + } //小数类型,四舍五入保留小数点后一位 if (FactConstant.DECIMAL.equals(l.getValueType())) { BigDecimal num = new BigDecimal(result.getValue()).setScale(1, BigDecimal.ROUND_HALF_UP); diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml index e1cbb6850b..aafd8dd25b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexAgencySubScoreDao.xml @@ -9,7 +9,8 @@ IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", fact.score AS score, dict.index_name AS "name", - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + (fact.SCORE * fact.WEIGHT) AS weightedScore FROM fact_index_agency_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code @@ -40,5 +41,23 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml index c48ba651ac..bd45c22bc4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunityScoreDao.xml @@ -28,10 +28,10 @@ ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - self.self_score AS selfOriginScore, + ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", - self.sub_score AS subOriginScore, + ROUND(self.sub_score, 1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_community_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml index b0fd69d5cf..37290ed60a 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCommunitySubScoreDao.xml @@ -9,7 +9,8 @@ IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", dict.index_name AS "name", fact.score AS score, - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + (fact.SCORE * fact.WEIGHT) AS weightedScore FROM fact_index_community_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code @@ -40,5 +41,23 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml new file mode 100644 index 0000000000..316e2f60e3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcScoreDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml new file mode 100644 index 0000000000..fcdbebc6d1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexCpcSubScoreDao.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml new file mode 100644 index 0000000000..c72adacb3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexDeptSubScoreDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml index a731e9c1db..0458665057 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridScoreDao.xml @@ -28,10 +28,10 @@ ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", - self.self_score AS selfOriginScore, + ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", - self.sub_score AS subOriginScore, + ROUND(self.sub_score, 1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM fact_index_grid_score fact diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml index eda1991759..1fda25b3ac 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/FactIndexGridSubScoreDao.xml @@ -9,7 +9,8 @@ IF(fact.origin_value='',0,IFNULL(fact.origin_value,0)) AS "value", dict.index_name AS "name", fact.score AS score, - round(fact.WEIGHT,2) AS weight + round(fact.WEIGHT,2) AS weight, + (fact.SCORE * fact.WEIGHT) AS weightedScore FROM fact_index_grid_sub_score fact LEFT JOIN index_dict dict ON fact.index_code = dict.index_code @@ -40,5 +41,22 @@ ORDER BY fact.month_id ASC + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml similarity index 93% rename from epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml rename to epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml index fffd0604bf..28f6d1955b 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/fact/IndexDictDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexDictDao.xml @@ -18,7 +18,8 @@ SELECT index_name AS "indexName", index_code AS "indexCode", - value_type AS "valueType" + value_type AS "valueType", + INDEX_DESC FROM index_dict WHERE diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml new file mode 100644 index 0000000000..9c7f5d0870 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexExplainDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml new file mode 100644 index 0000000000..e91cf12796 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml new file mode 100644 index 0000000000..741df34cfb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/index/IndexGroupDetailDao.xml @@ -0,0 +1,36 @@ + + + + + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index d5ca3cf33c..26c21cd8b1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -72,38 +72,46 @@ @@ -177,25 +185,41 @@ SELECT - ORG_ID, - ORG_NAME, + score.ORG_ID, + score.ORG_NAME, - round(party_dev_ablity,1) as score + round(score.party_dev_ablity,1) as score - round(govern_ablity,1) as score + round(score.govern_ablity,1) as score - round(service_ablity,1) as score + round(score.service_ablity,1) as score FROM - screen_index_data_monthly + screen_index_data_monthly score + + + + INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + + WHERE - del_flag = '0' + score.del_flag = '0' - AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + AND score.CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - AND PARENT_ID = #{agencyId,jdbcType=VARCHAR} - AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + AND score.PARENT_ID = #{agencyId,jdbcType=VARCHAR} + AND score.MONTH_ID = #{monthId,jdbcType=VARCHAR} - AND ORG_TYPE = #{orgType,jdbcType=VARCHAR} + AND score.ORG_TYPE = #{orgType,jdbcType=VARCHAR} - AND ORG_TYPE != 'department' + AND score.ORG_TYPE != 'department' ORDER BY - party_dev_ablity + score.party_dev_ablity - govern_ablity + score.govern_ablity - service_ablity + score.service_ablity ${sort} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 301954275f..4184ecd513 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -23,35 +23,43 @@ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml index 30fb7bd125..102b78296e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenPartyUserRankDataDao.xml @@ -131,4 +131,86 @@ m.POINT_TOTAL DESC, m.user_name - \ No newline at end of file + + + + + + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml index 5af47f5590..de0473571e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenUserJoinDao.xml @@ -28,6 +28,7 @@ + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml new file mode 100644 index 0000000000..bb5fc4b2e5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMemberDailyDao.xml @@ -0,0 +1,84 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index 42949df17b..d5bbf0cc29 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -291,4 +291,81 @@ AND f.MONTH_ID = #{monthId} GROUP BY f.AGENCY_ID + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index 7b2a4f9ae7..bd57a4df1e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -313,8 +313,7 @@ COUNT( ID ) AS "count" FROM fact_origin_project_log_daily WHERE ORG_TYPE = 'grid' - AND ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + AND (ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'resolved' OR ACTION_CODE = 'unresolved' @@ -347,8 +346,7 @@ INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - ( ACTION_CODE = 'response' - OR ACTION_CODE = 'close' + ( ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'resolved' OR ACTION_CODE = 'unresolved' @@ -362,33 +360,22 @@ SELECT AGENCY_ID, - COUNT( score >= 80 OR NULL ) AS 'count', + SUM( score ) AS 'count', COUNT( ID ) AS 'sum' FROM ( SELECT fm.AGENCY_ID, fm.ID, - IFNULL( fl.score, 80 ) AS "score" + IFNULL( IS_SATISFIED, 1 ) AS "score" FROM fact_origin_project_main_daily fm - INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID - AND da.`LEVEL` = #{level} - LEFT JOIN ( - SELECT - f.PROJECT_ID, - AVG( CASE ACTION_CODE WHEN 'bad' THEN 60 WHEN 'perfect' THEN 100 ELSE 80 END ) AS score - FROM - fact_origin_project_log_daily f - INNER JOIN dim_agency da ON f.AGENCY_ID = da.ID - AND da.`LEVEL` = #{level} - WHERE - ( ACTION_CODE = 'bad' OR ACTION_CODE = 'good' OR ACTION_CODE = 'perfect' ) - AND f.CUSTOMER_ID = #{customerId} - AND f.MONTH_ID = #{monthId} - GROUP BY - PROJECT_ID - ) fl ON fm.ID = fl.PROJECT_ID WHERE fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} AND fm.PROJECT_STATUS = 'closed' + AND fm.ORIGIN = 'issue' ) a GROUP BY AGENCY_ID @@ -552,4 +523,216 @@ GROUP BY PROJECT_ID HAVING COUNT(DISTINCT(ORG_ID)) = 1 + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 18aa1d5123..c9d6d8bfde 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -240,7 +240,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} GROUP BY @@ -254,7 +254,7 @@ INNER JOIN dim_agency da ON fm.AGENCY_ID = da.ID AND da.`LEVEL` = #{level} WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} AND fm.IS_RESOLVED = 'resolved' @@ -274,7 +274,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} @@ -287,7 +287,7 @@ FROM fact_origin_project_main_daily fm WHERE - fm.PROJECT_STATUS = 'close' + fm.PROJECT_STATUS = 'closed' AND fm.GRID_ID != '' AND fm.CUSTOMER_ID = #{customerId} AND fm.MONTH_ID = #{monthId} @@ -761,5 +761,312 @@ WHERE CUSTOMER_ID = #{customerId} AND DEL_FLAG = '0' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml index f0e5dc075d..2ee9f8afe1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml @@ -190,4 +190,81 @@ AND f.MONTH_ID = #{monthId} GROUP BY f.AGENCY_ID + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 741eeda829..115103bb6a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -97,6 +97,7 @@ fics.quarter_id, fics.year_id, ROUND(AVG( fics.score ),6) AS score, + COUNT(1) AS sample_count, fics.customer_id, PARENT_AGENCY_ID AS parentId FROM diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml index 64cca5242c..f1c861d1e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencySubScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + INSERT INTO fact_index_agency_sub_score (ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, DATA_TYPE, ORIGIN_VALUE, SCORE, SAMPLE_COUNT, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES @@ -20,6 +20,7 @@ #{item.dataType}, #{item.originValue}, #{item.score}, + #{item.sampleCount}, #{item.indexCode}, #{item.allParentIndexCode}, #{item.weight}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml index 45af93c437..214ca9f017 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunityScoreDao.xml @@ -74,6 +74,7 @@ #{quarterId} AS quarterId, #{yearId} AS yearId, IFNULL(ROUND(AVG( fics.score ),6),0) AS score, + COUNT(1) AS sampleCount, sca.customer_id, sca.pid AS parentId FROM screen_customer_agency sca diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml index f4dfd8fbd9..8f3bc53e6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CommunitySubScoreDao.xml @@ -5,7 +5,7 @@ - INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, + INSERT INTO fact_index_community_sub_score ( ID, CUSTOMER_ID, AGENCY_ID, PARENT_AGENCY_ID, YEAR_ID, QUARTER_ID, MONTH_ID, ORIGIN_VALUE, SAMPLE_COUNT, SCORE, INDEX_CODE,ALL_PARENT_INDEX_CODE, WEIGHT,DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) VALUES @@ -18,6 +18,7 @@ #{item.quarterId}, #{item.monthId}, #{item.originValue}, + #{item.sampleCount}, #{item.score}, #{item.indexCode}, #{item.allParentIndexCode}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml index bf0cfd3d51..b4ad476821 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/CpcScoreDao.xml @@ -46,9 +46,10 @@ - SELECT - round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE + round(AVG( SCORE ),6) AS AVG_VALUE, + count(1) AS SAMPLE_COUNT FROM fact_index_cpc_score m WHERE @@ -90,9 +91,10 @@ - SELECT - round(AVG( SCORE ),6) AS AVG_CONTACT_MASSES_SCORE + round(AVG( SCORE ),6) AS AVG_VALUE, + count(1) AS SAMPLE_COUNT FROM fact_index_cpc_score m WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml index 2c95faeb7a..1a67d13f8d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridScoreDao.xml @@ -131,6 +131,7 @@ figc.quarter_id as quarterId, figc.year_id as yearId, ROUND(AVG( figc.score ),6) AS score, + COUNT(1) AS sampleCount, figc.customer_id as customerId, sca.pid AS parentId FROM diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml index 056f92afb2..8d39d8dcc3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/GridSubScoreDao.xml @@ -24,7 +24,8 @@ `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, - `UPDATED_TIME` + `UPDATED_TIME`, + `SAMPLE_COUNT` ) VALUES @@ -47,7 +48,8 @@ 'APP_USER', now(), 'APP_USER', - now() + now(), + #{item.sampleCount} ) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml index 3298ce153b..d58ae256b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.xml @@ -241,6 +241,21 @@ CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml index c1b8578691..b60f152f95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenCustomerAgencyDao.xml @@ -440,4 +440,16 @@ AND PID = '0' AND CUSTOMER_ID = #{customerId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml new file mode 100644 index 0000000000..b38ec6cce5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_govern_rank_data_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID <= #{dateId} + + and ORG_TYPE=#{orgType} + + + and + ( + + ORG_ID = #{orgId} + + ) + + limit #{deleteSize} + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index de5fc6a9b9..fa4978c985 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -162,6 +162,7 @@ + @@ -186,7 +187,8 @@ oper.UPDATED_TIME AS joinDate, IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'leader','member') AS leaderFlag, groupp.CREATED_BY AS groupOwnerId, - IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode + IF(groupp.CREATED_BY = oper.CUSTOMER_USER_ID,'join','create') AS actionCode, + groupp.group_type AS groupType FROM RESI_GROUP groupp @@ -212,18 +214,103 @@ - - SELECT + m.SIGN_USER_ID AS userId, + count( DISTINCT m.GROUP_ACT_ID ) AS indexValue + FROM + act_sign_in_record m + inner join group_act_info a + on(m.GROUP_ACT_ID=a.id and a.DEL_FLAG='0' + ) + WHERE + m.DEL_FLAG = '0' + AND m.CUSTOMER_ID = #{customerId} + AND DATE_FORMAT( m.CREATED_TIME, '%Y%m' )= #{monthId} + and a.CUSTOMER_ID=#{customerId} + and a.`STATUS`!='canceled' + and a.CATEGORY_CODE='100001' + GROUP BY + m.SIGN_USER_ID + - ATTACHMENT_URL AS eventImgUrl, - SORT + + - FROM - resi_topic_attachment - WHERE - DEL_FLAG = '0' + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index ea0d0fc48b..7aa2bf3422 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -80,7 +80,8 @@ ca.ORGANIZATION_NAME as ORG_NAME FROM customer_grid cg - LEFT JOIN customer_agency ca ON ( cg.PID = CA.ID ) + LEFT JOIN customer_agency ca + ON ( cg.PID = CA.ID and ca.del_flag='0') WHERE CG.CUSTOMER_ID =#{customerId} and cg.del_flag='0' diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index 5dc44f074c..cf3ce06acc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -134,7 +134,7 @@ - SELECT csg.GRID_ID AS orgId, 'grid' AS orgType, @@ -144,17 +144,51 @@ WHERE csg.DEL_FLAG = '0' AND csg.CUSTOMER_ID = #{customerId} - UNION ALL + ORDER BY + orgType asc,orgId ASC + + + + + + + + + - \ No newline at end of file + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 58dd19a9e5..3c5ebd884f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -145,4 +145,21 @@ AND DATE_FORMAT(CREATED_TIME,'%Y%m%d')=#{dateId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index e9079abc3b..3d4c8a5c8b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -238,23 +238,18 @@ FROM ( SELECT - ps.PROJECT_ID, - ps.ORG_ID_PATH, - ps.GRID_ID, - ps.DEPARTMENT_ID - FROM - project_process pp - INNER JOIN project_staff ps ON pp.STAFF_ID = ps.STAFF_ID - AND pp.DEPARTMENT_NAME = ps.DEPARTMENT_NAME - AND pp.PROJECT_ID = ps.PROJECT_ID - AND ps.IS_HANDLE = 'handle' - AND pp.CREATED_TIME = ps.UPDATED_TIME - AND ps.CUSTOMER_ID = #{customerId} + PROJECT_ID, + ORG_ID_PATH, + GRID_ID, + DEPARTMENT_ID + FROM + project_process WHERE - pp.OPERATION = 'close' - - AND DATE_FORMAT(pp.CREATED_TIME , '%Y%m%d') = #{date} - + OPERATION = 'close' + AND CUSTOMER_ID = #{customerId} + + AND DATE_FORMAT(CREATED_TIME , '%Y%m%d') = #{date} + ) a LEFT JOIN ( diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index 2d92d5d61b..564aca5628 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -140,4 +140,16 @@ AND dcp.CUSTOMER_ID =#{customerId} and dcp.PIDS LIKE CONCAT(#{pids},'%') + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml new file mode 100644 index 0000000000..bcc0f98ef5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectDailyDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml new file mode 100644 index 0000000000..8fd44cba67 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyOriginProjectMonthlyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml new file mode 100644 index 0000000000..618a957a95 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalAgencyDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_group_total_agency_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml new file mode 100644 index 0000000000..689f3f5820 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupTotalGridDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_group_total_grid_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardAgencyDailyDao.xml new file mode 100644 index 0000000000..f6de9644d1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardAgencyDailyDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_party_member_vanguard_agency_daily where customer_id = #{customerId} and DATE_ID = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml new file mode 100644 index 0000000000..311262a04f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactPartyMemberVanguardGridDailyDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from fact_party_member_vanguard_grid_daily where customer_id = #{customerId} and DATE_ID = #{dateId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml new file mode 100644 index 0000000000..27d63b02e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussAgencyDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_topic_hotdiscuss_agency_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml new file mode 100644 index 0000000000..f82d421f42 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTopicHotdiscussGridDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + DELETE + FROM + fact_topic_hotdiscuss_grid_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml index 209d13e228..821ca24983 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -131,6 +131,17 @@ AND CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index 8dfb2aae2e..ae18ea2b7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -307,4 +307,23 @@ AND ATTACHMENT_TYPE = 'image' and TOPIC_ID = #{topicId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx new file mode 100644 index 0000000000..cb442ccfe9 Binary files /dev/null and b/epmet-module/data-statistical/data-statistical-server/src/test/java/resources/评价指标体系算法需求-备注3.0版新权重.xlsx differ diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java new file mode 100644 index 0000000000..d6c0543b9c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java @@ -0,0 +1,29 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 9:56 + */ +public interface StatsPartyMemberVanguardService { + /** + * 党员先锋统计-机关 + * @author zhaoqifeng + * @date 2021/5/18 9:58 + * @param params + * @return com.epmet.commons.tools.utils.Result + */ + Result agencyVanguardStats(StatsFormDTO params); + + /** + * 党员先锋统计-网格 + * @author zhaoqifeng + * @date 2021/5/18 9:58 + * @param params + * @return com.epmet.commons.tools.utils.Result + */ + Result gridVanguardStats(StatsFormDTO params); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java new file mode 100644 index 0000000000..0db94fcfb7 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java @@ -0,0 +1,47 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.StatsPartyMemberVanguardService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 9:56 + */ +@Service +public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVanguardService { + @Resource + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + + /** + * 党员先锋统计-机关 + * + * @param params + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:58 + */ + @Override + public Result agencyVanguardStats(StatsFormDTO params) { + return dataStatisticalOpenFeignClient.agencyVanguardStats(params); + } + + /** + * 党员先锋统计-网格 + * + * @param params + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:58 + */ + @Override + public Result gridVanguardStats(StatsFormDTO params) { + return dataStatisticalOpenFeignClient.gridVanguardStats(params); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsPartyMemberVanguardTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsPartyMemberVanguardTask.java new file mode 100644 index 0000000000..8972bd1832 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsPartyMemberVanguardTask.java @@ -0,0 +1,46 @@ +package com.epmet.task; + +import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; +import com.epmet.service.StatsPartyMemberVanguardService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; + +import javax.annotation.Resource; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/18 9:55 + */ +@Component("statsVanguardTask") +@Slf4j +public class StatsPartyMemberVanguardTask implements ITask { + + @Resource + private StatsPartyMemberVanguardService statsPartyMemberVanguardService; + + @Override + public void run(String params) { + log.info("statsVanguardTask定时任务正在执行,参数为:{}", params); + StatsFormDTO statsFormDTO = new StatsFormDTO(); + if (StringUtils.isNotBlank(params)) { + statsFormDTO = JSON.parseObject(params, StatsFormDTO.class); + } + Result result = statsPartyMemberVanguardService.agencyVanguardStats(statsFormDTO); + if (result.success()) { + log.info("statsVanguardTask组织级别定时任务执行成功"); + } else { + log.error("statsVanguardTask组织级别定时任务执行失败:" + result.getMsg()); + } + + result = statsPartyMemberVanguardService.gridVanguardStats(statsFormDTO); + if (result.success()) { + log.info("statsVanguardTask网格级别定时任务执行成功"); + } else { + log.error("statsVanguardTask网格级别定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProjectCategoryDisPoseResultDTO.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProjectCategoryDisPoseResultDTO.java new file mode 100644 index 0000000000..478c656627 --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/result/ProjectCategoryDisPoseResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/17 10:36 上午 + * @DESC + */ +@Data +public class ProjectCategoryDisPoseResultDTO implements Serializable { + + private static final long serialVersionUID = -2434579745274187160L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 查询传参 + */ + private String categoryCode; + + /** + * mysql查询接收结果 + */ + private String categoryName; + + /** + * 反参 + */ + private String projectCategory; + + /** + * 客户ID + */ + private String customerId; +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index dff2bbca89..a5179ea765 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -327,4 +327,13 @@ public interface GovIssueOpenFeignClient { */ @PostMapping("/gov/issue/issue/canevaluateprojectcountbatch") Result> canEvaluateProjectCountBatch(@RequestParam("issueIds")List issueIds); + + /** + * @Description 查询项目分类标签 + * @Param list + * @author zxc + * @date 2021/5/17 1:51 下午 + */ + @PostMapping(value = "/gov/issue/issueprojectcategorydict/getprojectcategory") + Result> getProjectCategory(@RequestBody List list); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index 869c096ddd..6808afaee5 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -271,4 +271,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result> canEvaluateProjectCountBatch(List issueIds) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "canEvaluateProjectCountBatch", issueIds); } + + @Override + public Result> getProjectCategory(List list) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getProjectCategory", list); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java index b28f0b352d..4a684d8ef2 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java @@ -32,10 +32,7 @@ import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.IssueProjectCategoryDictDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.CategoryTagResultDTO; -import com.epmet.dto.result.CustomerCategoryListResultDTO; -import com.epmet.dto.result.CustomerCategoryResultDTO; -import com.epmet.dto.result.ProjectIssueCategoryResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IssueProjectCategoryDictEntity; import com.epmet.excel.IssueProjectCategoryDictExcel; import com.epmet.project.dto.CustomerCategoryDTO; @@ -268,5 +265,17 @@ public class IssueProjectCategoryDictController { return new Result().ok(issueProjectCategoryDictService.getCategoryTagList(formDTO)); } + + /** + * @Description 查询项目分类标签 + * @Param list + * @author zxc + * @date 2021/5/17 1:51 下午 + */ + @PostMapping("getprojectcategory") + public Result> getProjectCategory(@RequestBody List list){ + return new Result>().ok(issueProjectCategoryDictService.getProjectCategory(list)); + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java index f9be70d073..6d2ad46fa8 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.form.IsDisableCategoryFormDTO; import com.epmet.dto.form.IssueProjectCategoryDictListFormDTO; import com.epmet.dto.result.CustomerCategoryListResultDTO; import com.epmet.dto.result.CustomerCategoryResultDTO; +import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO; import com.epmet.entity.IssueProjectCategoryDictEntity; import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -173,4 +174,13 @@ public interface IssueProjectCategoryDictDao extends BaseDao getCategoryList(@Param("customerId") String customerId, @Param("categoryIdList") List categoryIdList); + + /** + * @Description 查询项目分类标签 + * @Param list + * @author zxc + * @date 2021/5/17 1:51 下午 + */ + List getProjectCategory(@Param("list") List list,@Param("customerId") String customerId); + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java index 00ebcc18ca..abd4e63d38 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java @@ -22,10 +22,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.IssueProjectCategoryDictDTO; import com.epmet.dto.form.*; -import com.epmet.dto.result.CategoryTagResultDTO; -import com.epmet.dto.result.CustomerCategoryListResultDTO; -import com.epmet.dto.result.CustomerCategoryResultDTO; -import com.epmet.dto.result.ProjectIssueCategoryResultDTO; +import com.epmet.dto.result.*; import com.epmet.entity.IssueProjectCategoryDictEntity; import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import org.springframework.web.bind.annotation.RequestBody; @@ -216,4 +213,12 @@ public interface IssueProjectCategoryDictService extends BaseService getProjectCategory(List list); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 8db5944db0..6e61017ed1 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -472,4 +472,46 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl getProjectCategory(List list) { + String customerId = list.get(NumConstant.ZERO).getCustomerId(); + List projectCategory = baseDao.getProjectCategory(list, customerId); + if (CollectionUtils.isEmpty(projectCategory)){ + return new ArrayList<>(); + } + List result = new ArrayList<>(); + Map> groupByProject = projectCategory.stream().collect(Collectors.groupingBy(ProjectCategoryDisPoseResultDTO::getProjectId)); + groupByProject.forEach((projectId,categoryList) -> { + ProjectCategoryDisPoseResultDTO p = new ProjectCategoryDisPoseResultDTO(); + p.setProjectId(projectId); + p.setProjectCategory(disposeCategory(categoryList)); + result.add(p); + }); + return result; + } + + /** + * @Description 项目分类处理 + * @Param list + * @author zxc + * @date 2021/5/17 2:16 下午 + */ + public String disposeCategory(List list){ + String result = ""; + if (!CollectionUtils.isEmpty(list)){ + list.forEach(l -> { + result.concat(l.getCategoryName()).concat(","); + }); + } + if (StringUtils.isEmpty(result)){ + return result; + } + return result.substring(NumConstant.ZERO,result.length()-NumConstant.ONE); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 0d6adbd065..4a7b073b73 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -230,6 +230,20 @@ sort ASC + + + UPDATE issue_project_category_dict SET diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java index 175fe56674..b9cbcdc232 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/AgencysResultDTO.java @@ -96,4 +96,9 @@ public class AgencysResultDTO implements Serializable { * 组织区划的名称 */ private String areaName; + + /** + * 当前组织对应客户根组织级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String rootlevel; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 053f3427ee..a3695f6362 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -151,8 +151,9 @@ public class AgencyController { * @Description 组织首页-获取组织机构信息 */ @PostMapping("agencydetail") - @RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_TRACE) - public Result agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) { + //@RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_TRACE) + //public Result agencyDetail(@LoginUser TokenDto tokenDTO, @RequestBody AgencydetailFormDTO formDTO) { + public Result agencyDetail(@RequestBody AgencydetailFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AgencydetailFormDTO.AddUserInternalGroup.class); return agencyService.agencyDetail(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 07e29b44b1..b60e0ff31c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -237,6 +237,19 @@ public class AgencyServiceImpl implements AgencyService { agencysResultDTO = ConvertUtils.sourceToTarget(entity, AgencysResultDTO.class); agencysResultDTO.setAgencyId(entity.getId()); agencysResultDTO.setAgencyName(entity.getOrganizationName()); + //2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start + if (null != entity) { + if (null == entity.getPids() || "".equals(entity.getPids())) { + agencysResultDTO.setRootlevel(entity.getLevel()); + } else { + String id = Arrays.asList(entity.getPids().split(":")).get(0); + CustomerAgencyEntity rootEntity = customerAgencyDao.selectById(id); + if (null != rootEntity) { + agencysResultDTO.setRootlevel(rootEntity.getLevel()); + } + } + } + //2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end //2:查询本机关的所有上级机关,按自上而下层级顺序 if (null == entity.getPids()) { agencysResultDTO.setParentList(parentList); diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java new file mode 100644 index 0000000000..5a2e934a99 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/MassesDiscontentFormDTO.java @@ -0,0 +1,43 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 5:16 下午 + * @DESC + */ +@Data +public class MassesDiscontentFormDTO implements Serializable { + + private static final long serialVersionUID = -9104774532905137856L; + + public interface MassesDiscontentForm{} + + /** + * 时间区间,三个月:threeMonth;半年:sixMonth;一年:twelveMonth + * 一个月按照30天,三个月90天,半年180天,一年365天 + */ + private String timeSection; + + /** + * asc:分数由低到高 + * desc:分数由高到低 + */ + private String sortType; + + /** + * 组织ID + */ + private String agencyId; + + @NotNull(message = "pageNo不能为空",groups = MassesDiscontentForm.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空",groups = MassesDiscontentForm.class) + private Integer pageSize; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java new file mode 100644 index 0000000000..df4c02015d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectEvaluateScoreFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 11:05 上午 + * @DESC + */ +@Data +public class ProjectEvaluateScoreFormDTO implements Serializable { + + private static final long serialVersionUID = -8126781510521211570L; + + public interface ProjectEvaluateScoreForm{} + + @NotBlank(message = "projectId不能为空",groups = ProjectEvaluateScoreForm.class) + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java new file mode 100644 index 0000000000..905dd0be8d --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/MassesDiscontentResultDTO.java @@ -0,0 +1,62 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/5/14 9:04 上午 + * @DESC + */ +@Data +public class MassesDiscontentResultDTO implements Serializable { + + private static final long serialVersionUID = 8954504790464516198L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 话题所在网格 + */ + private String gridName; + + /** + * 话题图片 + */ + private List photos; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 项目分类标签 + */ + private String projectCategory; + + /** + * 项目评价分数 + */ + @JsonIgnore + private Integer score; + + public MassesDiscontentResultDTO() { + this.gridName = ""; + this.photos = new ArrayList<>(); + this.topicContent = ""; + this.projectCategory = ""; + } +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java new file mode 100644 index 0000000000..06bf349809 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectEvaluateScoreResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/13 10:57 上午 + * @DESC + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ProjectEvaluateScoreResultDTO implements Serializable { + + private static final long serialVersionUID = 3317308221138082162L; + + /** + * 项目评价分数 + */ + private Integer score = NumConstant.ZERO; + +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java new file mode 100644 index 0000000000..9b2127224b --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProjectScoreResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/18 1:29 下午 + * @DESC + */ +@Data +public class ProjectScoreResultDTO implements Serializable { + + private static final long serialVersionUID = 8559486245200043097L; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目评价分数 + */ + private Integer score; + + /** + * 议题ID + */ + private String issueId; +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index c32d227ad6..d5be20752e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -178,4 +178,19 @@ public interface ProjectConstant { String EVALUATE_GOOD = "good"; String EVALUATE_BAD = "bad"; String EVALUATE_PERFECT = "perfect"; + + /** + * 三个月,六个月,12个月 + */ + String THREE_MONTH = "threeMonth"; + String SIX_MONTH = "sixMonth"; + String TWELVE_MONTH = "twelveMonth"; + String YESTERDAY = "yesterday"; + + /** + * 排序 + */ + String SORT_ASC = "asc"; + String SORT_DESC = "desc"; + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java index 8857e92695..62fbe24a59 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectSatisfactionStatisticsController.java @@ -26,6 +26,10 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.MassesDiscontentFormDTO; +import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.MassesDiscontentResultDTO; +import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.excel.ProjectSatisfactionStatisticsExcel; import com.epmet.service.ProjectSatisfactionStatisticsService; import org.springframework.beans.factory.annotation.Autowired; @@ -91,4 +95,28 @@ public class ProjectSatisfactionStatisticsController { ExcelUtils.exportExcelToTarget(response, null, list, ProjectSatisfactionStatisticsExcel.class); } + /** + * @Description 项目评价分数 + * @Param formDTO + * @author zxc + * @date 2021/5/13 11:18 上午 + */ + @PostMapping("projectevaluatescore") + public Result projectEvaluateScore(@RequestBody ProjectEvaluateScoreFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, ProjectEvaluateScoreFormDTO.ProjectEvaluateScoreForm.class); + return new Result().ok(projectSatisfactionStatisticsService.projectEvaluateScore(formDTO)); + } + + /** + * @Description 群众不满 + * @Param formDTO + * @author zxc + * @date 2021/5/14 10:46 上午 + */ + @PostMapping("massesdiscontent") + public Result> massesDiscontent(@RequestBody MassesDiscontentFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, MassesDiscontentFormDTO.MassesDiscontentForm.class); + return new Result>().ok(projectSatisfactionStatisticsService.massesDiscontent(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java index 247f239261..cc2d336344 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectCategoryDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectCategoryDTO; import com.epmet.dto.form.DelCategoryFormDTO; +import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO; import com.epmet.entity.ProjectCategoryEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -52,4 +53,12 @@ public interface ProjectCategoryDao extends BaseDao { * @Author sun **/ List selectProjectCategoryList(DelCategoryFormDTO formDTO); + + /** + * @Description 根据项目ID查询项目分类 + * @Param projectIds + * @author zxc + * @date 2021/5/17 10:47 上午 + */ + List selectCategoryByIds(@Param("projectIds")List projectIds); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java index 17efc1b958..2c2fe53f31 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectDao.java @@ -154,4 +154,14 @@ public interface ProjectDao extends BaseDao { * @date 2021/5/12 10:29 上午 */ List selectAllClosedProject(); + + /** + * @Description 查询时间段内的项目ID + * @Param agencyId + * @Param startDate + * @Param endDate + * @author zxc + * @date 2021/5/14 1:59 下午 + */ + List selectProjectIdByTime(@Param("agencyId")String agencyId,@Param("endDate")Integer endDate,@Param("startDate")Integer startDate); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java index 28de98cdda..89e4d5049e 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectSatisfactionStatisticsDao.java @@ -18,6 +18,8 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.MassesDiscontentResultDTO; +import com.epmet.dto.result.ProjectScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -57,4 +59,21 @@ public interface ProjectSatisfactionStatisticsDao extends BaseDao selectExistsProject(); + + /** + * @Description 根据项目ID查询此项目评价信息 + * @Param projectId + * @author zxc + * @date 2021/5/13 1:28 下午 + */ + ProjectSatisfactionStatisticsEntity selectInfoByProjectId(@Param("projectId")String projectId); + + /** + * @Description 查询评价分数小于xx分的项目 + * @Param projectIds + * @author zxc + * @date 2021/5/17 9:59 上午 + */ + List selectProjectByScore(@Param("projectIds")List projectIds, @Param("setScore")Integer setScore, @Param("sortType")String sortType); + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java index 09c8985235..c55338cf80 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectSatisfactionStatisticsEntity.java @@ -61,16 +61,17 @@ public class ProjectSatisfactionStatisticsEntity extends BaseEpmetEntity { */ private Integer badCount; + /** + * 应评价人数【等于实际表决人数】 + */ + private Integer shouldEvaluateCount; + /** * 客户ID */ @TableField(fill = FieldFill.INSERT) private String customerId; - /** - * 应评价人数【等于实际表决人数】 - */ - private Integer shouldEvaluateCount; public ProjectSatisfactionStatisticsEntity() { this.goodCount = NumConstant.ZERO; @@ -78,4 +79,5 @@ public class ProjectSatisfactionStatisticsEntity extends BaseEpmetEntity { this.badCount = NumConstant.ZERO; this.shouldEvaluateCount = NumConstant.ZERO; } + } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java index 770a98d174..24b4f24b5b 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectSatisfactionStatisticsService.java @@ -20,6 +20,10 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.MassesDiscontentFormDTO; +import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.MassesDiscontentResultDTO; +import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; import java.util.List; @@ -92,4 +96,20 @@ public interface ProjectSatisfactionStatisticsService extends BaseService massesDiscontent(MassesDiscontentFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java index 7769eb2ef4..119f217c14 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionStatisticsServiceImpl.java @@ -20,22 +20,43 @@ package com.epmet.service.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.ProjectConstant; +import com.epmet.dao.ProjectCategoryDao; +import com.epmet.dao.ProjectDao; import com.epmet.dao.ProjectSatisfactionStatisticsDao; import com.epmet.dto.ProjectSatisfactionStatisticsDTO; +import com.epmet.dto.form.MassesDiscontentFormDTO; +import com.epmet.dto.form.ProjectEvaluateScoreFormDTO; +import com.epmet.dto.result.MassesDiscontentResultDTO; +import com.epmet.dto.result.ProjectCategoryDisPoseResultDTO; +import com.epmet.dto.result.ProjectEvaluateScoreResultDTO; +import com.epmet.dto.result.ProjectScoreResultDTO; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; +import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.redis.ProjectSatisfactionStatisticsRedis; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; +import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.service.ProjectSatisfactionStatisticsService; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 项目满意度调查统计表 @@ -48,6 +69,14 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl page(Map params) { @@ -101,4 +130,108 @@ public class ProjectSatisfactionStatisticsServiceImpl extends BaseServiceImpl massesDiscontent(MassesDiscontentFormDTO formDTO) { + // 根据时间范围查询已结案的项目,来源是issue的 + List projectIds = projectDao.selectProjectIdByTime(formDTO.getAgencyId(), getDateId("yesterday"), getDateId(formDTO.getTimeSection())); + if (CollectionUtils.isEmpty(projectIds)){ + return new ArrayList<>(); + } + // 查询少于75分的项目 + PageInfo pageInfo = PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()).doSelectPageInfo(() -> baseDao.selectProjectByScore(projectIds.stream().map(m -> m.getProjectId()).collect(Collectors.toList()), NumConstant.SEVENTY_FIVE, formDTO.getSortType())); + List projects = pageInfo.getList(); + if (CollectionUtils.isEmpty(projects)){ + return new ArrayList<>(); + } + // 项目分类标签 + List projectCategoryDisPoseResultDTOS = projectCategoryDao.selectCategoryByIds(projects.stream().map(m -> m.getProjectId()).collect(Collectors.toList())); + List projectCategoryData = new ArrayList<>(); + if (!CollectionUtils.isEmpty(projectCategoryDisPoseResultDTOS)){ + Result> projectCategory = issueOpenFeignClient.getProjectCategory(projectCategoryDisPoseResultDTOS); + if (!projectCategory.success()){ + throw new RenException("查询项目分类标签失败".concat(projectCategory.getMsg())); + } + projectCategoryData = projectCategory.getData(); + } + // 话题信息 + Result> topicInfos = resiGroupOpenFeignClient.getTopicInfos(projects.stream().map(m -> m.getIssueId()).collect(Collectors.toList())); + if (!topicInfos.success()){ + throw new RenException("查询话题信息失败".concat(topicInfos.getMsg())); + } + List finalProjectCategoryData = projectCategoryData; + // 数据组装 + projects.forEach(p -> { + if (!CollectionUtils.isEmpty(finalProjectCategoryData)){ + finalProjectCategoryData.forEach(cate -> { + if (p.getProjectId().equals(cate.getProjectId())){ + p.setProjectCategory(cate.getProjectCategory()); + } + }); + } + if (!CollectionUtils.isEmpty(topicInfos.getData())){ + topicInfos.getData().forEach(t -> { + if (p.getIssueId().equals(t.getIssueId())){ + p.setGridName(t.getGridName()); + p.setTopicContent(t.getTopicContent()); + p.setPhotos(t.getPhotos()); + } + }); + } + }); + return projects; + } + + /** + * @Description 处理时间 + * @Param dateType + * @author zxc + * @date 2021/5/18 2:28 下午 + */ + public Integer getDateId(String dateType){ + Integer result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.ONE)); + switch (dateType) { + case ProjectConstant.THREE_MONTH: + result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.NINETY)); + break; + case ProjectConstant.SIX_MONTH: + result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.ONE_HUNDRED_AND_EIGHTY)); + break; + case ProjectConstant.TWELVE_MONTH: + result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.THREE_HUNDRED_AND_SIXTY_FIVE)); + break; + case ProjectConstant.YESTERDAY: + result = Integer.valueOf(DateUtils.getBeforeNDay(NumConstant.ONE)); + break; + default: + } + return result; + } + } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql new file mode 100644 index 0000000000..4f8d970ed4 --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.13__add_parameter.sql @@ -0,0 +1 @@ +INSERT INTO `customer_project_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1007', 'default', 'satisfaction', '项目满意指标', '75', '评分小于当前分的为不满意', '0', 1, '1', '2020-10-26 10:57:41', '1', '2020-10-26 10:57:45'); diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml index 30033c620e..3f9c27f6d2 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectCategoryDao.xml @@ -35,4 +35,19 @@ project_id = #{projectId} + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml index 82233c7b68..a83934841c 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectDao.xml @@ -284,4 +284,20 @@ AND ORIGIN = 'issue' AND `STATUS` = 'closed' + + + + \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml index 114f3c5a04..0b4a51c479 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml +++ b/epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectSatisfactionStatisticsDao.xml @@ -36,6 +36,34 @@ + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java new file mode 100644 index 0000000000..4a2d43ea8e --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/result/TopicInfoResultDTO.java @@ -0,0 +1,42 @@ +package com.epmet.resi.group.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/5/17 2:44 下午 + * @DESC + */ +@Data +public class TopicInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 4068679301595597877L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 话题所在网格 + */ + private String gridName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 话题图片 + */ + private List photos; + + /** + * 话题内容 + */ + private String topicContent; +} diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java index 5973d663d1..e0828ce468 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/ResiGroupOpenFeignClient.java @@ -10,6 +10,7 @@ import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; import com.epmet.resi.group.feign.fallback.ResiGroupOpenFeignClientFallback; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.cloud.openfeign.FeignClient; @@ -277,4 +278,14 @@ public interface ResiGroupOpenFeignClient { */ @PostMapping("/resi/group/topic/get-topicdetail-byid/batch") Result> listTopicDetailsByIds(TopicDetailBatchFormDTO input); + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + @PostMapping("resi/group/topic/gettopicinfos") + Result> getTopicInfos(@RequestBody List issueIds); + } diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java index 5c178e9666..f4f4db750f 100644 --- a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/feign/fallback/ResiGroupOpenFeignClientFallback.java @@ -10,6 +10,7 @@ import com.epmet.resi.group.dto.topic.MyCreateTopicsFormDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.epmet.resi.mine.dto.from.MyPartProjectsFormDTO; import org.springframework.stereotype.Component; @@ -213,4 +214,9 @@ public class ResiGroupOpenFeignClientFallback implements ResiGroupOpenFeignClien public Result> listTopicDetailsByIds(TopicDetailBatchFormDTO input) { return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "listTopicDetailsByIds", input); } + + @Override + public Result> getTopicInfos(List issueIds) { + return ModuleUtils.feignConError(ServiceConstant.RESI_GROUP_SERVER, "getTopicInfos", issueIds); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java index e0b6a01ee8..c19e33d5ae 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/ResiTopicController.java @@ -522,4 +522,15 @@ public class ResiTopicController { } + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + @PostMapping("gettopicinfos") + public Result> getTopicInfos(@RequestBody List issueIds){ + return new Result>().ok(topicService.getTopicInfos(issueIds)); + } } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java index abc817659d..88bc4abad0 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/ResiTopicDao.java @@ -224,4 +224,12 @@ public interface ResiTopicDao extends BaseDao { * @author sun */ int upTopicList(@Param("delIdList") List delIdList, @Param("userId") String userId); + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:54 下午 + */ + List getTopicInfos(@Param("issueIds") List issueIds); } \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java index a0e29c3131..9a552f2baa 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/ResiTopicService.java @@ -413,4 +413,12 @@ public interface ResiTopicService extends BaseService { * @date 2021.05.18 15:42 */ List listTopicDetailsByIds(List topicIdList); + + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + List getTopicInfos(List issueIds); } diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java index f7aae98444..773eeda261 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/ResiTopicServiceImpl.java @@ -104,6 +104,7 @@ import com.epmet.resi.group.dto.topic.form.*; import com.epmet.resi.group.dto.topic.result.CheckTopicPublisherResultDTO; import com.epmet.resi.group.dto.topic.result.GovTopicIssueInfoResultDTO; import com.epmet.resi.group.dto.topic.result.*; +import com.epmet.resi.group.dto.topic.result.TopicInfoResultDTO; import com.epmet.send.SendMqMsgUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; @@ -629,6 +630,12 @@ public class ResiTopicServiceImpl extends BaseServiceImpl a.getAttachmentUrl()).collect(Collectors.toList()); } + /** + * @Description 查询话题信息 + * @Param issueIds + * @author zxc + * @date 2021/5/17 4:19 下午 + */ + @Override + public List getTopicInfos(List issueIds) { + if (CollectionUtils.isEmpty(issueIds)){ + return new ArrayList<>(); + } + List topicInfos = baseDao.getTopicInfos(issueIds); + Result> gridNames = govOrgOpenFeignClient.getGridListByGridIds(topicInfos.stream().map(m -> m.getGridId()).collect(Collectors.toList())); + if (!gridNames.success()){ + throw new RenException("查询网格Name失败"); + } + topicInfos.forEach(t -> { + gridNames.getData().forEach(g -> { + if (t.getGridId().equals(g.getGridId())){ + t.setGridName(g.getGridName()); + } + }); + }); + return topicInfos; + } + } diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInRecordDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInRecordDao.xml index ec3207549b..b2cb9d1fdc 100644 --- a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInRecordDao.xml +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/act/ActSignInRecordDao.xml @@ -25,6 +25,7 @@ WHERE acr.DEL_FLAG = '0' AND acr.GROUP_ACT_ID = #{groupActId} + order by acr.CREATED_TIME desc + SELECT + t.TOPIC_CONTENT AS topicContent, + g.GRID_ID AS gridId, + ta.ATTACHMENT_URL AS imgUrl, + t.ISSUE_ID AS issueId + FROM resi_topic t + LEFT JOIN resi_group g ON g.ID = t.GROUP_ID AND g.DEL_FLAG = '0' + LEFT JOIN resi_topic_attachment ta ON t.ID = ta.TOPIC_ID AND ta.DEL_FLAG = '0' AND ta.ATTACHMENT_TYPE = 'image' AND (ta.SORT = 0 OR ta.SORT = 1 OR ta.SORT = 2) + WHERE t.DEL_FLAG = '0' + AND ( + + t.ISSUE_ID = #{issueId} + + ) + + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 4221d063f9..af8191b9a2 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -428,6 +428,9 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl