From 7d13637747120561cbe9914c849da909aeb53a9f Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 23 Jun 2021 10:34:11 +0800 Subject: [PATCH 001/107] =?UTF-8?q?=E5=AD=94=E6=9D=91=EF=BC=8C=E6=A6=86?= =?UTF-8?q?=E5=B1=B1=EF=BC=8C=E9=94=A6=E6=B0=B4pid=E6=9B=B4=E4=B8=BA?= =?UTF-8?q?=E5=B9=B3=E9=98=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/IndexCalculateStreetServiceImpl.java | 11 ++++++----- .../indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml | 4 ++-- .../indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml | 2 +- .../indexcoll/FactIndexServiceAblityOrgMonthlyDao.xml | 4 ++-- .../screen/ScreenCustomerAgencyDao.xml | 4 ++-- 5 files changed, 13 insertions(+), 12 deletions(-) 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 f148e3d83e..5bb89adff4 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 @@ -674,7 +674,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ partition.forEach(publish -> { List index1SampleValues = new ArrayList<>(); publish.forEach(c -> { - c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); +// c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); @@ -754,7 +754,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); avg.forEach(c -> { - c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); +// c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); @@ -835,7 +835,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); List index1SampleValues = new ArrayList<>(); serviceAvg.forEach(c -> { - c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); +// c.setParentId(customerAgencyDao.selectAgencyId(form.getCustomerAreaCode())); pid.put(c.getAgencyId(),c.getParentId()); SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); index1SampleValues.add(s); @@ -932,6 +932,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ orgIds.forEach(org -> { SubCommunityAvgResultDTO s = new SubCommunityAvgResultDTO(); s.setAgencyId(org.getOrgId()); + s.setParentId(org.getPid()); subAvgScores.add(s); }); // 把除去孔村镇的数据赋值,孔村在下边单独处理 @@ -983,7 +984,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ kongCunGovernAbility.forEach(k -> { k.put("AGENCY_ID",k.get("AGENCY_ID")); - k.put("PARENT_ID",NumConstant.ZERO_STR); + k.put("PARENT_ID",k.get("PARENT_ID")); }); } if (!CollectionUtils.isEmpty(communityGovernAbility)){ @@ -1012,7 +1013,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ kongCunActivityCountList.forEach(k -> { k.put("AGENCY_ID",k.get("AGENCY_ID")); - k.put("PARENT_ID",NumConstant.ZERO_STR); + k.put("PARENT_ID",k.get("PARENT_ID")); }); } if (!CollectionUtils.isEmpty(ActivityCountList)){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml index d1db2b9588..76ab745264 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexGovrnAblityOrgMonthlyDao.xml @@ -288,7 +288,7 @@ SELECT sca.AGENCY_ID, - sca.PID AS PARENT_ID, + IF(sca.PID = '0',(SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode} AND DEL_FLAG = 0),sca.PID) AS PARENT_ID, #{monthId} AS MONTH_ID, #{quarterId} AS QUARTER_ID, #{yearId} AS YEAR_ID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml index 016cd62b24..1c0941a04b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcoll/FactIndexPartyAblityOrgMonthlyDao.xml @@ -176,7 +176,7 @@ SELECT sca.AGENCY_ID, - sca.PID AS PARENT_ID, + IF(sca.PID = '0',(SELECT AGENCY_ID FROM screen_customer_agency WHERE AREA_CODE = #{areaCode} AND DEL_FLAG = 0),sca.PID) AS PARENT_ID, #{monthId} AS MONTH_ID, #{quarterId} AS QUARTER_ID, #{yearId} AS YEAR_ID, @@ -222,7 +222,7 @@ + + + + + + From 57e78be08b1a5681bfa3ef711b54f085c52e0c0b Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Jun 2021 11:06:33 +0800 Subject: [PATCH 003/107] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9-?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E6=8B=89=E6=A1=86"mynextagency-mult?= =?UTF-8?q?ic"v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/ScreenCustomerGridDTO.java | 5 ++-- .../result/ProjectNextAgencyResultDTO.java | 3 +- .../controller/project/ProjectController.java | 2 +- .../service/project/ProjectService.java | 3 +- .../project/impl/ProjectServiceImpl.java | 29 +++++++++++++++++-- 5 files changed, 33 insertions(+), 9 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java index 65e98b940b..10c2a503c3 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenCustomerGridDTO.java @@ -17,9 +17,10 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; /** @@ -114,5 +115,5 @@ public class ScreenCustomerGridDTO implements Serializable { private String allParentIds; private String pid; private String pids; - + private String areaCode; } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java index 2c867a6398..19a92f93bd 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java @@ -3,7 +3,6 @@ package com.epmet.project.dto.result; import lombok.Data; import java.io.Serializable; -import java.util.List; /** * @Description 难点赌点-当前登录人员本级一级下一级组织机构/网格 返参DTO @@ -30,5 +29,5 @@ public class ProjectNextAgencyResultDTO implements Serializable { * */ private String orgType; - + private String areaCode; } 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 d6de29567d..90f3157f3d 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 @@ -138,7 +138,7 @@ public class ProjectController { **/ @PostMapping("mynextagency-multic") public Result> myNextAgencyMultic(@LoginUser TokenDto tokenDto){ - return new Result>().ok(projectService.myNextAgencyMultic(tokenDto.getUserId())); + return new Result>().ok(projectService.myNextAgencyMultic(tokenDto.getUserId(),tokenDto.getCustomerId())); } /** 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 dc2eaf5e3b..25f111af73 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 @@ -87,7 +87,8 @@ public interface ProjectService { * 210622: 新增此API, 后端改为从指标库取值 , 保证平阴县的工作人员,看到的下拉框是平阴县、以及8个街道 * * @param staffId 当前登录用户id + * @param currentCustomerId 当前客户id * @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO */ - List myNextAgencyMultic(String staffId); + List myNextAgencyMultic(String staffId,String currentCustomerId); } 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 c4687eafee..5a5097e7a1 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 @@ -403,10 +403,14 @@ public class ProjectServiceImpl implements ProjectService { * 210622: 新增此API, 后端改为从指标库取值 , 保证平阴县的工作人员,看到的下拉框是平阴县、以及8个街道 * * @param staffId 当前登录用户id + * @param currentCustomerId 当前客户id * @return com.epmet.project.dto.result.ProjectNextAgencyResultDTO */ @Override - public List myNextAgencyMultic(String staffId) { + public List myNextAgencyMultic(String staffId,String currentCustomerId) { + //多客户测试写死值,别忘了注释掉呀 + // staffId="3f04e397cc226e4e2f2531ac4363e3f9"; + // currentCustomerId="613cc61a6b8ce4c70d21bd413dac72cc"; //1、当前工作人员所属组织信息 Result staffResult = govOrgOpenFeignClient.getAgencyByStaff(staffId); if (!staffResult.success() || null == staffResult.getData()) { @@ -417,26 +421,45 @@ public class ProjectServiceImpl implements ProjectService { staffAgency.setOrgId(staffResult.getData().getId()); staffAgency.setOrgName(staffResult.getData().getOrganizationName()); staffAgency.setOrgType("agency"); + staffAgency.setAreaCode(staffResult.getData().getAreaCode()); resultList.add(staffAgency); //2、查询指标库当前组织的下级组织 - List agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); + List agencyDTOList =new ArrayList<>(); + Result> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(currentCustomerId); + if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { + log.warn("❤当前客户存在子客户❤"); + //如果包含子客户,则根据areaCode查询下一级 + agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); + } else { + //当前客户没有子客户,根据agencyId查询下一级组织 + agencyDTOList = screenAgencyService.queryNextAgencyList(StrConstant.EPMETY_STR, staffResult.getData().getId()); + } if (CollectionUtils.isNotEmpty(agencyDTOList)) { agencyDTOList.forEach(agencyDTO -> { ProjectNextAgencyResultDTO nextAgency = new ProjectNextAgencyResultDTO(); nextAgency.setOrgId(agencyDTO.getAgencyId()); nextAgency.setOrgName(agencyDTO.getAgencyName()); nextAgency.setOrgType("agency"); + nextAgency.setAreaCode(agencyDTO.getAreaCode()); resultList.add(nextAgency); }); } //3、查询指标库当前组织的下级网格 - List gridList = screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); + List gridList = new ArrayList<>(); + if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { + //如果包含子客户,则根据areaCode查询下一级网格 + gridList=screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR); + } else { + //当前客户没有子客户,根据agencyId查询下一级网格 + gridList=screenAgencyService.queryGridList(StrConstant.EPMETY_STR,staffResult.getData().getId()); + } if (CollectionUtils.isNotEmpty(gridList)) { gridList.forEach(gridDTO -> { ProjectNextAgencyResultDTO grid = new ProjectNextAgencyResultDTO(); grid.setOrgId(gridDTO.getGridId()); grid.setOrgName(gridDTO.getGridName()); grid.setOrgType("grid"); + grid.setAreaCode(gridDTO.getAreaCode()); resultList.add(grid); }); } From f656bd9c43c7252a56a1ec2f7aab0d55ebd1ff3f Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 23 Jun 2021 14:12:51 +0800 Subject: [PATCH 004/107] =?UTF-8?q?gataway=E6=8B=A6=E6=88=AA=20point?= =?UTF-8?q?=E8=AF=B7=E6=B1=82=20mqcallback=20=E6=94=BE=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/src/main/resources/bootstrap.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index d797bc08bd..7ea83738f6 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -466,11 +466,13 @@ epmet: - /data/aggregator/** - /gov/voice/** - /resi/voice/** + - /epmet/point/** # 内部认证url白名单(在白名单中的,就不会再校验登录了) internalAuthUrlsWhiteList: - /epmetuser/customerstaff/customerlist - /gov/project/project/platformcallback + - /epmet/point/mqCallback/** # 外部应用认证,使用AccessToken等头进行认证 externalOpenUrls: From 8973ce412e3e2db55ec992b56b53c15d9dfb44db Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Jun 2021 14:33:00 +0800 Subject: [PATCH 005/107] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E5=88=97=E8=A1=A8=EF=BC=9Adifficultyrank-multic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/DifficultyRankFormDTO.java | 7 +++ .../controller/project/ProjectController.java | 15 ++++++ .../datareport/dao/project/ProjectDao.java | 8 +++ .../service/project/ProjectService.java | 8 +++ .../project/impl/ProjectServiceImpl.java | 36 +++++++++++++ .../resources/mapper/project/ProjectDao.xml | 51 +++++++++++++++++++ 6 files changed, 125 insertions(+) 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 5a3936db6a..db63f70b40 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 @@ -40,4 +40,11 @@ public class DifficultyRankFormDTO implements Serializable { * 组织类型: 网格:grid ; 组织:agency */ private String orgType; + + //以下属性无需前端赋值 + /** + * 当前登录用户所属客户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 90f3157f3d..f114739e1a 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 @@ -114,6 +114,21 @@ public class ProjectController { return new Result>().ok(projectService.getDifficultyRank(param)); } + /** + * @return com.epmet.commons.tools.utils.Result> + * @param formDTO + * @author yinzuomei + * @description 难点赌点-耗时最长|涉及部门最多|处理次数 返回该组织下所有的难点堵点的 数据 + * 2021.06.21新增次API,多客户版本,eg:平阴县的工作人员可以看到8个街道的难点赌点 + * @Date 2021/6/23 13:09 + **/ + @PostMapping("difficultyrank-multic") + public Result> difficultyRankMultic(@RequestHeader("CustomerId") String customerId,@RequestBody DifficultyRankFormDTO formDTO){ + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, DifficultyRankFormDTO.DifficultyRankInternalGroup.class); + return new Result>().ok(projectService.difficultyRankMultic(formDTO)); + } + /** * @Description 难点赌点-耗时最长|涉及部门最多|处理次数 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 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 870c25a6d2..81e0ce2a3a 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 @@ -66,6 +66,14 @@ public interface ProjectDao { **/ List difficultyRank(DifficultyRankFormDTO difficultyRankFormDTO); + /** + * 工作端-数据:难点赌点列表查询V2,多客户版本 + * + * @param formDTO + * @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO + */ + List difficultyRankV2(DifficultyRankFormDTO formDTO); + /** * @Description 查询难点堵点的图片list * @param 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 25f111af73..41bb952fa0 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 @@ -62,6 +62,14 @@ public interface ProjectService { **/ List getDifficultyRank(DifficultyRankFormDTO param); + /** + * 难点赌点-耗时最长|涉及部门最多|处理次数 + * + * @param formDTO + * @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO + */ + List difficultyRankMultic(DifficultyRankFormDTO formDTO); + /** * @Description 难点赌点-获取组织下拉框 * @NEI https://nei.netease.com/interface/detail/res/?pid=57068&id=321614 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 5a5097e7a1..027e108845 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 @@ -359,6 +359,42 @@ public class ProjectServiceImpl implements ProjectService { return result; } + /** + * 难点赌点-耗时最长|涉及部门最多|处理次数 + * + * @param formDTO + * @return com.epmet.project.dto.result.ProjectDifficultRankResultDTO + */ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + @Override + public List difficultyRankMultic(DifficultyRankFormDTO formDTO) { + //1、查询当前客户是否包含子客户 + //多客户测试写死值,别忘了注释掉呀 + // formDTO.setCustomerId("613cc61a6b8ce4c70d21bd413dac72cc"); + // formDTO.setAgencyId("30705f91f1295ae77d372b868596a5e7"); + Result> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); + if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { + log.warn("❤当前客户存在子客户❤"); + //2、查询组织信息 + Result agencyResult = govOrgOpenFeignClient.getAgencyById(formDTO.getAgencyId()); + if (!agencyResult.success() || null == agencyResult.getData()) { + throw new RenException(String.format("查询组织信息异常,agencyId:%s", formDTO.getAgencyId())); + } + formDTO.setAgencyAreaCode(agencyResult.getData().getAreaCode()); + } + // 3、升级原来的列表查询接口 + PageHelper.startPage(null == formDTO.getPageNo() ? NumConstant.ONE : formDTO.getPageNo(), formDTO.getTopNum()); + List result = projectDao.difficultyRankV2(formDTO); + for (int i = 0; i < result.size(); i++) { + List imgUrlList = projectDao.getDifficultyImgList(result.get(i).getProjectId()); + result.get(i).setImgUrlList(imgUrlList); + } + if (CollectionUtils.isEmpty(result)) { + return new ArrayList<>(); + } + return result; + } + @Override public List getCategoryDict(String customerId) { List result = new ArrayList<>(); 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 d06d7ac03d..73552407d7 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 @@ -267,6 +267,57 @@ DESC + + + + + + + + + + + diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java index d5be20752e..43c87b57b5 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -178,7 +178,7 @@ public interface ProjectConstant { String EVALUATE_GOOD = "good"; String EVALUATE_BAD = "bad"; String EVALUATE_PERFECT = "perfect"; - + String EVALUATE="evaluate"; /** * 三个月,六个月,12个月 */ diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java index acc06b2281..c1e07bf6bf 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectSatisfactionDetailServiceImpl.java @@ -20,16 +20,20 @@ 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.rocketmq.messages.ProjectChangedMQMsg; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; -import com.epmet.commons.tools.constant.FieldConstant; -import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.scan.param.TextScanParamDTO; import com.epmet.commons.tools.scan.param.TextTaskDTO; import com.epmet.commons.tools.scan.result.SyncScanResult; +import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.IpUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.ScanContentUtils; import com.epmet.constant.ProjectConstant; @@ -39,25 +43,28 @@ import com.epmet.dao.ProjectSatisfactionStatisticsDao; import com.epmet.dto.ProjectSatisfactionDetailDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; -import com.epmet.entity.ProjectEntity; import com.epmet.entity.ProjectSatisfactionDetailEntity; import com.epmet.entity.ProjectSatisfactionStatisticsEntity; +import com.epmet.feign.EpmetMessageOpenFeignClient; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.GovIssueOpenFeignClient; import com.epmet.redis.ProjectRedis; import com.epmet.redis.ProjectSatisfactionDetailRedis; +import com.epmet.send.SendMqMsgUtil; import com.epmet.service.ProjectSatisfactionDetailService; import com.epmet.service.ProjectSatisfactionStatisticsService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.redisson.api.RLock; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; +import javax.servlet.http.HttpServletRequest; import java.util.*; import java.util.stream.Collectors; @@ -91,6 +98,10 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl page(Map params) { @@ -240,6 +251,21 @@ public class ProjectSatisfactionDetailServiceImpl extends BaseServiceImpl Date: Wed, 23 Jun 2021 16:33:38 +0800 Subject: [PATCH 008/107] =?UTF-8?q?SATISFACTION=5FSCORE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/evaluationindex/screen/ScreenProjectDataDao.java | 4 +++- .../toscreen/impl/ScreenProjectSettleServiceImpl.java | 2 +- .../evaluationindex/screen/ScreenProjectDataService.java | 3 +++ .../screen/impl/ScreenProjectDataServiceImpl.java | 6 ++++++ .../mapper/evaluationindex/screen/ScreenProjectDataDao.xml | 5 +++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index 1cdb4a1e8d..e36868829c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -18,12 +18,12 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.math.BigDecimal; import java.util.List; /** @@ -46,4 +46,6 @@ public interface ScreenProjectDataDao extends BaseDao { void insertBatch(@Param("list") List list); void updateBatch(@Param("list") List list,@Param("dateId") String dateId); + + int updateProjectSatisfactionScore(@Param("projectId")String projectId, @Param("score")BigDecimal score); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java index 6ffe5b9e17..16d073b953 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -200,7 +200,7 @@ public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleServic } } projectIds.forEach(id->{ - projectService.calProjectSatisfactionScore(customerId,id); + targetDbService.updateProjectSatisfactionScore(id,projectService.calProjectSatisfactionScore(customerId,id)); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java index b6f2c25c15..7b82707c91 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java @@ -24,6 +24,7 @@ import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; +import java.math.BigDecimal; import java.util.List; import java.util.Map; @@ -124,4 +125,6 @@ public interface ScreenProjectDataService extends BaseService meta,List orient); + + int updateProjectSatisfactionScore(String projectId, BigDecimal calProjectSatisfactionScore); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index bf8c212f6b..b6e89552dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -41,6 +41,7 @@ import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import javax.annotation.Resource; +import java.math.BigDecimal; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; @@ -285,4 +286,9 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl + + + update screen_project_data set SATISFACTION_SCORE=#{score} + where PROJECT_ID=#{projectId} + From b25781f844cd9ce5ccf3e7ed3db6011779f10ecb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 23 Jun 2021 17:44:32 +0800 Subject: [PATCH 009/107] =?UTF-8?q?/gov/mine/agency/getlatestcustomer?= =?UTF-8?q?=E8=BF=94=E5=8F=82=E5=A2=9E=E5=8A=A0haveSubCustomer=E3=80=81sub?= =?UTF-8?q?CustomerIds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/result/LatestCustomerResultDTO.java | 11 +++++++++++ .../impl/CustomerStaffAgencyServiceImpl.java | 5 +++++ .../src/main/java/com/epmet/dto/CustomerDTO.java | 13 ++++++++++++- .../com/epmet/service/impl/CustomerServiceImpl.java | 11 ++++++++++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java index 3c96aa6df6..d111551123 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/LatestCustomerResultDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.result; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @author zhaoqifeng @@ -38,4 +39,14 @@ public class LatestCustomerResultDTO implements Serializable { * 性别0未知1男2女 */ private Integer gender; + + /** + * 是否有字客户 + */ + private Boolean haveSubCustomer; + + /** + * 子客户列表 + */ + private List subCustomerIds; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java index 536cfdb330..7b6a784a83 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerStaffAgencyServiceImpl.java @@ -129,6 +129,9 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl getLatestCustomer(String userId) { LatestCustomerResultDTO resultDTO = new LatestCustomerResultDTO(); + resultDTO.setHaveSubCustomer(false); + resultDTO.setSubCustomerIds(new ArrayList<>()); + CustomerStaffAgencyDTO customerStaffAgencyDTO = baseDao.selectLatestCustomerByStaff(userId); resultDTO.setAgencyId(customerStaffAgencyDTO.getAgencyId()); @@ -150,6 +153,8 @@ public class CustomerStaffAgencyServiceImpl extends BaseServiceImpl customerResult = operCrmFeignClient.getCustomerInfo(customerDTO); if (customerResult.success() && null != customerResult.getData()) { resultDTO.setCustomerName(customerResult.getData().getCustomerName()); + resultDTO.setHaveSubCustomer(customerResult.getData().getHaveSubCustomer()); + resultDTO.setSubCustomerIds(customerResult.getData().getSubCustomerIds()); }else{ log.warn(String.format("根据客户id:%s,查询客户信息失败",customerDTO.getId())); } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java index 8e752eb744..1f234a5f4f 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/dto/CustomerDTO.java @@ -17,9 +17,11 @@ package com.epmet.dto; +import lombok.Data; + import java.io.Serializable; import java.util.Date; -import lombok.Data; +import java.util.List; /** @@ -123,4 +125,13 @@ public class CustomerDTO implements Serializable { */ private Date updatedTime; + /** + * 06.21:扩展属性:是否有字客户 + */ + private Boolean haveSubCustomer; + + /** + * 06.21:扩展属性:子客户列表 + */ + private List subCustomerIds; } \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index c2677c0504..3abde74e8f 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -215,7 +215,16 @@ public class CustomerServiceImpl extends BaseServiceImpl getCustomerInfo(CustomerDTO dto) { CustomerEntity entity = baseDao.selectById(dto.getId()); - return new Result().ok(ConvertUtils.sourceToTarget(entity, CustomerDTO.class)); + List customerIds=customerRelationService.getAllSubCustomerIds(dto.getId()); + CustomerDTO customerDTO=ConvertUtils.sourceToTarget(entity, CustomerDTO.class); + if(CollectionUtils.isEmpty(customerIds)){ + customerDTO.setHaveSubCustomer(false); + customerDTO.setSubCustomerIds(new ArrayList<>()); + }else{ + customerDTO.setHaveSubCustomer(true); + customerDTO.setSubCustomerIds(customerIds); + } + return new Result().ok(customerDTO); } @Override From daf257506c84123013e06123b743da2b53a0d7a9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 24 Jun 2021 09:33:19 +0800 Subject: [PATCH 010/107] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=20=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseReportController.java | 56 +++--- .../com/epmet/dao/stats/BaseReportDao.java | 44 +++++ .../com/epmet/service/BaseReportService.java | 99 ++++++++++ .../service/impl/BaseReportServiceImpl.java | 180 ++++++++++++++++++ .../resources/mapper/stats/BaseReportDao.xml | 136 +++++++++++++ 5 files changed, 487 insertions(+), 28 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/BaseReportDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/BaseReportDao.xml 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/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/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/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() + ) + + + + + From 770fc866997abe371805ed42ee0b4556298a2810 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Jun 2021 14:31:10 +0800 Subject: [PATCH 011/107] =?UTF-8?q?=E7=BE=A4=E4=BC=97=E4=B8=8D=E6=BB=A1?= =?UTF-8?q?=E5=88=97=E8=A1=A8v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/MassesDiscontentFormV2DTO.java | 52 ++++++++++++++ .../project/MassesDiscontentResultV2DTO.java | 69 +++++++++++++++++++ .../project/constant/ProjectConstant.java | 7 ++ .../controller/project/ProjectController.java | 15 ++++ .../datareport/dao/project/ProjectDao.java | 18 +++++ .../service/project/ProjectService.java | 10 +++ .../project/impl/ProjectServiceImpl.java | 56 +++++++++++++++ .../resources/mapper/project/ProjectDao.xml | 41 +++++++++++ 8 files changed, 268 insertions(+) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/project/MassesDiscontentResultV2DTO.java 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..4c287c8158 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/project/MassesDiscontentFormV2DTO.java @@ -0,0 +1,52 @@ +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; + + 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/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-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 f114739e1a..1c4154f4cb 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 @@ -11,6 +11,8 @@ import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantity import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; 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; @@ -169,4 +171,17 @@ 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取值 + * @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/dao/project/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/project/ProjectDao.java index 81e0ce2a3a..f3f3922c13 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取值 + * @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/project/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/project/ProjectService.java index 41bb952fa0..27f510ac06 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取值 + * + * @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 027e108845..100ba5775c 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 @@ -501,4 +506,55 @@ public class ProjectServiceImpl implements ProjectService { } return resultList; } + + /** + * 群众不满列表,改为从指标库的screen_project_data取值 + * + * @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..882a7f7735 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 @@ -326,4 +326,45 @@ WHERE EVENT_ID = #{eventId} ORDER BY SORT + + + From d2b8e873fd116f1921df2ffb6e445fcdcf714099 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Jun 2021 14:34:26 +0800 Subject: [PATCH 012/107] =?UTF-8?q?=E7=BE=A4=E4=BC=97=E4=B8=8D=E6=BB=A1?= =?UTF-8?q?=E5=88=97=E8=A1=A8v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/datareport/controller/project/ProjectController.java | 1 + .../main/java/com/epmet/datareport/dao/project/ProjectDao.java | 2 +- .../com/epmet/datareport/service/project/ProjectService.java | 2 +- .../datareport/service/project/impl/ProjectServiceImpl.java | 2 +- .../src/main/resources/mapper/project/ProjectDao.xml | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) 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 1c4154f4cb..6f485e507e 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 @@ -177,6 +177,7 @@ public class ProjectController { * @param formDTO * @author yinzuomei * @description 群众不满列表,改为从指标库的screen_project_data取值 + * sql里面写死<75分的展示 * @Date 2021/6/24 11:13 **/ @PostMapping("massesdiscontent-multic") 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 f3f3922c13..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 @@ -92,7 +92,7 @@ public interface ProjectDao { * @param endDate * @param sortType * @author yinzuomei - * @description 群众不满列表,改为从指标库的screen_project_data取值 + * @description 群众不满列表,改为从指标库的screen_project_data取值 sql里面写死<75分的展示 * @Date 2021/6/24 13:16 **/ List selectMassesDiscontentMultic(@Param("agencyId") String agencyId, 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 27f510ac06..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 @@ -103,7 +103,7 @@ public interface ProjectService { List myNextAgencyMultic(String staffId,String currentCustomerId); /** - * 群众不满列表,改为从指标库的screen_project_data取值 + * 群众不满列表,改为从指标库的screen_project_data取值,sql里面写死<75分的展示 * * @param formDTO * @return com.epmet.dto.result.project.MassesDiscontentResultV2DTO 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 100ba5775c..86e137b842 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 @@ -508,7 +508,7 @@ public class ProjectServiceImpl implements ProjectService { } /** - * 群众不满列表,改为从指标库的screen_project_data取值 + * 群众不满列表,改为从指标库的screen_project_data取值,sql里面写死<75分的展示 * * @param formDTO * @return com.epmet.dto.result.project.MassesDiscontentResultV2DTO 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 882a7f7735..7566341c5a 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 @@ -327,7 +327,7 @@ ORDER BY SORT - + + + + 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 From 2949eadb68ea1f3e2c6998d7cc2f0389001e4a92 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 24 Jun 2021 17:07:54 +0800 Subject: [PATCH 015/107] /data/report/screen/agency/agencydetail-multic bug --- .../com/epmet/dto/result/AgencyDetailMulticResultDTO.java | 4 ++-- .../src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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 index 26cf12fa71..bdc2add52a 100644 --- 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 @@ -60,12 +60,12 @@ public class AgencyDetailMulticResultDTO implements Serializable { /** * 街道 */ - private String street; + private String street=""; /** * 社区 */ - private String community; + private String community=""; /** * open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参 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 2e13dde7fb..1968041c09 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 @@ -350,6 +350,6 @@ public interface GovOrgOpenFeignClient { * @description 根据customerId查询参数(area_code_switch)值open: 选择地区编码必填;closed: 无需选择地区编码;;0409新增返参;没配置,返回closed * @Date 2021/6/24 16:11 **/ - @PostMapping(value = "getAreaCodeSwitch/{customerId}") + @PostMapping(value = "/gov/org/customeragency/getAreaCodeSwitch/{customerId}") Result getAreaCodeSwitch(@PathVariable("customerId")String customerId); } From 9b0c2e18059ecdc33412eea99c92609020d65720 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 25 Jun 2021 09:13:00 +0800 Subject: [PATCH 016/107] /data/report/screen/agency/agencydetail-multic --- .../commons/tools/constant/Constant.java | 9 ++ .../result/AgencyDetailMulticResultDTO.java | 2 + .../screen/ScreenCustomerAgencyDao.java | 11 +++ .../screen/impl/AgencyServiceImpl.java | 98 +++++++++++++------ .../mapper/screen/ScreenCustomerAgencyDao.xml | 48 ++++++--- .../epmet/dto/result/ParentListResultDTO.java | 5 +- 6 files changed, 130 insertions(+), 43 deletions(-) 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 9ff138efe7..49681043e0 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 @@ -136,4 +136,13 @@ public interface Constant { String CREATED_TIME = "created_time"; String DEFAULT_CUSTOMER = "default"; + + /** + * 省级:province; 市级: city; 区县级: district ;乡(镇、街道)级:street ;社区级:community + */ + String PROVINCE = "province"; + String CITY = "city"; + String DISTRICT = "district"; + String STREET = "street"; + String COMMUNITY = "community"; } 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 index bdc2add52a..bcd8c3adf5 100644 --- 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 @@ -84,6 +84,7 @@ public class AgencyDetailMulticResultDTO implements Serializable { //以下参数是06.24新增 + private String rootAgencyId; private String parentAreaCode; /** * 是否有字客户 @@ -94,4 +95,5 @@ public class AgencyDetailMulticResultDTO implements Serializable { * 子客户列表 */ private List subCustomerIds; + } 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 d31eee8700..aed418f5ab 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 @@ -192,4 +192,15 @@ public interface ScreenCustomerAgencyDao { List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId); List selectPAgencyById(@Param("listStr")List pidList); + + /** + * @return com.epmet.dto.result.ScreenCustomerAgencyDTO + * @param customerId + * @author yinzuomei + * @description 根据客户id,返回当前客户下的跟组织信息 + * @Date 2021/6/24 17:43 + **/ + ScreenCustomerAgencyDTO selectCustomerRootAgency(String customerId); + + ScreenCustomerAgencyDTO selectByAreaCode(String areaCode); } \ No newline at end of file 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 722673691b..1d039d9f01 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,6 +2,7 @@ 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.exception.RenException; @@ -17,7 +18,10 @@ 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.*; +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.plugins.AgencyNodeDTO; import com.epmet.evaluationindex.screen.constant.ScreenConstant; @@ -39,6 +43,7 @@ import org.springframework.util.CollectionUtils; import java.util.ArrayList; import java.util.Arrays; +import java.util.Collections; import java.util.List; /** @@ -376,11 +381,17 @@ public class AgencyServiceImpl implements AgencyService { return agencysResultDTO; } agencysResultDTO = ConvertUtils.sourceToTarget(customerAgencyDTO, AgencyDetailMulticResultDTO.class); + //2、当前登录用户所属客户,的跟级组织 + ScreenCustomerAgencyDTO rootAgency=screenCustomerAgencyDao.selectCustomerRootAgency(formDTO.getCustomerId()); + agencysResultDTO.setRootlevel(rootAgency.getLevel()); + agencysResultDTO.setRootAgencyId(rootAgency.getAgencyId()); + //3、当前登录用户所属客户,是否开启了area_code开关 + agencysResultDTO.setAreaCodeSwitch(govOrgOpenFeignClient.getAreaCodeSwitch(formDTO.getCustomerId()).getData()); - agencysResultDTO.setAreaCodeSwitch(govOrgOpenFeignClient.getAreaCodeSwitch(customerAgencyDTO.getCustomerId()).getData()); - //如果当前客户不存在子客户则areaCode置为空 + //4、如果当前客户不存在子客户则areaCode置为空 Result> crmRes=operCrmOpenFeignClient.getAllSubCustomerIds(formDTO.getCustomerId()); if (crmRes.success() &&CollectionUtils.isEmpty(crmRes.getData())) { + //不存在子客户,则areaCode相关返参都默认为空字符串 agencysResultDTO.setAreaCode(StrConstant.EPMETY_STR); agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); agencysResultDTO.setParentAreaCode(StrConstant.EPMETY_STR); @@ -392,38 +403,63 @@ public class AgencyServiceImpl implements AgencyService { 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()); - } + if(agencysResultDTO.getHaveSubCustomer()){ + // 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop + // TODO + log.info("多客户版本parentList、level要重新赋值"); + ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); + agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); + List temp = getParentListMultic(parentList,parentAgency,formDTO.getCustomerId(),agencysResultDTO.getRootAgencyId()); + agencysResultDTO.setParentList(temp); + }else{ + //单客户 + //6:查询当前组织的所有上级组织,按自上而下层级顺序 + 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)); + } + if(!CollectionUtils.isEmpty(pidList)){ + //单客户,存在上级时查询... + agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList)); } } - //2021.5.26 sun 添加当前组织对应客户的根组织级别返参 end + return agencysResultDTO; + } - //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)); + private List getParentListMultic(List resList,ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) { + ParentListResultDTO resultDTO = new ParentListResultDTO(); + resultDTO.setId(firstParent.getAgencyId()); + resultDTO.setName(firstParent.getAgencyName()); + resultDTO.setLevel(firstParent.getLevel()); + resList.add(resultDTO); + if (firstParent.getCustomerId().equals(currentUserCustomerId) && firstParent.getAgencyId().equals(rootAgencyId)) { + Collections.reverse(resList); + return resList; + } else { + ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(firstParent.getParentAreaCode()); + return getParentListMultic(resList,parentAgency, currentUserCustomerId, rootAgencyId); } - agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList)); + } - return agencysResultDTO; + 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/resources/mapper/screen/ScreenCustomerAgencyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenCustomerAgencyDao.xml index 5a1e506707..0a076134ef 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 @@ -377,18 +377,44 @@ + + + + + diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java index 60683bf779..421ecabd25 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java @@ -19,7 +19,6 @@ package com.epmet.dto.result; import lombok.Data; -import javax.validation.constraints.NotBlank; import java.io.Serializable; @@ -43,4 +42,8 @@ public class ParentListResultDTO implements Serializable { private String name = ""; + /** + * 省级:province; 市级: city; 区县级: district ;乡(镇、街道)级:street ;社区级:community + */ + private String level=""; } \ No newline at end of file From cf764b1b6ffa7877c1106a65811d654b4b0a031f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 25 Jun 2021 09:43:44 +0800 Subject: [PATCH 017/107] =?UTF-8?q?/data/report/screen/project/projectdeta?= =?UTF-8?q?ilv2=E5=8F=8D=E5=8F=82=E5=A2=9E=E5=8A=A0projectTitle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/dto/result/ScreenProjectDetailResultDTO.java | 5 +++++ .../main/resources/mapper/screen/ScreenProjectDataDao.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java index 1c7391dd93..a52300cc0b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java @@ -24,6 +24,11 @@ public class ScreenProjectDetailResultDTO implements Serializable { * 项目id */ private String projectId; + /** + * 项目标题 + */ + private String projectTitle; + /** * 议题内容,其实就是项目内容 */ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index 0f0cb8c58c..fcfd484a42 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -60,6 +60,7 @@ + + + + + + \ No newline at end of file From 0106659777941bcd31dd177c825568bb7d44e2b8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 25 Jun 2021 09:46:16 +0800 Subject: [PATCH 019/107] =?UTF-8?q?=E6=A5=BC=E6=A2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/datareport/controller/screen/AgencyController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 628157c757..6c71a15009 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 @@ -125,7 +125,7 @@ public class AgencyController { **/ @PostMapping("agencydetail-multic") public Result queryAgencyDetailMultiC(@LoginUser TokenDto tokenDto, @RequestBody AgencyDetailMulticFormDTO formDTO){ - // formDTO.setCustomerId(tokenDto.getCustomerId()); + formDTO.setCustomerId(tokenDto.getCustomerId()); ValidatorUtils.validateEntity(formDTO, AgencyDetailMulticFormDTO.AddUserInternalGroup.class); return new Result().ok(agencyService.queryAgencyDetailMultiC(formDTO)); } From 784c5b6e10d6a3cfdd8df42570d9c180e8ea296f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 25 Jun 2021 09:58:01 +0800 Subject: [PATCH 020/107] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E4=B8=8A=E6=8A=A5?= =?UTF-8?q?=E9=83=A8=E5=88=86=E6=8E=A5=E5=8F=A3=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/stats/BaseReportDao.java | 55 +++++++++++++++++-- .../service/impl/BaseReportServiceImpl.java | 40 ++++++++++++-- .../resources/mapper/stats/BaseReportDao.xml | 24 ++++++++ 3 files changed, 109 insertions(+), 10 deletions(-) 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 index d379ba229a..d60d287216 100644 --- 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 @@ -1,7 +1,6 @@ package com.epmet.dao.stats; -import com.epmet.dto.basereport.form.AgencyRegUserFormDTO; -import com.epmet.dto.basereport.form.GridRegUserFormDTO; +import com.epmet.dto.basereport.form.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -15,30 +14,74 @@ import java.util.List; 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); + + /** + * @Description 根据dateId删除客户网格群组总数数据 + * @author sun + */ + int delGridGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户网格群组总数数据 + * @author sun + */ + void insertBatchGridGroupTotal(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户组织群组总数数据 + * @author sun + */ + int delAgencyGroupTotal(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户组织群组总数数据 + * @author sun + */ + void insertBatchAgencyGroupTotal(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户网格热议话题数据 + * @author sun + */ + int delGridHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户网格热议话题数据 + * @author sun + */ + void insertBatchGridHotTopic(@Param("list") List dataList); + + /** + * @Description 根据dateId删除客户组织热议话题数据 + * @author sun + */ + int delAgencyHotTopic(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 批量新增客户组织热议话题数据 + * @author sun + */ + void insertBatchAgencyHotTopic(@Param("list") List dataList); } 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 5551d2749b..5c4f341e8d 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 @@ -66,7 +66,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void gridGroupTotal(GridGroupTotalFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridGroupTotal(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchGridGroupTotal(formDTO.getDataList()); + } } /** @@ -77,7 +85,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void agencyGroupTotal(AgencyGroupTotalFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyGroupTotal(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchAgencyGroupTotal(formDTO.getDataList()); + } } /** @@ -88,7 +104,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void gridHotTopic(GridHotTopicFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridHotTopic(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchGridHotTopic(formDTO.getDataList()); + } } /** @@ -99,7 +123,15 @@ public class BaseReportServiceImpl implements BaseReportService { @Override @Transactional(rollbackFor = Exception.class) public void agencyHotTopic(AgencyHotTopicFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyHotTopic(formDTO.getDataList().get(0).getCustomerId(), formDTO.getDataList().get(0).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseReportDao.insertBatchAgencyHotTopic(formDTO.getDataList()); + } } /** 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 index 8c3e4a4056..45f112c07b 100644 --- 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 @@ -132,5 +132,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + From 3a9560f9beae27034aa3a0ec395a608b0fcde91f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 25 Jun 2021 10:00:19 +0800 Subject: [PATCH 021/107] /data/report/screen/project/projectdetailv2 --- .../mapper/screen/ScreenProjectDataDao.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index fcfd484a42..f45f13aadc 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -60,14 +60,14 @@ + 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 c3a5c39d6a..af8d39f643 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 @@ -77,5 +77,24 @@ del_flag = '0' AND parent_agency_id = #{agencyId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index e93b4eba0c..8377391764 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -349,6 +349,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setSatisfactionCount(dto.getCount()); + entity.setClosedProjectCount(dto.getSum()); } })); } @@ -360,6 +362,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal selfCount = new BigDecimal(grid.getCount()); if (grid.getSum() != NumConstant.ZERO) { entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setGovernCount(grid.getCount()); + entity.setClosedCount(grid.getSum()); } })); } @@ -372,6 +376,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResponseCount(dto.getCount()); + entity.setTransferCount(dto.getSum()); } })); } @@ -384,6 +390,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResolvedCount(dto.getCount()); + entity.setClosedCount(dto.getSum()); } })); } @@ -423,6 +431,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setSatisfactionCount(dto.getCount()); + entity.setClosedProjectCount(dto.getSum()); } })); } @@ -435,6 +445,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResponseCount(dto.getCount()); + entity.setTransferCount(dto.getSum()); } })); } @@ -446,6 +458,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setGovernCount(dto.getCount()); + entity.setClosedCount(dto.getSum()); } })); } @@ -458,6 +472,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResolvedCount(dto.getCount()); + entity.setClosedCount(dto.getSum()); } })); } @@ -496,6 +512,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setSatisfactionCount(dto.getCount()); + entity.setClosedProjectCount(dto.getSum()); } })); } @@ -508,6 +526,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResponseCount(dto.getCount()); + entity.setTransferCount(dto.getSum()); } })); } @@ -519,6 +539,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setGovernCount(dto.getCount()); + entity.setClosedCount(dto.getSum()); } })); } @@ -531,6 +553,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResolvedCount(dto.getCount()); + entity.setClosedCount(dto.getSum()); } })); } @@ -569,6 +593,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setSatisfactionCount(dto.getCount()); + entity.setClosedProjectCount(dto.getSum()); } })); } @@ -581,6 +607,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResponseCount(dto.getCount()); + entity.setTransferCount(dto.getSum()); } })); } @@ -592,6 +620,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setGovernCount(dto.getCount()); + entity.setClosedCount(dto.getSum()); } })); } @@ -604,6 +634,8 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setResolvedCount(dto.getCount()); + entity.setClosedCount(dto.getSum()); } })); } From 80d70bc15571df05e033c6398d81ffc6cdd09723 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Jun 2021 14:01:30 +0800 Subject: [PATCH 033/107] =?UTF-8?q?emm=20=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgencyTopicIssueFormDTO.java | 8 +- .../form/AgencyTopicStatusFormDTO.java | 8 +- .../dto/basereport/form/GridIssueFormDTO.java | 8 +- .../form/GridTopicIssueFormDTO.java | 8 +- .../form/GridTopicStatusFormDTO.java | 8 +- .../controller/BaseReportController.java | 45 ++- .../com/epmet/dao/stats/BaseReportDao.java | 86 +++++ .../com/epmet/service/BaseReportService.java | 16 +- .../service/impl/BaseReportServiceImpl.java | 71 +++- .../resources/mapper/stats/BaseReportDao.xml | 322 ++++++++++++++++++ 10 files changed, 533 insertions(+), 47 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java index 6de6fd913f..046b947bec 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicIssueFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.util.List; @@ -13,6 +15,8 @@ import java.util.List; public class AgencyTopicIssueFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface AgencyTopicIssueForm extends CustomerClientShowGroup{} + /** * 为true时需要删除历史数据 */ @@ -20,11 +24,11 @@ public class AgencyTopicIssueFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = AgencyTopicIssueForm.class) private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList{ /** * 客户Id diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java index db7b9f4942..6bb5eac899 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyTopicStatusFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -14,6 +16,8 @@ import java.util.List; public class AgencyTopicStatusFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface AgencyTopicStatusForm extends CustomerClientShowGroup{} + /** * 为true时需要删除历史数据 */ @@ -21,11 +25,11 @@ public class AgencyTopicStatusFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = AgencyTopicStatusForm.class) private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList { /** * 客户Id diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java index 5c6d2621a4..4fd03e434b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridIssueFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -14,6 +16,8 @@ import java.util.List; public class GridIssueFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface GridIssueForm extends CustomerClientShowGroup{} + /** * 为true时需要删除历史数据 */ @@ -21,11 +25,11 @@ public class GridIssueFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = GridIssueForm.class) private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList{ /** * 客户ID diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java index a0f9b4eefd..bd40463640 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicIssueFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -14,6 +16,8 @@ import java.util.List; public class GridTopicIssueFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface GridTopicIssueForm extends CustomerClientShowGroup{} + /** * 为true时需要删除历史数据 */ @@ -21,11 +25,11 @@ public class GridTopicIssueFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = GridTopicIssueForm.class) private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList{ /** * 客户Id diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java index 4e19bc1125..519ea28a37 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridTopicStatusFormDTO.java @@ -1,7 +1,9 @@ package com.epmet.dto.basereport.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotEmpty; import java.io.Serializable; import java.math.BigDecimal; import java.util.List; @@ -14,6 +16,8 @@ import java.util.List; public class GridTopicStatusFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface GridTopicStatusForm extends CustomerClientShowGroup{} + /** * 为true时需要删除历史数据 */ @@ -21,11 +25,11 @@ public class GridTopicStatusFormDTO implements Serializable { /** * 数据集合对象 */ + @NotEmpty(message = "数据集合对象不能为空",groups = GridTopicStatusForm.class) private List dataList; @Data - public class DataList implements Serializable { - private static final long serialVersionUID = 1L; + public static class DataList{ /** * 客户Id 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 1db8161221..f8990a9a8f 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 @@ -94,64 +94,75 @@ public class BaseReportController { } /** + * @Description 网格状态话题数据-008 * @Param formDTO - * @Description 网格状态话题数据 - * @author sun + * @author zxc + * @date 2021/6/25 3:09 下午 */ @PostMapping("gridtopicstatus") public Result gridTopicStatus(@RequestBody GridTopicStatusFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridTopicStatusFormDTO.GridTopicStatusForm.class); baseReportService.gridTopicStatus(formDTO); return new Result(); } /** + * @Description 组织状态话题数据-007 * @Param formDTO - * @Description 组织状态话题数据 - * @author sun + * @author zxc + * @date 2021/6/25 3:09 下午 */ @PostMapping("agencytopicstatus") public Result agencyTopicStatus(@RequestBody AgencyTopicStatusFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyTopicStatusFormDTO.AgencyTopicStatusForm.class); baseReportService.agencyTopicStatus(formDTO); return new Result(); } /** + * @Description 网格话题转议题数据-006 * @Param formDTO - * @Description 网格话题转议题数据 - * @author sun + * @author zxc + * @date 2021/6/25 1:51 下午 */ @PostMapping("gridtopicissue") public Result gridTopicIssue(@RequestBody GridTopicIssueFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridTopicIssueFormDTO.GridTopicIssueForm.class); baseReportService.gridTopicIssue(formDTO); return new Result(); } /** + * @Description 组织话题转议题数据-005 * @Param formDTO - * @Description 组织话题转议题数据 - * @author sun + * @author zxc + * @date 2021/6/25 1:50 下午 */ @PostMapping("agencytopicissue") public Result agencyTopicIssue(@RequestBody AgencyTopicIssueFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, AgencyTopicIssueFormDTO.AgencyTopicIssueForm.class); baseReportService.agencyTopicIssue(formDTO); return new Result(); } /** + * @Description 网格议题数据-004 * @Param formDTO - * @Description 网格议题数据 - * @author sun + * @author zxc + * @date 2021/6/25 1:50 下午 */ @PostMapping("gridissue") public Result gridIssue(@RequestBody GridIssueFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, GridIssueFormDTO.GridIssueForm.class); baseReportService.gridIssue(formDTO); return new Result(); } /** + * @Description 组织议题数据-003 * @Param formDTO - * @Description 组织议题数据 - * @author sun + * @author zxc + * @date 2021/6/25 1:50 下午 */ @PostMapping("agencyissue") public Result agencyIssue(@RequestBody AgencyIssueFormDTO formDTO) { @@ -161,9 +172,10 @@ public class BaseReportController { } /** + * @Description 网格项目数据-002 * @Param formDTO - * @Description 网格项目数据 - * @author sun + * @author zxc + * @date 2021/6/25 1:50 下午 */ @PostMapping("gridproject") public Result gridProject(@RequestBody GridProjectFormDTO formDTO) { @@ -173,9 +185,10 @@ public class BaseReportController { } /** + * @Description 组织项目数据-001 * @Param formDTO - * @Description 组织项目数据 - * @author sun + * @author zxc + * @date 2021/6/25 1:50 下午 */ @PostMapping("agencyproject") public Result agencyProject(@RequestBody AgencyProjectFormDTO formDTO) { 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 index bb9b5a2c9d..66a80a58fe 100644 --- 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 @@ -138,4 +138,90 @@ public interface BaseReportDao { * @date 2021/6/25 10:54 上午 */ void insertAgencyIssue(@Param("list")List dataList); + + /** + * @Description 删除网格议题数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/25 2:00 下午 + */ + int delGridIssue(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 新增网格议题数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 2:00 下午 + */ + void insertGridIssue(@Param("list")List dataList); + + /** + * @Description 删除组织话题转议题数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/25 2:13 下午 + */ + int delAgencyTopicIssue(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 新增组织话题转议题数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 2:14 下午 + */ + void insertAgencyTopicIssue(@Param("list")List dataList); + + /** + * @Description 删除网格话题转议题数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/25 2:41 下午 + */ + int delGridTopicIssue(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 新增网格话题转议题数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 2:41 下午 + */ + void insertGridTopicIssue(@Param("list")List dataList); + + /** + * @Description 删除组织状态话题数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/25 3:17 下午 + */ + int delAgencyTopicStatus(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 增加组织状态话题数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 3:18 下午 + */ + void insertAgencyTopicStatus(@Param("list")List dataList); + + /** + * @Description 删除网格状态话题数据 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/6/25 3:30 下午 + */ + int delGridTopicStatus(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * @Description 增加网格状态话题数据 + * @Param dataList + * @author zxc + * @date 2021/6/25 3:30 下午 + */ + void insertGridTopicStatus(@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 b1bf097f58..50b5f3579d 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 @@ -53,56 +53,56 @@ public interface BaseReportService { /** * @Param formDTO - * @Description 网格状态话题数据 + * @Description 网格状态话题数据-008 * @author sun */ void gridTopicStatus(GridTopicStatusFormDTO formDTO); /** * @Param formDTO - * @Description 组织状态话题数据 + * @Description 组织状态话题数据-007 * @author sun */ void agencyTopicStatus(AgencyTopicStatusFormDTO formDTO); /** * @Param formDTO - * @Description 网格话题转议题数据 + * @Description 网格话题转议题数据-006 * @author sun */ void gridTopicIssue(GridTopicIssueFormDTO formDTO); /** * @Param formDTO - * @Description 组织话题转议题数据 + * @Description 组织话题转议题数据-005 * @author sun */ void agencyTopicIssue(AgencyTopicIssueFormDTO formDTO); /** * @Param formDTO - * @Description 网格议题数据 + * @Description 网格议题数据-004 * @author sun */ void gridIssue(GridIssueFormDTO formDTO); /** * @Param formDTO - * @Description 组织议题数据 + * @Description 组织议题数据-003 * @author sun */ void agencyIssue(AgencyIssueFormDTO formDTO); /** * @Param formDTO - * @Description 网格项目数据 + * @Description 网格项目数据-002 * @author sun */ void gridProject(GridProjectFormDTO formDTO); /** * @Param formDTO - * @Description 组织项目数据 + * @Description 组织项目数据-001 * @author sun */ void agencyProject(AgencyProjectFormDTO formDTO); 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 db2753e51e..b00c8cace6 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 @@ -142,62 +142,107 @@ public class BaseReportServiceImpl implements BaseReportService { /** * @Param formDTO - * @Description 网格状态话题数据 + * @Description 网格状态话题数据-008 * @author sun */ @Override @Transactional(rollbackFor = Exception.class) public void gridTopicStatus(GridTopicStatusFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridTopicStatus(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertGridTopicStatus(p); + }); } /** * @Param formDTO - * @Description 组织状态话题数据 + * @Description 组织状态话题数据-007 * @author sun */ @Override @Transactional(rollbackFor = Exception.class) public void agencyTopicStatus(AgencyTopicStatusFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyTopicStatus(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertAgencyTopicStatus(p); + }); } /** * @Param formDTO - * @Description 网格话题转议题数据 + * @Description 网格话题转议题数据-006 * @author sun */ @Override @Transactional(rollbackFor = Exception.class) public void gridTopicIssue(GridTopicIssueFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridTopicIssue(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertGridTopicIssue(p); + }); } /** * @Param formDTO - * @Description 组织话题转议题数据 + * @Description 组织话题转议题数据-005 * @author sun */ @Override @Transactional(rollbackFor = Exception.class) public void agencyTopicIssue(AgencyTopicIssueFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delAgencyTopicIssue(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertAgencyTopicIssue(p); + }); } /** * @Param formDTO - * @Description 网格议题数据 + * @Description 网格议题数据-004 * @author sun */ @Override @Transactional(rollbackFor = Exception.class) public void gridIssue(GridIssueFormDTO formDTO) { - + if (formDTO.getIsFirst()) { + int deleteNum; + do { + deleteNum = baseReportDao.delGridIssue(formDTO.getDataList().get(NumConstant.ZERO).getCustomerId(), formDTO.getDataList().get(NumConstant.ZERO).getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + List> partition = ListUtils.partition(formDTO.getDataList(), NumConstant.ONE_HUNDRED); + partition.forEach(p -> { + baseReportDao.insertGridIssue(p); + }); } /** * @Param formDTO - * @Description 组织议题数据 + * @Description 组织议题数据-003 * @author sun */ @Override @@ -217,7 +262,7 @@ public class BaseReportServiceImpl implements BaseReportService { /** * @Param formDTO - * @Description 网格项目数据 + * @Description 网格项目数据-002 * @author sun */ @Override @@ -237,7 +282,7 @@ public class BaseReportServiceImpl implements BaseReportService { /** * @Param formDTO - * @Description 组织项目数据 + * @Description 组织项目数据-001 * @author sun */ @Override 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 index 8f16d0462a..5bd8912385 100644 --- 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 @@ -606,4 +606,326 @@ ) + + + + INSERT INTO fact_issue_grid_daily + (ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + YEAR_ID, + QUARTER_ID, + MONTH_ID, + WEEK_ID, + DATE_ID, + ISSUE_INCR, + ISSUE_TOTAL, + SHIFT_PROJECT_INCR, + SHIFT_PROJECT_TOTAL, + SHIFT_PROJECT_PERCENT, + VOTING_INCR, + VOTING_TOTAL, + VOTING_PERCENT, + CLOSED_INCR, + CLOSED_RESOLVED_INCR, + CLOSED_UNRESOLVED_INCR, + CLOSED_TOTAL, + CLOSED_RESOLVED_TOTAL, + CLOSED_UNRESOLVED_TOTAL, + CLOSED_PERCENT, + CLOSED_RESOLVED_PERCENT, + CLOSED_UNRESOLVED_PERCENT, + CLOSED_CASE_INCR, + CLOSED_CASE_RESOLVED_INCR, + CLOSED_CASE_UNRESOLVED_INCR, + CLOSED_CASE_TOTAL, + CLOSED_CASE_RESOLVED_TOTAL, + CLOSED_CASE_UNRESOLVED_TOTAL, + CLOSED_CASE_RESOLVED_PERCENT, + CLOSED_CASE_UNRESOLVED_PERCENT, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + DEL_FLAG, + UPDATED_TIME) + VALUES + + ( + REPLACE(UUID(), '-', ''), + #{i.customerId}, + #{i.agencyId}, + #{i.gridId}, + #{i.yearId}, + #{i.quarterId}, + #{i.monthId}, + #{i.weekId}, + #{i.dateId}, + #{i.issueIncr}, + #{i.issueTotal}, + #{i.shiftProjectIncr}, + #{i.shiftProjectTotal}, + #{i.shiftProjectPercent}, + #{i.votingIncr}, + #{i.votingTotal}, + #{i.votingPercent}, + #{i.closedIncr}, + #{i.closedResolvedIncr}, + #{i.closedUnresolvedIncr}, + #{i.closedTotal}, + #{i.closedResolvedTotal}, + #{i.closedUnresolvedTotal}, + #{i.closedPercent}, + #{i.closedResolvedPercent}, + #{i.closedUnresolvedPercent}, + #{i.closedCaseIncr}, + #{i.closedCaseResolvedIncr}, + #{i.closedCaseUnresolvedIncr}, + #{i.closedCaseTotal}, + #{i.closedCaseResolvedTotal}, + #{i.closedCaseUnresolvedTotal}, + #{i.closedCaseResolvedPercent}, + #{i.closedCaseUnresolvedPercent}, + 0, + 'BASE_REPORT', + NOW(), + 'BASE_REPORT', + 0, + NOW() + ) + + + + + + DELETE FROM fact_issue_grid_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + + DELETE FROM fact_topic_issue_agency_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + + INSERT INTO fact_topic_issue_agency_daily + ( + ID, + CUSTOMER_ID, + PID, + AGENCY_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_TOTAL, + ISSUE_INCR, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + values + + ( + REPLACE(UUID(), '-', ''), + #{i.customerId}, + #{i.pid}, + #{i.agencyId}, + #{i.dateId}, + #{i.weekId}, + #{i.monthId}, + #{i.quarterId}, + #{i.yearId}, + #{i.issueTotal}, + #{i.issueIncr}, + 0, + 0, + 'BASE_REPORT', + NOW(), + 'BASE_REPORT', + NOW() + ) + + + + + + INSERT INTO fact_topic_issue_grid_daily + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_INCR, + ISSUE_TOTAL, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + values + + ( + REPLACE(UUID(), '-', ''), + #{i.customerId}, + #{i.agencyId}, + #{i.gridId}, + #{i.dateId}, + #{i.weekId}, + #{i.monthId}, + #{i.quarterId}, + #{i.yearId}, + #{i.issueIncr}, + #{i.issueTotal}, + 0, + 0, + 'BASE_REPORT', + NOW(), + 'BASE_REPORT', + NOW() + ) + + + + + + DELETE FROM fact_topic_issue_grid_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + + DELETE FROM fact_topic_status_agency_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + + + + + INSERT INTO fact_topic_status_agency_daily + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + PID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TOPIC_STATUS_ID, + TOPIC_COUNT, + TOPIC_PROPORTION, + TOPIC_INCREMENT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + values + + ( + REPLACE(UUID(), '-', ''), + #{i.customerId}, + #{i.agencyId}, + #{i.pid}, + #{i.dateId}, + #{i.weekId}, + #{i.monthId}, + #{i.quarterId}, + #{i.yearId}, + #{i.topicStatusId}, + #{i.topicCount}, + #{i.topicProportion}, + #{i.topicIncrement}, + 0, + 0, + 'BASE_REPORT', + NOW(), + 'BASE_REPORT', + NOW() + ) + + + + + + INSERT INTO fact_topic_status_grid_daily + ( + ID, + CUSTOMER_ID, + AGENCY_ID, + GRID_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TOPIC_STATUS_ID, + TOPIC_COUNT, + TOPIC_PROPORTION, + TOPIC_INCREMENT, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + values + + ( + REPLACE(UUID(), '-', ''), + #{i.customerId}, + #{i.agencyId}, + #{i.gridId}, + #{i.dateId}, + #{i.weekId}, + #{i.monthId}, + #{i.quarterId}, + #{i.yearId}, + #{i.topicStatusId}, + #{i.topicCount}, + #{i.topicProportion}, + #{i.topicIncrement}, + 0, + 0, + 'BASE_REPORT', + NOW(), + 'BASE_REPORT', + NOW() + ) + + + + + + DELETE FROM fact_topic_status_grid_daily + WHERE customer_id = #{customerId} + AND date_id = #{dateId} + LIMIT 1000 + From 5a1c83e59c489a3cd8de2d58986f33d35f66ade6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 28 Jun 2021 15:50:52 +0800 Subject: [PATCH 034/107] =?UTF-8?q?=E7=BE=A4=E4=BC=97=E4=B8=8D=E6=BB=A1?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.20__add_satisfaction_score.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql new file mode 100644 index 0000000000..7bc2a498dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql @@ -0,0 +1,2 @@ +-- epmet_evaluation_index库执行以下sql: 增加群众不满得分 +alter table screen_project_data add COLUMN `SATISFACTION_SCORE` decimal(10,6) DEFAULT NULL COMMENT '满意度得分' AFTER LATITUDE; From 17b98c4090ed95102859f3d5fefd07f9c5b60ae3 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 29 Jun 2021 10:05:39 +0800 Subject: [PATCH 035/107] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 10 +++++----- .../screen/ScreenGovernRankDataDailyDao.xml | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 7 deletions(-) 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 fd3115d370..a753c7f00a 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 @@ -1300,22 +1300,22 @@ public class DataStatsServiceImpl implements DataStatsService { } //1.查询组织直属网格列表【网格维度】 - List gridList = dataStatsDao.getSubGridList(formDTO.getAgencyId()); + List gridList = indexService.getSubGridList(formDTO.getAgencyId()); if (gridList.size() < NumConstant.ONE) { return resultList; } - List gridIds = gridList.stream().map(DimGridEntity::getId).collect(Collectors.toList()); + List gridIds = gridList.stream().map(ScreenCustomerGridDTO::getGridId).collect(Collectors.toList()); //2.按日期查找组织直属网格事件治理指数列表 List list = dataStatsDao.getGridGovern(gridIds, formDTO.getDateId()); //3.封装数据 - for (DimGridEntity gr : gridList) { + for (ScreenCustomerGridDTO gr : gridList) { GridGovrnResultDTO dto = new GridGovrnResultDTO(); - dto.setGridId(gr.getId()); + dto.setGridId(gr.getGridId()); dto.setGridName(gr.getGridName()); for (GridGovrnResultDTO re : list) { - if (gr.getId().equals(re.getGridId())) { + if (gr.getGridId().equals(re.getGridId())) { dto.setProblemResolvedCount(re.getProblemResolvedCount()); dto.setGroupSelfGovernRatio(re.getGroupSelfGovernRatio()); dto.setGridSelfGovernRatio(re.getGridSelfGovernRatio()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml index b38ec6cce5..b738c0f217 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenGovernRankDataDailyDao.xml @@ -52,7 +52,14 @@ 0 AS RESPONSE_RATIO, 0 AS RESOLVED_RATIO, 0 AS GOVERN_RATIO, - 0 AS SATISFACTION_RATIO + 0 AS SATISFACTION_RATIO, + 0 AS RESPONSE_COUNT, + 0 AS TRANSFER_COUNT, + 0 AS RESOLVED_COUNT, + 0 AS CLOSED_COUNT, + 0 AS GOVERN_COUNT, + 0 AS SATISFACTION_COUNT, + 0 AS CLOSED_PROJECT_COUNT FROM screen_customer_agency WHERE @@ -69,7 +76,14 @@ 0 AS RESPONSE_RATIO, 0 AS RESOLVED_RATIO, 0 AS GOVERN_RATIO, - 0 AS SATISFACTION_RATIO + 0 AS SATISFACTION_RATIO, + 0 AS RESPONSE_COUNT, + 0 AS TRANSFER_COUNT, + 0 AS RESOLVED_COUNT, + 0 AS CLOSED_COUNT, + 0 AS GOVERN_COUNT, + 0 AS SATISFACTION_COUNT, + 0 AS CLOSED_PROJECT_COUNT FROM screen_customer_grid WHERE From db8bbce4d84a5eda6e1cdf0e4bf1c712c97e220b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 29 Jun 2021 10:41:03 +0800 Subject: [PATCH 036/107] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=9E=8D=E5=90=88?= =?UTF-8?q?=E5=BC=95=E8=B5=B7=E7=9A=84=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E7=BB=84=E7=BB=87=E5=B1=82=E7=BA=A7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=BF=94=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/datastats/result/SubAgencyGroupResultDTO.java | 4 ++++ .../dto/datastats/result/SubAgencyIssueResultDTO.java | 4 ++++ .../datastats/result/SubAgencyProjectResultDTO.java | 4 ++++ .../dto/datastats/result/SubAgencyTopicResultDTO.java | 4 ++++ .../dto/datastats/result/SubAgencyUserResultDTO.java | 4 ++++ .../service/datastats/impl/DataStatsServiceImpl.java | 10 ++++++++++ 6 files changed, 30 insertions(+) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java index 144368c26e..8b0f229204 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyGroupResultDTO.java @@ -19,6 +19,10 @@ public class SubAgencyGroupResultDTO implements Serializable { private String agencyId; //组织名称 private String agencyName; + //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province + private String level; + //行政地区编码 + private String areaCode; //党群小组总数 private Integer groupTotal = 0; //楼院小组总数 diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java index 5bece9dab4..a13f9d158b 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyIssueResultDTO.java @@ -19,6 +19,10 @@ public class SubAgencyIssueResultDTO implements Serializable { private String agencyId; //组织名称 private String agencyName; + //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province + private String level; + //行政地区编码 + private String areaCode; //议题总数 private Integer issueTotal = 0; //表决中总数 diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java index 33aa889ad4..63b0c512ca 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyProjectResultDTO.java @@ -19,6 +19,10 @@ public class SubAgencyProjectResultDTO implements Serializable { private String agencyId; //组织名称 private String agencyName; + //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province + private String level; + //行政地区编码 + private String areaCode; //项目总数 private Integer projectTotal = 0; //处理中总数 diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java index bad0896389..3712128526 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyTopicResultDTO.java @@ -19,6 +19,10 @@ public class SubAgencyTopicResultDTO implements Serializable { private String agencyId; //组织名称 private String agencyName; + //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province + private String level; + //行政地区编码 + private String areaCode; //话题总数 private Integer topicTotal = 0; //热议中总数 diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java index a60c3ad76b..d1cc92cd8f 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/result/SubAgencyUserResultDTO.java @@ -19,6 +19,10 @@ public class SubAgencyUserResultDTO implements Serializable { private String agencyId; //组织名称 private String agencyName; + //机关级别[社区级:community;乡(镇、街道)级:street;区县级: district;市级: city;省级:province + private String level; + //行政地区编码 + private String areaCode; //用户总数 private Integer userTotal = 0; //党员总数 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 a753c7f00a..48bd39d76f 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 @@ -302,6 +302,8 @@ public class DataStatsServiceImpl implements DataStatsService { SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO(); dto.setAgencyId(sub.getAgencyId()); dto.setAgencyName(sub.getAgencyName()); + dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel()); + dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode()); for (SubAgencyUserResultDTO u : list) { if (sub.getAgencyId().equals(u.getAgencyId())) { dto.setUserTotal(u.getUserTotal()); @@ -438,6 +440,8 @@ public class DataStatsServiceImpl implements DataStatsService { SubAgencyGroupResultDTO dto = new SubAgencyGroupResultDTO(); dto.setAgencyId(sub.getAgencyId()); dto.setAgencyName(sub.getAgencyName()); + dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel()); + dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode()); for (SubAgencyGroupResultDTO u : list) { if (sub.getAgencyId().equals(u.getAgencyId())) { dto.setGroupTotal(u.getGroupTotal()); @@ -597,6 +601,8 @@ public class DataStatsServiceImpl implements DataStatsService { resultDTO.setAgencyId(sub.getAgencyId()); resultDTO.setAgencyName(sub.getAgencyName()); + resultDTO.setLevel(null == sub.getLevel() ? "" : sub.getLevel()); + resultDTO.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode()); resultDTO.setTopicTotal(topicTotal.get()); resultDTO.setDiscussingTotal(hotdiscussTotal.get()); resultDTO.setDiscussingRatio(resultDTO.getDiscussingTotal() == 0 || resultDTO.getTopicTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) resultDTO.getDiscussingTotal() / (float) resultDTO.getTopicTotal()))); @@ -758,6 +764,8 @@ public class DataStatsServiceImpl implements DataStatsService { SubAgencyIssueResultDTO dto = new SubAgencyIssueResultDTO(); dto.setAgencyId(sub.getAgencyId()); dto.setAgencyName(sub.getAgencyName()); + dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel()); + dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode()); for (SubAgencyIssueResultDTO u : list) { if (sub.getAgencyId().equals(u.getAgencyId())) { dto.setIssueTotal(u.getIssueTotal()); @@ -898,6 +906,8 @@ public class DataStatsServiceImpl implements DataStatsService { SubAgencyProjectResultDTO dto = new SubAgencyProjectResultDTO(); dto.setAgencyId(sub.getAgencyId()); dto.setAgencyName(sub.getAgencyName()); + dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel()); + dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode()); for (SubAgencyProjectResultDTO u : list) { if (sub.getAgencyId().equals(u.getAgencyId())) { dto.setProjectTotal(u.getProjectTotal()); From ff70c3e4d3545cea13e721f3835f01816849a4fc Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 29 Jun 2021 11:11:57 +0800 Subject: [PATCH 037/107] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E5=AD=90=E5=AE=A2=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/opercrm/CustomerRelationDao.java | 9 +++++++++ .../service/opercrm/CustomerRelation.java | 9 +++++++++ .../opercrm/impl/CustomerRelationImpl.java | 15 +++++++++++++++ .../mapper/opercrm/CustomerRelationDao.xml | 9 +++++++++ 4 files changed, 42 insertions(+) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java index ed7aef852a..4cca334ea8 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/opercrm/CustomerRelationDao.java @@ -13,4 +13,13 @@ import java.util.List; @Mapper public interface CustomerRelationDao { List selectUsedAreaCodeList(String areaCode); + + /** + * 根据customerId查询其所有下级子客户id + * @author zhaoqifeng + * @date 2021/6/29 11:04 + * @param customerId + * @return java.util.List + */ + List selectAllSubCustomerIds(String customerId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java index af0dc94e88..c53ce0348e 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java @@ -10,4 +10,13 @@ import java.util.List; */ public interface CustomerRelation { List selectUsedAreaCodeList(String areaCode); + + /** + * 是否有子客户 + * @author zhaoqifeng + * @date 2021/6/29 11:06 + * @param customerId + * @return boolean + */ + boolean haveSubCustomer(String customerId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java index 045232e1a7..13dd247d1b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java @@ -5,6 +5,7 @@ import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.opercrm.CustomerRelationDao; import com.epmet.dataaggre.service.opercrm.CustomerRelation; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -27,4 +28,18 @@ public class CustomerRelationImpl implements CustomerRelation { public List selectUsedAreaCodeList(String areaCode) { return customerRelationDao.selectUsedAreaCodeList(areaCode); } + + /** + * 是否有子客户 + * + * @param customerId + * @return boolean + * @author zhaoqifeng + * @date 2021/6/29 11:06 + */ + @Override + public boolean haveSubCustomer(String customerId) { + List list = customerRelationDao.selectAllSubCustomerIds(customerId); + return CollectionUtils.isNotEmpty(list); + } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml index 169a44070f..439efdb207 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/opercrm/CustomerRelationDao.xml @@ -14,4 +14,13 @@ AND cr.AREA_CODE LIKE concat(#{areaCode}, '%') AND cr.AREA_CODE != #{areaCode} + \ No newline at end of file From 042d42b28ea5c38d1baa1dc823cb2c66c9e1a82f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 29 Jun 2021 13:20:06 +0800 Subject: [PATCH 038/107] =?UTF-8?q?mynextagency-multic=E8=BF=94=E5=8F=82?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0areaCode?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ProjectNextAgencyResultDTO.java | 11 +++++++++++ .../service/project/impl/ProjectServiceImpl.java | 10 ++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java index 19a92f93bd..9aaf0b6050 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectNextAgencyResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.project.dto.result; +import com.epmet.commons.tools.constant.StrConstant; import lombok.Data; import java.io.Serializable; @@ -29,5 +30,15 @@ public class ProjectNextAgencyResultDTO implements Serializable { * */ private String orgType; + /** + * orgId对应的areaCode。 只有当前客户有子客户时,才会返回指,否则返回null或者空字符串 + * */ private String areaCode; + + public ProjectNextAgencyResultDTO(){ + this.orgId= StrConstant.EPMETY_STR; + this.orgName= StrConstant.EPMETY_STR; + this.orgType= StrConstant.EPMETY_STR; + this.areaCode= StrConstant.EPMETY_STR; + } } 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 4d35a8a9ea..9ae8baffc7 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 @@ -483,7 +483,10 @@ public class ProjectServiceImpl implements ProjectService { nextAgency.setOrgId(agencyDTO.getAgencyId()); nextAgency.setOrgName(agencyDTO.getAgencyName()); nextAgency.setOrgType("agency"); - nextAgency.setAreaCode(agencyDTO.getAreaCode()); + if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { + //只有当前客户存在子客户时,才返回areaCode + nextAgency.setAreaCode(agencyDTO.getAreaCode()); + } resultList.add(nextAgency); }); } @@ -502,7 +505,10 @@ public class ProjectServiceImpl implements ProjectService { grid.setOrgId(gridDTO.getGridId()); grid.setOrgName(gridDTO.getGridName()); grid.setOrgType("grid"); - grid.setAreaCode(gridDTO.getAreaCode()); + if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { + //只有当前客户存在子客户时,才返回areaCode + grid.setAreaCode(gridDTO.getAreaCode()); + } resultList.add(grid); }); } From 990dc8058414cca32f2b8f9b4a2d87861cebe152 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 29 Jun 2021 14:18:51 +0800 Subject: [PATCH 039/107] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/EvaluationIndexDao.java | 9 +++ .../datastats/impl/DataStatsServiceImpl.java | 81 ++++++++++--------- .../EvaluationIndexService.java | 9 +++ .../impl/EvaluationIndexServiceImpl.java | 13 +++ .../evaluationindex/EvaluationIndexDao.xml | 14 ++++ 5 files changed, 87 insertions(+), 39 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java index 392ec5991a..613700f3aa 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -67,4 +67,13 @@ public interface EvaluationIndexDao { * @return java.util.List */ ScreenGovernRankDataDailyDTO getGovernRankList(@Param("agencyIds") List agencyIds, @Param("dateId") String dateId); + + /** + * 获取组织信息 + * @author zhaoqifeng + * @date 2021/6/29 13:58 + * @param agencyId + * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO + */ + ScreenCustomerAgencyDTO getAgencyInfo(@Param("agencyId") String agencyId); } \ No newline at end of file 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 48bd39d76f..d70b3a3dfb 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 @@ -19,6 +19,7 @@ import com.epmet.dataaggre.entity.datastats.DimGridEntity; import com.epmet.dataaggre.entity.datastats.FactAgencyGovernDailyEntity; import com.epmet.dataaggre.service.datastats.DataStatsService; 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; @@ -46,6 +47,8 @@ public class DataStatsServiceImpl implements DataStatsService { private DataStatsDao dataStatsDao; @Autowired private EvaluationIndexService indexService; + @Autowired + private CustomerRelation customerRelation; /** @@ -1127,40 +1130,39 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } - if (OrgConstant.PROVINCE.equals(formDTO.getLevel()) || OrgConstant.CITY.equals(formDTO.getLevel()) || OrgConstant.DISTRICT.equals(formDTO.getLevel())) { - if (StringUtils.isNotBlank(formDTO.getAreaCode())) { + ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); + if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) { - List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), formDTO.getAreaCode()); - if (CollectionUtils.isEmpty(subAgencyIds)) { - subAgencyIds = new ArrayList<>(); - } - subAgencyIds.add(formDTO.getAgencyId()); - List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); - if (CollectionUtils.isNotEmpty(list)) { - //问题解决总数 - Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getProblemResolvedCount).sum(); - //未出小组即未转议题的:话题关闭已解决数 - Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicResolvedCount).sum(); - //未出小组即未转议题的:话题关闭无需解决数 - Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicUnResolvedCount).sum(); - //未出当前网格的,结案项目数 - Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getGridSelfGovernProjectTotal).sum(); - //由社区结案的项目总数 - Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getCommunityClosedCount).sum(); - //由街道结案的项目总数 - Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getStreetClosedCount).sum(); - //由区直部门结案的项目总数 - Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getDistrictDeptClosedCount).sum(); - - resultDTO.setProblemResolvedCount(problemResolvedCount); - resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); - resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); - resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); - resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); - resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); - - return resultDTO; - } + List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); + if (CollectionUtils.isEmpty(subAgencyIds)) { + subAgencyIds = new ArrayList<>(); + } + subAgencyIds.add(formDTO.getAgencyId()); + List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); + if (CollectionUtils.isNotEmpty(list)) { + //问题解决总数 + Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getProblemResolvedCount).sum(); + //未出小组即未转议题的:话题关闭已解决数 + Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicResolvedCount).sum(); + //未出小组即未转议题的:话题关闭无需解决数 + Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicUnResolvedCount).sum(); + //未出当前网格的,结案项目数 + Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getGridSelfGovernProjectTotal).sum(); + //由社区结案的项目总数 + Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getCommunityClosedCount).sum(); + //由街道结案的项目总数 + Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getStreetClosedCount).sum(); + //由区直部门结案的项目总数 + Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getDistrictDeptClosedCount).sum(); + + resultDTO.setProblemResolvedCount(problemResolvedCount); + resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); + resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); + resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); + resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); + resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); + + return resultDTO; } } //1.按日期查询当前组织事件治理指数 @@ -1201,8 +1203,9 @@ public class DataStatsServiceImpl implements DataStatsService { return resultList; } List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); - if (StringUtils.isNotBlank(formDTO.getAreaCode())) { - List subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); + ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); + if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) { + List subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode()); agencyIds = subAgencies.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); subAgencyList = subAgencies.stream().map(item -> { DimAgencyEntity entity = new DimAgencyEntity(); @@ -1377,10 +1380,10 @@ public class DataStatsServiceImpl implements DataStatsService { SimpleDateFormat format = new SimpleDateFormat(DateUtils.DATE_PATTERN_YYYYMMDD); formDTO.setDateId(format.format(yesterday)); } - - if (OrgConstant.PROVINCE.equals(formDTO.getLevel()) || OrgConstant.CITY.equals(formDTO.getLevel()) || OrgConstant.DISTRICT.equals(formDTO.getLevel())) { - if (StringUtils.isNotBlank(formDTO.getAreaCode())) { - ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), formDTO.getAreaCode(), formDTO.getDateId()); + if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { + ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getOrgId()); + if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) { + ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount())); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java index fe6fef6bfc..ae8849e81d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -49,4 +49,13 @@ public interface EvaluationIndexService { * @return java.util.List */ ScreenGovernRankDataDailyDTO getGovernRank(String agencyId, String areaCode, String dateId); + + /** + * 获取组织信息 + * @author zhaoqifeng + * @date 2021/6/29 13:57 + * @param agencyId + * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO + */ + ScreenCustomerAgencyDTO getAgencyInfo(String agencyId); } 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 96c86d7d53..c4c45b0fd2 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 @@ -90,4 +90,17 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { return evaluationIndexDao.getGovernRankList(agencyIdList, dateId); } + /** + * 获取组织信息 + * + * @param agencyId + * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO + * @author zhaoqifeng + * @date 2021/6/29 13:57 + */ + @Override + public ScreenCustomerAgencyDTO getAgencyInfo(String agencyId) { + return evaluationIndexDao.getAgencyInfo(agencyId); + } + } 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 af8d39f643..188b3e5c58 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 @@ -96,5 +96,19 @@ AND ORG_TYPE = 'agency' AND DATE_ID = #{dateId} + \ No newline at end of file From 01e18463b42fa9030768fee347f35b2716e8029a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 29 Jun 2021 14:29:44 +0800 Subject: [PATCH 040/107] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=9E=8D=E5=90=88?= =?UTF-8?q?=E5=BC=95=E8=B5=B7=E7=9A=84=E6=9F=A5=E8=AF=A2=E8=B0=83=E6=95=B4?= =?UTF-8?q?=EF=BC=8C=E5=90=8E=E7=AB=AF=E5=A4=84=E7=90=86=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E9=9C=80=E8=A6=81=E5=89=8D=E7=AB=AF=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=8F=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../form/AgenctBasicDataFormDTO.java | 8 ----- .../dto/datastats/form/SubAgencyFormDTO.java | 4 --- .../evaluationindex/EvaluationIndexDao.java | 6 ++++ .../datastats/impl/DataStatsServiceImpl.java | 27 +++++++------- .../EvaluationIndexService.java | 13 +++++++ .../impl/EvaluationIndexServiceImpl.java | 35 +++++++++++++++++++ .../evaluationindex/EvaluationIndexDao.xml | 15 ++++++++ 7 files changed, 82 insertions(+), 26 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java index df3e286b57..9f8c5fd1b1 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/AgenctBasicDataFormDTO.java @@ -24,14 +24,6 @@ public class AgenctBasicDataFormDTO implements Serializable { * 日维度Id */ private String dateId; - /** - * 机关级别(社区级:community, 乡(镇、街道)级:street, 区县级: district, 市级: city 省级:province) - */ - private String level; - /** - * 行政地区编码 - */ - private String areaCode; public interface Agency extends CustomerClientShowGroup{} } diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java index be7ef9bb75..4789d534dd 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/datastats/form/SubAgencyFormDTO.java @@ -23,10 +23,6 @@ public class SubAgencyFormDTO implements Serializable { * 日维度Id */ private String dateId; - /** - * 行政地区编码 - */ - private String areaCode; /** * 排序类型字段 * 用户【用户:user 党员:party 居民:resi】 diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java index 613700f3aa..878e376bce 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -76,4 +76,10 @@ public interface EvaluationIndexDao { * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO */ ScreenCustomerAgencyDTO getAgencyInfo(@Param("agencyId") String agencyId); + + /** + * @Description 查询agencyId对应组织信息 + * @author sun + */ + ScreenCustomerAgencyDTO getByAgencyId(@Param("agencyId") String agencyId); } \ No newline at end of file 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 d70b3a3dfb..04676609bc 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 @@ -71,10 +71,9 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setDateId(format.format(yesterday)); } - //0.判断level是否有值,有值判断areaCode是否有值,没值直接用agencyId查数据,有值查询不是当前agencyId对应客户的areaCode的下级组织列表 - if(StringUtils.isNotBlank(formDTO.getLevel())&&!"community".equals(formDTO.getLevel())&&StringUtils.isNotBlank(formDTO.getAreaCode())){ - agencyList = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), formDTO.getAreaCode()); - } + //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 + agencyList = indexService.getAgencyIdsByAgencyId(formDTO.getAgencyId()); + agencyList.add(formDTO.getAgencyId()); agencyList.add(formDTO.getAgencyId()); //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 @@ -290,8 +289,8 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setType("user"); } - //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查 - List subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); + //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); if (subAgencyList.size() < NumConstant.ONE) { return resultList; } @@ -428,8 +427,8 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setType("group"); } - //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查 - List subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); + //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); if (subAgencyList.size() < NumConstant.ONE) { return resultList; } @@ -563,8 +562,8 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setType("topic"); } - //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查 - List subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); + //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); if (subAgencyList.size() < NumConstant.ONE) { return resultList; } @@ -752,8 +751,8 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setType("issue"); } - //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查 - List subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); + //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); if (subAgencyList.size() < NumConstant.ONE) { return resultList; } @@ -894,8 +893,8 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setType("project"); } - //1.查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查 - List subAgencyList = indexService.getSubAgencyList(formDTO.getAgencyId(), formDTO.getAreaCode()); + //1.查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + List subAgencyList = indexService.getSubAgencyListByAgency(formDTO.getAgencyId()); if (subAgencyList.size() < NumConstant.ONE) { return resultList; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java index ae8849e81d..43be38a84f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/evaluationindex/EvaluationIndexService.java @@ -58,4 +58,17 @@ public interface EvaluationIndexService { * @return com.epmet.dataaggre.dto.evaluationindex.ScreenCustomerAgencyDTO */ ScreenCustomerAgencyDTO getAgencyInfo(String agencyId); + + /** + * @Description 根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 + * @author sun + */ + List getAgencyIdsByAgencyId(String agencyId); + + /** + * @Description 查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + * @author sun + */ + List getSubAgencyListByAgency(String agencyId); + } 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 c4c45b0fd2..c9fa3bf7d2 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 @@ -11,6 +11,7 @@ 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.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; @@ -32,6 +33,8 @@ import java.util.List; public class EvaluationIndexServiceImpl implements EvaluationIndexService { @Autowired private EvaluationIndexDao evaluationIndexDao; + @Autowired + private CustomerRelation customerRelation; /** * @Param formDTO @@ -103,4 +106,36 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { return evaluationIndexDao.getAgencyInfo(agencyId); } + /** + * @Description 根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 + * @author sun + */ + @Override + public List getAgencyIdsByAgencyId(String agencyId) { + //1.查询agencyId对应组织信息 + ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); + //2.判断客户是否存在子客户 + if (!customerRelation.haveSubCustomer(dto.getCustomerId())) { + return new ArrayList<>(); + } + //3.存在子客户的,查询当前组织的areaCode对应的直属下级且不是agencyId对应的客户id的客户组织列表 + return evaluationIndexDao.getAgencyByAreaCodeAgencyId(agencyId, dto.getAreaCode()); + } + + /** + * @Description 查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + * @author sun + */ + @Override + public List getSubAgencyListByAgency(String agencyId) { + //1.查询agencyId对应组织信息 + ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); + //2.判断客户是否存在子客户 + if (!customerRelation.haveSubCustomer(dto.getCustomerId())) { + return evaluationIndexDao.getSubAgencyList(agencyId, null); + } else { + return evaluationIndexDao.getSubAgencyList(null, dto.getAreaCode()); + } + } + } 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 188b3e5c58..b76960a3d2 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 @@ -111,4 +111,19 @@ and AGENCY_ID = #{agencyId} + + \ No newline at end of file From 02e5d4d0bbcd7493685aa83a24d8d713cb2db2fd Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 29 Jun 2021 14:53:36 +0800 Subject: [PATCH 041/107] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=86=97=E4=BD=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/service/datastats/impl/DataStatsServiceImpl.java | 1 - 1 file changed, 1 deletion(-) 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 04676609bc..d3a596036f 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 @@ -74,7 +74,6 @@ public class DataStatsServiceImpl implements DataStatsService { //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 agencyList = indexService.getAgencyIdsByAgencyId(formDTO.getAgencyId()); agencyList.add(formDTO.getAgencyId()); - agencyList.add(formDTO.getAgencyId()); //1.查询组织下注册用户最新日统计数据【只查询注册用户的统计数据,不涉及参与用户的】 List userList = dataStatsDao.getAgnecyRegUser(agencyList, formDTO.getDateId()); From 6b7bca2b5b621ae77a5e0701ecde98ba0d879f97 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 29 Jun 2021 15:26:24 +0800 Subject: [PATCH 042/107] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/datastats/DatsStatsDao.xml | 2 +- .../epmet/service/impl/GovernanceDataReportServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 204b82442e..7b4361e463 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 @@ -677,7 +677,7 @@ STREET_CLOSED_COUNT, DISTRICT_DEPT_CLOSED_COUNT FROM - fact_grid_govern_daily + fact_agency_govern_daily WHERE DEL_FLAG = '0' AND DATE_ID = #{dateId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java index 58e40fc7fc..63e588c647 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/GovernanceDataReportServiceImpl.java @@ -69,7 +69,7 @@ public class GovernanceDataReportServiceImpl implements GovernanceDataReportServ */ @Override public void insertAgencyGovernDaily(AgencyGovernDailyFormDTO formDTO, String customerId) { - if (StringUtils.isEmpty(formDTO.getDateId()) || formDTO.getDateId().length() != NumConstant.SIX) { + if (StringUtils.isEmpty(formDTO.getDateId()) || formDTO.getDateId().length() != NumConstant.EIGHT) { throw new RenException("dateId格式应为: yyyyMMdd,当前传入:" + formDTO.getDateId()); } if (formDTO.getIsFirst()) { @@ -95,7 +95,7 @@ public class GovernanceDataReportServiceImpl implements GovernanceDataReportServ */ @Override public void insertGridGovernDaily(GridGovernDailyFormDTO formDTO, String customerId) { - if (StringUtils.isEmpty(formDTO.getDateId()) || formDTO.getDateId().length() != NumConstant.SIX) { + if (StringUtils.isEmpty(formDTO.getDateId()) || formDTO.getDateId().length() != NumConstant.EIGHT) { throw new RenException("dateId格式应为: yyyyMMdd,当前传入:" + formDTO.getDateId()); } if (formDTO.getIsFirst()) { From 7a2ee528bfb8f2069fc1cc68ad96da5d9eb7fcba Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 29 Jun 2021 16:23:06 +0800 Subject: [PATCH 043/107] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/ScreenProjectDetailResultDTO.java | 4 +- .../datareport/redis/DataReportRedis.java | 39 +++++++++++++++++++ .../screen/impl/AgencyServiceImpl.java | 12 +++++- .../java/com/epmet/redis/CustomerRedis.java | 32 +++++++++++++++ .../impl/CustomerRelationServiceImpl.java | 23 ++++++++++- 5 files changed, 105 insertions(+), 5 deletions(-) create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java index 287703b6ef..ece032ba4d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java @@ -26,7 +26,7 @@ public class ScreenProjectDetailResultDTO implements Serializable { */ private String projectId; /** - * 项目标题 + * 项目标题,06.25新增,工作端小程序难点赌点+群众不满详情用 */ private String projectTitle; @@ -73,7 +73,7 @@ public class ScreenProjectDetailResultDTO implements Serializable { private List processList; /** - * 满意度得分 + * 满意度得分 06.25新增,这个返参目前大屏和工作端小程序都没有用到,工作端小程序详情的得分是取得列表返回去的值 */ private BigDecimal score; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java new file mode 100644 index 0000000000..f9bdc24a1e --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/redis/DataReportRedis.java @@ -0,0 +1,39 @@ +package com.epmet.datareport.redis; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.map.MapUtil; +import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.result.AgencyDetailMulticResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.util.Map; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/6/29 15:46 + */ +@Component +public class DataReportRedis { + @Autowired + private RedisUtils redisUtils; + private String agencyDetailKeyPrefix="epmet:screen:"; + + public AgencyDetailMulticResultDTO queryAgencyDetailMulticResultDTO(String customerId, String agencyId) { + String agencyDetailKey=agencyDetailKeyPrefix.concat(customerId).concat(":").concat(agencyId); + Map map = redisUtils.hGetAll(agencyDetailKey); + if (MapUtil.isEmpty(map)) { + return null; + } + AgencyDetailMulticResultDTO dto = BeanUtil.mapToBean(map, AgencyDetailMulticResultDTO.class, true); + return dto; + } + + public void setAgencyDetailMulticResultDTO(String customerId, String agencyId, AgencyDetailMulticResultDTO agencysResultDTO) { + String agencyDetailKey = agencyDetailKeyPrefix.concat(customerId).concat(":").concat(agencyId); + Map map = BeanUtil.beanToMap(agencysResultDTO); + redisUtils.hMSet(agencyDetailKey, map, RedisUtils.DEFAULT_EXPIRE); + } +} 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 1d039d9f01..d8c9efc155 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 @@ -12,6 +12,7 @@ import com.epmet.commons.tools.utils.Result; 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.ScreenCustomerGridDTO; @@ -67,6 +68,8 @@ public class AgencyServiceImpl implements AgencyService { private GovOrgOpenFeignClient govOrgOpenFeignClient; @Autowired private OperCrmOpenFeignClient operCrmOpenFeignClient; + @Autowired + private DataReportRedis dataReportRedis; /** * @Description 1、组织机构树 @@ -371,7 +374,12 @@ public class AgencyServiceImpl implements AgencyService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override public AgencyDetailMulticResultDTO queryAgencyDetailMultiC(AgencyDetailMulticFormDTO formDTO) { - AgencyDetailMulticResultDTO agencysResultDTO = new AgencyDetailMulticResultDTO(); + AgencyDetailMulticResultDTO agencysResultDTO =dataReportRedis.queryAgencyDetailMulticResultDTO(formDTO.getCustomerId(),formDTO.getAgencyId()); + if (null != agencysResultDTO) { + log.info("queryAgencyDetailMultiC从redis取值入参:"+ JSON.toJSONString(formDTO)); + return agencysResultDTO; + } + agencysResultDTO = new AgencyDetailMulticResultDTO(); List parentList = new ArrayList<>(); agencysResultDTO.setParentList(parentList); @@ -405,7 +413,6 @@ public class AgencyServiceImpl implements AgencyService { if(agencysResultDTO.getHaveSubCustomer()){ // 5、多客户时根据area_code查询上级,自下向上,查询到当前客户的跟组织即可stop - // TODO log.info("多客户版本parentList、level要重新赋值"); ScreenCustomerAgencyDTO parentAgency=screenCustomerAgencyDao.selectByAreaCode(agencysResultDTO.getParentAreaCode()); agencysResultDTO.setLevel(getAgencyLevelMultiC(parentAgency)); @@ -429,6 +436,7 @@ public class AgencyServiceImpl implements AgencyService { agencysResultDTO.setParentList(screenCustomerAgencyDao.selectPAgencyById(pidList)); } } + dataReportRedis.setAgencyDetailMulticResultDTO(formDTO.getCustomerId(),formDTO.getAgencyId(),agencysResultDTO); return agencysResultDTO; } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/redis/CustomerRedis.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/redis/CustomerRedis.java index 63ad887526..2911420fe3 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/redis/CustomerRedis.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/redis/CustomerRedis.java @@ -17,10 +17,15 @@ package com.epmet.redis; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.map.MapUtil; import com.epmet.commons.tools.redis.RedisUtils; +import com.epmet.dto.CustomerDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import java.util.Map; + /** * 客户表 * @@ -32,6 +37,11 @@ public class CustomerRedis { @Autowired private RedisUtils redisUtils; + /** + * 客户信息rediskey前缀 + */ + private String customerInfoKeyPref="epmet:customer:info:"; + public void delete(Object[] ids) { } @@ -44,4 +54,26 @@ public class CustomerRedis { return null; } + + /** + * 查询客户基本信息 + */ + public CustomerDTO queryCustomerInfo(String customerId) { + String customerInfoKey=customerInfoKeyPref.concat(customerId); + Map customerDtoMap = redisUtils.hGetAll(customerInfoKey); + if (MapUtil.isEmpty(customerDtoMap)) { + return null; + } + CustomerDTO customerDTO = BeanUtil.mapToBean(customerDtoMap, CustomerDTO.class, true); + return customerDTO; + } + + /** + * 将客户基本信息放到redis,有效期一天 + */ + public void saveCustomerInfo(String customerId, CustomerDTO data) { + String customerInfoKey = customerInfoKeyPref.concat(customerId); + Map customerDtoMap = BeanUtil.beanToMap(data); + redisUtils.hMSet(customerInfoKey, customerDtoMap,RedisUtils.DEFAULT_EXPIRE); + } } \ No newline at end of file diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java index 72727b7f22..6a3a82127d 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerRelationServiceImpl.java @@ -27,14 +27,20 @@ import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.CustomerRelationDao; +import com.epmet.dto.CustomerDTO; import com.epmet.dto.CustomerRelationDTO; import com.epmet.entity.CustomerRelationEntity; +import com.epmet.redis.CustomerRedis; import com.epmet.service.CustomerRelationService; +import com.epmet.service.CustomerService; 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 org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -48,6 +54,10 @@ import java.util.Map; @Slf4j @Service public class CustomerRelationServiceImpl extends BaseServiceImpl implements CustomerRelationService { + @Autowired + private CustomerRedis customerRedis; + @Autowired + private CustomerService customerService; @Override public PageData page(Map params) { @@ -146,7 +156,18 @@ public class CustomerRelationServiceImpl extends BaseServiceImpl getAllSubCustomerIds(String customerId) { - return baseDao.selectAllSubCustomerIds(customerId); + CustomerDTO customerDTO = customerRedis.queryCustomerInfo(customerId); + if (null != customerDTO) { + return customerDTO.getSubCustomerIds(); + } + CustomerDTO data = customerService.get(customerId); + if (null != data) { + data.setSubCustomerIds(baseDao.selectAllSubCustomerIds(customerId)); + data.setHaveSubCustomer(CollectionUtils.isNotEmpty(data.getSubCustomerIds()) ? true : false); + customerRedis.saveCustomerInfo(customerId, data); + return data.getSubCustomerIds(); + } + return new ArrayList<>(); } } \ No newline at end of file From 0b81f6c83d98a7112b64a4e29a63f5171066f7fc Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 29 Jun 2021 16:46:33 +0800 Subject: [PATCH 044/107] =?UTF-8?q?=E5=8E=BB=E9=99=A4,?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/screen/ScreenProjectDataDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml index 53294f4783..543b9d3eb4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -70,7 +70,7 @@ IFNULL(project_address,'') as reportAddress, CUSTOMER_ID as customerId, PROJECT_STATUS_CODE as projectStatusCode, - floor( SATISFACTION_SCORE) AS score, + floor( SATISFACTION_SCORE) AS score FROM screen_project_data WHERE From 3abf215554f67b5602c97b14674642c6b3e8784d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 29 Jun 2021 16:54:07 +0800 Subject: [PATCH 045/107] =?UTF-8?q?=E5=85=A5=E5=8F=82=E9=9B=86=E5=90=88?= =?UTF-8?q?=E5=88=A4=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java | 2 +- .../com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java | 2 +- .../com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java | 2 +- .../com/epmet/dto/basereport/form/GridHotTopicFormDTO.java | 2 +- .../java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java | 3 +-- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java index 76f12be516..c5fed7b1cf 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyGroupTotalFormDTO.java @@ -17,7 +17,7 @@ public class AgencyGroupTotalFormDTO implements Serializable { /** * 数据集合对象 */ - @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + @NotEmpty(message = "至少有一条数据", groups = {AgencyGroupTotalFormDTO.saveList.class}) private List dataList; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java index 6583407543..9fb08407ce 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyHotTopicFormDTO.java @@ -17,7 +17,7 @@ public class AgencyHotTopicFormDTO implements Serializable { /** * 数据集合对象 */ - @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + @NotEmpty(message = "至少有一条数据", groups = {AgencyHotTopicFormDTO.saveList.class}) private List dataList; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java index d6a3063eeb..bf7d2d3478 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/AgencyRegUserFormDTO.java @@ -18,7 +18,7 @@ public class AgencyRegUserFormDTO implements Serializable { /** * 数据集合对象 */ - @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + @NotEmpty(message = "至少有一条数据", groups = {AgencyRegUserFormDTO.saveList.class}) private List dataList; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java index 3fd04fa2f6..54d1029231 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridHotTopicFormDTO.java @@ -17,7 +17,7 @@ public class GridHotTopicFormDTO implements Serializable { /** * 数据集合对象 */ - @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + @NotEmpty(message = "至少有一条数据", groups = {GridHotTopicFormDTO.saveList.class}) private List dataList; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java index e2b85792ea..84f18f226c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/basereport/form/GridRegUserFormDTO.java @@ -1,7 +1,6 @@ package com.epmet.dto.basereport.form; import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; -import com.epmet.dto.indexcollect.form.GridPartyAbilityFormDTO; import lombok.Data; import javax.validation.constraints.NotEmpty; @@ -19,7 +18,7 @@ public class GridRegUserFormDTO implements Serializable { /** * 数据集合对象 */ - @NotEmpty(message = "至少有一条数据", groups = {GridGroupTotalFormDTO.saveList.class}) + @NotEmpty(message = "至少有一条数据", groups = {GridRegUserFormDTO.saveList.class}) private List dataList; /** From 90ed6aefacfee62b896f229f7c22bbb82fa290bb Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 30 Jun 2021 10:44:54 +0800 Subject: [PATCH 046/107] =?UTF-8?q?=E5=93=8D=E5=BA=94=E7=8E=87=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GovernRankDataExtractServiceImpl.java | 24 ++++++-- .../extract/FactOriginProjectLogDailyDao.xml | 60 ++++++++++++++++--- 2 files changed, 72 insertions(+), 12 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index 8377391764..f72dab9d9a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -375,7 +375,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); entity.setResponseCount(dto.getCount()); entity.setTransferCount(dto.getSum()); } @@ -444,7 +448,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); entity.setResponseCount(dto.getCount()); entity.setTransferCount(dto.getSum()); } @@ -525,7 +533,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); entity.setResponseCount(dto.getCount()); entity.setTransferCount(dto.getSum()); } @@ -606,7 +618,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); entity.setResponseCount(dto.getCount()); entity.setTransferCount(dto.getSum()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index b5a2fe362f..32a1e56b98 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -297,8 +297,7 @@ SELECT a.AGENCY_ID, a.count AS "sum", - IFNULL( b.count, - 0 ) AS "count" + IFNULL( b.count, 0 ) + IFNULL( c.count, 0 ) AS "count" FROM (SELECT da.ID AS AGENCY_ID, COUNT( f.ID ) AS "count" @@ -599,12 +620,24 @@ AND f.DATE_ID <= #{dateId} GROUP BY da.ID ) b ON a.AGENCY_ID = b.AGENCY_ID + LEFT JOIN + (SELECT da.ID AS AGENCY_ID, + COUNT(DISTINCT f.ID ) AS "count" + FROM fact_origin_project_log_daily f + INNER JOIN dim_agency da ON f.PIDS LIKE CONCAT( '%', da.ID, '%' ) + AND da.`LEVEL` = #{level} + WHERE + ACTION_CODE = 'response' + AND f.IS_ACTIVE = 1 + AND f.CUSTOMER_ID = #{customerId} + AND f.DATE_ID <= #{dateId} + GROUP BY da.ID ) c + ON a.AGENCY_ID = c.AGENCY_ID @@ -371,6 +377,12 @@ AND scg.PARENT_AGENCY_ID = #{parentAgencyId} + + and scg.customer_id in + + #{customerId} + + From 24f59a001ae1403060349056633cdc47fe0eaf35 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 30 Jun 2021 15:18:26 +0800 Subject: [PATCH 050/107] =?UTF-8?q?project/mynextagency-multic=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/ScreenCustomerAgencyDao.java | 4 ++-- .../service/project/impl/ProjectServiceImpl.java | 2 ++ .../resources/mapper/screen/ScreenCustomerAgencyDao.xml | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) 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 915f8e4d11..4dd7253eba 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 @@ -180,7 +180,7 @@ public interface ScreenCustomerAgencyDao { * @param pid * @return java.util.List */ - List selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid, @Param("allSubCustomerIds") List allSubCustomerIds); + List selectNextAgencyList(@Param("areaCode") String areaCode, @Param("pid") String pid, @Param("allCustomerIds") List allCustomerIds); /** * 查询当前组织的下面的网格,可根据areaCode查询,也可根据parentAgencyId查询 @@ -189,7 +189,7 @@ public interface ScreenCustomerAgencyDao { * @param parentAgencyId * @return java.util.List */ - List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allSubCustomerIds") List allSubCustomerIds); + List selectGridDTOList(@Param("areaCode") String areaCode, @Param("parentAgencyId") String parentAgencyId,@Param("allCustomerIds") List allCustomerIds); List selectPAgencyById(@Param("listStr")List pidList); 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 620b67f482..251ab2f0a1 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 @@ -471,6 +471,7 @@ public class ProjectServiceImpl implements ProjectService { Result> crmRes = operCrmOpenFeignClient.getAllSubCustomerIds(currentCustomerId); if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { log.warn("❤当前客户存在子客户❤"); + crmRes.getData().add(currentCustomerId); //如果包含子客户,则根据areaCode查询下一级 agencyDTOList = screenAgencyService.queryNextAgencyList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR,crmRes.getData()); } else { @@ -494,6 +495,7 @@ public class ProjectServiceImpl implements ProjectService { List gridList = new ArrayList<>(); if (crmRes.success() && CollectionUtils.isNotEmpty(crmRes.getData())) { //如果包含子客户,则根据areaCode查询下一级网格 + crmRes.getData().add(currentCustomerId); gridList=screenAgencyService.queryGridList(staffResult.getData().getAreaCode(), StrConstant.EPMETY_STR,crmRes.getData()); } else { //当前客户没有子客户,根据agencyId查询下一级网格 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 5a2d013d19..7852232a1c 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 @@ -355,9 +355,9 @@ AND sca.PARENT_AREA_CODE =#{areaCode} - + and sca.customer_id in - + #{customerId} @@ -377,9 +377,9 @@ AND scg.PARENT_AGENCY_ID = #{parentAgencyId} - + and scg.customer_id in - + #{customerId} From 33470b0c1fe1714f30ab99635a3b9021f06d6719 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 30 Jun 2021 16:12:01 +0800 Subject: [PATCH 051/107] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=B0=83=E6=95=B4=EF=BC=8C=E6=8C=89areacode?= =?UTF-8?q?=E6=9F=A5=E6=95=B0=E6=8D=AE=E6=97=B6=E6=B7=BB=E5=8A=A0=E5=AE=A2?= =?UTF-8?q?=E6=88=B7Id=E7=9A=84=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/EvaluationIndexDao.java | 13 +++++ .../datastats/impl/DataStatsServiceImpl.java | 6 +-- .../impl/EvaluationIndexServiceImpl.java | 14 +++--- .../service/opercrm/CustomerRelation.java | 4 +- .../opercrm/impl/CustomerRelationImpl.java | 5 +- .../evaluationindex/EvaluationIndexDao.xml | 48 +++++++++++++++++++ 6 files changed, 76 insertions(+), 14 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java index 878e376bce..fd509f640d 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -82,4 +82,17 @@ public interface EvaluationIndexDao { * @author sun */ ScreenCustomerAgencyDTO getByAgencyId(@Param("agencyId") String agencyId); + + /** + * @Description 存在子客户的,查询当前组织的areaCode对应的直属下级且不是agencyId对应的客户id的但是存在父子客户关系的客户组织列表 + * @author sun + */ + List getAgencyIdsByAgencyId(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List list); + + /** + * @Description 查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查 + * @author sun + */ + List getSubAgencyListByAgency(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List list); + } \ No newline at end of file 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 d3a596036f..9c9e8b0333 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 @@ -1129,7 +1129,7 @@ public class DataStatsServiceImpl implements DataStatsService { formDTO.setDateId(format.format(yesterday)); } ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); - if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) { + if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); if (CollectionUtils.isEmpty(subAgencyIds)) { @@ -1202,7 +1202,7 @@ public class DataStatsServiceImpl implements DataStatsService { } List agencyIds = subAgencyList.stream().map(DimAgencyEntity::getId).collect(Collectors.toList()); ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); - if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) { + if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { List subAgencies = indexService.getSubAgencyList(formDTO.getAgencyId(), agencyDTO.getAreaCode()); agencyIds = subAgencies.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); subAgencyList = subAgencies.stream().map(item -> { @@ -1380,7 +1380,7 @@ public class DataStatsServiceImpl implements DataStatsService { } if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getOrgId()); - if (customerRelation.haveSubCustomer(agencyDTO.getCustomerId())) { + if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); 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 c9fa3bf7d2..8351deeaf6 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 @@ -115,11 +115,12 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { //1.查询agencyId对应组织信息 ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); //2.判断客户是否存在子客户 - if (!customerRelation.haveSubCustomer(dto.getCustomerId())) { + List list = customerRelation.haveSubCustomer(dto.getCustomerId()); + if (!CollectionUtils.isNotEmpty(list)) { return new ArrayList<>(); } - //3.存在子客户的,查询当前组织的areaCode对应的直属下级且不是agencyId对应的客户id的客户组织列表 - return evaluationIndexDao.getAgencyByAreaCodeAgencyId(agencyId, dto.getAreaCode()); + //3.存在子客户的,查询当前组织的areaCode对应的直属下级且不是agencyId对应的客户id的但是存在父子客户关系的客户组织列表 + return evaluationIndexDao.getAgencyIdsByAgencyId(agencyId, dto.getAreaCode(), list); } /** @@ -131,10 +132,11 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { //1.查询agencyId对应组织信息 ScreenCustomerAgencyDTO dto = evaluationIndexDao.getByAgencyId(agencyId); //2.判断客户是否存在子客户 - if (!customerRelation.haveSubCustomer(dto.getCustomerId())) { - return evaluationIndexDao.getSubAgencyList(agencyId, null); + List list = customerRelation.haveSubCustomer(dto.getCustomerId()); + if (!CollectionUtils.isNotEmpty(list)) { + return evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null); } else { - return evaluationIndexDao.getSubAgencyList(null, dto.getAreaCode()); + return evaluationIndexDao.getSubAgencyListByAgency(null, dto.getAreaCode(), list); } } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java index c53ce0348e..71d96fe17b 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/CustomerRelation.java @@ -16,7 +16,7 @@ public interface CustomerRelation { * @author zhaoqifeng * @date 2021/6/29 11:06 * @param customerId - * @return boolean + * @return List */ - boolean haveSubCustomer(String customerId); + List haveSubCustomer(String customerId); } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java index 13dd247d1b..af5f40e53f 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/opercrm/impl/CustomerRelationImpl.java @@ -38,8 +38,7 @@ public class CustomerRelationImpl implements CustomerRelation { * @date 2021/6/29 11:06 */ @Override - public boolean haveSubCustomer(String customerId) { - List list = customerRelationDao.selectAllSubCustomerIds(customerId); - return CollectionUtils.isNotEmpty(list); + public List haveSubCustomer(String customerId) { + return customerRelationDao.selectAllSubCustomerIds(customerId); } } 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 b76960a3d2..ccc4ef9b35 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 @@ -126,4 +126,52 @@ AND agency_id = #{agencyId} + + + + \ No newline at end of file From 585f053fbd71c51177835237476d4ea6d0eda29c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 30 Jun 2021 16:28:00 +0800 Subject: [PATCH 052/107] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataaggre/dao/evaluationindex/EvaluationIndexDao.java | 2 +- .../evaluationindex/impl/EvaluationIndexServiceImpl.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java index fd509f640d..197b4e05e6 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/dao/evaluationindex/EvaluationIndexDao.java @@ -90,7 +90,7 @@ public interface EvaluationIndexDao { List getAgencyIdsByAgencyId(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List list); /** - * @Description 查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查 + * @Description 查询直属下级组织列表,有areaCode的按areaCode查,没有的按agencyId查且是在当前客户和子客户范围内查询 * @author sun */ List getSubAgencyListByAgency(@Param("agencyId") String agencyId, @Param("areaCode") String areaCode, @Param("list") List list); 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 8351deeaf6..3fd170de55 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 @@ -124,7 +124,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { } /** - * @Description 查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查 + * @Description 查询直属下级组织列表,有子客户的按areaCode查没有的按agencyId查且是在当前客户和子客户范围内查询 * @author sun */ @Override @@ -136,6 +136,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { if (!CollectionUtils.isNotEmpty(list)) { return evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null); } else { + list.add(agencyId); return evaluationIndexDao.getSubAgencyListByAgency(null, dto.getAreaCode(), list); } } From 6cc8d652af6faf21ecdc06ad386aa19829ea58e7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 30 Jun 2021 16:32:10 +0800 Subject: [PATCH 053/107] rizhi --- .../indexcal/impl/IndexCalculateStreetServiceImpl.java | 1 + 1 file changed, 1 insertion(+) 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 ca12d8058f..b5d77983b0 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 @@ -782,6 +782,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ } else { // 治理能力的六个五级指标 List> communityGovernAbility = disposeFiveLevel(form); + log.info("治理能力的六个五级指标==="+communityGovernAbility.toString()); if (CollectionUtils.isEmpty(communityGovernAbility)){ log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); }else{ From 1840167103066f82bb8f45079b3b3ab41cfe4670 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Wed, 30 Jun 2021 16:47:44 +0800 Subject: [PATCH 054/107] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/impl/EvaluationIndexServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3fd170de55..fc9e6b8ba6 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 @@ -136,7 +136,7 @@ public class EvaluationIndexServiceImpl implements EvaluationIndexService { if (!CollectionUtils.isNotEmpty(list)) { return evaluationIndexDao.getSubAgencyListByAgency(agencyId, null, null); } else { - list.add(agencyId); + list.add(dto.getCustomerId()); return evaluationIndexDao.getSubAgencyListByAgency(null, dto.getAreaCode(), list); } } From 66bb25506a693979373fd108375f411227759476 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 1 Jul 2021 09:41:33 +0800 Subject: [PATCH 055/107] =?UTF-8?q?sql=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/V0.0.20__add_satisfaction_score.sql | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql index 7bc2a498dc..cfc365f038 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql @@ -1,2 +1,11 @@ -- epmet_evaluation_index库执行以下sql: 增加群众不满得分 alter table screen_project_data add COLUMN `SATISFACTION_SCORE` decimal(10,6) DEFAULT NULL COMMENT '满意度得分' AFTER LATITUDE; + +ALTER TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` + ADD COLUMN `RESPONSE_COUNT` int(11) NULL COMMENT '响应次数' AFTER `RESPONSE_RATIO`, + ADD COLUMN `TRANSFER_COUNT` int(11) NULL COMMENT '项目转入次数' AFTER `RESPONSE_COUNT`, + ADD COLUMN `RESOLVED_COUNT` int(11) NULL COMMENT '解决项目数' AFTER `RESOLVED_RATIO`, + ADD COLUMN `CLOSED_COUNT` int(11) NULL COMMENT '已关闭项目数' AFTER `RESOLVED_COUNT`, + ADD COLUMN `GOVERN_COUNT` int(11) NULL COMMENT '自治项目数' AFTER `GOVERN_RATIO`, + ADD COLUMN `SATISFACTION_COUNT` int(11) NULL COMMENT '满意项目数' AFTER `SATISFACTION_RATIO`, + ADD COLUMN `CLOSED_PROJECT_COUNT` int(11) NULL COMMENT '已关闭项目(由议题转的项目)数' AFTER `SATISFACTION_COUNT`; \ No newline at end of file From b98e62e717d56e90dc81a7ff441b5e31910e110a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 10:57:42 +0800 Subject: [PATCH 056/107] projectCreateTime --- .../epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java index 2b0642ce25..f0f6422e94 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java @@ -1,9 +1,11 @@ package com.epmet.dto.screen.form; +import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; +import java.util.Date; /** * @description: @@ -47,7 +49,8 @@ public class ScreenProjectDataInfoFormDTO implements Serializable { /** * 事件时间 */ - private String projectCreateTime; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date projectCreateTime; /** * 上报人 From 05802eb1112e115a76313a9686eda2c085962be3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 11:10:15 +0800 Subject: [PATCH 057/107] projectCreateTime_1 --- .../impl/ScreenProjectDataServiceImpl.java | 32 +++++++------------ 1 file changed, 11 insertions(+), 21 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index b6e89552dc..ac49a4aecc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -61,12 +61,6 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl page(Map params) { @@ -141,7 +135,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl Date: Thu, 1 Jul 2021 13:53:38 +0800 Subject: [PATCH 058/107] =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) 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 9c9e8b0333..984ce2156a 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 @@ -293,8 +293,38 @@ public class DataStatsServiceImpl implements DataStatsService { if (subAgencyList.size() < NumConstant.ONE) { return resultList; } - List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); + // List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); + + subAgencyList.forEach(sub->{ + //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 + List agencyList = indexService.getAgencyIdsByAgencyId(formDTO.getAgencyId()); + agencyList.add(sub.getAgencyId()); + //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 + List list = dataStatsDao.getSubAgencyUser(agencyList, formDTO.getDateId()); + + //3.封装数据 + int userTotal = 0; + int resiTotal = 0; + int partyMemberTotal = 0; + for (SubAgencyUserResultDTO u : list){ + userTotal+=u.getUserTotal(); + resiTotal+=u.getResiTotal(); + partyMemberTotal+=u.getPartyMemberTotal(); + } + SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO(); + dto.setAgencyId(sub.getAgencyId()); + dto.setAgencyName(sub.getAgencyName()); + dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel()); + dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode()); + dto.setUserTotal(userTotal); + dto.setPartyMemberTotal(partyMemberTotal); + dto.setResiTotal(resiTotal); + dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal()))); + dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); + resultList.add(dto); + }); + /* //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 List list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); @@ -316,7 +346,7 @@ public class DataStatsServiceImpl implements DataStatsService { dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); resultList.add(dto); } - +*/ //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override From 341bf493192cd29a247dc8639028149ec12399e9 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 1 Jul 2021 15:18:15 +0800 Subject: [PATCH 059/107] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=BF=98=E5=8E=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 34 ++----------------- 1 file changed, 2 insertions(+), 32 deletions(-) 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 984ce2156a..9c9e8b0333 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 @@ -293,38 +293,8 @@ public class DataStatsServiceImpl implements DataStatsService { if (subAgencyList.size() < NumConstant.ONE) { return resultList; } - // List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); - - subAgencyList.forEach(sub->{ - //0.根据组织Id查询是否存在子客户,存在的按areaCode查询当前客户之外的客户组织列表 - List agencyList = indexService.getAgencyIdsByAgencyId(formDTO.getAgencyId()); - agencyList.add(sub.getAgencyId()); - //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 - List list = dataStatsDao.getSubAgencyUser(agencyList, formDTO.getDateId()); - - //3.封装数据 - int userTotal = 0; - int resiTotal = 0; - int partyMemberTotal = 0; - for (SubAgencyUserResultDTO u : list){ - userTotal+=u.getUserTotal(); - resiTotal+=u.getResiTotal(); - partyMemberTotal+=u.getPartyMemberTotal(); - } - SubAgencyUserResultDTO dto = new SubAgencyUserResultDTO(); - dto.setAgencyId(sub.getAgencyId()); - dto.setAgencyName(sub.getAgencyName()); - dto.setLevel(null == sub.getLevel() ? "" : sub.getLevel()); - dto.setAreaCode(null == sub.getAreaCode() ? "" : sub.getAreaCode()); - dto.setUserTotal(userTotal); - dto.setPartyMemberTotal(partyMemberTotal); - dto.setResiTotal(resiTotal); - dto.setPartyMemberRatio(dto.getPartyMemberTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getPartyMemberTotal() / (float) dto.getUserTotal()))); - dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); - resultList.add(dto); - }); + List agencyIds = subAgencyList.stream().map(ScreenCustomerAgencyDTO::getAgencyId).collect(Collectors.toList()); - /* //2.查询直属下级组织注册用户日统计数据,默认按用户总数降序 List list = dataStatsDao.getSubAgencyUser(agencyIds, formDTO.getDateId()); @@ -346,7 +316,7 @@ public class DataStatsServiceImpl implements DataStatsService { dto.setResiRatio(dto.getResiTotal() == 0 || dto.getUserTotal() == 0 ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float) dto.getResiTotal() / (float) dto.getUserTotal()))); resultList.add(dto); } -*/ + //4.按要求排序并返回 Collections.sort(resultList, new Comparator() { @Override From 251648da70bea240ae7cb5dd3e7c65617dc162eb Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 15:41:31 +0800 Subject: [PATCH 060/107] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E7=94=9F=E4=BA=A7?= =?UTF-8?q?=E9=83=BD=E5=B7=B2=E7=BB=8F=E6=89=A7=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V0.0.20__add_satisfaction_score.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql index cfc365f038..5daf6faa5a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.20__add_satisfaction_score.sql @@ -1,5 +1,5 @@ -- epmet_evaluation_index库执行以下sql: 增加群众不满得分 -alter table screen_project_data add COLUMN `SATISFACTION_SCORE` decimal(10,6) DEFAULT NULL COMMENT '满意度得分' AFTER LATITUDE; +alter table `epmet_evaluation_index`.screen_project_data add COLUMN `SATISFACTION_SCORE` decimal(10,6) DEFAULT NULL COMMENT '满意度得分' AFTER LATITUDE; ALTER TABLE `epmet_evaluation_index`.`screen_govern_rank_data_daily` ADD COLUMN `RESPONSE_COUNT` int(11) NULL COMMENT '响应次数' AFTER `RESPONSE_RATIO`, From 8407fe1cc0011876b6407714bdce7553222c57e4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 16:36:01 +0800 Subject: [PATCH 061/107] temp --- .../com/epmet/controller/IndexCalculateController.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 9f2a4b06cd..8471300c71 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -147,7 +147,12 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); if (aBoolean) { - log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), formDTO.getMonthId(), aBoolean, (System.currentTimeMillis() - start) / 1000); + log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒,customerAreaCode:{}", + formDTO.getCustomerId(), + formDTO.getMonthId(), + aBoolean, + (System.currentTimeMillis() - start) / 1000, + formDTO.getCustomerAreaCode()); } redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); From 7771142c70d72d2cc37f2ed58ecd9bd49d68d3e8 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 1 Jul 2021 16:44:49 +0800 Subject: [PATCH 062/107] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datastats/impl/DataStatsServiceImpl.java | 77 ++++++++++--------- 1 file changed, 40 insertions(+), 37 deletions(-) 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 9c9e8b0333..de2d896d08 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 @@ -1130,37 +1130,38 @@ public class DataStatsServiceImpl implements DataStatsService { } ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getAgencyId()); if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { - - List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); - if (CollectionUtils.isEmpty(subAgencyIds)) { - subAgencyIds = new ArrayList<>(); - } - subAgencyIds.add(formDTO.getAgencyId()); - List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); - if (CollectionUtils.isNotEmpty(list)) { - //问题解决总数 - Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getProblemResolvedCount).sum(); - //未出小组即未转议题的:话题关闭已解决数 - Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicResolvedCount).sum(); - //未出小组即未转议题的:话题关闭无需解决数 - Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getInGroupTopicUnResolvedCount).sum(); - //未出当前网格的,结案项目数 - Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getGridSelfGovernProjectTotal).sum(); - //由社区结案的项目总数 - Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getCommunityClosedCount).sum(); - //由街道结案的项目总数 - Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getStreetClosedCount).sum(); - //由区直部门结案的项目总数 - Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity ::getDistrictDeptClosedCount).sum(); - - resultDTO.setProblemResolvedCount(problemResolvedCount); - resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); - resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); - resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); - resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); - resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); - - return resultDTO; + if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) { + List subAgencyIds = indexService.getAgencyByAreaCodeAgencyId(formDTO.getAgencyId(), agencyDTO.getAreaCode()); + if (CollectionUtils.isEmpty(subAgencyIds)) { + subAgencyIds = new ArrayList<>(); + } + subAgencyIds.add(formDTO.getAgencyId()); + List list = dataStatsDao.getAgencyGovernDaily(subAgencyIds, formDTO.getDateId()); + if (CollectionUtils.isNotEmpty(list)) { + //问题解决总数 + Integer problemResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getProblemResolvedCount).sum(); + //未出小组即未转议题的:话题关闭已解决数 + Integer inGroupTopicResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicResolvedCount).sum(); + //未出小组即未转议题的:话题关闭无需解决数 + Integer inGroupTopicUnResolvedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getInGroupTopicUnResolvedCount).sum(); + //未出当前网格的,结案项目数 + Integer gridSelfGovernProjectTotal = list.stream().mapToInt(FactAgencyGovernDailyEntity::getGridSelfGovernProjectTotal).sum(); + //由社区结案的项目总数 + Integer communityClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getCommunityClosedCount).sum(); + //由街道结案的项目总数 + Integer streetClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getStreetClosedCount).sum(); + //由区直部门结案的项目总数 + Integer districtDeptClosedCount = list.stream().mapToInt(FactAgencyGovernDailyEntity::getDistrictDeptClosedCount).sum(); + + resultDTO.setProblemResolvedCount(problemResolvedCount); + resultDTO.setGroupSelfGovernRatio(getPercentage(inGroupTopicResolvedCount + inGroupTopicUnResolvedCount, problemResolvedCount)); + resultDTO.setGridSelfGovernRatio(getPercentage(gridSelfGovernProjectTotal, problemResolvedCount)); + resultDTO.setCommunityResolvedRatio(getPercentage(communityClosedCount, problemResolvedCount)); + resultDTO.setStreetResolvedRatio(getPercentage(streetClosedCount, problemResolvedCount)); + resultDTO.setDistrictDeptResolvedRatio(getPercentage(districtDeptClosedCount, problemResolvedCount)); + + return resultDTO; + } } } //1.按日期查询当前组织事件治理指数 @@ -1381,12 +1382,14 @@ public class DataStatsServiceImpl implements DataStatsService { if (OrgConstant.AGENCY.equals(formDTO.getOrgType())) { ScreenCustomerAgencyDTO agencyDTO = indexService.getAgencyInfo(formDTO.getOrgId()); if (CollectionUtils.isNotEmpty(customerRelation.haveSubCustomer(agencyDTO.getCustomerId()))) { - ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); - resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); - resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); - resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount())); - resultDTO.setSatisfactionRatio(getPercentage(governData.getSatisfactionCount(), governData.getClosedProjectCount())); - return resultDTO; + if (OrgConstant.PROVINCE.equals(agencyDTO.getLevel()) || OrgConstant.CITY.equals(agencyDTO.getLevel()) || OrgConstant.DISTRICT.equals(agencyDTO.getLevel())) { + ScreenGovernRankDataDailyDTO governData = indexService.getGovernRank(formDTO.getOrgId(), agencyDTO.getAreaCode(), formDTO.getDateId()); + resultDTO.setGovernRatio(getPercentage(governData.getGovernCount(), governData.getClosedCount())); + resultDTO.setResolvedRatio(getPercentage(governData.getResolvedCount(), governData.getClosedCount())); + resultDTO.setResponseRatio(getPercentage(governData.getResponseCount(), governData.getTransferCount())); + resultDTO.setSatisfactionRatio(getPercentage(governData.getSatisfactionCount(), governData.getClosedProjectCount())); + return resultDTO; + } } } From d7a92f2f9295c6199d1f33306e8ee5edf2836612 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 1 Jul 2021 16:46:40 +0800 Subject: [PATCH 063/107] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/evaluationindex/EvaluationIndexDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 ccc4ef9b35..af92260ab7 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 @@ -84,7 +84,7 @@ SUM(RESOLVED_COUNT) AS resolvedCount, SUM(CLOSED_COUNT) AS closedCount, SUM(GOVERN_COUNT) AS governCount, - SUM(SATISFACTION_PROJECT_COUNT) AS satisfactionProjectCount, + SUM(SATISFACTION_COUNT) AS satisfactionProjectCount, SUM(CLOSED_PROJECT_COUNT) AS closedProjectCount FROM screen_govern_rank_data_daily From 9b45488216848d1f1cce9bb14474935b69116bee Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 1 Jul 2021 16:48:56 +0800 Subject: [PATCH 064/107] =?UTF-8?q?=E6=B2=BB=E7=90=86=E6=8C=87=E6=95=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mapper/evaluationindex/EvaluationIndexDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 af92260ab7..3e95accc9d 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 @@ -84,7 +84,7 @@ SUM(RESOLVED_COUNT) AS resolvedCount, SUM(CLOSED_COUNT) AS closedCount, SUM(GOVERN_COUNT) AS governCount, - SUM(SATISFACTION_COUNT) AS satisfactionProjectCount, + SUM(SATISFACTION_COUNT) AS satisfactionCount, SUM(CLOSED_PROJECT_COUNT) AS closedProjectCount FROM screen_govern_rank_data_daily From 90f37d813032e29a93cc7fbb93f139e42571050a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 17:13:11 +0800 Subject: [PATCH 065/107] sl --- .../java/com/epmet/controller/IndexCalculateController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java index 8471300c71..9add28ae1c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/IndexCalculateController.java @@ -147,12 +147,11 @@ public class IndexCalculateController { long start = System.currentTimeMillis(); Boolean aBoolean = indexCalculateService.indexCalculate(formDTO); if (aBoolean) { - log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒,customerAreaCode:{}", + log.error("客户Id:{},monthId:{},全部指标计算完成,结果:{},总耗时:{}秒", formDTO.getCustomerId(), formDTO.getMonthId(), aBoolean, - (System.currentTimeMillis() - start) / 1000, - formDTO.getCustomerAreaCode()); + (System.currentTimeMillis() - start) / 1000); } redisUtils.delete(RedisKeys.getCustomerStatsCalFlag(formDTO.getCustomerId())); From aeaf88daa9e28a2b843f333d1b6d67b3dd7b2f9e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Thu, 1 Jul 2021 17:31:03 +0800 Subject: [PATCH 066/107] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E8=AF=95=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/screen/ScreenIndexDataYearlyDao.xml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 4184ecd513..64ed5e273f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -31,19 +31,6 @@ score.ORG_TYPE orgType FROM screen_index_data_yearly score - - - - INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' - - - INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0' - - - INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0' - - - WHERE score.del_flag = '0' AND score.parent_id = #{agencyId} From aa83c9f476dd00a38e750c771e53557d68d46f52 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 2 Jul 2021 08:40:03 +0800 Subject: [PATCH 067/107] rollback --- .../mapper/screen/ScreenIndexDataMonthlyDao.xml | 6 +++--- .../mapper/screen/ScreenIndexDataYearlyDao.xml | 13 +++++++++++++ .../indexcoll/impl/FactIndexCollectServiceImpl.java | 1 + 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 26c21cd8b1..9d4129b914 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -86,13 +86,13 @@ - INNER JOIN screen_customer_grid org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + INNER JOIN screen_customer_grid org ON org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' - INNER JOIN screen_customer_agency org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0' + INNER JOIN screen_customer_agency org ON org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0' - INNER JOIN screen_customer_dept org ON org.CUSTOMER_ID = score.CUSTOMER_ID AND org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0' + INNER JOIN screen_customer_dept org ON org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0' diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 64ed5e273f..7102d018d4 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -31,6 +31,19 @@ score.ORG_TYPE orgType FROM screen_index_data_yearly score + + + + INNER JOIN screen_customer_grid org ON org.GRID_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_agency org ON org.AGENCY_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + INNER JOIN screen_customer_dept org ON org.DEPT_ID = score.ORG_ID AND org.DEL_FLAG = '0' + + + WHERE score.del_flag = '0' AND score.parent_id = #{agencyId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 127479f37e..07d726f1a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -893,6 +893,7 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); } while (deleteNum > NumConstant.ZERO); List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); + log.info("插入的entity:"+ JSON.toJSONString(entity)); screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); } } From 332c6f18511dd43ed68cbecd0519982118f67ba1 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 2 Jul 2021 09:05:19 +0800 Subject: [PATCH 068/107] rollback --- .../indexcoll/impl/FactIndexCollectServiceImpl.java | 1 - 1 file changed, 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java index 07d726f1a6..127479f37e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcoll/impl/FactIndexCollectServiceImpl.java @@ -893,7 +893,6 @@ public class FactIndexCollectServiceImpl implements FactIndexCollectService { deleteNum = screenIndexDataYearlyDao.deleteIndexDataYearly(customerId, getYearStr(monthId)); } while (deleteNum > NumConstant.ZERO); List entity = ConvertUtils.sourceToTarget(monthlyFormList, IndexDataYearlyFormDTO.class); - log.info("插入的entity:"+ JSON.toJSONString(entity)); screenIndexDataYearlyDao.batchInsertIndexDataYearly(entity, customerId); } } From 4b4d866aa69a17633b9fa1b1d203901e7dbf88b7 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 2 Jul 2021 10:34:08 +0800 Subject: [PATCH 069/107] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=BD=93=E5=89=8D?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=98=AF=E4=B8=8D=E6=98=AF=E8=B7=9F=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E6=B7=BB=E5=8A=A0=E5=AE=A2=E6=88=B7Id=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/dto/form/RootAgencyFormDTO.java | 5 +++++ .../datareport/controller/fact/FactIndexController.java | 5 ++++- .../dao/evaluationindex/screen/ScreenCustomerAgencyDao.java | 2 +- .../datareport/service/fact/impl/FactIndexServiceImpl.java | 2 +- .../main/resources/mapper/screen/ScreenCustomerAgencyDao.xml | 1 + 5 files changed, 12 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java index 42a67c936f..ce778cf651 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/RootAgencyFormDTO.java @@ -21,4 +21,9 @@ public class RootAgencyFormDTO implements Serializable { @NotBlank(message = "组织ID不能为空",groups = {RootAgencyFormDTO.AddUserInternalGroup.class}) private String agencyId; + /** + * token中客户Id + */ + private String customerId; + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java index 3a2f5cfebb..29d8cb939b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/fact/FactIndexController.java @@ -1,5 +1,7 @@ package com.epmet.datareport.controller.fact; +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.fact.FactIndexService; @@ -98,8 +100,9 @@ public class FactIndexController { * @author sun */ @PostMapping("index/rootagency") - public Result rootAgency(@RequestBody RootAgencyFormDTO formDTO) { + public Result rootAgency(@LoginUser TokenDto tokenDto, @RequestBody RootAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, RootAgencyFormDTO.AddUserInternalGroup.class); + formDTO.setCustomerId(tokenDto.getCustomerId()); return new Result().ok(factIndexService.rootAgency(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 4dd7253eba..a951b18406 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 @@ -100,7 +100,7 @@ public interface ScreenCustomerAgencyDao { * @Description 根据组织ID判断是否根组织 * @author sun */ - int selectRootAgency(@Param("agencyId") String agencyId); + int selectRootAgency(@Param("agencyId") String agencyId, @Param("customerId") String customerId); /** * desc: 根据orgId获取组织信息 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java index 7a5eeee0d1..80d2161ebb 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/fact/impl/FactIndexServiceImpl.java @@ -486,7 +486,7 @@ public class FactIndexServiceImpl implements FactIndexService { public RootAgencyResultDTO rootAgency(RootAgencyFormDTO formDTO) { RootAgencyResultDTO resultDTO = new RootAgencyResultDTO(); //1.根据agencyId查询是否为根级组织 - int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId()); + int num = screenCustomerAgencyDao.selectRootAgency(formDTO.getAgencyId(), formDTO.getCustomerId()); if (num < NumConstant.ONE) { resultDTO.setIsRoot(false); } 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 7852232a1c..83770370b5 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 @@ -116,6 +116,7 @@ del_flag = '0' AND pid = '0' AND agency_id = #{agencyId} + AND customer_id = #{customerId} SELECT - scj.ID, - IFNULL(avg( scj.JOIN_TOTAL ),0) AS total, - IFNULL(ROUND( avg( scj.AVG_JOIN ), 1 ),0) AS averageJoin, - IFNULL(avg( scj.JOIN_TOTAL_UP_RATE ),0) AS monthIncr, - (case when IFNULL(avg( scj.JOIN_TOTAL_UP_RATE ),0) >0 then 'incr' - when IFNULL(avg( scj.JOIN_TOTAL_UP_RATE ),0) < 0 then 'decr' - else 'eq' - end )as monthTrend, - ROUND( IFNULL(avg( scj.AVG_ISSUE ),0), 1 ) AS averageIssue, - IFNULL(avg( scj.AVG_ISSUE_UP_RATE ),0) AS issueCompareLatestMonth, - ( - case when IFNULL(avg( scj.AVG_ISSUE_UP_RATE ),0) > 0 then 'incr' - when IFNULL(avg( scj.AVG_ISSUE_UP_RATE ),0) < 0 then 'decr' - else 'eq' - end - )as issueCompareLatestTrend, - IFNULL(avg( scj.AGVG_JOIN_UP_RATE) ,0) AS joinCompareLatestMonth, - ( - case when IFNULL(avg( scj.AGVG_JOIN_UP_RATE ),0) > 0 then 'incr' - when IFNULL(avg( scj.AGVG_JOIN_UP_RATE ),0) < 0 then 'decr' - else 'eq' - end - )as joinCompareLatestTrend + ifnull(sum(suj.JOIN_TOTAL),0) as total, + 0 as monthIncr, + ''as monthTrend, + round(IFNULL(sum(suj.avg_issue_fz)/sum(suj.avg_issue_fm),0)) as averageIssue, + 0 as issueCompareLatestMonth, + '' as issueCompareLatestTrend, + round(ifnull(sum(suj.avg_join_fz)/sum(suj.avg_join_fm),0))as averageJoin, + 0 as joinCompareLatestMonth, + '' as joinCompareLatestTrend FROM - screen_user_join scj - LEFT JOIN screen_customer_agency agency ON scj.org_id = agency.agency_id + screen_user_join suj + INNER JOIN screen_customer_agency sca ON ( suj.ORG_ID = sca.AGENCY_ID AND sca.DEL_FLAG = '0' ) WHERE - scj.DEL_FLAG = '0' - AND scj.MONTH_ID = #{monthId} - AND agency.PARENT_AREA_CODE =#{areaCode} + suj.ORG_TYPE = 'agency' + AND sca.PARENT_AREA_CODE = #{areaCode} + AND suj.MONTH_ID = #{monthId} From ce2629707f0677dcc8807c1262a34fc4880cdc5f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 9 Jul 2021 10:48:08 +0800 Subject: [PATCH 078/107] =?UTF-8?q?=E6=B2=BB=E7=90=86=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=8E=92=E8=A1=8C-=E6=97=A5=E7=BB=9F=E8=AE=A1=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../GovernRankDataExtractServiceImpl.java | 100 ++++++++++++++---- .../extract/FactOriginProjectLogDailyDao.xml | 9 +- 2 files changed, 89 insertions(+), 20 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java index e93b4eba0c..ebdb11825b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/GovernRankDataExtractServiceImpl.java @@ -348,7 +348,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setSatisfactionRatio(ratio); } })); } @@ -356,10 +360,14 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe List gridList = factOriginProjectLogDailyService.getGridSelfDaily(customerId, dateId); if (CollectionUtils.isNotEmpty(gridList)) { list.forEach(entity -> gridList.stream().filter(gridAbility -> entity.getOrgId().equals(gridAbility.getOrgId())).forEach(grid -> { - BigDecimal resolveCount = new BigDecimal(grid.getSum()); - BigDecimal selfCount = new BigDecimal(grid.getCount()); if (grid.getSum() != NumConstant.ZERO) { - entity.setGovernRatio(selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal resolveCount = new BigDecimal(grid.getSum()); + BigDecimal selfCount = new BigDecimal(grid.getCount()); + BigDecimal ratio = selfCount.multiply(hundred).divide(resolveCount, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } @@ -371,7 +379,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -383,7 +395,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResolvedRatio(ratio); } })); } @@ -422,7 +438,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setSatisfactionRatio(ratio); } })); } @@ -434,7 +454,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -445,7 +469,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } @@ -457,7 +485,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResolvedRatio(ratio); } })); } @@ -495,7 +527,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setSatisfactionRatio(ratio); } })); } @@ -507,7 +543,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -518,7 +558,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } @@ -530,7 +574,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResolvedRatio(ratio); } })); } @@ -568,7 +616,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setSatisfactionRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setSatisfactionRatio(ratio); } })); } @@ -580,7 +632,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResponseRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResponseRatio(ratio); } })); } @@ -591,7 +647,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setGovernRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setGovernRatio(ratio); } })); } @@ -603,7 +663,11 @@ public class GovernRankDataExtractServiceImpl implements GovernRankDataExtractSe if (dto.getSum() != NumConstant.ZERO) { BigDecimal sum = new BigDecimal(dto.getSum()); BigDecimal count = new BigDecimal(dto.getCount()); - entity.setResolvedRatio(count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP)); + BigDecimal ratio = count.multiply(hundred).divide(sum, NumConstant.SIX, RoundingMode.HALF_UP); + if (ratio.compareTo(hundred) > 0) { + ratio = hundred; + } + entity.setResolvedRatio(ratio); } })); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml index a5c0960f9c..c540e0f4ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectLogDailyDao.xml @@ -650,7 +650,10 @@ DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} AND ( ACTION_CODE = 'response' OR ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'created' ) - AND PROJECT_ID IN ( SELECT ID FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 AND PROJECT_STATUS = 'closed' AND ORIGIN = "issue") + AND PROJECT_ID IN ( + SELECT ID FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 AND PROJECT_STATUS = 'closed' AND ORIGIN = 'issue' + AND CUSTOMER_ID = #{customerId} + AND DATE_ID <= #{dateId}) GROUP BY PROJECT_ID HAVING @@ -717,7 +720,9 @@ DEL_FLAG = 0 AND CUSTOMER_ID = #{customerId} AND ( ACTION_CODE = 'response' OR ACTION_CODE = 'close' OR ACTION_CODE = 'transfer' OR ACTION_CODE = 'created' ) - AND PROJECT_ID IN ( SELECT ID FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 AND PROJECT_STATUS = 'closed' AND ORIGIN = "issue" ) + AND PROJECT_ID IN ( SELECT ID FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 AND PROJECT_STATUS = 'closed' AND ORIGIN = 'issue' + AND CUSTOMER_ID = #{customerId} + AND DATE_ID <= #{dateId}) GROUP BY PROJECT_ID HAVING From 155a0aefbb9ab0033df8f09eba5c55f0cf01ca47 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 9 Jul 2021 11:08:56 +0800 Subject: [PATCH 079/107] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9sql?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/project/ProjectDao.xml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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 dce166ad17..9cde166e58 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 @@ -299,8 +299,11 @@ - - AND sdd1.EVENT_STATUS_CODE = #{status} + + AND sdd1.EVENT_STATUS_CODE in('pending','0') + + + AND sdd1.EVENT_STATUS_CODE in('closed','10','5') union select sca.AREA_CODE,sdd2.* from screen_difficulty_data sdd2 @@ -322,8 +325,11 @@ - - AND sdd2.EVENT_STATUS_CODE = #{status} + + AND sdd2.EVENT_STATUS_CODE in('pending','0') + + + AND sdd2.EVENT_STATUS_CODE in('closed','10','5') ) diff ORDER BY From 76242aad66aab6198bb117d6d8943634cdbfb8b0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 9 Jul 2021 11:25:41 +0800 Subject: [PATCH 080/107] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E4=BF=AE=E6=94=B9=EF=BC=8C=E5=86=99=E6=AD=BB?= =?UTF-8?q?areaCode=3D370124=E6=97=B6=E6=8C=89=E7=85=A7areaCode=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=EF=BC=8C=E5=85=B6=E4=BD=99=E7=9A=84=E6=8C=89=E7=85=A7?= =?UTF-8?q?agencyId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../datareport/service/project/impl/ProjectServiceImpl.java | 4 ++++ 1 file changed, 4 insertions(+) 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 251ab2f0a1..33fd65dd1b 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 @@ -389,6 +389,10 @@ public class ProjectServiceImpl implements ProjectService { } formDTO.setAreaCode(agencyResult.getData().getAreaCode()); }*/ + // 只有平阴根据areaCode查询,其余的还是按照agencyId查询 + if (StringUtils.isNotBlank(formDTO.getAreaCode()) && !"370124".equals(formDTO.getAreaCode())) { + formDTO.setAreaCode(StrConstant.EPMETY_STR); + } // 3、升级原来的列表查询接口 PageHelper.startPage(null == formDTO.getPageNo() ? NumConstant.ONE : formDTO.getPageNo(), formDTO.getTopNum()); List result = projectDao.difficultyRankV2(formDTO); From 8059011ffb14a27c65638b66c63bf29b78bbda20 Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 9 Jul 2021 13:31:14 +0800 Subject: [PATCH 081/107] =?UTF-8?q?=E5=85=AC=E4=BC=97=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E6=A6=82=E6=8B=AC=E6=8A=BD=E5=8F=96=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=88=86=E5=AD=90=E5=88=86=E6=AF=8D=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/db/migration/V0.0.22__pulic_party.sql | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.22__pulic_party.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.22__pulic_party.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.22__pulic_party.sql new file mode 100644 index 0000000000..7c9f7a9e3d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.22__pulic_party.sql @@ -0,0 +1,7 @@ +ALTER TABLE `epmet_evaluation_index`.`screen_user_join` + ADD COLUMN `AVG_ISSUE_FZ` int(11) NULL DEFAULT 0 COMMENT '人均议题分子' AFTER `AVG_ISSUE`, + ADD COLUMN `AVG_ISSUE_FM` int(11) NULL DEFAULT 0 COMMENT '人均议题分母' AFTER `AVG_ISSUE_FZ`, + ADD COLUMN `AVG_JOIN_FZ` int(11) NULL DEFAULT 0 COMMENT '平均参与度分子' AFTER `AVG_JOIN`, + ADD COLUMN `AVG_JOIN_FM` int(11) NULL DEFAULT 0 COMMENT '平均参与度分母' AFTER `AVG_JOIN_FZ`, + DROP PRIMARY KEY, + ADD PRIMARY KEY (`ID`) USING BTREE; From d8268745e586e66c321659b04bab38825b7d09b4 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 9 Jul 2021 14:34:39 +0800 Subject: [PATCH 082/107] =?UTF-8?q?screen=5Fuser=5Fjoin=E8=A1=A8=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=8A=BD=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenUserJoinDao.java | 11 + .../impl/PublicPartExtractServiceImpl.java | 213 +++++++++++++++++- .../screen/ScreenUserJoinService.java | 3 +- .../impl/ScreenUserJoinServiceImpl.java | 4 +- .../screen/ScreenUserJoinDao.xml | 7 + 5 files changed, 224 insertions(+), 14 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java index b63726e8ac..ba45d011da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -62,6 +62,17 @@ public interface ScreenUserJoinDao extends BaseDao { Integer deleteUserJoin(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * @Description 根据类别删除 + * @Param customerId + * @Param monthId + * @Param delFlag + * @author zxc + * @date 2021/7/9 2:21 下午 + */ + Integer deleteUserJoinByCategory(@Param("customerId") String customerId,@Param("monthId") String monthId, + @Param("delFlag") String delFlag); + /** * 11、基层治理-公众参与 * 2) 在批量新增 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index cc97b96fab..5e96035ae9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -76,6 +76,14 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { *

* 不考虑市北:人均议题:统计周期内议题总数/发过议题的人数 参与度:各个行为(表决)的总数/发生行为的人数 * + * + * ================================================================================================================ + * ================================================================================================================ + * 2021-07-09 新注释 + * 公众参与里的指标含义说明: + * 总参与:议题参与的次数(比如 表决 等行为,产品只有表决行为,其他三个街道 包含评论数、点赞数、点踩数) + * 人均议题:议题总数/组织内的总人数(项目:绑定网格的总用户数,产品:组织内的小组成员数去重) + * 平均参与度:议题参与的总人数(每个议题参与人数的和)/(应参与人数(项目:组织内的人数不去重;产品:组织内的小组成员数去重)* 议题个数) * @return java.lang.Boolean * @author LiuJanJun * @date 2020/9/25 10:24 上午 @@ -86,9 +94,9 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { log.warn("extractTotalDataMonthly param is error,param:{}", JSON.toJSONString(formDTO)); return false; } - extractGridUserJoin(formDTO); - extractAgencyUserJoin(formDTO); - return null; + gridUserJoinCal(formDTO); + agencyUserJoinCal(formDTO); + return true; } private void extractGridUserJoin(ExtractScreenFormDTO formDTO) { @@ -178,7 +186,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { entity.setAvgJoin(bigDecimal.divide(votedByIssueCount, 4, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal(NumConstant.ONE_HUNDRED))); } } - screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values())); + screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()),OrgTypeConstant.GRID); } private void extractAgencyUserJoin(ExtractScreenFormDTO formDTO) { @@ -253,12 +261,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { } }); } - screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values())); - } - - public static void main(String[] args) { - BigDecimal bigDecimal = new BigDecimal(0); - bigDecimal = bigDecimal.add(new BigDecimal(0 / (1 * 1.0))); + screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()),OrgTypeConstant.GRID); } private void buildUserJoinEntity(ExtractScreenFormDTO formDTO, Object org, Map result) { @@ -274,7 +277,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { } else if (org instanceof DimAgencyEntity) { DimAgencyEntity agency = (DimAgencyEntity) org; entity.setCustomerId(agency.getCustomerId()); - entity.setOrgType(agency.getLevel()); + entity.setOrgType(OrgTypeConstant.AGENCY); entity.setOrgId(agency.getId()); entity.setParentId(agency.getPid()); entity.setOrgName(agency.getAgencyName()); @@ -289,6 +292,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { entity.setAvgJoin(new BigDecimal(0)); entity.setAgvgJoinUpRate(new BigDecimal("0")); entity.setAgvgJoinUpFlag(""); + entity.setAvgIssueFz(NumConstant.ZERO); + entity.setAvgIssueFm(NumConstant.ZERO); + entity.setAvgJoinFz(NumConstant.ZERO); + entity.setAvgJoinFm(NumConstant.ZERO); result.put(entity.getOrgId(), entity); } @@ -304,4 +311,188 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { public Boolean extractPerTotalDataDaily(ExtractScreenFormDTO formDTO) { return null; } + + /** + * @Description 基层治理-公众参与【网格-月】 + * @Param formDTO + * @author zxc + * @date 2021/7/9 9:20 上午 + */ + public void gridUserJoinCal(ExtractScreenFormDTO formDTO){ + // 查询客户下所有网格 + List orgList = dimGridService.getGridListByCustomerId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(orgList)) { + log.warn("抽取【公众参与-人均议题】,获取组织数据失败,customerId:{}", formDTO.getCustomerId()); + return; + } + //构建组织数据 + Map insertMap = new HashMap<>(16); + orgList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap)); + //获取议题月份增量 + List issueTotal = factIssueGridMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(issueTotal)) { + return; + } + // 查询 注册居民本月增量 党员认证本月增量 截止本月底居民总数 + List userCountList = factRegUserGridMonthlyService.selectGridUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); + if (CollectionUtils.isEmpty(userCountList)) { + return; + } + // list 转 map 以orgId为key + Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o)); + for (FactIssueGridMonthlyEntity issue : issueTotal) { + String gridId = issue.getGridId(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + if (entity == null) { + continue; + } + // 议题本月增长 + entity.setJoinTotal(issue.getIssueIncr()); + // 网格下 注册居民本月增量,党员认证本月增量,截止本月底居民总数 + GridUserCountResultDTO user = userCountMap.get(gridId); + if (user == null) { + continue; + } + // 议题总数/组织内的总人数(项目:绑定网格的总用户数,产品:组织内的小组成员数去重) + log.debug("issue:{}", JSON.toJSONString(issue)); + log.debug("user:{}", JSON.toJSONString(user)); + if (!user.getRegTotal().equals(0)) { + BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal()),NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + entity.setAvgIssueFz(issue.getIssueIncr()); + entity.setAvgIssueFm(user.getRegTotal()); + // 人均议题 + entity.setAvgIssue(avgIssueCount); + } + } + //获取该月 表决的人数 + List voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.GRID_ID); + Map gridMemberCount = new HashMap<>(16); + // 议题月份增量不为空 + if (!CollectionUtils.isEmpty(issueTotal)) { + //获取每个网格的应表决人数 + List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.GRID_ID); + if (CollectionUtils.isEmpty(memberCountList)) { + return; + } + // 网格下的组员 + gridMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); + } + /** + * 平均参与度:议题参与的总人数(每个议题参与人数的和)/(应参与人数(项目:网格内的人数不去重;产品:组织内的小组成员数去重)* 议题个数) + */ + // 根据网格ID分组 + Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId)); + //遍历实际参与人数 + for (Map.Entry> entry : voteMap.entrySet()) { + String gridId = entry.getKey(); + ScreenUserJoinEntity entity = insertMap.get(gridId); + if (entity == null) { + continue; + } + List issueList = entry.getValue(); + BigDecimal realJoinCount = new BigDecimal(0); + // 网格下 议题个数 + BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount()); + // 网格下 组员人数 + Integer memberCount = gridMemberCount.get(gridId); + for (IssueVoteUserCountResultDTO vote : issueList) { + // 每个议题参与人数求和 + realJoinCount = realJoinCount.add(new BigDecimal(vote.getVoteCount())); + } + if (votedByIssueCount.intValue() != NumConstant.ZERO) { + // 平均参与度 = 议题参与的总人数 / (应参与人数 * 议题个数) + BigDecimal avgFz = votedByIssueCount.multiply(new BigDecimal(memberCount)); + entity.setAvgJoinFz(Integer.valueOf(avgFz.toString())); + entity.setAvgJoinFm(Integer.valueOf(realJoinCount.toString())); + entity.setAvgJoin(realJoinCount.divide(avgFz, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + } + } + screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()),OrgTypeConstant.GRID); + } + + /** + * @Description 基层治理-公众参与【组织-月】 + * @Param formDTO + * @author zxc + * @date 2021/7/9 9:20 上午 + */ + public void agencyUserJoinCal(ExtractScreenFormDTO formDTO){ + // 查询客户下的所有组织 + List agencyList = dimAgencyService.getAgencyListByCustomerId(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(agencyList)) { + log.warn("抽取【公众参与-人均议题】,获取组织数据失败,customerId:{}", formDTO.getCustomerId()); + return; + } + //构建组织数据 + Map insertMap = new HashMap<>(16); + agencyList.forEach(org -> buildUserJoinEntity(formDTO, org, insertMap)); + // 查询组织下 议题月增长,截止本月议题总数 + List issueTotal = factIssueAgencyMonthlyService.getIssueIncCountAndTotalByMonthId(formDTO.getCustomerId(), formDTO.getMonthId()); + // 查询 注册居民本月增量 党员认证本月增量 截止本月底居民总数 + List userCountList = factRegUserAgencyMonthlyService.selectAgencyUserCount(formDTO.getCustomerId(), formDTO.getMonthId()); + // 以agencyId为key + Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o)); + Set agencyIdSet = new HashSet<>(); + if (!CollectionUtils.isEmpty(issueTotal)) { + issueTotal.forEach(issue -> { + String agencyId = issue.getAgencyId(); + agencyIdSet.add(agencyId); + ScreenUserJoinEntity entity = insertMap.get(agencyId); + if (entity == null){ + return; + } + entity.setJoinTotal(issue.getIssueIncr()); + GridUserCountResultDTO user = userCountMap.get(agencyId); + // 人均议题:议题总数/组织内的总人数(项目:绑定网格的总用户数,产品:组织内的小组成员数去重) + if (!user.getRegTotal().equals(NumConstant.ZERO)) { + BigDecimal avgIssueCount = new BigDecimal(issue.getIssueIncr()).divide(new BigDecimal(user.getRegTotal()), NumConstant.FOUR, BigDecimal.ROUND_HALF_UP); + entity.setAvgIssueFz(issue.getIssueIncr()); + entity.setAvgIssueFm(user.getRegTotal()); + entity.setAvgIssue(avgIssueCount); + } + }); + List> partition = ListUtils.partition(new ArrayList<>(agencyIdSet), NumConstant.THIRTY); + partition.forEach(list -> { + //获取该月 表决的人数 + List voteCountList = factOriginIssueLogDailyService.getVoteCount(formDTO.getCustomerId(), formDTO.getMonthId(), ProjectConstant.AGENCY_ID); + Map orgMemberCount = new HashMap<>(16); + if (!CollectionUtils.isEmpty(issueTotal)) { + //获取每个组织的应表决人数 + List memberCountList = factOriginGroupMainDailyService.selectDistinctGroupMemberCount(formDTO.getCustomerId(), ProjectConstant.AGENCY_ID); + if (CollectionUtils.isEmpty(memberCountList)) { + log.warn("抽取【公众参与-人均议题】,获取应表决人数为空,customerId:{}", formDTO.getCustomerId()); + return; + } + // (k,v) = (agencyId,组织下的人) + orgMemberCount = memberCountList.stream().collect(Collectors.toMap(GridGroupUserCountResultDTO::getOrgId, o -> o.getMemberCount())); + } + // 平均参与度:议题参与的总人数(每个议题参与人数的和)/(应参与人数(项目:组织内的人数不去重;产品:组织内的小组成员数去重)* 议题个数) + // 根据组织ID分组 + Map> voteMap = voteCountList.stream().collect(Collectors.groupingBy(IssueVoteUserCountResultDTO::getOrgId)); + for (Map.Entry> entry : voteMap.entrySet()) { + String orgId = entry.getKey(); + ScreenUserJoinEntity entity = insertMap.get(orgId); + List issueList = entry.getValue(); + // 实际参与人数 + BigDecimal realJoinCount = new BigDecimal(NumConstant.ZERO); + // 组织下 的议题数 + BigDecimal votedByIssueCount = new BigDecimal(issueList.get(NumConstant.ZERO).getIssueCount()); + // 组织下应参与人数 + Integer memberCount = orgMemberCount.get(orgId); + for (IssueVoteUserCountResultDTO vote : issueList) { + realJoinCount = realJoinCount.add(new BigDecimal(vote.getVoteCount())); + } + if (votedByIssueCount.intValue() != 0) { + // 平均参与度 = 议题参与的总人数 / (应参与人数 * 议题个数) + BigDecimal avgFz = votedByIssueCount.multiply(new BigDecimal(memberCount)); + entity.setAvgJoin(realJoinCount.divide(votedByIssueCount, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + entity.setAvgJoinFz(Integer.valueOf(realJoinCount.toString())); + entity.setAvgJoinFm(Integer.valueOf(avgFz.toString())); + } + } + }); + } + screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()),OrgTypeConstant.AGENCY); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java index 0a42c758a4..dcdf848174 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java @@ -36,9 +36,10 @@ public interface ScreenUserJoinService extends BaseService * * @param formDTO * @param list + * @param delFlag 删除标志 agency,grid * @return java.lang.Boolean * @author LiuJanJun * @date 2020/9/27 4:40 下午 */ - Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List list); + Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List list,String delFlag); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java index 328a3d1a1c..978ce14992 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java @@ -54,14 +54,14 @@ public class ScreenUserJoinServiceImpl extends BaseServiceImpl list) { + public Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List list, String delFlag) { if (formDTO == null || StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId()) || CollectionUtils.isEmpty(list)) { log.error("deleteAndInsertBatch param is error"); return false; } int deleteNum; do { - deleteNum = baseDao.deleteUserJoin(formDTO.getCustomerId(), formDTO.getMonthId()); + deleteNum = baseDao.deleteUserJoinByCategory(formDTO.getCustomerId(), formDTO.getMonthId(),delFlag); } while (deleteNum != NumConstant.ZERO); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml index 862a31464c..0fc7db5b18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml @@ -26,6 +26,13 @@ limit 1000; + + + delete from screen_user_join + where CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} AND ORG_TYPE = #{delFlag} + limit 1000 + + insert into screen_user_join ( From f5f6ce54726ad90f1150408178c56387d6435481 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 9 Jul 2021 15:08:00 +0800 Subject: [PATCH 083/107] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8C=87=E5=AE=9A=20?= =?UTF-8?q?=E6=9C=88=E4=BB=BD=E7=9A=84=E5=89=8Dn=E6=9C=88=20=E8=BF=94?= =?UTF-8?q?=E5=9B=9EyyyyMM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/commons/tools/utils/DateUtils.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 b47d56574c..c2988b67f9 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 @@ -446,6 +446,22 @@ public class DateUtils { return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMM); } + /** + * @Description 获取指定 月份的前n月 返回yyyyMM + * @Param beforeMonth + * @Param monthId + * @author zxc + * @date 2021/7/9 2:44 下午 + */ + public static String getBeforeNMonthByMonth(int beforeMonth, String monthId){ + StringBuilder builder = new StringBuilder(monthId); + builder.insert(NumConstant.FOUR,"-"); + builder.insert(builder.length(),"-01"); + LocalDate parse = LocalDate.parse(builder.toString()); + LocalDate localDate = parse.minusMonths(beforeMonth); + return localDate.toString().replace("-","").substring(NumConstant.ZERO,NumConstant.SIX); + } + /** * @return java.util.List 返回yyyyMMdd * @param startTime yyyyMMdd From 149fd98a73885fd8e67923d9105219aef04660ee Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 9 Jul 2021 15:54:51 +0800 Subject: [PATCH 084/107] =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E7=AB=AF?= =?UTF-8?q?=E9=9A=BE=E7=82=B9=E8=B5=8C=E7=82=B9=E5=88=97=E8=A1=A8=EF=BC=8C?= =?UTF-8?q?=E8=BF=94=E5=8F=82=E5=A2=9E=E5=8A=A0statusDesc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/ProjectDifficultRankResultDTO.java | 9 +++++++-- .../src/main/resources/mapper/project/ProjectDao.xml | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java index f781d62d15..f3d1967599 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectDifficultRankResultDTO.java @@ -3,7 +3,6 @@ package com.epmet.project.dto.result; import lombok.Data; import java.io.Serializable; -import java.util.ArrayList; import java.util.List; /** @@ -25,11 +24,17 @@ public class ProjectDifficultRankResultDTO implements Serializable { * 项目标题 * */ private String title; - + // 3个街道和产品这边状态码不一样.. /** * 状态: 待处理: pending; 结案closed * */ private String statusCode; + // pending 处理中 + // closed 已结案 + // 10 已结案 + // 5 已关闭 + // 0 处理中 + private String statusDesc; /** * 社区-网格名 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 9cde166e58..fced0091a6 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 @@ -273,6 +273,7 @@ diff.EVENT_ID AS projectId, ifnull(diff.EVENT_CONTENT,diff.EVENT_TITLE) AS title, diff.EVENT_STATUS_CODE AS statusCode, + IFNULL(diff.EVENT_STATUS_DESC,'') as statusDesc, diff.EVENT_SOURCE AS gridName, diff.EVENT_IMG_URL AS imgUrl, floor(diff.EVENT_COST_TIME/60) AS totalHours, From 67ee6c6560319abbbdbfed8d2b9323730a80c2c0 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 9 Jul 2021 16:40:02 +0800 Subject: [PATCH 085/107] =?UTF-8?q?=E5=A2=9E=E9=95=BF=E7=8E=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/GovernConstant.java | 16 ++++ .../screen/ScreenUserJoinDao.java | 10 +++ .../impl/PublicPartExtractServiceImpl.java | 83 ++++++++++++++++++- .../screen/ScreenUserJoinService.java | 10 +++ .../impl/ScreenUserJoinServiceImpl.java | 13 +++ .../screen/ScreenUserJoinDao.xml | 10 +++ 6 files changed, 140 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/GovernConstant.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/GovernConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/GovernConstant.java new file mode 100644 index 0000000000..9219f505a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/GovernConstant.java @@ -0,0 +1,16 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2021/7/9 3:24 下午 + * @DESC + */ +public interface GovernConstant { + + /** + * 增长:incr;下降:decr; 相等 :eq; + */ + String INCR = "incr"; + String DECR = "decr"; + String EQ = "eq"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java index ba45d011da..ada3123821 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenUserJoinDao.java @@ -83,4 +83,14 @@ public interface ScreenUserJoinDao extends BaseDao { * @Date 10:52 2020-08-18 **/ void batchInsertUserJoin(@Param("list") List list, @Param("customerId")String customerId); + + /** + * @Description 根据月份查询screenUserJoin + * @Param customerId + * @Param monthId + * @Param flag :agency : grid + * @author zxc + * @date 2021/7/9 3:13 下午 + */ + List selectScreenUserJoin(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("flag")String flag); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index 5e96035ae9..9260f204e5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.GovernConstant; import com.epmet.constant.OrgTypeConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dto.extract.form.ExtractScreenFormDTO; @@ -407,7 +408,8 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { entity.setAvgJoin(realJoinCount.divide(avgFz, NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); } } - screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()),OrgTypeConstant.GRID); + ArrayList dispose = dispose(formDTO, insertMap, OrgTypeConstant.GRID); + screenUserJoinService.deleteAndInsertBatch(formDTO, dispose,OrgTypeConstant.GRID); } /** @@ -492,7 +494,84 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { } }); } - screenUserJoinService.deleteAndInsertBatch(formDTO, new ArrayList<>(insertMap.values()),OrgTypeConstant.AGENCY); + ArrayList dispose = dispose(formDTO, insertMap, OrgTypeConstant.AGENCY); + screenUserJoinService.deleteAndInsertBatch(formDTO, dispose,OrgTypeConstant.AGENCY); } + public ArrayList dispose(ExtractScreenFormDTO formDTO,Map insertMap,String flag) { + String beforeNMonthByMonth = DateUtils.getBeforeNMonthByMonth(NumConstant.ONE, formDTO.getMonthId()); + List screenUserJoinEntities = screenUserJoinService.selectScreenUserJoin(formDTO.getCustomerId(), beforeNMonthByMonth, flag); + ArrayList insertList = new ArrayList<>(insertMap.values()); + if (CollectionUtils.isEmpty(screenUserJoinEntities)) { + insertList.forEach(l -> { + // 总的参与次数较上月增长率 + if (l.getJoinTotal().equals(NumConstant.ZERO)) { + l.setJoinTotalUpFlag(GovernConstant.EQ); + l.setJoinTotalUpRate(NumConstant.ZERO_DECIMAL); + } else if (l.getJoinTotal() > NumConstant.ZERO) { + l.setJoinTotalUpFlag(GovernConstant.INCR); + l.setJoinTotalUpRate(NumConstant.ONE_HUNDRED_DECIMAL); + } + // 人均议题较上月增长率 + if (l.getAvgIssue().equals(NumConstant.ZERO_DECIMAL)) { + l.setAvgIssueUpFlag(GovernConstant.EQ); + l.setAvgIssueUpRate(NumConstant.ZERO_DECIMAL); + } else { + l.setAvgIssueUpFlag(GovernConstant.INCR); + l.setAvgIssueUpRate(NumConstant.ONE_HUNDRED_DECIMAL); + } + // 平均参与度较上月增长率 + if (l.getAvgJoin().equals(NumConstant.ZERO_DECIMAL)) { + l.setAgvgJoinUpFlag(GovernConstant.EQ); + l.setAgvgJoinUpRate(NumConstant.ZERO_DECIMAL); + } else { + l.setAgvgJoinUpFlag(GovernConstant.INCR); + l.setAgvgJoinUpRate(NumConstant.ONE_HUNDRED_DECIMAL); + } + }); + } else { + insertList.forEach(l -> { + screenUserJoinEntities.forEach(s -> { + if (l.getOrgId().equals(s.getOrgId())) { + // 总的参与次数较上月增长率 + if (l.getJoinTotal() > s.getJoinTotal()) { + l.setJoinTotalUpFlag(GovernConstant.INCR); + l.setJoinTotalUpRate(new BigDecimal(((l.getJoinTotal() - s.getJoinTotal()) / s.getJoinTotal()) * NumConstant.ONE_HUNDRED).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + } else if (l.getJoinTotal() < s.getJoinTotal()) { + l.setJoinTotalUpFlag(GovernConstant.DECR); + l.setJoinTotalUpRate(new BigDecimal(((l.getJoinTotal() - s.getJoinTotal()) / s.getJoinTotal()) * NumConstant.ONE_HUNDRED).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + } else { + l.setJoinTotalUpFlag(GovernConstant.EQ); + l.setJoinTotalUpRate(NumConstant.ZERO_DECIMAL); + } + // 人均议题较上月增长率 + Integer re = l.getAvgIssue().compareTo(s.getAvgIssue()); + if (re.equals(NumConstant.ONE)) { + l.setAvgIssueUpFlag(GovernConstant.INCR); + l.setAvgIssueUpRate(l.getAvgIssue().subtract(s.getAvgIssue()).divide(s.getAvgIssue()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + } else if (re.equals(NumConstant.ONE_NEG)) { + l.setAvgIssueUpFlag(GovernConstant.DECR); + l.setAvgIssueUpRate(l.getAvgIssue().subtract(s.getAvgIssue()).divide(s.getAvgIssue()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + } else { + l.setAvgIssueUpFlag(GovernConstant.EQ); + l.setAvgIssueUpRate(NumConstant.ZERO_DECIMAL); + } + // 平均参与度较上月增长率 + Integer avgJoinRe = l.getAvgJoin().compareTo(s.getAvgJoin()); + if (avgJoinRe.equals(NumConstant.ONE)) { + l.setAgvgJoinUpFlag(GovernConstant.INCR); + l.setAgvgJoinUpRate(l.getAvgJoin().subtract(s.getAvgJoin()).divide(s.getAvgJoin()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + } else if (avgJoinRe.equals(NumConstant.ONE_NEG)) { + l.setAvgIssueUpFlag(GovernConstant.DECR); + l.setAgvgJoinUpRate(l.getAvgJoin().subtract(s.getAvgJoin()).divide(s.getAvgJoin()).multiply(NumConstant.ONE_HUNDRED_DECIMAL).setScale(NumConstant.FOUR, BigDecimal.ROUND_HALF_UP)); + } else { + l.setAvgIssueUpFlag(GovernConstant.EQ); + l.setAgvgJoinUpRate(NumConstant.ZERO_DECIMAL); + } + } + }); + }); + } + return insertList; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java index dcdf848174..e3574393e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenUserJoinService.java @@ -42,4 +42,14 @@ public interface ScreenUserJoinService extends BaseService * @date 2020/9/27 4:40 下午 */ Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List list,String delFlag); + + /** + * @Description 根据月份查询screenUserJoin + * @Param customerId + * @Param monthId + * @Param flag :agency : grid + * @author zxc + * @date 2021/7/9 3:13 下午 + */ + List selectScreenUserJoin(String customerId,String monthId,String flag); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java index 978ce14992..97b976e475 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java @@ -124,6 +124,19 @@ public class ScreenUserJoinServiceImpl extends BaseServiceImpl selectScreenUserJoin(String customerId, String monthId, String flag) { + return baseDao.selectScreenUserJoin(customerId, monthId, flag); + } + /** * 计算 本月数值 相较于 上月数值,的增长率 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml index 0fc7db5b18..42cc5ffba3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenUserJoinDao.xml @@ -100,4 +100,14 @@ + + + + From c429247428620c4b9f721e1aee653c6e46436190 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 9 Jul 2021 16:49:35 +0800 Subject: [PATCH 086/107] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=8C=87?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java index 97b976e475..a402ac4370 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenUserJoinServiceImpl.java @@ -48,11 +48,11 @@ import java.util.List; */ @Slf4j @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) public class ScreenUserJoinServiceImpl extends BaseServiceImpl implements ScreenUserJoinService { @Override - @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Transactional(rollbackFor = Exception.class) public Boolean deleteAndInsertBatch(ExtractScreenFormDTO formDTO, List list, String delFlag) { if (formDTO == null || StringUtils.isBlank(formDTO.getCustomerId()) || StringUtils.isBlank(formDTO.getMonthId()) || CollectionUtils.isEmpty(list)) { From 68e27f881f58fadefaaa45a202c2e3b656ed21e9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 9 Jul 2021 17:10:46 +0800 Subject: [PATCH 087/107] NullPointerEx fix trytry --- .../screen/impl/AgencyServiceImpl.java | 15 ++++++++++++--- .../com/epmet/dto/result/ParentListResultDTO.java | 5 +++++ 2 files changed, 17 insertions(+), 3 deletions(-) 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 062b632e09..538df72f10 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 @@ -468,18 +468,27 @@ public class AgencyServiceImpl implements AgencyService { return agencysResultDTO; } - private List getParentListMultic(List resList,ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) { + private List getParentListMultic(List resList, ScreenCustomerAgencyDTO firstParent, String currentUserCustomerId, String rootAgencyId) { ParentListResultDTO resultDTO = new ParentListResultDTO(); resultDTO.setId(firstParent.getAgencyId()); resultDTO.setName(firstParent.getAgencyName()); resultDTO.setLevel(firstParent.getLevel()); + resultDTO.setAreaCode(firstParent.getAreaCode()); resList.add(resultDTO); if (firstParent.getCustomerId().equals(currentUserCustomerId) && firstParent.getAgencyId().equals(rootAgencyId)) { Collections.reverse(resList); return resList; } else { - ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(firstParent.getParentAreaCode()); - return getParentListMultic(resList,parentAgency, currentUserCustomerId, rootAgencyId); + String parentAgencyAreaCode = firstParent.getParentAreaCode(); + if (StringUtils.isNotBlank(parentAgencyAreaCode)) { + parentAgencyAreaCode = parentAgencyAreaCode.replaceAll("(0)+$", ""); + } + ScreenCustomerAgencyDTO parentAgency = screenCustomerAgencyDao.selectByAreaCode(parentAgencyAreaCode); + if (null != parentAgency) { + return getParentListMultic(resList, parentAgency, currentUserCustomerId, rootAgencyId); + } else { + return resList; + } } } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java index 421ecabd25..b9222196f9 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/ParentListResultDTO.java @@ -46,4 +46,9 @@ public class ParentListResultDTO implements Serializable { * 省级:province; 市级: city; 区县级: district ;乡(镇、街道)级:street ;社区级:community */ private String level=""; + + /** + * 增加此返回值,为了调试用 + */ + private String areaCode; } \ No newline at end of file From 80f82908c5dcc352eaa48a47269bf145aec62847 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 9 Jul 2021 17:38:12 +0800 Subject: [PATCH 088/107] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=8F=98=E5=8A=A8=E6=B6=88=E8=B4=B9=E9=A2=91=E7=8E=87=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=EF=BC=8C=E7=94=A8redis?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mq/ProjectChangedCustomListener.java | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java index a9f266edf4..d1b789dc7e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/mq/ProjectChangedCustomListener.java @@ -5,6 +5,8 @@ import com.epmet.commons.rocketmq.messages.ProjectChangedMQMsg; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.distributedlock.DistributedLock; import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.redis.RedisKeys; +import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.SpringContextUtils; import com.epmet.dto.extract.form.ExtractOriginFormDTO; import com.epmet.service.evaluationindex.extract.todata.FactOriginExtractService; @@ -21,6 +23,7 @@ import org.apache.rocketmq.common.message.MessageExt; import org.redisson.api.RLock; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.data.redis.core.RedisTemplate; import javax.annotation.PreDestroy; import java.util.Date; @@ -41,24 +44,16 @@ import java.util.stream.Collectors; public class ProjectChangedCustomListener implements MessageListenerConcurrently { private Logger logger = LoggerFactory.getLogger(getClass()); - /** - * 控制通知类型消息的消费频率 - */ - private static final Cache customerIdCache = CacheBuilder.newBuilder().maximumSize(NumConstant.ONE_HUNDRED) - .expireAfterWrite(NumConstant.THIRTY,TimeUnit.SECONDS).build(); + + private RedisUtils redisUtils; @Override public ConsumeConcurrentlyStatus consumeMessage(List msgs, ConsumeConcurrentlyContext context) { long start = System.currentTimeMillis(); try { - List customerIds = msgs.stream().map(messageExt -> new String(messageExt.getBody())).distinct().collect(Collectors.toList()); - for (String customerId : customerIds) { - //获取缓存 如果不存在缓存中 则执行消费 并放入缓存中 - String ifPresent = customerIdCache.getIfPresent(customerId); - if (StringUtils.isBlank(ifPresent)){ - consumeMessage(customerId); - customerIdCache.put(customerId,customerId); - } + List msgStrs = msgs.stream().map(messageExt -> new String(messageExt.getBody())).distinct().collect(Collectors.toList()); + for (String msgStr : msgStrs) { + consumeMessage(msgStr); } } catch (Exception e) { //失败不重发 @@ -76,6 +71,23 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently log.warn("consumeMessage msg body is blank"); return; } + + if (redisUtils == null) { + redisUtils = SpringContextUtils.getBean(RedisUtils.class); + } + + String redisKey = RedisKeys.getProjectChangedMsgDistinceKey(msgObj.getCustomerId()); + if (redisUtils.get(redisKey) == null) { + consumeMessage(msgObj); + log.info("消费了项目变动消息,customer id:{}", msgObj.getCustomerId()); + // 有效期30秒 + redisUtils.set(redisKey, msg, 30); + } else { + log.info("该项目变动消息刚刚消费,请等待30秒,customer id:{}", msgObj.getCustomerId()); + } + } + + public void consumeMessage(ProjectChangedMQMsg msgObj) { DistributedLock distributedLock = null; RLock lock = null; try { @@ -128,6 +140,7 @@ public class ProjectChangedCustomListener implements MessageListenerConcurrently } } } + @PreDestroy public void saveCalStatus() { //todo From fa862c51ec93e96428362508510570a6eaf68a52 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 9 Jul 2021 17:42:37 +0800 Subject: [PATCH 089/107] =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/commons/tools/redis/RedisKeys.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java index 68c417c580..6f5e7bf1f3 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/redis/RedisKeys.java @@ -469,4 +469,8 @@ public class RedisKeys { public static String getCorsConfigKey() { return rootPrefix.concat("sys:cors"); } + + public static String getProjectChangedMsgDistinceKey(String customerId) { + return rootPrefix.concat("project_changed:consume:").concat(customerId); + } } From 75311c7fe932f7b1d4ae0c513745c9ef9d633fd0 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Fri, 9 Jul 2021 17:44:22 +0800 Subject: [PATCH 090/107] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E5=88=A0=E9=99=A4=E6=94=B9=E4=B8=BA=E7=89=A9?= =?UTF-8?q?=E7=90=86=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenProjectDataDao.java | 18 ++++++++++++++++++ .../screen/ScreenProjectImgDataDao.java | 2 ++ .../impl/ScreenProjectDataServiceImpl.java | 10 ++-------- .../screen/ScreenProjectDataDao.xml | 13 +++++++++++++ .../screen/ScreenProjectImgDataDao.xml | 4 ++++ 5 files changed, 39 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index 1cdb4a1e8d..5410417202 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -46,4 +46,22 @@ public interface ScreenProjectDataDao extends BaseDao { void insertBatch(@Param("list") List list); void updateBatch(@Param("list") List list,@Param("dateId") String dateId); + + /** + * 根据项目ID删除数据 + * @author zhaoqifeng + * @date 2021/7/9 17:33 + * @param projectId + * @return int + */ + int deleteByProjectId(@Param("projectId") String projectId); + + /** + * 根据项目ID删除数据 + * @author zhaoqifeng + * @date 2021/7/9 17:33 + * @param list + * @return int + */ + void deleteByProjectIds(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java index 4904f32724..9335e8aa61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java @@ -37,4 +37,6 @@ public interface ScreenProjectImgDataDao extends BaseDao list); void insertBatch(@Param("list") List list); + + int deleteByProjectId(@Param("projectId") String projectId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index bf8c212f6b..15deb2bb57 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -177,14 +177,8 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl deleteWrapper = new QueryWrapper<>(); - deleteWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()); - baseDao.delete(deleteWrapper); - QueryWrapper screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>(); - screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()); - screenProjectImgDataDao.delete(screenProjectImgDataEntityQueryWrapper); + baseDao.deleteByProjectId(item.getProjectId()); + screenProjectImgDataDao.deleteByProjectId(item.getProjectId()); //如果orgType未知,获取一下 // if ("unknown".equals(item.getOrgType())){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index 51c75a1c17..2a123547f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -46,6 +46,19 @@ and DATE_FORMAT(PROJECT_CREATE_TIME,'%Y%m%d') = #{dateId} limit 1000 + + delete from screen_project_data + where PROJECT_ID = #{projectId} + + + + delete from screen_project_data + + + PROJECT_ID = #{projectId} + + + SELECT - psd.PROJECT_ID + distinct psd.PROJECT_ID FROM project_satisfaction_detail psd WHERE From 3445fe4debc6b26cf7b4a2cdad7a3a778245adf2 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 12 Jul 2021 10:16:04 +0800 Subject: [PATCH 107/107] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E5=88=A0=E9=99=A4=E6=94=B9=E4=B8=BA=E7=89=A9?= =?UTF-8?q?=E7=90=86=E5=88=A0=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/evaluationindex/screen/ScreenProjectDataDao.java | 4 ++-- .../evaluationindex/screen/ScreenProjectImgDataDao.java | 2 +- .../screen/impl/ScreenProjectDataServiceImpl.java | 4 ++-- .../mapper/evaluationindex/screen/ScreenProjectDataDao.xml | 7 ++++--- .../evaluationindex/screen/ScreenProjectImgDataDao.xml | 1 + 5 files changed, 10 insertions(+), 8 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index 5410417202..4afa322825 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -54,7 +54,7 @@ public interface ScreenProjectDataDao extends BaseDao { * @param projectId * @return int */ - int deleteByProjectId(@Param("projectId") String projectId); + int deleteByProjectId(@Param("customerId") String customerId, @Param("projectId") String projectId); /** * 根据项目ID删除数据 @@ -63,5 +63,5 @@ public interface ScreenProjectDataDao extends BaseDao { * @param list * @return int */ - void deleteByProjectIds(@Param("list") List list); + void deleteByProjectIds(@Param("customerId") String customerId, @Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java index 9335e8aa61..ff563a9f6e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java @@ -38,5 +38,5 @@ public interface ScreenProjectImgDataDao extends BaseDao list); - int deleteByProjectId(@Param("projectId") String projectId); + int deleteByProjectId(@Param("customerId") String customerId, @Param("projectId") String projectId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index 8ac534876c..4db3552a39 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -173,8 +173,8 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl delete from screen_project_data where PROJECT_ID = #{projectId} + AND customer_id = #{customerId} delete from screen_project_data - - + where 1=1 + AND customer_id = #{customerId} + PROJECT_ID = #{projectId} -