diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/AgencyDetailMulticFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/AgencyDetailMulticFormDTO.java new file mode 100644 index 0000000000..003e925379 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/AgencyDetailMulticFormDTO.java @@ -0,0 +1,34 @@ +package com.epmet.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 工作端小程序-数据上面的 当前组织调用此接口 + * + * @author yinzuomei@elink-cn.com + * @date 2021/6/24 15:26 + */ +@Data +public class AgencyDetailMulticFormDTO implements Serializable { + private static final long serialVersionUID = 6603177626712295270L; + /** + * 内部错误分组 + * */ + public interface AddUserInternalGroup{} + + /** + * 机关组织Id + */ + @NotBlank(message = "机关组织ID不能为空" , groups = {AddUserInternalGroup.class}) + private String agencyId; + + + /** + * 当前登录用户所属的客户id + */ + private String customerId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java new file mode 100644 index 0000000000..55df09cdfe --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java @@ -0,0 +1,57 @@ +package com.epmet.dto.form.project; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; +import java.io.Serializable; + +/** + * 群众不满列表查询入参DTO,从指标库取值 + * + * @author yinzuomei@elink-cn.com + * @date 2021/6/24 10:55 + */ +@Data +public class MassesDiscontentFormV2DTO implements Serializable { + public interface MassesDiscontentFormV2 { + } + + /** + * 时间区间,三个月:threeMonth;半年:sixMonth;一年:twelveMonth + * 一个月按照30天,三个月90天,半年180天,一年365天 + */ + @NotBlank(message = "timeSection不能为空,取值:三个月:threeMonth;半年:sixMonth;一年:twelveMonth", groups = MassesDiscontentFormV2.class) + private String timeSection; + + /** + * asc:分数由低到高 + * desc:分数由高到低 + */ + @NotBlank(message = "sortType不能为空,取值:asc:分数由低到高;desc:分数由高到低", groups = MassesDiscontentFormV2.class) + private String sortType; + + /** + * 组织ID + */ + @NotBlank(message = "agencyId不能为空", groups = MassesDiscontentFormV2.class) + private String agencyId; + + @NotNull(message = "pageNo不能为空", groups = MassesDiscontentFormV2.class) + private Integer pageNo; + + @NotNull(message = "pageSize不能为空", groups = MassesDiscontentFormV2.class) + private Integer pageSize; + + /** + * 当前agency对应的区域编码,由前端传入,前端从/data/report/screen/agency/agencydetail这取值 + */ + private String areaCode; + + + + + //以下属性无需前端传入 + private String startDate; + private String endDate; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java new file mode 100644 index 0000000000..26cf12fa71 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/AgencyDetailMulticResultDTO.java @@ -0,0 +1,97 @@ +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/6/24 15:31 + */ +@Data +public class AgencyDetailMulticResultDTO implements Serializable { + /** + * 机关组织Id + */ + private String agencyId = ""; + + /** + * 组织名称 + */ + private String agencyName = ""; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String level = ""; + + /** + * 地区编码 + */ + private String areaCode = ""; + + /** + * 【省份】名称 + */ + private String province = ""; + + /** + * 【城市】名称 + */ + private String city = ""; + + /** + * 【区县】名称 + */ + private String district = ""; + + /** + * 本机关的所有上级机关 + */ + private List parentList; + + /** + * 街道 + */ + private String street; + + /** + * 社区 + */ + private String community; + + /** + * open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参 + */ + private String areaCodeSwitch; + + /** + * 组织区划的名称 + */ + private String areaName; + + /** + * 当前组织对应客户根组织级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String rootlevel; + + + //以下参数是06.24新增 + private String parentAreaCode; + /** + * 是否有字客户 + */ + private Boolean haveSubCustomer; + + /** + * 子客户列表 + */ + private List subCustomerIds; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java new file mode 100644 index 0000000000..60683bf779 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + + +/** + * 组织首页-获取组织机构信息接口-本机关的所有上级机关信息 + * + * @author sun + */ +@Data +public class ParentListResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关组织Id + */ + private String id = ""; + /** + * 机关组织名称 + */ + private String name = ""; + + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java index 5ceeca49a7..a07fa65053 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/ScreenCustomerAgencyDTO.java @@ -46,4 +46,14 @@ public class ScreenCustomerAgencyDTO implements Serializable { * 当前组织的上级行政地区编码add0204;举例平阴县对应的是济南市3701 */ private String parentAreaCode; + + /** + * 父级id ,顶级,此列为0 + */ + private String pid; + + /** + * 所有上级ID,用逗号(英文)分开 + */ + private String pids; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java new file mode 100644 index 0000000000..627edc6daa --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java @@ -0,0 +1,69 @@ +package com.epmet.dto.result.project; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * 群众不满列表查询返参DTO,从指标库取值 + * + * @author yinzuomei@elink-cn.com + * @date 2021/6/24 11:02 + */ +@Data +public class MassesDiscontentResultV2DTO implements Serializable { + private static final long serialVersionUID = 403953150174574960L; + /** + * 项目ID + */ + private String projectId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 话题所在网格 + */ + private String gridName; + + /** + * 话题图片 + */ + private List photos; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 项目分类标签 + */ + private String projectCategory; + + /** + * 项目评价分数 + * 直接取整数位展示 + */ + private BigDecimal score; + + @JsonIgnore + private String customerId; + @JsonIgnore + private String parentAgencyId; + @JsonIgnore + private String areaCode; + + public MassesDiscontentResultV2DTO() { + this.gridName = ""; + this.photos = new ArrayList<>(); + this.topicContent = ""; + this.projectCategory = ""; + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java index 7b07db5c72..ac850effbe 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -22,4 +22,11 @@ public interface ProjectConstant { String PROCESS_FAILURE = "查询项目进展失败......"; + /** + * 三个月,六个月,12个月 + */ + String THREE_MONTH = "threeMonth"; + String SIX_MONTH = "sixMonth"; + String TWELVE_MONTH = "twelveMonth"; + String YESTERDAY = "yesterday"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java index db63f70b40..8f62ab848e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/DifficultyRankFormDTO.java @@ -41,10 +41,14 @@ public class DifficultyRankFormDTO implements Serializable { */ private String orgType; + /** + * 当前agency对应的区域编码,由前端传入,前端从/data/report/screen/agency/agencydetail这取值 + */ + private String areaCode; + //以下属性无需前端赋值 /** * 当前登录用户所属客户id */ private String customerId; - private String agencyAreaCode; } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java index de888a8472..abd9b25e92 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/project/ProjectController.java @@ -19,6 +19,8 @@ import com.epmet.dto.result.screen.ProjectQuantityResultDTO; import com.epmet.dto.result.screen.QueryQuantityMonthlyResultDTO; import com.epmet.datareport.service.project.ProjectService; import com.epmet.dto.form.ProcessListFormDTO; +import com.epmet.dto.form.project.MassesDiscontentFormV2DTO; +import com.epmet.dto.result.project.MassesDiscontentResultV2DTO; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; @@ -177,4 +179,18 @@ public class ProjectController { public Result> categoryDict(@RequestHeader("CustomerId") String customerId) { return new Result>().ok(projectService.getCategoryDict(customerId)); } + + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 群众不满列表,改为从指标库的screen_project_data取值 + * sql里面写死<75分的展示 + * @Date 2021/6/24 11:13 + **/ + @PostMapping("massesdiscontent-multic") + public Result> queryMassesDiscontentMultic(@RequestBody MassesDiscontentFormV2DTO formDTO){ + ValidatorUtils.validateEntity(formDTO, MassesDiscontentFormV2DTO.MassesDiscontentFormV2.class); + return new Result>().ok(projectService.queryMassesDiscontentMultic(formDTO)); + } } 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 1eba0b727c..628157c757 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 @@ -1,10 +1,14 @@ package com.epmet.datareport.controller.screen; +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.dto.form.AddAreaCodeDictFormDTO; +import com.epmet.dto.form.AgencyDetailMulticFormDTO; import com.epmet.dto.form.AreaCodeDictFormDTO; +import com.epmet.dto.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; import com.epmet.dto.result.plugins.AgencyNodeDTO; @@ -110,4 +114,19 @@ public class AgencyController { } return new Result<>(); } + + + /** + * @return com.epmet.commons.tools.utils.Result + * @param + * @author yinzuomei + * @description 工作端小程序-数据上面的 当前组织调用此接口 + * @Date 2021/6/24 15:29 + **/ + @PostMapping("agencydetail-multic") + public Result queryAgencyDetailMultiC(@LoginUser TokenDto tokenDto, @RequestBody AgencyDetailMulticFormDTO formDTO){ + // formDTO.setCustomerId(tokenDto.getCustomerId()); + ValidatorUtils.validateEntity(formDTO, AgencyDetailMulticFormDTO.AddUserInternalGroup.class); + return new Result().ok(agencyService.queryAgencyDetailMultiC(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 3c1e1a05c8..d31eee8700 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 @@ -18,6 +18,7 @@ package com.epmet.datareport.dao.evaluationindex.screen; import com.epmet.dto.ScreenCustomerGridDTO; +import com.epmet.dto.result.ParentListResultDTO; import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.dto.result.plugins.DeptNodeDTO; @@ -189,4 +190,6 @@ public interface ScreenCustomerAgencyDao { * @return java.util.List */ List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId); + + List selectPAgencyById(@Param("listStr")List pidList); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java index 81e0ce2a3a..d323c244c8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java @@ -1,5 +1,6 @@ package com.epmet.datareport.dao.project; +import com.epmet.dto.result.project.MassesDiscontentResultV2DTO; import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.result.*; @@ -82,4 +83,21 @@ public interface ProjectDao { * @date 2020.10.20 10:13 **/ List getDifficultyImgList(String eventId); + + /** + * @return java.util.List + * @param agencyId + * @param areaCode + * @param startDate + * @param endDate + * @param sortType + * @author yinzuomei + * @description 群众不满列表,改为从指标库的screen_project_data取值 sql里面写死<75分的展示 + * @Date 2021/6/24 13:16 + **/ + List selectMassesDiscontentMultic(@Param("agencyId") String agencyId, + @Param("areaCode") String areaCode, + @Param("startDate") String startDate, + @Param("endDate") String endDate, + @Param("sortType") String sortType); } 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 48e8e8946b..e780570be1 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 @@ -3,10 +3,12 @@ package com.epmet.datareport.service.evaluationindex.screen; import com.epmet.dto.AgencyInfoDTO; 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.result.AgencyDetailMulticResultDTO; import com.epmet.dto.result.AreaCodeDictResultDTO; -import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; import com.epmet.dto.result.ScreenCustomerAgencyDTO; +import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; import com.epmet.evaluationindex.screen.dto.form.CompartmentFormDTO; @@ -92,4 +94,12 @@ public interface AgencyService { * @return java.util.List */ List queryGridList(String areaCode, String parentAgencyId); + + /** + * 工作端小程序-数据上面的 当前组织调用此接口 + * + * @param formDTO + * @return com.epmet.dto.result.AgencyDetailMulticResultDTO + */ + AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO); } 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 8e9ebf8fe5..722673691b 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 @@ -3,8 +3,10 @@ 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.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; 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.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenCustomerAgencyDao; @@ -13,10 +15,10 @@ import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.dto.AgencyInfoDTO; 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.result.AreaCodeDictResultDTO; +import com.epmet.dto.result.*; import com.epmet.dto.result.commonservice.AddAreaCodeDictResultDTO; -import com.epmet.dto.result.ScreenCustomerAgencyDTO; import com.epmet.dto.result.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant; import com.epmet.evaluationindex.screen.dto.form.CompartmentByBizTypeFormDTO; @@ -26,6 +28,8 @@ 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.GovOrgOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.apache.ibatis.exceptions.TooManyResultsException; @@ -34,6 +38,7 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -53,6 +58,10 @@ public class AgencyServiceImpl implements AgencyService { private ScreenCustomerGridDao screenCustomerGridDao; @Autowired private EpmetCommonServiceOpenFeignClient commonServiceOpenFeignClient; + @Autowired + private GovOrgOpenFeignClient govOrgOpenFeignClient; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; /** * @Description 1、组织机构树 @@ -347,4 +356,74 @@ public class AgencyServiceImpl implements AgencyService { public List queryGridList(String areaCode, String parentAgencyId) { return screenCustomerAgencyDao.selectGridDTOList(areaCode,parentAgencyId); } + + /** + * 工作端小程序-数据上面的 当前组织调用此接口 + * + * @param formDTO + * @return com.epmet.dto.result.AgencyDetailMulticResultDTO + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) + @Override + public AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO) { + AgencyDetailMulticResultDTO agencysResultDTO = new AgencyDetailMulticResultDTO(); + List parentList = new ArrayList<>(); + agencysResultDTO.setParentList(parentList); + + //1:查询本机关详细信息 + ScreenCustomerAgencyDTO customerAgencyDTO = screenCustomerAgencyDao.selectByAgencyId(formDTO.getAgencyId()); + if (null == customerAgencyDTO) { + return agencysResultDTO; + } + agencysResultDTO = ConvertUtils.sourceToTarget(customerAgencyDTO, AgencyDetailMulticResultDTO.class); + + agencysResultDTO.setAreaCodeSwitch(govOrgOpenFeignClient.getAreaCodeSwitch(customerAgencyDTO.getCustomerId()).getData()); + //如果当前客户不存在子客户则areaCode置为空 + Result> crmRes=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + if (crmRes.success() &&CollectionUtils.isEmpty(crmRes.getData())) { + agencysResultDTO.setAreaCode(StrConstant.EPMETY_STR); + agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); + agencysResultDTO.setParentAreaCode(StrConstant.EPMETY_STR); + agencysResultDTO.setHaveSubCustomer(false); + agencysResultDTO.setSubCustomerIds(new ArrayList<>()); + }else{ + agencysResultDTO.setAreaName(agencysResultDTO.getAgencyName()); + agencysResultDTO.setHaveSubCustomer(true); + agencysResultDTO.setSubCustomerIds(crmRes.getData()); + } + + //2021.5.26 sun 添加当前组织对应客户的根组织级别返参 start + if (null != customerAgencyDTO) { + if ("0".equals(customerAgencyDTO.getPid())||StringUtils.isBlank(customerAgencyDTO.getPid())) { + agencysResultDTO.setRootlevel(customerAgencyDTO.getLevel()); + } else { + String rootAgencyId =""; + if(customerAgencyDTO.getPids().contains(StrConstant.COLON)){ + rootAgencyId= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON)).get(NumConstant.ZERO); + }else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){ + rootAgencyId= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA)).get(NumConstant.ZERO); + } + ScreenCustomerAgencyDTO rootEntity = screenCustomerAgencyDao.selectByAgencyId(rootAgencyId); + if (null != rootEntity) { + agencysResultDTO.setRootlevel(rootEntity.getLevel()); + } + } + } + //2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end + + //2:查询本机关的所有上级机关,按自上而下层级顺序 + if (StringUtils.isBlank(customerAgencyDTO.getPids())) { + agencysResultDTO.setParentList(parentList); + return agencysResultDTO; + } + List pidList =new ArrayList<>(); + if(customerAgencyDTO.getPids().contains(StrConstant.COLON)){ + pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COLON)); + }else if(customerAgencyDTO.getPids().contains(StrConstant.COMMA)){ + pidList= Arrays.asList(customerAgencyDTO.getPids().split(StrConstant.COMMA)); + } + agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList)); + + return agencysResultDTO; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java index 41bb952fa0..e2d1a06654 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java @@ -1,6 +1,8 @@ package com.epmet.datareport.service.project; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.project.MassesDiscontentFormV2DTO; +import com.epmet.dto.result.project.MassesDiscontentResultV2DTO; import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; @@ -99,4 +101,12 @@ public interface ProjectService { * @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO */ List myNextAgencyMultic(String staffId,String currentCustomerId); + + /** + * 群众不满列表,改为从指标库的screen_project_data取值,sql里面写死<75分的展示 + * + * @param formDTO + * @return com.epmet.dto.result.project.MassesDiscontentResultV2DTO + */ + List queryMassesDiscontentMultic(MassesDiscontentFormV2DTO formDTO); } 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 0f8fc80081..6e06b3cc3a 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 @@ -11,6 +11,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.dao.project.ProjectDao; import com.epmet.datareport.service.evaluationindex.screen.AgencyService; import com.epmet.datareport.service.project.ProjectService; @@ -19,7 +20,9 @@ import com.epmet.dto.ScreenCustomerGridDTO; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.SubAgencyFormDTO; +import com.epmet.dto.form.project.MassesDiscontentFormV2DTO; import com.epmet.dto.result.*; +import com.epmet.dto.result.project.MassesDiscontentResultV2DTO; import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; import com.epmet.feign.*; import com.epmet.project.constant.ProjectConstant; @@ -72,6 +75,8 @@ public class ProjectServiceImpl implements ProjectService { private OperCrmOpenFeignClient operCrmOpenFeignClient; @Autowired private AgencyService screenAgencyService; + @Autowired + private ScreenProjectDataDao screenProjectDataDao; /** * @Author sun @@ -372,7 +377,9 @@ public class ProjectServiceImpl implements ProjectService { //多客户测试写死值,别忘了注释掉呀 // formDTO.setCustomerId("613cc61a6b8ce4c70d21bd413dac72cc"); // formDTO.setAgencyId("30705f91f1295ae77d372b868596a5e7"); - Result> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + + //06.24决定areaCode让前端传入, 前端从前端从/data/report/screen/agency/agencydetail这取值取值 + /*Result> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { log.warn("❤当前客户存在子客户❤"); //2、查询组织信息 @@ -380,8 +387,8 @@ public class ProjectServiceImpl implements ProjectService { if (!agencyResult.success() || null == agencyResult.getData()) { throw new RenException(String.format("查询组织信息异常,agencyId:%s", formDTO.getAgencyId())); } - formDTO.setAgencyAreaCode(agencyResult.getData().getAreaCode()); - } + formDTO.setAreaCode(agencyResult.getData().getAreaCode()); + }*/ // 3、升级原来的列表查询接口 PageHelper.startPage(null == formDTO.getPageNo() ? NumConstant.ONE : formDTO.getPageNo(), formDTO.getTopNum()); List result = projectDao.difficultyRankV2(formDTO); @@ -501,4 +508,55 @@ public class ProjectServiceImpl implements ProjectService { } return resultList; } + + /** + * 群众不满列表,改为从指标库的screen_project_data取值,sql里面写死<75分的展示 + * + * @param formDTO + * @return com.epmet.dto.result.project.MassesDiscontentResultV2DTO + */ + @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)); + //已结案、并且来源于议题、在当前时间范围内的、 + List list = projectDao.selectMassesDiscontentMultic(formDTO.getAgencyId(), + formDTO.getAreaCode(), + formDTO.getStartDate(), + formDTO.getEndDate(), + formDTO.getSortType()); + list.forEach(project -> { + project.setPhotos(screenProjectDataDao.selectProjectImgs(project.getProjectId(), project.getCustomerId())); + }); + return list; + } + + /** + * @Description 处理时间 + * @Param dateType + * @author zxc + * @date 2021/5/18 2:28 下午 + */ + public String getDateId(String dateType){ + String result = DateUtils.getBeforeNDay(NumConstant.ONE); + switch (dateType) { + case ProjectConstant.THREE_MONTH: + result = DateUtils.getBeforeNDay(NumConstant.NINETY); + break; + case ProjectConstant.SIX_MONTH: + result = DateUtils.getBeforeNDay(NumConstant.ONE_HUNDRED_AND_EIGHTY); + break; + case ProjectConstant.TWELVE_MONTH: + result = DateUtils.getBeforeNDay(NumConstant.THREE_HUNDRED_AND_SIXTY_FIVE); + break; + case ProjectConstant.YESTERDAY: + result = DateUtils.getBeforeNDay(NumConstant.ONE); + break; + default: + } + return result; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index 73552407d7..888f8b0938 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -296,10 +296,10 @@ ) diff WHERE diff.DEL_FLAG = '0' - - and diff.AREA_CODE like concat(#{agencyAreaCode},'%') + + and diff.AREA_CODE like concat(#{areaCode},'%') - + AND diff.ORG_ID = #{agencyId,jdbcType=VARCHAR} @@ -326,4 +326,45 @@ WHERE EVENT_ID = #{eventId} ORDER BY SORT + + + 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 05b01722dc..5a1e506707 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 @@ -372,4 +372,23 @@ AND scg.PARENT_AGENCY_ID = #{parentAgencyId} + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java index 5547c0491a..9bb84ceba8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/BaseReportController.java @@ -23,8 +23,8 @@ public class BaseReportController { * @author sun */ @PostMapping("gridreguser") - public Result gridreguser(@RequestHeader("CustomerId") String customerId, @RequestBody GridRegUserFormDTO formDTO) { - + public Result gridRegUser(@RequestBody GridRegUserFormDTO formDTO) { + baseReportService.gridRegUser(formDTO); return new Result(); } @@ -34,8 +34,8 @@ public class BaseReportController { * @author sun */ @PostMapping("agencyreguser") - public Result agencyreguser(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyRegUserFormDTO formDTO) { - + public Result agencyRegUser(@RequestBody AgencyRegUserFormDTO formDTO) { + baseReportService.agencyRegUser(formDTO); return new Result(); } @@ -45,8 +45,8 @@ public class BaseReportController { * @author sun */ @PostMapping("gridgrouptotal") - public Result gridgrouptotal(@RequestHeader("CustomerId") String customerId, @RequestBody GridGroupTotalFormDTO formDTO) { - + public Result gridGroupTotal(@RequestBody GridGroupTotalFormDTO formDTO) { + baseReportService.gridGroupTotal(formDTO); return new Result(); } @@ -56,8 +56,8 @@ public class BaseReportController { * @author sun */ @PostMapping("agencygrouptotal") - public Result agencygrouptotal(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyGroupTotalFormDTO formDTO) { - + public Result agencyGroupTotal(@RequestBody AgencyGroupTotalFormDTO formDTO) { + baseReportService.agencyGroupTotal(formDTO); return new Result(); } @@ -67,8 +67,8 @@ public class BaseReportController { * @author sun */ @PostMapping("gridhottopic") - public Result gridhottopic(@RequestHeader("CustomerId") String customerId, @RequestBody GridHotTopicFormDTO formDTO) { - + public Result gridHotTopic(@RequestBody GridHotTopicFormDTO formDTO) { + baseReportService.gridHotTopic(formDTO); return new Result(); } @@ -78,8 +78,8 @@ public class BaseReportController { * @author sun */ @PostMapping("agencyhottopic") - public Result agencyhottopic(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyHotTopicFormDTO formDTO) { - + public Result agencyHotTopic(@RequestBody AgencyHotTopicFormDTO formDTO) { + baseReportService.agencyHotTopic(formDTO); return new Result(); } @@ -89,8 +89,8 @@ public class BaseReportController { * @author sun */ @PostMapping("gridtopicstatus") - public Result gridtopicstatus(@RequestHeader("CustomerId") String customerId, @RequestBody GridTopicStatusFormDTO formDTO) { - + public Result gridTopicStatus(@RequestBody GridTopicStatusFormDTO formDTO) { + baseReportService.gridTopicStatus(formDTO); return new Result(); } @@ -100,8 +100,8 @@ public class BaseReportController { * @author sun */ @PostMapping("agencytopicstatus") - public Result agencytopicstatus(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyTopicStatusFormDTO formDTO) { - + public Result agencyTopicStatus(@RequestBody AgencyTopicStatusFormDTO formDTO) { + baseReportService.agencyTopicStatus(formDTO); return new Result(); } @@ -111,8 +111,8 @@ public class BaseReportController { * @author sun */ @PostMapping("gridtopicissue") - public Result gridtopicissue(@RequestHeader("CustomerId") String customerId, @RequestBody GridTopicIssueFormDTO formDTO) { - + public Result gridTopicIssue(@RequestBody GridTopicIssueFormDTO formDTO) { + baseReportService.gridTopicIssue(formDTO); return new Result(); } @@ -122,8 +122,8 @@ public class BaseReportController { * @author sun */ @PostMapping("agencytopicissue") - public Result agencytopicissue(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyTopicIssueFormDTO formDTO) { - + public Result agencyTopicIssue(@RequestBody AgencyTopicIssueFormDTO formDTO) { + baseReportService.agencyTopicIssue(formDTO); return new Result(); } @@ -133,8 +133,8 @@ public class BaseReportController { * @author sun */ @PostMapping("gridissue") - public Result gridissue(@RequestHeader("CustomerId") String customerId, @RequestBody GridIssueFormDTO formDTO) { - + public Result gridIssue(@RequestBody GridIssueFormDTO formDTO) { + baseReportService.gridIssue(formDTO); return new Result(); } @@ -144,8 +144,8 @@ public class BaseReportController { * @author sun */ @PostMapping("agencyissue") - public Result agencyissue(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyIssueFormDTO formDTO) { - + public Result agencyIssue(@RequestBody AgencyIssueFormDTO formDTO) { + baseReportService.agencyIssue(formDTO); return new Result(); } @@ -155,8 +155,8 @@ public class BaseReportController { * @author sun */ @PostMapping("gridproject") - public Result gridproject(@RequestHeader("CustomerId") String customerId, @RequestBody GridProjectFormDTO formDTO) { - + public Result gridProject(@RequestBody GridProjectFormDTO formDTO) { + baseReportService.gridProject(formDTO); return new Result(); } @@ -166,8 +166,8 @@ public class BaseReportController { * @author sun */ @PostMapping("agencyproject") - public Result agencyproject(@RequestHeader("CustomerId") String customerId, @RequestBody AgencyProjectFormDTO formDTO) { - + public Result agencyProject(@RequestBody AgencyProjectFormDTO formDTO) { + baseReportService.agencyProject(formDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index d0f1ab08df..05ed692454 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -94,7 +94,7 @@ public interface AgencyScoreDao extends BaseDao { * @date 2021/1/18 上午9:09 */ List selectAgencyScoreAvgExistsSub(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode); - List selectAgencyScoreAvgExistsSubNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId); + List selectAgencyScoreAvgExistsSubNew(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("areaCode")String areaCode,@Param("quarterId")String quarterId,@Param("yearId")String yearId,@Param("customerId")String customerId); List selectAgencyScoreAvgByOrgIds(@Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("orgIds")List orgIds); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java new file mode 100644 index 0000000000..d379ba229a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java @@ -0,0 +1,44 @@ +package com.epmet.dao.stats; + +import com.epmet.dto.basereport.form.AgencyRegUserFormDTO; +import com.epmet.dto.basereport.form.GridRegUserFormDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author sun + * @Description 部分基础数据上报 + */ +@Mapper +public interface BaseReportDao { + + /** + * @Param formDTO + * @Description 根据dateId删除客户网格注册用户数据 + * @author sun + */ + int delGridRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Param formDTO + * @Description 批量新增客户网格注册用户数据 + * @author sun + */ + void insertBatchGridRegUser(@Param("list") List dataList); + + /** + * @Param formDTO + * @Description 根据dateId删除客户组织注册用户数据 + * @author sun + */ + int delAgencyRegUser(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Param formDTO + * @Description 批量新增客户组织注册用户数据 + * @author sun + */ + void insertBatchAgencyRegUser(@Param("list") List dataList); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/BaseReportService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/BaseReportService.java index be5a76aacd..b1bf097f58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/BaseReportService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/BaseReportService.java @@ -1,10 +1,109 @@ package com.epmet.service; +import com.epmet.dto.basereport.form.*; + /** * @Author sun * @Description 部分基础数据上报 */ public interface BaseReportService { + /** + * @Param formDTO + * @Description 网格注册用户数据 + * @author sun + */ + void gridRegUser(GridRegUserFormDTO formDTO); + + /** + * @Param formDTO + * @Description 组织机关注册用户数据 + * @author sun + */ + void agencyRegUser(AgencyRegUserFormDTO formDTO); + + /** + * @Param formDTO + * @Description 网格群组总数 + * @author sun + */ + void gridGroupTotal(GridGroupTotalFormDTO formDTO); + + /** + * @Param formDTO + * @Description 组织群组总数 + * @author sun + */ + void agencyGroupTotal(AgencyGroupTotalFormDTO formDTO); + + /** + * @Param formDTO + * @Description 网格热议话题数据 + * @author sun + */ + void gridHotTopic(GridHotTopicFormDTO formDTO); + + /** + * @Param formDTO + * @Description 组织热议话题数据 + * @author sun + */ + void agencyHotTopic(AgencyHotTopicFormDTO formDTO); + + /** + * @Param formDTO + * @Description 网格状态话题数据 + * @author sun + */ + void gridTopicStatus(GridTopicStatusFormDTO formDTO); + + /** + * @Param formDTO + * @Description 组织状态话题数据 + * @author sun + */ + void agencyTopicStatus(AgencyTopicStatusFormDTO formDTO); + + /** + * @Param formDTO + * @Description 网格话题转议题数据 + * @author sun + */ + void gridTopicIssue(GridTopicIssueFormDTO formDTO); + + /** + * @Param formDTO + * @Description 组织话题转议题数据 + * @author sun + */ + void agencyTopicIssue(AgencyTopicIssueFormDTO formDTO); + + /** + * @Param formDTO + * @Description 网格议题数据 + * @author sun + */ + void gridIssue(GridIssueFormDTO formDTO); + + /** + * @Param formDTO + * @Description 组织议题数据 + * @author sun + */ + void agencyIssue(AgencyIssueFormDTO formDTO); + + /** + * @Param formDTO + * @Description 网格项目数据 + * @author sun + */ + void gridProject(GridProjectFormDTO formDTO); + + /** + * @Param formDTO + * @Description 组织项目数据 + * @author sun + */ + void agencyProject(AgencyProjectFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 9c8e1579d9..1a40acf7aa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java @@ -649,10 +649,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map gridPartyScoreSampleCountMap = new HashMap<>(); indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId,customerId); log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); subGridPartyAvgScore.forEach(s -> { - gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode()), s.getSampleCount()); }); if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); @@ -745,10 +745,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { // 治理能力平均值 - List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId,customerId); log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); districtGovernAvgList.forEach(s -> { - gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode()), s.getSampleCount()); }); for (int i = 0; i < districtGovernAvgList.size(); i++) { if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ @@ -790,6 +790,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict if (CollectionUtils.isEmpty(deptScoreAvgList)) { log.warn("查询所有直属部门治理能力平均值集合为空"); } else{ + deptScoreAvgList.forEach(d -> { + gridPartyScoreSampleCountMap.put(d.getAgencyId().concat(":").concat(IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode()), d.getSampleCount()); + }); MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList())); List> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE); governAvg.forEach(avg -> { @@ -845,10 +848,10 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { - List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSubNew(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId,customerId); log.info("subStreetAvgList:::"+subStreetAvgList.toString()); subStreetAvgList.forEach(s -> { - gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); + gridPartyScoreSampleCountMap.put(s.getParentId().concat(":").concat(IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode()), s.getSampleCount()); }); for (int i = 0; i < subStreetAvgList.size(); i++) { if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ 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 b19e564503..ca12d8058f 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 @@ -667,7 +667,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ List dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelfNew(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode(),quarterId,yearId); // 数据处理 List subCommPartyAvgScore = disposeSubAvg(dispose, form); - dispose.forEach(s -> { + subCommPartyAvgScore.forEach(s -> { gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode()), s.getSampleCount()); }); if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { @@ -971,6 +971,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ avgScore.forEach(avg -> { if (subScore.getAgencyId().equals(avg.getParentId())){ subScore.setScore(avg.getScore()); + subScore.setSampleCount(avg.getSampleCount()); avg.setScoreStatus(true); } }); @@ -991,6 +992,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ // 孔村单独处理 if (s.getAgencyId().equals(PingYinConstant.KONG_CUN_AGENCY_ID)){ s.setScore(divide); + // 党总支数量求平均数 + s.setSampleCount(subAvgResultDTOS.size()); } }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java index 2f0efdc5f6..5551d2749b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/BaseReportServiceImpl.java @@ -1,7 +1,13 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.stats.BaseReportDao; +import com.epmet.dto.basereport.form.*; import com.epmet.service.BaseReportService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; /** * @Author sun @@ -10,4 +16,178 @@ import org.springframework.stereotype.Service; @Service public class BaseReportServiceImpl implements BaseReportService { + @Autowired + private BaseReportDao baseReportDao; + + + /** + * @Param formDTO + * @Description 网格注册用户数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void gridRegUser(GridRegUserFormDTO formDTO) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridRegUser(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchGridRegUser(formDTO.getDataList()); + } + } + + /** + * @Param formDTO + * @Description 组织机关注册用户数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void agencyRegUser(AgencyRegUserFormDTO formDTO) { + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyRegUser(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchAgencyRegUser(formDTO.getDataList()); + } + } + + /** + * @Param formDTO + * @Description 网格群组总数 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void gridGroupTotal(GridGroupTotalFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 组织群组总数 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void agencyGroupTotal(AgencyGroupTotalFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 网格热议话题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void gridHotTopic(GridHotTopicFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 组织热议话题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void agencyHotTopic(AgencyHotTopicFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 网格状态话题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void gridTopicStatus(GridTopicStatusFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 组织状态话题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void agencyTopicStatus(AgencyTopicStatusFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 网格话题转议题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void gridTopicIssue(GridTopicIssueFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 组织话题转议题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void agencyTopicIssue(AgencyTopicIssueFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 网格议题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void gridIssue(GridIssueFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 组织议题数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void agencyIssue(AgencyIssueFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 网格项目数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void gridProject(GridProjectFormDTO formDTO) { + + } + + /** + * @Param formDTO + * @Description 组织项目数据 + * @author sun + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void agencyProject(AgencyProjectFormDTO formDTO) { + + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index 9cceffc4df..10868e075f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -263,7 +263,9 @@ (fics.agency_id = sca.agency_id AND fics.del_flag = '0' AND fics.month_id = #{monthId} - AND fics.index_code = #{indexCode}) + AND fics.index_code = #{indexCode} + AND fics.CUSTOMER_ID = #{customerId} + ) WHERE sca.DEL_FLAG = '0' AND sca.PARENT_AREA_CODE = #{areaCode} GROUP BY parentId diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml new file mode 100644 index 0000000000..8c3e4a4056 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml @@ -0,0 +1,136 @@ + + + + + + DELETE + FROM + fact_reg_user_grid_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + insert into fact_reg_user_grid_daily + ( + id, + customer_id, + agency_id, + grid_id, + date_id, + week_id, + year_id, + reg_total, + resi_total, + warm_hearted_total, + partymember_total, + reg_incr, + warm_incr, + partymember_incr, + resi_proportion, + partymember_proportion, + warm_hearted_proportion, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.gridId}, + #{item.dateId}, + #{item.weekId}, + #{item.yearId}, + #{item.regTotal}, + #{item.resiTotal}, + #{item.warmHeartedTotal}, + #{item.partymemberTotal}, + #{item.regIncr}, + #{item.warmIncr}, + #{item.partymemberIncr}, + #{item.resiProportion}, + #{item.partymemberProportion}, + #{item.warmHeartedProportion}, + 0, + 0, + 'BASE_REPORT', + now(), + 'BASE_REPORT', + now() + ) + + + + + DELETE + FROM + fact_reg_user_agency_daily + WHERE + customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + insert into fact_reg_user_agency_daily + ( + id, + customer_id, + agency_id, + date_id, + week_id, + year_id, + reg_total, + resi_total, + warm_hearted_total, + partymember_total, + reg_incr, + warm_incr, + partymember_incr, + resi_proportion, + partymember_proportion, + warm_hearted_proportion, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.agencyId}, + #{item.dateId}, + #{item.weekId}, + #{item.yearId}, + #{item.regTotal}, + #{item.resiTotal}, + #{item.warmHeartedTotal}, + #{item.partymemberTotal}, + #{item.regIncr}, + #{item.warmIncr}, + #{item.partymemberIncr}, + #{item.resiProportion}, + #{item.partymemberProportion}, + #{item.warmHeartedProportion}, + 0, + 0, + 'BASE_REPORT', + now(), + 'BASE_REPORT', + now() + ) + + + + + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index 4e28d10dc1..2e13dde7fb 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -342,4 +342,14 @@ public interface GovOrgOpenFeignClient { */ @PostMapping("/gov/org/customerstaffgrid/gridstaff") Result> selectGridStaffByGridIds(@RequestBody List gridIds); + + /** + * @return com.epmet.commons.tools.utils.Result + * @param customerId + * @author yinzuomei + * @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参;没配置,返回closed + * @Date 2021/6/24 16:11 + **/ + @PostMapping(value = "getAreaCodeSwitch/{customerId}") + Result getAreaCodeSwitch(@PathVariable("customerId")String customerId); } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 4976297323..0d13438885 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -197,4 +197,16 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> selectGridStaffByGridIds(List gridIds) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "selectGridStaffByGridIds", gridIds); } + + /** + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参;没配置,返回closed + * @Date 2021/6/24 16:11 + **/ + @Override + public Result getAreaCodeSwitch(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getAreaCodeSwitch", customerId); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java index b88368a11d..96145dbe81 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/CustomerAgencyController.java @@ -17,7 +17,6 @@ package com.epmet.controller; -import com.baomidou.mybatisplus.extension.api.R; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; @@ -34,13 +33,12 @@ import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.excel.CustomerAgencyExcel; import com.epmet.service.CustomerAgencyService; +import com.epmet.service.CustomerOrgParameterService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import javax.servlet.http.HttpServletResponse; -import javax.validation.constraints.NotBlank; import java.util.List; import java.util.Map; import java.util.Set; @@ -58,6 +56,8 @@ public class CustomerAgencyController { @Autowired private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerOrgParameterService customerOrgParameterService; @GetMapping("page") public Result> page(@RequestParam Map params) { @@ -297,4 +297,9 @@ public class CustomerAgencyController { Result organizeTree(@PathVariable("agencyId") String agencyId) { return new Result().ok(customerAgencyService.organizeTree(agencyId)); } + + @PostMapping("getAreaCodeSwitch/{customerId}") + public Result getAreaCodeSwitch(@PathVariable("customerId")String customerId){ + return new Result().ok(customerOrgParameterService.getAreaCodeSwitch(customerId)); + } } \ No newline at end of file