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..ad1d27d9e6 --- /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; + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + /** + * 党员发布话题数 + */ + private Integer topicCount; + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + /** + * 党员发布话题转项目结案数占比 + */ + 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 3060e67b42..ee78a25f8b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -158,6 +158,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 @@ -239,6 +253,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 @@ -320,6 +348,20 @@ epmet elink@833066 + + + + + epmet + elink@833066 + + + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -401,6 +443,20 @@ epmet_oper_crm_user EpmEt-db-UsEr + + + + + epmet_data_statistical_user + 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..0bf1504b81 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/datastats/impl/DataStatsServiceImpl.java @@ -0,0 +1,1302 @@ + 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) { + 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..fafc989776 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/datastats/DatsStatsDao.xml @@ -0,0 +1,657 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file 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-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/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-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java index c611d4b97e..891f6ef091 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java @@ -26,4 +26,7 @@ public interface IssueConstant { *未解决 */ String UNRESOLVED = "unresolved"; + + String CLOSED_RESOLVED = "closed_resolved"; + String CLOSED_UNRESOLVED = "closed_unresolved"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java index 8292361039..818d5a399c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMainDailyDTO.java @@ -150,6 +150,11 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 */ private Date updatedTime; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + private List members = new ArrayList(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java new file mode 100644 index 0000000000..42ec5cd2b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginGroupMemberDailyDTO.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactOriginGroupMemberDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 组Id + */ + private String groupId; + + /** + * 小组所在的网格id + */ + private String gridId; + + /** + * 小组所在的社区id + */ + private String agencyId; + + /** + * 小组所在的街道id + */ + private String parentId; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 成员Id(userId) + */ + private String memberId; + + /** + * 客户Id + */ + private String customerId; + + /** + * leader(群主) member(成员) + */ + private String leaderFlag; + + /** + * 入群审核通过或自动加入群的日期 yyyyMMdd + */ + private String dateId; + + /** + * 入群周 2020W15 + */ + private String weekId; + + /** + * 入群月 202004 + */ + private String monthId; + + /** + * 入群季 2020Q2 + */ + private String quarterId; + + /** + * 入群年 2020 + */ + private String yearId; + + /** + * join(入群),群主建群自己入群也是join + */ + private String actionCode; + + /** + * 是否是党员 + */ + private Integer isParty; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * + */ + private String createdBy; + + /** + * + */ + private Date createdTime; + + /** + * + */ + private String updatedBy; + + /** + * + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java index 8f5f1571db..4843b32966 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectLogDailyDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto.extract; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -44,7 +45,7 @@ public class FactOriginProjectLogDailyDTO implements Serializable { private String customerId; /** - * 网格grid,部门department + * 网格grid,部门department,组织:agency */ private String orgType; @@ -90,6 +91,11 @@ public class FactOriginProjectLogDailyDTO implements Serializable { */ private String yearId; + /** + * 项目ID + */ + private String projectId; + /** * 议题ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java index 9d1484b5f4..13e1e5fba7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginProjectMainDailyDTO.java @@ -138,6 +138,11 @@ public class FactOriginProjectMainDailyDTO implements Serializable { */ private String isOverdue; + /** + * 是否满意 1:是 + */ + private Integer isSatisfied; + /** * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java new file mode 100644 index 0000000000..6b1ec0810f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFactGridGovernDailyFromDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 治理指数网格-计算入参。 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/27 17:28 + */ +@Data +public class ExtractFactGridGovernDailyFromDTO implements Serializable { + private static final long serialVersionUID = -4511693100253244749L; + @NotBlank(message = "customer") + private String customerId; + private String dateId; + private List gridIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java index c188b64a57..8d948a633e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractIndexFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.extract.form; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; import java.io.Serializable; /** @@ -13,8 +15,13 @@ public class ExtractIndexFormDTO implements Serializable { private static final long serialVersionUID = 1248641210655148366L; + public interface AddUserInternalGroup { + } + + @NotBlank(message = "customerId不能为空", groups = AddUserInternalGroup.class) private String customerId; + @Length(min = 6, max = 6, message = "monthId不能为空", groups = {AddUserInternalGroup.class}) private String monthId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java index d7fca3b15d..f57927f65d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/OrgStatisticsResultDTO.java @@ -15,6 +15,7 @@ public class OrgStatisticsResultDTO implements Serializable { private static final long serialVersionUID = 9221060553279124719L; private String customerId; private String agencyId; + private String level; private String orgId; private Integer count; private Integer sum; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java index 24e5ec021a..d0f56ff909 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/PartyMemberInfoResultDTO.java @@ -48,4 +48,9 @@ public class PartyMemberInfoResultDTO implements Serializable { * 机关名称 */ private String agencyName; + + /** + * 党员的用户id + */ + private String userId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java new file mode 100644 index 0000000000..f75e5dc1b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/ActCategoryDictDTO.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.group; + +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; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 类别编码 + */ + private String categoryCode; + + /** + * 活动类别名称;eg:支部建设、联建共建 + */ + private String categoryName; + + /** + * 等级1,2...... + */ + private Integer level; + + /** + * 排序 + */ + private Integer sort; + + /** + * 上级类别编码 + */ + private String parentCode; +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java new file mode 100644 index 0000000000..7d91c9c3fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupTotalFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * 小组总数-网格日统计-接口入参 + */ +@Data +public class GroupTotalFormDTO implements Serializable { + + private static final long serialVersionUID = -4527492073390715391L; + + /** + * 客户Id + */ + private String customerId = ""; + /** + * 需要执行的日期(格式:yyyyMMdd) + */ + private String dateId = ""; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java new file mode 100644 index 0000000000..02efab6132 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyAndParentResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.indexcal; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/5/26 1:47 下午 + * @DESC + */ +@Data +public class AgencyAndParentResultDTO implements Serializable { + + private static final long serialVersionUID = -7300464262794241276L; + + /** + * 组织ID + */ + private String agencyId; + + /** + * parentId + */ + private String pid; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java index 42d0ce8fa3..e558c4206e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/AgencyScoreDTO.java @@ -86,6 +86,11 @@ public class AgencyScoreDTO implements Serializable { */ private BigDecimal score; + /** + * 样本量 + */ + private Integer sampleCount; + /** * 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli;街道相关:jiedaoxiangguan;全区相关:quanquxiangguan */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java index f88e035b7b..13cfc69069 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubAgencyScoreAvgResultDTO.java @@ -48,4 +48,9 @@ public class SubAgencyScoreAvgResultDTO implements Serializable { * 分数 */ private BigDecimal score; + + /** + * 样本量 + */ + private Integer sampleCount; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java index a2c167eaeb..4376910337 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcal/SubCommunityAvgResultDTO.java @@ -50,6 +50,11 @@ public class SubCommunityAvgResultDTO implements Serializable { */ private BigDecimal score = NumConstant.ZERO_DECIMAL; + /** + * 样本量 + */ + private Integer sampleCount; + /** * 赋值状态 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java new file mode 100644 index 0000000000..b59fd8a969 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/indexcollect/result/PartyJoinThreeMeetDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.indexcollect.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格相关:党员参加“三会一课”人次 用 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/13 10:50 + */ +@Data +public class PartyJoinThreeMeetDTO implements Serializable { + private static final long serialVersionUID = 3027535602832948917L; + private String gridId; + private String userId; + private Integer joinThreeMeetsCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java new file mode 100644 index 0000000000..abeeab8d89 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectPointDTO.java @@ -0,0 +1,17 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/21 10:53 + */ +@Data +public class ProjectPointDTO implements Serializable { + private static final long serialVersionUID = -592430619162380664L; + private String projectId; + private Integer point; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java index 3ca91f2a98..94c1ea6b79 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/FactIndexCommunityScoreDTO.java @@ -79,6 +79,11 @@ public class FactIndexCommunityScoreDTO implements Serializable { */ private String originValue; + /** + * 参与计算的样本量 + */ + private Integer sampleCount; + /** * 分值 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java new file mode 100644 index 0000000000..29d988da64 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenGovernRankDataDailyDTO.java @@ -0,0 +1,132 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +public class ScreenGovernRankDataDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java index 460eb12640..92883b45dc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/result/SubGridAvgResultDTO.java @@ -49,4 +49,9 @@ public class SubGridAvgResultDTO implements Serializable { */ private BigDecimal score; + /** + * 样本量 + */ + private Integer sampleCount; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java new file mode 100644 index 0000000000..89809107e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectDailyDTO.java @@ -0,0 +1,187 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactAgencyOriginProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 项目来源 来源:议题issue 组织agency + */ + private String origin; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【0.未删除 1.已删除】 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java new file mode 100644 index 0000000000..b35d5f30dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyOriginProjectMonthlyDTO.java @@ -0,0 +1,172 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +public class FactAgencyOriginProjectMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【0.未删除 1.已删除】 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java new file mode 100644 index 0000000000..d840d0510f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalAgencyDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +public class FactGroupTotalAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 当前组织及下级小组总数 + */ + private Integer groupTotal; + + /** + * 当前组织及下级楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 当前组织及下级支部小组总数 + */ + private Integer branchTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java new file mode 100644 index 0000000000..942888e0cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupTotalGridDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +public class FactGroupTotalGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格下小组总数 + */ + private Integer groupTotal; + + /** + * 网格下楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 网格下支部小组总数 + */ + private Integer branchTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardAgencyDailyDTO.java new file mode 100644 index 0000000000..434775abd2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardAgencyDailyDTO.java @@ -0,0 +1,179 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +public class FactPartyMemberVanguardAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardGridDailyDTO.java new file mode 100644 index 0000000000..7d28a3e095 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactPartyMemberVanguardGridDailyDTO.java @@ -0,0 +1,179 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +public class FactPartyMemberVanguardGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java new file mode 100644 index 0000000000..c5c5eeaa21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussAgencyDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +public class FactTopicHotdiscussAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java new file mode 100644 index 0000000000..340f07dc49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicHotdiscussGridDailyDTO.java @@ -0,0 +1,126 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +public class FactTopicHotdiscussGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java new file mode 100644 index 0000000000..4fd7830330 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/form/TopicStatusFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.stats.topic.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * 热议中话题-网格、机关日统计-接口入参 + */ +@Data +public class TopicStatusFormDTO implements Serializable { + + private static final long serialVersionUID = -4527492073390715391L; + + /** + * 客户Id + */ + private String customerId = ""; + /** + * 需要执行的日期(格式:yyyyMMdd) + */ + private String dateId = ""; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java new file mode 100644 index 0000000000..01c5f60075 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicListResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dto.stats.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * 热议中话题-网格、机关日统计-接口返参 + */ +@Data +public class TopicListResultDTO implements Serializable { + private static final long serialVersionUID = -7427128491727512781L; + + /** + * 客户Id + */ + private String customerId; + /** + * 话题Id + */ + private String topicId; + /** + * 网格id + */ + private String gridId; + /** + * 小组Id + */ + private String groupId; + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String status; + /** + * 是否转为议题,0:false,1:true + * */ + private Boolean shiftIssue; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 27a471f2d4..dfafe94a1e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -236,4 +236,24 @@ public interface DataStatisticalOpenFeignClient { @PostMapping(value = "/data/stats/indexdict/initCustomerIndex") Result initCustomerIndex(@RequestBody InitCustomerIndexForm formDTO); + /** + * 党员先锋统计-机关 + * @author zhaoqifeng + * @date 2021/5/18 9:26 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/data/stats/vanguard/agencyvanguardstats") + Result agencyVanguardStats(@RequestBody StatsFormDTO formDTO); + + /** + * 党员先锋统计-网格 + * @author zhaoqifeng + * @date 2021/5/18 9:27 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/data/stats/vanguard/gridvanguardstats") + Result gridVanguardStats(@RequestBody StatsFormDTO formDTO); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 88574dbd8d..d842746b35 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -230,4 +230,30 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result initCustomerIndex(InitCustomerIndexForm formDTO) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "initCustomerIndex", formDTO); } + + /** + * 党员先锋统计-机关 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:26 + */ + @Override + public Result agencyVanguardStats(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "agencyVanguardStats", formDTO); + } + + /** + * 党员先锋统计-网格 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2021/5/18 9:27 + */ + @Override + public Result gridVanguardStats(StatsFormDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "gridVanguardStats", formDTO); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java index 5476a93a1b..1b6697f1ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java @@ -11,4 +11,17 @@ public interface DimObjectActionConstant { * 发布话题 */ String TOPIC_PUBLISH="discussing"; + + // response 处理/响应 + // close 结案 + // transfer 流转 + // return 退回 + // resolved 结案_已解决 + // unresolved 结案_无需解决 + // evaluate 满意度评价 + // bad 不满意 + // good 基本满意 + // perfect 非常满意 + // created 立项 + String PROJECT_RETURN="return"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index e1b0dd8a11..b714ce2210 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -71,4 +71,14 @@ public interface ProjectConstant { String ISSUE = "issue"; + + /** + * 项目来源于议题 + */ + String PROJECT_ORIGIN_ISSUE="issue"; + + /** + * 项目来源于 工作端立项 + */ + String PROJECT_ORIGIN_AGENCY="agency"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 794b1b707d..a5317f5ba2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -18,6 +18,8 @@ import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; @@ -34,9 +36,9 @@ import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.entity.stats.DimDateEntity; import com.epmet.entity.stats.DimMonthEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.StatsPartyMemberVanguardService; import com.epmet.service.evaluationindex.extract.dataToIndex.*; -import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; -import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.evaluationindex.screen.*; @@ -111,6 +113,14 @@ public class DemoController { private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; @Autowired private ScreenCentralZoneDataAbsorptionService screenCentralZoneDataAbsorptionService; + @Autowired + private StatsPartyMemberVanguardService statsPartyMemberVanguardService; + @Autowired + private FactGroupActDailyService factGroupActDailyService; + @Autowired + private FactGridGovernDailyService factGridGovernDailyService; + @Autowired + private FactAgencyGovernDailyService factAgencyGovernDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -526,6 +536,14 @@ public class DemoController { } + /** + * @return com.epmet.commons.tools.utils.Result + * @param customerId + * @param dateId + * @author yinzuomei + * @description 话题原始表抽取方法 + * @Date 2021/5/28 10:23 + **/ @PostMapping("inserttopicorigin") public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { @@ -664,6 +682,15 @@ public class DemoController { return new Result(); } + @PostMapping("governRankDaily") + public Result governRankDaily(@RequestBody CustomerIdAndDateIdFormDTO formDTO){ + governRankDataExtractService.extractGridDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractCommunityDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractStreetDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + governRankDataExtractService.extractDistrictDataDaily(formDTO.getCustomerId(), formDTO.getDateId()); + return new Result(); + } + @Autowired private PioneerDataExtractService pioneerDataExtractService; @Autowired @@ -877,4 +904,36 @@ public class DemoController { screenCentralZoneDataAbsorptionService.centralZoneDataHub(param); return new Result(); } + @PostMapping("vanguard") + public Result partyMemberVanguard(@RequestBody StatsFormDTO formDTO) { + statsPartyMemberVanguardService.agencyStats(formDTO); + statsPartyMemberVanguardService.gridStats(formDTO); + return new Result(); + } + + @PostMapping("extractgroupact") + public Result extractGroupAct(@RequestParam("customerId") String customerId,@RequestParam("dateId")String dateId){ + factGroupActDailyService.extractGridGroupActDaily(customerId,dateId); + factGroupActDailyService.extractAgencyGroupActDaily(customerId,dateId); + return new Result(); + } + + /** + * @return com.epmet.commons.tools.utils.Result + * @param fromDTO + * @author yinzuomei + * @description + * @Date 2021/5/27 17:28 + **/ + @PostMapping("extractgridgoverndaily") + public Result extractFactGridGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){ + factGridGovernDailyService.extractFactGridGovernDaily(fromDTO); + return new Result(); + } + @PostMapping("extractFactAgencyGovernDaily") + public Result extractFactAgencyGovernDaily(@RequestBody ExtractFactGridGovernDailyFromDTO fromDTO){ + factAgencyGovernDailyService.extractFactAgencyGovernDaily(fromDTO.getCustomerId(), fromDTO.getDateId()); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java index 9542bdc580..2cce1d4a19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginExtractController.java @@ -126,7 +126,9 @@ public class FactOriginExtractController { paramNew.setDateId(dateDimId); groupExtractService.extractGroupData(paramNew); } - }else groupExtractService.extractGroupData(param); + }else { + groupExtractService.extractGroupData(param); + } return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java index e3e70ba31c..9896ae6290 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -1,10 +1,15 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.service.StatsGroupService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +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; /** * @Author zxc @@ -56,4 +61,25 @@ public class StatsGroupController { return new Result(); } + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + @PostMapping("gridgrouptotal") + public Result gridGroupTotal(@RequestBody(required = false) GroupTotalFormDTO formDTO) { + statsGroupService.gridGroupTotal(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + @PostMapping("agencygrouptotal") + public Result agencyGroupTotal(@RequestBody(required = false) GroupTotalFormDTO formDTO) { + statsGroupService.agencyGroupTotal(formDTO); + return new Result(); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPartyMemberVanguardController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPartyMemberVanguardController.java new file mode 100644 index 0000000000..a8dd3c8892 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPartyMemberVanguardController.java @@ -0,0 +1,49 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.StatsFormDTO; +import com.epmet.service.StatsPartyMemberVanguardService; +import org.springframework.web.bind.annotation.PostMapping; +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 9:23 + */ +@RequestMapping("vanguard") +@RestController +public class StatsPartyMemberVanguardController { + @Resource + private StatsPartyMemberVanguardService statsPartyMemberVanguardService; + + /** + * 党员先锋统计-机关 + * @author zhaoqifeng + * @date 2021/5/18 9:26 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("agencyvanguardstats") + public Result agencyVanguardStats(StatsFormDTO formDTO) { + statsPartyMemberVanguardService.agencyStats(formDTO); + return new Result(); + } + + /** + * 党员先锋统计-网格 + * @author zhaoqifeng + * @date 2021/5/18 9:27 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("gridvanguardstats") + public Result gridVanguardStats(StatsFormDTO formDTO) { + statsPartyMemberVanguardService.gridStats(formDTO); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java index e76badc8a3..6fffd887bc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java @@ -2,6 +2,8 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; import com.epmet.service.StatsTopicService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -27,4 +29,25 @@ public class StatsTopicController { statsTopicService.partition(formDTO); return new Result(); } + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + @PostMapping("gridtopicstatus") + public Result gridTopicStatus(@RequestBody(required = false) TopicStatusFormDTO formDTO) { + statsTopicService.gridTopicStatus(formDTO); + return new Result(); + } + + /** + * @Author sun + * @Description 热议中话题-机关日统计 + **/ + @PostMapping("agencytopicstatus") + public Result agencyTopicStatus(@RequestBody(required = false) TopicStatusFormDTO formDTO) { + statsTopicService.agencyTopicStatus(formDTO); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java new file mode 100644 index 0000000000..2671d89c4e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactAgencyGovernDailyDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Mapper +public interface FactAgencyGovernDailyDao extends BaseDao { + /** + * 删除数据 + * @author zhaoqifeng + * @date 2021/5/31 14:47 + * @param customerId + * @param dateId + * @return int + */ + int deleteAgencyGovernDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("deleteSize") Integer deleteSize); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java new file mode 100644 index 0000000000..1408abaeff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGridGovernDailyDao.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Mapper +public interface FactGridGovernDailyDao extends BaseDao { + + int deleteBatchByCustomerIdAndDateId(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("limit") int limit); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.java new file mode 100644 index 0000000000..37d3d4e144 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActDailyDao.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.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactGroupActDailyDao extends BaseDao { + + int deleteBatch(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("limit") Integer limit, + @Param("orgType")String orgType); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.java new file mode 100644 index 0000000000..e7b179ef70 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactGroupActMonthlyDao.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.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactGroupActMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java index 911d8b7993..1533d70143 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMainDailyDao.java @@ -199,4 +199,30 @@ public interface FactOriginGroupMainDailyDao extends BaseDao selectOrgGroupCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); + + /** + * @Author sun + * @Description 查询客户小组维度下有效群组列表 + **/ + List selectCustomerGroupList(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:06 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberGroupStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取网格级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:07 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberGroupStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java new file mode 100644 index 0000000000..81a0dd3303 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginGroupMemberDailyDao.java @@ -0,0 +1,57 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; +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 FactOriginGroupMemberDailyDao extends BaseDao { + + /** + * 获取组织级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:06 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGroupPartyMemberStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取网格级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 17:07 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGroupPartyMemberStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index c8969fea56..ba3ddbce69 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -25,6 +25,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.ShiftProjectCountResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -205,4 +206,51 @@ public interface FactOriginIssueMainDailyDao extends BaseDao selectOrgIssueCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); + + /** + * 获取组织级别党员发布话题转议题统计 + * @author zhaoqifeng + * @date 2021/5/17 15:02 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberIssueStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题转议题统计 + * @author zhaoqifeng + * @date 2021/5/17 15:03 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberIssueStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织关闭议题数 + * @author zhaoqifeng + * @date 2021/5/25 17:18 + * @param customerId + * @param dateId + * @param closedStatus + * @return java.util.List + */ + List selectAgencyClosedIssueCount(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("closedStatus") String closedStatus); + + /** + * 3、当前网格内,议题关闭已解决数 + * 4、当前网格内,议题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved + * @param resolveType unresolved,resolved + * @return + */ + List selectGroupByGridId(@Param("customerId")String customerId, + @Param("gridIds")List gridIds, + @Param("issueStatus")String issueStatus, + @Param("resolveType")String resolveType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java index 8e18ad5500..3bdbc200bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectLogDailyDao.java @@ -18,12 +18,12 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; - import java.util.List; /** @@ -182,6 +182,28 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectGridResponse(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List selectOrgResponseDaily(@Param("customerId") String customerId, @Param("dateId") String dateId, + @Param("level")String level); + + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 10:01 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridResponseDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + /** * 组织项目响应度 * @author zhaoqifeng @@ -215,6 +237,27 @@ public interface FactOriginProjectLogDailyDao extends BaseDao selectOrgSatisfaction(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level")String level); + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridSatisfactionDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 15:52 + * @param customerId + * @param level + * @param dateId + * @return java.util.List + */ + List selectOrgSatisfactionDaily(@Param("customerId") String customerId, @Param("level")String level, @Param("dateId") String dateId); + /** * 获取部门办结项目数 * @author zhaoqifeng @@ -245,4 +288,42 @@ public interface FactOriginProjectLogDailyDao extends BaseDao */ List selectGridClosed(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 网格自治率统计--按天 + * @author zhaoqifeng + * @date 2021/5/24 17:53 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 组织网格自治率统计--按天 + * @author zhaoqifeng + * @date 2021/5/24 17:53 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectAgencyGridSelfDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @return java.util.List + * @param projectId + * @author yinzuomei + * @description 根据项目id, 查询处理明细 + * @Date 2021/5/27 12:58 + **/ + List selectListByProjectId(String projectId); + + /** + * @return com.epmet.dto.extract.FactOriginProjectLogDailyDTO + * @param projectId + * @author yinzuomei + * @description 查询某一个项目的结案操作明细 + * @Date 2021/5/27 12:58 + **/ + FactOriginProjectLogDailyDTO selectClosedLog(String projectId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index dbc532b90c..1c4aa60c18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -28,6 +28,8 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -157,6 +159,18 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getSelfProject(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + /** + * 组织自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getSelfProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId, + @Param("level") String level); + /** * 组织解决项目数 @@ -170,6 +184,18 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId, @Param("level") String level); + /** + * 组织解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getResolveProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId, + @Param("level") String level); + /** * 网格解决项目数 * @author zhaoqifeng @@ -180,6 +206,16 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getGridResolveProject(@Param("customerId") String customerId, @Param("monthId")String monthId); + /** + * 网格解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:16 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResolveProjectDaily(@Param("customerId") String customerId, @Param("dateId")String dateId); + /** * @Description 查询难点赌点的基本信息,要排除之前已经结案过的项目 * @param customerId @@ -370,4 +406,104 @@ public interface FactOriginProjectMainDailyDao extends BaseDao getProjectPeriodForDiff(@Param("customerId") String customerId, @Param("dateId") String dateId); List selectResponseCount(@Param("customerId") String customerId); + + + /** + * 获取组织级别党员发布话题转项目统计 + * @author zhaoqifeng + * @date 2021/5/17 15:02 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberProjectStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题转项目统计 + * @author zhaoqifeng + * @date 2021/5/17 15:03 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberProjectStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题结案统计 + * @author zhaoqifeng + * @date 2021/5/17 15:02 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberClosedProjectStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取组织级别党员发布话题结案统计 + * @author zhaoqifeng + * @date 2021/5/17 15:03 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberClosedProjectStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数、 + * 6、当前网格内:来源于议题的项目:结案无需解决数、 + * 7、当前网格内:项目立项,结案已解决数;默认为0、 + * 8、当前网格内:项目立项,结案无需解决数;默认为0、 + * + * @param customerId + * @param gridIds + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO + */ + List selectGroupByGrid(@Param("customerId")String customerId, + @Param("gridIds")List gridIds, + @Param("projectStatus")String projectStatus, + @Param("origin")String origin, + @Param("isResolved")String isResolved); + + /** + * 获取组织已结案项目 + * @author zhaoqifeng + * @date 2021/5/26 15:11 + * @param customerId + * @param dateId + * @param closedStatus + * @return java.util.List + */ + List selectAgencyClosedProjectCount(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param( + "closedStatus") String closedStatus, @Param("origin") String origin); + + /** + * 组织结案项目统计 + * @author zhaoqifeng + * @date 2021/5/27 14:51 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectAgencyClosedProjectStaticDaily(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 当前网格内已结案的项目 + * + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param gridId + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO + */ + List getGridClosedProjectList(@Param("customerId")String customerId, + @Param("gridId") String gridId, + @Param("projectStatus")String projectStatus, + @Param("origin") String origin, + @Param("isResolved")String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java index 103e85c748..1834e7fd04 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -147,4 +148,55 @@ public interface FactOriginTopicMainDailyDao extends BaseDao selectOrgTopicCount(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("level") String level); + + /** + * 组织内党员发布话题占比统计 + * @author zhaoqifeng + * @date 2021/5/17 10:29 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberTopicStaticByAgency(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 网格内党员发布话题占比统计 + * @author zhaoqifeng + * @date 2021/5/17 10:31 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectPartyMemberTopicStaticByGrid(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 1、当前网格内,话题关闭已解决数 + * 2、当前网格内,话题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param topicStatus 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * @param closedStatus unresolved,resolved + * @return + */ + List selectTopicGroupByGridId(@Param("customerId")String customerId, + @Param("gridIds")List gridIds, + @Param("topicStatus")String topicStatus, + @Param("closedStatus")String closedStatus, + @Param("shiftIssue")String shiftIssue); + + /** + * 获取组织已关闭话题数 + * @author zhaoqifeng + * @date 2021/5/25 15:45 + * @param customerId + * @param dateId + * @param closedStatus + * @param shiftIssue + * @return java.util.List + */ + List selectAgencyClosedTopicCount(@Param("customerId") String customerId, @Param("dateId") String dateId, + @Param("closedStatus") String closedStatus, @Param("shiftIssue") Integer shiftIssue); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java index c1b8e5b479..b4b6fc8869 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/CpcScoreDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.indexcal.CpcScoreResultDTO; import com.epmet.entity.evaluationindex.indexcal.CpcScoreEntity; +import com.epmet.model.AvgOperationResultVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -46,9 +47,9 @@ public interface CpcScoreDao extends BaseDao { * @description 获取网格内党员的联系群众能力考评分(平均值) * @Date 2020/8/31 10:56 **/ - BigDecimal selectGridContactMassesAvgValue(@Param("customerId") String customerId, - @Param("monthId") String monthId, - @Param("gridId") String gridId); + AvgOperationResultVO selectGridContactMassesAvgValue(@Param("customerId") String customerId, + @Param("monthId") String monthId, + @Param("gridId") String gridId); /** * @param formDTO @@ -77,7 +78,7 @@ public interface CpcScoreDao extends BaseDao { * @description 组织内党员的参与议事能力考评分(平均值) * @Date 2020/8/31 15:51 **/ - BigDecimal selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); + AvgOperationResultVO selectGridJoinIssueAvgValue(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("gridId") String gridId); int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId, @Param("indexCode") String indexCode, @Param("deleteSize") Integer deleteSize, @Param("isTotal") String isTotal); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java index a47ebdc88d..cc7277e9e0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyDao.java @@ -123,4 +123,14 @@ public interface FactIndexGovrnAblityGridMonthlyDao extends BaseDao */ List selectGridByCustomer(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 查询客户下网格治理能力 + * @author zhaoqifeng + * @date 2020/9/24 15:26 + * @param customerId + * @param dateId + * @return java.util.List + */ + List selectGridByCustomerDaily(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 53f4074eab..b0dedb0db5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.AgencyMonthCountResultDTO; import com.epmet.dto.extract.result.CustomerAgencyInfoResultDTO; import com.epmet.dto.extract.result.OrgNameResultDTO; +import com.epmet.dto.indexcal.AgencyAndParentResultDTO; import com.epmet.dto.indexcollect.form.CustomerBizOrgFormDTO; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.TreeResultDTO; @@ -33,6 +34,7 @@ import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; /** * 组织机构信息 @@ -99,6 +101,14 @@ public interface ScreenCustomerAgencyDao extends BaseDao selectAgencyIdAndParentId(@Param("customerId") String customerId); + /** * 返回当前客户下,未匹配到的 【乡(镇、街道)级、区县级】 组织信息 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.java new file mode 100644 index 0000000000..688d9b4d3f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenGovernRankDataDailyDao.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.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; +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-24 + */ +@Mapper +public interface ScreenGovernRankDataDailyDao extends BaseDao { + /** + * 组织级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @param level + * @return java.util.List + */ + List initAgencyDataList(@Param("customerId") String customerId, @Param("level") String level); + + /** + * 网格级别初始化数据 + * @author zhaoqifeng + * @date 2020/9/24 14:52 + * @param customerId + * @return java.util.List + */ + List initGridDataList(@Param("customerId") String customerId); + + /** + * 删除旧数据 + * @author zhaoqifeng + * @date 2020/9/25 10:38 + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param orgIds + * @return java.lang.Integer + */ + Integer deleteRankData(@Param("customerId") String customerId, @Param("orgType") String orgType, @Param("dateId") String dateId, + @Param("deleteSize") Integer deleteSize, + @Param("orgIds")List orgIds); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 32059b58b3..2cbd65788c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -1,11 +1,15 @@ package com.epmet.dao.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -90,4 +94,48 @@ public interface GroupDataDao { * @date 2020.09.18 22:45 **/ List groupExtracting(@Param("customerId")String customerId,@Param("dateId") String dateId); + + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 限制活动分类编码100001 三会一课 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectUserSignedCount(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectCountGridCreateThreeMeets(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @return com.epmet.dto.group.ActCategoryDictDTO + */ + List queryCustomerActCategoryDict(String customerId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * + * @param customerId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountGridGroupActDaily(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("categoryCode") String categoryCode, + @Param("gridId")String gridId); + + List selectCountAgencyGroupActDaily(@Param("customerId") String customerId, + @Param("agencyId")String agencyId, + @Param("dateId") String dateId, + @Param("categoryCode") String categoryCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 47f0e3da95..fc575d3024 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -59,4 +59,14 @@ public interface StatsCustomerAgencyDao extends BaseDao { * @return java.lang.String */ List selectAgencyStaffIds(@Param("customerId") String customerId,@Param("agencyId")String agencyId); + + List queryAgencyListByCustomerId(String customerId); + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity selectByDeptId(String deptId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 2d3318c262..44e47f6f92 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -18,12 +18,16 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.CustomerProjectParameterDTO; import com.epmet.dto.ProjectDTO; +import com.epmet.dto.ProjectSatisfactionStatisticsDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectPointDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -135,4 +139,23 @@ public interface ProjectDao extends BaseDao { List selectProjectCategory(@Param("list")List list); List getProjectCategoryData(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * 获取项目满意度 + * @author zhaoqifeng + * @date 2021/5/21 10:06 + * @param customerId + * @return java.util.List + */ + List selectProjectSatisfaction(@Param("customerId") String customerId); + + /** + * 根据key查找value + * @author zhaoqifeng + * @date 2021/5/21 10:58 + * @param customerId + * @param parameterKey + * @return java.lang.String + */ + String selectValueByKey(@Param("customerId") String customerId, @Param("parameterKey") String parameterKey); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index 0d614b2e4a..3e69bc2837 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -100,4 +100,12 @@ public interface DimCustomerPartymemberDao extends BaseDao selectPartyMemberUserIdsByPids(@Param("customerId") String customerId, @Param("pids")String pids); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.java new file mode 100644 index 0000000000..6428ba8104 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectDailyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactAgencyOriginProjectDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.java new file mode 100644 index 0000000000..2848f6e90b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyOriginProjectMonthlyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Mapper +public interface FactAgencyOriginProjectMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.java new file mode 100644 index 0000000000..a38c1d00b5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalAgencyDailyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Mapper +public interface FactGroupTotalAgencyDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java new file mode 100644 index 0000000000..cf88536956 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupTotalGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Mapper +public interface FactGroupTotalGridDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java new file mode 100644 index 0000000000..812935ef6e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardAgencyDailyDao.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactPartyMemberVanguardAgencyDailyDao extends BaseDao { + + /** + * 删除日统计数据 + * @author zhaoqifeng + * @date 2021/5/17 17:19 + * @param customerId + * @param dateId + * @return int + */ + int deleteDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardGridDailyDao.java new file mode 100644 index 0000000000..310bcabdef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactPartyMemberVanguardGridDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Mapper +public interface FactPartyMemberVanguardGridDailyDao extends BaseDao { + /** + * 删除日统计数据 + * @author zhaoqifeng + * @date 2021/5/17 17:19 + * @param customerId + * @param dateId + * @return int + */ + int deleteDailyData(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.java new file mode 100644 index 0000000000..a0ea409d91 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussAgencyDailyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Mapper +public interface FactTopicHotdiscussAgencyDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.java new file mode 100644 index 0000000000..6a2237cee6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTopicHotdiscussGridDailyDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Mapper +public interface FactTopicHotdiscussGridDailyDao extends BaseDao { + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index d9b11ddc6a..4f37200359 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -11,6 +11,7 @@ import com.epmet.dto.group.result.TopicContentResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -142,4 +143,10 @@ public interface TopicDao { List initNewScreenProjectImgData(@Param("customerId") String customerId, @Param("list") List list); ResiTopicAndImgResultDTO getTopicAndImgs(@Param("topicId") String topicId); + + /** + * @Author sun + * @Description 根据客户Id和截止日期查询话题业务数据 + **/ + List selectTopicList(@Param("customerId") String customerId, @Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java new file mode 100644 index 0000000000..2f37f9a113 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactAgencyGovernDailyEntity.java @@ -0,0 +1,174 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +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-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_govern_daily") +public class FactAgencyGovernDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 组织id + */ + private String agencyId; + + /** + * agency_id所属的机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 组织i所属的组织id + */ + private String pid; + + /** + * 组织i所有上级id + */ + private String pids; + + /** + * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 + */ + private Integer problemResolvedCount; + + /** + * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + */ + private BigDecimal groupSelfGovernRatio; + + /** + * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal gridSelfGovernRatio; + + /** + * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal communityClosedRatio; + + /** + * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal streetClosedRatio; + + /** + * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal districtDeptClosedRatio; + + /** + * 1、当前组织内,话题关闭已解决数 + */ + private Integer topicResolvedCount; + + /** + * 2、当前组织内,话题关闭无需解决数 + */ + private Integer topicUnResolvedCount; + + /** + * 3、当前组织内,议题关闭已解决数 + */ + private Integer issueResolvedCount; + + /** + * 4、当前组织内,议题关闭无需解决数 + */ + private Integer issueUnResolvedCount; + + /** + * 5、当前组织内:来源于议题的项目:结案已解决数 + */ + private Integer issueProjectResolvedCount; + + /** + * 6、当前组织内:来源于议题的项目:结案无需解决数 + */ + private Integer issueProjectUnResolvedCount; + + /** + * 7、当前组织内:项目立项,结案已解决数;默认为0, + */ + private Integer approvalProjectResolvedCount; + + /** + * 8、当前组织内:项目立项,结案无需解决数;默认为0, + */ + private Integer approvalProjectUnResolvedCount; + + /** + * 9、当前组织内,未出小组即未转议题的:话题关闭已解决数 + */ + private Integer inGroupTopicResolvedCount; + + /** + * 10、当前组织内,未出小组即未转议题的:话题关闭无需解决数 + */ + private Integer inGroupTopicUnResolvedCount; + + /** + * 未出当前网格的,结案项目数 + */ + private Integer gridSelfGovernProjectTotal; + + /** + * 当前组织内结案的项目中:由社区结案的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前组织内结案的项目中:由街道结案的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前组织内结案的项目中:由区直部门结案的项目总数 + */ + private Integer districtDeptClosedCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java new file mode 100644 index 0000000000..22fa2b2b67 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGridGovernDailyEntity.java @@ -0,0 +1,222 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_govern_daily") +public class FactGridGovernDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 数据更新至:yyyyMMdd; + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有上级id + */ + private String pids; + + /** + * 界面展示:问题解决总数=1+2+3+4+5+6+7+8 + */ + private Integer problemResolvedCount; + + /** + * 界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + */ + private BigDecimal groupSelfGovernRatio; + + /** + * 界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal gridSelfGovernRatio; + + /** + * 界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal communityClosedRatio; + + /** + * 界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal streetClosedRatio; + + /** + * 界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + */ + private BigDecimal districtDeptClosedRatio; + + /** + * 1、当前网格内,话题关闭已解决数 + */ + private Integer topicResolvedCount; + + /** + * 2、当前网格内,话题关闭无需解决数 + */ + private Integer topicUnResolvedCount; + + /** + * 3、当前网格内,议题关闭已解决数 + */ + private Integer issueResolvedCount; + + /** + * 4、当前网格内,议题关闭无需解决数 + */ + private Integer issueUnResolvedCount; + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数 + */ + private Integer issueProjectResolvedCount; + + /** + * 6、当前网格内:来源于议题的项目:结案无需解决数 + */ + private Integer issueProjectUnResolvedCount; + + /** + * 7、当前网格内:项目立项,结案已解决数;默认为0, + */ + private Integer approvalProjectResolvedCount; + + /** + * 8、当前网格内:项目立项,结案无需解决数;默认为0, + */ + private Integer approvalProjectUnResolvedCount; + + /** + * 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 + */ + private Integer inGroupTopicResolvedCount; + + /** + * 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数 + */ + private Integer inGroupTopicUnResolvedCount; + + /** + * 11、来源于议题的项目,未出网格结案并且已解决的项目数 + */ + private Integer fromIssueResolvedInGridCount; + + /** + * 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + */ + private Integer fromIssueUnResolvedInGridCount; + + /** + * 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyResolvedInGridCount; + + /** + * 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyUnResolvedInGridCount; + + /** + * 15、未出当前网格的,结案项目数=11+12+13+14 + */ + private Integer gridSelfGovernProjectTotal; + + + /** + * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer districtDeptClosedCount; + + + public FactGridGovernDailyEntity() { + this.customerId = StrConstant.EPMETY_STR; + this.dateId = StrConstant.EPMETY_STR; + this.gridId = StrConstant.EPMETY_STR; + this.pid = StrConstant.EPMETY_STR; + this.pids = StrConstant.EPMETY_STR; + //界面展示 + this.problemResolvedCount = NumConstant.ZERO; + this.groupSelfGovernRatio=BigDecimal.ZERO; + this.gridSelfGovernProjectTotal=NumConstant.ZERO; + this.communityClosedRatio=BigDecimal.ZERO; + this.streetClosedRatio=BigDecimal.ZERO; + this.districtDeptClosedRatio=BigDecimal.ZERO; + + this.topicResolvedCount=NumConstant.ZERO; + this.topicUnResolvedCount=NumConstant.ZERO; + this.issueResolvedCount=NumConstant.ZERO; + this.issueUnResolvedCount=NumConstant.ZERO; + this.issueProjectResolvedCount=NumConstant.ZERO; + this.issueProjectUnResolvedCount=NumConstant.ZERO; + this.approvalProjectResolvedCount=NumConstant.ZERO; + this.approvalProjectUnResolvedCount=NumConstant.ZERO; + this.inGroupTopicResolvedCount=NumConstant.ZERO; + this.inGroupTopicUnResolvedCount=NumConstant.ZERO; + this.fromIssueResolvedInGridCount=NumConstant.ZERO; + this.fromIssueUnResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO; + this.gridSelfGovernProjectTotal=NumConstant.ZERO; + this.communityClosedCount=NumConstant.ZERO; + this.streetClosedCount=NumConstant.ZERO; + this.districtDeptClosedCount=NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java new file mode 100644 index 0000000000..f128f25d3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActDailyEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +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-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_act_daily") +public class FactGroupActDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户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-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java new file mode 100644 index 0000000000..d90918a643 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactGroupActMonthlyEntity.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +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-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_act_monthly") +public class FactGroupActMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 数据维度:yyyyMM + */ + private String monthId; + + /** + * 网格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; + + /** + * 本月内:活动组织次数 + */ + private Integer organizeIncr; + + /** + * 本月内:活动签到人数参加人数 + */ + private Integer participateUserIncr; + + /** + * 本月内:平均参加人数 + */ + private Integer avgParticipateUserIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java index 8bb0ba12a1..34b01407d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMainDailyEntity.java @@ -116,4 +116,9 @@ Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审 */ private Integer isOwnerParty; + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java new file mode 100644 index 0000000000..97317f5868 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginGroupMemberDailyEntity.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.extract; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_group_member_daily") +public class FactOriginGroupMemberDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组Id + */ + private String groupId; + + /** + * 小组所在的网格id + */ + private String gridId; + + /** + * 小组所在的社区id + */ + private String agencyId; + + /** + * 小组所在的街道id + */ + private String parentId; + + /** + * 所有上级组织ID,英文:隔开 + */ + private String pids; + + /** + * 成员Id(userId) + */ + private String memberId; + + /** + * 客户Id + */ + private String customerId; + + /** + * leader(群主) member(成员) + */ + private String leaderFlag; + + /** + * 入群审核通过或自动加入群的日期 yyyyMMdd + */ + private String dateId; + + /** + * 入群周 2020W15 + */ + private String weekId; + + /** + * 入群月 202004 + */ + private String monthId; + + /** + * 入群季 2020Q2 + */ + private String quarterId; + + /** + * 入群年 2020 + */ + private String yearId; + + /** + * join(入群),群主建群自己入群也是join + */ + private String actionCode; + + /** + * 是否是党员 + */ + private Integer isParty; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java index 35d0e46b8f..be69a89f3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectMainDailyEntity.java @@ -138,6 +138,11 @@ public class FactOriginProjectMainDailyEntity extends BaseEpmetEntity { */ private String isOverdue; + /** + * 是否满意 1:是 + */ + private Integer isSatisfied; + /** * 办结组织Ids(:隔开,有可能是社区id可能是网格id,无需区分级别,在统计时模糊查询) */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java new file mode 100644 index 0000000000..fcc4193885 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridClosedTotalCommonDTO.java @@ -0,0 +1,64 @@ +package com.epmet.entity.evaluationindex.extract; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/26 15:47 + */ +@Data +public class GovernGridClosedTotalCommonDTO implements Serializable { + private static final long serialVersionUID = 7717094992132062415L; + private String gridId; + /** + * 11、来源于议题的项目,未出网格结案并且已解决的项目数 + */ + private Integer fromIssueResolvedInGridCount; + + /** + * 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + */ + private Integer fromIssueUnResolvedInGridCount; + + /** + * 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyResolvedInGridCount; + + /** + * 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + */ + private Integer fromAgencyUnResolvedInGridCount; + + /** + * 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + */ + private Integer communityClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer streetClosedCount; + + /** + * 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + */ + private Integer districtDeptClosedCount; + + public GovernGridClosedTotalCommonDTO(){ + this.gridId = StrConstant.EPMETY_STR; + this.fromIssueResolvedInGridCount=NumConstant.ZERO; + this.fromIssueUnResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyResolvedInGridCount=NumConstant.ZERO; + this.fromAgencyUnResolvedInGridCount=NumConstant.ZERO; + this.communityClosedCount=NumConstant.ZERO; + this.streetClosedCount=NumConstant.ZERO; + this.districtDeptClosedCount=NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java new file mode 100644 index 0000000000..38dae54c41 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernGridTotalCommonDTO.java @@ -0,0 +1,18 @@ +package com.epmet.entity.evaluationindex.extract; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格的治理指数,按天统计 计算过程中,通用dto + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/25 13:43 + */ +@Data +public class GovernGridTotalCommonDTO implements Serializable { + private String customerId; + private String gridId; + private Integer total; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java new file mode 100644 index 0000000000..b4dfa42239 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/GovernProjectInfoDTO.java @@ -0,0 +1,20 @@ +package com.epmet.entity.evaluationindex.extract; + +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/5/26 18:00 + */ +@Data +public class GovernProjectInfoDTO extends FactOriginProjectMainDailyDTO implements Serializable { + private FactOriginProjectLogDailyDTO closeLogDTO; + private List projectLogDTOList; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java index fa88df4ba7..f6bf4bb903 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/indexcal/GridSubScoreEntity.java @@ -101,4 +101,9 @@ public class GridSubScoreEntity extends BaseEpmetEntity { * 权重(同一组权重总和=1) */ private BigDecimal weight; + + /** + * 样本总量 + */ + private Integer sampleCount; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java new file mode 100644 index 0000000000..8bbe10f526 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenGovernRankDataDailyEntity.java @@ -0,0 +1,102 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_govern_rank_data_daily") +public class ScreenGovernRankDataDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 年Id + */ + private String yearId; + + /** + * 月份Id + */ + private String monthId; + + /** + * 数据更新至:yyyyMMdd + */ + private String dateId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 响应率 + */ + private BigDecimal responseRatio; + + /** + * 解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 自治率 + */ + private BigDecimal governRatio; + + /** + * 满意率 + */ + private BigDecimal satisfactionRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java new file mode 100644 index 0000000000..138bfba563 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/group/ResiGroupEntity.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.group; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 群组信息表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-28 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("resi_group") +public class ResiGroupEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 群头像(htt://地址) + */ + private String groupHeadPhoto; + + /** + * 小组名称 + */ + private String groupName; + + /** + * 群介绍 + */ + private String groupIntroduction; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格id + */ + private String gridId; + + /** + * 状态:(审核通过 - approved 、 审核中 - under_auditting、 审核未通过 - rejected 、 已屏蔽 - hidden、 已关闭 - closed) +Ps: 如果一个小组被拒绝,当前小组的状态将永久停留在“审核未通过” + */ + private String state; + + /** + * 最新话题时间 + */ + private Date latestTopicPublishDate; + + /** + * 进组审核open开启;close关闭 + */ + private String auditSwitch; + + /** + * VISIT_SWITCH 小组是否允许参观:允许:open;不允许:closed + */ + private String visitSwitch; + + /** + * 小组类型(ordinary:楼院小组 branch:支部小组) + */ + private String groupType; + + /** + * 小组等级 + */ + private Integer level; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java new file mode 100644 index 0000000000..cb239df727 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectDailyEntity.java @@ -0,0 +1,157 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_origin_project_daily") +public class FactAgencyOriginProjectDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 项目来源 来源:议题issue 组织agency + */ + private String origin; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java new file mode 100644 index 0000000000..2acda24617 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyOriginProjectMonthlyEntity.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_origin_project_monthly") +public class FactAgencyOriginProjectMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.java new file mode 100644 index 0000000000..814c9abd6a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalAgencyDailyEntity.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.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_total_agency_daily") +public class FactGroupTotalAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 当前组织及下级小组总数 + */ + private Integer groupTotal; + + /** + * 当前组织及下级楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 当前组织及下级支部小组总数 + */ + private Integer branchTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.java new file mode 100644 index 0000000000..995fe3fbb5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupTotalGridDailyEntity.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.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_total_grid_daily") +public class FactGroupTotalGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格下小组总数 + */ + private Integer groupTotal; + + /** + * 网格下楼院小组总数 + */ + private Integer ordinaryTotal; + + /** + * 网格下支部小组总数 + */ + private Integer branchTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardAgencyDailyEntity.java new file mode 100644 index 0000000000..44666ec1d9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardAgencyDailyEntity.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_party_member_vanguard_agency_daily") +public class FactPartyMemberVanguardAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardGridDailyEntity.java new file mode 100644 index 0000000000..5b591a8e7e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactPartyMemberVanguardGridDailyEntity.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_party_member_vanguard_grid_daily") +public class FactPartyMemberVanguardGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 党员建组数 + */ + private Integer groupCount; + + private Integer groupTotal; + private Integer groupMemberTotal; + private Integer topicTotal; + private Integer issueTotal; + private Integer projectTotal; + private Integer projectClosedTotal; + + /** + * 党员建组数占比 + */ + private BigDecimal groupRatio; + + /** + * 组内党员人数 + */ + private Integer groupMemberCount; + + /** + * 组内党员人数占比 + */ + private BigDecimal groupMemberRatio; + + /** + * 党员发布话题数 + */ + private Integer topicCount; + + /** + * 党员发布话题数占比 + */ + private BigDecimal topicRatio; + + /** + * 党员发布话题转议题数 + */ + private Integer issueCount; + + /** + * 党员发布话题转议题数占比 + */ + private BigDecimal issueRatio; + + /** + * 党员发布话题转项目数 + */ + private Integer projectCount; + + /** + * 党员发布话题转项目数占比 + */ + private BigDecimal projectRatio; + + /** + * 党员发布话题转项目结案数 + */ + private Integer projectClosedCount; + + /** + * 党员发布话题转项目结案数占比 + */ + private BigDecimal projectClosedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.java new file mode 100644 index 0000000000..4590334147 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussAgencyDailyEntity.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.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_hotdiscuss_agency_daily") +public class FactTopicHotdiscussAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.java new file mode 100644 index 0000000000..9b1fde9b74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTopicHotdiscussGridDailyEntity.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.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_hotdiscuss_grid_daily") +public class FactTopicHotdiscussGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题状态【热议中:hot_discuss】 + */ + private String status; + + /** + * 状态话题数量 + */ + private Integer topicCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java new file mode 100644 index 0000000000..d97ad2e264 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/model/AvgOperationResultVO.java @@ -0,0 +1,21 @@ +package com.epmet.model; + +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 平均值运算结果vo + */ +@Data +public class AvgOperationResultVO { + /** + * 样本量 + */ + private Integer sampleCount; + + /** + * 平均值 + */ + private BigDecimal avgValue; +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index 10bb4f3a46..c6019d1490 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -1,6 +1,9 @@ package com.epmet.service; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; + +import java.text.ParseException; /** * @Author zxc @@ -26,4 +29,15 @@ public interface StatsGroupService { */ void groupAgencyMonthly(GroupStatsFormDTO formDTO); + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + void gridGroupTotal(GroupTotalFormDTO formDTO); + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + void agencyGroupTotal(GroupTotalFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java new file mode 100644 index 0000000000..c4ba1d4fe2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPartyMemberVanguardService.java @@ -0,0 +1,31 @@ +package com.epmet.service; + +import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; + +/** + * 党员先锋相关统计 + * @author zhaoqifeng + * @date 2021/5/13 15:07 + */ +public interface StatsPartyMemberVanguardService { + /** + * 组织统计 + * @author zhaoqifeng + * @date 2021/5/13 15:13 + * @param formDTO + * @return void + */ + void agencyStats(StatsFormDTO formDTO); + + /** + * 网格统计 + * @author zhaoqifeng + * @date 2021/5/13 15:13 + * @param formDTO + * @return void + */ + void gridStats(StatsFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java index 0c17e21420..8a6464c255 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java @@ -1,6 +1,7 @@ package com.epmet.service; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; /** * @Description 话题统计Service接口 @@ -18,4 +19,16 @@ public interface StatsTopicService { * @date 2020.06.28 14:38 **/ void partition(StatsFormDTO formDTO); + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + void gridTopicStatus(TopicStatusFormDTO formDTO); + + /** + * @Author sun + * @Description 热议中话题-机关日统计 + **/ + void agencyTopicStatus(TopicStatusFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java index 6c7fad11c7..353c3ad882 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalCpcIndexServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthly import com.epmet.service.evaluationindex.extract.dataToIndex.CalCpcIndexService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityCpcMonthlyService; +import com.epmet.service.group.GroupDataService; import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -43,6 +44,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { private FactIndexPartyAblityCpcMonthlyService factIndexPartyAblityCpcMonthlyService; @Autowired private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Autowired + private GroupDataService groupDataService; /** * @param customerId 客户id @@ -54,7 +57,7 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { **/ @Override public void calCpcPartyAbility(String customerId, String monthId) { - //1、构造初始值 + //1、构造初始值 当前客户下所有的党员 List indexPartyAblityCpcList = dimCustomerPartymemberService.selectPartyMemberList(customerId); if (CollectionUtils.isEmpty(indexPartyAblityCpcList)) { log.info("dim_customer_partymember do not any records customerId="+customerId); @@ -71,7 +74,8 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { Map shiftIssueCountMap = calShiftIssueCount(customerId, monthId); //4、党员提出的议题转项目数 Map shiftProjectCountMap = calShiftProjectCount(customerId, monthId); - //5、参加“三会一课”次数 默认0 + //5、参加“三会一课”次数 默认0 :当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 + Map joinThreeMeetsCountMap=calJoinThreeMeetsCount(customerId,monthId); //可以先查询出每个党员的 自建群 Map> userCreatedGroups = queryUserCreatedGroups(customerId, indexPartyAblityCpcList); @@ -105,7 +109,10 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { if (shiftProjectCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setShiftProjectCount(shiftProjectCountMap.get(indexPartyAblityCpcEntity.getUserId())); } - //5、参加“三会一课”次数 目前没有此业务,默认0 + //5、参加“三会一课”次数 目前没有此业务,默认0 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 + if(joinThreeMeetsCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())){ + indexPartyAblityCpcEntity.setJoinThreeMeetsCount(joinThreeMeetsCountMap.get(indexPartyAblityCpcEntity.getUserId())); + } //6、党员自建群群众人数 if (groupUserCountMap.containsKey(indexPartyAblityCpcEntity.getUserId())) { indexPartyAblityCpcEntity.setGroupUserCount(groupUserCountMap.get(indexPartyAblityCpcEntity.getUserId())); @@ -220,6 +227,24 @@ public class CalCpcIndexServiceImpl implements CalCpcIndexService { return resultMap; } + /** + * @return java.util.Map + * @param customerId + * @param monthId + * @author yinzuomei + * @description 5:参加“三会一课”次数 : 当前用户在本月内活动签到次数 限制活动分类编码100001 三会一课 + * @Date 2021/5/12 13:38 + **/ + private Map calJoinThreeMeetsCount(String customerId, String monthId) { + //查询小组活动签到表,计算用户在本月内签到的活动次数 + List list=groupDataService.selectJoinThreeMeetsCount(customerId,monthId); + Map resultMap = new HashMap<>(); + for (CpcIndexCommonDTO cpcIndexCommonDTO : list) { + resultMap.put(cpcIndexCommonDTO.getUserId(), cpcIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + /** * @param customerId * @param monthId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index fc3c7532d1..f0c009064f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ExtractConstant; import com.epmet.constant.ProjectEvaluateConstant; @@ -8,6 +9,9 @@ import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.dto.indexcollect.result.PartyJoinThreeMeetDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.service.evaluationindex.extract.dataToIndex.CalGridIndexService; import com.epmet.service.evaluationindex.extract.todata.*; @@ -15,8 +19,10 @@ import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthl import com.epmet.service.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyService; import com.epmet.service.evaluationindex.screen.ScreenCustomerGridService; +import com.epmet.service.group.GroupDataService; import com.epmet.service.heart.ActInfoService; import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.FactArticlePublishedGridDailyService; import com.epmet.service.stats.user.FactRegUserGridMonthlyService; import com.epmet.service.user.UserService; @@ -29,7 +35,10 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -71,6 +80,10 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { private PartyMemberService partyMemberService; @Autowired private ScreenCustomerGridService gridService; + @Autowired + private GroupDataService groupDataService; + @Autowired + private DimCustomerPartymemberService dimCustomerPartymemberService; /** * @Description 计算网格指标党建能力 @@ -130,6 +143,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { }); } + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + Map createThreeMeetsCountMap=getCreateThreeMeetsCountMap(customerId,monthId); + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + List joinThreeMeetsCountList=getJoinThreeMeetsCountMap(customerId,monthId); + String quarterId = DateUtils.getQuarterId(monthId); String yearId = DateUtils.getYearId(monthId); result.forEach(r -> { @@ -217,6 +235,20 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { } }); } + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + if (createThreeMeetsCountMap.containsKey(r.getGridId())) { + r.setCreateThreeMeetsCount(createThreeMeetsCountMap.get(r.getGridId())); + } + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + if (!CollectionUtils.isEmpty(joinThreeMeetsCountList)) { + Integer joinThreeMeetsCount = NumConstant.ZERO; + for (PartyJoinThreeMeetDTO dto : joinThreeMeetsCountList) { + if (dto.getGridId().equals(r.getGridId())) { + joinThreeMeetsCount += dto.getJoinThreeMeetsCount(); + } + } + r.setJoinThreeMeetsCount(joinThreeMeetsCount); + } }); delPartyAbility(customerId, monthId); List> partition = ListUtils.partition(result, NumConstant.ONE_HUNDRED); @@ -226,6 +258,39 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { return true; } + private Map getCreateThreeMeetsCountMap(String customerId, String monthId) { + // 组织“三会一课”次数 前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + //查询小组活动签到表,计算用户在本月内签到的活动次数 + List list=groupDataService.selectCountGridCreateThreeMeets(customerId,monthId); + Map resultMap = new HashMap<>(); + for (GridIndexCommonDTO gridIndexCommonDTO : list) { + resultMap.put(gridIndexCommonDTO.getGridId(), gridIndexCommonDTO.getIndexValue()); + } + return resultMap; + } + + private List getJoinThreeMeetsCountMap(String customerId, String monthId) { + List partyJoinThreeMeetDTOList = new ArrayList<>(); + // 党员参加“三会一课”人次 :本网格内注册的党员,在本月内活动签到次数 + //1、查询出当前客户下注册的党员 + List list = dimCustomerPartymemberService.selectPartyMemberInfoByCustomerId(customerId); + if (!CollectionUtils.isEmpty(list)) { + partyJoinThreeMeetDTOList = ConvertUtils.sourceToTarget(list, PartyJoinThreeMeetDTO.class); + //2、查询出所有用户本月签到次数 + List userList = groupDataService.selectJoinThreeMeetsCount(customerId, monthId); + for (PartyJoinThreeMeetDTO partyJoinThreeMeetDTO : partyJoinThreeMeetDTOList) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(NumConstant.ZERO); + for (CpcIndexCommonDTO cpcIndexCommonDTO : userList) { + if (partyJoinThreeMeetDTO.getUserId().equals(cpcIndexCommonDTO.getUserId())) { + partyJoinThreeMeetDTO.setJoinThreeMeetsCount(cpcIndexCommonDTO.getIndexValue()); + break; + } + } + } + } + return partyJoinThreeMeetDTOList; + } + /** * @Description 计算网格指标治理能力 * @param customerId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java index 80e087bc3f..b21eee911b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexOriginExtractServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.evaluationindex.extract.dataToIndex.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.extract.form.ExtractIndexFormDTO; import com.epmet.service.evaluationindex.extract.dataToIndex.*; import com.epmet.service.stats.DimCustomerService; @@ -72,6 +73,7 @@ public class IndexOriginExtractServiceImpl implements IndexOriginExtractService ExtractIndexFormDTO param = new ExtractIndexFormDTO(); param.setCustomerId(cId); param.setMonthId(finalMonthId); + ValidatorUtils.validateEntity(param, ExtractIndexFormDTO.AddUserInternalGroup.class); submitJob(param); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java new file mode 100644 index 0000000000..0504164079 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactAgencyGovernDailyService.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface FactAgencyGovernDailyService extends BaseService { + + /** + * 治理指数-组织相关 + * @author zhaoqifeng + * @date 2021/5/25 14:10 + * @param customerId + * @param dateId + * @return void + */ + void extractFactAgencyGovernDaily(String customerId, String dateId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java new file mode 100644 index 0000000000..15447342ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGridGovernDailyService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; +import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface FactGridGovernDailyService extends BaseService { + // 指标解释: + // 1、问题解决总数:当前网格内,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 2、党群自治占比:当前网格内,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 3、网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + /** + * 治理指数-网格相关:问题解决总数、党群自治占比、网格自治占比 + * + * + * @param fromDTO + * @return + */ + void extractFactGridGovernDaily(ExtractFactGridGovernDailyFromDTO fromDTO); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java new file mode 100644 index 0000000000..6c8ee23cd7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActDailyService.java @@ -0,0 +1,48 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactGroupActDailyService extends BaseService { + + /** + * 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + void extractGridGroupActDaily(String customerId, String dateId); + + /** + * 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + void extractAgencyGroupActDaily(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java new file mode 100644 index 0000000000..1d7391b8b4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactGroupActMonthlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactGroupActMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java index 730acde2c8..89beadf503 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMainDailyService.java @@ -26,6 +26,7 @@ import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; import java.util.List; +import java.util.Map; /** @@ -64,7 +65,8 @@ public interface FactOriginGroupMainDailyService extends BaseService originGroupData, List memberList, List missing); + boolean insertExtractedData(boolean isFirst, String customerId, String dateId, List originGroupData, + List memberList, List missing, List partyIds); /** * @param customerId @@ -105,4 +107,22 @@ public interface FactOriginGroupMainDailyService extends BaseService */ List getOrgGroupCount(String customerId, String monthId, String level); + + /** + * @Author sun + * @Description 查询客户小组维度下有效群组列表 + **/ + List getGroupListByCustomerId(String customerId, String dateId); + + /** + * 获取组织/网格级别党员建组统计 + * @author zhaoqifeng + * @date 2021/5/13 16:55 + * @param customerId + * @param dateId + * @param type agency grid + * @return java.util.List + */ + Map getPartyMemberGroupStatic(String customerId, String dateId, String type); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java new file mode 100644 index 0000000000..53ff5cf084 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginGroupMemberDailyService.java @@ -0,0 +1,107 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactOriginGroupMemberDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactOriginGroupMemberDailyDTO + * @author generator + * @date 2021-05-12 + */ + FactOriginGroupMemberDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactOriginGroupMemberDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactOriginGroupMemberDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); + + /** + * 获取小组党员统计 + * @author zhaoqifeng + * @date 2021/5/14 10:33 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getGroupPartyMemberStatic(String customerId, String dateId, String type); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java index de2ac6f8c7..cf25f79ebb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginIssueMainDailyService.java @@ -20,8 +20,10 @@ package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import java.util.List; +import java.util.Map; /** * 议题主表 @@ -110,4 +112,39 @@ public interface FactOriginIssueMainDailyService extends BaseService */ List getOrgIssueCount(String customerId, String monthId, String level); + + /** + * 获取组织/网格级别党员发布话题转议题统计 + * @author zhaoqifeng + * @date 2021/5/17 14:52 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberIssueStatic(String customerId, String dateId, String type); + + /** + * 3、当前网格内,议题关闭已解决数 + * 4、当前网格内,议题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved + * @param resolveType unresolved,resolved + * @return + */ + List queryGridIssueValue(String customerId, List gridIds, String issueStatus, String resolveType); + + /** + * 获取组织关闭议题数 + * @author zhaoqifeng + * @date 2021/5/25 17:09 + * @param customerId + * @param dateId + * @param closedStatus + * @return java.util.Map + */ + Map getAgencyClosedIssueCount(String customerId, String dateId, String closedStatus); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index c337c085da..b925cc31e4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -218,6 +218,27 @@ public interface FactOriginProjectLogDailyService extends BaseService getOrgResponse(String customerId, String monthId, String level); + /** + * 网格项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResponseDaily(String customerId, String dateId); + + /** + * 组织项目响应度 + * @author zhaoqifeng + * @date 2020/9/25 9:56 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getOrgResponseDaily(String customerId, String dateId, String level); + /** * 网格满意率 * @author zhaoqifeng @@ -239,6 +260,27 @@ public interface FactOriginProjectLogDailyService extends BaseService getOrgSatisfaction(String customerId, String monthId, String level); + /** + * 网格满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridSatisfactionDaily(String customerId, String dateId); + + /** + * 组织满意率 + * @author zhaoqifeng + * @date 2020/9/27 16:06 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getOrgSatisfactionDaily(String customerId, String dateId, String level); + /** * 获取部门办结项目数 * @author zhaoqifeng @@ -268,4 +310,24 @@ public interface FactOriginProjectLogDailyService extends BaseService */ List getGridClosed(String customerId, String monthId); + + /** + * 网格自制率统计-按天 + * @author zhaoqifeng + * @date 2021/5/24 17:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridSelfDaily(String customerId, String dateId); + + /** + * 组织网格自制率统计-按天 + * @author zhaoqifeng + * @date 2021/5/24 17:52 + * @param customerId + * @param dateId + * @return java.util.List + */ + Map getAgencyGridSelfDaily(String customerId, String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 449e546658..d9a4c12c93 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -29,9 +29,12 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import java.util.List; +import java.util.Map; /** * 项目主表_日统计 @@ -145,6 +148,17 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getSelfProject(String customerId, String monthId, String level); + /** + * 自治项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getSelfProjectDaily(String customerId, String dateId, String level); + /** * 已解决项目数 * @author zhaoqifeng @@ -155,6 +169,16 @@ public interface FactOriginProjectMainDailyService extends BaseService */ List getResolveProject(String customerId, String monthId, String level); + /** + * 已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @param level + * @return java.util.List + */ + List getResolveProjectDaily(String customerId, String dateId, String level); /** * 网格已解决项目数 @@ -166,6 +190,16 @@ public interface FactOriginProjectMainDailyService extends BaseService getGridResolveProject(String customerId, String monthId); + /** + * 网格已解决项目数 + * @author zhaoqifeng + * @date 2020/9/25 15:34 + * @param customerId + * @param dateId + * @return java.util.List + */ + List getGridResolveProjectDaily(String customerId, String dateId); + /** * 网格项目数 * @author zhaoqifeng @@ -367,4 +401,80 @@ public interface FactOriginProjectMainDailyService extends BaseService list, String customerId); + /** + * 获取组织/网格级别党员发布话题转项目统计 + * @author zhaoqifeng + * @date 2021/5/17 15:25 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberProjectStatic(String customerId, String dateId, String type); + + /** + * 获取组织/网格级别党员发布话题结案统计 + * @author zhaoqifeng + * @date 2021/5/17 15:39 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberClosedProjectStatic(String customerId, String dateId, String type); + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数、 + * 6、当前网格内:来源于议题的项目:结案无需解决数、 + * 7、当前网格内:项目立项,结案已解决数;默认为0、 + * 8、当前网格内:项目立项,结案无需解决数;默认为0、 + * + * @param customerId + * @param gridIds + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return + */ + List queryGridProjectValue(String customerId, List gridIds, String projectStatus, String origin, String isResolved); + + /** + * 获取组织关闭项目数 + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param dateId + * @param closedStatus + * @param origin + * @return java.util.Map + */ + Map getAgencyClosedProjectCount(String customerId, String dateId, String closedStatus, String origin); + + /** + * 组织结案项目统计 + * @author zhaoqifeng + * @date 2021/5/27 14:56 + * @param customerId + * @param dateId + * @return java.util.Map> + */ + Map> getAgencyClosedProjectStatic(String customerId, String dateId); + + /** + * 当前网格内已结案的项目 + * + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param gridId + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO + */ + List getGridClosedProjectList(String customerId, + String gridId, + String projectStatus, + String origin, + String isResolved); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java index 5c4f8da390..7486daa191 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginTopicMainDailyService.java @@ -23,8 +23,10 @@ import com.epmet.dto.extract.result.CreateTopicCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import java.util.List; +import java.util.Map; /** @@ -111,4 +113,43 @@ public interface FactOriginTopicMainDailyService extends BaseService */ List getOrgTopicCount(String customerId, String monthId, String level); + + /** + * 获取组织/网格级别党员发布话题统计 + * @author zhaoqifeng + * @date 2021/5/17 14:25 + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + */ + Map getPartyMemberTopicStatic(String customerId, String dateId, String type); + + /** + * 1、当前网格内,话题关闭已解决数 + * 2、当前网格内,话题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param topicStatus 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * @param closedStatus unresolved,resolved + * @param shiftIssue 是否转为议题,0:false,1:true; + * @return + */ + List queryGridTopicValue(String customerId, List gridIds, String topicStatus, String closedStatus, String shiftIssue); + + + /** + * 获取组织已关闭话题数 + * @author zhaoqifeng + * @date 2021/5/25 15:02 + * @param customerId + * @param dateId + * @param closedStatus + * @param shiftIssue + * @return java.util.List + */ + Map getAgencyClosedTopicCount(String customerId, String dateId, String closedStatus, Integer shiftIssue); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java new file mode 100644 index 0000000000..6629836e02 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactAgencyGovernDailyServiceImpl.java @@ -0,0 +1,334 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.*; +import com.epmet.dao.evaluationindex.extract.FactAgencyGovernDailyDao; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.evaluationindex.extract.FactAgencyGovernDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.*; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.util.DimIdGenerator; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * 组织的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Service +public class FactAgencyGovernDailyServiceImpl extends BaseServiceImpl implements FactAgencyGovernDailyService { + + @Resource + private DimAgencyService dimAgencyService; + @Resource + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Resource + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Resource + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Resource + private FactOriginProjectLogDailyService factOriginProjectLogDailyService; + + /** + * 治理指数-组织相关 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2021/5/25 14:10 + */ + @Override + public void extractFactAgencyGovernDaily(String customerId, String dateId) { + List agencyList = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGovernDailyList = agencyList.stream().map(agency -> initEntity(agency, dateId)).collect(Collectors.toList()); + // 1.问题解决总数:当前组织下,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 话题总数 + Map topicTotal = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, null, + null); + if (!topicTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicTotal.get(item.getAgencyId()); + if (null != dto) { + item.setProblemResolvedCount(dto.getSum()); + } + }); + //当前组织内,话题关闭已解决数 + Map topicResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, + ProjectConstant.RESOLVED, + null); + if (!topicResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setTopicResolvedCount(dto.getSum()); + } + }); + } + //当前组织内,话题关闭未解决数 + Map topicUnResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, + ProjectConstant.UNRESOLVED, + null); + if (!topicUnResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicUnResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setTopicUnResolvedCount(dto.getSum()); + } + }); + } + //当前组织内,话题关闭已解决数 + Map topicSelfResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, dateId, + ProjectConstant.RESOLVED, + NumConstant.ZERO); + if (!topicSelfResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicSelfResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setInGroupTopicResolvedCount(dto.getSum()); + } + }); + } + //当前组织内,话题关闭未解决数 + Map topicSelfUnResolvedCount = factOriginTopicMainDailyService.getAgencyClosedTopicCount(customerId, + dateId, + ProjectConstant.UNRESOLVED, + NumConstant.ZERO); + if (!topicSelfUnResolvedCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = topicSelfUnResolvedCount.get(item.getAgencyId()); + if (null != dto) { + item.setInGroupTopicUnResolvedCount(dto.getSum()); + } + }); + } + } + //议题总数 + Map issueTotal = factOriginIssueMainDailyService.getAgencyClosedIssueCount(customerId, dateId, null); + if (!issueTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueTotal.get(item.getAgencyId()); + if (null != dto) { + item.setProblemResolvedCount(item.getProblemResolvedCount() + dto.getSum()); + } + }); + // 当前组织内,议题关闭已解决数 + Map issueResolvedTotal = factOriginIssueMainDailyService.getAgencyClosedIssueCount(customerId, dateId, + IssueConstant.CLOSED_RESOLVED); + if (!issueResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueResolvedCount(dto.getSum()); + } + }); + } + // 当前组织内,议题关闭未解决数 + Map issueUnResolvedTotal = factOriginIssueMainDailyService.getAgencyClosedIssueCount(customerId, dateId, + IssueConstant.CLOSED_UNRESOLVED); + if (!issueUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueUnResolvedCount(dto.getSum()); + } + }); + } + } + //项目总数 + Map projectTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, dateId, null, + null); + if (!projectTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = projectTotal.get(item.getAgencyId()); + if (null != dto) { + item.setProblemResolvedCount(item.getProblemResolvedCount() + dto.getSum()); + } + }); + // 当前组织内:来源于议题的项目:结案已解决数 + Map issueProjectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + "issue"); + if (!issueProjectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueProjectResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueProjectResolvedCount(dto.getSum()); + } + }); + } + // 当前组织内:来源于议题的项目:结案无需解决数 + Map issueProjectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + "issue"); + if (!issueProjectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = issueProjectUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setIssueProjectUnResolvedCount(dto.getSum()); + } + }); + } + + // 当前组织内:来源于议题的项目:结案已解决数 + Map projectResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.RESOLVED, + OrgTypeConstant.AGENCY); + if (!projectResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = projectResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setApprovalProjectResolvedCount(dto.getSum()); + } + }); + } + // 当前组织内:来源于议题的项目:结案无需解决数 + Map projectUnResolvedTotal = factOriginProjectMainDailyService.getAgencyClosedProjectCount(customerId, + dateId, ProjectConstant.UNRESOLVED, + OrgTypeConstant.AGENCY); + if (!projectUnResolvedTotal.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = projectUnResolvedTotal.get(item.getAgencyId()); + if (null != dto) { + item.setApprovalProjectUnResolvedCount(dto.getSum()); + } + }); + } + } + // 2.党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + agencyGovernDailyList.forEach(item -> { + int count = item.getInGroupTopicResolvedCount() + item.getInGroupTopicUnResolvedCount(); + int sum = item.getProblemResolvedCount(); + if (sum != NumConstant.ZERO) { + BigDecimal resolveCount = new BigDecimal(sum); + BigDecimal selfCount = new BigDecimal(count); + item.setGroupSelfGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + }); + // 3.网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + Map gridSelfCount = factOriginProjectLogDailyService.getAgencyGridSelfDaily(customerId, dateId); + if (!gridSelfCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + OrgStatisticsResultDTO dto = gridSelfCount.get(item.getAgencyId()); + if (null != dto) { + int count = dto.getCount(); + int sum = item.getProblemResolvedCount(); + if (sum != NumConstant.ZERO) { + BigDecimal resolveCount = new BigDecimal(sum); + BigDecimal selfCount = new BigDecimal(count); + item.setGridSelfGovernRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + } + }); + } + // 4.社区解决占比:当前组织下,由社区结案的项目数与问题解决总数之比 + // 5.区直部门解决占比:当前组织下,由区级部门结案的项目数与问题解决总数之比 + // 6.街道解决占比:当前组织下,由街道结案的项目数与问题解决总数之比 + Map> projectCount = factOriginProjectMainDailyService.getAgencyClosedProjectStatic(customerId, dateId); + if (!gridSelfCount.isEmpty()) { + agencyGovernDailyList.forEach(item -> { + List list = projectCount.get(item.getAgencyId()); + if (CollectionUtils.isNotEmpty(list)) { + Map map = list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getLevel, + Function.identity())); + int sum = item.getProblemResolvedCount(); + BigDecimal resolveCount = new BigDecimal(sum); + if (sum != NumConstant.ZERO) { + // 社区解决占比 + OrgStatisticsResultDTO community = map.get(ScreenConstant.COMMUNITY); + if (null != community) { + int count = community.getSum(); + BigDecimal selfCount = new BigDecimal(count); + item.setCommunityClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + item.setCommunityClosedCount(count); + } + // 街道解决占比 + OrgStatisticsResultDTO street = map.get(ScreenConstant.STREET); + if (null != street) { + int count = street.getSum(); + BigDecimal selfCount = new BigDecimal(count); + item.setStreetClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + item.setStreetClosedCount(count); + } + // 区直部门解决占比 + OrgStatisticsResultDTO districtDept = map.get(ScreenConstant.DISTRICT); + if (null != districtDept) { + int count = districtDept.getCount(); + BigDecimal selfCount = new BigDecimal(count); + item.setDistrictDeptClosedRatio(selfCount.divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + item.setDistrictDeptClosedCount(count); + } + } + } + }); + } + if (CollectionUtils.isNotEmpty(agencyGovernDailyList)) { + int deleteNum; + do { + deleteNum = baseDao.deleteAgencyGovernDailyData(customerId, dateId, IndexCalConstant.DELETE_SIZE); + } while (deleteNum != NumConstant.ZERO); + //删除旧数据 + insertBatch(agencyGovernDailyList); + } + } + + private FactAgencyGovernDailyEntity initEntity(DimAgencyDTO agency, String dateId) { + FactAgencyGovernDailyEntity entity = new FactAgencyGovernDailyEntity(); + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setLevel(agency.getLevel()); + entity.setPid(agency.getPid()); + entity.setPids(agency.getPids()); + entity.setDateId(dateId); + entity.setProblemResolvedCount(NumConstant.ZERO); + entity.setGroupSelfGovernRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGridSelfGovernRatio(new BigDecimal(NumConstant.ZERO)); + entity.setCommunityClosedRatio(new BigDecimal(NumConstant.ZERO)); + entity.setStreetClosedRatio(new BigDecimal(NumConstant.ZERO)); + entity.setDistrictDeptClosedRatio(new BigDecimal(NumConstant.ZERO)); + entity.setTopicResolvedCount(NumConstant.ZERO); + entity.setTopicUnResolvedCount(NumConstant.ZERO); + entity.setIssueResolvedCount(NumConstant.ZERO); + entity.setIssueUnResolvedCount(NumConstant.ZERO); + entity.setIssueProjectResolvedCount(NumConstant.ZERO); + entity.setIssueProjectUnResolvedCount(NumConstant.ZERO); + entity.setApprovalProjectResolvedCount(NumConstant.ZERO); + entity.setApprovalProjectUnResolvedCount(NumConstant.ZERO); + entity.setInGroupTopicResolvedCount(NumConstant.ZERO); + entity.setInGroupTopicUnResolvedCount(NumConstant.ZERO); + entity.setGridSelfGovernProjectTotal(NumConstant.ZERO); + entity.setCommunityClosedCount(NumConstant.ZERO); + entity.setStreetClosedCount(NumConstant.ZERO); + entity.setDistrictDeptClosedCount(NumConstant.ZERO); + return entity; + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java new file mode 100644 index 0000000000..2a9b0e4120 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGridGovernDailyServiceImpl.java @@ -0,0 +1,540 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DimObjectActionConstant; +import com.epmet.constant.DimObjectStatusConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dao.evaluationindex.extract.FactGridGovernDailyDao; +import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; +import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; +import com.epmet.dto.org.GridInfoDTO; +import com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridClosedTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerGridService; +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.text.NumberFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * 网格的治理指数,按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Slf4j +@Service +public class FactGridGovernDailyServiceImpl extends BaseServiceImpl implements FactGridGovernDailyService { + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Autowired + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Autowired + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + @Autowired + private CustomerGridService customerGridService; + @Autowired + private CustomerAgencyService customerAgencyService; + + // 指标解释: + // 1、问题解决总数:当前网格内,话题关闭(已解决+无需解决)总数、议题关闭(已解决+无需解决)总数和项目结案(议题转为项目的结案数+项目立项结案数)总数之和 + // 2、党群自治占比:当前网格内,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 3、网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + /** + * 治理指数-网格相关:问题解决总数、党群自治占比、网格自治占比 + * + * @param fromDTO + * @return + */ + @Override + public void extractFactGridGovernDaily(ExtractFactGridGovernDailyFromDTO fromDTO) { + String customerId=fromDTO.getCustomerId(); + String dateId=fromDTO.getDateId(); + log.info("extractFactGridGovernDaily start customerId="+customerId+";dateId="+dateId); + //客户id, dateId不能为空 + if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ + return; + } + // 2、当前客户下所有的网格 + List gridInfoDTOList=customerGridService.queryGridInfoList(customerId); + if(CollectionUtils.isEmpty(gridInfoDTOList)){ + log.info("当前客户customerId=("+customerId+")下没有网格,无需计算"); + return; + } + List gridIds=gridInfoDTOList.stream().map(GridInfoDTO::getGridId).collect(Collectors.toList()); + List insertEntityList=this.constructFactGridGovernDailyEntityList(customerId,dateId,gridInfoDTOList); + log.info("==========================当前客户下多少个网格? "+insertEntityList.size()); + + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + Map topicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,null); + Map topicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,null); + Map issueResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED); + Map issueUnResolvedMap=getIssueMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED); + Map issueProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.RESOLVED); + Map issueProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_ISSUE,DimObjectStatusConstant.UNRESOLVED); + Map approvalProjectResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.RESOLVED); + Map approvalProjectUnResolvedMap=getGridProjectMap(customerId,null,ProjectConstant.CLOSED,ProjectConstant.PROJECT_ORIGIN_AGENCY,DimObjectStatusConstant.UNRESOLVED); + Map inGroupTopicResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.RESOLVED,NumConstant.ZERO_STR); + Map inGroupTopicUnResolvedMap=getTopicMap(customerId, null,ProjectConstant.CLOSED, DimObjectStatusConstant.UNRESOLVED,NumConstant.ZERO_STR); + Map dtoMap=getGovernGridClosedTotalCommonDTOMap(customerId,gridIds); + + for(FactGridGovernDailyEntity insertEntity:insertEntityList){ + //1、当前网格内,话题关闭已解决数 + if(topicResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setTopicResolvedCount(topicResolvedMap.get(insertEntity.getGridId())); + } + //2、当前网格内,话题关闭无需解决数 + if(topicUnResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setTopicUnResolvedCount(topicUnResolvedMap.get(insertEntity.getGridId())); + } + + + //3、当前网格内,议题关闭已解决数 + if(issueResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setIssueResolvedCount(issueResolvedMap.get(insertEntity.getGridId())); + } + //4、当前网格内,议题关闭无需解决数 + if(issueUnResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setIssueUnResolvedCount(issueUnResolvedMap.get(insertEntity.getGridId())); + } + + + // 5、当前网格内:来源于议题的项目:结案已解决数 + if(issueProjectResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setIssueProjectResolvedCount(issueProjectResolvedMap.get(insertEntity.getGridId())); + } + // 6、当前网格内:来源于议题的项目:结案无需解决数 + if(issueProjectUnResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setIssueProjectUnResolvedCount(issueProjectUnResolvedMap.get(insertEntity.getGridId())); + } + //7、当前网格内:项目立项,结案已解决数;默认为0, + if(approvalProjectResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setApprovalProjectResolvedCount(approvalProjectResolvedMap.get(insertEntity.getGridId())); + } + // 8、当前网格内:项目立项,结案无需解决数;默认为0, + if(approvalProjectUnResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setApprovalProjectUnResolvedCount(approvalProjectUnResolvedMap.get(insertEntity.getGridId())); + } + + // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + // 9、当前网格内,未出小组即未转议题的:话题关闭已解决数 + if(inGroupTopicResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setInGroupTopicResolvedCount(inGroupTopicResolvedMap.get(insertEntity.getGridId())); + } + // 10、当前网格内,未出小组即未转议题的:话题关闭无需解决数 + if(inGroupTopicUnResolvedMap.containsKey(insertEntity.getGridId())){ + insertEntity.setInGroupTopicUnResolvedCount(inGroupTopicUnResolvedMap.get(insertEntity.getGridId())); + } + + if (dtoMap.containsKey(insertEntity.getGridId()) && null != dtoMap.get(insertEntity.getGridId())) { + // 11、来源于议题的项目,未出网格结案并且已解决的项目数 + insertEntity.setFromIssueResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromIssueResolvedInGridCount()); + // 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + insertEntity.setFromIssueUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromIssueUnResolvedInGridCount()); + // 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + insertEntity.setFromAgencyResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyResolvedInGridCount()); + // 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + insertEntity.setFromAgencyUnResolvedInGridCount(dtoMap.get(insertEntity.getGridId()).getFromAgencyUnResolvedInGridCount()); + // 所有网格内结案项目数(未出网格)=来源于议题的项目结案已解决+来源于议题的项目结案无需解决+来源于立项的项目结案已解决+来源于立项的项目结案无需解决 + // 15、未出当前网格的,结案项目数=11+12+13+14 + insertEntity.setGridSelfGovernProjectTotal(insertEntity.getFromIssueResolvedInGridCount()+insertEntity.getFromIssueUnResolvedInGridCount()+ + insertEntity.getFromAgencyResolvedInGridCount()+insertEntity.getFromAgencyUnResolvedInGridCount()); + + //当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + insertEntity.setCommunityClosedCount(dtoMap.get(insertEntity.getGridId()).getCommunityClosedCount()); + //当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + insertEntity.setStreetClosedCount(dtoMap.get(insertEntity.getGridId()).getStreetClosedCount()); + //当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + insertEntity.setDistrictDeptClosedCount(dtoMap.get(insertEntity.getGridId()).getDistrictDeptClosedCount()); + } + + //界面展示:1、问题解决总数=1+2+3+4+5+6+7+8 + insertEntity.setProblemResolvedCount(insertEntity.getTopicResolvedCount()+insertEntity.getTopicUnResolvedCount() + +insertEntity.getIssueResolvedCount()+insertEntity.getIssueUnResolvedCount() + +insertEntity.getIssueProjectResolvedCount()+insertEntity.getIssueProjectUnResolvedCount() + +insertEntity.getApprovalProjectResolvedCount()+insertEntity.getApprovalProjectUnResolvedCount()); + + // 党群自治占比:当前组织下,所有小组内关闭(已解决+无需解决)的话题数与问题解决总数之比(未出小组:未转议题的) + //界面展示:2、党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数 + int groupSelfGovernRatioFz=insertEntity.getInGroupTopicResolvedCount()+insertEntity.getInGroupTopicUnResolvedCount(); + if (NumConstant.ZERO == groupSelfGovernRatioFz || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { + insertEntity.setGroupSelfGovernRatio(BigDecimal.ZERO); + }else{ + String groupSelfGovernRatioStr = numberFormat.format((float) groupSelfGovernRatioFz / insertEntity.getProblemResolvedCount()); + insertEntity.setGroupSelfGovernRatio(new BigDecimal(groupSelfGovernRatioStr)); + } + + // 网格自治占比:当前组织下,所有网格内结案项目数与问题解决总数之比(未出网格) + //界面展示:3、网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + if(NumConstant.ZERO==insertEntity.getGridSelfGovernProjectTotal()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()){ + insertEntity.setGridSelfGovernRatio(BigDecimal.ZERO); + }else{ + String gridSelfGovernRatioStr = numberFormat.format((float) insertEntity.getGridSelfGovernProjectTotal() / insertEntity.getProblemResolvedCount()); + insertEntity.setGridSelfGovernRatio(new BigDecimal(gridSelfGovernRatioStr)); + } + + //界面展示:4、社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + //网格内出来的项目,最终由社区结案的项目数 + if (NumConstant.ZERO == insertEntity.getCommunityClosedCount()||NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { + insertEntity.setCommunityClosedRatio(BigDecimal.ZERO); + }else{ + String setCommunityClosedRatioStr = numberFormat.format((float) insertEntity.getCommunityClosedCount() / insertEntity.getProblemResolvedCount()); + insertEntity.setCommunityClosedRatio(new BigDecimal(setCommunityClosedRatioStr)); + } + + // 界面展示:5、街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + //网格内出来的项目,最终由街道结案的项目数 + if (NumConstant.ZERO == insertEntity.getStreetClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { + insertEntity.setStreetClosedRatio(BigDecimal.ZERO); + } else { + String streetClosedRatioStr = numberFormat.format((float) insertEntity.getStreetClosedCount() / insertEntity.getProblemResolvedCount()); + insertEntity.setStreetClosedRatio(new BigDecimal(streetClosedRatioStr)); + } + + //界面展示:6、区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数 + //网格内出来的项目,最终由区直部门结案的项目数 + if (NumConstant.ZERO == insertEntity.getDistrictDeptClosedCount() || NumConstant.ZERO == insertEntity.getProblemResolvedCount()) { + insertEntity.setDistrictDeptClosedRatio(BigDecimal.ZERO); + } else { + String setDistrictDeptClosedRatioStr = numberFormat.format((float) insertEntity.getDistrictDeptClosedCount() / insertEntity.getProblemResolvedCount()); + insertEntity.setDistrictDeptClosedRatio(new BigDecimal(setDistrictDeptClosedRatioStr)); + } + + } + // 先删除,后新增 + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatchByCustomerIdAndDateId(customerId, dateId, NumConstant.TWO_HUNDRED); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + this.insertBatch(insertEntityList); + log.info("extractFactGridGovernDaily completed"); + } + + private Map getGovernGridClosedTotalCommonDTOMap(String customerId, List gridIds) { + Map resultMap = new HashMap<>(); + for (String gridId : gridIds) { + + GovernGridClosedTotalCommonDTO governGridClosedTotalCommonDTO = new GovernGridClosedTotalCommonDTO(); + governGridClosedTotalCommonDTO.setGridId(gridId); + + // 11、来源于议题的项目,未出网格结案并且已解决的项目数 + int fromIssueResolvedInGridCount = NumConstant.ZERO; + // 12、来源于议题的项目,未出网格结案并且无需解决的项目数 + int fromIssueUnResolvedInGridCount = NumConstant.ZERO; + // 13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + int fromAgencyResolvedInGridCount = NumConstant.ZERO; + // 14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + int fromAgencyUnResolvedInGridCount = NumConstant.ZERO; + // 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + int communityClosedCount= NumConstant.ZERO; + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + int streetClosedCount=NumConstant.ZERO;; + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + int districtDeptClosedCount=NumConstant.ZERO; + + //当前网格内已结案的项目 + List currentGridClosedProjectList = factOriginProjectMainDailyService.getGridClosedProjectList(customerId, gridId, + ProjectConstant.CLOSED,null,null); + for (GovernProjectInfoDTO governProjectInfoDTO : currentGridClosedProjectList) { + // 1、先判断当前项目是否出了网格 + // 举例:A社区下有A1、A2两个网格;A1网格下的一个项目,流转给了A2网格的某人,他结案了。 只要项目流转部门未出grid ;就算是网格自治。 + boolean inGridClosed = checkIsInGridClosed(governProjectInfoDTO.getGridId(), + governProjectInfoDTO.getProjectLogDTOList()); + if (inGridClosed) { + log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于网格自治"); + // 2、在网格内流转结案的,计算以下下值 + if (ProjectConstant.PROJECT_ORIGIN_ISSUE.equals(governProjectInfoDTO.getOrigin())) { + if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 11、来源于议题的项目,未出网格(在网格内流转的)结案并且已解决的项目数 + fromIssueResolvedInGridCount += 1; + } else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 12、来源于议题的项目,未出网格(在网格内流转的)结案并且无需解决的项目数 + fromIssueUnResolvedInGridCount += 1; + } + } else if (ProjectConstant.PROJECT_ORIGIN_AGENCY.equals(governProjectInfoDTO.getOrigin())) { + if (ProjectConstant.RESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 13、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0 + fromAgencyResolvedInGridCount += 1; + } else if (ProjectConstant.UNRESOLVED.equals(governProjectInfoDTO.getIsResolved())) { + // 14、来源于项目立项的项目,未出网格(在网格内流转的)结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0 + fromAgencyUnResolvedInGridCount += 1; + } + } + } else { + // 3、出了网格的判断是由谁解决的? + String resolveOrgType=getProjectResolveOrgType(governProjectInfoDTO.getProjectLogDTOList()); + if("community".equals(resolveOrgType)){ + // 当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数 + log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于社区解决"); + communityClosedCount+=1; + }else if("street".equals(resolveOrgType)){ + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于街道解决"); + streetClosedCount+=1; + }else if("districtdept".equals(resolveOrgType)){ + // 当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数 + log.info("projectId=【"+governProjectInfoDTO.getId()+"】属于区直部门解决"); + districtDeptClosedCount+=1; + } + // todo 可能是 市级解决、省级解决呢??? + } + } + + governGridClosedTotalCommonDTO.setFromIssueResolvedInGridCount(fromIssueResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromIssueUnResolvedInGridCount(fromIssueUnResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromAgencyResolvedInGridCount(fromAgencyResolvedInGridCount); + governGridClosedTotalCommonDTO.setFromAgencyUnResolvedInGridCount(fromAgencyUnResolvedInGridCount); + governGridClosedTotalCommonDTO.setCommunityClosedCount(communityClosedCount); + governGridClosedTotalCommonDTO.setStreetClosedCount(streetClosedCount); + governGridClosedTotalCommonDTO.setDistrictDeptClosedCount(districtDeptClosedCount); + resultMap.put(gridId, governGridClosedTotalCommonDTO); + } + return resultMap; + } + + /** + * 已经出网格的项目,到底归谁解决呢? + * + * @param projectLogDTOList 当前项目所有的处理明细 + * @return String 社区解决:community;街道解决:street;区直部门解决:districtdept + */ + private String getProjectResolveOrgType(List projectLogDTOList) { + List handleLevelList=new ArrayList<>(); + for (FactOriginProjectLogDailyDTO logDailyDTO : projectLogDTOList) { + if(logDailyDTO.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN)||NumConstant.ZERO==logDailyDTO.getIsActive()){ + //当前操作如果是退回,不参与比较 + continue; + } + + /** + * 机关级别(社区级:community, + 乡(镇、街道)级:street, + 区县级: district, + 市级: city + 省级:province) + */ + // orgType: 网格grid,部门department,组织:agency + if ("grid".equals(logDailyDTO.getOrgType())) { + handleLevelList.add(NumConstant.ONE); + } else if ("agency".equals(logDailyDTO.getOrgType())) { + CustomerAgencyEntity agencyEntity=customerAgencyService.getAgencyById(logDailyDTO.getOrgId()); + if("community".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.TWO); + }else if("street".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.THREE); + }else if("district".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FOUR); + }else if("city".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FIVE); + }else if("province".equals(agencyEntity.getLevel())){ + handleLevelList.add(NumConstant.SIX); + } + } else if ("department".equals(logDailyDTO.getOrgType())) { + CustomerAgencyEntity deptAgencyEntity=customerAgencyService.getAgencyByDeptId(logDailyDTO.getOrgId()); + if("district".equals(deptAgencyEntity.getLevel())){ + // 区直部门直接返回 + return "districtdept"; + }else if("community".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.TWO); + }else if("street".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.THREE); + }else if("city".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.FIVE); + }else if("province".equals(deptAgencyEntity.getLevel())){ + handleLevelList.add(NumConstant.SIX); + } + } + } + //网格:1 grid + //社区:2 community + //街道:3 street + //区县:4 district + //市级:5 city + //省:6 province + //区直部门:7 districtdept + //求出最高的处理部门级别 + String result = ""; + int max = Collections.max(handleLevelList); + switch (max) { + case NumConstant.ONE: + return "grid"; + case NumConstant.TWO: + result = "community"; + break; + case NumConstant.THREE: + result = "street"; + break; + case NumConstant.FOUR: + result = "district"; + break; + case NumConstant.FIVE: + result = "city"; + break; + case NumConstant.SIX: + result = "province"; + break; + case NumConstant.SEVEN: + result = "districtdept"; + } + return result; + } + + /** + * 根据项目处理的明细,判断当前项目是否在网格内自己解决的 + * + * @param gridId 当前项目所属网格 + * @param projectLogDTOList + * @return boolean + */ + private boolean checkIsInGridClosed(String gridId, List projectLogDTOList) { + boolean flag = true; + for (FactOriginProjectLogDailyDTO detail : projectLogDTOList) { + if(detail.getActionCode().equals(DimObjectActionConstant.PROJECT_RETURN) + || NumConstant.ZERO==detail.getIsActive()){ + //当前操作如果是退回,不参与比较 + continue; + } + //只要出了网格,就不算自治 + if (!"grid".equals(detail.getOrgType())) { + flag = false; + break; + } + } + return flag; + } + + /** + * 构造要插入的数据,每个网格一天一条数据,初始赋值0 + * + * @param customerId + * @param dateId + * @param gridInfoDTOList + * @return com.epmet.entity.evaluationindex.extract.FactGridGovernDailyEntity + */ + private List constructFactGridGovernDailyEntityList(String customerId, String dateId, List gridInfoDTOList) { + List insertEntityList = new ArrayList<>(); + for (GridInfoDTO gridInfoDTO : gridInfoDTOList) { + FactGridGovernDailyEntity entity = new FactGridGovernDailyEntity(); + entity.setCustomerId(customerId); + entity.setDateId(dateId); + entity.setGridId(gridInfoDTO.getGridId()); + entity.setPid(gridInfoDTO.getAgencyId()); + entity.setPids(gridInfoDTO.getPids()); + insertEntityList.add(entity); + } + return insertEntityList; + } + + /** + * 1、当前网格内,话题关闭已解决数 + * 2、当前网格内,话题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param topicStatus 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * @param closedStatus unresolved,resolved + * @param shiftIssue 是否转为议题,0:false,1:true; + * @return + */ + private Map getTopicMap(String customerId, List gridIds, String topicStatus, String closedStatus,String shiftIssue) { + Map resultMap = new HashMap<>(); + List list = factOriginTopicMainDailyService.queryGridTopicValue(customerId, gridIds, topicStatus, closedStatus,shiftIssue); + for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) { + resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal()); + } + return resultMap; + } + + /** + * 3、当前网格内,议题关闭已解决数 + * 4、当前网格内,议题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved + * @param resolveType unresolved,resolved + * @return + */ + private Map getIssueMap(String customerId, List gridIds, String issueStatus, String resolveType) { + Map resultMap = new HashMap<>(); + List list = factOriginIssueMainDailyService.queryGridIssueValue(customerId, gridIds, issueStatus, resolveType); + for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) { + resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal()); + } + return resultMap; + } + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数、 + * 6、当前网格内:来源于议题的项目:结案无需解决数、 + * 7、当前网格内:项目立项,结案已解决数;默认为0、 + * 8、当前网格内:项目立项,结案无需解决数;默认为0、 + * + * @param customerId + * @param gridIds + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return + */ + private Map getGridProjectMap(String customerId, List gridIds, String projectStatus, String origin, String isResolved) { + Map resultMap = new HashMap<>(); + List list = factOriginProjectMainDailyService.queryGridProjectValue(customerId, gridIds, projectStatus, origin, isResolved); + for (GovernGridTotalCommonDTO gridTotalCommonDTO : list) { + resultMap.put(gridTotalCommonDTO.getGridId(), gridTotalCommonDTO.getTotal()); + } + return resultMap; + } + + + /** + * 15、未出当前网格的,结案项目数=11+12+13+14 + * + * @param customerId + * @param gridId + */ + private Integer calGridSelfGovernProjectTotal(String customerId, String gridId) { + // todo + return 0; + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java new file mode 100644 index 0000000000..3212ad6dc0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActDailyServiceImpl.java @@ -0,0 +1,165 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactGroupActDailyDao; +import com.epmet.dto.group.ActCategoryDictDTO; +import com.epmet.dto.org.GridInfoDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActDailyService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerGridService; +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.util.ArrayList; +import java.util.List; + +/** + * 组织活动(参加人数、组织次数、平均参加人数)按天累计值分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Slf4j +@DataSource(DataSourceConstant.STATS) +@Service +public class FactGroupActDailyServiceImpl extends BaseServiceImpl implements FactGroupActDailyService { + + @Autowired + private GroupDataService groupDataService; + @Autowired + private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerGridService customerGridService; + + /** + * 当前客户截止到dateId,网格下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractGridGroupActDaily(String customerId, String dateId) { + if(StringUtils.isBlank(customerId)||StringUtils.isBlank(dateId)){ + return; + } + // 1、查询出当前客户的组织分类;如果没有直接返回 + List actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); + if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { + return; + } + + // 2、当前客户下所有的网格 + List gridInfoDTOList=customerGridService.queryGridInfoList(customerId); + // 2、遍历每个分类,查询组织次数、参与人数、平均参与人数 + List insertList = new ArrayList<>(); + for(GridInfoDTO gridInfoDTO:gridInfoDTOList){ + + for (ActCategoryDictDTO actCategoryDictDTO : actCategoryDictDTOList) { + List list = groupDataService.selectCountGridGroupActDaily(customerId, dateId, actCategoryDictDTO.getCategoryCode(),gridInfoDTO.getGridId()); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(dto->{ + dto.setCategoryCode(actCategoryDictDTO.getCategoryCode()); + dto.setParentCode(actCategoryDictDTO.getParentCode()); + dto.setLevel(actCategoryDictDTO.getLevel()); + dto.setOrgType("grid"); + dto.setDateId(dateId); + }); + insertList.addAll(list); + } + } + } + + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"grid"); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + insertList.forEach(insertEntity -> { + baseDao.insert(insertEntity); + }); + log.info("extractGridGroupActDaily completed"); + } + + /** + * 当前客户截止到dateId,组织下 各个分类的 参加人数,组织次数,平均参加人数 + * + * @param customerId + * @param dateId + * @return + */ + @Override + public void extractAgencyGroupActDaily(String customerId, String dateId) { + // 1、查询出当前客户的组织分类;如果没有直接返回 + List actCategoryDictDTOList = groupDataService.queryCustomerActCategoryDict(customerId); + if (CollectionUtils.isEmpty(actCategoryDictDTOList)) { + return; + } + // 2、当前客户下所有的组织 + List agencyEntityList=customerAgencyService.queryAgencyListByCustomerId(customerId); + List insertList = new ArrayList<>(); + for(CustomerAgencyEntity agencyEntity:agencyEntityList){ + for(ActCategoryDictDTO categoryDict:actCategoryDictDTOList){ + List list = groupDataService.selectCountAgencyGroupActDaily(customerId, + agencyEntity.getId(), + dateId, + categoryDict.getCategoryCode()); + if (CollectionUtils.isNotEmpty(list)) { + list.forEach(dto->{ + dto.setCategoryCode(categoryDict.getCategoryCode()); + dto.setParentCode(categoryDict.getParentCode()); + dto.setLevel(categoryDict.getLevel()); + dto.setOrgId(agencyEntity.getId()); + dto.setOrgType("agency"); + dto.setPid(agencyEntity.getPid()); + dto.setPids(agencyEntity.getPids()); + dto.setDateId(dateId); + }); + insertList.addAll(list); + } + } + } + + // 3、批量删除 + int deleteNum; + do { + deleteNum = baseDao.deleteBatch(customerId, dateId, NumConstant.TWO_HUNDRED,"agency"); + } while (deleteNum > NumConstant.ZERO); + + // 4、插入数据 + insertList.forEach(insertEntity->{ + baseDao.insert(insertEntity); + }); + log.info("extractAgencyGroupActDaily completed"); + } + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java new file mode 100644 index 0000000000..3cb14a7e31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactGroupActMonthlyServiceImpl.java @@ -0,0 +1,41 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactGroupActMonthlyDao; +import com.epmet.entity.evaluationindex.extract.FactGroupActMonthlyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactGroupActMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 专项组活动(参加人数、组织次数、平均参加人数)按月增量分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@DataSource(DataSourceConstant.STATS) +@Slf4j +@Service +public class FactGroupActMonthlyServiceImpl extends BaseServiceImpl implements FactGroupActMonthlyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index 1cd62fd24a..2ec8212d21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -5,7 +5,11 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; +import com.epmet.service.StatsGroupService; +import com.epmet.service.StatsTopicService; import com.epmet.service.evaluationindex.extract.todata.*; import com.epmet.service.stats.DimCustomerPartymemberService; import com.epmet.service.stats.DimCustomerService; @@ -48,6 +52,13 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { private DimCustomerPartymemberService dimCustomerPartymemberService; @Autowired private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; + @Autowired + private FactGroupActDailyService factGroupActDailyService; + @Autowired + private StatsGroupService statsGroupService; + @Autowired + private StatsTopicService statsTopicService; + @Override public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) { @@ -188,6 +199,104 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } } }); + //小组活动 + threadPool.submit(() -> { + ExtractOriginFormDTO extractOriginFormDTO = ConvertUtils.sourceToTarget(param, ExtractOriginFormDTO.class); + if (!isRange) { + //截止到当前dateId + try { + factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + try { + factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + } else { + //参数指定日期内,比如startDate=20210501,endDate=20210513;依次计算截止到20210501的数据.....截止到20210513的数据 + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractGridGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + try { + for (int i = 0; i < finalDaysBetween.size(); i++) { + String dateDimId = finalDaysBetween.get(i); + extractOriginFormDTO.setDateId(dateDimId); + factGroupActDailyService.extractAgencyGroupActDaily(extractOriginFormDTO.getCustomerId(), extractOriginFormDTO.getDateId()); + } + } catch (Exception e) { + log.error("抽取【fact_group_act_daily】发生异常,参数:" + JSON.toJSONString(extractOriginFormDTO), e); + } + } + }); + + //网格、组织小组总数日统计 + threadPool.submit(() -> { + GroupTotalFormDTO formDTO = new GroupTotalFormDTO(); + formDTO.setCustomerId(param.getCustomerId()); + if (!isRange) { + formDTO.setDateId(param.getDateId()); + try { + statsGroupService.gridGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsGroupService.agencyGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } else { + try { + statsGroupService.gridGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsGroupService.agencyGroupTotal(formDTO); + } catch (Exception e) { + log.error("小组总数-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } + }); + + //热议中话题网格、机关日统计 + threadPool.submit(() -> { + TopicStatusFormDTO formDTO = new TopicStatusFormDTO(); + formDTO.setCustomerId(param.getCustomerId()); + if (!isRange) { + formDTO.setDateId(param.getDateId()); + try { + statsTopicService.gridTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsTopicService.agencyTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } else { + try { + statsTopicService.gridTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-网格日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + try { + statsTopicService.agencyTopicStatus(formDTO); + } catch (Exception e) { + log.error("热议中话题-机关日统计计算错误,参数:" + JSON.toJSONString(formDTO), e); + } + } + }); + submitProjectRelationData(param, finalDaysBetween); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java index 94fadea5fe..164b0b76dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMainDailyServiceImpl.java @@ -18,21 +18,33 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginGroupMainDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; import com.epmet.dto.extract.form.ScreenPartyLinkMassesDataFormDTO; import com.epmet.dto.extract.result.GridGroupUserCountResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.group.result.ExtractGroupMemberActionRecordResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; 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.math.BigDecimal; +import java.math.RoundingMode; import java.util.ArrayList; +import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.function.Function; import java.util.stream.Collectors; @@ -45,6 +57,8 @@ import java.util.stream.Collectors; @Service public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMainDailyService { + @Autowired + private FactOriginGroupMemberDailyService factOriginGroupMemberDailyService; /** * @return java.util.List @@ -84,7 +98,7 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl originGroupData, List memberList,List missing) { + public boolean insertExtractedData(boolean isFirst, String customerId, String dateId,List originGroupData, List memberList,List missing, List partyIds) { if(!CollectionUtils.isEmpty(originGroupData)) { if (isFirst) { //isFirst @@ -96,9 +110,15 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl members = ConvertUtils.sourceToTarget(memberList, FactOriginGroupMemberDailyEntity.class); + members.forEach(item -> { + if (partyIds.contains(item.getMemberId())) { + item.setIsParty(NumConstant.ONE); + } + }); baseDao.insertBatchMain(originGroupData); - baseDao.insertBatchMembers(memberList); + factOriginGroupMemberDailyService.insertBatch(members); } if(!CollectionUtils.isEmpty(missing)){ baseDao.deleteBatchByGroupId(customerId,missing); @@ -136,4 +156,46 @@ public class FactOriginGroupMainDailyServiceImpl extends BaseServiceImpl getGroupListByCustomerId(String customerId, String dateId) { + return baseDao.selectCustomerGroupList(customerId, dateId); + } + + /** + * 获取组织/网格级别党员建组统计 + * + * @param customerId + * @param dateId + * @param type agency grid + * @return java.util.List + * @author zhaoqifeng + * @date 2021/5/13 16:55 + */ + @Override + public Map getPartyMemberGroupStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberGroupStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberGroupStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java new file mode 100644 index 0000000000..e8ab17e4d1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginGroupMemberDailyServiceImpl.java @@ -0,0 +1,145 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.extract.todata.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginGroupMemberDailyDao; +import com.epmet.dto.extract.FactOriginGroupMemberDailyDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMemberDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMemberDailyService; +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.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; + +/** + * + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactOriginGroupMemberDailyServiceImpl extends BaseServiceImpl implements FactOriginGroupMemberDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactOriginGroupMemberDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactOriginGroupMemberDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactOriginGroupMemberDailyDTO get(String id) { + FactOriginGroupMemberDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactOriginGroupMemberDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactOriginGroupMemberDailyDTO dto) { + FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactOriginGroupMemberDailyDTO dto) { + FactOriginGroupMemberDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactOriginGroupMemberDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 获取小组党员统计 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/14 10:33 + */ + @Override + public Map getGroupPartyMemberStatic(String customerId, String dateId, String type) { + List staticsList; + if (OrgTypeConstant.AGENCY.equals(type)) { + //组织级别统计 + staticsList = baseDao.selectGroupPartyMemberStaticByAgency(customerId, dateId); + } else { + //网格级别统计 + staticsList = baseDao.selectGroupPartyMemberStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(staticsList)) { + return Collections.emptyMap(); + } + staticsList.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return staticsList.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return staticsList.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java index 0eac851c63..c9db796c53 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginIssueMainDailyServiceImpl.java @@ -19,15 +19,25 @@ package com.epmet.service.evaluationindex.extract.todata.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.service.evaluationindex.extract.todata.FactOriginIssueMainDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Collections; import java.util.List; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Collectors; /** * 议题主表 @@ -127,4 +137,72 @@ public class FactOriginIssueMainDailyServiceImpl extends BaseServiceImpl getOrgIssueCount(String customerId, String monthId, String level) { return baseDao.selectOrgIssueCount(customerId, monthId, level); } + + /** + * 获取组织/网格级别党员发布话题转议题统计 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/17 14:52 + */ + @Override + public Map getPartyMemberIssueStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberIssueStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberIssueStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + + /** + * 3、当前网格内,议题关闭已解决数 + * 4、当前网格内,议题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param issueStatus 议题状态 voting 已转项目:shift_project 已关闭:closed_resloved + * @param resolveType unresolved,resolved + * @return + */ + @Override + public List queryGridIssueValue(String customerId, List gridIds, String issueStatus, String resolveType) { + return baseDao.selectGroupByGridId(customerId,gridIds,issueStatus,resolveType); + } + + /** + * 获取组织关闭议题数 + * + * @param customerId + * @param dateId + * @param closedStatus + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/25 17:09 + */ + @Override + public Map getAgencyClosedIssueCount(String customerId, String dateId, String closedStatus) { + List list = baseDao.selectAgencyClosedIssueCount(customerId, dateId, closedStatus); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 9be7b9f44f..73de4eb905 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -41,6 +41,7 @@ import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -290,6 +291,35 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/25 9:56 + */ + @Override + public List getGridResponseDaily(String customerId, String dateId) { + return baseDao.selectGridResponseDaily(customerId, dateId); + } + + /** + * 组织项目响应度 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 9:56 + */ + @Override + public List getOrgResponseDaily(String customerId, String dateId, String level) { + return baseDao.selectOrgResponseDaily(customerId, dateId, level); + } + @Override public List getGridSatisfaction(String customerId, String monthId) { return baseDao.selectGridSatisfaction(customerId, monthId); @@ -300,6 +330,35 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/27 16:06 + */ + @Override + public List getGridSatisfactionDaily(String customerId, String dateId) { + return baseDao.selectGridSatisfactionDaily(customerId, dateId); + } + + /** + * 组织满意率 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/27 16:06 + */ + @Override + public List getOrgSatisfactionDaily(String customerId, String dateId, String level) { + return baseDao.selectOrgSatisfactionDaily(customerId, dateId, level); + } + /** * 获取部门办结项目数 * @@ -342,5 +401,37 @@ public class FactOriginProjectLogDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/24 17:52 + */ + @Override + public List getGridSelfDaily(String customerId, String dateId) { + return baseDao.selectGridSelfDaily(customerId, dateId); + } + + /** + * 组织网格自制率统计-按天 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2021/5/24 17:52 + */ + @Override + public Map getAgencyGridSelfDaily(String customerId, String dateId) { + List list = baseDao.selectAgencyGridSelfDaily(customerId, dateId); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 00f8ecbb9c..7347feb480 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; @@ -38,6 +39,8 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; +import com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; @@ -47,10 +50,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; /** @@ -179,16 +182,60 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getSelfProjectDaily(String customerId, String dateId, String level) { + return baseDao.getSelfProjectDaily(customerId, dateId, level); + } + @Override public List getResolveProject(String customerId, String monthId, String level) { return baseDao.getResolveProject(customerId, monthId, level); } + /** + * 已解决项目数 + * + * @param customerId + * @param dateId + * @param level + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getResolveProjectDaily(String customerId, String dateId, String level) { + return baseDao.getResolveProjectDaily(customerId, dateId, level); + } + @Override public List getGridResolveProject(String customerId, String monthId) { return baseDao.getGridResolveProject(customerId, monthId); } + /** + * 网格已解决项目数 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/25 15:34 + */ + @Override + public List getGridResolveProjectDaily(String customerId, String dateId) { + return baseDao.getGridResolveProjectDaily(customerId, dateId); + } + @Override public List getGridProjectCount(String customerId, String monthId) { return baseDao.getGridProjectCount(customerId, monthId); @@ -528,5 +575,149 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/17 15:25 + */ + @Override + public Map getPartyMemberProjectStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberProjectStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberProjectStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + + /** + * 获取组织/网格级别党员发布话题结案统计 + * + * @param customerId + * @param dateId + * @param type + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/17 15:39 + */ + @Override + public Map getPartyMemberClosedProjectStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberClosedProjectStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberClosedProjectStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + + /** + * 5、当前网格内:来源于议题的项目:结案已解决数、 + * 6、当前网格内:来源于议题的项目:结案无需解决数、 + * 7、当前网格内:项目立项,结案已解决数;默认为0、 + * 8、当前网格内:项目立项,结案无需解决数;默认为0、 + * + * @param customerId + * @param gridIds + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO + */ + @Override + public List queryGridProjectValue(String customerId, List gridIds, String projectStatus, String origin, String isResolved) { + return baseDao.selectGroupByGrid(customerId,gridIds,projectStatus,origin,isResolved); + } + + /** + * 获取组织关闭项目数 + * + * @param customerId + * @param dateId + * @param closedStatus + * @param origin + * @return java.util.Map + * @author zhaoqifeng + * @date 2021/5/26 15:09 + */ + @Override + public Map getAgencyClosedProjectCount(String customerId, String dateId, String closedStatus, String origin) { + List list = baseDao.selectAgencyClosedProjectCount(customerId, dateId, closedStatus, origin); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } + + /** + * 组织结案项目统计 + * + * @param customerId + * @param dateId + * @return java.util.Map> + * @author zhaoqifeng + * @date 2021/5/27 14:56 + */ + @Override + public Map> getAgencyClosedProjectStatic(String customerId, String dateId) { + List list = baseDao.selectAgencyClosedProjectStaticDaily(customerId, dateId); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.groupingBy(OrgStatisticsResultDTO::getAgencyId)); + } + + /** + * 当前网格内已结案的项目 + * + * @author zhaoqifeng + * @date 2021/5/26 15:09 + * @param customerId + * @param gridId + * @param projectStatus 状态:待处理 pending,结案closed + * @param origin 项目来源 来源:议题issue 组织agency + * @param isResolved unresolved,resolved + * @return com.epmet.entity.evaluationindex.extract.GovernProjectInfoDTO + */ + @Override + public List getGridClosedProjectList(String customerId, + String gridId, + String projectStatus, + String origin, + String isResolved) { + List resultList=baseDao.getGridClosedProjectList(customerId,gridId,projectStatus,origin,isResolved); + return resultList; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java index ee147e5151..c9e42a3a49 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginTopicMainDailyServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.DimObjectActionConstant; import com.epmet.constant.IndexCalConstant; +import com.epmet.constant.OrgTypeConstant; import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao; import com.epmet.dto.extract.form.ExtractOriginFormDTO; @@ -36,6 +37,7 @@ import com.epmet.dto.org.GridInfoDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.entity.evaluationindex.extract.GovernGridTotalCommonDTO; import com.epmet.service.evaluationindex.extract.todata.FactOriginTopicMainDailyService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.topic.TopicService; @@ -47,10 +49,10 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.*; +import java.util.function.Function; import java.util.stream.Collectors; @@ -346,4 +348,75 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/17 14:25 + */ + @Override + public Map getPartyMemberTopicStatic(String customerId, String dateId, String type) { + List result; + if (OrgTypeConstant.AGENCY.equals(type)) { + result = baseDao.selectPartyMemberTopicStaticByAgency(customerId, dateId); + } else { + result = baseDao.selectPartyMemberTopicStaticByGrid(customerId, dateId); + } + if (CollectionUtils.isEmpty(result)) { + return Collections.emptyMap(); + } + result.forEach(item -> { + BigDecimal count = new BigDecimal(item.getCount()); + BigDecimal sum = new BigDecimal(item.getSum()); + item.setRatio(count.divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + }); + if (OrgTypeConstant.AGENCY.equals(type)) { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } else { + return result.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getOrgId, Function.identity())); + } + } + + + /** + * 1、当前网格内,话题关闭已解决数 + * 2、当前网格内,话题关闭无需解决数 + * 这两个值可以通过此方法获得 + * + * @param customerId + * @param gridIds + * @param topicStatus 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + * @param closedStatus unresolved,resolved + * @param shiftIssue :是否转为议题,0:false,1:true; + * @return + */ + @Override + public List queryGridTopicValue(String customerId, List gridIds, String topicStatus, String closedStatus, String shiftIssue) { + return baseDao.selectTopicGroupByGridId(customerId,gridIds,topicStatus,closedStatus,shiftIssue); + } + /** + * 获取组织已关闭话题数 + * + * @param customerId + * @param dateId + * @param closedStatus + * @param shiftIssue + * @return java.util.List + * @author zhaoqifeng + * @date 2021/5/25 15:02 + */ + @Override + public Map getAgencyClosedTopicCount(String customerId, String dateId, String closedStatus, Integer shiftIssue) { + List list = baseDao.selectAgencyClosedTopicCount(customerId, dateId, closedStatus,shiftIssue); + if (CollectionUtils.isEmpty(list)) { + return Collections.emptyMap(); + } + return list.stream().collect(Collectors.toMap(OrgStatisticsResultDTO::getAgencyId, Function.identity())); + } + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java index 6f6451114d..209588d464 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/GroupExtractServiceImpl.java @@ -89,7 +89,7 @@ public class GroupExtractServiceImpl implements GroupExtractService { List memberList = new LinkedList<>(); if (!CollectionUtils.isEmpty(originGroupData)) { List gridList = dimGridService.getGridAttributes(param.getCustomerId(),null); - + List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); if (!CollectionUtils.isEmpty(gridList)) { Map gridMap = gridList.stream().collect(Collectors.toMap(GridAttributesResultDTO::getGridId, Function.identity(), (key1, key2) -> key2)); @@ -166,14 +166,13 @@ public class GroupExtractServiceImpl implements GroupExtractService { param.getDateId(), originGroupData, memberList, - missingGroups + missingGroups, + partyIds ); } - - List partyIds = userService.getPartymembersByCustomerId(param.getCustomerId()); List heartedIds = userService.getWarmHeartedByCustomerId(param.getCustomerId()); if(!partyIds.isEmpty()) { factOriginGroupMainDailyDao.updatePartyFlag(partyIds, param.getCustomerId()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java index 77b4d843b8..0ec9de39bb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/ProjectExtractServiceImpl.java @@ -215,7 +215,15 @@ public class ProjectExtractServiceImpl implements ProjectExtractService { if (!list.isEmpty()) { factOriginProjectMainDailyService.insertBatch(list); } + + } + + //满意度 + List satisfaction = projectService.getProjectSatisfaction(customerId); + if (CollectionUtils.isNotEmpty(satisfaction)) { + factOriginProjectMainDailyService.updateBatchById(satisfaction); } + final List mainList = list; List logList = new ArrayList<>(); //节点发起人 部门流转退回结案 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java index ef55ca765a..81b88a84bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/GovernRankDataExtractService.java @@ -49,4 +49,48 @@ public interface GovernRankDataExtractService { * @date 2020/9/24 15:17 */ void extractDistrictData(String customerId, String monthId); + + /** + * 网格治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + void extractGridDataDaily(String customerId, String dateId); + + /** + * 社区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractCommunityDataDaily(String customerId, String dateId); + + /** + * 街道治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractStreetDataDaily(String customerId, String dateId); + + /** + * 全区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + void extractDistrictDataDaily(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 14198e915b..926b253910 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -5,12 +5,14 @@ import com.epmet.constant.IndexCalConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.extract.toscreen.GovernRankDataExtractService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyService; import com.epmet.service.evaluationindex.indexcoll.FactIndexGovrnAblityOrgMonthlyService; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -30,6 +32,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe @Autowired private ScreenGovernRankDataService screenGovernRankDataService; @Autowired + private ScreenGovernRankDataDailyService screenGovernRankDataDailyService; + @Autowired private FactIndexGovrnAblityOrgMonthlyService factIndexGovrnAblityOrgMonthlyService; @Autowired private FactIndexGovrnAblityGridMonthlyService factIndexGovrnAblityGridMonthlyService; @@ -283,4 +287,294 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe } screenGovernRankDataService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, monthId, IndexCalConstant.DELETE_SIZE, list); } + + /** + * 网格治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:16 + */ + @Override + public void extractGridDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.GRID, null); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getGridSatisfactionDaily(customerId, dateId); + if (!CollectionUtils.isEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getOrgId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自治率 + List gridList = factOriginProjectLogDailyService.getGridSelfDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(gridList)) { + list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getOrgId())).forEach(grid -> { + BigDecimal resolveCount = new BigDecimal(grid.getSum()); + BigDecimal selfCount = new BigDecimal(grid.getCount()); + if (grid.getSum() != NumConstant.ZERO) { + entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getGridResponseDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getGridResolveProjectDaily(customerId, dateId); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.GRID, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 社区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractCommunityDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProjectDaily(customerId, dateId, OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.COMMUNITY); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 街道治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractStreetDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.STREET); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProjectDaily(customerId, dateId, OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.STREET); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } + + /** + * 全区治理能力 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2020/9/24 15:17 + */ + @Override + public void extractDistrictDataDaily(String customerId, String dateId) { + List list = screenGovernRankDataDailyService.initList(customerId, OrgTypeConstant.AGENCY, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isEmpty(list)) { + return; + } + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + list.forEach(entity -> { + entity.setYearId(dateId.substring(NumConstant.ZERO, NumConstant.FOUR)); + entity.setMonthId(dateId.substring(NumConstant.ZERO, NumConstant.SIX)); + entity.setDateId(dateId); + }); + + //满意率 满意和非常满意占比 + List satisfactionList = factOriginProjectLogDailyService.getOrgSatisfactionDaily(customerId, dateId, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(satisfactionList)) { + list.forEach(entity -> satisfactionList.stream().filter(item -> item.getAgencyId().equals(entity.getOrgId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + + //响应率 响应次数/流转到网格的次数 + List responseList = factOriginProjectLogDailyService.getOrgResponseDaily(customerId, dateId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(responseList)) { + list.forEach(entity -> responseList.stream().filter(response -> entity.getOrgId().equals(response.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //自制率 自治项目数/办结项目数 + List selfList = factOriginProjectMainDailyService.getSelfProjectDaily(customerId, dateId, OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(selfList)) { + list.forEach(entity -> selfList.stream().filter(self -> entity.getOrgId().equals(self.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + //解决率 已解决项目数/办结项目数 + List resolveList = factOriginProjectMainDailyService.getResolveProjectDaily(customerId, dateId, + OrgTypeConstant.DISTRICT); + if (CollectionUtils.isNotEmpty(resolveList)) { + list.forEach(entity -> resolveList.stream().filter(resolve -> entity.getOrgId().equals(resolve.getAgencyId())).forEach(dto -> { + if (dto.getSum() != NumConstant.ZERO) { + BigDecimal sum = new BigDecimal(dto.getSum()); + BigDecimal count = new BigDecimal(dto.getCount()); + entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + } + })); + } + screenGovernRankDataDailyService.delAndSaveRankData(customerId, OrgTypeConstant.AGENCY, dateId, IndexCalConstant.DELETE_SIZE, list); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 1a9b76f055..d2d37a4693 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -5,10 +5,13 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.enums.EnvEnum; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.HttpClientManager; +import com.epmet.dto.extract.form.ExtractFactGridGovernDailyFromDTO; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.dto.extract.form.ExtractScreenFormDTO; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.service.evaluationindex.extract.todata.FactAgencyGovernDailyService; +import com.epmet.service.evaluationindex.extract.todata.FactGridGovernDailyService; import com.epmet.service.evaluationindex.extract.toscreen.*; import com.epmet.service.evaluationindex.indexcal.IndexCalculateService; import com.epmet.service.evaluationindex.screen.*; @@ -69,6 +72,10 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; @Autowired private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; + @Autowired + private FactGridGovernDailyService factGridGovernDailyService; + @Autowired + private FactAgencyGovernDailyService factAgencyGovernDailyService; /** * @param extractOriginFormDTO @@ -221,6 +228,42 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { log.error("按天统计:组织内各个分类下的项目总数,customerId为:"+customerId+"dateId为:"+dateId, e); } + //治理能力排行screen_govern_rank_data + try { + governRankDataExtractService.extractGridDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【网格】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractCommunityDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【社区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractStreetDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【街道】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + try { + governRankDataExtractService.extractDistrictDataDaily(customerId, dateId); + }catch (Exception e){ + log.error("治理能力排行【全区】抽取到大屏失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + + try{ + ExtractFactGridGovernDailyFromDTO extractFactGridGovernDailyFromDTO=new ExtractFactGridGovernDailyFromDTO(); + extractFactGridGovernDailyFromDTO.setCustomerId(customerId); + extractFactGridGovernDailyFromDTO.setDateId(dateId); + factGridGovernDailyService.extractFactGridGovernDaily(extractFactGridGovernDailyFromDTO); + }catch(Exception e){ + log.error("治理指数-网格fact_grid_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } + + try{ + factAgencyGovernDailyService.extractFactAgencyGovernDaily(customerId, dateId); + }catch(Exception e){ + log.error("治理指数-组织fact_agency_govern_daily抽取失败,customerId为:" + customerId + "dateId为:" + dateId, e); + } extractPartData(customerId, dateId); log.info("===== extractDaily method end ======"); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java index e99f35a569..bd9a5c8b5a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/GridCorreLationServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.entity.evaluationindex.indexcal.GridSelfSubScoreEntity; import com.epmet.entity.evaluationindex.indexcal.GridSubScoreEntity; import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; import com.epmet.eum.IndexCodeEnum; +import com.epmet.model.AvgOperationResultVO; import com.epmet.service.evaluationindex.indexcal.GridCorreLationService; import com.epmet.service.evaluationindex.indexcal.IndexCodeFieldReService; import com.epmet.service.evaluationindex.screen.IndexGroupDetailService; @@ -185,6 +186,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { **/ @Transactional(rollbackFor = Exception.class) public void calculateGridDangJian(CalculateCommonFormDTO formDTO) { + // 该客户下的指标列表及权重 List indexList = indexGroupDetailService.getDetailListByParentCode(formDTO.getCustomerId(), IndexCodeEnum.WANG_GE_XIANG_GUAN.getCode(), IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); @@ -212,6 +214,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList = new ArrayList<>(); + // 平均值计算结果,内含平均值,样本总量 + HashMap gridAvgOpeResultMap = new HashMap<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -234,8 +238,9 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { // log.info("组织内党员的联系群众能力考评分(平均值) 单独处理"); //网格内党员的联系群众能力考评分(平均值) String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); - BigDecimal contactMassesAvgValue = getGridContactMassesAvgValue(formDTO, gridId); - SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgValue); + AvgOperationResultVO contactMassesAvgVo = getGridContactMassesAvgValue(formDTO, gridId); + gridAvgOpeResultMap.put(gridId.concat(":").concat(IndexCodeEnum.ZUZHINEIDANGYDLXQZNLKPFPJZ.getCode()), contactMassesAvgVo); + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), contactMassesAvgVo.getAvgValue()); value.getIndexValueVOs().add(contactMassesAblityValue); }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 @@ -249,12 +254,16 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { HashMap resultMap = calculate(indexMap); resultMapList.add(resultMap); } - // 保存中间表 + //保存中间表 deleteBeforeDataList(formDTO,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.GRID_DJ_ALL_PARENT_INDEX_CODE); saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), - NumConstant.ZERO_STR); + NumConstant.ZERO_STR, + gridAvgOpeResultMap); + + // 清理map + gridAvgOpeResultMap.clear(); } /** @@ -315,10 +324,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 获取网格(组织)内党员的联系群众能力考评分(平均值) * @Date 2020/8/31 9:50 **/ - private BigDecimal getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); + private AvgOperationResultVO getGridContactMassesAvgValue(CalculateCommonFormDTO calculateCommonFormDTO, String gridId) { + AvgOperationResultVO result = cpcScoreDao.selectGridContactMassesAvgValue(calculateCommonFormDTO.getCustomerId(), calculateCommonFormDTO.getMonthId(), gridId); if (null == result) { - return new BigDecimal(NumConstant.ZERO_STR); + result.setAvgValue(new BigDecimal(0)); + result.setSampleCount(0); + } + + if (result.getAvgValue() == null) { + result.setAvgValue(new BigDecimal(NumConstant.ZERO)); } //FOR TEST /*BigDecimal result=null; @@ -340,10 +354,15 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { * @description 组织内党员的参与议事能力考评分(平均值) * @Date 2020/8/31 15:51 **/ - private BigDecimal getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { - BigDecimal result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + private AvgOperationResultVO getGridJoinIssueAvgValue(CalculateCommonFormDTO formDTO, String gridId) { + AvgOperationResultVO result = cpcScoreDao.selectGridJoinIssueAvgValue(formDTO.getCustomerId(), formDTO.getMonthId(), gridId); if (null == result) { - return new BigDecimal(NumConstant.ZERO_STR); + //return new BigDecimal(NumConstant.ZERO_STR); + result.setSampleCount(0); + result.setAvgValue(new BigDecimal(0)); + } + if (result.getAvgValue() == null) { + result.setAvgValue(new BigDecimal(NumConstant.ZERO)); } //FOR TEST /*BigDecimal result=null; @@ -414,7 +433,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { /** * @param formDTO 客户id 月份id: yyyyMM - * @param resultMapList + * @param resultMapList key:网格id,value:该网格各项指标的计算结果 * @param indexCode 指标编码: 党建能力:dangjiannengli;治理能力:zhilinengli;服务能力:fuwunengli; * @param isTotal 1:总分;0不是 * @return void @@ -425,7 +444,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { private void saveGridCorreLationResult(CalculateCommonFormDTO formDTO, List> resultMapList, String indexCode, - String isTotal) { + String isTotal, + HashMap avgOpeResultVo) { String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); //三大能力结果表 @@ -466,6 +486,14 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { gridSubScoreEntity.setScore(detail.getScore()); gridSubScoreEntity.setWeight(detail.getWeight()); gridSubScoreEntity.setOriginValue(detail.getOriginValue()); + + // 为平均值类型的指标赋值样本总量 + AvgOperationResultVO avgOperationResultVO = avgOpeResultVo.get(gridSubScoreEntity.getGridId().concat(":").concat(gridSubScoreEntity.getIndexCode())); + if (avgOperationResultVO != null) { + gridSubScoreEntity.setSampleCount(avgOperationResultVO.getSampleCount()); + } else { + gridSubScoreEntity.setSampleCount(0); + } gridSubScoreList.add(gridSubScoreEntity); } }); @@ -625,6 +653,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList = new ArrayList<>(); + HashMap avgOperationResultVo = new HashMap<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -643,8 +672,10 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { if (IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode().equals(key)) { // log.info("组织内党员的参与议事能力考评分(平均值) 单独处理"); String gridId = (String) recordMap.get(IndexCalConstant.GRID_ID); - BigDecimal joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); - SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue); + AvgOperationResultVO joinAvgValue = getGridJoinIssueAvgValue(formDTO, gridId); + avgOperationResultVo.put(gridId.concat(":").concat(IndexCodeEnum.ZUZHINEIDANGYDSYYSNLKPFPJZ.getCode()), joinAvgValue); + + SampleValue contactMassesAblityValue = new SampleValue((String) recordMap.get(IndexCalConstant.GRID_ID), joinAvgValue.getAvgValue()); value.getIndexValueVOs().add(contactMassesAblityValue); }else if (StringUtils.isNotBlank(indexCodeFieldReService.getFieldNameByIndexCode(key))) { //对应的数值 @@ -663,7 +694,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), - NumConstant.ZERO_STR); + NumConstant.ZERO_STR, + avgOperationResultVo); } @@ -700,6 +732,7 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { //指标集合 Map> indexMap = buildGridCorrelationIndexInputVO(formDTO, indexList, minAndMaxMap); List> resultMapList = new ArrayList<>(); + HashMap avgOperationResultVO = new HashMap<>(); //分页查询采集记录 for (int pageNo = 1; pageNo <= totalPage; pageNo++) { int pageIndex = (pageNo - NumConstant.ONE) * IndexCalConstant.PAGE_SIZE; @@ -734,7 +767,8 @@ public class GridCorreLationServiceImpl implements GridCorreLationService { saveGridCorreLationResult(formDTO, resultMapList, IndexCodeEnum.FU_WU_NENG_LI.getCode(), - NumConstant.ZERO_STR); + NumConstant.ZERO_STR, + avgOperationResultVO); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java index 82fe83bb3c..8a12ec8c1e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java @@ -228,9 +228,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); //下属所有网格的党建能力平均值 + + // 计算党建能力平均分时候的样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),quarterId,yearId); + subGridPartyAvgScore.stream().forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL); } else { @@ -283,6 +289,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId,monthId); + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); + }); deleteAndInsert(result); return true; } @@ -304,9 +314,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); + subGridGovernAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("社区下级治理能力平均分集合为空"); }else{ @@ -357,6 +373,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); + }); deleteAndInsert(result); return true; } @@ -378,10 +398,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { List subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScoreNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),quarterId,yearId); + subGridServiceAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridServiceAvg)) { log.warn("查询社区下级所有网格服务能力得分平均值集合为空"); } else { @@ -432,6 +458,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? 0 : sampleCount); + }); deleteAndInsert(result); return true; } @@ -671,6 +701,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni log.info("communityPartyCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(form.getCustomerId(),form.getMonthId()); + result.getFiveLevel().forEach(s->{ + s.setSampleCount(0); + }); deleteAndInsert(result); return true; } @@ -745,6 +778,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s->{ + s.setSampleCount(0); + }); deleteAndInsert(result); return true; } @@ -820,6 +856,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni HashMap scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); + result.getFiveLevel().forEach(s->{ + s.setSampleCount(0); + }); deleteAndInsert(result); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 988fc7e118..bceed3de9d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -19,10 +19,7 @@ import com.epmet.dao.evaluationindex.indexcal.DeptScoreDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityOrgMonthlyDao; import com.epmet.dao.evaluationindex.screen.IndexGroupDetailDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; -import com.epmet.dto.indexcal.AgencyCalResultDTO; -import com.epmet.dto.indexcal.AgencyScoreDTO; -import com.epmet.dto.indexcal.CalculateCommonFormDTO; -import com.epmet.dto.indexcal.SubAgencyScoreAvgResultDTO; +import com.epmet.dto.indexcal.*; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; @@ -224,11 +221,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map agencyMap = agencyMap(customerId); + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); + subGridPartyAvgScore.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { @@ -282,6 +285,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId,monthId,IndexCalConstant.DISTRICT_LEVEL); + + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -303,10 +311,16 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); + districtGovernAvgList.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); + }); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ districtGovernAvgList.remove(districtGovernAvgList.get(i)); @@ -363,6 +377,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("districtGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -384,11 +403,17 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,quarterId,yearId); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); + subStreetAvgList.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); + }); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ subStreetAvgList.remove(subStreetAvgList.get(i)); @@ -421,6 +446,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict log.info("districtServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("districtServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); } return true; @@ -613,6 +643,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map agencyMap = agencyMap(customerId); //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { @@ -627,7 +658,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); party.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }else { @@ -699,6 +731,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { // 治理能力平均值 @@ -718,7 +751,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }else { @@ -788,6 +822,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + Map agencyMap = agencyMap(customerId); detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { @@ -808,7 +843,8 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { if (!c.getParentId().equals(NumConstant.ZERO_STR)) { - pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); +// pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); + pid.put(c.getParentId(), agencyMap.get(c.getParentId())); SampleValue s = new SampleValue(c.getParentId(), c.getScore()); index1SampleValues.add(s); }else { @@ -882,5 +918,19 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict return true; } + /** + * @Description 查询客户下的所有组织parentId + * @Param customerId + * @author zxc + * @date 2021/5/26 1:44 下午 + */ + public Map agencyMap(String customerId){ + Map result = new HashMap<>(16); + List dtos = customerAgencyDao.selectAgencyIdAndParentId(customerId); + dtos.forEach(d -> { + result.put(d.getAgencyId(),d.getPid()); + }); + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java index bf251be59f..f148e3d83e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java @@ -230,10 +230,16 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); //下属所有社区的党建能力平均值 detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { List subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),quarterId,yearId); + subCommPartyAvgScore.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { @@ -286,6 +292,13 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetPartyAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); deleteOldRecord(customerId, monthId, IndexCalConstant.STREET_LEVEL); + + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); + insertDetail(result); return true; } @@ -307,9 +320,15 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { List subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),quarterId,yearId); + subGridGovernAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subGridGovernAvg)){ log.warn("查询街道下属所有社区治理能力汇总为空"); }else if (subGridGovernAvg.size() > NumConstant.ZERO) { @@ -360,6 +379,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetGovernAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("streetGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } @@ -381,10 +405,17 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ String yearId = DateUtils.getYearId(monthId); List indexInputVOS = new ArrayList<>(); Map pid = new HashMap<>(); + + // key:agencyId,value:sampleCount样本量 + Map gridPartyScoreSampleCountMap = new HashMap<>(); + detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { List subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreNew(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),quarterId,yearId); + subCommServiceAvg.forEach(s -> { + gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode()), s.getSampleCount()); + }); if (CollectionUtils.isEmpty(subCommServiceAvg)) { log.warn("查询街道下属社区服务能力得分平均值为空"); } else if (subCommServiceAvg.size() > NumConstant.ZERO) { @@ -435,6 +466,11 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ log.info("streetServiceAbilityCalculate getScoreTotalOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); log.info("streetServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); AgencyCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.JIE_DAO_XIANG_GUAN.getCode(), pid); + // 赋值样本量 + result.getFiveLevel().forEach(s -> { + Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); + s.setSampleCount(sampleCount == null ? NumConstant.ZERO : sampleCount); + }); insertDetail(result); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java index 8010a566d2..c8621ab7d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/FactIndexGovrnAblityGridMonthlyService.java @@ -21,4 +21,15 @@ public interface FactIndexGovrnAblityGridMonthlyService extends BaseService getGridByCustomer(String customerId, String monthId); + + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + List getGridByCustomerDaily(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java index 3f9c73afb3..bf3dd65e5e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexGovrnAblityGridMonthlyServiceImpl.java @@ -22,4 +22,18 @@ public class FactIndexGovrnAblityGridMonthlyServiceImpl extends BaseServiceImpl< public List getGridByCustomer(String customerId, String monthId) { return baseDao.selectGridByCustomer(customerId, monthId); } + + /** + * 查询客户下网格治理能力 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 15:41 + */ + @Override + public List getGridByCustomerDaily(String customerId, String dateId) { + return baseDao.selectGridByCustomerDaily(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java new file mode 100644 index 0000000000..0fa086cfb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenGovernRankDataDailyService.java @@ -0,0 +1,121 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +public interface ScreenGovernRankDataDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-24 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-24 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenGovernRankDataDailyDTO + * @author generator + * @date 2021-05-24 + */ + ScreenGovernRankDataDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-24 + */ + void save(ScreenGovernRankDataDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-24 + */ + void update(ScreenGovernRankDataDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-24 + */ + void delete(String[] ids); + + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 + */ + List initList(String customerId, String orgType, String agencyLevel); + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, List entityList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java new file mode 100644 index 0000000000..3c48645963 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenGovernRankDataDailyServiceImpl.java @@ -0,0 +1,170 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dao.evaluationindex.screen.ScreenGovernRankDataDailyDao; +import com.epmet.dto.screen.ScreenGovernRankDataDailyDTO; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataDailyEntity; +import com.epmet.entity.evaluationindex.screen.ScreenGovernRankDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenGovernRankDataDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 基层治理-治理能力排行数据(按月统计) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-24 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenGovernRankDataDailyServiceImpl extends BaseServiceImpl implements ScreenGovernRankDataDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenGovernRankDataDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenGovernRankDataDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenGovernRankDataDailyDTO get(String id) { + ScreenGovernRankDataDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenGovernRankDataDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenGovernRankDataDailyDTO dto) { + ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenGovernRankDataDailyDTO dto) { + ScreenGovernRankDataDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenGovernRankDataDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 构造screen_govern_rank_data 初始数据,先赋值为0 + * + * @param customerId + * @param orgType + * @param agencyLevel + * @return java.util.List + * @author zhaoqifeng + * @date 2020/9/24 14:41 + */ + @Override + public List initList(String customerId, String orgType, String agencyLevel) { + List list = new ArrayList<>(); + switch (orgType) { + case OrgTypeConstant.AGENCY: + log.info("组织级别统计"); + list = baseDao.initAgencyDataList(customerId, agencyLevel); + break; + case OrgTypeConstant.GRID: + log.info("网格级别统计"); + list = baseDao.initGridDataList(customerId); + break; + default: + log.info("部门级别统计"); + break; + } + return list; + } + + /** + * 保存抽取结果 + * + * @param customerId + * @param orgType + * @param dateId + * @param deleteSize + * @param entityList + * @return void + * @author zhaoqifeng + * @date 2020/9/25 10:32 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void delAndSaveRankData(String customerId, String orgType, String dateId, Integer deleteSize, + List entityList) { + if (CollectionUtils.isEmpty(entityList)) { + return; + } + List orgIds = new ArrayList<>(); + for (ScreenGovernRankDataDailyEntity entity : entityList) { + orgIds.add(entity.getOrgId()); + } + int deleteNum; + do { + deleteNum = baseDao.deleteRankData(customerId, orgType, dateId, deleteSize, orgIds); + } while (deleteNum != NumConstant.ZERO); + + insertBatch(entityList); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 38e291d420..89cc949ea6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -1,7 +1,11 @@ package com.epmet.service.group; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.result.*; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -66,4 +70,49 @@ public interface GroupDataService { **/ List extractGroupData(Boolean isFirst,String customerId,String dateId); + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectJoinThreeMeetsCount(String customerId, String monthId); + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + List selectCountGridCreateThreeMeets(String customerId, String monthId); + + /** + * 查询出当前客户的组织分类;如果没有直接返回 + * + * @param customerId + */ + List queryCustomerActCategoryDict(String customerId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 网格按天 + * @param customerId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountGridGroupActDaily(String customerId, String dateId, String categoryCode,String gridId); + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 组织按天 + * @param customerId + * @param agencyId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + List selectCountAgencyGroupActDaily(String customerId, String agencyId, String dateId, String categoryCode); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index b7875982d5..a7a596ca10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -1,24 +1,27 @@ package com.epmet.service.group.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.constant.DataSourceConstant; import com.epmet.dao.group.GroupDataDao; import com.epmet.dto.extract.FactOriginGroupMainDailyDTO; +import com.epmet.dto.group.ActCategoryDictDTO; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; -import com.epmet.entity.stats.DimGridEntity; +import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; +import com.epmet.dto.indexcollect.result.GridIndexCommonDTO; +import com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity; import com.epmet.service.group.GroupDataService; import com.epmet.util.DimIdGenerator; -import org.apache.commons.lang3.StringUtils; -import org.apache.poi.util.StringUtil; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.util.CollectionUtils; import java.util.*; import java.util.stream.Collectors; @@ -27,6 +30,7 @@ import java.util.stream.Collectors; * @Author zxc * @CreateTime 2020/6/16 13:23 */ +@Slf4j @Service @DataSource(DataSourceConstant.RESI_GROUP) public class GroupDataServiceImpl implements GroupDataService { @@ -138,6 +142,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List getAgencyGroupTotalCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -163,6 +168,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ + @Override public List selectAgencyEveryGroupPeopleCount(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -176,6 +182,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @param dateId * @author zxc */ + @Override public List selectAgencyGroupIncr(String customerId,String dateId){ /*if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -210,5 +217,76 @@ public class GroupDataServiceImpl implements GroupDataService { return groupDataDao.groupExtracting(customerId,isFirst?null:dateId); } + /** + * 查询小组活动签到表,计算用户在本月内签到的活动次数 限制活动分类编码100001 三会一课 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + @Override + public List selectJoinThreeMeetsCount(String customerId, String monthId) { + return groupDataDao.selectUserSignedCount(customerId,monthId); + } + + /** + * 网格相关:组织“三会一课”次数: 当前网格下 满足【未取消的活动 and 签到记录>1 and 活动开始时间在当前时间维度内】 +1 + * + * @param customerId + * @param monthId + * @return com.epmet.dto.indexcollect.result.CpcIndexCommonDTO + */ + @Override + public List selectCountGridCreateThreeMeets(String customerId, String monthId) { + return groupDataDao.selectCountGridCreateThreeMeets(customerId,monthId); + } + + /** + * 查询出当前客户的组织分类;如果没有直接返回 + * + * @param customerId + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List queryCustomerActCategoryDict(String customerId) { + List resultList=groupDataDao.queryCustomerActCategoryDict(customerId); + if(CollectionUtils.isNotEmpty(resultList)){ + log.info("当前客户下有自己的项目分类"); + return resultList; + } + log.info("----------------------------------------------------"); + return groupDataDao.queryCustomerActCategoryDict(Constant.DEFAULT_CUSTOMER); + } + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * + * @param customerId + * @param dateId + * @param categoryCode + * @return + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List selectCountGridGroupActDaily(String customerId, String dateId, String categoryCode,String gridId) { + return groupDataDao.selectCountGridGroupActDaily(customerId,dateId,categoryCode,gridId); + } + + /** + * 查询某个分类截止到dateId,组织次数、参与人数、平均参与人数 + * 组织按天 + * + * @param customerId + * @param agencyId + * @param dateId + * @param categoryCode + * @return com.epmet.entity.evaluationindex.extract.FactGroupActDailyEntity + */ + @DataSource(DataSourceConstant.RESI_GROUP) + @Override + public List selectCountAgencyGroupActDaily(String customerId, String agencyId, String dateId, String categoryCode) { + return groupDataDao.selectCountAgencyGroupActDaily(customerId,agencyId,dateId,categoryCode); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 5e4fde3280..50382aa75e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,30 +1,43 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.convert.DateConverter; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; +import com.epmet.dto.group.form.GroupTotalFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.entity.group.ResiGroupEntity; import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; import com.epmet.service.StatsGroupService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginGroupMainDailyService; import com.epmet.service.group.GroupDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.configuration.ConfigurationException; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.text.ParseException; +import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -50,6 +63,14 @@ public class StatsGroupServiceImpl implements StatsGroupService { private DimCustomerService dimCustomerService; @Autowired private CustomerGridService customerGridService; + @Autowired + private DimGridService dimGridService; + @Autowired + private FactGroupTotalGridDailyService factGroupTotalGridDailyService; + @Autowired + private FactGroupTotalAgencyDailyService factGroupTotalAgencyDailyService; + @Autowired + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; /** * @param @@ -333,4 +354,246 @@ public class StatsGroupServiceImpl implements StatsGroupService { return DimIdGenerator.getDimIdBean(result); } + /** + * @Author sun + * @Description 小组总数-网格日统计 + **/ + @Override + public void gridGroupTotal(GroupTotalFormDTO formDTO) { + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + 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)); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户网格-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + gridGroupStats(formDTO.getCustomerId(), formDTO.getDateId()); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + //获取有效客户列表 + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计网格-小组总数日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + gridGroupStats(customerId, formDTO.getDateId()); + } catch (Exception e) { + log.error("小组总数-网格日统计-程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 小组总数-网格日统计数据 + **/ + private void gridGroupStats(String customerId, String dateId) { + //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3.根据客户Id查询客户下有效的群组列表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); + List groupList = factOriginGroupMainDailyService.getGroupListByCustomerId(customerId, dateId); + + //4.分别计算每个网格下审核通过的小组数据 + List list = new ArrayList<>(); + DimIdGenerator.DimIdBean finalDimId = dimId; + dimGridList.forEach(grid -> { + FactGroupTotalGridDailyEntity entity = new FactGroupTotalGridDailyEntity(); + AtomicInteger total = new AtomicInteger(0); + AtomicInteger ordinary = new AtomicInteger(0); + AtomicInteger branch = new AtomicInteger(0); + groupList.forEach(group -> { + if (grid.getId().equals(group.getGridId()) && "approved".equals(group.getGroupState())) { + total.addAndGet(1); + if ("ordinary".equals(group.getGroupType())) { + ordinary.addAndGet(1); + } + if ("branch".equals(group.getGroupType())) { + branch.addAndGet(1); + } + } + }); + //封装数据 + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); + entity.setGroupTotal(total.get()); + entity.setOrdinaryTotal(ordinary.get()); + entity.setBranchTotal(branch.get()); + list.add(entity); + }); + + //5.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactGroupTotalGridDailyEntity delEntity = new FactGroupTotalGridDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id、日维度Id批量删除小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalGridDailyService.delDateGroupTotal(delEntity); + + //5.2:批量保存网格日统计数据 + log.info("StatsGroupServiceImpl.customerGridStats-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalGridDailyService.insertBatch(list); + } + + } + + /** + * @Author sun + * @Description 小组总数-机关日统计 + **/ + @Override + public void agencyGroupTotal(GroupTotalFormDTO formDTO) { + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + 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)); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户组织下-小组总数日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + agencyGroupStats(formDTO.getCustomerId(), formDTO.getDateId()); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计机关-小组总数日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + agencyGroupStats(customerId, formDTO.getDateId()); + } catch (Exception e) { + log.error("小组总数-机关日统计程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 小组总数-机关日统计数据 + **/ + private void agencyGroupStats(String customerId, String dateId) { + //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + //3.根据客户Id查询网格维度表数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + + //4.根据客户Id查询客户下有效的群组列表数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id查询客户下有效的群组列表数据,对应客户Id:" + customerId); + List groupList = factOriginGroupMainDailyService.getGroupListByCustomerId(customerId, dateId); + + List list = new ArrayList<>(); + //5.遍历组织维度数据分别计算每个组织下群组数据 + DimIdGenerator.DimIdBean finalDimId = dimId; + agencyList.forEach(agency->{ + FactGroupTotalAgencyDailyEntity entity = new FactGroupTotalAgencyDailyEntity(); + //5-1.汇总组织及所有下级组织列表 + Map map = new HashMap<>(); + map.put(agency.getId(), agency.getId()); + String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); + agencyList.forEach(sub -> { + if (sub.getPids().contains(subPids)) { + map.put(sub.getId(), sub.getId()); + } + }); + + //5-2.汇总组织及下级所有的网格列表 + List agencyGridList = new ArrayList<>(); + gridList.forEach(grid->{ + if (map.containsKey(grid.getAgencyId())) { + agencyGridList.add(grid.getId()); + } + }); + + AtomicInteger total = new AtomicInteger(0); + AtomicInteger ordinary = new AtomicInteger(0); + AtomicInteger branch = new AtomicInteger(0); + //5-3.根据汇总的网格列表统计对应的群组数据 + agencyGridList.forEach(gridId -> { + groupList.forEach(group -> { + if (gridId.equals(group.getGridId()) && "approved".equals(group.getGroupState())) { + total.addAndGet(1); + if ("ordinary".equals(group.getGroupType())) { + ordinary.addAndGet(1); + } + if ("branch".equals(group.getGroupType())) { + branch.addAndGet(1); + } + } + }); + }); + //封装数据 + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); + entity.setGroupTotal(total.get()); + entity.setOrdinaryTotal(ordinary.get()); + entity.setBranchTotal(branch.get()); + list.add(entity); + }); + + //6.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactGroupTotalAgencyDailyEntity delEntity = new FactGroupTotalAgencyDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsGroupServiceImpl.agencyGroupStats-根据客户Id、日维度Id批量删除小组总数机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalAgencyDailyService.delDateGroupTotal(delEntity); + + //5.2:批量保存机关日统计数据 + log.info("StatsGroupServiceImpl.agencyGroupStats-批量新增小组总数机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factGroupTotalAgencyDailyService.insertBatch(list); + } + + + } + + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java new file mode 100644 index 0000000000..7147774894 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPartyMemberVanguardServiceImpl.java @@ -0,0 +1,414 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.OrgTypeConstant; +import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; +import com.epmet.service.StatsPartyMemberVanguardService; +import com.epmet.service.evaluationindex.extract.todata.*; +import com.epmet.service.stats.*; +import com.epmet.util.DimIdGenerator; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/5/13 15:13 + */ +@Slf4j +@Service +public class StatsPartyMemberVanguardServiceImpl implements StatsPartyMemberVanguardService { + + @Resource + private DimCustomerService dimCustomerService; + @Resource + private DimAgencyService dimAgencyService; + @Resource + private DimGridService dimGridService; + @Resource + private FactPartyMemberVanguardAgencyDailyService factPartyMemberVanguardAgencyDailyService; + @Resource + private FactPartyMemberVanguardGridDailyService factPartyMemberVanguardGridDailyService; + @Resource + private FactOriginGroupMainDailyService factOriginGroupMainDailyService; + @Resource + private FactOriginGroupMemberDailyService factOriginGroupMemberDailyService; + @Resource + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + @Resource + private FactOriginIssueMainDailyService factOriginIssueMainDailyService; + @Resource + private FactOriginProjectMainDailyService factOriginProjectMainDailyService; + + + + + /** + * 组织统计 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2021/5/13 15:13 + */ + @Override + public void agencyStats(StatsFormDTO formDTO) { + Date date = yesterday(); + //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerAgencyStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (CollectionUtils.isNotEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + customerAgencyStats(customerId, date); + } catch (Exception e) { + log.error("Error creating model JSON", e); + } + } + } + } while (CollectionUtils.isNotEmpty(customerIdList) && customerIdList.size() == pageSize); + } + } + + private void customerAgencyStats(String customerId, Date date) { + //1:查询日期各维度表Id + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + if (CollectionUtils.isNotEmpty(dimAgencyList)) { + List vanguardList = dimAgencyList.stream().map(item -> initAgencyDailyEntity(item, dimId)).collect(Collectors.toList()); + //党员建组占比统计 + Map groupStatic = factOriginGroupMainDailyService.getPartyMemberGroupStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!groupStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = groupStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupCount(dto.getCount()); + item.setGroupRatio(dto.getRatio()); + item.setGroupTotal(dto.getSum()); + } + }); + } + + //小组成员党员占比统计 + Map memberStatic = factOriginGroupMemberDailyService.getGroupPartyMemberStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!memberStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = memberStatic.get(item.getAgencyId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题占比统计 + Map topicStatic = factOriginTopicMainDailyService.getPartyMemberTopicStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!topicStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = topicStatic.get(item.getAgencyId()); + if (null != dto) { + item.setTopicCount(dto.getCount()); + item.setTopicRatio(dto.getRatio()); + item.setTopicTotal(dto.getSum()); + } + }); + } + //党员发布话题转议题占比统计 + Map issueStatic = factOriginIssueMainDailyService.getPartyMemberIssueStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!issueStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = issueStatic.get(item.getAgencyId()); + if (null != dto) { + item.setIssueCount(dto.getCount()); + item.setIssueRatio(dto.getRatio()); + item.setIssueTotal(dto.getSum()); + } + }); + } + //党员发布话题转项目占比统计 + Map projectStatic = factOriginProjectMainDailyService.getPartyMemberProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!projectStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = projectStatic.get(item.getAgencyId()); + if (null != dto) { + item.setProjectCount(dto.getCount()); + item.setProjectRatio(dto.getRatio()); + item.setProjectTotal(dto.getSum()); + } + }); + } + //项目结案占比统计 + Map closedStatic = factOriginProjectMainDailyService.getPartyMemberClosedProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.AGENCY); + if (!closedStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = closedStatic.get(item.getAgencyId()); + if (null != dto) { + item.setProjectClosedCount(dto.getCount()); + item.setProjectClosedRatio(dto.getRatio()); + item.setProjectClosedTotal(dto.getSum()); + } + }); + } + //删除旧数据 + factPartyMemberVanguardAgencyDailyService.deleteDailyData(customerId, dimId.getDateId()); + //批量插入 + factPartyMemberVanguardAgencyDailyService.insertBatch(vanguardList); + } + } + /** + * 网格统计 + * + * @param formDTO + * @return void + * @author zhaoqifeng + * @date 2021/5/13 15:13 + */ + @Override + public void gridStats(StatsFormDTO formDTO) { + Date date = yesterday(); + //入参有时间的则按具体时间执行,没有的则按当前时间前一天执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getDate())) { + date = DateUtils.parse(formDTO.getDate(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + customerGridStats(formDTO.getCustomerId(), date); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (CollectionUtils.isNotEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + customerGridStats(customerId, date); + } catch (Exception e) { + log.error("Error creating model JSON", e); + } + } + } + } while (CollectionUtils.isNotEmpty(customerIdList) && customerIdList.size() == pageSize); + } + } + + private void customerGridStats(String customerId, Date date) { + //1:查询日期各维度表Id + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("根据客户Id查询网格维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + if (CollectionUtils.isNotEmpty(dimGridList)) { + List vanguardList = + dimGridList.stream().map(item -> initGridDailyEntity(item, dimId)).collect(Collectors.toList()); + //党员建组占比统计 + Map groupStatic = factOriginGroupMainDailyService.getPartyMemberGroupStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!groupStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = groupStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupCount(dto.getCount()); + item.setGroupRatio(dto.getRatio()); + item.setGroupTotal(dto.getSum()); + } + }); + } + + //小组成员党员占比统计 + Map memberStatic = factOriginGroupMemberDailyService.getGroupPartyMemberStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!memberStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = memberStatic.get(item.getGridId()); + if (null != dto) { + item.setGroupMemberCount(dto.getCount()); + item.setGroupMemberRatio(dto.getRatio()); + item.setGroupMemberTotal(dto.getSum()); + } + }); + } + //党员发布话题占比统计 + Map topicStatic = factOriginTopicMainDailyService.getPartyMemberTopicStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!topicStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = topicStatic.get(item.getGridId()); + if (null != dto) { + item.setTopicCount(dto.getCount()); + item.setTopicRatio(dto.getRatio()); + item.setTopicTotal(dto.getSum()); + } + }); + } + //党员发布话题转议题占比统计 + Map issueStatic = factOriginIssueMainDailyService.getPartyMemberIssueStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!issueStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = issueStatic.get(item.getGridId()); + if (null != dto) { + item.setIssueCount(dto.getCount()); + item.setIssueRatio(dto.getRatio()); + item.setIssueTotal(dto.getSum()); + } + }); + } + //党员发布话题转项目占比统计 + Map projectStatic = factOriginProjectMainDailyService.getPartyMemberProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!projectStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = projectStatic.get(item.getGridId()); + if (null != dto) { + item.setProjectCount(dto.getCount()); + item.setProjectRatio(dto.getRatio()); + item.setProjectTotal(dto.getSum()); + } + }); + } + //项目结案占比统计 + Map closedStatic = factOriginProjectMainDailyService.getPartyMemberClosedProjectStatic(customerId, + dimId.getDateId(), OrgTypeConstant.GRID); + if (!closedStatic.isEmpty()) { + vanguardList.forEach(item -> { + OrgStatisticsResultDTO dto = closedStatic.get(item.getGridId()); + if (null != dto) { + item.setProjectClosedCount(dto.getCount()); + item.setProjectClosedRatio(dto.getRatio()); + item.setProjectClosedTotal(dto.getSum()); + } + }); + } + //删除旧数据 + factPartyMemberVanguardGridDailyService.deleteDailyData(customerId, dimId.getDateId()); + //批量插入 + factPartyMemberVanguardGridDailyService.insertBatch(vanguardList); + } + } + + + private Date yesterday() { + Date date = new Date(); + try { + DateFormat sdf = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + 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; + } + + private FactPartyMemberVanguardAgencyDailyEntity initAgencyDailyEntity(DimAgencyDTO agency, DimIdGenerator.DimIdBean dimId) { + FactPartyMemberVanguardAgencyDailyEntity entity = new FactPartyMemberVanguardAgencyDailyEntity(); + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupCount(NumConstant.ZERO); + entity.setGroupRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupTotal(NumConstant.ZERO); + entity.setGroupMemberCount(NumConstant.ZERO); + entity.setGroupMemberRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupMemberTotal(NumConstant.ZERO); + entity.setTopicCount(NumConstant.ZERO); + entity.setTopicRatio(new BigDecimal(NumConstant.ZERO)); + entity.setTopicTotal(NumConstant.ZERO); + entity.setIssueCount(NumConstant.ZERO); + entity.setIssueRatio(new BigDecimal(NumConstant.ZERO)); + entity.setIssueTotal(NumConstant.ZERO); + entity.setProjectCount(NumConstant.ZERO); + entity.setProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectTotal(NumConstant.ZERO); + entity.setProjectClosedCount(NumConstant.ZERO); + entity.setProjectClosedRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectClosedTotal(NumConstant.ZERO); + return entity; + } + + + private FactPartyMemberVanguardGridDailyEntity initGridDailyEntity(DimGridEntity grid, DimIdGenerator.DimIdBean dimId) { + FactPartyMemberVanguardGridDailyEntity entity = new FactPartyMemberVanguardGridDailyEntity(); + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setGroupCount(NumConstant.ZERO); + entity.setGroupRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupTotal(NumConstant.ZERO); + entity.setGroupMemberCount(NumConstant.ZERO); + entity.setGroupMemberRatio(new BigDecimal(NumConstant.ZERO)); + entity.setGroupMemberTotal(NumConstant.ZERO); + entity.setTopicCount(NumConstant.ZERO); + entity.setTopicRatio(new BigDecimal(NumConstant.ZERO)); + entity.setTopicTotal(NumConstant.ZERO); + entity.setIssueCount(NumConstant.ZERO); + entity.setIssueRatio(new BigDecimal(NumConstant.ZERO)); + entity.setIssueTotal(NumConstant.ZERO); + entity.setProjectCount(NumConstant.ZERO); + entity.setProjectRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectTotal(NumConstant.ZERO); + entity.setProjectClosedCount(NumConstant.ZERO); + entity.setProjectClosedRatio(new BigDecimal(NumConstant.ZERO)); + entity.setProjectClosedTotal(NumConstant.ZERO); + return entity; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java index 423c47174e..74e0c8615b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -6,12 +6,15 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ProjectConstant; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.StatsFormDTO; +import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.form.TopicStatusFormDTO; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.entity.evaluationindex.extract.FactOriginGroupMainDailyEntity; +import com.epmet.entity.stats.*; import com.epmet.service.StatsTopicService; -import com.epmet.service.stats.DimAgencyService; -import com.epmet.service.stats.DimCustomerService; -import com.epmet.service.stats.DimTopicStatusService; +import com.epmet.service.stats.*; import com.epmet.service.stats.topic.TopicStatisticalService; import com.epmet.service.topic.TopicService; import com.epmet.util.DimIdGenerator; @@ -23,7 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; +import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; /** * @Description 话题统计Service @@ -35,21 +40,22 @@ import java.util.*; public class StatsTopicServiceImpl implements StatsTopicService { protected static final Logger log = LoggerFactory.getLogger(StatsTopicServiceImpl.class); - @Autowired private DimCustomerService dimCustomerService; - @Autowired private DimAgencyService dimAgencyService; - @Autowired private DimTopicStatusService dimTopicStatusService; - @Autowired private TopicService topicService; - @Autowired private TopicStatisticalService topicStatisticalService; + @Autowired + private DimGridService dimGridService; + @Autowired + private FactTopicHotdiscussGridDailyService factTopicHotdiscussGridDailyService; + @Autowired + private FactTopicHotdiscussAgencyDailyService factTopicHotdiscussAgencyDailyService; /** * @param formDTO 如果目标日期为空,则自动计算为T-1天 @@ -122,4 +128,232 @@ public class StatsTopicServiceImpl implements StatsTopicService { } } + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + @Override + public void gridTopicStatus(TopicStatusFormDTO formDTO) { + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + 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)); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("热议中话题网格日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + gridTopic(formDTO.getCustomerId(), formDTO.getDateId()); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + //获取有效客户列表 + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计热议中话题网格日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + gridTopic(customerId, formDTO.getDateId()); + } catch (Exception e) { + log.error("热议中话题-网格日统计-程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 热议中话题-网格日统计 + **/ + private void gridTopic(String customerId, String dateId) { + //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + log.info("StatsGroupServiceImpl.customerGridStats-根据客户Id查询网格维度数据,对应客户Id:" + customerId); + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3.根据客户Id查询客户下有效的话题数据,查询dateId之前的数据 + List list = topicService.getTopicList(customerId, dateId); + + //4.遍历封装数据 + List saveList = new ArrayList<>(); + dimGridList.forEach(grid->{ + FactTopicHotdiscussGridDailyEntity entity = new FactTopicHotdiscussGridDailyEntity(); + AtomicInteger total = new AtomicInteger(0); + AtomicInteger num = new AtomicInteger(0); + list.forEach(l->{ + if(grid.getId().equals(l.getGridId()) ){ + total.addAndGet(1); + if(l.getStatus().equals("discussing") && !l.getShiftIssue()){ + num.addAndGet(1); + } + } + }); + entity.setCustomerId(customerId); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); + entity.setDateId(dimId.getDateId()); + entity.setWeekId(dimId.getWeekId()); + entity.setMonthId(dimId.getMonthId()); + entity.setQuarterId(dimId.getQuarterId()); + entity.setYearId(dimId.getYearId()); + entity.setTopicTotal(total.get()); + entity.setStatus("hot_discuss"); + entity.setTopicCount(num.get()); + saveList.add(entity); + }); + + //5.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(saveList)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactTopicHotdiscussGridDailyEntity delEntity = new FactTopicHotdiscussGridDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + factTopicHotdiscussGridDailyService.delTopicGrid(delEntity); + + //5.2:批量保存网格日统计数据 + log.info("StatsTopicServiceImpl.gridTopic-批量新增热议中话题网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factTopicHotdiscussGridDailyService.insertBatch(saveList); + } + + } + + /** + * @Author sun + * @Description 热议中话题-机关日统计 + **/ + @Override + public void agencyTopicStatus(TopicStatusFormDTO formDTO) { + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + 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)); + } + //入参有客户Id的则按客户Id执行,没有的则全部客户都执行 + if (null != formDTO && StringUtils.isNotBlank(formDTO.getCustomerId())) { + log.info("单独统计客户组织下热议中话题日统计数据,当前统计的客户Id:" + formDTO.getCustomerId()); + agencyTopic(formDTO.getCustomerId(), formDTO.getDateId()); + } else { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + log.info("for循环统计机关热议中话题日统计数据,当前统计的客户Id:" + customerId); + //遍历统计每一个客户数据 + agencyTopic(customerId, formDTO.getDateId()); + } catch (Exception e) { + log.error("热议中话题机关日统计程序错误,对应客户Id:" + customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + } + + /** + * @Author sun + * @Description 热议中话题-机关日统计数据 + **/ + private void agencyTopic(String customerId, String dateId) { + //1:查询各维度表Id,方便使用 + Date date = DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD); + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 + log.info("StatsTopicServiceImpl.agencyTopic-根据客户Id查询机关维度数据,对应客户Id:" + customerId); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + + //3.根据客户Id查询网格维度表数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + + //4..根据客户Id查询客户下有效的话题数据,查询dateId之前的数据 + List groupList = topicService.getTopicList(customerId, dateId); + + List list = new ArrayList<>(); + //5.遍历组织维度数据分别计算每个组织下话题数据 + DimIdGenerator.DimIdBean finalDimId = dimId; + agencyList.forEach(agency->{ + FactTopicHotdiscussAgencyDailyEntity entity = new FactTopicHotdiscussAgencyDailyEntity(); + //5-1.汇总组织及所有下级组织列表 + Map map = new HashMap<>(); + map.put(agency.getId(), agency.getId()); + String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); + agencyList.forEach(sub -> { + if (sub.getPids().contains(subPids)) { + map.put(sub.getId(), sub.getId()); + } + }); + + //5-2.汇总组织及下级所有的网格列表 + List agencyGridList = new ArrayList<>(); + gridList.forEach(grid->{ + if (map.containsKey(grid.getAgencyId())) { + agencyGridList.add(grid.getId()); + } + }); + + AtomicInteger total = new AtomicInteger(0); + AtomicInteger num = new AtomicInteger(0); + //5-3.根据汇总的网格列表统计对应的群组数据 + agencyGridList.forEach(gridId -> { + groupList.forEach(l -> { + if (gridId.equals(l.getGridId())) { + total.addAndGet(1); + if(l.getStatus().equals("discussing") && !l.getShiftIssue()){ + num.addAndGet(1); + } + } + }); + }); + //封装数据 + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + entity.setDateId(finalDimId.getDateId()); + entity.setWeekId(finalDimId.getWeekId()); + entity.setMonthId(finalDimId.getMonthId()); + entity.setQuarterId(finalDimId.getQuarterId()); + entity.setYearId(finalDimId.getYearId()); + entity.setTopicTotal(total.get()); + entity.setStatus("hot_discuss"); + entity.setTopicCount(num.get()); + list.add(entity); + }); + + //6.批量插入数据库,先删后增的逻辑 + if (!CollectionUtils.isEmpty(list)) { + //5.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactTopicHotdiscussAgencyDailyEntity delEntity = new FactTopicHotdiscussAgencyDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + log.info("StatsTopicServiceImpl.agencyTopic-根据客户Id、日维度Id批量删除热议中话题机关日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factTopicHotdiscussAgencyDailyService.delTopicAgency(delEntity); + + //5.2:批量保存机关日统计数据 + log.info("StatsTopicServiceImpl.agencyTopic-批量新增小组总数网格日统计表数据,对应客户Id:" + customerId + ",日维度Id:" + dimId.getDateId()); + factTopicHotdiscussAgencyDailyService.insertBatch(list); + } + + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java index 92516e516b..0eb247471e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -29,4 +29,23 @@ public interface CustomerAgencyService { * @return com.epmet.dto.org.result.OrgStaffResultDTO */ List queryOrgStaffIds(String customerId); + + + List queryAgencyListByCustomerId(String customerId); + + /** + * 根据组织id查询基本信息 + * + * @param agencyId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity getAgencyById(String agencyId); + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + CustomerAgencyEntity getAgencyByDeptId(String deptId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java index 3a3d8b4511..d603b6781c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -76,4 +76,31 @@ public class CustomerAgencyServiceImpl implements CustomerAgencyService { resultList.addAll(gridStaffIds); return resultList; } + + @Override + public List queryAgencyListByCustomerId(String customerId) { + return customerAgencyDao.queryAgencyListByCustomerId(customerId); + } + + /** + * 根据组织id查询基本信息 + * + * @param agencyId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + @Override + public CustomerAgencyEntity getAgencyById(String agencyId) { + return customerAgencyDao.selectById(agencyId); + } + + /** + * 查询部门所属组织信息 + * + * @param deptId + * @return com.epmet.entity.evaluationindex.screen.ScreenCustomerAgencyEntity + */ + @Override + public CustomerAgencyEntity getAgencyByDeptId(String deptId) { + return customerAgencyDao.selectByDeptId(deptId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 56a99d5257..36c3ebd05b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -23,6 +23,7 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Param; @@ -152,4 +153,13 @@ public interface ProjectService extends BaseService { */ List getProjectCategoryData(String customerId, String dateId); + /** + * 获取项目满意度 + * @author zhaoqifeng + * @date 2021/5/21 10:04 + * @param customerId + * @return java.util.List + */ + List getProjectSatisfaction(String customerId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index d2a3ff001d..3581f920b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -26,17 +26,16 @@ import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.ProjectPointDTO; import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; import java.util.stream.Collectors; /** @@ -163,5 +162,39 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/5/21 10:04 + */ + @Override + public List getProjectSatisfaction(String customerId) { + List list = baseDao.selectProjectSatisfaction(customerId); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(list)) { + return Collections.emptyList(); + } + //获取项目满意指标 + String value = baseDao.selectValueByKey(customerId, "satisfaction"); + if (null == value) { + //客户没有自定义配置的话取默认配置 + value = baseDao.selectValueByKey("default", "satisfaction"); + } + + String finalValue = value; + return list.stream().map(item -> { + FactOriginProjectMainDailyEntity entity = new FactOriginProjectMainDailyEntity(); + entity.setId(item.getProjectId()); + if (item.getPoint() < Integer.parseInt(finalValue)) { + entity.setIsSatisfied(NumConstant.ZERO); + } else { + entity.setIsSatisfied(NumConstant.ONE); + } + return entity; + }).collect(Collectors.toList()); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java index d231065d66..d93248f4f5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -131,4 +131,12 @@ public interface DimCustomerPartymemberService extends BaseService getPartyMemberUserIds(String customerId, String type,String orgId); + + /** + * 查询当前客户下所有注册的党员 + * + * @param customerId + * @return 返回网格id、用户id + */ + List selectPartyMemberInfoByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java new file mode 100644 index 0000000000..6a3e24b5f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyOriginProjectDailyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactAgencyOriginProjectDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyOriginProjectDailyDTO + * @author generator + * @date 2021-05-12 + */ + FactAgencyOriginProjectDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactAgencyOriginProjectDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactAgencyOriginProjectDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java new file mode 100644 index 0000000000..5d3a4fdb19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyOriginProjectMonthlyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactAgencyOriginProjectMonthlyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +public interface FactAgencyOriginProjectMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-12 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-12 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactAgencyOriginProjectMonthlyDTO + * @author generator + * @date 2021-05-12 + */ + FactAgencyOriginProjectMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void save(FactAgencyOriginProjectMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-12 + */ + void update(FactAgencyOriginProjectMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-12 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java new file mode 100644 index 0000000000..602b0092f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalAgencyDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FactGroupTotalAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +public interface FactGroupTotalAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupTotalAgencyDailyDTO + * @author generator + * @date 2021-05-10 + */ + FactGroupTotalAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void save(FactGroupTotalAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void update(FactGroupTotalAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-10 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java new file mode 100644 index 0000000000..fef3b0328c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupTotalGridDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.FactGroupTotalGridDailyDTO; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +public interface FactGroupTotalGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-10 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-10 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupTotalGridDailyDTO + * @author generator + * @date 2021-05-10 + */ + FactGroupTotalGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void save(FactGroupTotalGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-10 + */ + void update(FactGroupTotalGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-10 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java new file mode 100644 index 0000000000..385b615549 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardAgencyDailyService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactPartyMemberVanguardAgencyDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactPartyMemberVanguardAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactPartyMemberVanguardAgencyDailyDTO + * @author generator + * @date 2021-05-13 + */ + FactPartyMemberVanguardAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void save(FactPartyMemberVanguardAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void update(FactPartyMemberVanguardAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-13 + */ + void delete(String[] ids); + + /** + * 清除日数据 + * @author zhaoqifeng + * @date 2021/5/17 15:55 + * @param customerId + * @param dateId + * @return void + */ + void deleteDailyData(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardGridDailyService.java new file mode 100644 index 0000000000..bfe7d258ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactPartyMemberVanguardGridDailyService.java @@ -0,0 +1,105 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactPartyMemberVanguardGridDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +public interface FactPartyMemberVanguardGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-13 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-13 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactPartyMemberVanguardGridDailyDTO + * @author generator + * @date 2021-05-13 + */ + FactPartyMemberVanguardGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void save(FactPartyMemberVanguardGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-13 + */ + void update(FactPartyMemberVanguardGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-13 + */ + void delete(String[] ids); + + /** + * 清除日数据 + * @author zhaoqifeng + * @date 2021/5/17 15:55 + * @param customerId + * @param dateId + * @return void + */ + void deleteDailyData(String customerId, String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java new file mode 100644 index 0000000000..7e60409a73 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussAgencyDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicHotdiscussAgencyDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +public interface FactTopicHotdiscussAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicHotdiscussAgencyDailyDTO + * @author generator + * @date 2021-05-17 + */ + FactTopicHotdiscussAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void save(FactTopicHotdiscussAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void update(FactTopicHotdiscussAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-17 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java new file mode 100644 index 0000000000..e7a3fbfe0a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTopicHotdiscussGridDailyService.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicHotdiscussGridDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +public interface FactTopicHotdiscussGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-05-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-05-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicHotdiscussGridDailyDTO + * @author generator + * @date 2021-05-17 + */ + FactTopicHotdiscussGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void save(FactTopicHotdiscussGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-05-17 + */ + void update(FactTopicHotdiscussGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-05-17 + */ + void delete(String[] ids); + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 5aa8fb1d26..cec5da65e6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -246,4 +246,15 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl selectPartyMemberInfoByCustomerId(String customerId) { + return baseDao.selectPartyMemberInfoByCustomerId(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java new file mode 100644 index 0000000000..ef08dc5cbf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectDailyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactAgencyOriginProjectDailyDao; +import com.epmet.dto.stats.FactAgencyOriginProjectDailyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectDailyEntity; +import com.epmet.service.stats.FactAgencyOriginProjectDailyService; +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 java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactAgencyOriginProjectDailyServiceImpl extends BaseServiceImpl implements FactAgencyOriginProjectDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactAgencyOriginProjectDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyOriginProjectDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactAgencyOriginProjectDailyDTO get(String id) { + FactAgencyOriginProjectDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyOriginProjectDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyOriginProjectDailyDTO dto) { + FactAgencyOriginProjectDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyOriginProjectDailyDTO dto) { + FactAgencyOriginProjectDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java new file mode 100644 index 0000000000..55a965b5d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyOriginProjectMonthlyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactAgencyOriginProjectMonthlyDao; +import com.epmet.dto.stats.FactAgencyOriginProjectMonthlyDTO; +import com.epmet.entity.stats.FactAgencyOriginProjectMonthlyEntity; +import com.epmet.service.stats.FactAgencyOriginProjectMonthlyService; +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 java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-12 + */ +@Service +public class FactAgencyOriginProjectMonthlyServiceImpl extends BaseServiceImpl implements FactAgencyOriginProjectMonthlyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactAgencyOriginProjectMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactAgencyOriginProjectMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactAgencyOriginProjectMonthlyDTO get(String id) { + FactAgencyOriginProjectMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactAgencyOriginProjectMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactAgencyOriginProjectMonthlyDTO dto) { + FactAgencyOriginProjectMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactAgencyOriginProjectMonthlyDTO dto) { + FactAgencyOriginProjectMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactAgencyOriginProjectMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..d10940fcc3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalAgencyDailyServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactGroupTotalAgencyDailyDao; +import com.epmet.dto.FactGroupTotalAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupTotalAgencyDailyEntity; +import com.epmet.service.stats.FactGroupTotalAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小组总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Service +public class FactGroupTotalAgencyDailyServiceImpl extends BaseServiceImpl implements FactGroupTotalAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupTotalAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupTotalAgencyDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactGroupTotalAgencyDailyDTO get(String id) { + FactGroupTotalAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupTotalAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupTotalAgencyDailyDTO dto) { + FactGroupTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupTotalAgencyDailyDTO dto) { + FactGroupTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateGroupTotal(FactGroupTotalAgencyDailyEntity delEntity) { + baseDao.delDateGroupTotal(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java new file mode 100644 index 0000000000..f8aa5d5afe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupTotalGridDailyServiceImpl.java @@ -0,0 +1,108 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactGroupTotalGridDailyDao; +import com.epmet.dto.FactGroupTotalGridDailyDTO; +import com.epmet.entity.stats.FactGroupTotalGridDailyEntity; +import com.epmet.service.stats.FactGroupTotalGridDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 小组总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-10 + */ +@Service +public class FactGroupTotalGridDailyServiceImpl extends BaseServiceImpl implements FactGroupTotalGridDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupTotalGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupTotalGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactGroupTotalGridDailyDTO get(String id) { + FactGroupTotalGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupTotalGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupTotalGridDailyDTO dto) { + FactGroupTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupTotalGridDailyDTO dto) { + FactGroupTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupTotalGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateGroupTotal(FactGroupTotalGridDailyEntity delEntity) { + baseDao.delDateGroupTotal(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..9c951b7b2f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardAgencyDailyServiceImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.FactPartyMemberVanguardAgencyDailyDao; +import com.epmet.dto.stats.FactPartyMemberVanguardAgencyDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardAgencyDailyEntity; +import com.epmet.service.stats.FactPartyMemberVanguardAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class FactPartyMemberVanguardAgencyDailyServiceImpl extends BaseServiceImpl implements FactPartyMemberVanguardAgencyDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactPartyMemberVanguardAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactPartyMemberVanguardAgencyDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactPartyMemberVanguardAgencyDailyDTO get(String id) { + FactPartyMemberVanguardAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactPartyMemberVanguardAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactPartyMemberVanguardAgencyDailyDTO dto) { + FactPartyMemberVanguardAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactPartyMemberVanguardAgencyDailyDTO dto) { + FactPartyMemberVanguardAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 清除日数据 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2021/5/17 15:55 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteDailyData(String customerId, String dateId) { + baseDao.deleteDailyData(customerId, dateId); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardGridDailyServiceImpl.java new file mode 100644 index 0000000000..235cf53e23 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactPartyMemberVanguardGridDailyServiceImpl.java @@ -0,0 +1,118 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.FactPartyMemberVanguardGridDailyDao; +import com.epmet.dto.stats.FactPartyMemberVanguardGridDailyDTO; +import com.epmet.entity.stats.FactPartyMemberVanguardGridDailyEntity; +import com.epmet.service.stats.FactPartyMemberVanguardGridDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党员先锋-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-13 + */ +@Service +@DataSource(DataSourceConstant.STATS) +public class FactPartyMemberVanguardGridDailyServiceImpl extends BaseServiceImpl implements FactPartyMemberVanguardGridDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactPartyMemberVanguardGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactPartyMemberVanguardGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactPartyMemberVanguardGridDailyDTO get(String id) { + FactPartyMemberVanguardGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactPartyMemberVanguardGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactPartyMemberVanguardGridDailyDTO dto) { + FactPartyMemberVanguardGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactPartyMemberVanguardGridDailyDTO dto) { + FactPartyMemberVanguardGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactPartyMemberVanguardGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 清除日数据 + * + * @param customerId + * @param dateId + * @return void + * @author zhaoqifeng + * @date 2021/5/17 15:55 + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteDailyData(String customerId, String dateId) { + baseDao.deleteDailyData(customerId, dateId); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..af5f866943 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussAgencyDailyServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactTopicHotdiscussAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicHotdiscussAgencyDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussAgencyDailyEntity; +import com.epmet.service.stats.FactTopicHotdiscussAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Service +public class FactTopicHotdiscussAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicHotdiscussAgencyDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicHotdiscussAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicHotdiscussAgencyDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactTopicHotdiscussAgencyDailyDTO get(String id) { + FactTopicHotdiscussAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicHotdiscussAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicHotdiscussAgencyDailyDTO dto) { + FactTopicHotdiscussAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicHotdiscussAgencyDailyDTO dto) { + FactTopicHotdiscussAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delTopicAgency(FactTopicHotdiscussAgencyDailyEntity delEntity) { + baseDao.delTopicAgency(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java new file mode 100644 index 0000000000..697143bfd2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTopicHotdiscussGridDailyServiceImpl.java @@ -0,0 +1,109 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.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.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.dao.stats.FactTopicHotdiscussGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicHotdiscussGridDailyDTO; +import com.epmet.entity.stats.FactTopicHotdiscussGridDailyEntity; +import com.epmet.service.stats.FactTopicHotdiscussGridDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-05-17 + */ +@Service +public class FactTopicHotdiscussGridDailyServiceImpl extends BaseServiceImpl implements FactTopicHotdiscussGridDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicHotdiscussGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicHotdiscussGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactTopicHotdiscussGridDailyDTO get(String id) { + FactTopicHotdiscussGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicHotdiscussGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicHotdiscussGridDailyDTO dto) { + FactTopicHotdiscussGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicHotdiscussGridDailyDTO dto) { + FactTopicHotdiscussGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicHotdiscussGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delTopicGrid(FactTopicHotdiscussGridDailyEntity delEntity) { + baseDao.delTopicGrid(delEntity); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index 475fb886c7..78a823b155 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -6,6 +6,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -116,4 +117,10 @@ public interface TopicService { * @date 2021/4/13 5:39 下午 */ ResiTopicAndImgResultDTO getTopicAndImgs(String topicId,String attachmentType); + + /** + * @Author sun + * @Description 根据客户Id和截止日期查询话题业务数据 + **/ + List getTopicList(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 0b74adba49..a47baa85bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -14,6 +14,7 @@ import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; import com.epmet.dto.stats.topic.result.GroupTopicData; +import com.epmet.dto.stats.topic.result.TopicListResultDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.topic.TopicOriginInfoDTO; @@ -1413,4 +1414,14 @@ public class TopicServiceImpl implements TopicService { public List queryTopicOriginInfoList(String customerId, String dateId) { return topicDao.selectListTopicOriginInfo(customerId, dateId); } + + /** + * @Author sun + * @Description 根据客户Id和截止日期查询话题业务数据 + **/ + @Override + public List getTopicList(String customerId, String dateId) { + return topicDao.selectTopicList(customerId, dateId); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql new file mode 100644 index 0000000000..a4e1300cdb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.12__alter_fact_origin_group_main_daily.sql @@ -0,0 +1,3 @@ +ALTER TABLE `fact_origin_group_main_daily` +ADD COLUMN `GROUP_TYPE` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '小组类型(ordinary:楼院小组 branch:支部小组)' AFTER `GROUP_STATE`; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.13__group_and_topic_stats.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.13__group_and_topic_stats.sql new file mode 100644 index 0000000000..5e2b260221 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.13__group_and_topic_stats.sql @@ -0,0 +1,87 @@ +CREATE TABLE `fact_group_total_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dim表', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '当前组织及下级小组总数', + `ORDINARY_TOTAL` int(11) DEFAULT NULL COMMENT '当前组织及下级楼院小组总数', + `BRANCH_TOTAL` int(11) DEFAULT NULL COMMENT '当前组织及下级支部小组总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小组总数-机关日统计表'; + +CREATE TABLE `fact_group_total_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dim表', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_TOTAL` int(11) DEFAULT '0' COMMENT '网格下小组总数', + `ORDINARY_TOTAL` int(11) DEFAULT NULL COMMENT '网格下楼院小组总数', + `BRANCH_TOTAL` int(11) DEFAULT NULL COMMENT '网格下支部小组总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='小组总数-网格日统计表'; + +CREATE TABLE `fact_topic_hotdiscuss_agency_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID 关联机关dm表', + `PID` varchar(64) NOT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dm表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `STATUS` varchar(32) DEFAULT NULL COMMENT '话题状态【热议中:hot_discuss】', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '状态话题数量', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='热议中话题机关日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】'; + +CREATE TABLE `fact_topic_hotdiscuss_grid_daily` ( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机关ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID 关联网格dm表', + `DATE_ID` varchar(32) NOT NULL COMMENT '日期ID', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季度ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `TOPIC_TOTAL` int(11) DEFAULT '0' COMMENT '话题总数', + `STATUS` varchar(32) DEFAULT NULL COMMENT '话题状态【热议中:hot_discuss】', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '状态话题数量', + `DEL_FLAG` varchar(32) NOT NULL DEFAULT '0' COMMENT '删除标识', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='热议中话题网格日统计表【热议中指的没有被关闭、屏蔽、转议题的话题】'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql new file mode 100644 index 0000000000..b5e87ed6f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__cpc_subscore_add_samplecount.sql @@ -0,0 +1,5 @@ +alter table fact_index_grid_sub_score add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; +alter table fact_index_community_sub_score + add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; +alter table fact_index_agency_sub_score + add column SAMPLE_COUNT int(10) comment '参与统计的样本个数' after ORIGIN_VALUE; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql new file mode 100644 index 0000000000..a450ab5eec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.14__groupact_analysis.sql @@ -0,0 +1,47 @@ +-- epmet_data_statistical 库执行以下脚本 +CREATE TABLE `fact_group_act_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至日期Id:yyyyMMdd', + `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', + `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', + `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', + `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', + `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', + `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', + `LEVEL` int(11) NOT NULL COMMENT '分类等级', + `ORGANIZE_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 组织次数;包含dateId这一天的数据', + `PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 参加人数;包含dateId这一天的数据', + `AVG_PARTICIPATE_USER_TOTAL` int(11) NOT NULL COMMENT '截止到dateId: 平均参加人数;包含dateId这一天的数据', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织活动(参加人数、组织次数、平均参加人数)按天累计值分析'; + + +CREATE TABLE `fact_group_act_monthly` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', + `MONTH_ID` varchar(8) NOT NULL COMMENT '数据维度:yyyyMM', + `ORG_ID` varchar(64) NOT NULL COMMENT '网格id', + `ORG_TYPE` varchar(10) NOT NULL COMMENT '网格:grid;组织:agency', + `PID` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pid=网格所属组织id;\r\n2)orgType=agency: pid=当前组织的上级组织', + `PIDS` varchar(255) DEFAULT NULL COMMENT '1)orgType=grid: pids=网格所有上级组织,包括pid;\r\n2)orgType=agency: pids=当前组织的所有上级组织,包括pid.', + `CATEGORY_CODE` varchar(255) NOT NULL COMMENT '活动分类编码', + `PARENT_CODE` varchar(255) NOT NULL COMMENT '上级分类编码', + `LEVEL` int(11) NOT NULL COMMENT '分类等级', + `ORGANIZE_INCR` int(11) NOT NULL COMMENT '本月内:活动组织次数', + `PARTICIPATE_USER__INCR` int(11) NOT NULL COMMENT '本月内:活动签到人数参加人数', + `AVG_PARTICIPATE_USER_INCR` int(11) NOT NULL COMMENT '本月内:平均参加人数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(64) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(64) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='专项组活动(参加人数、组织次数、平均参加人数)按月增量分析'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql new file mode 100644 index 0000000000..e83d7f5313 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.15__govern.sql @@ -0,0 +1,110 @@ +-- epmet_data_statistical新增两张表,治理指数网格按天统计,治理指数按组织按天统计 + +CREATE TABLE `fact_agency_govern_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+AGENCY_ID+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '组织id', + `LEVEL` varchar(30) NOT NULL COMMENT 'agency_id所属的机关级别(社区级:community,\r\n乡(镇、街道)级:street,\r\n区县级: district,\r\n市级: city\r\n省级:province)', + `PID` varchar(64) NOT NULL COMMENT '组织i所属的组织id', + `PIDS` varchar(255) NOT NULL COMMENT '组织i所有上级id', + `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', + `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', + `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前组织内,话题关闭已解决数', + `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前组织内,话题关闭无需解决数', + `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前组织内,议题关闭已解决数', + `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前组织内,议题关闭无需解决数', + `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前组织内:来源于议题的项目:结案已解决数', + `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前组织内:来源于议题的项目:结案无需解决数', + `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前组织内:项目立项,结案已解决数;默认为0,', + `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前组织内:项目立项,结案无需解决数;默认为0,', + `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前组织内,未出小组即未转议题的:话题关闭已解决数', + `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前组织内,未出小组即未转议题的:话题关闭无需解决数', + `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL DEFAULT '0' COMMENT '11、未出当前网格的,结案项目数', + `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由社区结案的项目总数', + `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由街道结案的项目总数', + `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前组织内结案的项目中:由区直部门结案的项目总数', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='组织的治理指数,按天统计'; + +CREATE TABLE `fact_grid_govern_daily` ( + `ID` varchar(64) NOT NULL COMMENT '主键,customer_id+grid_id+date_id只有一条记录', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd; ', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格id', + `PID` varchar(64) NOT NULL COMMENT '网格所属的组织id', + `PIDS` varchar(255) NOT NULL COMMENT '网格所有上级id', + `PROBLEM_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '界面展示:问题解决总数=1+2+3+4+5+6+7+8', + `GROUP_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:党群自治占比=(9+10)/PROBLEM_RESOLVED_COUNT; 此列存储的是小数', + `GRID_SELF_GOVERN_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:网格自治占比=GRID_SELF_GOVERN_PROJECT_TOTAL/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `COMMUNITY_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:社区解决占比=COMMUNITY_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `STREET_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:街道解决占比=STREET_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `DISTRICT_DEPT_CLOSED_RATIO` decimal(10,6) NOT NULL COMMENT '界面展示:区直部门解决占比=DISTRICT_DEPT_CLOSED_COUNT/PROBLEM_RESOLVED_COUNT;此列存储的是小数', + `TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '1、当前网格内,话题关闭已解决数', + `TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '2、当前网格内,话题关闭无需解决数', + `ISSUE_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '3、当前网格内,议题关闭已解决数', + `ISSUE_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '4、当前网格内,议题关闭无需解决数', + `ISSUE_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '5、当前网格内:来源于议题的项目:结案已解决数', + `ISSUE_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '6、当前网格内:来源于议题的项目:结案无需解决数', + `APPROVAL_PROJECT_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '7、当前网格内:项目立项,结案已解决数;默认为0,', + `APPROVAL_PROJECT_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '8、当前网格内:项目立项,结案无需解决数;默认为0,', + `IN_GROUP_TOPIC_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '9、当前网格内,未出小组即未转议题的:话题关闭已解决数', + `IN_GROUP_TOPIC_UN_RESOLVED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '10、当前网格内,未出小组即未转议题的:话题关闭无需解决数', + `FROM_ISSUE_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '11、来源于议题的项目,未出网格结案并且已解决的项目数', + `FROM_ISSUE_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '12、来源于议题的项目,未出网格结案并且无需解决的项目数', + `FROM_AGENCY_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '13、来源于项目立项的项目,未出网格结案,并且已解决的项目数;因现在网格不能立项,所以此列默认为0', + `FROM_AGENCY_UN_RESOLVED_IN_GRID_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '14、来源于项目立项的项目,未出网格结案,并且无需解决的项目数;因现在网格不能立项,所以此列默认为0', + `GRID_SELF_GOVERN_PROJECT_TOTAL` int(11) NOT NULL COMMENT '15、未出当前网格的,结案项目数=11+12+13+14', + `COMMUNITY_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由社区结案(已解决+未解决)的项目总数', + `STREET_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由街道结案(已解决+未解决)的项目总数', + `DISTRICT_DEPT_CLOSED_COUNT` int(11) NOT NULL DEFAULT '0' COMMENT '当前网格内出来的项目:由区直部门(已解决+未解决)结案的项目总数', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除、1已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间:第一次提交审核的时间,注意和历史表的第一条记录时间一致', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='网格的治理指数,按天统计'; + +# 小组成员添加是否是党员 +ALTER TABLE `epmet_data_statistical`.`fact_origin_group_member_daily` + ADD COLUMN `IS_PARTY` tinyint(1) NULL DEFAULT 0 COMMENT '是否是党员' AFTER `ACTION_CODE`; + +# 项目主表添加结案项目是否满意 +ALTER TABLE `epmet_data_statistical`.`fact_origin_project_main_daily` + ADD COLUMN `IS_SATISFIED` tinyint(1) NULL COMMENT '是否满意 1:是' AFTER `IS_OVERDUE`; + +# 添加治理能力按日统计表 +CREATE TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` ( + `ID` varchar(64) NOT NULL COMMENT 'ID 主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户Id', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年Id', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月份Id', + `DATE_ID` varchar(8) NOT NULL COMMENT '数据更新至:yyyyMMdd', + `ORG_TYPE` varchar(32) NOT NULL DEFAULT 'agency' COMMENT '组织类别 agency:组织;部门:department;网格:grid', + `ORG_ID` varchar(64) NOT NULL COMMENT '组织Id 可以为网格,机关id', + `PARENT_ID` varchar(64) NOT NULL COMMENT '上级组织Id', + `ORG_NAME` varchar(32) NOT NULL COMMENT '组织名称', + `RESPONSE_RATIO` decimal(10,6) DEFAULT NULL COMMENT '响应率', + `RESOLVED_RATIO` decimal(10,6) DEFAULT NULL COMMENT '解决率', + `GOVERN_RATIO` decimal(10,6) DEFAULT NULL COMMENT '自治率', + `SATISFACTION_RATIO` decimal(10,6) DEFAULT NULL COMMENT '满意率', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 0未删除;1已删除', + `REVISION` int(11) NOT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='基层治理-治理能力排行数据(按日统计)'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql new file mode 100644 index 0000000000..15cca09546 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.17__inxdex_explain.sql @@ -0,0 +1,113 @@ +CREATE TABLE `index_explain` ( + `ID` varchar(64) NOT NULL COMMENT '主键', + `CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户id', + `TITLE` varchar(32) NOT NULL COMMENT '名称', + `INDEX_CODE` varchar(256) NOT NULL COMMENT '指标code', + `MEANING` varchar(256) NOT NULL COMMENT '含义', + `ORG_LEVEL` varchar(16) NOT NULL COMMENT '组织级别(网格级:grid;社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province)', + `PID` varchar(16) NOT NULL COMMENT '父ID', + `SORT` int(11) NOT NULL COMMENT '排序', + `IS_SEARCH` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否需要查询;1有;0:无;', + `TYPE` varchar(16) NOT NULL DEFAULT 'none' COMMENT '数据类型:none;本级:self;下级:sub', + `DEL_FLAG` varchar(1) NOT NULL DEFAULT '0' COMMENT '删除标记 0:未删除,1:已删除', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL DEFAULT 'app_user' COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='指标说明文案'; + +#插入指标结束 +BEGIN; +INSERT INTO `index_explain` VALUES ('1', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'grid', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('10', 'default', '1/2下级党建指数得分', 'shequxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'community', '8', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('11', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'community', '0', 4, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('12', 'default', '2/1本级治理指数得分', 'shequxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'community', '11', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('13', 'default', '2/2下级治理指数得分', 'shequxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'community', '11', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('14', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'community', '0', 3, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('15', 'default', '3/1本级服务指数得分', 'shequxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'community', '14', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('16', 'default', '3/2下级服务指数得分', 'shequxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'community', '14', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('17', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'street', '0', 5, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('18', 'default', '1/1本级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'street', '17', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('19', 'default', '1/2下级党建指数得分', 'jiedaoxiangguan:dangjiannengli', '下级党建指数得分=下级所有网格党建指数的平均值*相关权重', 'street', '17', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('2', 'default', '1/1本级党建指数得分', 'wanggexiangguan:dangjiannengli', '本级党建指数得分=网格各项党建指数指标数据得分*相关权重之和', 'grid', '1', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('20', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'street', '0', 6, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('21', 'default', '2/1本级治理指数得分', 'jiedaoxiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'street', '20', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('22', 'default', '2/2下级治理指数得分', 'jiedaoxiangguan:zhilinengli', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'street', '20', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('23', 'default', '服务指数', '', '含义:自然月周期内,服务指数得分=本级服务指数得分+下级服务指数得分', 'street', '0', 7, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('24', 'default', '3/1本级服务指数得分', 'jiedaoxiangguan:fuwunengli', '本级服务指数得分=社区活动组织次数得分*相关权重', 'street', '23', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('25', 'default', '3/2下级服务指数得分', 'jiedaoxiangguan:fuwunengli', '下级服务指数得分=社区下级所有网格服务指数得分(平均值)*相关权重', 'street', '23', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('26', 'default', '党建指数', '', '含义:自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'district', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('27', 'default', '1/1本级党建指数得分', 'quanquxiangguan:dangjiannengli', '本级党建指数得分=区名义发文数量得分*相关权重', 'district', '26', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('28', 'default', '1/2下级党建指数得分', 'quanquxiangguan:dangjiannengli', '下级党建指数得分=区下级街道党建指数汇总(平均值)*相关权重', 'district', '26', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('29', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=所有街道治理指数(平均值)*相关权重(d%)+所有直属部门治理指数(平均值)*相关权重(d%)', 'district', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('3', 'default', '1/2下级党建指数得分', 'dangyuanxiangguan:lianxiqunzhong', '下级党建指数得分=组织内党员的联系群众指数考评分(平均值)*相关权重', 'grid', '1', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('30', 'default', '2/1所有街道治理指数(平均值)', 'quanquxiangguan:zhilinengli', '所有街道治理指数(平均值)得分=区下级所有街道治理指数得分总和/街道总数', 'district', '29', 1, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('31', 'default', '2/2所有直属部门治理指数(平均值)', 'quzhibumen:zhilinengli', '所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和', 'district', '29', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('32', 'default', '服务指数', 'quanquxiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=区下属街道服务指数汇总(平均值)=区下属所有街道服务指数得分之和/街道总数', 'district', '0', 3, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('4', 'default', '治理指数', '', '含义:自然月周期内,治理指数得分=本级治理指数得分+下级治理指数得分', 'grid', '0', 2, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('5', 'default', '2/1本级治理指数得分', 'wanggexiangguan:zhilinengli', '本级治理指数得分=网格各项治理指数指标数据得分*相关权重之和', 'grid', '4', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('6', 'default', '2/2下级治理指数得分', 'dangyuanxiangguan:canyuyishi', '下级治理指数得分=组织内党员的参与议事指数考评分(平均值)*相关权重', 'grid', '4', 2, 1, 'xiaji', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('7', 'default', '服务指数', 'wanggexiangguan:fuwunengli', '含义:自然月周期内,服务指数得分=活动组织次数得分*相关权重+志愿者占比得分*相关权重+党员志愿者率得分*相关权重', 'grid', '0', 3, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('8', 'default', '党建指数', '', '自然月周期内,党建指数得分=本级党建指数得分+下级党建指数得分', 'community', '0', 1, 0, 'none', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +INSERT INTO `index_explain` VALUES ('9', 'default', '1/1本级党建指数得分', 'shequxiangguan:dangjiannengli', '本级党建指数得分=社区名义发文数量得分*相关权重', 'community', '8', 1, 1, 'zishen', '0', 0, 'app_user', '2021-05-12 14:25:14', 'app_user', '2021-05-12 14:25:16'); +COMMIT; + +#更新含义 +update index_dict SET INDEX_DESC='自然月周期内,网格内注册群众用户数。' WHERE INDEX_CODE = 'wanggequnzhongyhs'; +update index_dict SET INDEX_DESC='自然月周期内,网格内注册党员用户数。' WHERE INDEX_CODE = 'wanggedangyuanyhs'; +update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的群众用户。' WHERE INDEX_CODE = 'wanggehuoyueqzyhs'; +update index_dict SET INDEX_DESC='自然月周期内,参与话题、事件评论、点赞、点踩总次数大于给定阈值的党员用户。' WHERE INDEX_CODE = 'wanggehuoyuedyyhs'; +update index_dict SET INDEX_DESC='自然月周期内,网格内党员提出的总话题数与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtchts'; +update index_dict SET INDEX_DESC='自然月周期内,网格内群众提出的总话题数与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtchts'; +update index_dict SET INDEX_DESC='自然月周期内,网格内所有党员提出的议题转为项目的数目与党员人数之比。' WHERE INDEX_CODE = 'wanggedangyuanrjtcdytzxms'; +update index_dict SET INDEX_DESC='自然月周期内,网格内所有群众提出的议题转为项目的数目与群众人数之比。' WHERE INDEX_CODE = 'wanggequnzhongrjtcdytzxms'; +update index_dict SET INDEX_DESC='自然月周期内,党员自建群(群主)数量。' WHERE INDEX_CODE = 'jianqundangyuans'; +update index_dict SET INDEX_DESC='自然月周期内,党员自建群群众人数乘相关权重、党员自建群活跃群众人数乘相关权重、党员自建群活跃度-话题数乘相关权重与自建群活跃度-议题转项目率乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,网格内所有发文数量' WHERE INDEX_CODE = 'wanggedifawsl'; +update index_dict SET INDEX_DESC='自然月周期内,已转项目议题数与近两个自然月内议题总数之比' WHERE INDEX_CODE = 'wanggeyitizxml'; +update index_dict SET INDEX_DESC='自然月周期内,本网格内注册党员活动签到次数。' WHERE INDEX_CODE = 'dangyuancanjiashykrc'; +update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'xiashusuoyouwgddjnlpjz'; +update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区党建指数得分之和与网格总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqdjnlhzpjz'; +update index_dict SET INDEX_DESC='自然月周期内,街道内所有发文数量' WHERE INDEX_CODE = 'jiedaomingyifwsl'; +update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道党建指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiajijieddjnlhzpjz'; +update index_dict SET INDEX_DESC='自然月周期内,区内所有发文数量' WHERE INDEX_CODE = 'qumingyifawsl'; +update index_dict SET INDEX_DESC='自然月周期内,党员提出话题数乘相关权重、党员参与话题数乘相关权重、党员提出的话题转议题数乘相关权重与党员提出的议题转项目数乘相关权重之和' WHERE INDEX_CODE = 'zuzhineidangydcyysnlkpfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,网格内成员提出议题的总数量' WHERE INDEX_CODE = 'wanggezongyitsm'; +update index_dict SET INDEX_DESC='自然月周期内,新增议题数与发布议题人数去重之比' WHERE INDEX_CODE = 'wanggerenjunytsm'; +update index_dict SET INDEX_DESC='自然月周期内,议题转化的项目数' WHERE INDEX_CODE = 'wanggezongxiangms'; +update index_dict SET INDEX_DESC='自然月周期内,从议题创建到项目关闭,包括处理人,没有出过议题所属网格的项目数。' WHERE INDEX_CODE = 'wanggezizhixms'; +update index_dict SET INDEX_DESC='自然月周期内,办结的项目数' WHERE INDEX_CODE = 'wanggebanjiexms'; +update index_dict SET INDEX_DESC='自然月周期内,未被退回的项目数与项目总数之比' WHERE INDEX_CODE = 'wanggechuishaobmzql'; +update index_dict SET INDEX_DESC='自然月周期内,网格内自治办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'wanggeneijiejdxmdmyd'; +update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格治理指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiashusywgzlnlhzpjz'; +update index_dict SET INDEX_DESC='自然月周期内,社区被吹哨的次数' WHERE INDEX_CODE = 'shequbeichuiscs'; +update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexms'; +update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'shequxiangmuxyd'; +update index_dict SET INDEX_DESC='自然月周期内,超期项目数与结案项目数之比' WHERE INDEX_CODE = 'shequchaoqixml'; +update index_dict SET INDEX_DESC='自然月周期内,社区办结项目数目' WHERE INDEX_CODE = 'shequbanjiexml'; +update index_dict SET INDEX_DESC='自然月周期内,社区级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'shequbanjiexmmyd'; +update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区治理指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusysqzlnlhz'; +update index_dict SET INDEX_DESC='自然月周期内,街道被吹哨的次数' WHERE INDEX_CODE = 'jiedaobeichuiscs'; +update index_dict SET INDEX_DESC='自然月周期内,街道办结项目数目' WHERE INDEX_CODE = 'jiedaobanjiexms'; +update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'jiedaoxiangmuxyd'; +update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'jiedaobanjiexmdclxl'; +update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目数目与街道级尚未办结的项目数的比例' WHERE INDEX_CODE = 'jiedaoxiangmubjl'; +update index_dict SET INDEX_DESC='自然月周期内,街道级办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'jiedaojixiangmmyd'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门被吹哨的次数' WHERE INDEX_CODE = 'quzhibumenbcscs'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目' WHERE INDEX_CODE = 'quzhibumenbjxms'; +update index_dict SET INDEX_DESC='自然月周期内,项目受理时长(分钟)与项目数之比' WHERE INDEX_CODE = 'quzhibumenxmxyd'; +update index_dict SET INDEX_DESC='自然月周期内,办结项目的平均处理时长的倒数' WHERE INDEX_CODE = 'quzhibumenbjxmdclxl'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目数目与区直部门尚未办结的项目数的比例' WHERE INDEX_CODE = 'quzhibumenxmbjl'; +update index_dict SET INDEX_DESC='自然月周期内,区直部门办结项目的满意度评价的平均分(非常满意100,满意80,一般60)' WHERE INDEX_CODE = 'quzhibumenxmmyd'; +update index_dict SET INDEX_DESC='所有指数部门治理指数(平均值)得分=区直部门各项治理指数指标数据平均分*相关权重之和' WHERE INDEX_CODE = 'suoyouzhishubmzlnlpjz'; +update index_dict SET INDEX_DESC='自然月周期内,网格内爱心活动组织次数。' WHERE INDEX_CODE = 'wanggehuodongzzcs'; +update index_dict SET INDEX_DESC='自然月周期内,志愿者内党员数与志愿者总数之比' WHERE INDEX_CODE = 'wanggezhiyuanzzb'; +update index_dict SET INDEX_DESC='自然月周期内,网格内党员志愿者总数与网格党员总人数之比。' WHERE INDEX_CODE = 'wanggedangyuanzyzl'; +update index_dict SET INDEX_DESC='自然月周期内,社区下所有网格服务指数得分之和与网格总数之比' WHERE INDEX_CODE = 'shequxiajisywgfwnldfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,社区内爱心活动组织次数。' WHERE INDEX_CODE = 'shequhuodongzzcs'; +update index_dict SET INDEX_DESC='自然月周期内,街道下所有社区服务指数得分之和与社区总数之比' WHERE INDEX_CODE = 'jiedaoxiashusqfwnldfpjz'; +update index_dict SET INDEX_DESC='自然月周期内,街道内爱心活动组织次数。' WHERE INDEX_CODE = 'jiedaohuodongzzcs'; +update index_dict SET INDEX_DESC='自然月周期内,区下级所有街道服务指数得分之和与街道总数之比' WHERE INDEX_CODE = 'quxiashujiedfwnlhzpjz'; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql new file mode 100644 index 0000000000..1bbb8b6e4c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.18__modify_index_weight_for_3.0.sql @@ -0,0 +1,22 @@ +#修改党员相关 三会一课权重 +UPDATE index_group_detail_template SET WEIGHT = 0.1 WHERE INDEX_CODE = 'dangwuhuodong'; +UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'canyuyishi'; +UPDATE index_group_detail_template SET WEIGHT = 0.45 WHERE INDEX_CODE = 'lianxiqunzhong'; +UPDATE index_group_detail_template SET WEIGHT = 1 WHERE INDEX_CODE = 'canjiasanhykcs'; + +UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +UPDATE index_group_detail_template SET WEIGHT = 0.26 WHERE INDEX_CODE = 'wanggedifawsl'; +UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'zuzhisanhykcs'; +UPDATE index_group_detail_template SET WEIGHT = 0.04 WHERE INDEX_CODE = 'dangyuancanjiashykrc'; + +#开发和测试的 对应的客户已经修改执行完了 +#修改生产的 先给党群e事通和亿联员工互助会设置一下权重。再加上我们自己的 微笑崂山 +UPDATE index_group_detail SET WEIGHT = 0.1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangwuhuodong'; +UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canyuyishi'; +UPDATE index_group_detail SET WEIGHT = 0.45 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'lianxiqunzhong'; +UPDATE index_group_detail SET WEIGHT = 1 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'canjiasanhykcs'; + +UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhineidangydlxqznlkpfpjz'; +UPDATE index_group_detail SET WEIGHT = 0.26 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'wanggedifawsl'; +UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'zuzhisanhykcs'; +UPDATE index_group_detail SET WEIGHT = 0.04 WHERE CUSTOMER_ID IN ('7ae84f0ceb36397f5078187d72de3403','04c0d396e298f13e57aa5904a657eaa6','3fdd0380deff5b30f45376cdf995d1c1') AND INDEX_CODE = 'dangyuancanjiashykrc'; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_vanguard.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_vanguard.sql new file mode 100644 index 0000000000..b847790598 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.19__add_vanguard.sql @@ -0,0 +1,77 @@ +CREATE TABLE `fact_party_member_vanguard_agency_daily` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID', + `PID` varchar(64) DEFAULT NULL COMMENT '父级机关ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_COUNT` int(11) DEFAULT '0' COMMENT '党员建组数', + `GROUP_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员建组数占比', + `GROUP_TOTAL` int(11) DEFAULT NULL COMMENT '小组总数', + `GROUP_MEMBER_COUNT` int(11) DEFAULT '0' COMMENT '组内党员人数', + `GROUP_MEMBER_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '组内党员人数占比', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT NULL COMMENT '小组成员总数', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题数', + `TOPIC_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题数占比', + `TOPIC_TOTAL` int(11) DEFAULT NULL COMMENT '话题总数', + `ISSUE_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转议题数', + `ISSUE_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转议题数占比', + `ISSUE_TOTAL` int(11) DEFAULT NULL COMMENT '议题总数', + `PROJECT_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目数', + `PROJECT_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目数占比', + `PROJECT_TOTAL` int(11) DEFAULT NULL COMMENT '项目总数', + `PROJECT_CLOSED_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目结案数', + `PROJECT_CLOSED_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目结案数占比', + `PROJECT_CLOSED_TOTAL` int(11) DEFAULT NULL COMMENT '结案项目总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='党员先锋-机关日统计数据'; + +CREATE TABLE `fact_party_member_vanguard_grid_daily` +( + `ID` varchar(64) NOT NULL COMMENT '唯一标识', + `CUSTOMER_ID` varchar(32) NOT NULL COMMENT '客户ID', + `AGENCY_ID` varchar(64) NOT NULL COMMENT '机构ID', + `GRID_ID` varchar(64) NOT NULL COMMENT '网格ID', + `DATE_ID` varchar(32) NOT NULL COMMENT '统计日期 关联日期dim表', + `WEEK_ID` varchar(32) NOT NULL COMMENT '周ID', + `MONTH_ID` varchar(32) NOT NULL COMMENT '月ID', + `QUARTER_ID` varchar(32) NOT NULL COMMENT '季ID', + `YEAR_ID` varchar(32) NOT NULL COMMENT '年ID', + `GROUP_COUNT` int(11) DEFAULT '0' COMMENT '党员建组数', + `GROUP_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员建组数占比', + `GROUP_TOTAL` int(11) DEFAULT NULL COMMENT '小组成员总数', + `GROUP_MEMBER_COUNT` int(11) DEFAULT '0' COMMENT '组内党员人数', + `GROUP_MEMBER_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '组内党员人数占比', + `GROUP_MEMBER_TOTAL` int(11) DEFAULT NULL COMMENT '小组成员总数', + `TOPIC_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题数', + `TOPIC_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题数占比', + `TOPIC_TOTAL` int(11) DEFAULT NULL COMMENT '话题总数', + `ISSUE_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转议题数', + `ISSUE_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转议题数占比', + `ISSUE_TOTAL` int(11) DEFAULT NULL COMMENT '议题总数', + `PROJECT_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目数', + `PROJECT_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目数占比', + `PROJECT_TOTAL` int(11) DEFAULT NULL COMMENT '项目总数', + `PROJECT_CLOSED_COUNT` int(11) DEFAULT '0' COMMENT '党员发布话题转项目结案数', + `PROJECT_CLOSED_RATIO` decimal(11, 6) DEFAULT '0.000000' COMMENT '党员发布话题转项目结案数占比', + `PROJECT_CLOSED_TOTAL` int(11) DEFAULT NULL COMMENT '结案项目总数', + `DEL_FLAG` char(1) NOT NULL DEFAULT '0' COMMENT '删除标识 未删除:0,已删除:1', + `REVISION` int(11) NOT NULL DEFAULT '0' COMMENT '乐观锁', + `CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', + `CREATED_TIME` datetime NOT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', + `UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) +) ENGINE = InnoDB + DEFAULT CHARSET = utf8mb4 COMMENT ='党员先锋-网格日统计数据'; \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml new file mode 100644 index 0000000000..e8d12dd708 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactAgencyGovernDailyDao.xml @@ -0,0 +1,13 @@ + + + + + + + + delete from fact_agency_govern_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + limit #{deleteSize} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml new file mode 100644 index 0000000000..3a13103f14 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGridGovernDailyDao.xml @@ -0,0 +1,16 @@ + + + + + + + DELETE + FROM + fact_grid_govern_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + LIMIT #{limit} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml new file mode 100644 index 0000000000..91897851f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActDailyDao.xml @@ -0,0 +1,15 @@ + + + + + + + delete from fact_group_act_daily + where CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + and org_type=#{orgType} + limit #{limit} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml new file mode 100644 index 0000000000..085c49ab2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactGroupActMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml index db5dc8b583..21df7f9a68 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginGroupMainDailyDao.xml @@ -139,6 +139,7 @@ id, customer_id, group_state, + group_type, grid_id, agency_id, parent_id, @@ -165,6 +166,7 @@ #{item.id}, #{item.customerId}, #{item.groupState}, + #{item.groupType}, #{item.gridId}, #{item.agencyId}, #{item.parentId}, @@ -338,4 +340,44 @@ AND f.GROUP_STATE = 'approved' GROUP BY f.AGENCY_ID + + + + + 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 46039b48a9..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 @@ -166,4 +166,29 @@ AND ca.CUSTOMER_ID = #{customerId} and ca.pids like CONCAT(#{agencyId},'%') - \ 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 879dc9904a..166917e5d7 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 @@ -281,4 +281,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 5aeb7fe9bb..02ea36cfaf 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 @@ -434,6 +434,9 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl