diff --git a/epmet-admin/epmet-admin-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-admin/epmet-admin-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-auth/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-auth/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-auth/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} 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 49681043e0..29a7dcda6b 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 @@ -145,4 +145,19 @@ public interface Constant { String DISTRICT = "district"; String STREET = "street"; String COMMUNITY = "community"; + + //footbar参数值含义:flat:水平模式;float:浮起某个菜单 + String FOOT_BAR_FLOAT="float"; + //footbar参数值含义:flat:水平模式;float:浮起某个菜单 + String FOOT_BAR_FLAT="flat"; + + /** + * resi_footbar_pattern + * gov_footbar_pattern + * 后缀 + */ + String FOOTBAR_PATTERN_KEY_SUFFIX="_footbar_pattern"; + // resi_footbar_highlight_num + // gov_footbar_highlight_num + String FOOTBAR_HIGHLIGHT_NUM="_footbar_highlight_num"; } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java deleted file mode 100644 index d56cd7615a..0000000000 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/KongCunCustomerEnvEnum.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.epmet.commons.tools.enums; - -import com.epmet.commons.tools.utils.SpringContextUtils; -import org.springframework.core.env.Environment; - -/** - * 系统环境变量枚举类 - * dev|test|prod - * - * @author jianjun liu - * @date 2020-07-03 11:14 - **/ -public enum KongCunCustomerEnvEnum { - /** - * 环境变量枚举 - */ - DEV("dev", "开发环境", "613cc61a6b8ce4c70d21bd413dac72cc"), - TEST("test", "体验环境", "b272625617e53620b2b3cbc65d1ecbbb"), - PROD("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80"), - UN_KNOWN("prod", "生产环境", "6f203e30de1a65aab7e69c058826cd80") - ; - - private String code; - private String name; - private String customerId; - - - - KongCunCustomerEnvEnum(String code, String name, String customerId) { - this.code = code; - this.name = name; - this.customerId = customerId; - } - - public static KongCunCustomerEnvEnum getEnum(String code) { - KongCunCustomerEnvEnum[] values = KongCunCustomerEnvEnum.values(); - for (KongCunCustomerEnvEnum value : values) { - if (value.getCode().equals(code)) { - return value; - } - } - return KongCunCustomerEnvEnum.UN_KNOWN; - } - - public static KongCunCustomerEnvEnum getCurrentEnv(){ - try { - Environment environment = SpringContextUtils.getBean(Environment.class); - String[] activeProfiles = environment.getActiveProfiles(); - if (activeProfiles.length > 0) { - return getEnum(activeProfiles[0]); - } - } catch (Exception e) { - e.printStackTrace(); - } - return KongCunCustomerEnvEnum.UN_KNOWN; - } - - - public String getCode() { - return code; - } - - public String getName() { - return name; - } - - public String getCustomerId(){ - return customerId; - } -} 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 index 3462ad772b..97087745d0 100644 --- 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 @@ -1,7 +1,9 @@ package com.epmet.commons.tools.enums; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; +import org.apache.commons.lang3.StringUtils; /** * 组织级别枚举类 @@ -42,6 +44,37 @@ public enum OrgLevelEnum { throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode()); } + /** + * desc: 获取下一等级的组织级别 + * + * @param parentAgencyLevel + * @return java.lang.String + * @author LiuJanJun + * @date 2021/8/5 1:57 下午 + * todo 加上数字 根据数据返回 + */ + public static String getSubOrgLevel(String parentAgencyLevel) { + String level = StrConstant.EPMETY_STR; + if (StringUtils.isBlank(parentAgencyLevel)) { + return level; + } + OrgLevelEnum anEnum = OrgLevelEnum.getEnum(parentAgencyLevel); + switch (anEnum){ + case PROVINCE: + return OrgLevelEnum.CITY.getCode(); + case CITY: + return OrgLevelEnum.DISTRICT.getCode(); + case DISTRICT: + return OrgLevelEnum.STREET.getCode(); + case STREET: + return OrgLevelEnum.COMMUNITY.getCode(); + case COMMUNITY: + return OrgLevelEnum.GRID.getCode(); + default: + return level; + } + } + 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 c2988b67f9..faaf5f2c3a 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 @@ -425,6 +425,23 @@ public class DateUtils { return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); } + /** + * @return java.lang.String + * @param beforDay + * @author yinzuomei + * @description 获取当前日期的前n天 返回yyyyMMdd + * @Date 2020/6/23 1:50 + **/ + public static String getBeforeNDay(String dateId,int beforDay){ + Calendar c = Calendar.getInstance(); + if (StringUtils.isNotBlank(dateId)){ + c.setTime(DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD)); + } + c.add(Calendar.DATE, - beforDay); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); + } + public static String getBeforeNDay(int beforDay,String format){ Calendar c = Calendar.getInstance(); c.add(Calendar.DATE, - beforDay); @@ -664,15 +681,6 @@ public class DateUtils { return result; } - public static void main(String[] args) { - Date today=new Date(); - Date yesterDay=DateUtils.parse("2020-07-28 15:33:00","yyyy-MM-dd HH:mm:ss"); - Date tomorrow=DateUtils.parse("2020-07-30 15:33:00","yyyy-MM-dd HH:mm:ss"); - System.out.println(comparteDate(today,today)); - System.out.println(comparteDate(yesterDay,today)); - System.out.println(comparteDate(tomorrow,today)); - } - public static String getYearId(String monthId) { if (StringUtils.isNotBlank(monthId) && monthId.length() > 4) { return monthId.substring(NumConstant.ZERO, NumConstant.FOUR); @@ -874,4 +882,117 @@ public class DateUtils { return DateUtils.format(date,dateType); } + /** + * 获取指定日期的 所在周的第一天和和最后一天 + * @param dataStr + * @return + * @throws ParseException + */ + public static String getLastOfWeek(String dataStr) throws ParseException { + Calendar cal = Calendar.getInstance(); + if (StringUtils.isNotBlank(dataStr)){ + cal.setTime(new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).parse(dataStr)); + } + + int d = 0; + if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) { + d = -6; + } else { + d = 2 - cal.get(Calendar.DAY_OF_WEEK); + } + cal.add(Calendar.DAY_OF_WEEK, d); + // 所在周开始日期 + String data1 = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(cal.getTime()); + cal.add(Calendar.DAY_OF_WEEK, 6); + // 所在周结束日期 + String data2 = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(cal.getTime()); + return data1 + "-" + data2; + + } + + /** + * 获取指定日期的 所在周的第一天和和最后一天 + * @param dataStr + * @return + * @throws ParseException + */ + public static String getFirstOfWeek(String dataStr) throws ParseException { + Calendar cal = Calendar.getInstance(); + if (StringUtils.isNotBlank(dataStr)){ + cal.setTime(new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).parse(dataStr)); + } + + int d = 0; + if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) { + d = -6; + } else { + d = 2 - cal.get(Calendar.DAY_OF_WEEK); + } + cal.add(Calendar.DAY_OF_WEEK, d); + // 所在周开始日期 + String data1 = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(cal.getTime()); + cal.add(Calendar.DAY_OF_WEEK, 6); + // 所在周结束日期 + String data2 = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(cal.getTime()); + return data1 + "-" + data2; + + } + + + /** + * 获取本周的第一天 + * @return String + * **/ + public static String getWeekStart(String dateId){ + Calendar cal=Calendar.getInstance(); + if (StringUtils.isNotBlank(dateId)){ + cal.setTime(DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD)); + } + int d = 0; + if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) { + d = -6; + } else { + d = 2 - cal.get(Calendar.DAY_OF_WEEK); + } + cal.add(Calendar.DAY_OF_WEEK, d); + Date time=cal.getTime(); + return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(time); + } + /** + * 获取本周的最后一天 + * @return String + * **/ + public static String getWeekEnd(String dateId){ + Calendar cal=Calendar.getInstance(); + if (StringUtils.isNotBlank(dateId)){ + cal.setTime(DateUtils.parseDate(dateId,DateUtils.DATE_PATTERN_YYYYMMDD)); + } + int d = 0; + if (cal.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) { + d = -6; + } else { + d = 2 - cal.get(Calendar.DAY_OF_WEEK); + } + cal.add(Calendar.DAY_OF_WEEK, d); + cal.add(Calendar.DAY_OF_WEEK, 6); + Date time=cal.getTime(); + return new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD).format(time); + } + + + public static void main(String[] args) throws ParseException { + String first = DateUtils.getFirstOfWeek("20210801"); + System.out.println(first); + String fLastOfWeek = DateUtils.getLastOfWeek("20210801"); + System.out.println(fLastOfWeek); + + System.out.println(DateUtils.getWeekStart("20210801")); + System.out.println(DateUtils.getWeekEnd("20210801")); + + Date dateIdDate = DateUtils.parse("20210801", DateUtils.DATE_PATTERN_YYYYMMDD); + String format = DateUtils.format(DateUtils.getMonthStart(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); + System.out.println(format); + format = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); + System.out.println(format); + } } diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java new file mode 100644 index 0000000000..2f70659219 --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeAreaCodeNode.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2018 人人开源 All rights reserved. + * + * https://www.renren.io + * + * 版权所有,侵权必究! + */ + +package com.epmet.commons.tools.utils; + +import lombok.Data; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.List; + +/** + * 树节点,所有需要实现树节点的,都需要继承该类 + * + * @author Mark sunlightcs@gmail.com + * @since 1.0.0 + */ +@Data +public class TreeAreaCodeNode extends TreeStringNode implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键 + */ + private String areaCode; + /** + * 上级ID + */ + private String parentAreaCode; + /** + * 子节点列表 + */ + private List children = new ArrayList<>(); +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java index 4272d9cfc6..c321fea717 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/TreeUtils.java @@ -131,4 +131,32 @@ public class TreeUtils { return result; } + /** + * 构建树节点 + */ + public static List buildTreeByAreaCode(List treeNodes) { + List result = new ArrayList<>(); + + //list转map + Map nodeMap = new LinkedHashMap<>(treeNodes.size()); + for(T treeNode : treeNodes){ + nodeMap.put(treeNode.getAreaCode(), treeNode); + } + + for(T node : nodeMap.values()) { + T parent = nodeMap.get(node.getParentAreaCode()); + if(parent != null && !(node.getAreaCode().equals(parent.getAreaCode()))){ + if (parent.getChildren() == null){ + parent.setChildren(new ArrayList()); + } + parent.getChildren().add(node); + continue; + } + + result.add(node); + } + + return result; + } + } 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 ce186bfffc..d9eea40501 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 @@ -30,4 +30,6 @@ public interface DataSourceConstant { String DATA_STATISTICAL="datastatistical"; String EVALUATION_INDEX = "evaluationIndex"; + + String OPERCUSTOMIZE="opercustomize"; } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/form/AppFootBarFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/form/AppFootBarFormDTO.java new file mode 100644 index 0000000000..922b136d2d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/form/AppFootBarFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dataaggre.dto.app.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询底部footBar信息(两端通用) + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 18:54 + */ +@Data +public class AppFootBarFormDTO implements Serializable { + public interface AddUserInternalGroup {} + /** + * 产品配置:default; 客户定制化里面就传客户id + */ + @NotBlank(message = "customerId不能为空",groups = AddUserInternalGroup.class) + private String customerId; + /** + * 工作端:gov;居民端resi + */ + @NotBlank(message = "appType不能为空",groups = AddUserInternalGroup.class) + private String appType; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/result/AppFootBarResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/result/AppFootBarResultDTO.java new file mode 100644 index 0000000000..15085b7634 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/result/AppFootBarResultDTO.java @@ -0,0 +1,39 @@ +package com.epmet.dataaggre.dto.app.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 查询底部footBar信息(两端通用) + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 19:00 + */ +@Data +public class AppFootBarResultDTO implements Serializable { + private static final long serialVersionUID = -2219461245919203814L; + + /** + * 水平:flat;浮起:float + */ + private String pattern; + /** + * 默认返回0,如果是浮起模式且是奇数,返回是footBarList的索引 + */ + private Integer highLightNum; + + + private List footBarList; + + /** + * 是否是奇数,true:是奇数 + */ + private Boolean isOddNum; + + /** + * 是否都上传了图标,true:都上传了 + */ + // private Boolean bothUploaded; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/result/CustomerFootBarDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/result/CustomerFootBarDTO.java new file mode 100644 index 0000000000..b324bb755e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/app/result/CustomerFootBarDTO.java @@ -0,0 +1,49 @@ +package com.epmet.dataaggre.dto.app.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询底部footBar信息(两端通用) + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 19:01 + */ +@Data +public class CustomerFootBarDTO implements Serializable { + /** + * KEY + */ + private String barKey; + + /** + * bar名称 + */ + private String barName; + + /** + * 页面标题 + */ + private String pageTitle; + + /** + * 图标路径 + */ + private String iconPath; + + /** + * 选中页面图标路径 + */ + private String selectedIconPath; + + /** + * 凸起时图标路径 + */ + private String floatIconPath; + + /** + * 客户id + */ + private String customerId; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/BaseDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/BaseDataFormDTO.java new file mode 100644 index 0000000000..1eae69043b --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/BaseDataFormDTO.java @@ -0,0 +1,34 @@ +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 BaseDataFormDTO implements Serializable { + + private static final long serialVersionUID = 6766797386944333123L; + /** + * 组织Id + */ + @NotBlank(message = "组织ID不能为空",groups = {BaseDataFormDTO.BaseData.class, AgencyIdAndLevel.class}) + private String agencyId; + @NotBlank(message = "组织级别不能为空",groups = AgencyIdAndLevel.class) + private String agencyLevel; + private String type; + /** + * 日维度Id + */ + private String dateId; + private String startDateId; + private String endDateId; + public interface BaseData extends CustomerClientShowGroup{} + public interface AgencyIdAndLevel extends CustomerClientShowGroup{} + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubTopicAndGroupFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubTopicAndGroupFormDTO.java new file mode 100644 index 0000000000..7a64b567d7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubTopicAndGroupFormDTO.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 SubTopicAndGroupFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 当前组织id;从组织树取 + */ + @NotBlank(message = "组织ID不能为空", groups = SubTopicAndGroupFormDTO.Agency.class) + private String agencyId; + /** + * 当前组织级别;从组织树取 + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + @NotBlank(message = "组织级别不能为空", groups = SubTopicAndGroupFormDTO.Agency.class) + private String agencyLevel; + /** + * 日维度Id【yyyyMMdd eg:20210808,默认前一天】 + */ + 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/SubUserTotalFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubUserTotalFormDTO.java new file mode 100644 index 0000000000..f97af0583e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubUserTotalFormDTO.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 SubUserTotalFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + /** + * 当前组织id;从组织树取 + */ + @NotBlank(message = "组织ID不能为空", groups = SubUserTotalFormDTO.Agency.class) + private String agencyId; + /** + * 当前组织级别;从组织树取 + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + @NotBlank(message = "组织级别不能为空", groups = SubUserTotalFormDTO.Agency.class) + private String agencyLevel; + /** + * 日维度Id【yyyyMMdd eg:20210808,默认前一天】 + */ + 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/result/BaseStatsDataResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/BaseStatsDataResultDTO.java new file mode 100644 index 0000000000..8302d08e49 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/BaseStatsDataResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 基础数据-组织各种数据汇总-接口返参 + * @Auth sun + */ +@Data +public class BaseStatsDataResultDTO implements Serializable { + private static final long serialVersionUID = -771436069527114021L; + + private Integer topicTotal; + private Integer topicIncr; + // private Integer topicToIssueTotal; + private Integer issueTotal; + private Integer issueIncr; + // private Integer issueToProjectTotal; + private Integer projectTotal; + private Integer projectIncr; + private Integer closedProjectTotal; + private Integer closedProjectIncr; +// private Integer patrolTotal; +// private Integer patrolTotalTime; +// private Integer orgId; +// private Integer orgName; + + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubTopicAndGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubTopicAndGroupResultDTO.java new file mode 100644 index 0000000000..0b76a3d2a1 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubTopicAndGroupResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 对外接口-查询下级话题和小组数-接口返参 + * @Auth sun + */ +@Data +public class SubTopicAndGroupResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + //组织或网格ID + private String orgId; + //组织或网格名称 + private String orgName = ""; + //话题总数 + private Integer topicTotal = 0; + //小组总数 + private Integer groupTotal = 0; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubUserTotalResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubUserTotalResultDTO.java new file mode 100644 index 0000000000..2f87e63143 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubUserTotalResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 对外接口-查询下级用户党员数-接口返参 + * @Auth sun + */ +@Data +public class SubUserTotalResultDTO implements Serializable { + private static final long serialVersionUID = 466974582608407121L; + //组织或网格ID + private String orgId; + //组织或网格名称 + private String orgName = ""; + //用户总数 + private Integer userTotal = 0; + //党员总数 + private Integer partyMemberTotal = 0; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/TotalAndIncrResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/TotalAndIncrResultDTO.java new file mode 100644 index 0000000000..02fee2c919 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/TotalAndIncrResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 总数及增量 返回结果 + * @Auth sun + */ +@Data +public class TotalAndIncrResultDTO implements Serializable { + + private static final long serialVersionUID = -6624315950853255235L; + private Integer total; + private Integer incr; + private Integer total2; + private Integer incr2; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/WorkFactResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/WorkFactResultDTO.java new file mode 100644 index 0000000000..9eebe98854 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/WorkFactResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dataaggre.dto.datastats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2021/8/5 4:51 下午 + * @version: 1.0 + */ +@Data +public class WorkFactResultDTO implements Serializable { + private static final long serialVersionUID = -8149310637601355664L; + private Integer topicToIssueTotal = 0; + private Integer issueToProjectTotal = 0; + private Integer closedProjectTotal = 0; + private Integer patrolTotal = 0; + private String patrolTotalTime = "0"; + private String orgId; + private String orgName; + + +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java new file mode 100644 index 0000000000..5400a1247f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/PatrolDailySumResult.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.dto.epmetuser.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2021/8/8 11:01 上午 + * @version: 1.0 + */ +@Data +public class PatrolDailySumResult implements Serializable { + private static final long serialVersionUID = 310405655189243944L; + + private String fullAgencyId; + private Integer patrolTotal; + private Integer totalTime; +} diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java index 3b2c818967..2ad0113f89 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/evaluationindex/ScreenCustomerAgencyDTO.java @@ -23,6 +23,11 @@ public class ScreenCustomerAgencyDTO implements Serializable { */ private String agencyId; + /** + * pids + */ + private String pids; + /** * 组织名称 */ diff --git a/epmet-module/data-aggregator/data-aggregator-server/pom.xml b/epmet-module/data-aggregator/data-aggregator-server/pom.xml index f075b3c427..6c2a9d38c6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/pom.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/pom.xml @@ -171,6 +171,11 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_oper_customize_user + EpmEt-db-UsEr 0 192.168.1.140 @@ -266,6 +271,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_oper_customize_user + EpmEt-db-UsEr + 0 192.168.1.140 @@ -361,6 +372,12 @@ epmet elink@833066 + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -456,6 +473,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_oper_customize_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/AppController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/AppController.java new file mode 100644 index 0000000000..b5606a747e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/AppController.java @@ -0,0 +1,40 @@ +package com.epmet.dataaggre.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; +import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; +import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; +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; + +/** + * 小程序相关配置,可以放在这,目前只放了footbar + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 18:36 + */ +@RestController +@RequestMapping("app") +public class AppController { + @Autowired + private CustomerFootBarService customerFootBarService; + + /** + * 查询底部footBar信息(两端通用) + * + * @param footBarFormDTO + * @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO + * @author yinzuomei + * @date 2021/7/27 18:59 + */ + @PostMapping("footbars") + public Result queryAppFootBars(@RequestBody AppFootBarFormDTO footBarFormDTO){ + ValidatorUtils.validateEntity(footBarFormDTO,AppFootBarFormDTO.AddUserInternalGroup.class); + AppFootBarResultDTO resultDTO=customerFootBarService.queryAppFootBars(footBarFormDTO); + return new Result().ok(resultDTO); + } +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/pub/PubController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/pub/PubController.java new file mode 100644 index 0000000000..2d6b0fa999 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/controller/pub/PubController.java @@ -0,0 +1,118 @@ +package com.epmet.dataaggre.controller.pub; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dataaggre.dto.datastats.form.BaseDataFormDTO; +import com.epmet.dataaggre.dto.datastats.result.BaseStatsDataResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubTopicAndGroupResultDTO; +import com.epmet.dataaggre.dto.datastats.result.SubUserTotalResultDTO; +import com.epmet.dataaggre.dto.datastats.result.WorkFactResultDTO; +import com.epmet.dataaggre.service.datastats.DataStatsService; +import lombok.extern.log4j.Log4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.List; + +/** + * 小程序相关配置,可以放在这,目前只放了footbar + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 18:36 + */ +@Log4j +@RestController +@RequestMapping("pub") +public class PubController { + @Autowired + private DataStatsService dataStatsService; + + /** + * 查询 话题 议题 项目数 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO + * @author yinzuomei + * @date 2021/7/27 18:59 + */ + @PostMapping("baseDataAgg") + public Result getBaseStatsData(@RequestBody BaseDataFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO,BaseDataFormDTO.BaseData.class); + BaseStatsDataResultDTO baseStatsData = dataStatsService.getBaseStatsData(formDTO); + return new Result().ok(baseStatsData); + } + + /** + * 查询下级工作实况 + * + * @param formDTO + * @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO + * @author yinzuomei + * @date 2021/7/27 18:59 + */ + @PostMapping("subWorkFact") + public Result> getSubWorkFact(@RequestBody BaseDataFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, BaseDataFormDTO.AgencyIdAndLevel.class); + List subWorkFact = dataStatsService.getSubWorkFact(formDTO); + return new Result>().ok(subWorkFact); + } + + /** + * @Param formDTO + * @Description 对外接口--查询下级用户党员数 + * @author sun + */ + @PostMapping("subUserTotal") + public Result> subUserTotal(@RequestBody BaseDataFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, BaseDataFormDTO.AgencyIdAndLevel.class); + List data = dataStatsService.subUserTotal(formDTO); + return new Result>().ok(data); + } + + /** + * @Param formDTO + * @Description 对外接口--查询下级话题和小组数 + * @author sun + */ + @PostMapping("subTopicAndGroup") + public Result> subTopicAndGroup(@RequestBody BaseDataFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, BaseDataFormDTO.AgencyIdAndLevel.class); + List data = dataStatsService.subTopicAndGroup(formDTO); + return new Result>().ok(data); + } + + /** + * 导出数据,使用map接收 + * + * @param map + * @param response + * @throws IOException + */ + @PostMapping("/exportExcel") + public void exportExcel(@RequestBody BaseDataFormDTO formDTO, HttpServletResponse response) throws IOException { + /* try { + Map mapData = new HashMap<>(); + BaseStatsDataResultDTO baseStatsData = dataStatsService.getBaseStatsData(formDTO); + String templatePath = "excel/trace_temp.xlsx"; + log.info("exportExcel templatePath:{}",templatePath); + mapData.put("dataType", baseStatsData); + + start = System.currentTimeMillis(); + Workbook workbook = ExcelExportUtil.exportExcel(new TemplateExportParams(templatePath, "数据汇总"), baseStatsData); + //header + response.setHeader("content-Type", "application/vnd.ms-excel"); + response.addHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("继续追踪导出详情-".concat(DateUtils.formatDate()) + ".xlsx", "UTF-8")); + //加密 + log.error("excelExport build wb cost:{}",System.currentTimeMillis()-start); + } catch (UnsupportedEncodingException e) { + e.printStackTrace(); + }*/ + + } + +} 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 index d157058b2e..46f7e64cb6 100644 --- 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 @@ -33,7 +33,7 @@ import java.util.List; /** * @Author sun - * @Description 数据统计服务 + * @Description 数据统计服务 */ @Mapper public interface DataStatsDao { @@ -178,50 +178,54 @@ public interface DataStatsDao { /** * 查询组织党员先锋详情 - * @author zhaoqifeng - * @date 2021/5/18 14:40 + * * @param agencyId * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + * @author zhaoqifeng + * @date 2021/5/18 14:40 */ PartyMemberVanguardDetailResultDTO selectAgencyVanguardDetail(@Param("agencyId") String agencyId); /** * 查询网格党员先锋详情 - * @author zhaoqifeng - * @date 2021/5/18 14:40 + * * @param grid * @return com.epmet.dataaggre.dto.datastats.result.PartyMemberVanguardDetailResultDTO + * @author zhaoqifeng + * @date 2021/5/18 14:40 */ PartyMemberVanguardDetailResultDTO selectGridVanguardDetail(@Param("grid") String grid); /** * 查询组织党员先锋排行 - * @author zhaoqifeng - * @date 2021/5/18 15:02 + * * @param agencyId * @return java.util.List + * @author zhaoqifeng + * @date 2021/5/18 15:02 */ List selectAgencyVanguardRank(@Param("agencyId") String agencyId); /** * 查询网格党员先锋排行 - * @author zhaoqifeng - * @date 2021/5/18 15:03 + * * @param agencyId * @return java.util.List + * @author zhaoqifeng + * @date 2021/5/18 15:03 */ 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 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 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, @@ -246,11 +250,35 @@ public interface DataStatsDao { /** * 根据组织Id查询事件治理指数 - * @author zhaoqifeng - * @date 2021/6/25 15:08 + * * @param agencyIds * @param dateId * @return com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity + * @author zhaoqifeng + * @date 2021/6/25 15:08 */ List getAgencyGovernDaily(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); -} \ No newline at end of file + + /** + * desc: 根据组织Id和时间获取 话题总数及增量 + * + * @param agencyList + * @param dateId + * @return com.epmet.dataaggre.dto.datastats.result.TotalAndIncrResultDTO + * @author LiuJanJun + * @date 2021/8/5 3:59 下午 + */ + TotalAndIncrResultDTO getAgencySumTopic(@Param("agencyList") List agencyList, @Param("dateId") String dateId); + + TotalAndIncrResultDTO getAgencySumIssue(@Param("agencyList") List agencyList, @Param("dateId") String dateId); + + TotalAndIncrResultDTO getAgencySumProject(@Param("agencyList") List agencyList, @Param("dateId") String dateId); + + /** + * 获取话题相关总数 + * @param agencyList + * @param dateId + * @return + */ + List getSubSumAgencyTopic(@Param("agencyList") List agencyList, @Param("dateId") String dateId); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java new file mode 100644 index 0000000000..c7e68c410e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/epmetuser/StatsStaffPatrolRecordDailyDao.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dataaggre.dao.epmetuser; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; +import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; +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-06-07 + */ +@Mapper +public interface StatsStaffPatrolRecordDailyDao extends BaseDao { + + /** + * desc:获取巡查次数和时间 + * @param agencyFullIdList + * @param startDateId + * @param endDateId + * @return + */ + List getPatrolSumList(@Param("agencyFullIdList") List agencyFullIdList, @Param("startDateId") String startDateId, @Param("endDateId") String endDateId); +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerParameterDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerParameterDao.java new file mode 100644 index 0000000000..c18293dfce --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerParameterDao.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.dataaggre.dao.opercrm; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 客户配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-07-27 + */ +@Mapper +public interface CustomerParameterDao extends BaseDao { + /** + * 根据参数key查询 + * + * @param parameterKey + * @param customerId + * @return java.lang.String + * @author yinzuomei + * @date 2021/7/27 17:07 + */ + CustomerParameterEntity selectByParameterKey(@Param("parameterKey")String parameterKey, @Param("customerId")String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.java new file mode 100644 index 0000000000..7d5d11dda7 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercustomize/CustomerFootBarDao.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.dao.opercustomize; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; +import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-07-27 + */ +@Mapper +public interface CustomerFootBarDao extends BaseDao { + + /** + * 查询客户工作端或者居民端,footbar列表 + * + * @param customerId + * @param appType + * @return java.util.List + * @author yinzuomei + * @date 2021/7/28 10:56 + */ + List selectAppFootBars(@Param("customerId") String customerId, @Param("appType") String appType); + + /** + * 查询某个footbar信息 + * + * @param customerId + * @param appType + * @param barKey + * @return com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity + * @author yinzuomei + * @date 2021/7/28 10:56 + */ + CustomerFootBarEntity selectDefaultIcon(@Param("customerId") String customerId, @Param("appType")String appType, @Param("barKey")String barKey); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StatsStaffPatrolRecordDailyEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StatsStaffPatrolRecordDailyEntity.java new file mode 100644 index 0000000000..1c52ad1336 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/epmetuser/StatsStaffPatrolRecordDailyEntity.java @@ -0,0 +1,125 @@ +/** + * 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.epmetuser; + +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-06-29 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("stats_staff_patrol_record_daily") +public class StatsStaffPatrolRecordDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 来源类型 external:外部,internal:内部 + */ + private String sourceType; + + /** + * 客户Id + */ + private String customerId; + + /** + * 数据来源客户Id + */ + private String sourceCustomerId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格id + */ + private String gridId; + + /** + * 工作人员所属组织id=网格所属的组织id + */ + private String agencyId; + + /** + * 网格所有上级id + */ + private String gridPids; + + /** + * 工作人员用户id + */ + private String staffId; + + /** + * 巡查次数 + */ + private Integer patrolTotal; + + /** + * 巡查时长 单位:秒 + */ + private Integer totalTime; + + /** + * 巡查期间直接立项项目数 + */ + private Integer reportProjectCount; + + /** + * 最新的巡查开始时间 + */ + private Date latestPatrolTime; + + /** + * 最新的巡查状态 正在巡查中:patrolling;结束:end + */ + private String latestPatrolStatus; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/opercrm/CustomerParameterEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/opercrm/CustomerParameterEntity.java new file mode 100644 index 0000000000..3ab50da4eb --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/opercrm/CustomerParameterEntity.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.dataaggre.entity.opercrm; + +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-07-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_parameter") +public class CustomerParameterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 参数KEY值(发短信:send_msg;) + */ + private String parameterKey; + + /** + * 参数名称(短信) + */ + private String parameterName; + + /** + * 参数开关:开启:on,关闭:off + */ + private String parameterSwitch; + + /** + * 参数VALUE值 + */ + private String parameterValue; + + /** + * 说明 + */ + private String description; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/opercustomize/CustomerFootBarEntity.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/opercustomize/CustomerFootBarEntity.java new file mode 100644 index 0000000000..ba743511e9 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/entity/opercustomize/CustomerFootBarEntity.java @@ -0,0 +1,88 @@ +/** + * 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.opercustomize; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-07-27 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_foot_bar") +public class CustomerFootBarEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 工作端:gov居民端:resi + */ + private String appType; + + /** + * KEY + */ + private String barKey; + + /** + * bar名称 + */ + private String barName; + + /** + * 页面标题 + */ + private String pageTitle; + + /** + * 图标路径 + */ + private String iconPath; + + /** + * 选中页面图标路径 + */ + private String selectedIconPath; + + /** + * 凸起时图标路径 + */ + private String floatIconPath; + + /** + * 是否显示。1:显示,0:隐藏 + */ + private Integer display; + + /** + * 排序 + */ + private Integer orderIndex; + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/healthcheck/HealthCheckController.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..2b8768891f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.dataaggre.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} 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 index 36ec2943db..9db20ef41c 100644 --- 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 @@ -7,7 +7,6 @@ import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; import com.epmet.dataaggre.dto.resigroup.ActCategoryDictDTO; import com.epmet.dataaggre.dto.resigroup.result.GroupActRankDetailDTO; -import java.security.PrivateKey; import java.util.List; /** @@ -182,4 +181,34 @@ public interface DataStatsService { * @date 2021.07.05 16:05 */ GridMemberDataAnalysisResultDTO getGridMemberIssueProjectStats(String staffId); + + /** + * desc:获取话题 议题 项目 关闭项目数 + * @param formDTO + * @return + */ + BaseStatsDataResultDTO getBaseStatsData(BaseDataFormDTO formDTO); + + /** + * 获取工作实况中的数 + * @param formDTO + * @return + */ + List getSubWorkFact(BaseDataFormDTO formDTO); + + /** + * @Param formDTO + * @Description 对外接口--查询下级用户党员数 + * @author sun + * @param formDTO + */ + List subUserTotal(BaseDataFormDTO formDTO); + + /** + * @Param formDTO + * @Description 对外接口--查询下级话题和小组数 + * @author sun + * @param formDTO + */ + List subTopicAndGroup(BaseDataFormDTO 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 index bfa9a29710..ac853e29e7 100644 --- 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 @@ -1,8 +1,9 @@ package com.epmet.dataaggre.service.datastats.impl; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.epmet.commons.dynamic.datasource.annotation.DataSource; + import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; + import com.epmet.commons.tools.constant.StrConstant; + import com.epmet.commons.tools.enums.OrgLevelEnum; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.constant.OrgConstant; @@ -11,20 +12,20 @@ import com.epmet.dataaggre.dao.datastats.FactGridMemberStatisticsDailyDao; 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.govorg.result.GridMemberDataAnalysisResultDTO; +import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerGridDTO; import com.epmet.dataaggre.dto.evaluationindex.ScreenGovernRankDataDailyDTO; +import com.epmet.dataaggre.dto.govorg.result.GridMemberDataAnalysisResultDTO; 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.entity.datastats.FactGridMemberStatisticsDailyEntity; import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; +import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; -import com.github.pagehelper.PageHelper; import com.epmet.dataaggre.service.opercrm.CustomerRelation; +import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; @@ -57,6 +58,8 @@ public class DataStatsServiceImpl implements DataStatsService { @Autowired private FactGridMemberStatisticsDailyDao factGridMemberStatisticsDailyDao; + @Autowired + private StatsStaffPatrolRecordDailyService statsStaffPatrolRecordDailyService; /** @@ -1428,6 +1431,199 @@ public class DataStatsServiceImpl implements DataStatsService { public GridMemberDataAnalysisResultDTO getGridMemberIssueProjectStats(String staffId) { return factGridMemberStatisticsDailyDao.getGridMemberIssueProjectStats( staffId); } + + @Override + public BaseStatsDataResultDTO getBaseStatsData(BaseDataFormDTO 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)); + } + BaseStatsDataResultDTO result = new BaseStatsDataResultDTO(); + result.setTopicTotal(0); + result.setTopicIncr(0); + + result.setIssueTotal(0); + result.setIssueIncr(0); + result.setProjectTotal(0); + result.setProjectIncr(0); + result.setClosedProjectTotal(0); + result.setClosedProjectIncr(0); + + + //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 + List agencyList = indexService.getAgencyIdsByAgencyId(formDTO.getAgencyId()); + agencyList.add(formDTO.getAgencyId()); + TotalAndIncrResultDTO sum = dataStatsDao.getAgencySumTopic(agencyList, formDTO.getDateId()); + if (sum == null){ + return result; + } + result.setTopicIncr(sum.getIncr()); + result.setTopicTotal(sum.getTotal()); + + sum = dataStatsDao.getAgencySumIssue(agencyList,formDTO.getDateId()); + result.setIssueIncr(sum.getIncr()); + result.setIssueTotal(sum.getTotal()); + + sum = dataStatsDao.getAgencySumProject(agencyList,formDTO.getDateId()); + result.setProjectIncr(sum.getIncr()); + result.setProjectTotal(sum.getTotal()); + result.setClosedProjectIncr(sum.getIncr2()); + result.setClosedProjectTotal(sum.getTotal2()); + return result; + } + + @Override + public List getSubWorkFact(BaseDataFormDTO formDTO) { + //入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + if (StringUtils.isBlank(formDTO.getType())){ + formDTO.setType("yesterday"); + } + Date yesterday = DateUtils.addDateDays(new Date(), -1); + if (StringUtils.isBlank(formDTO.getDateId())) { + SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); + formDTO.setDateId(format.format(yesterday)); + } + String startDate = null; + String actulStartDate = null; + String endDate = null; + Date dateIdDate = DateUtils.parse(formDTO.getDateId(), DateUtils.DATE_PATTERN_YYYYMMDD); + boolean isYesterday = DateUtils.getBeforeNDay(1,DateUtils.DATE_PATTERN_YYYYMMDD).equals(formDTO.getDateId()); + switch (formDTO.getType()){ + case "yesterday": + startDate = DateUtils.getBeforeNDay(formDTO.getDateId(),1); + endDate = formDTO.getDateId(); + actulStartDate = formDTO.getDateId(); + break; + case "thisWeek": + actulStartDate = DateUtils.getWeekStart(formDTO.getDateId()); + startDate = DateUtils.getBeforeNDay(actulStartDate,1); + DateUtils.format(DateUtils.addDateDays(yesterday, -1),DateUtils.DATE_PATTERN_YYYYMMDD); + if (!isYesterday){ + endDate = DateUtils.getWeekEnd(formDTO.getDateId()); + } + break; + case "thisMonth": + actulStartDate = DateUtils.format(DateUtils.getMonthStart(dateIdDate),DateUtils.DATE_PATTERN_YYYYMMDD); + startDate = DateUtils.getBeforeNDay(actulStartDate,1); + if (!isYesterday) { + endDate = DateUtils.format(DateUtils.getMonthEnd(dateIdDate), DateUtils.DATE_PATTERN_YYYYMMDD); + } + break; + default: + log.warn("==========="); + } + formDTO.setStartDateId(startDate); + formDTO.setEndDateId(endDate); + List result = new ArrayList<>(); + //如果是社区 则下级是网格 查询网格的数据 + if (OrgLevelEnum.COMMUNITY.getCode().equals(formDTO.getAgencyLevel())){ + //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 + List subAgencyList = indexService.getSubGridList(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return null; + } + List gridIdList = subAgencyList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); + //查询组织的话题转议题数据 + List toIssueStart = dataStatsDao.getSubGridTopicShiftIssue(gridIdList, formDTO.getStartDateId()); + List toIssueEnd = dataStatsDao.getSubGridTopicShiftIssue(gridIdList, formDTO.getEndDateId()); + Map toIssueStartMap = toIssueStart.stream().collect(Collectors.toMap(SubGridFormDTO.Topic::getGridId, SubGridFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); + Map toIssueEndMap = toIssueEnd.stream().collect(Collectors.toMap(SubGridFormDTO.Topic::getGridId, SubGridFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); + //查询组织的议题转项目数据 + List toProjectStart = dataStatsDao.getSubGridIssue(gridIdList, formDTO.getStartDateId()); + List toProjectEnd = dataStatsDao.getSubGridIssue(gridIdList, formDTO.getEndDateId()); + Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubGridIssueResultDTO::getGridId, SubGridIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); + Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubGridIssueResultDTO::getGridId, SubGridIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); + //查询组织已关闭的项目数据 + List closeProjectStart = dataStatsDao.getSubGridProject(gridIdList, formDTO.getStartDateId()); + List closeProjectEnd = dataStatsDao.getSubGridProject(gridIdList, formDTO.getEndDateId()); + Map closeProjectStartMap = closeProjectStart.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubGridProjectResultDTO::getGridId, SubGridProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + //巡查次数和时间 + List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(gridIdList,actulStartDate,formDTO.getEndDateId()); + Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1)); + + subAgencyList.forEach(agency->{ + String gridId = agency.getGridId(); + WorkFactResultDTO resultDTO = new WorkFactResultDTO(); + resultDTO.setOrgId(gridId); + resultDTO.setOrgName(agency.getGridName()); + resultDTO.setTopicToIssueTotal(getTotal(toIssueStartMap,toIssueEndMap,gridId)); + resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,gridId)); + resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,gridId)); + + PatrolDailySumResult patrolRecordDTO = patrolListMap.get(agency.getAllParentIds()); + setPatrolAttr(resultDTO, patrolRecordDTO); + result.add(resultDTO); + }); + }else { + //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return null; + } + + List agencyList = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); + //查询组织的话题转议题数据 + List toIssueStart = dataStatsDao.getSubAgencyTopicShiftIssue(agencyList, formDTO.getStartDateId()); + List toIssueEnd = dataStatsDao.getSubAgencyTopicShiftIssue(agencyList, formDTO.getEndDateId()); + Map toIssueStartMap = toIssueStart.stream().collect(Collectors.toMap(SubAgencyFormDTO.Topic::getAgencyId, SubAgencyFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); + Map toIssueEndMap = toIssueEnd.stream().collect(Collectors.toMap(SubAgencyFormDTO.Topic::getAgencyId, SubAgencyFormDTO.Topic::getShiftedIssueTotal, (o1, o2) -> o1)); + //查询组织的议题转项目数据 + List toProjectStart = dataStatsDao.getSubAgencyIssue(agencyList, formDTO.getStartDateId()); + List toProjectEnd = dataStatsDao.getSubAgencyIssue(agencyList, formDTO.getEndDateId()); + Map toProjectStartMap = toProjectStart.stream().collect(Collectors.toMap(SubAgencyIssueResultDTO::getAgencyId, SubAgencyIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); + Map toProjectEndMap = toProjectEnd.stream().collect(Collectors.toMap(SubAgencyIssueResultDTO::getAgencyId, SubAgencyIssueResultDTO::getShiftProjectTotal, (o1, o2) -> o1)); + //查询组织已关闭的项目数据 + List closeProjectStart = dataStatsDao.getSubAgencyProject(agencyList, formDTO.getStartDateId()); + List closeProjectEnd = dataStatsDao.getSubAgencyProject(agencyList, formDTO.getEndDateId()); + Map closeProjectStartMap = closeProjectStart.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + Map closeProjectEndMap = closeProjectEnd.stream().collect(Collectors.toMap(SubAgencyProjectResultDTO::getAgencyId, SubAgencyProjectResultDTO::getClosedProjectTotal, (o1, o2) -> o1)); + //巡查次数和时间 + List agencyFullIds = subAgencyList.stream().map(o -> o.getPids().concat(StrConstant.COLON).concat(o.getAgencyId())).collect(Collectors.toList()); + List patrolList = statsStaffPatrolRecordDailyService.getPatrolSumList(agencyFullIds,actulStartDate,formDTO.getEndDateId()); + Map patrolListMap = patrolList.stream().collect(Collectors.toMap(PatrolDailySumResult::getFullAgencyId, o -> o, (o1, o2) -> o1)); + + subAgencyList.forEach(agency->{ + String agencyId = agency.getAgencyId(); + WorkFactResultDTO resultDTO = new WorkFactResultDTO(); + resultDTO.setOrgId(agencyId); + resultDTO.setOrgName(agency.getAgencyName()); + resultDTO.setTopicToIssueTotal(getTotal(toIssueStartMap,toIssueEndMap,agencyId)); + resultDTO.setIssueToProjectTotal(getTotal(toProjectStartMap,toProjectEndMap,agencyId)); + resultDTO.setClosedProjectTotal(getTotal(closeProjectStartMap,closeProjectEndMap,agencyId)); + String fullAgencyId = agency.getPids().concat(StrConstant.COLON).concat(agencyId); + PatrolDailySumResult patrolRecordDTO = patrolListMap.get(fullAgencyId); + setPatrolAttr(resultDTO,patrolRecordDTO); + result.add(resultDTO); + }); + } + + List newResult = result.stream().sorted(Comparator.comparing(o -> o.getTopicToIssueTotal() + o.getIssueToProjectTotal() + o.getClosedProjectTotal() + o.getPatrolTotal())).collect(Collectors.toList()); + return newResult; + } + + private void setPatrolAttr(WorkFactResultDTO resultDTO, PatrolDailySumResult patrolRecordDTO) { + if (patrolRecordDTO != null){ + resultDTO.setPatrolTotal(patrolRecordDTO.getPatrolTotal()); + Integer totalTime = patrolRecordDTO.getTotalTime(); + if (totalTime != null || totalTime > 0){ + int minutes = totalTime / 60; + if (minutes >0){ + String totalTimeDesc = minutes / 60 + "小时"+ minutes % 60 + "分"; + resultDTO.setPatrolTotalTime(totalTimeDesc); + } + } + } + } + + private Integer getTotal(Map startMap, Map endMap,String agencyId){ + Integer total1 = startMap.getOrDefault(agencyId,NumConstant.ZERO); + Integer total2 = endMap.getOrDefault(agencyId,NumConstant.ZERO); + return Math.max(total2-total1,0); + } + private String getPercentage(Integer countInt, Integer totalInt) { if (NumConstant.ZERO == totalInt) { return "0%"; @@ -1439,4 +1635,172 @@ public class DataStatsServiceImpl implements DataStatsService { return ratio.toString().concat("%"); } + /** + * @Param formDTO + * @Description 对外接口--查询下级用户党员数 + * @author sun + * @param formDTO + */ + @Override + public List subUserTotal(BaseDataFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1.入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + 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)); + } + + //根据组织级别判断查询直属下级组织或网格数据 + //2.直属网格 + if ("community".equals(formDTO.getAgencyLevel())) { + //2-1.查询组织直属网格列表【网格维度】 + List gridList = indexService.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); + //2-2.查询网格下用户、党员日统计数据,按用户总数降序 + List list = dataStatsDao.getSubGridUser(gridIds, formDTO.getDateId()); + //2-3.封装数据 + gridList.forEach(gr -> { + SubUserTotalResultDTO dto = new SubUserTotalResultDTO(); + dto.setOrgId(gr.getGridId()); + dto.setOrgName(gr.getGridName()); + list.forEach(re -> { + if (gr.getGridId().equals(re.getGridId())) { + dto.setUserTotal(re.getUserTotal()); + dto.setPartyMemberTotal(re.getPartyMemberTotal()); + } + }); + resultList.add(dto); + }); + + } else { + //3.直属组织 + //3-1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); + //3-2.查询组织下用户、党员日统计数据,按用户总数降序 + List list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); + //3-3.封装数据 + subAgencyList.forEach(sub -> { + SubUserTotalResultDTO dto = new SubUserTotalResultDTO(); + dto.setOrgId(sub.getAgencyId()); + dto.setOrgName(sub.getAgencyName()); + list.forEach(u -> { + if (sub.getAgencyId().equals(u.getAgencyId())) { + dto.setUserTotal(u.getUserTotal()); + dto.setPartyMemberTotal(u.getPartyMemberTotal()); + } + }); + resultList.add(dto); + }); + } + + //4.按用户数降序排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubUserTotalResultDTO o1, SubUserTotalResultDTO o2) { + //降序 + return o2.getUserTotal().compareTo(o1.getUserTotal()); + } + }); + + return resultList; + } + + /** + * @Param formDTO + * @Description 对外接口--查询下级话题和小组数 + * @author sun + * @param formDTO + */ + @Override + public List subTopicAndGroup(BaseDataFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1.入参有日期的则按具体时间执行,没有的则按当前时间前一天执行 + 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)); + } + + //根据组织级别判断查询直属下级组织或网格数据 + //2.直属网格 + if ("community".equals(formDTO.getAgencyLevel())) { + //2-1.查询组织直属网格列表【网格维度】 + List gridList = indexService.getSubGridList(formDTO.getAgencyId()); + if (gridList.size() < NumConstant.ONE) { + return resultList; + } + List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); + //2-2.查询网格下热议中话题日统计数据 + List hotdiscuss = dataStatsDao.getSubGridTopicHotDiscuss(gridIds, formDTO.getDateId()); + //2-2.查询网格层级小组日统计数据 + List list = dataStatsDao.getSubGridGroup(gridIds, formDTO.getDateId()); + //2-3.封装数据 + gridList.forEach(gr -> { + SubTopicAndGroupResultDTO resultDTO = new SubTopicAndGroupResultDTO(); + resultDTO.setOrgId(gr.getGridId()); + resultDTO.setOrgName(gr.getGridName()); + hotdiscuss.forEach(t -> { + if (t.getGridId().equals(gr.getGridId())) { + resultDTO.setTopicTotal(t.getTopicTotal()); + } + }); + list.forEach(l -> { + if (l.getGridId().equals(gr.getGridId())) { + resultDTO.setGroupTotal(l.getGroupTotal()); + } + }); + resultList.add(resultDTO); + }); + + } else { + //3.直属组织 + //3-1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); + if (subAgencyList.size() < NumConstant.ONE) { + return resultList; + } + List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); + //3-2.查询组织下热议中话题日统计数据 + List hotdiscuss = dataStatsDao.getSubAgencyTopicHotDiscuss(agencyIds, formDTO.getDateId()); + //3-3.查询直属下级组织小组日统计数据 + List list = dataStatsDao.getSubAgencyGroup(agencyIds, formDTO.getDateId()); + //3-4.封装数据 + subAgencyList.forEach(sub -> { + SubTopicAndGroupResultDTO resultDTO = new SubTopicAndGroupResultDTO(); + resultDTO.setOrgId(sub.getAgencyId()); + resultDTO.setOrgName(sub.getAgencyName()); + hotdiscuss.forEach(t -> { + if (t.getAgencyId().equals(sub.getAgencyId())) { + resultDTO.setTopicTotal(t.getTopicTotal()); + } + }); + list.forEach(u -> { + if (sub.getAgencyId().equals(u.getAgencyId())) { + resultDTO.setGroupTotal(u.getGroupTotal()); + } + }); + resultList.add(resultDTO); + }); + } + + //4.按用户数降序排序并返回 + Collections.sort(resultList, new Comparator() { + @Override + public int compare(SubTopicAndGroupResultDTO o1, SubTopicAndGroupResultDTO o2) { + //降序 + return o2.getTopicTotal().compareTo(o1.getTopicTotal()); + } + }); + + return resultList; + } + } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.java new file mode 100644 index 0000000000..e8ec143b3c --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/StatsStaffPatrolRecordDailyService.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.dataaggre.service.epmetuser; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; +import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; + +import java.util.List; + +/** + * 工作人员巡查主记录 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-06-07 + */ +public interface StatsStaffPatrolRecordDailyService extends BaseService { + + /** + * desc:获取组织或网格的 时间段内的总次数等 + * @param agencyList + * @param startDateId + * @param endDateId + * @return + */ + List getPatrolSumList(List agencyList, String startDateId, String endDateId); + +} diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java new file mode 100644 index 0000000000..aad90034f3 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/epmetuser/impl/StatsStaffPatrolRecordDailyServiceImpl.java @@ -0,0 +1,39 @@ +package com.epmet.dataaggre.service.epmetuser.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.epmetuser.StatsStaffPatrolRecordDailyDao; +import com.epmet.dataaggre.dto.epmetuser.result.PatrolDailySumResult; +import com.epmet.dataaggre.entity.epmetuser.StatsStaffPatrolRecordDailyEntity; +import com.epmet.dataaggre.service.epmetuser.StatsStaffPatrolRecordDailyService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * desc: + * + * @author: LiuJanJun + * @date: 2021/8/6 11:06 上午 + * @version: 1.0 + */ +@DataSource(DataSourceConstant.EPMET_USER) +@Slf4j +@Service +public class StatsStaffPatrolRecordDailyServiceImpl extends BaseServiceImpl implements StatsStaffPatrolRecordDailyService { + /** + * desc:获取组织或网格的 时间段内的总次数等 + * + * @param agencyFullIdList + * @param startDateId + * @param endDateId + * @return + */ + @Override + public List getPatrolSumList(List agencyFullIdList, String startDateId, String endDateId) { + return baseDao.getPatrolSumList(agencyFullIdList,startDateId,endDateId); + } + +} 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 index fc9e6b8ba6..f8c7eb301a 100644 --- 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 @@ -1,9 +1,8 @@ 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.commons.tools.exception.RenException; 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; @@ -14,13 +13,10 @@ import com.epmet.dataaggre.service.evaluationindex.EvaluationIndexService; import com.epmet.dataaggre.service.opercrm.CustomerRelation; 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.text.SimpleDateFormat; import java.util.ArrayList; -import java.util.Date; import java.util.List; /** @@ -114,6 +110,9 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { public List getAgencyIdsByAgencyId(String agencyId) { //1.查询agencyId对应组织信息 ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); + if (dto == null){ + return new ArrayList<>(); + } //2.判断客户是否存在子客户 List list = customerRelation.haveSubCustomer(dto.getCustomerId()); if (!CollectionUtils.isNotEmpty(list)) { @@ -131,6 +130,9 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { public List getSubAgencyListByAgency(String agencyId) { //1.查询agencyId对应组织信息 ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); + if (dto == null){ + throw new RenException("组织信息不存在!"); + } //2.判断客户是否存在子客户 List list = customerRelation.haveSubCustomer(dto.getCustomerId()); if (!CollectionUtils.isNotEmpty(list)) { diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerParameterService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerParameterService.java new file mode 100644 index 0000000000..2ed5791a12 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerParameterService.java @@ -0,0 +1,34 @@ +/** + * 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.service.opercrm; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; + +/** + * 客户配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-07-27 + */ +public interface CustomerParameterService extends BaseService { + + CustomerParameterEntity queryFootBarPattern(String customerId, String appType); + + CustomerParameterEntity queryFootBarHighLightNum(String customerId, String appType); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerParameterServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerParameterServiceImpl.java new file mode 100644 index 0000000000..4a9a3f342d --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerParameterServiceImpl.java @@ -0,0 +1,60 @@ +/** + * 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.service.opercrm.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.opercrm.CustomerParameterDao; +import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; +import com.epmet.dataaggre.service.opercrm.CustomerParameterService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * 客户配置表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-07-27 + */ +@DataSource(DataSourceConstant.OPER_CRM) +@Slf4j +@Service +public class CustomerParameterServiceImpl extends BaseServiceImpl implements CustomerParameterService { + + @Override + public CustomerParameterEntity queryFootBarPattern(String customerId, String appType) { + String parameterKey=appType.concat(Constant.FOOTBAR_PATTERN_KEY_SUFFIX); + CustomerParameterEntity pattern=baseDao.selectByParameterKey(parameterKey,customerId); + if(null ==pattern){ + pattern=baseDao.selectByParameterKey(parameterKey, Constant.DEFAULT_CUSTOMER); + } + return pattern; + } + + @Override + public CustomerParameterEntity queryFootBarHighLightNum(String customerId, String appType) { + String parameterKey=appType.concat(Constant.FOOTBAR_HIGHLIGHT_NUM); + CustomerParameterEntity entity=baseDao.selectByParameterKey(parameterKey,customerId); + if(null ==entity){ + entity=baseDao.selectByParameterKey(parameterKey, Constant.DEFAULT_CUSTOMER); + } + return entity; + } +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.java new file mode 100644 index 0000000000..b185b9746a --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/CustomerFootBarService.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.dataaggre.service.opercustomize; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; +import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; +import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-07-27 + */ +public interface CustomerFootBarService extends BaseService { + + /** + * 查询底部footBar信息(两端通用) + * + * @param footBarFormDTO + * @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO + * @author yinzuomei + * @date 2021/7/27 18:59 + */ + AppFootBarResultDTO queryAppFootBars(AppFootBarFormDTO footBarFormDTO); +} \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java new file mode 100644 index 0000000000..4e1546f5a5 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercustomize/impl/CustomerFootBarServiceImpl.java @@ -0,0 +1,115 @@ +/** + * 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.service.opercustomize.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.dataaggre.constant.DataSourceConstant; +import com.epmet.dataaggre.dao.opercustomize.CustomerFootBarDao; +import com.epmet.dataaggre.dto.app.form.AppFootBarFormDTO; +import com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO; +import com.epmet.dataaggre.dto.app.result.CustomerFootBarDTO; +import com.epmet.dataaggre.entity.opercrm.CustomerParameterEntity; +import com.epmet.dataaggre.entity.opercustomize.CustomerFootBarEntity; +import com.epmet.dataaggre.service.opercrm.CustomerParameterService; +import com.epmet.dataaggre.service.opercustomize.CustomerFootBarService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + + +/** + * APP底部菜单栏信息 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-07-27 + */ +@DataSource(DataSourceConstant.OPERCUSTOMIZE) +@Slf4j +@Service +public class CustomerFootBarServiceImpl extends BaseServiceImpl implements CustomerFootBarService { + + @Autowired + private CustomerParameterService customerParameterService; + + /** + * 查询底部footBar信息(两端通用) + * + * @param footBarFormDTO + * @return com.epmet.dataaggre.dto.app.result.AppFootBarResultDTO + * @author yinzuomei + * @date 2021/7/27 18:59 + */ + @Override + public AppFootBarResultDTO queryAppFootBars(AppFootBarFormDTO footBarFormDTO) { + AppFootBarResultDTO resultDTO = new AppFootBarResultDTO(); + resultDTO.setPattern(Constant.FOOT_BAR_FLAT); + resultDTO.setHighLightNum(NumConstant.ZERO); + // 1、查询客户的模式,没有返回产品默认的;*水平:flat;浮起:float + CustomerParameterEntity patternEntity = customerParameterService.queryFootBarPattern(footBarFormDTO.getCustomerId(), footBarFormDTO.getAppType()); + // 2、查询客户设置的第几个,没有默认返回0, + CustomerParameterEntity highLightNumEntity = customerParameterService.queryFootBarHighLightNum(footBarFormDTO.getCustomerId(), footBarFormDTO.getAppType()); + List footBarList = baseDao.selectAppFootBars(footBarFormDTO.getCustomerId(), footBarFormDTO.getAppType()); + if (CollectionUtils.isEmpty(footBarList)) { + footBarList = baseDao.selectAppFootBars(Constant.DEFAULT_CUSTOMER, footBarFormDTO.getAppType()); + }else{ + //如果客户没有上传图标,返回产品默认的图标 + for (CustomerFootBarDTO dto : footBarList) { + if (StringUtils.isBlank(dto.getIconPath()) + || StringUtils.isBlank(dto.getSelectedIconPath()) + || StringUtils.isBlank(dto.getFloatIconPath())) { + CustomerFootBarEntity defaultEntity = baseDao.selectDefaultIcon(Constant.DEFAULT_CUSTOMER, footBarFormDTO.getAppType(), dto.getBarKey()); + if (StringUtils.isBlank(dto.getIconPath())) { + dto.setIconPath(null == defaultEntity ? StrConstant.EPMETY_STR : defaultEntity.getIconPath()); + } + if (StringUtils.isBlank(dto.getSelectedIconPath())) { + dto.setSelectedIconPath(null == defaultEntity ? StrConstant.EPMETY_STR : defaultEntity.getSelectedIconPath()); + } + if (StringUtils.isBlank(dto.getFloatIconPath())) { + dto.setFloatIconPath(null == defaultEntity ? StrConstant.EPMETY_STR : defaultEntity.getFloatIconPath()); + } + } + } + } + if (footBarList.size() % NumConstant.TWO == 0) { + resultDTO.setIsOddNum(false); + } else { + resultDTO.setIsOddNum(true); + } + //只有客户选择的浮起+奇数+全部上传了图标才返回pattern=flat + if (resultDTO.getIsOddNum() && Constant.FOOT_BAR_FLOAT.equals(patternEntity.getParameterValue())) { + resultDTO.setPattern(Constant.FOOT_BAR_FLOAT); + //返回 + resultDTO.setHighLightNum(footBarList.size() / NumConstant.TWO); + } else { + resultDTO.setPattern(Constant.FOOT_BAR_FLAT); + resultDTO.setHighLightNum(Integer.valueOf(highLightNumEntity.getParameterValue())); + } + //如果是浮起模式且是奇数,返回是footBarList的索引 + resultDTO.setFootBarList(footBarList); + return resultDTO; + } + +} \ No newline at end of file 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 ab888fc91c..98ff885e99 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 @@ -139,6 +139,11 @@ dynamic: url: @datasource.druid.evaluationIndex.url@ username: @datasource.druid.evaluationIndex.username@ password: @datasource.druid.evaluationIndex.password@ + opercustomize: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.opercustomize.url@ + username: @datasource.druid.opercustomize.username@ + password: @datasource.druid.opercustomize.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 index 7b4361e463..eb3f9c7d33 100644 --- 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 @@ -685,5 +685,62 @@ AGENCY_ID = #{agencyId} + + + + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml new file mode 100644 index 0000000000..5642d17f40 --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/epmetuser/StatsStaffPatrolRecordDailyDao.xml @@ -0,0 +1,18 @@ + + + + + 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 index d248aa13df..7ad70627dc 100644 --- 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 @@ -154,7 +154,8 @@ agency_name AS agencyName, level AS level, area_code AS areaCode, - parent_area_code AS parentAreaCode + parent_area_code AS parentAreaCode, + PIDS FROM screen_customer_agency WHERE @@ -174,4 +175,4 @@ - \ No newline at end of file + diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerParameterDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerParameterDao.xml new file mode 100644 index 0000000000..63decd801e --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerParameterDao.xml @@ -0,0 +1,15 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml new file mode 100644 index 0000000000..b412fd552f --- /dev/null +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercustomize/CustomerFootBarDao.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java new file mode 100644 index 0000000000..0eae55ef84 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/govOrg/OrgTreeFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.dto.form.govOrg; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 各机关注册用户数入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:47 + */ +@Data +public class OrgTreeFormDTO implements Serializable { + + + private static final long serialVersionUID = 6649155066499141632L; + + private String mobile; + + private String customerId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/govOrg/OrgTreeNode.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/govOrg/OrgTreeNode.java new file mode 100644 index 0000000000..4989cc8bd1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/govOrg/OrgTreeNode.java @@ -0,0 +1,18 @@ +package com.epmet.dto.result.govOrg; + +import com.epmet.commons.tools.utils.TreeAreaCodeNode; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +@Data +public class OrgTreeNode extends TreeAreaCodeNode { + private String id; + private String pid; + private String orgId; + private String orgName; + private String level; + + private List children=new ArrayList<>(); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java index 6c71a15009..f393b43c59 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/AgencyController.java @@ -8,9 +8,11 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AgencyDetailMulticFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.govOrg.OrgTreeFormDTO; import com.epmet.dto.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.govOrg.OrgTreeNode; import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; @@ -129,4 +131,17 @@ public class AgencyController { ValidatorUtils.validateEntity(formDTO, AgencyDetailMulticFormDTO.AddUserInternalGroup.class); return new Result().ok(agencyService.queryAgencyDetailMultiC(formDTO)); } + + /** + * desc: 获取组织树 含所有直线上级 但不含部门和网格 目前 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author LiuJanJun + * @date 2021/8/3 5:17 下午 + */ + @PostMapping("getStaffAgencyTree") + public Result getStaffAgencyTree(@RequestBody OrgTreeFormDTO formDTO) { + return new Result().ok(agencyService.getStaffAgencyTree(formDTO)); + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java index 04c509de8b..051a6ec3e6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenCustomerAgencyDao.java @@ -114,7 +114,7 @@ public interface ScreenCustomerAgencyDao { CompartmentResultDTO getAgencyInfoByAegncyId(@Param("agencyId") String agencyId); /** - * @Description 查询组织的下级组织ID + * @Description 查询组织的下级组织ID * @Param agencyId * @author zxc * @date 2020/10/28 10:33 上午 @@ -134,7 +134,7 @@ public interface ScreenCustomerAgencyDao { * @description 根据areaCode查询组织机构 * @Date 2021/2/4 21:51 **/ - List queryStaffAgencyTree(@Param("areaCode")String areaCode); + List queryStaffAgencyTree(@Param("areaCode") String areaCode); /** * @param areaCode @@ -143,7 +143,7 @@ public interface ScreenCustomerAgencyDao { * @description 查找组织下的部门 * @Date 2021/2/4 21:51 **/ - List selectDeptList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + List selectDeptList(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); /** * @param areaCode @@ -152,27 +152,27 @@ public interface ScreenCustomerAgencyDao { * @description 查找组织下的网格 * @Date 2021/2/4 21:52 **/ - List selectGridList(@Param("areaCode") String areaCode,@Param("agencyId") String agencyId); + List selectGridList(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); /** - * @return java.util.List * @param areaCode * @param agencyId + * @return java.util.List * @author yinzuomei * @description 下一级组织+直属网格 * @Date 2021/5/10 14:02 **/ - List getNextAgencyIds(@Param("areaCode")String areaCode,@Param("agencyId")String agencyId); + List getNextAgencyIds(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); - List selectSubAgencyIds(@Param("areaCode")String areaCode, @Param("agencyId")String agencyId); + List selectSubAgencyIds(@Param("areaCode") String areaCode, @Param("agencyId") String agencyId); /** - * @Description 根据agencyId查询网格 + * @Description 根据agencyId查询网格 * @Param agencyId * @author zxc * @date 2021/6/8 1:27 下午 */ - List selectGrid(@Param("agencyId")String agencyId,@Param("areaCode")String areaCode); + List selectGrid(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode); /** * 查询当前组织的下一级组织,可根据areaCode查询,也可根据pid查询 @@ -190,13 +190,13 @@ public interface ScreenCustomerAgencyDao { * @param parentAgencyId * @return java.util.List */ - List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allCustomerIds") List allCustomerIds); + List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId, @Param("allCustomerIds") List allCustomerIds); - List selectPAgencyById(@Param("listStr")List pidList); + List selectPAgencyById(@Param("listStr") List pidList); /** - * @return com.epmet.dto.result.ScreenCustomerAgencyDTO * @param customerId + * @return com.epmet.dto.result.ScreenCustomerAgencyDTO * @author yinzuomei * @description 根据客户id,返回当前客户下的跟组织信息 * @Date 2021/6/24 17:43 @@ -204,4 +204,15 @@ public interface ScreenCustomerAgencyDao { ScreenCustomerAgencyDTO selectCustomerRootAgency(String customerId); ScreenCustomerAgencyDTO selectByAreaCode(String areaCode); -} \ No newline at end of file + + /** + * desc: 根据pids 或者 areaCode 获取所有下级组织 + * + * @param pids + * @param areaCode + * @return java.util.List + * @author LiuJanJun + * @date 2021/8/5 11:01 上午 + */ + List selectAllSubAgencyList(@Param("pids") String pids, @Param("areaCode") String areaCode); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/healthcheck/HealthCheckController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..fdce5c584e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.datareport.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java index aa142bed95..284241e296 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/AgencyService.java @@ -5,10 +5,12 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AgencyDetailMulticFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.govOrg.OrgTreeFormDTO; import com.epmet.dto.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.govOrg.OrgTreeNode; import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; @@ -104,4 +106,14 @@ public interface AgencyService { * @return com.epmet.dto.result.AgencyDetailMulticResultDTO */ AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO); + + /** + * desc: 获取工作人员组织树 含所有直线上级组织 不含网格及部门 + * + * @param mobile + * @return com.epmet.dto.result.plugins.AgencyNodeDTO + * @author LiuJanJun + * @date 2021/8/3 5:03 下午 + */ + OrgTreeNode getStaffAgencyTree(OrgTreeFormDTO mobile); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java index c6dc8deba2..8b45ddb6ef 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/AgencyServiceImpl.java @@ -2,28 +2,35 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.alibaba.fastjson.JSON; 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.constant.StrConstant; +import com.epmet.commons.tools.enums.OrgLevelEnum; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.AgencyTreeUtils; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.utils.TreeUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerGridDao; import com.epmet.datareport.redis.DataReportRedis; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.dto.AgencyInfoDTO; +import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerStaffDTO; import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.form.AddAreaCodeDictFormDTO; import com.epmet.dto.form.AgencyDetailMulticFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.form.CustomerStaffFormDTO; +import com.epmet.dto.form.govOrg.OrgTreeFormDTO; import com.epmet.dto.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.ParentListResultDTO; import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; +import com.epmet.dto.result.govOrg.OrgTreeNode; import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; @@ -33,6 +40,7 @@ import com.epmet.evaluationindex.screen.dto.result.AgencyDistributionResultDTO; import com.epmet.evaluationindex.screen.dto.result.CompartmentResultDTO; import com.epmet.evaluationindex.screen.dto.result.TreeResultDTO; import com.epmet.feign.EpmetCommonServiceOpenFeignClient; +import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; import lombok.extern.slf4j.Slf4j; @@ -42,10 +50,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; +import java.util.*; /** * 组织相关api @@ -70,6 +75,8 @@ public class AgencyServiceImpl implements AgencyService { private OperCrmOpenFeignClient operCrmOpenFeignClient; @Autowired private DataReportRedis dataReportRedis; + @Autowired + private EpmetUserOpenFeignClient userOpenFeignClient; /** * @Description 1、组织机构树 @@ -438,7 +445,7 @@ public class AgencyServiceImpl implements AgencyService { log.info("多客户版本parentList、level要重新赋值;agencysResultDTO.getParentAreaCode()="+agencysResultDTO.getParentAreaCode()); ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); if (null != parentAgency) { - agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); + agencysResultDTO.setLevel(OrgLevelEnum.getSubOrgLevel(parentAgency.getLevel())); List temp = getParentListMultic(parentList, parentAgency, formDTO.getCustomerId(), agencysResultDTO.getRootAgencyId()); agencysResultDTO.setParentList(temp); } @@ -468,6 +475,97 @@ public class AgencyServiceImpl implements AgencyService { return agencysResultDTO; } + @Override + public OrgTreeNode getStaffAgencyTree(OrgTreeFormDTO formDTO) { + //获取工作人员信息 + CustomerStaffFormDTO staffParam = new CustomerStaffFormDTO(); + staffParam.setMobile(formDTO.getMobile()); + staffParam.setCustomerId(formDTO.getCustomerId()); + Result staffInfoResult = userOpenFeignClient.getCustomerStaffInfo(staffParam); + if (!staffInfoResult.success()){ + throw new RenException(staffInfoResult.getCode(),staffInfoResult.getInternalMsg()); + } + //获取工作人员组织信息 + Result agencyByStaff = govOrgOpenFeignClient.getAgencyByStaff(staffInfoResult.getData().getUserId()); + if (!agencyByStaff.success() || agencyByStaff.getData()== null || StringUtils.isBlank(agencyByStaff.getData().getId()) ){ + throw new RenException(staffInfoResult.getCode(),staffInfoResult.getMsg()); + } + CustomerAgencyDTO staffAgencyDTO = agencyByStaff.getData(); + log.debug("getStaffAgencyTree查询当前工作人员组织信息为:{}",JSON.toJSONString(staffAgencyDTO)); + + //4、如果当前客户不存在子客户则areaCode置为空 + Result> crmRes=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + if (!crmRes.success()){ + throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode()); + } + List nodes = new ArrayList<>(); + ScreenCustomerAgencyDTO parentAgencyDTO = null; + + List nodeList = new ArrayList<>(); + //单客户 + if (CollectionUtils.isEmpty(crmRes.getData())){ + String parentId = staffAgencyDTO.getPid(); + do { + parentAgencyDTO = screenCustomerAgencyDao.selectByAgencyId(parentId); + if (parentAgencyDTO == null){ + break; + } + convertOrgTreeNode(nodeList, parentAgencyDTO); + if (parentAgencyDTO.getPid() == null || NumConstant.ZERO_STR.equals(parentAgencyDTO.getPid())){ + break; + } + parentId = parentAgencyDTO.getAreaCode(); + } while (true); + //多客户 获取所有下级 + List agencyNodeDTOS = screenCustomerAgencyDao.selectAllSubAgencyList(staffAgencyDTO.getPids(),null); + agencyNodeDTOS.forEach(agency->convertOrgTreeNode(nodeList, agency)); + nodes = TreeUtils.buildTreeByAreaCode(nodeList); + }else { + String parentAreaCode = staffAgencyDTO.getParentAreaCode(); + //多客户 获取所有直线上级 + do { + parentAgencyDTO = screenCustomerAgencyDao.selectByAreaCode(parentAreaCode); + if (parentAgencyDTO == null){ + break; + } + convertOrgTreeNode(nodeList, parentAgencyDTO); + if (parentAgencyDTO.getPid() == null || NumConstant.ZERO_STR.equals(parentAgencyDTO.getPid())){ + break; + } + parentAreaCode = parentAgencyDTO.getAreaCode(); + } while (true); + log.debug("getStaffAgencyTree查询所有上级为:{}",JSON.toJSONString(nodeList)); + //多客户 获取所有下级 + List agencyNodeDTOS = screenCustomerAgencyDao.selectAllSubAgencyList(null,staffAgencyDTO.getAreaCode()); + //孔村降级处理 且移除掉 党总支级别 + String KONG_CUN_AGENCY_ID = "1234085031077498881"; + Iterator iterator = agencyNodeDTOS.iterator(); + while (iterator.hasNext()){ + ScreenCustomerAgencyDTO e = iterator.next(); + if (e.getPids().contains(KONG_CUN_AGENCY_ID)){ + if (OrgLevelEnum.STREET.getCode().equals(e.getLevel())){ + iterator.remove(); + } + if (KONG_CUN_AGENCY_ID.equals(e.getAgencyId())){ + e.setLevel(OrgLevelEnum.getSubOrgLevel(e.getLevel())); + } + } + convertOrgTreeNode(nodeList, e); + } + nodes = TreeUtils.buildTreeByAreaCode(nodeList); + } + log.debug("getStaffAgencyTree查询所有上级树结构为:{}",JSON.toJSONString(nodes)); + //只有一个根节点的树 所以返回一个 + return nodes.get(0); + } + + private void convertOrgTreeNode(List nodeList, ScreenCustomerAgencyDTO currentAgency) { + OrgTreeNode orgTreeNode = ConvertUtils.sourceToTarget(currentAgency, OrgTreeNode.class); + orgTreeNode.setOrgId(currentAgency.getAgencyId()); + orgTreeNode.setOrgName(currentAgency.getAgencyName()); + nodeList.add(orgTreeNode); + } + private List getParentListMultic(List resList, ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) { ParentListResultDTO resultDTO = new ParentListResultDTO(); resultDTO.setId(firstParent.getAgencyId()); @@ -491,20 +589,4 @@ public class AgencyServiceImpl implements AgencyService { } } } - - private String getAgencyLevelMultiC(ScreenCustomerAgencyDTO parentAgency) { - String level=StrConstant.EPMETY_STR; - if(null!=parentAgency){ - if(Constant.PROVINCE.equals(parentAgency.getLevel())){ - return Constant.CITY; - }else if(Constant.CITY.equals(parentAgency.getLevel())){ - return Constant.DISTRICT; - }else if(Constant.DISTRICT.equals(parentAgency.getLevel())){ - return Constant.STREET; - }else if(Constant.STREET.equals(parentAgency.getLevel())){ - return Constant.COMMUNITY; - } - } - return level; - } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java index 33fd65dd1b..070fcca43a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/impl/ProjectServiceImpl.java @@ -530,11 +530,11 @@ public class ProjectServiceImpl implements ProjectService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public List queryMassesDiscontentMultic(MassesDiscontentFormV2DTO formDTO) { - PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); formDTO.setEndDate(getDateId(ProjectConstant.YESTERDAY)); formDTO.setStartDate(getDateId(formDTO.getTimeSection())); log.info(JSON.toJSONString(formDTO,true)); //已结案、并且来源于议题、在当前时间范围内的、 + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); List list = projectDao.selectMassesDiscontentMultic(formDTO.getAgencyId(), formDTO.getAreaCode(), formDTO.getStartDate(), diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index 9cda990ac0..34664cd623 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -142,7 +142,7 @@ - + diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 0d940865f0..f0e65a8bd1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml @@ -433,4 +433,21 @@ AND sca.AREA_CODE = #{areaCode} limit 1 + diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java index a0d86d6164..2be14c087f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java @@ -19,6 +19,8 @@ package com.epmet.dto.stats.user; import java.io.Serializable; import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.math.BigDecimal; @@ -150,4 +152,16 @@ public class FactParticipationUserGridDailyDTO implements Serializable { */ private String delFlag; + public FactParticipationUserGridDailyDTO() { + this.regTotal = NumConstant.ZERO; + this.resiTotal = NumConstant.ZERO; + this.warmHeartedTotal = NumConstant.ZERO; + this.partymemberTotal = NumConstant.ZERO; + this.regIncr = NumConstant.ZERO; + this.warmIncr = NumConstant.ZERO; + this.partymemberIncr = NumConstant.ZERO; + this.resiProportion = NumConstant.ZERO_DECIMAL; + this.partymemberProportion = NumConstant.ZERO_DECIMAL; + this.warmHeartedProportion = NumConstant.ZERO_DECIMAL; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java index 15221181a8..be34873cf6 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java @@ -19,6 +19,8 @@ package com.epmet.dto.stats.user; import java.io.Serializable; import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.math.BigDecimal; @@ -149,4 +151,16 @@ public class FactParticipationUserGridMonthlyDTO implements Serializable { */ private String delFlag; + public FactParticipationUserGridMonthlyDTO() { + this.regTotal = NumConstant.ZERO; + this.resiTotal = NumConstant.ZERO; + this.warmHeartedTotal = NumConstant.ZERO; + this.partymemberTotal = NumConstant.ZERO; + this.regIncr = NumConstant.ZERO; + this.warmIncr = NumConstant.ZERO; + this.partymemberIncr = NumConstant.ZERO; + this.partymemberProportion = NumConstant.ZERO_DECIMAL; + this.resiProportion = NumConstant.ZERO_DECIMAL; + this.warmHeartedProportion = NumConstant.ZERO_DECIMAL; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java index cf2d64b687..ea99e123f8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java @@ -19,6 +19,8 @@ package com.epmet.dto.stats.user; import java.io.Serializable; import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.math.BigDecimal; @@ -149,4 +151,16 @@ public class FactRegUserGridDailyDTO implements Serializable { */ private String delFlag; + public FactRegUserGridDailyDTO() { + this.regTotal = NumConstant.ZERO; + this.resiTotal = NumConstant.ZERO; + this.warmHeartedTotal = NumConstant.ZERO; + this.partymemberTotal = NumConstant.ZERO; + this.regIncr = NumConstant.ZERO; + this.warmIncr = NumConstant.ZERO; + this.partymemberIncr = NumConstant.ZERO; + this.resiProportion = NumConstant.ZERO_DECIMAL; + this.partymemberProportion = NumConstant.ZERO_DECIMAL; + this.warmHeartedProportion = NumConstant.ZERO_DECIMAL; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java index 51308b4d4c..4060d75e7f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java @@ -19,6 +19,8 @@ package com.epmet.dto.stats.user; import java.io.Serializable; import java.util.Date; + +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.math.BigDecimal; @@ -149,4 +151,16 @@ public class FactRegUserGridMonthlyDTO implements Serializable { */ private String delFlag; + public FactRegUserGridMonthlyDTO() { + this.regTotal = NumConstant.ZERO; + this.resiTotal = NumConstant.ZERO; + this.warmHeartedTotal = NumConstant.ZERO; + this.partymemberTotal = NumConstant.ZERO; + this.regIncr = NumConstant.ZERO; + this.warmIncr = NumConstant.ZERO; + this.partymemberIncr = NumConstant.ZERO; + this.warmHeartedProportion = NumConstant.ZERO_DECIMAL; + this.resiProportion = NumConstant.ZERO_DECIMAL; + this.partymemberProportion = NumConstant.ZERO_DECIMAL; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java index 40315afc0c..22e6955a83 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java @@ -5,6 +5,7 @@ import com.epmet.dto.stats.user.*; import lombok.Data; import java.io.Serializable; +import java.util.ArrayList; import java.util.List; /** @@ -71,4 +72,15 @@ public class UserStatisticalData implements Serializable { * yyyyMM */ private String monthId; + + public UserStatisticalData() { + this.partiAgencyDailyList = new ArrayList<>(); + this.partiGridDailyList = new ArrayList<>(); + this.partiAgencyMonthlyList = new ArrayList<>(); + this.partiGridMonthlyList = new ArrayList<>(); + this.regAgencyDailyList = new ArrayList<>(); + this.regGridDailyList = new ArrayList<>(); + this.regAgencyMonthlyList = new ArrayList<>(); + this.regGridMonthlyList = new ArrayList<>(); + } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/IncrAndTotalUserIdsResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/IncrAndTotalUserIdsResultDTO.java new file mode 100644 index 0000000000..77591143e1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/IncrAndTotalUserIdsResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/7/27 10:41 上午 + * @DESC + */ +@Data +public class IncrAndTotalUserIdsResultDTO implements Serializable { + + private static final long serialVersionUID = 9116867002773352209L; + + private String gridId; + + private List userIds; + + /** + * userId类型:daily:日,monthly:月 + */ + private String type; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/IncrWithinTimeRangeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/IncrWithinTimeRangeResultDTO.java new file mode 100644 index 0000000000..e922a0e3a6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/IncrWithinTimeRangeResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/7/28 10:58 上午 + * @DESC 查询指定时间范围内注册/参与用户增量 + */ +@Data +public class IncrWithinTimeRangeResultDTO implements Serializable { + + private static final long serialVersionUID = 6199087464367184830L; + + private String gridId; + + private Integer userCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/PartyTotalAndIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/PartyTotalAndIncrResultDTO.java new file mode 100644 index 0000000000..2dcdcdc8f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/PartyTotalAndIncrResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/7/27 4:53 下午 + * @DESC + */ +@Data +public class PartyTotalAndIncrResultDTO implements Serializable { + + private static final long serialVersionUID = 6546408164027047797L; + + private String gridId; + + private Integer dailyIncr; + + private Integer monthlyIncr; + + private Integer total; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/TotalAndIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/TotalAndIncrResultDTO.java new file mode 100644 index 0000000000..f0886b0399 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/TotalAndIncrResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.user.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/7/27 10:14 上午 + * @DESC + */ +@Data +public class TotalAndIncrResultDTO implements Serializable { + + private static final long serialVersionUID = -3184476610188193106L; + + private Integer total; + + private Integer dailyIncr; + + private Integer monthlyIncr; + + private String gridId; + + public TotalAndIncrResultDTO() { + this.total = NumConstant.ZERO; + this.dailyIncr = NumConstant.ZERO; + this.monthlyIncr = NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/TotalUserIdsResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/TotalUserIdsResultDTO.java new file mode 100644 index 0000000000..1536055246 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/TotalUserIdsResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zxc + * @DateTime 2021/7/27 10:57 上午 + * @DESC + */ +@Data +public class TotalUserIdsResultDTO implements Serializable { + + private static final long serialVersionUID = 8236061658552220549L; + + private String gridId; + + private List userIds; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/WarmTotalAndIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/WarmTotalAndIncrResultDTO.java new file mode 100644 index 0000000000..2b9b86e2f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/WarmTotalAndIncrResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.user.result; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2021/7/27 1:30 下午 + * @DESC + */ +@Data +public class WarmTotalAndIncrResultDTO implements Serializable { + + private static final long serialVersionUID = -4864864583111279861L; + + private String gridId; + + private Integer total; + + /** + * 日增 + */ + private Integer dailyIncr; + + /** + * 月增 + */ + private Integer monthlyIncr; + + public WarmTotalAndIncrResultDTO() { + this.total = NumConstant.ZERO; + this.dailyIncr = NumConstant.ZERO; + this.monthlyIncr = NumConstant.ZERO; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java index 5dfd4bc79d..c468f3a27c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -48,7 +48,7 @@ public interface FactGroupGridDailyDao extends BaseDao * @param dateId * @author zxc */ - void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); + Integer deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); /** * @Description 根据机关级别查询小组数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java index f74e27ede1..8231cc4e7a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java @@ -37,7 +37,7 @@ public interface FactParticipationUserAgencyDailyDao extends BaseDao list); - void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + Integer deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); /** * @Description 查询机关下用户信息 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java index d52897c4b9..4f3f570d27 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java @@ -36,6 +36,6 @@ public interface FactParticipationUserAgencyMonthlyDao extends BaseDao list); - void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); + Integer deleteByParams(@Param("monthId")String monthId,@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/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java index 687e8650d6..acd5329dd4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java @@ -38,7 +38,7 @@ public interface FactParticipationUserGridDailyDao extends BaseDao list); - void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + Integer deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); /** * @Description 查询网格下用户信息 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java index b67adec9dc..ec04d3a275 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java @@ -36,5 +36,5 @@ public interface FactParticipationUserGridMonthlyDao extends BaseDao list); - void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); + Integer deleteByParams(@Param("monthId")String monthId,@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/user/FactRegUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java index e22a094565..b26b96ec63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java @@ -36,6 +36,6 @@ public interface FactRegUserAgencyDailyDao extends BaseDao list); - void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + Integer deleteByParams(@Param("dateId")String dateId,@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/user/FactRegUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java index 5df37b7ff5..633df1abb2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java @@ -37,7 +37,7 @@ public interface FactRegUserAgencyMonthlyDao extends BaseDao list); - void deleteByParams(@Param("monthId") String monthId, @Param("customerId") String customerId); + Integer deleteByParams(@Param("monthId") String monthId, @Param("customerId") String customerId); List selectAgencyUserCount(@Param("customerId") String customerId, @Param("monthId") String monthId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java index ba2c53eb2c..d0b24b16f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java @@ -37,7 +37,7 @@ public interface FactRegUserGridDailyDao extends BaseDao list); - void deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); + Integer deleteByParams(@Param("dateId")String dateId,@Param("customerId")String customerId); /** * @Description 根据机构级别查询用户数与党员数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java index 744f9ffd0a..3eef3fda97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java @@ -37,7 +37,7 @@ public interface FactRegUserGridMonthlyDao extends BaseDao list); - void deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); + Integer deleteByParams(@Param("monthId")String monthId,@Param("customerId")String customerId); /** * @Description 查询网格下的客户 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index 3d63f88ce5..8e03a5abc2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -5,11 +5,7 @@ import com.epmet.dto.extract.form.StaffPatrolStatsFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; -import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; -import com.epmet.dto.user.result.StaffRoleInfoDTO; -import com.epmet.dto.user.result.CustomerStaffDTO; -import com.epmet.dto.user.result.StaffPatrolRecordResult; -import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO; +import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,6 +32,16 @@ public interface UserDao { **/ CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + /** + * @Description 查询注册用户的总量与增量【新方法】 + * @Param regOrPartiFlag + * @Param gridIds + * @Param targetDate + * @author zxc + * @date 2021/7/27 10:20 上午 + */ + List selectResiTotalAndIncrByGridIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate,@Param("startDate")Date startDate); + /** * @param * @return @@ -45,6 +51,15 @@ public interface UserDao { **/ CommonTotalAndIncCountResultDTO selectPartyTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("targetDate") Date targetDate); + /** + * @Description 查询党员的总量与增量【新方法】 + * @Param targetDate + * @Param regOrPartiFlag + * @author zxc + * @date 2021/7/27 5:08 下午 + */ + List selectPartyTotalAndIncrNew(@Param("targetDate") Date targetDate,@Param("regOrPartiFlag") String regOrPartiFlag,@Param("startDate") Date startDate); + /** * @param * @return @@ -54,6 +69,18 @@ public interface UserDao { **/ CommonTotalAndIncCountResultDTO selectWarmTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + /** + * @Description 查询热心居民的总量与增量【新方法】 + * @Param userIds 总注册用户 + * @Param incrUserIds 增长注册用户 + * @Param gridIds 网格IDS + * @Param targetDate dateId eg:2021-07-27 + * @author zxc + * @date 2021/7/27 1:31 下午 + */ + List selectWarmTotalAndIncrByGrids(@Param("userIds") List userIds, @Param("incrDailyUserIds") List incrDailyUserIds, @Param("gridIds") Set gridIds, + @Param("targetDate") Date targetDate,@Param("startDate") Date startDate,@Param("incrMonthlyUserIds") List incrMonthlyUserIds); + /** * @param * @return @@ -72,6 +99,27 @@ public interface UserDao { **/ List selectTotalUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + /** + * @Description 查询指定网格范围下单位时间内新增的注册用户Id【新方法】 + * @Param regOrPartiFlag + * @Param gridIds + * @Param targetDate + * @author zxc + * @date 2021/7/27 10:41 上午 + */ + List selectIncrUserIdsByGrids(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate, + @Param("startDate")Date startDate); + + /** + * @Description 查询指定网格范围下单位时间内全部的注册用户Id【新方法】 + * @Param regOrPartiFlag + * @Param gridIds + * @Param targetDate + * @author zxc + * @date 2021/7/29 10:08 上午 + */ + List selectTotalUserIdsByGrids(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + /** * @param * @return @@ -90,6 +138,17 @@ public interface UserDao { **/ Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate); + /** + * @Description 查询指定时间范围内注册/参与用户增量【新方法】 + * @Param regOrPartiFlag + * @Param gridIds + * @Param startDate + * @Param endDate + * @author zxc + * @date 2021/7/28 11:00 上午 + */ + List selectIncrWithinTimeRangeByGrids(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate") Date startDate, @Param("endDate") Date endDate); + /** * @param * @return diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new 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 b5d77983b0..7401c62038 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 @@ -5,7 +5,6 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; -import com.epmet.commons.tools.enums.KongCunCustomerEnvEnum; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; 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 a7a596ca10..9263313f48 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 @@ -64,11 +64,7 @@ public class GroupDataServiceImpl implements GroupDataService { formDTO.setCustomerId(customerId); formDTO.setDateId(dateId); List gridGroupTotalResultDTOS = groupDataDao.selectGridGroupTotal(formDTO); - if (gridGroupTotalResultDTOS.size() == NumConstant.ZERO){ - result.forEach(grid -> { - grid.setGroupTotal(NumConstant.ZERO); - }); - }else { + if (!CollectionUtils.isEmpty(gridGroupTotalResultDTOS)){ result.forEach(grid -> { gridGroupTotalResultDTOS.forEach(groupTotal -> { if (grid.getGridId().equals(groupTotal.getGridId())) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java index d59d82e1e0..f0c8d90832 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java @@ -32,10 +32,12 @@ import com.epmet.dto.stats.FactGroupGridDailyDTO; import com.epmet.entity.stats.FactGroupGridDailyEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.stats.FactGroupGridDailyService; +import org.apache.commons.collections4.ListUtils; 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.Arrays; import java.util.List; @@ -114,12 +116,18 @@ public class FactGroupGridDailyServiceImpl extends BaseServiceImpl formDto,String customerId) { - if (formDto.size() == NumConstant.ZERO){ + if (CollectionUtils.isEmpty(formDto)){ return; } String dateId = formDto.get(NumConstant.ZERO).getDateId(); - baseDao.deleteInsertDateId(dateId,customerId); - baseDao.insertGroupGridDaily(formDto); + Integer delNum; + do { + delNum = baseDao.deleteInsertDateId(dateId,customerId); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(formDto, NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseDao.insertGroupGridDaily(p); + }); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java index f42f74645c..50b3ade54f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java @@ -3,8 +3,10 @@ package com.epmet.service.stats.user.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.dao.stats.user.*; +import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.service.stats.user.UserStatisticalService; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -12,6 +14,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.List; + /** * @Description * @ClassName UserStatisticalServiceImpl @@ -59,58 +63,91 @@ public class UserStatisticalServiceImpl implements UserStatisticalService { } if(null != data.getPartiAgencyDailyList() && data.getPartiAgencyDailyList().size() > NumConstant.ZERO){ - - participationUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); - participationUserAgencyDailyDao.insertBatch(data.getPartiAgencyDailyList()); + Integer delNum; + do { + delNum = participationUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getPartiAgencyDailyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + participationUserAgencyDailyDao.insertBatch(p); + }); } if(null != data.getPartiAgencyMonthlyList() && data.getPartiAgencyMonthlyList().size() > NumConstant.ZERO){ - - participationUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); - participationUserAgencyMonthlyDao.insertBatch(data.getPartiAgencyMonthlyList()); - + Integer delNum; + do { + delNum = participationUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getPartiAgencyMonthlyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + participationUserAgencyMonthlyDao.insertBatch(p); + }); } if(null != data.getPartiGridMonthlyList() && data.getPartiGridMonthlyList().size() > NumConstant.ZERO){ - - participationUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); - participationUserGridMonthlyDao.insertBatch(data.getPartiGridMonthlyList()); - + Integer delNum; + do { + delNum = participationUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getPartiGridMonthlyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + participationUserGridMonthlyDao.insertBatch(p); + }); } if(null != data.getPartiGridDailyList() && data.getPartiGridDailyList().size() > NumConstant.ZERO){ - - participationUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); - participationUserGridDailyDao.insertBatch(data.getPartiGridDailyList()); - + Integer delNum; + do { + delNum = participationUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getPartiGridDailyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + participationUserGridDailyDao.insertBatch(p); + }); } if(null != data.getRegAgencyDailyList() && data.getRegAgencyDailyList().size() > NumConstant.ZERO){ - - regUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); - regUserAgencyDailyDao.insertBatch(data.getRegAgencyDailyList()); - + Integer delNum; + do { + delNum = regUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getRegAgencyDailyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + regUserAgencyDailyDao.insertBatch(p); + }); } if(null != data.getRegAgencyMonthlyList() && data.getRegAgencyMonthlyList().size() > NumConstant.ZERO){ - - regUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); - regUserAgencyMonthlyDao.insertBatch(data.getRegAgencyMonthlyList()); - + Integer delNum; + do { + delNum = regUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getRegAgencyMonthlyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + regUserAgencyMonthlyDao.insertBatch(p); + }); } if(null != data.getRegGridDailyList() && data.getRegGridDailyList().size() > NumConstant.ZERO){ - - regUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); - regUserGridDailyDao.insertBatch(data.getRegGridDailyList()); - + Integer delNum; + do { + delNum = regUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getRegGridDailyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + regUserGridDailyDao.insertBatch(p); + }); } if(null != data.getRegGridMonthlyList() && data.getRegGridMonthlyList().size() > NumConstant.ZERO){ - - regUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); - regUserGridMonthlyDao.insertBatch(data.getRegGridMonthlyList()); - + Integer delNum; + do { + delNum = regUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + }while (delNum > NumConstant.ZERO && delNum == NumConstant.ONE_THOUSAND); + List> partition = ListUtils.partition(data.getRegGridMonthlyList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + regUserGridMonthlyDao.insertBatch(p); + }); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 6cfcc8e89e..c154ead20b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -17,11 +17,7 @@ import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.form.GmUploadEventFormDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; -import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; -import com.epmet.dto.user.result.StaffRoleInfoDTO; -import com.epmet.dto.user.result.CustomerStaffDTO; -import com.epmet.dto.user.result.StaffPatrolRecordResult; -import com.epmet.dto.user.result.StatsStaffPatrolRecordDailyDTO; +import com.epmet.dto.user.result.*; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.service.user.UserService; import com.epmet.util.DimIdGenerator; @@ -120,14 +116,16 @@ public class UserServiceImpl implements UserService { if(null != agencyMap && agencyMap.size() > NumConstant.ZERO){ agencyMap.forEach((agencyId,v) -> { if(null != v && v.size() > NumConstant.ZERO){ - queryUserData(ModuleConstant.DIM_BELONGING_GRID, + /*queryUserData(ModuleConstant.DIM_BELONGING_GRID, agencyId, // v.get(NumConstant.ZERO).getPid(), v.get(NumConstant.ZERO).getCustomerId(), new HashSet<>(v.get(NumConstant.ZERO).getGridIds()), targetDate, dataPacket, - timeDimension); + timeDimension);*/ + traverseGridUserDispose(agencyId,v.get(NumConstant.ZERO).getCustomerId(),new HashSet<>(v.get(NumConstant.ZERO).getGridIds()) + ,targetDate,dataPacket,timeDimension); } }); } @@ -709,6 +707,244 @@ public class UserServiceImpl implements UserService { } + /** + * @Description + * @Param agencyId 组织ID + * @Param customerId 客户ID + * @Param gridIds 网格IDS + * @Param targetDate dateId 日期 eg:2021-07-27 + * @Param dataPacket 数据包 + * @Param timeDimension 日期维度 + * @author zxc + * @date 2021/7/27 9:53 上午 + */ + void traverseGridUserDispose(String agencyId,String customerId, Set gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){ + if (CollectionUtils.isEmpty(gridIds)){ + return; + } + dataPacket.setCustomerId(customerId); + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + Calendar calendar = Calendar.getInstance(); + //求出这个月的第一天 + calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); + //1.计算机关下注册用户一个时间单位内的累计与 [月增长,日增长] + List regData = userDao.selectResiTotalAndIncrByGridIds(ModuleConstant.REG_OR_PARTI_FLAG_REG, gridIds, targetDate,calendar.getTime()); + //2.查询注册用户的Id列表 + // 增长 + List incrRegUsers = userDao.selectIncrUserIdsByGrids(ModuleConstant.REG_OR_PARTI_FLAG_REG, gridIds, targetDate,calendar.getTime()); + List incrDailyUserIds = new ArrayList<>(); + List incrMonthlyUserIds = new ArrayList<>(); + if (!CollectionUtils.isEmpty(incrRegUsers)){ + // 月增长 和 日增长 分开 + Map> groupByType = incrRegUsers.stream().collect(Collectors.groupingBy(IncrAndTotalUserIdsResultDTO::getType)); + if (!CollectionUtils.isEmpty(groupByType.get(ModuleConstant.DAILY))){ + groupByType.get(ModuleConstant.DAILY).forEach(d -> { + if (!CollectionUtils.isEmpty(d.getUserIds())){ + // 日增长 + incrDailyUserIds.addAll(d.getUserIds()); + } + }); + } + if (!CollectionUtils.isEmpty(groupByType.get(ModuleConstant.MONTHLY))){ + groupByType.get(ModuleConstant.MONTHLY).forEach(m -> { + if (!CollectionUtils.isEmpty(m.getUserIds())){ + // 月增长 + incrMonthlyUserIds.addAll(m.getUserIds()); + } + }); + } + } + // 全部 + List totalRegUsers = userDao.selectTotalUserIdsByGrids(ModuleConstant.REG_OR_PARTI_FLAG_REG, gridIds, targetDate); + List totalUserIds = new ArrayList<>(); + if (!CollectionUtils.isEmpty(totalRegUsers)){ + totalRegUsers.forEach(t -> { + if (!CollectionUtils.isEmpty(t.getUserIds())){ + totalUserIds.addAll(t.getUserIds()); + } + }); + } + //3.查询机关下一个时间单位内热心居民的累计与增量(注册用户) + List warmRegData = userDao.selectWarmTotalAndIncrByGrids(totalUserIds, incrDailyUserIds, gridIds, targetDate,calendar.getTime(),incrMonthlyUserIds); + //4.查询机关下一个时间单位内党员的累计与增量(注册用户) + List partyRegData = userDao.selectPartyTotalAndIncrNew(targetDate, ModuleConstant.REG_OR_PARTI_FLAG_REG,calendar.getTime()); + + //参与用户 + //1.计算机关下参与用户一个时间单位内的累计与 [月增长,日增长] + List partiData = userDao.selectResiTotalAndIncrByGridIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI, gridIds, targetDate,calendar.getTime()); + //2.查询参与用户的Id列表[增长] + List incrPartiUsers = userDao.selectIncrUserIdsByGrids(ModuleConstant.REG_OR_PARTI_FLAG_PARTI, gridIds, targetDate, calendar.getTime()); + List incrDailyPartiUserIds = new ArrayList<>(); + List incrMonthlyPartiUserIds = new ArrayList<>(); + if (!CollectionUtils.isEmpty(incrPartiUsers)){ + // 月增长 和 天增长 分开 + Map> groupByType = incrRegUsers.stream().collect(Collectors.groupingBy(IncrAndTotalUserIdsResultDTO::getType)); + if (!CollectionUtils.isEmpty(groupByType.get(ModuleConstant.DAILY))){ + groupByType.get(ModuleConstant.DAILY).forEach(d -> { + if (!CollectionUtils.isEmpty(d.getUserIds())){ + // 日增长 + incrDailyPartiUserIds.addAll(d.getUserIds()); + } + }); + } + if (!CollectionUtils.isEmpty(groupByType.get(ModuleConstant.MONTHLY))){ + groupByType.get(ModuleConstant.MONTHLY).forEach(m -> { + if (!CollectionUtils.isEmpty(m.getUserIds())){ + // 月增长 + incrMonthlyPartiUserIds.addAll(m.getUserIds()); + } + }); + } + } + // 查询参与用户的Id列表[全部] + List totalPartiUsers = userDao.selectTotalUserIdsByGrids(ModuleConstant.REG_OR_PARTI_FLAG_PARTI, gridIds, targetDate); + List totalPartiUserIds = new ArrayList<>(); + if (!CollectionUtils.isEmpty(totalPartiUsers)){ + totalPartiUsers.forEach(t -> { + if (!CollectionUtils.isEmpty(t.getUserIds())){ + totalPartiUserIds.addAll(t.getUserIds()); + } + }); + } + //3.查询机关下一个时间单位内热心居民的累计与增量(参与用户) + List warmPartiData = userDao.selectWarmTotalAndIncrByGrids(totalPartiUserIds, incrDailyPartiUserIds, gridIds, targetDate,calendar.getTime(),incrMonthlyPartiUserIds); + //4.查询机关下一个时间单位内党员的累计与增量(参与用户) + List partyPartiData = userDao.selectPartyTotalAndIncrNew(targetDate, ModuleConstant.REG_OR_PARTI_FLAG_PARTI,calendar.getTime()); + + /** ==================== *开始组装数据* ==================== **/ + gridIds.forEach(gridId -> { + //注册用户网格级别 + FactRegUserGridDailyDTO regGridD = new FactRegUserGridDailyDTO(); + regGridD.setCustomerId(customerId); + regGridD.setGridId(gridId); + regGridD.setAgencyId(agencyId); + regGridD.setDateId(timeDimension.getDateId()); + regGridD.setWeekId(timeDimension.getWeekId()); + regGridD.setYearId(timeDimension.getYearId()); + regGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + regGridD.setResiProportion(new BigDecimal(NumConstant.ONE)); + //参与用户网格级别 + FactParticipationUserGridDailyDTO partiGridD = new FactParticipationUserGridDailyDTO(); + partiGridD.setCustomerId(customerId); + partiGridD.setGridId(gridId); + partiGridD.setAgencyId(agencyId); + partiGridD.setDateId(timeDimension.getDateId()); + partiGridD.setWeekId(timeDimension.getWeekId()); + partiGridD.setYearId(timeDimension.getYearId()); + partiGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + partiGridD.setResiProportion(new BigDecimal(NumConstant.ONE)); + FactRegUserGridMonthlyDTO regGridM = new FactRegUserGridMonthlyDTO(); + regGridM.setCustomerId(customerId); + regGridM.setGridId(gridId); + regGridM.setAgencyId(agencyId); + regGridM.setMonthId(timeDimension.getMonthId()); + regGridM.setQuarterId(timeDimension.getQuarterId()); + regGridM.setYearId(timeDimension.getYearId()); + regGridM.setPartymemberProportion(regGridD.getPartymemberProportion()); + regGridM.setWarmHeartedProportion(regGridD.getWarmHeartedProportion()); + regGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + regGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + FactParticipationUserGridMonthlyDTO partiGridM = new FactParticipationUserGridMonthlyDTO(); + partiGridM.setCustomerId(customerId); + partiGridM.setGridId(gridId); + partiGridM.setAgencyId(agencyId); + partiGridM.setMonthId(timeDimension.getMonthId()); + partiGridM.setQuarterId(timeDimension.getQuarterId()); + partiGridM.setYearId(timeDimension.getYearId()); + partiGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + partiGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + if (!CollectionUtils.isEmpty(regData)){ + for (TotalAndIncrResultDTO r : regData) { + if (gridId.equals(r.getGridId())){ + regGridD.setResiTotal(r.getTotal()); + regGridD.setRegTotal(r.getTotal()); + regGridD.setRegIncr(r.getDailyIncr()); + regGridM.setRegTotal(r.getTotal()); + regGridM.setResiTotal(r.getTotal()); + regGridM.setRegIncr(r.getMonthlyIncr()); + break; + } + } + } + if (!CollectionUtils.isEmpty(warmRegData)){ + for (WarmTotalAndIncrResultDTO w : warmRegData) { + if (gridId.equals(w.getGridId())){ + regGridD.setWarmHeartedTotal(w.getTotal()); + regGridD.setWarmIncr(w.getDailyIncr()); + regGridM.setWarmHeartedTotal(w.getTotal()); + regGridM.setWarmIncr(w.getMonthlyIncr()); + break; + } + } + } + if (!CollectionUtils.isEmpty(partiData)){ + for (TotalAndIncrResultDTO p : partiData) { + if (gridId.equals(p.getGridId())){ + partiGridD.setResiTotal(p.getTotal()); + partiGridD.setRegTotal(p.getTotal()); + partiGridD.setRegIncr(p.getDailyIncr()); + partiGridM.setRegTotal(p.getTotal()); + partiGridM.setResiTotal(p.getTotal()); + partiGridM.setRegIncr(p.getMonthlyIncr()); + break; + } + } + } + if (!CollectionUtils.isEmpty(partyRegData)){ + for (PartyTotalAndIncrResultDTO p : partyRegData) { + if (gridId.equals(p.getGridId())){ + regGridD.setPartymemberTotal(p.getTotal()); + regGridD.setPartymemberIncr(p.getDailyIncr()); + regGridM.setPartymemberTotal(p.getTotal()); + regGridM.setPartymemberIncr(p.getMonthlyIncr()); + regGridM.setPartymemberTotal(p.getTotal()); + regGridM.setPartymemberIncr(p.getMonthlyIncr()); + break; + } + } + } + if (!CollectionUtils.isEmpty(warmPartiData)){ + for (WarmTotalAndIncrResultDTO w : warmPartiData) { + if (gridId.equals(w.getGridId())){ + partiGridD.setWarmHeartedTotal(w.getTotal()); + partiGridD.setWarmIncr(w.getDailyIncr()); + partiGridM.setWarmHeartedTotal(w.getTotal()); + partiGridM.setWarmIncr(w.getMonthlyIncr()); + break; + } + } + } + if (!CollectionUtils.isEmpty(partyPartiData)){ + for (PartyTotalAndIncrResultDTO p : partyPartiData) { + if (gridId.equals(p.getGridId())){ + partiGridD.setPartymemberTotal(p.getTotal()); + partiGridD.setPartymemberIncr(p.getDailyIncr()); + partiGridM.setPartymemberTotal(p.getTotal()); + partiGridM.setPartymemberIncr(p.getMonthlyIncr()); + break; + } + } + } + regGridD.setPartymemberProportion(regGridD.getRegTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)regGridD.getPartymemberTotal()/(float)regGridD.getRegTotal()))); + regGridD.setWarmHeartedProportion(regGridD.getRegTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)regGridD.getWarmHeartedTotal()/(float)regGridD.getRegTotal()))); + partiGridD.setPartymemberProportion(partiGridD.getPartymemberTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partiGridD.getPartymemberTotal()/(float)partiGridD.getRegTotal() ))); + partiGridD.setWarmHeartedProportion(partiGridD.getPartymemberTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partiGridD.getWarmHeartedTotal()/(float)partiGridD.getRegTotal() ))); + regGridM.setPartymemberProportion(regGridD.getPartymemberProportion()); + regGridM.setWarmHeartedProportion(regGridD.getWarmHeartedProportion()); + partiGridM.setPartymemberProportion(partiGridD.getPartymemberProportion()); + partiGridM.setWarmHeartedProportion(partiGridD.getWarmHeartedProportion()); + dataPacket.getRegGridDailyList().add(regGridD); + dataPacket.getPartiGridDailyList().add(partiGridD); + dataPacket.getRegGridMonthlyList().add(regGridM); + dataPacket.getPartiGridMonthlyList().add(partiGridM); + }); + + } /** * @return java.util.List diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java index 1881ed5c77..8b06b9688b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -43,4 +43,8 @@ public interface ModuleConstant { String TOPIC_STATUS_SHIFT_ISSUE = "shift_issue"; String NEED_UPDATE_STATUS_TOPIC = "needUpdateStatusTopic"; + + String MONTHLY = "monthly"; + + String DAILY = "daily"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 7b4c669324..0f3e92b1d6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -74,6 +74,7 @@ WHERE date_id = #{dateId} AND customer_id = #{customerId} + limit 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml index f23abdcbf1..b59659027a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml @@ -100,6 +100,7 @@ AND CUSTOMER_ID = #{customerId} + LIMIT 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml index 7215527ed6..3ff5542f39 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml @@ -100,6 +100,7 @@ AND CUSTOMER_ID = #{customerId} + LIMIT 1000 \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml index 30c5f5c39c..6777cfdbbe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -105,6 +105,7 @@ AND CUSTOMER_ID = #{customerId} + LIMIT 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml index cfe17cd854..e365dd1022 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml @@ -104,6 +104,7 @@ AND CUSTOMER_ID = #{customerId} + LIMIT 1000 \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml index 185a97da77..85baff9c08 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml @@ -100,6 +100,7 @@ AND CUSTOMER_ID = #{customerId} + LIMIT 1000 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml index 7d01629a99..f3a23413cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml @@ -100,6 +100,7 @@ AND CUSTOMER_ID = #{customerId} + LIMIT 1000 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DELETE FROM diff --git a/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-activiti/epmet-activiti-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-demo/epmet-demo-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-ext/epmet-ext-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-heart/epmet-heart-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-message/epmet-message-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java index ab1d289bf5..b293ae4478 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankListResultDTO.java @@ -30,6 +30,8 @@ public class ResiPointRankListResultDTO implements Serializable { * */ private Integer myRanking; + private String myHeadImgUrl; + /** * 积分排名列表 * */ diff --git a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java index ee551db6e0..65fae629a4 100644 --- a/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java +++ b/epmet-module/epmet-point/epmet-point-client/src/main/java/com/epmet/dto/result/ResiPointRankingResultDTO.java @@ -20,4 +20,6 @@ public class ResiPointRankingResultDTO implements Serializable { private Integer point; + private String headImgUrl; + } diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java index 8b0b408d8a..10ed45500f 100644 --- a/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java +++ b/epmet-module/epmet-point/epmet-point-server/src/main/java/com/epmet/service/impl/UserPointStatisticalDailyServiceImpl.java @@ -146,6 +146,7 @@ public class UserPointStatisticalDailyServiceImpl extends BaseServiceImpl list = codeOperationHistoryService.getHistoryList(formDTO.getCustomerId(), formDTO.getClientType()); PageInfo pageInfo = new PageInfo<>(list); return new PageData<>(list, pageInfo.getTotal()); diff --git a/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/gov-access/gov-access-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java index 52b9d21b44..be67ff5a33 100644 --- a/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java +++ b/epmet-module/gov-grid/gov-grid-client/src/main/java/com/epmet/dto/form/RedDotFormDTO.java @@ -23,7 +23,7 @@ public class RedDotFormDTO implements Serializable { /** * 网格ID */ - @NotBlank(message = "网格id不能为空") + //@NotBlank(message = "网格id不能为空") private String gridId; } diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java index 49c0fb8129..a2916ee01c 100644 --- a/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java +++ b/epmet-module/gov-grid/gov-grid-server/src/main/java/com/epmet/service/impl/RemindServiceImpl.java @@ -14,6 +14,7 @@ import org.slf4j.LoggerFactory; 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.Collections; @@ -228,14 +229,20 @@ public class RemindServiceImpl implements RemindService { Result> groupResult = resiGroupFeignClient.queryGroupProcessingCount(gridIdList); if (groupResult.success() && !CollectionUtils.isEmpty(groupResult.getData())) { groupResult.getData().forEach(groupDto -> { - //当前网格 - if (formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) { + if (StringUtils.isEmpty(formDTO.getGridId())) { functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP); details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP, groupDto.getCount())); - } - //其他网格 - if (!formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) { - redDotResultDTO.setOtherGridRedDot(true); + redDotResultDTO.setOtherGridRedDot(false); + } else { + //当前网格 + if (formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP); + details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_GROUP, groupDto.getCount())); + } + //其他网格 + if (!formDTO.getGridId().equals(groupDto.getGridId()) && groupDto.getCount() > 0) { + redDotResultDTO.setOtherGridRedDot(true); + } } }); } @@ -244,14 +251,20 @@ public class RemindServiceImpl implements RemindService { Result> resiResult = resiPartymemberFeignClient.queryResiProcessingCount(gridIdList); if (resiResult.success() && !CollectionUtils.isEmpty(resiResult.getData())) { resiResult.getData().forEach(resiDto -> { - //当前网格 - if (formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) { + if (StringUtils.isEmpty(formDTO.getGridId())) { functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI); details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI, resiDto.getCount())); - } - //其他网格 - if (!formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) { - redDotResultDTO.setOtherGridRedDot(true); + redDotResultDTO.setOtherGridRedDot(false); + } else { + //当前网格 + if (formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI); + details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_RESI, resiDto.getCount())); + } + //其他网格 + if (!formDTO.getGridId().equals(resiDto.getGridId()) && resiDto.getCount() > 0) { + redDotResultDTO.setOtherGridRedDot(true); + } } }); } @@ -260,14 +273,20 @@ public class RemindServiceImpl implements RemindService { Result> partyResult = resiPartymemberFeignClient.queryPartyMemberProcessingCount(gridIdList); if (partyResult.success() && !CollectionUtils.isEmpty(partyResult.getData())) { partyResult.getData().forEach(partyDto -> { - //当前网格 - if (formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) { + if (StringUtils.isEmpty(formDTO.getGridId())) { functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH); details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH, partyDto.getCount())); - } - //其他网格 - if (!formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) { - redDotResultDTO.setOtherGridRedDot(true); + redDotResultDTO.setOtherGridRedDot(false); + } else { + //当前网格 + if (formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH); + details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_PARTYAUTH, partyDto.getCount())); + } + //其他网格 + if (!formDTO.getGridId().equals(partyDto.getGridId()) && partyDto.getCount() > 0) { + redDotResultDTO.setOtherGridRedDot(true); + } } }); } @@ -276,14 +295,20 @@ public class RemindServiceImpl implements RemindService { Result> issueResult = govIssueFeignClient.queryVotingIssueCount(gridIdList); if (issueResult.success() && !CollectionUtils.isEmpty(issueResult.getData())) { issueResult.getData().forEach(issueDto -> { - //当前网格 - if (formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) { + if (StringUtils.isEmpty(formDTO.getGridId())) { functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE); details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE, issueDto.getCount())); - } - //其他网格 - if (!formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) { - redDotResultDTO.setOtherGridRedDot(true); + redDotResultDTO.setOtherGridRedDot(false); + } else { + //当前网格 + if (formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE); + details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_ISSUE, issueDto.getCount())); + } + //其他网格 + if (!formDTO.getGridId().equals(issueDto.getGridId()) && issueDto.getCount() > 0) { + redDotResultDTO.setOtherGridRedDot(true); + } } }); } @@ -292,14 +317,21 @@ public class RemindServiceImpl implements RemindService { Result> badgeResult = epmetUserOpenFeignClient.queryGridAuditingBadgeCount(gridIdList); if (badgeResult.success() && !CollectionUtils.isEmpty(badgeResult.getData())) { badgeResult.getData().forEach(badgeDto -> { - //当前网格 - if (formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) { + + if (StringUtils.isEmpty(formDTO.getGridId())) { functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE); details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE, badgeDto.getCount())); - } - //其他网格 - if (!formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) { - redDotResultDTO.setOtherGridRedDot(true); + redDotResultDTO.setOtherGridRedDot(false); + } else { + //当前网格 + if (formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) { + functionList.add(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE); + details.add(new RedDotDetialDTO(WorkGrassRootsFunctionConstant.WORK_GRASSROOTS_BADGE, badgeDto.getCount())); + } + //其他网格 + if (!formDTO.getGridId().equals(badgeDto.getGridId()) && badgeDto.getCount() > 0) { + redDotResultDTO.setOtherGridRedDot(true); + } } }); } 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 20e21a4277..5e57fa2007 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 @@ -337,4 +337,8 @@ public interface GovIssueOpenFeignClient { */ @PostMapping(value = "/gov/issue/issueprojectcategorydict/getprojectcategory") Result> getProjectCategory(@RequestBody List list); + + + @PostMapping("/gov/issue/issue/unresolvedlist") + Result> getUnresolvedList(@RequestBody ShiftProjectListFromDTO formDTO); } 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 8bb48b0075..8bc43defbc 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 @@ -276,4 +276,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result> getProjectCategory(List list) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getProjectCategory", list); } + + @Override + public Result> getUnresolvedList(ShiftProjectListFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getUnresolvedList", formDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java index 4f1125b356..cec85e03e5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueController.java @@ -278,5 +278,11 @@ public class IssueController { return new Result>().ok(issueService.canEvaluateProjectCountBatch(issueIds)); } + + @PostMapping("unresolvedlist") + public Result> getUnresolvedList(@RequestBody ShiftProjectListFromDTO formDTO){ + return new Result>().ok(issueService.getUnResolvedList(formDTO)); + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java index e1f1e0f476..be1c4ee25b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueDao.java @@ -216,4 +216,13 @@ public interface IssueDao extends BaseDao { * @Date 2020/12/25 14:12 **/ List selectIssueRedDot(@Param("gridIdList") List gridIdList); + + /** + * 无需解决列表 + * @author zhaoqifeng + * @date 2021/7/27 16:52 + * @param gridId + * @return java.util.List + */ + List selectUnResolvedList(@Param("gridId") String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java index dd1eb23013..af7ec1b7a5 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueService.java @@ -341,4 +341,13 @@ public interface IssueService extends BaseService { * @date 2021/5/11 4:50 下午 */ List canEvaluateProjectCountBatch(List issueIds); + + /** + * 无需解决解决列表 + * @author zhaoqifeng + * @date 2021/7/27 16:58 + * @param fromDTO + * @return java.util.List + */ + List getUnResolvedList(ShiftProjectListFromDTO fromDTO); } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index b1f1701e75..1a131bb685 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -127,6 +127,8 @@ public class IssueServiceImpl extends BaseServiceImpl imp private IssueVoteDetailDao issueVoteDetailDao; @Autowired private EpmetMessageOpenFeignClient messageOpenFeignClient; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; @Value("${openapi.scan.server.url}") @@ -1507,4 +1509,46 @@ public class IssueServiceImpl extends BaseServiceImpl imp return result; } + /** + * 无需解决解决列表 + * + * @param fromDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/7/27 16:58 + */ + @Override + public List getUnResolvedList(ShiftProjectListFromDTO fromDTO) { + List resultList = new ArrayList<>(); + List issueList = baseDao.selectUnResolvedList(fromDTO.getGridId()); + if (CollectionUtils.isNotEmpty(issueList)) { + resultList.addAll(issueList); + } + List projectList = govProjectOpenFeignClient.getUnResolvedList(fromDTO).getData(); + if (CollectionUtils.isNotEmpty(projectList)) { + resultList.addAll(projectList); + } + if (CollectionUtils.isNotEmpty(resultList)) { + resultList = resultList.stream().sorted(Comparator.comparing(UnResolvedResultDTO::getClosedTime).reversed()).collect(Collectors.toList()); + int fromIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); + int toIndex = fromDTO.getPageNo() * fromDTO.getPageSize(); + if (fromIndex >= resultList.size()) { + return new ArrayList<>(); + } + if (toIndex > resultList.size()) { + toIndex = resultList.size(); + } + resultList = resultList.subList(fromIndex, toIndex); + } + return resultList; + } + + public static void main(String[] args) { + List list = new ArrayList<>(); + list.add("1"); + list.add("2"); + list.add("3"); + System.out.println(list.subList(0, 3)); + } + } diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml index 498d2ab252..f12b363cc7 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueDao.xml @@ -235,6 +235,7 @@ DEL_FLAG = '0' AND GRID_ID = #{gridId} AND ISSUE_STATUS = 'closed' + AND RESOLVE_TYPE = 'resolved' ORDER BY created_time DESC LIMIT #{pageNo}, @@ -561,4 +562,19 @@ GROUP BY temp.gridId + \ No newline at end of file diff --git a/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/gov-mine/gov-mine-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java deleted file mode 100644 index 064d2173ea..0000000000 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/OrgTreeNode.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.epmet.dto; - -import lombok.Data; - -import java.util.List; - -@Data -public class OrgTreeNode { - private String orgId; - private String orgName; - private String orgType; - private List subOrgs; -} diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java similarity index 100% rename from epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java rename to epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ShiftProjectListFromDTO.java diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java new file mode 100644 index 0000000000..7fe06f2dce --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PendingResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/7/27 10:47 + */ + +@NoArgsConstructor +@Data +public class PendingResultDTO implements Serializable { + + private static final long serialVersionUID = 2545519820222637112L; + private String issueId; + private String issueTitle; + private Long issueShiftedTime; + private String topicContent; + private List currentHandleDepartMent; + private List topicVoices; + private List topicImgs; + private String sourceId; + @JsonIgnore + private String projectId; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java new file mode 100644 index 0000000000..644a4d33cd --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ResolvedResultDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/7/27 13:55 + */ +@Data +public class ResolvedResultDTO implements Serializable { + private static final long serialVersionUID = -6670213622289052352L; + /** + * 议题Id + */ + private String issueId; + /** + * 议题标题 + */ + private String issueTitle; + /** + * 转成项目时间 + */ + private Long closedTime; + + /** + * 结案说明 + */ + private String publicReply; + + /** + * 来源id + */ + private String sourceId; + + /** + * 话题图片 + */ + private List topicImgs; + + /** + * 话题语音 + */ + private List topicVoices; + + /** + * 话题内容 + */ + private String topicContent; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java new file mode 100644 index 0000000000..f803df9fc6 --- /dev/null +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/UnResolvedResultDTO.java @@ -0,0 +1,53 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/7/27 10:31 + */ +@Data +public class UnResolvedResultDTO implements Serializable { + private static final long serialVersionUID = 3654271828450408782L; + /** + * 议题Id + */ + private String issueId; + /** + * 议题标题 + */ + private String issueTitle; + /** + * 转成项目时间 + */ + private Long closedTime; + + /** + * 结案说明 + */ + private String solution; + + /** + * 来源id + */ + private String sourceId; + + /** + * 话题图片 + */ + private List topicImgs; + + /** + * 话题语音 + */ + private List topicVoices; + + /** + * 话题内容 + */ + private String topicContent; +} diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java index 6d5c1d01ac..7b0c1a7bd9 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/GovProjectOpenFeignClient.java @@ -93,4 +93,35 @@ public interface GovProjectOpenFeignClient { */ @PostMapping("gov/project/project/patrolproject") Result selectPatrolProject(@RequestBody PatrolProjectFormDTO formDTO); + + + /** + * 获取待处理列表 + * @author zhaoqifeng + * @date 2021/7/27 14:55 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("gov/project/project/pendinglist") + Result> getPendingList(@RequestBody ShiftProjectListFromDTO formDTO); + + /** + * 已解决项目列表 + * @author zhaoqifeng + * @date 2021/7/27 14:55 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("gov/project/project/resolvedlist") + Result> getResolvedList(@RequestBody ShiftProjectListFromDTO formDTO); + + /** + * 无需解决项目列表 + * @author zhaoqifeng + * @date 2021/7/27 14:55 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("gov/project/project/unresolvedlist") + Result> getUnResolvedList(@RequestBody ShiftProjectListFromDTO formDTO); } diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java index d6a4661b96..44ea0d1e63 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/feign/fallback/GovProjectOpenFeignClientFallback.java @@ -80,4 +80,43 @@ public class GovProjectOpenFeignClientFallback implements GovProjectOpenFeignCli public Result selectPatrolProject(PatrolProjectFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "selectPatrolProject", formDTO); } + + /** + * 获取待处理列表 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2021/7/27 14:55 + */ + @Override + public Result> getPendingList(ShiftProjectListFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getPendingList", formDTO); + } + + /** + * 已解决项目列表 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2021/7/27 14:55 + */ + @Override + public Result> getResolvedList(ShiftProjectListFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getResolvedList", formDTO); + } + + /** + * 无需解决项目列表 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2021/7/27 14:55 + */ + @Override + public Result> getUnResolvedList(ShiftProjectListFromDTO formDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_PROJECT_SERVER, "getUnResolvedList", formDTO); + } } diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java index 1c1460b3cb..46de571a19 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectController.java @@ -234,4 +234,41 @@ public class ProjectController { return new Result().ok(projectService.selectPatrolProject(formDTO)); } + + /** + * 获取待处理列表 + * @author zhaoqifeng + * @date 2021/7/27 14:55 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("pendinglist") + public Result> getPendingList(@RequestBody ShiftProjectListFromDTO formDTO){ + return new Result>().ok(projectService.getPendingList(formDTO)); + } + + /** + * 已解决项目列表 + * @author zhaoqifeng + * @date 2021/7/27 14:55 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("resolvedlist") + public Result> getResolvedList(@RequestBody ShiftProjectListFromDTO formDTO){ + return new Result>().ok(projectService.getResolvedListByGrid(formDTO)); + } + + /** + * 无需解决项目列表 + * @author zhaoqifeng + * @date 2021/7/27 14:55 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("unresolvedlist") + public Result> getUnResolvedList(@RequestBody ShiftProjectListFromDTO formDTO){ + return new Result>().ok(projectService.getUnResolvedListByGrid(formDTO)); + } + } \ 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 38176df2ad..d5c2dbab5d 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 @@ -173,4 +173,37 @@ public interface ProjectDao extends BaseDao { * @date 2021/7/1 10:16 上午 */ Integer selectPatrolProject(PatrolProjectFormDTO formDTO); + + /** + * 获取党建声音处理中列表 + * @author zhaoqifeng + * @date 2021/7/27 10:28 + * @param gridId + * @param pageNo + * @param pageSize + * @return java.util.List + */ + List selectPendingListByGrid(@Param("gridId")String gridId, @Param("pageNo") Integer pageNo, + @Param("pageSize") Integer pageSize); + + /** + * 获取党建声音已结案列表 + * @author zhaoqifeng + * @date 2021/7/27 10:28 + * @param gridId + * @param pageNo + * @param pageSize + * @return java.util.List + */ + List selectResolvedListByGrid(@Param("gridId")String gridId, @Param("pageNo") Integer pageNo, + @Param("pageSize") Integer pageSize); + + /** + * 无需解决列表 + * @author zhaoqifeng + * @date 2021/7/27 14:38 + * @param gridId + * @return java.util.List + */ + List selectUnResolvedListByGrid(@Param("gridId")String gridId); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java index f04d8f050a..7a5ac21888 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java @@ -303,4 +303,31 @@ public interface ProjectService extends BaseService { * @date 2021/7/1 10:16 上午 */ Integer selectPatrolProject(PatrolProjectFormDTO formDTO); + + /** + * 获取待处理列表 + * @author zhaoqifeng + * @date 2021/7/27 14:18 + * @param fromDTO + * @return java.util.List + */ + List getPendingList(ShiftProjectListFromDTO fromDTO); + + /** + * 已解决项目列表 + * @author zhaoqifeng + * @date 2021/7/27 14:36 + * @param fromDTO + * @return java.util.List + */ + List getResolvedListByGrid(ShiftProjectListFromDTO fromDTO); + + /** + * 无需解决项目列表 + * @author zhaoqifeng + * @date 2021/7/27 14:40 + * @param fromDTO + * @return java.util.List + */ + List getUnResolvedListByGrid(ShiftProjectListFromDTO fromDTO); } \ No newline at end of file diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java index d721ccad51..f15a2a7c24 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java @@ -2706,4 +2706,51 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author zhaoqifeng + * @date 2021/7/27 14:18 + */ + @Override + public List getPendingList(ShiftProjectListFromDTO fromDTO) { + int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); + List list = baseDao.selectPendingListByGrid(fromDTO.getGridId(), pageIndex, fromDTO.getPageSize()); + list.forEach(item -> { + ProjectDTO dto = new ProjectDTO(); + dto.setId(item.getProjectId()); + item.setCurrentHandleDepartMent(baseDao.selectDepartmentNameList(dto)); + }); + return list; + } + + /** + * 已解决项目列表 + * + * @param fromDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/7/27 14:36 + */ + @Override + public List getResolvedListByGrid(ShiftProjectListFromDTO fromDTO) { + int pageIndex = (fromDTO.getPageNo() - NumConstant.ONE) * fromDTO.getPageSize(); + return baseDao.selectResolvedListByGrid(fromDTO.getGridId(), pageIndex, fromDTO.getPageSize()); + } + + /** + * 无需解决项目列表 + * + * @param fromDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/7/27 14:40 + */ + @Override + public List getUnResolvedListByGrid(ShiftProjectListFromDTO fromDTO) { + return baseDao.selectUnResolvedListByGrid(fromDTO.getGridId()); + } + } \ 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 265ef3bcc6..5940f47003 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 @@ -316,5 +316,67 @@ AND ORIGIN = 'agency' AND CREATED_BY = #{userId} + + + \ No newline at end of file diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java index f45707ee7b..62274c346b 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/ArticleServiceImpl.java @@ -588,7 +588,6 @@ public class ArticleServiceImpl extends BaseServiceImpl resultList; List roles = epmetUserOpenFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); @@ -612,12 +611,14 @@ public class ArticleServiceImpl extends BaseServiceImpl gridList = new HashSet<>(); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId(), formDTO.getTagIdList(), gridList); } else { Set gridList = new HashSet<>(); if (null != userInfo.getGridIdList()) { gridList = userInfo.getGridIdList(); } + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); resultList = baseDao.selectArticleListForAgency(tokenDto.getCustomerId(), formDTO.getTagIdList(), gridList); } resultList.forEach(result -> { @@ -632,8 +633,6 @@ public class ArticleServiceImpl extends BaseServiceImpl roles = epmetUserOpenFeignClient.getStaffRoles(tokenDto.getUserId()).getData(); LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); loginUserDetailsFormDTO.setApp(tokenDto.getApp()); @@ -656,9 +655,11 @@ public class ArticleServiceImpl extends BaseServiceImpl gridList = new HashSet<>(); + PageHelper.startPage(formDTO.getPageNo(), formDTO.getPageSize()); resultList = baseDao.selectOfflineList(gridList); } PageInfo pageInfo = new PageInfo<>(resultList); diff --git a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java index 4b53ba35e9..3667e35988 100644 --- a/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java +++ b/epmet-module/gov-voice/gov-voice-server/src/main/java/com/epmet/service/impl/SpecialSubjectServiceImpl.java @@ -209,6 +209,7 @@ public class SpecialSubjectServiceImpl extends BaseServiceImpl specialSubjectList = baseDao.selectList(wrapper); if (CollectionUtils.isNotEmpty(specialSubjectList)) { List tags = specialSubjectList.stream().map(SpecialSubjectEntity :: getTagId).distinct().collect(Collectors.toList()); + // 排除 list = list.stream().filter(item -> !tags.contains(item.getTagId())).collect(Collectors.toList()); } return list; @@ -291,9 +294,6 @@ public class SpecialSubjectServiceImpl extends BaseServiceImpl { PreviewResultDTO previewResultDTO = new PreviewResultDTO(); -// SpecialSubjectDTO subject = baseDao.getInfo(tagId); -// previewResultDTO.setSpecialSubjectId(subject.getId()); -// previewResultDTO.setTagName(subject.getTagName()); previewResultDTO.setArticleList(articleService.getArticleListByTag(tagId, (formDTO.getPageNo() - NumConstant.ONE) * formDTO.getPageSize(), formDTO.getPageSize())); result.add(previewResultDTO); diff --git a/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/oper-access/oper-access-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/FootBarPatternFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/FootBarPatternFormDTO.java new file mode 100644 index 0000000000..469e4e5cbc --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/FootBarPatternFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 17:21 + */ +@Data +public class FootBarPatternFormDTO implements Serializable { + private static final long serialVersionUID = 8607183484805804359L; + /** + * 产品配置:default; 客户定制化里面就传客户id + */ + @NotBlank(message = "customerId不能为空") + private String customerId; + /** + * 工作端:gov;居民端resi + */ + @NotBlank(message = "appType不能为空") + private String appType; + + /** + * 参数值含义:flat:水平模式;float:浮起某个菜单 + */ + @NotBlank(message = "pattern不能为空,参数值含义:flat:水平模式;float:浮起某个菜单") + private String pattern; +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/FootBarPatternQueryFormDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/FootBarPatternQueryFormDTO.java new file mode 100644 index 0000000000..da01d03505 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/form/FootBarPatternQueryFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 查询FootBar显示模式(产品配置+客户定制化通用) + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 16:40 + */ +@Data +public class FootBarPatternQueryFormDTO implements Serializable { + private static final long serialVersionUID = 2928030075406974562L; + /** + * 产品配置:default; 客户定制化里面就传客户id + */ + @NotBlank(message = "customerId不能为空") + private String customerId; + /** + * 工作端:gov;居民端resi + */ + @NotBlank(message = "appType不能为空") + private String appType; + +} diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/FootBarPatternQueryResultDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/FootBarPatternQueryResultDTO.java new file mode 100644 index 0000000000..ff513c15c2 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/result/FootBarPatternQueryResultDTO.java @@ -0,0 +1,23 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询FootBar显示模式(产品配置+客户定制化通用) + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 16:49 + */ +@Data +public class FootBarPatternQueryResultDTO implements Serializable { + private static final long serialVersionUID = -3185762444171339921L; + + /** + * 参数值含义:flat:水平模式;float:浮起某个菜单 + */ + private String pattern; + + private String customerId; +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index 30fe309079..032fab629a 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -34,6 +34,7 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.excel.CustomerExcel; import com.epmet.feign.GovOrgFeignClient; +import com.epmet.service.CustomerParameterService; import com.epmet.service.CustomerRelationService; import com.epmet.service.CustomerService; import com.epmet.service.CustomerThirdplatApiServiceService; @@ -70,6 +71,9 @@ public class CustomerController { @Autowired private CustomerThirdplatApiServiceService customerThirdplatApiServiceService; + @Autowired + private CustomerParameterService customerParameterService; + @GetMapping("page") public Result> page(@RequestParam Map params) { @@ -393,4 +397,33 @@ public class CustomerController { } return new Result<>(); } + + /** + * 查询FootBar显示模式(产品配置+客户定制化通用) + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/7/27 16:54 + */ + @PostMapping("footbarpattern") + public Result queryFootBarPattern(@RequestBody FootBarPatternQueryFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(customerParameterService.queryFootBarPattern(formDTO)); + } + + /** + * ??? + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/7/27 17:24 + */ + @PostMapping("savefootbarpattern") + public Result saveFootBarPattern(@RequestBody FootBarPatternFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO); + customerParameterService.saveFootBarPattern(formDTO); + return new Result(); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerParameterDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerParameterDao.java index 5d11da7f96..ac78d17ef6 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerParameterDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerParameterDao.java @@ -31,4 +31,15 @@ public interface CustomerParameterDao extends BaseDao { * @date 2021/1/4 下午4:12 */ void updateParamInfo(@Param("formDTOS")List formDTOS); + + /** + * 查询FootBar显示模式(产品配置+客户定制化通用) + * + * @param parameterKey + * @param customerId + * @return java.lang.String + * @author yinzuomei + * @date 2021/7/27 17:07 + */ + CustomerParameterEntity selectAppFootBarPattern(@Param("parameterKey")String parameterKey, @Param("customerId")String customerId); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java index 4ab868a9c1..4ff8119c79 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerParameterService.java @@ -1,7 +1,10 @@ package com.epmet.service; import com.epmet.dto.form.CrmParameterFormDTO; +import com.epmet.dto.form.FootBarPatternFormDTO; +import com.epmet.dto.form.FootBarPatternQueryFormDTO; import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.dto.result.FootBarPatternQueryResultDTO; import java.util.List; @@ -27,4 +30,23 @@ public interface CustomerParameterService { */ void updateParamInfo(List formDTOS); + /** + * 查询FootBar显示模式(产品配置+客户定制化通用) + * + * @param formDTO + * @return com.epmet.dto.result.FootBarPatternQueryResultDTO + * @author yinzuomei + * @date 2021/7/27 16:58 + */ + FootBarPatternQueryResultDTO queryFootBarPattern(FootBarPatternQueryFormDTO formDTO); + + /** + * ???? + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/7/27 17:24 + */ + void saveFootBarPattern(FootBarPatternFormDTO formDTO); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java index 001fab6aff..f00c91d57e 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerParameterServiceImpl.java @@ -1,9 +1,20 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.Constant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerParameterDao; +import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CrmParameterFormDTO; +import com.epmet.dto.form.FootBarPatternFormDTO; +import com.epmet.dto.form.FootBarPatternQueryFormDTO; +import com.epmet.dto.result.CheckFloatFootBarResultDTO; import com.epmet.dto.result.CrmParameterResultDTO; +import com.epmet.dto.result.FootBarPatternQueryResultDTO; +import com.epmet.entity.CustomerParameterEntity; +import com.epmet.feign.OperCustomizeOpenFeignClient; import com.epmet.service.CustomerParameterService; +import com.epmet.service.CustomerService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -23,6 +34,10 @@ public class CustomerParameterServiceImpl implements CustomerParameterService { @Autowired private CustomerParameterDao parameterDao; + @Autowired + private CustomerService customerService; + @Autowired + private OperCustomizeOpenFeignClient operCustomizeOpenFeignClient; /** * @Description 查询客户配置信息 @@ -54,4 +69,80 @@ public class CustomerParameterServiceImpl implements CustomerParameterService { if (CollectionUtils.isEmpty(formDTOS))return; parameterDao.updateParamInfo(formDTOS); } + + /** + * 查询FootBar显示模式(产品配置+客户定制化通用) + * + * @param formDTO + * @return com.epmet.dto.result.FootBarPatternQueryResultDTO + * @author yinzuomei + * @date 2021/7/27 16:58 + */ + @Override + public FootBarPatternQueryResultDTO queryFootBarPattern(FootBarPatternQueryFormDTO formDTO) { + String parameterKey=formDTO.getAppType().concat(Constant.FOOTBAR_PATTERN_KEY_SUFFIX); + CustomerParameterEntity pattern=parameterDao.selectAppFootBarPattern(parameterKey,formDTO.getCustomerId()); + if (null == pattern){ + pattern = parameterDao.selectAppFootBarPattern(parameterKey, Constant.DEFAULT_CUSTOMER); + } + FootBarPatternQueryResultDTO resultDTO=new FootBarPatternQueryResultDTO(); + resultDTO.setPattern(pattern.getParameterValue()); + resultDTO.setCustomerId(formDTO.getCustomerId()); + return resultDTO; + } + + /** + * ???? + * + * @param formDTO + * @return void + * @author yinzuomei + * @date 2021/7/27 17:24 + */ + @Override + public void saveFootBarPattern(FootBarPatternFormDTO formDTO) { + //1、客户不存在 + if (!Constant.DEFAULT_CUSTOMER.equals(formDTO.getCustomerId()) && null == customerService.get(formDTO.getCustomerId())) { + throw new RenException("客户信息不存在"); + } + // 2、如果选择的浮起,只有footbar为奇数+并且3个图标路径全部上传才可以配置浮起模式 + if (Constant.FOOT_BAR_FLOAT.equals(formDTO.getPattern())) { + CheckFloatFootBarFormDTO checkFloatFootBarFormDTO = new CheckFloatFootBarFormDTO(); + checkFloatFootBarFormDTO.setCustomerId(formDTO.getCustomerId()); + checkFloatFootBarFormDTO.setAppType(formDTO.getAppType()); + Result customizeResult = operCustomizeOpenFeignClient.checkFloatFootBar(checkFloatFootBarFormDTO); + if (!customizeResult.success() && null == customizeResult.getData()) { + throw new RenException("查询客户footbar信息异常"); + } + if(!customizeResult.getData().getIsOddNum()){ + //运营端错误信息是怎么显示的? + throw new RenException("只有footbar个数为奇数时,才可以选择此模式"); + } + if(!customizeResult.getData().getBothUploaded()){ + throw new RenException("请先上传footbar图标,全部上传后才可以选择此模式"); + } + } + //3、符合条件,更新或者插入 + String parameterKey = formDTO.getAppType().concat(Constant.FOOTBAR_PATTERN_KEY_SUFFIX); + CustomerParameterEntity original = parameterDao.selectAppFootBarPattern(parameterKey, formDTO.getCustomerId()); + if (null != original) { + original.setParameterValue(formDTO.getPattern()); + parameterDao.updateById(original); + } else { + CustomerParameterEntity defaultCustomer = parameterDao.selectAppFootBarPattern(parameterKey, Constant.DEFAULT_CUSTOMER); + if(null==defaultCustomer){ + throw new RenException(String.format("系统异常,%产品没有配置默认值",parameterKey)); + } + CustomerParameterEntity insertEntity = new CustomerParameterEntity(); + insertEntity.setCustomerId(formDTO.getCustomerId()); + insertEntity.setParameterKey(parameterKey); + insertEntity.setParameterName(defaultCustomer.getParameterName()); + insertEntity.setParameterSwitch(defaultCustomer.getParameterSwitch()); + insertEntity.setParameterValue(formDTO.getPattern()); + insertEntity.setDescription(defaultCustomer.getDescription()); + parameterDao.insert(insertEntity); + } + } + + } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.8__insert_footbar_parameter.sql b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.8__insert_footbar_parameter.sql new file mode 100644 index 0000000000..5a0491e249 --- /dev/null +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/db/migration/V0.0.8__insert_footbar_parameter.sql @@ -0,0 +1,4 @@ +INSERT INTO `epmet_oper_crm`.`customer_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_SWITCH`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('cf4ea9c6eeb011eb89b70050568f8cf7', 'default', 'gov_footbar_pattern', '工作端footbar显示样式', 'on', 'flat', '参数值含义:flat:水平模式;float:浮起某个菜单', 0, 0, 'yinzuomei', '2021-07-27 16:04:53', 'yinzuomei', '2021-07-27 16:04:56'); +INSERT INTO `epmet_oper_crm`.`customer_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_SWITCH`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('1e398325eeb111eb89b70050568f8cf7', 'default', 'resi_footbar_pattern', '居民端footbar显示样式', 'on', 'flat', '参数值含义: flat:水平模式;float:浮起某个菜单。', 0, 0, 'yinzuomei', '2021-07-27 16:05:46', 'yinzuomei', '2021-07-27 16:05:51'); +INSERT INTO `epmet_oper_crm`.`customer_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_SWITCH`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('c7baa378eeb111eb89b70050568f8cf7', 'default', 'gov_footbar_highlight_num', '工作端footbar为水平模式时,第几个凸起?现在默认是0', 'on', '0', '工作端footbar为水平模式时,第几个凸起?现在默认是0', 0, 0, 'yinzuomei', '2021-07-27 16:12:46', 'yinzuomei', '2021-07-27 16:12:51'); +INSERT INTO `epmet_oper_crm`.`customer_parameter`(`ID`, `CUSTOMER_ID`, `PARAMETER_KEY`, `PARAMETER_NAME`, `PARAMETER_SWITCH`, `PARAMETER_VALUE`, `DESCRIPTION`, `DEL_FLAG`, `REVISION`, `CREATED_BY`, `CREATED_TIME`, `UPDATED_BY`, `UPDATED_TIME`) VALUES ('35d14ac1eeb211eb89b70050568f8cf7', 'default', 'resi_footbar_highlight_num', '居民端footbar为水平模式时,第几个凸起?现在默认是0', 'on', '0', '居民端footbar为水平模式时,第几个凸起?现在默认是0', 0, 0, 'yinzuomei', '2021-07-27 16:14:43', 'yinzuomei', '2021-07-27 16:14:49'); diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml index 2a5c38a13d..e1208d3855 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml +++ b/epmet-module/oper-crm/oper-crm-server/src/main/resources/mapper/CustomerParameterDao.xml @@ -30,4 +30,14 @@ AND PARAMETER_KEY = #{formDTO.parameterKey} + + + \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java index 9a33b3161d..b8b6280610 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/CustomerFootBarDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -100,4 +101,10 @@ public class CustomerFootBarDTO implements Serializable { private Boolean display; + /** + * 浮起时图标 + */ + private String floatIconPath; + + private String customerId; } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CheckFloatFootBarFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CheckFloatFootBarFormDTO.java new file mode 100644 index 0000000000..499d0ecddd --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CheckFloatFootBarFormDTO.java @@ -0,0 +1,28 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 校验当前客户是否可以选择浮起footbar模式 + * 只有奇数并且3个图标都上传的才可以 + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 17:56 + */ +@Data +public class CheckFloatFootBarFormDTO implements Serializable { + private static final long serialVersionUID = 3202974977135976455L; + /** + * 传客户id + */ + @NotBlank(message = "customerId不能为空") + private String customerId; + /** + * 工作端:gov;居民端resi + */ + @NotBlank(message = "appType不能为空") + private String appType; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java index d5981860fd..01886698a8 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/CustomerFootBarFormDTO.java @@ -14,6 +14,9 @@ public class CustomerFootBarFormDTO { // 创建footbar的分组 public interface CreateFootBarGroup extends CustomerClientShowGroup {} + //产品配置-添加footbar时,3个icon必填 + public interface DefaultCustomerCreateFootBarGroup extends CustomerClientShowGroup {} + // 查询footbar列表分组 public interface ListFootBarGroup extends CustomerClientShowGroup {} @@ -41,7 +44,7 @@ public class CustomerFootBarFormDTO { @NotBlank(message = "FootBar的ID不能为空", groups = { UpdateFootBarGroup.class, FootBarDetailGroup.class, UpdateDisplayStatusGroup.class, DeleteFootbarsGroup.class }) private String id; - @NotBlank(message = "客户ID不能为空", groups = { CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class }) + @NotBlank(message = "客户ID不能为空", groups = { CreateFootBarGroup.class, AddDefaultFootbars4Customer.class, ListFootBarGroup4Oper.class , DeleteFootbarsGroup.class}) private String customerId; // 哪一个端:gov,resi @@ -51,17 +54,19 @@ public class CustomerFootBarFormDTO { @NotBlank(message = "名称不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class }) private String barName; - @NotBlank(message = "key不能为空", groups = { CreateFootBarGroup.class }) + @NotBlank(message = "key不能为空", groups = { CreateFootBarGroup.class , DeleteFootbarsGroup.class}) private String barKey; @NotBlank(message = "页面标题不能为空", groups = { CreateFootBarGroup.class, UpdateFootBarGroup.class }) private String pageTitle; - //@NotBlank(message = "图标路径不能为空", groups = { UpdateFootBarGroup.class }) + @NotBlank(message = "图标路径不能为空", groups = {DefaultCustomerCreateFootBarGroup.class}) private String iconPath; - //@NotBlank(message = "选中的图标路径不能为空", groups = { UpdateFootBarGroup.class }) + @NotBlank(message = "选中的图标路径不能为空", groups = {DefaultCustomerCreateFootBarGroup.class}) private String selectedIconPath; + @NotBlank(message = "浮起时图标不能为空", groups = {DefaultCustomerCreateFootBarGroup.class}) + private String floatIconPath; @NotEmpty(message = "顺序不能为空", groups = { SaveOrderGroup.class }) private List orderList; @@ -69,6 +74,8 @@ public class CustomerFootBarFormDTO { @NotNull(message = "显示状态不能为空", groups = { UpdateDisplayStatusGroup.class }) private Boolean display; + @NotBlank(message = "操作人id不能为空", groups = {DeleteFootbarsGroup.class, SaveOrderGroup.class, UpdateDisplayStatusGroup.class}) + private String userId; /** * 排序索引号dto */ diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/NotOnlineFootBarFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/NotOnlineFootBarFormDTO.java new file mode 100644 index 0000000000..8a2f70dada --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/NotOnlineFootBarFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 客户定制化-FootBar配置,获取当前客户未上线的 + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/28 9:39 + */ +@Data +public class NotOnlineFootBarFormDTO implements Serializable { + private static final long serialVersionUID = -4103181048360051521L; + @NotBlank(message = "客户id不能为空") + private String customerId; + @NotBlank(message = "appType不能为空") + private String appType; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SyncFootBar4CustomerFormDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SyncFootBar4CustomerFormDTO.java new file mode 100644 index 0000000000..1662bd2928 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/form/SyncFootBar4CustomerFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 客户定制化-同步footbar + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/28 15:21 + */ +@Data +public class SyncFootBar4CustomerFormDTO implements Serializable { + private static final long serialVersionUID = 8879950597580438204L; + @NotBlank(message = "customerId不能为空") + private String customerId; + @NotBlank(message = "appType不能为空") + private String appType; + private List syncBarKeyList; + private List addBarKeyList; + + @NotBlank(message = "操作用户不能为空") + private String userId; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CheckFloatFootBarResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CheckFloatFootBarResultDTO.java new file mode 100644 index 0000000000..cb8dff7688 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CheckFloatFootBarResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 校验当前客户是否可以选择浮起footbar模式 + * 只有奇数并且3个图标都上传的才可以 + * + * @author yinzuomei@elink-cn.com + * @date 2021/7/27 17:56 + */ +@Data +public class CheckFloatFootBarResultDTO implements Serializable { + private static final long serialVersionUID = 8205326079938200511L; + + /** + * 是否是奇数,true:是奇数 + */ + private Boolean isOddNum; + + /** + * 是否都上传了图标,true:都上传了 + */ + private Boolean bothUploaded; +} diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java index c517c835ad..373d5df5fa 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/dto/result/CustomerFootBarResultDTO.java @@ -68,6 +68,11 @@ public class CustomerFootBarResultDTO implements Serializable { */ private String selectedIconPath; + /** + * 浮起时图标 + */ + private String floatIconPath; + /** * 删除标识:0.未删除 1.已删除 */ @@ -105,6 +110,10 @@ public class CustomerFootBarResultDTO implements Serializable { private String defaultIconPath; private String defaultSelectedIconPath; + /** + * 浮起时图标-产品默认 + */ + private String defaultFloatIconPath; private String defaultPageTitle; diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java index 7674dbc437..fd56957265 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/OperCustomizeOpenFeignClient.java @@ -1,7 +1,9 @@ package com.epmet.feign; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallbackFactory; import org.springframework.cloud.openfeign.FeignClient; @@ -9,13 +11,9 @@ import org.springframework.cloud.openfeign.FeignClient; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CustomerFunctionListFormDTO; +import com.epmet.dto.result.CheckFloatFootBarResultDTO; import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.fallback.OperCustomizeOpenFeignClientFallback; -import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import java.util.List; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.http.MediaType; import org.springframework.web.bind.annotation.PostMapping; @@ -37,4 +35,16 @@ public interface OperCustomizeOpenFeignClient { @PostMapping(value = "/oper/customize/customerfunction/getOpenedFunctionList", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) Result> getOpenedFunctionList(@RequestBody CustomerFunctionListFormDTO formDTO); + + /** + * 校验当前客户是否可以选择浮起footbar模式 + * 只有奇数并且3个图标都上传的才可以 + * + * @param checkFloatFootBarFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/7/27 18:06 + */ + @PostMapping(value = "/oper/customize/customerfootbar/checkfloatfootbar", consumes = MediaType.APPLICATION_JSON_UTF8_VALUE) + Result checkFloatFootBar(@RequestBody CheckFloatFootBarFormDTO checkFloatFootBarFormDTO); } diff --git a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java index 3e4664048d..2fe50e5c9f 100644 --- a/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java +++ b/epmet-module/oper-customize/oper-customize-client/src/main/java/com/epmet/feign/fallback/OperCustomizeOpenFeignClientFallback.java @@ -4,11 +4,10 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; -import com.epmet.commons.tools.constant.ServiceConstant; -import com.epmet.commons.tools.utils.ModuleUtils; -import com.epmet.commons.tools.utils.Result; import com.epmet.dto.form.CustomerFunctionListFormDTO; +import com.epmet.dto.result.CheckFloatFootBarResultDTO; import com.epmet.dto.result.DefaultFunctionListResultDTO; import com.epmet.feign.OperCustomizeOpenFeignClient; import org.springframework.stereotype.Component; @@ -36,4 +35,18 @@ public class OperCustomizeOpenFeignClientFallback implements OperCustomizeOpenFe public Result> getOpenedFunctionList(CustomerFunctionListFormDTO formDTO){ return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "getOpenedFunctionList", formDTO); } + + /** + * 校验当前客户是否可以选择浮起footbar模式 + * 只有奇数并且3个图标都上传的才可以 + * + * @param checkFloatFootBarFormDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/7/27 18:06 + */ + @Override + public Result checkFloatFootBar(CheckFloatFootBarFormDTO checkFloatFootBarFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CUSTOMIZE_SERVER, "checkFloatFootBar", checkFloatFootBarFormDTO); + } } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java index 7e8f5c4325..63d4cc6b4b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/controller/CustomerFootBarController.java @@ -17,10 +17,12 @@ package com.epmet.controller; +import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.ExcelUtils; import com.epmet.commons.tools.utils.Result; @@ -30,7 +32,11 @@ import com.epmet.commons.tools.validator.group.AddGroup; import com.epmet.commons.tools.validator.group.DefaultGroup; import com.epmet.commons.tools.validator.group.UpdateGroup; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.form.NotOnlineFootBarFormDTO; +import com.epmet.dto.form.SyncFootBar4CustomerFormDTO; +import com.epmet.dto.result.CheckFloatFootBarResultDTO; import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; import com.epmet.excel.CustomerFootBarExcel; @@ -160,11 +166,12 @@ public class CustomerFootBarController { List footbars = customerFootBarService.listAllCustomerFootBars(customerId, appType); List barDTOS = new LinkedList<>(); footbars.forEach(barEntity -> { - CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey()); - CustomerFootBarDTO barDTO = new CustomerFootBarDTO(); BeanUtils.copyProperties(barEntity, barDTO); - barDTO.setDefaultBarName(defaultFootBarEntity.getBarName()); + CustomerFootBarEntity defaultFootBarEntity = customerFootBarService.getByAppTypeAndBarKeyOfCustomer("default", barEntity.getAppType(), barEntity.getBarKey()); + if(null!=defaultFootBarEntity){ + barDTO.setDefaultBarName(defaultFootBarEntity.getBarName()); + } barDTOS.add(barDTO); }); return new Result>().ok(barDTOS); @@ -178,7 +185,7 @@ public class CustomerFootBarController { */ @PostMapping("createfootbar") public Result createFootBar(@RequestBody CustomerFootBarFormDTO form) { - ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.CreateFootBarGroup.class); + ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.CreateFootBarGroup.class, CustomerFootBarFormDTO.DefaultCustomerCreateFootBarGroup.class); customerFootBarService.createFootBar(form); return new Result(); } @@ -213,9 +220,10 @@ public class CustomerFootBarController { * @return */ @PostMapping("saveorder") - public Result saveOrder(@RequestBody CustomerFootBarFormDTO form) { + public Result saveOrder(@LoginUser TokenDto tokenDto, @RequestBody CustomerFootBarFormDTO form) { + form.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.SaveOrderGroup.class); - customerFootBarService.saveOrder(form.getOrderList()); + customerFootBarService.saveOrder(form.getUserId(),form.getOrderList()); return new Result(); } @@ -225,9 +233,10 @@ public class CustomerFootBarController { * @return */ @PostMapping("updatedisplaystatus") - public Result updateDisplayStatus(@RequestBody CustomerFootBarFormDTO form) { + public Result updateDisplayStatus(@LoginUser TokenDto tokenDto,@RequestBody CustomerFootBarFormDTO form) { + form.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.UpdateDisplayStatusGroup.class); - customerFootBarService.updateDisplayStatus(form.getId(), form.getDisplay()); + customerFootBarService.updateDisplayStatus(form.getId(), form.getDisplay(),form.getUserId()); return new Result(); } @@ -249,10 +258,57 @@ public class CustomerFootBarController { * @return */ @PostMapping("deletefootbar") - public Result deleteFootBar(@RequestBody CustomerFootBarFormDTO form) { + public Result deleteFootBar(@LoginUser TokenDto tokenDto, @RequestBody CustomerFootBarFormDTO form) { + form.setUserId(tokenDto.getUserId()); ValidatorUtils.validateEntity(form, CustomerFootBarFormDTO.DeleteFootbarsGroup.class); - customerFootBarService.deleteFootBar(form.getId()); + customerFootBarService.deleteFootBar(form.getId(),form.getUserId()); return new Result(); } + /** + * 校验当前客户是否可以选择浮起footbar模式 + * 只有奇数并且3个图标都上传的才可以 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/7/27 18:06 + */ + @PostMapping("checkfloatfootbar") + public Result checkFloatFootBar(@RequestBody CheckFloatFootBarFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return new Result().ok(customerFootBarService.checkFloatFootBar(formDTO)); + } + + /** + * 客户定制化-采集产品配置中,我没有的添加到当前客户 + * + * @param form + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/7/28 10:01 + */ + @PostMapping("syncfootbar4customer") + public Result createFootBarCustomer(@LoginUser TokenDto tokenDto, @RequestBody SyncFootBar4CustomerFormDTO form) { + form.setUserId(tokenDto.getUserId()); + ValidatorUtils.validateEntity(form); + customerFootBarService.createFootBarCustomer(form); + return new Result(); + } + + /** + * 客户定制化-FootBar配置,获取当前客户未上线的 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author yinzuomei + * @date 2021/7/28 9:47 + */ + @PostMapping("getNotOnlineFootBars") + public Result> getNotOnlineFootBars(@RequestBody NotOnlineFootBarFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + return customerFootBarService.getNotOnlineFootBars(formDTO); + } + } + diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java index 30fac6164c..d68c74c750 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/dao/CustomerFootBarDao.java @@ -64,7 +64,7 @@ public interface CustomerFootBarDao extends BaseDao { * @param orderIndex * @return */ - Integer updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex); + Integer updateOrder(@Param("id") String id, @Param("orderIndex") Integer orderIndex,@Param("userId") String userId); CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(@Param("customerId") String customerId, @Param("appType") String appType, @@ -77,11 +77,48 @@ public interface CustomerFootBarDao extends BaseDao { List listByAppTypeAndCustomerId(@Param("customerId") String customerId, @Param("appType") String appType); - void updateDisplayStatus(@Param("id") String id, @Param("display") Boolean display); + void updateDisplayStatus(@Param("id") String id, @Param("display") Boolean display,@Param("userId")String userId); List listFootBarOwnerCustomerIds(); void physicsDeleteById(@Param("id") String id); - void physicsDeleteByAppTypeAndBarKey(@Param("appType") String appType, @Param("barKey") String barKey); + void physicsDeleteByAppTypeAndBarKey(@Param("appType") String appType, @Param("barKey") String barKey,@Param("id")String id); + + /** + * 客户定制化-FootBar配置,获取当前客户未上线的 + * + * @param customerId + * @param appType + * @return java.util.List + * @author yinzuomei + * @date 2021/7/28 9:49 + */ + List selectNotOnlineFootBars(@Param("customerId") String customerId, @Param("appType")String appType); + + /** + * 根据key查询 + * + * @param customerId + * @param appType + * @param barKeyList + * @return com.epmet.entity.CustomerFootBarEntity + * @author yinzuomei + * @date 2021/7/28 15:27 + */ + List selectListByKey(@Param("customerId")String customerId, + @Param("appType")String appType, + @Param("barKeyList")List barKeyList); + + int updateCustomerFootBarByKey(@Param("customerId")String customerId, + @Param("appType")String appType, + @Param("barKey")String barKey, + @Param("userId")String userId, + @Param("pageTitle")String pageTitle, + @Param("barName")String barName, + @Param("iconPath")String iconPath, + @Param("selectedIconPath")String selectedIconPath, + @Param("floatIconPath")String floatIconPath); + + int updateFootBarDel(@Param("id") String id, @Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java index 9abc736b13..405d4f4d51 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/entity/CustomerFootBarEntity.java @@ -18,13 +18,10 @@ package com.epmet.entity; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; - /** * APP底部菜单栏信息 * @@ -80,4 +77,9 @@ public class CustomerFootBarEntity extends BaseEpmetEntity { */ private Boolean display; + /** + * 浮起时图标 + */ + private String floatIconPath; + } diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java index 0ed3c9e0e5..0cb8bba353 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/CustomerFootBarService.java @@ -19,8 +19,13 @@ package com.epmet.service; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.form.NotOnlineFootBarFormDTO; +import com.epmet.dto.form.SyncFootBar4CustomerFormDTO; +import com.epmet.dto.result.CheckFloatFootBarResultDTO; import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; @@ -105,13 +110,44 @@ public interface CustomerFootBarService extends BaseService orderList); + void saveOrder(String userId,List orderList); CustomerFootBarEntity getByAppTypeAndBarKeyOfCustomer(String customerId, String appType, String barKey); - void updateDisplayStatus(String id, Boolean display); + void updateDisplayStatus(String id, Boolean display,String userId); void addDefault4Customer(String customerId, String appType); - void deleteFootBar(String id); + void deleteFootBar(String id,String userId); + + /** + * 校验当前客户是否可以选择浮起footbar模式 + * 只有奇数并且3个图标都上传的才可以 + * + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @date 2021/7/27 18:06 + */ + CheckFloatFootBarResultDTO checkFloatFootBar(CheckFloatFootBarFormDTO formDTO); + + /** + * 客户定制化-采集产品配置中,我没有的添加到当前客户 + * + * @param form + * @return void + * @author yinzuomei + * @date 2021/7/28 10:01 + */ + void createFootBarCustomer(SyncFootBar4CustomerFormDTO form); + + /** + * 客户定制化-FootBar配置,获取当前客户未上线的 + * + * @param formDTO + * @return com.epmet.dto.result.CustomerFootBarResultDTO + * @author yinzuomei + * @date 2021/7/28 9:47 + */ + Result> getNotOnlineFootBars(NotOnlineFootBarFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java index 5205059bc0..ddb7c959a5 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java +++ b/epmet-module/oper-customize/oper-customize-server/src/main/java/com/epmet/service/impl/CustomerFootBarServiceImpl.java @@ -20,30 +20,34 @@ 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.Constant; +import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.redis.RedisKeys; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.ConvertUtils; -import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.Result; import com.epmet.dao.CustomerFootBarDao; import com.epmet.dto.CustomerFootBarDTO; +import com.epmet.dto.form.CheckFloatFootBarFormDTO; import com.epmet.dto.form.CustomerFootBarFormDTO; +import com.epmet.dto.form.NotOnlineFootBarFormDTO; +import com.epmet.dto.form.SyncFootBar4CustomerFormDTO; +import com.epmet.dto.result.CheckFloatFootBarResultDTO; import com.epmet.dto.result.CustomerFootBarResultDTO; import com.epmet.entity.CustomerFootBarEntity; import com.epmet.redis.CustomerFootBarRedis; import com.epmet.service.CustomerFootBarService; 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.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Optional; +import java.util.*; /** * APP底部菜单栏信息 @@ -130,16 +134,17 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl orderList) { + public void saveOrder(String userId,List orderList) { for (CustomerFootBarFormDTO.OrderIndexDTO idx : orderList) { - baseDao.updateOrder(idx.getId(), idx.getOrderIndex()); + baseDao.updateOrder(idx.getId(), idx.getOrderIndex(),userId); } if (!CollectionUtils.isEmpty(orderList)) { @@ -229,8 +237,8 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl 0 || uniqueCount2 > 0) { throw new RenException(EpmetErrorCode.OPER_CUSTOMER_FOOTBAR_EXISTS.getCode(), @@ -295,4 +305,114 @@ public class CustomerFootBarServiceImpl extends BaseServiceImpl + * @author yinzuomei + * @date 2021/7/27 18:06 + */ + @Override + public CheckFloatFootBarResultDTO checkFloatFootBar(CheckFloatFootBarFormDTO formDTO) { + CheckFloatFootBarResultDTO resultDTO = new CheckFloatFootBarResultDTO(); + resultDTO.setIsOddNum(false); + resultDTO.setBothUploaded(true); + List footbars = this.listCustomerFootBars(formDTO.getCustomerId(), formDTO.getAppType()); + if (!CollectionUtils.isEmpty(footbars)) { + if (footbars.size() % 2 == 0) { + resultDTO.setIsOddNum(false); + } else { + resultDTO.setIsOddNum(true); + } + // TODO 是否需要3个图标都上传?? 如果不限制3个必传,让前端判断,取默认 + for (CustomerFootBarEntity entity : footbars) { + if (StringUtils.isBlank(entity.getIconPath()) + || StringUtils.isBlank(entity.getSelectedIconPath()) + || StringUtils.isBlank(entity.getFloatIconPath())) { + resultDTO.setBothUploaded(false); + break; + } + } + } + return resultDTO; + } + + /** + * 客户定制化-采集产品配置中,我没有的添加到当前客户 + * + * @param form + * @return void + * @author yinzuomei + * @date 2021/7/28 10:01 + */ + @Transactional(rollbackFor = Exception.class) + @Override + public void createFootBarCustomer(SyncFootBar4CustomerFormDTO form) { + if (!CollectionUtils.isEmpty(form.getSyncBarKeyList())) { + // 根据key, 查找产品配置中该footbar信息 + List syncList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getSyncBarKeyList()); + syncList.forEach(syncEntity -> { + baseDao.updateCustomerFootBarByKey(form.getCustomerId(), + form.getAppType(), + syncEntity.getBarKey(), + form.getUserId(), + syncEntity.getPageTitle(), + syncEntity.getBarName(), + syncEntity.getIconPath(), + syncEntity.getSelectedIconPath(), + syncEntity.getFloatIconPath() + ); + }); + } + // 产品配置有,当前客户未上线的,直接增加 + if (!CollectionUtils.isEmpty(form.getAddBarKeyList())) { + List addList = baseDao.selectListByKey(Constant.DEFAULT_CUSTOMER, form.getAppType(), form.getAddBarKeyList()); + addList.forEach(addEntity -> { + CustomerFootBarFormDTO footBarFormDTO = new CustomerFootBarFormDTO(); + footBarFormDTO.setCustomerId(form.getCustomerId()); + footBarFormDTO.setAppType(form.getAppType()); + footBarFormDTO.setBarKey(addEntity.getBarKey()); + footBarFormDTO.setBarName(addEntity.getBarName()); + // 校验一下是否存在 + validateBeforeCreate(footBarFormDTO); + + CustomerFootBarEntity entity = ConvertUtils.sourceToTarget(addEntity, CustomerFootBarEntity.class); + entity.setCustomerId(form.getCustomerId()); + entity.setOrderIndex(baseDao.fetchNextOrder(form.getCustomerId(), form.getAppType())); + entity.setDisplay(true); + baseDao.insert(entity); + }); + } + } + + /** + * 客户定制化-FootBar配置,获取当前客户未上线的 + * + * @param formDTO + * @return com.epmet.dto.result.CustomerFootBarResultDTO + * @author yinzuomei + * @date 2021/7/28 9:49 + */ + @Override + public Result> getNotOnlineFootBars(NotOnlineFootBarFormDTO formDTO) { + String customerId = formDTO.getCustomerId(); + String appType = formDTO.getAppType(); + List footbars = baseDao.selectNotOnlineFootBars(customerId, appType); + List barDTOS=new ArrayList<>(); + footbars.forEach(defaultBar -> { + CustomerFootBarResultDTO barDTO = new CustomerFootBarResultDTO(); + BeanUtils.copyProperties(defaultBar, barDTO); + barDTO.setDefaultBarName(defaultBar.getBarName()); + barDTO.setDefaultIconPath(defaultBar.getIconPath()); + barDTO.setDefaultSelectedIconPath(defaultBar.getSelectedIconPath()); + barDTO.setDefaultFloatIconPath(defaultBar.getFloatIconPath()); + barDTO.setDefaultPageTitle(defaultBar.getPageTitle()); + barDTOS.add(barDTO); + }); + return new Result>().ok(barDTOS); + } } \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.12__add_float_icon_path.sql b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.12__add_float_icon_path.sql new file mode 100644 index 0000000000..34301ce5f8 --- /dev/null +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/db/migration/V0.0.12__add_float_icon_path.sql @@ -0,0 +1 @@ +alter table customer_foot_bar add COLUMN FLOAT_ICON_PATH VARCHAR(255) COMMENT '凸起时图标路径' AFTER SELECTED_ICON_PATH; \ No newline at end of file diff --git a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml index b320a9c1d2..fee4c4277b 100644 --- a/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml +++ b/epmet-module/oper-customize/oper-customize-server/src/main/resources/mapper/CustomerFootBarDao.xml @@ -24,14 +24,16 @@ update customer_foot_bar - set ORDER_INDEX = #{orderIndex} + set ORDER_INDEX = #{orderIndex},UPDATED_BY=#{userId},UPDATED_TIME=NOW() where ID = #{id} + and DEL_FLAG='0' update customer_foot_bar - set DISPLAY=#{display} + set DISPLAY=#{display},UPDATED_BY=#{userId},UPDATED_TIME=NOW() where ID = #{id} + and DEL_FLAG='0' @@ -46,6 +48,7 @@ from customer_foot_bar where app_type = #{appType} and BAR_KEY = #{barKey} + and id=#{id} @@ -66,7 +69,8 @@ created_by, created_time, updated_by, - updated_time + updated_time, + FLOAT_ICON_PATH FROM customer_foot_bar @@ -95,7 +99,8 @@ created_by, created_time, updated_by, - updated_time + updated_time, + FLOAT_ICON_PATH as floatIconPath FROM customer_foot_bar @@ -152,11 +157,13 @@ created_by, created_time, updated_by, - updated_time + updated_time, + FLOAT_ICON_PATH as floatIconPath from customer_foot_bar where CUSTOMER_ID = #{customerId} and APP_TYPE = #{appType} and BAR_KEY = #{barKey} + and DEL_FLAG='0' + + + + + + UPDATE customer_foot_bar + SET BAR_NAME = #{barName}, + PAGE_TITLE = #{pageTitle}, + ICON_PATH = #{iconPath}, + SELECTED_ICON_PATH = #{selectedIconPath}, + FLOAT_ICON_PATH = #{floatIconPath}, + UPDATED_BY = #{userId}, + UPDATED_TIME = NOW() + WHERE + CUSTOMER_ID = #{customerId} + AND app_type = #{appType} + AND BAR_KEY = #{barKey} + AND DEL_FLAG = '0' + + + + UPDATE customer_foot_bar + set DEL_FLAG='1',UPDATED_BY = #{userId}, UPDATED_TIME = NOW() + where id=#{id} + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/resi-guide/resi-guide-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java index f790c9b769..e3c06ede7a 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/controller/IssueController.java @@ -235,5 +235,41 @@ public class IssueController { PublishSuggestionResultDTO resultDTO=issueService.publisSuggestion(formDTO); return new Result().ok(resultDTO); } + + /** + * 处理中列表 + * @author zhaoqifeng + * @date 2021/7/27 17:50 + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("processing") + public Result> processingList(@RequestBody ShiftProjectListFromDTO fromDTO){ + return new Result>().ok(issueService.getProcessing(fromDTO)); + } + + /** + * 已结案列表 + * @author zhaoqifeng + * @date 2021/7/27 17:50 + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("closedproject") + public Result> closedProject(@RequestBody ShiftProjectListFromDTO fromDTO){ + return new Result>().ok(issueService.getClosedProjectList(fromDTO)); + } + + /** + * 无需解决列表 + * @author zhaoqifeng + * @date 2021/7/27 17:50 + * @param fromDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("unreslovedlist") + public Result> unResolvedList(@RequestBody ShiftProjectListFromDTO fromDTO){ + return new Result>().ok(issueService.getUnResolvedList(fromDTO)); + } } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java index 7196ee7717..c75ab67fa8 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/IssueService.java @@ -127,4 +127,34 @@ public interface IssueService { * @date 2021.05.19 10:52 */ List getClosedList(CommonIssueListFormDTO issueListFormDTO); + + /** + * 处理中项目列表 + * @author zhaoqifeng + * @date 2021/7/26 17:46 + * @param formDTO + * @return java.util.List + */ + List getProcessing(ShiftProjectListFromDTO formDTO); + + + /** + * 已结案项目列表 + * @author zhaoqifeng + * @date 2021/7/27 15:51 + * @param formDTO + * @return java.util.List + */ + List getClosedProjectList(ShiftProjectListFromDTO formDTO); + + /** + * 无需解决项目议题列表 + * @author zhaoqifeng + * @date 2021/7/27 17:45 + * @param formDTO + * @return java.util.List + */ + List getUnResolvedList(ShiftProjectListFromDTO formDTO); + + } diff --git a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java index d01104d40f..97ea4918b7 100644 --- a/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java +++ b/epmet-module/resi-hall/resi-hall-server/src/main/java/com/epmet/service/impl/IssueServiceImpl.java @@ -54,6 +54,8 @@ public class IssueServiceImpl implements IssueService { private LoginUserUtil loginUserUtil; @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private GovProjectOpenFeignClient govProjectOpenFeignClient; @Autowired private ResiGroupOpenFeignClient resiGroupOpenFeignClient; @@ -468,4 +470,109 @@ public class IssueServiceImpl implements IssueService { return issueList; } + + /** + * 处理中项目列表 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/7/26 17:46 + */ + @Override + public List getProcessing(ShiftProjectListFromDTO formDTO) { + List resultList = govProjectOpenFeignClient.getPendingList(formDTO).getData(); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { + return new ArrayList<>(); + } + + List topicIds = resultList.stream().map(PendingResultDTO::getSourceId).collect(Collectors.toList()); + TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); + form.setTopicIdList(topicIds); + Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); + if (!topicDetailsResult.success()) { + logger.error("调用resi-group批量查询详情失败"); + } else { + List topicDetails = topicDetailsResult.getData(); + HashMap rtm = convertTopicDetailList2Map(topicDetails); + resultList.forEach(vi -> { + ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); + vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + }); + } + + return resultList; + } + + /** + * 已结案项目列表 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/7/27 15:51 + */ + @Override + public List getClosedProjectList(ShiftProjectListFromDTO formDTO) { + List resultList = govProjectOpenFeignClient.getResolvedList(formDTO).getData(); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { + return new ArrayList<>(); + } + + List topicIds = resultList.stream().map(ResolvedResultDTO::getSourceId).collect(Collectors.toList()); + TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); + form.setTopicIdList(topicIds); + Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); + if (!topicDetailsResult.success()) { + logger.error("调用resi-group批量查询详情失败"); + } else { + List topicDetails = topicDetailsResult.getData(); + HashMap rtm = convertTopicDetailList2Map(topicDetails); + resultList.forEach(vi -> { + ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); + vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + }); + } + + return resultList; + } + + /** + * 无需解决项目议题列表 + * + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/7/27 17:45 + */ + @Override + public List getUnResolvedList(ShiftProjectListFromDTO formDTO) { + List resultList = govIssueOpenFeignClient.getUnresolvedList(formDTO).getData(); + if (org.apache.commons.collections4.CollectionUtils.isEmpty(resultList)) { + return new ArrayList<>(); + } + + List topicIds = resultList.stream().map(UnResolvedResultDTO::getSourceId).collect(Collectors.toList()); + TopicDetailBatchFormDTO form = new TopicDetailBatchFormDTO(); + form.setTopicIdList(topicIds); + Result> topicDetailsResult = resiGroupOpenFeignClient.listTopicDetailsByIds(form); + if (!topicDetailsResult.success()) { + logger.error("调用resi-group批量查询详情失败"); + } else { + List topicDetails = topicDetailsResult.getData(); + HashMap rtm = convertTopicDetailList2Map(topicDetails); + resultList.forEach(vi -> { + ResiTopicDetailResultDTO rr = rtm.get(vi.getSourceId()); + vi.setTopicImgs(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicVoices(rr == null ? new ArrayList<>() : rr.getTopicImgs()); + vi.setTopicContent(rr == null ? "" : rr.getTopicContent()); + }); + } + + return resultList; + } } diff --git a/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/resi-home/resi-home-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/resi-partymember/resi-partymember-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-module/resi-voice/resi-voice-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/healthcheck/HealthCheckController.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..136a85850c --- /dev/null +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.openapi.scan.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +} diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java new file mode 100644 index 0000000000..7ad372c8cc --- /dev/null +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/healthcheck/HealthCheckController.java @@ -0,0 +1,21 @@ +package com.epmet.healthcheck; + +import com.epmet.commons.tools.utils.Result; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +@RestController +@RequestMapping("healthcheck") +public class HealthCheckController { + + /** + * http健康检查 + * @return + */ + @PostMapping("http") + public Result httpHealthCheck() { + return new Result(); + } + +}