From 4029959dfcbd30c9da66aae603702cb9ece7f019 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Apr 2021 17:53:17 +0800 Subject: [PATCH 01/17] =?UTF-8?q?"agencydetail"=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/AgencyServiceImpl.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 155bad550c..2a5bcbb838 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -251,6 +251,28 @@ public class AgencyServiceImpl implements AgencyService { parentList = customerAgencyDao.selectPAgencyById(listStr); agencysResultDTO.setParentList(parentList); agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); + //查询组织区划的名称 + if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { + switch (entity.getLevel()) { + case CustomerAgencyConstant.PROVINCE_LEVEL: + agencysResultDTO.setAreaName(entity.getProvince()); + break; + case CustomerAgencyConstant.CITY_LEVEL: + agencysResultDTO.setAreaName(entity.getCity()); + break; + case CustomerAgencyConstant.DISTRICT: + agencysResultDTO.setAreaName(entity.getDistrict()); + break; + case CustomerAgencyConstant.STREET_LEVEL: + agencysResultDTO.setAreaName(entity.getStreet()); + break; + case CustomerAgencyConstant.COMMUNITY_LEVEL: + agencysResultDTO.setAreaName(entity.getCommunity()); + break; + default: + agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); + } + } return new Result().ok(agencysResultDTO); } From 77a21116a4bbc73a5c42a36f2517a6e0d5901e39 Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 14 Apr 2021 18:00:42 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E9=9A=BE=E7=82=B9=E5=A0=B5=E7=82=B9?= =?UTF-8?q?=E5=9B=BE=E7=89=87=20=E8=AE=BE=E7=BD=AEcustomerId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java index 780571ca07..d40fbd8b6a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenGrassrootsGovernDataAbsorptionServiceImpl.java @@ -297,6 +297,7 @@ public class ScreenGrassrootsGovernDataAbsorptionServiceImpl implements ScreenGr imgData.setEventImgUrl(img.getAttachmentUrl()); imgData.setSort(img.getSort()); imgDataEntities.add(imgData); + imgData.setCustomerId(param.getCustomerId()); }); log.info("projectId:{} imgs:{}", project.getId(), imgDataEntities.stream().filter(o -> o.getEventId().equals(project.getId())).count()); } From 017bf883dc1f0cdc2a02896a2414097f3c1478d7 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Apr 2021 18:10:39 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=BB=84=E7=BB=87V2?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/form/AddAgencyV2FormDTO.java | 52 ++++++++++--------- .../epmet/service/impl/AgencyServiceImpl.java | 16 +++++- 2 files changed, 43 insertions(+), 25 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java index c426bc6d41..e5b775c067 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java @@ -59,28 +59,32 @@ public class AddAgencyV2FormDTO implements Serializable { @NotBlank(message = "请选择组织区划", groups = AreaCodeGroup.class) private String areaCode; - /** - * 省份 - */ - private String province; - - /** - * 城市 - */ - private String city; - - /** - * 区县 - */ - private String district; - - /** - * 街道 - */ - private String street; - - /** - * 社区 - */ - private String community; + // /** + // * 省份 + // */ + // private String province; + // + // /** + // * 城市 + // */ + // private String city; + // + // /** + // * 区县 + // */ + // private String district; + // + // /** + // * 街道 + // */ + // private String street; + // + // /** + // * 社区 + // */ + // private String community; + + //区域编码名称 + @NotBlank(message = "请选择组织区划", groups = AreaCodeGroup.class) + private String areaName; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 2a5bcbb838..6202cc038c 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -459,7 +459,7 @@ public class AgencyServiceImpl implements AgencyService { customerAgencyDao.insert(insertEntity); //3:返回新组织Id resultDTO.setAgencyId(insertEntity.getId()); - resultDTO.setAreaCode(StrConstant.EPMETY_STR); + resultDTO.setAreaCode(insertEntity.getAreaCode()); return resultDTO; } @@ -482,15 +482,29 @@ public class AgencyServiceImpl implements AgencyService { { case CustomerAgencyConstant.PROVINCE_LEVEL: insertEntity.setLevel(CustomerAgencyConstant.CITY_LEVEL); + insertEntity.setProvince(parent.getProvince()); + insertEntity.setCity(formDTO.getAreaName()); break; case CustomerAgencyConstant.CITY_LEVEL: insertEntity.setLevel(CustomerAgencyConstant.DISTRICT); + insertEntity.setProvince(parent.getProvince()); + insertEntity.setCity(parent.getCity()); + insertEntity.setDistrict(formDTO.getAreaName()); break; case CustomerAgencyConstant.DISTRICT: insertEntity.setLevel(CustomerAgencyConstant.STREET_LEVEL); + insertEntity.setProvince(parent.getProvince()); + insertEntity.setCity(parent.getCity()); + insertEntity.setDistrict(parent.getDistrict()); + insertEntity.setStreet(formDTO.getAreaName()); break; case CustomerAgencyConstant.STREET_LEVEL: insertEntity.setLevel(CustomerAgencyConstant.COMMUNITY_LEVEL); + insertEntity.setProvince(parent.getProvince()); + insertEntity.setCity(parent.getCity()); + insertEntity.setDistrict(parent.getDistrict()); + insertEntity.setStreet(parent.getStreet()); + insertEntity.setCommunity(formDTO.getAreaName()); break; default: log.info("parent.getLevel()="+parent.getLevel()); From ff7a5bed55ee0009fed97c442477b12165b99834 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 14 Apr 2021 18:32:53 +0800 Subject: [PATCH 04/17] departmentdetail --- .../java/com/epmet/dto/result/DepartmentDetailResultDTO.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java index 8d7ab9dff2..11271d8009 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/DepartmentDetailResultDTO.java @@ -58,5 +58,6 @@ public class DepartmentDetailResultDTO implements Serializable { */ private List staffList; + private String areaCode; } \ No newline at end of file From 4b61d8920a83455a25eafec5c2891fdba1d33662 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Apr 2021 14:16:45 +0800 Subject: [PATCH 05/17] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90?= =?UTF-8?q?=E5=8D=95/=E5=A4=9A=E5=AE=A2=E6=88=B7=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E5=88=86=E5=BC=80=EF=BC=8C=E3=80=90org-=E5=A4=A9=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/ScreenProjectOrgDailyDao.java | 1 + .../ScreenProjectOrgDailyServiceImpl.java | 113 ++++++++++-------- .../screen/ScreenProjectOrgDailyDao.xml | 17 +++ 3 files changed, 79 insertions(+), 52 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java index 731347f2a6..cc8e1fb2a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectOrgDailyDao.java @@ -47,4 +47,5 @@ public interface ScreenProjectOrgDailyDao extends BaseDao selectOrgProject(@Param("agencyInfos") List agencyInfos, @Param("dateId") String dateId); + List selectOrgProjectByAgency(@Param("agencyInfos") List agencyInfos, @Param("dateId") String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index c5818bd6fe..be73462ebb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.dto.pingyin.result.ProjectTotalResultDTO; import com.epmet.dto.pingyin.result.ResolvedNumResultDTO; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.crm.CustomerRelationEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectOrgDailyEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.crm.CustomerRelationService; @@ -161,70 +162,39 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl agencyInfos = new ArrayList<>(); - //如果有子客户要按照跟组织的area_code查询组织列表 if(customerRelationService.haveSubCustomer(customerId)){ - // - CustomerAgencyEntity rootAgency=customerAgencyService.getRootAgencyInfo(customerId); - agencyInfos=agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); + // 多客户处理 + extractionProjectOrgDailyMoreCustomer(customerId,dateId); }else{ - agencyInfos=agencyDao.selectAgencyByCustomer(customerId); + // 单客户处理 + extractionProjectOrgDailyOneCustomer(customerId, dateId); } + } + + /** + * @Description 单客户处理 + * @Param customerId + * @Param dateId + * @author zxc + * @date 2021/4/15 上午9:09 + */ + public void extractionProjectOrgDailyOneCustomer(String customerId, String dateId){ + List agencyInfos=agencyDao.selectAgencyByCustomer(customerId); if (CollectionUtils.isEmpty(agencyInfos)){ log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); return; } - List projectOrgDaily = baseDao.selectOrgProject(agencyInfos, dateId); + List projectOrgDaily = baseDao.selectOrgProjectByAgency(agencyInfos, dateId); if (CollectionUtils.isEmpty(projectOrgDaily)){ log.info(String.format(PingYinConstants.SELECT_GRID_INFO_BY_ORG_IS_NULL,customerId)); return; } - List orgIds = agencyInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); - // 查询 项目总数 - List projectTotal = projectMainDailyService.selectProjectTotalByOrg(orgIds, dateId, null); - // 查询 项目解决数 - List resolvedNum = projectMainDailyService.selectResolvedNumByOrg(orgIds, dateId); - //查询 参与满意度评价的总次数 - String[] activeCodesAll = {PingYinConstants.EVALUATE_BAD,PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; - List evaluateTotal = projectMainDailyService.selectEvaluateCountByOrg(orgIds, dateId, getActiveCode(activeCodesAll)); - //查询 满意+非常满意的总次数 - String[] activeCodesGood = {PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; - List evaluateGood = projectMainDailyService.selectEvaluateCountByOrg(orgIds, dateId, getActiveCode(activeCodesGood)); projectOrgDaily.forEach(p -> { - // 参与满意度评价的总次数 - if (!CollectionUtils.isEmpty(evaluateTotal)){ - evaluateTotal.forEach(e -> { - if (p.getOrgId().equals(e.getOrgId())){ - p.setEvaluateTotal(p.getEvaluateTotal() + e.getEvaluateCount()); - } - }); - } - // 满意+非常满意的总次数 - if (!CollectionUtils.isEmpty(evaluateGood)){ - evaluateGood.forEach(e -> { - if (p.getOrgId().equals(e.getOrgId())){ - p.setGoodTotal(p.getGoodTotal() + e.getEvaluateCount()); - } - }); - } - // 项目总数 - if (!CollectionUtils.isEmpty(projectTotal)) { - projectTotal.forEach(t -> { - if (p.getOrgId().equals(t.getOrgId())){ - p.setProjectTotal(p.getProjectTotal() + t.getProjectTotal()); - } - }); - } - // 已解决的项目总数 - if (!CollectionUtils.isEmpty(resolvedNum)){ - resolvedNum.forEach(r -> { - if (p.getOrgId().equals(r.getOrgId())){ - p.setResolvedNum(p.getResolvedNum() + r.getResolvedNum()); - } - }); - } - // 不满意总次数 - p.setBadTotal(p.getEvaluateTotal() - p.getGoodTotal()); + p.setBadTotal(null == p.getBadTotal() ? NumConstant.ZERO : p.getBadTotal()); + p.setEvaluateTotal(null == p.getEvaluateTotal() ? NumConstant.ZERO : p.getEvaluateTotal()); + p.setGoodTotal(null == p.getGoodTotal() ? NumConstant.ZERO : p.getGoodTotal()); + p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + p.setResolvedNum(null == p.getResolvedNum() ? NumConstant.ZERO : p.getResolvedNum()); }); log.info(projectOrgDaily.toString()); agencyInfos.forEach(a -> { @@ -247,6 +217,45 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl agencyInfos = agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); + if (CollectionUtils.isEmpty(agencyInfos)){ + log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + return; + } + List projectOrgDaily = baseDao.selectOrgProject(agencyInfos, dateId); + if (CollectionUtils.isEmpty(projectOrgDaily)){ + log.info(String.format(PingYinConstants.SELECT_GRID_INFO_BY_ORG_IS_NULL,customerId)); + return; + } + projectOrgDaily.forEach(p -> { + p.setBadTotal(null == p.getBadTotal() ? NumConstant.ZERO : p.getBadTotal()); + p.setEvaluateTotal(null == p.getEvaluateTotal() ? NumConstant.ZERO : p.getEvaluateTotal()); + p.setGoodTotal(null == p.getGoodTotal() ? NumConstant.ZERO : p.getGoodTotal()); + p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + p.setResolvedNum(null == p.getResolvedNum() ? NumConstant.ZERO : p.getResolvedNum()); + }); + log.info(projectOrgDaily.toString()); + agencyInfos.forEach(a -> { + a.setDateId(dateId); + projectOrgDaily.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setResolvedRatio(getRatio(p.getResolvedNum(),p.getProjectTotal())); + a.setBadRatio(getRatio(p.getBadTotal(),p.getEvaluateTotal())); + a.setGoodRatio(getRatio(p.getGoodTotal(),p.getEvaluateTotal())); + a.setBadTotal(p.getBadTotal()); + a.setEvaluateTotal(p.getEvaluateTotal()); + a.setGoodTotal(p.getGoodTotal()); + a.setProjectTotal(p.getProjectTotal()); + a.setResolvedNum(p.getResolvedNum()); + } + }); + }); + log.info(agencyInfos.toString()); + del(customerId, dateId); + insert(agencyInfos,customerId,dateId); + } /** * @Description activeCode处理 * @Param actCode diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml index 3ec91a496a..0700977462 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectOrgDailyDao.xml @@ -125,6 +125,23 @@ AND g.DATE_ID #{dateId} + \ No newline at end of file From 07274e5dc0617cd3d26f0d4c88bcb2ec89e48fbf Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Apr 2021 14:29:36 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90?= =?UTF-8?q?=E5=8D=95/=E5=A4=9A=E5=AE=A2=E6=88=B7=E6=9A=82=E6=97=B6?= =?UTF-8?q?=E5=88=86=E5=BC=80=EF=BC=8C=E3=80=90org-=E6=9C=88=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScreenProjectQuantityOrgMonthlyDao.java | 2 + .../ScreenProjectOrgDailyServiceImpl.java | 2 +- ...nProjectQuantityOrgMonthlyServiceImpl.java | 80 +++++++++++++++++-- .../ScreenProjectQuantityOrgMonthlyDao.xml | 30 +++++++ 4 files changed, 107 insertions(+), 7 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java index a11d394821..3adec6357e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.java @@ -49,6 +49,7 @@ public interface ScreenProjectQuantityOrgMonthlyDao extends BaseDao selectQuantityOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + List selectQuantityOrgMonthlyByAgency(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); /** * @Description 项目(事件)数量查询【本月之前的累计】 @@ -58,6 +59,7 @@ public interface ScreenProjectQuantityOrgMonthlyDao extends BaseDao selectQuantityGrandOrgMonthly(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); + List selectQuantityGrandOrgMonthlyByAgency(@Param("agencyInfos") List agencyInfos, @Param("monthId") String monthId); } \ 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/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index be73462ebb..e1241d23e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -154,7 +154,7 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl screenProjectOrgDailyDTOS = new ArrayList<>(); - //如果有子客户要按照跟组织的area_code查询组织列表 if(customerRelationService.haveSubCustomer(customerId)){ - CustomerAgencyEntity rootAgency=customerAgencyService.getRootAgencyInfo(customerId); - screenProjectOrgDailyDTOS=agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); + // 多客户处理 + extractionProjectOrgMonthlyMoreCustomer(customerId, monthId); }else{ - screenProjectOrgDailyDTOS=agencyDao.selectAgencyByCustomer(customerId); + // 单客户处理 + extractionProjectOrgMonthlyOneCustomer(customerId, monthId); } + } + + /** + * @Description 单客户处理 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/4/15 下午2:18 + */ + public void extractionProjectOrgMonthlyOneCustomer(String customerId,String monthId){ + List screenProjectOrgDailyDTOS=agencyDao.selectAgencyByCustomer(customerId); + if (CollectionUtils.isEmpty(screenProjectOrgDailyDTOS)){ + log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); + return; + } + + List agencyInfos = ConvertUtils.sourceToTarget(screenProjectOrgDailyDTOS, ScreenProjectQuantityOrgMonthlyDTO.class); + List projectOrg = baseDao.selectQuantityOrgMonthlyByAgency(agencyInfos, monthId); + if (!CollectionUtils.isEmpty(projectOrg)){ + projectOrg.forEach(p -> { + p.setClosedIncr(p.getClosedIncr()); + p.setProjectIncr(p.getProjectIncr()); + }); + } + List projectGrandOrg = baseDao.selectQuantityGrandOrgMonthly(agencyInfos, monthId); + if (!CollectionUtils.isEmpty(projectGrandOrg)){ + projectGrandOrg.forEach(p -> { + p.setClosedTotal(p.getClosedTotal()); + p.setProjectTotal(p.getProjectTotal()); + p.setUnClosedTotal(p.getUnClosedTotal()); + }); + } + agencyInfos.forEach(a -> { + a.setMonthId(monthId); + if (!CollectionUtils.isEmpty(projectOrg)){ + projectOrg.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setClosedIncr(null == p.getClosedIncr() ? NumConstant.ZERO : p.getClosedIncr()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + } + }); + } + if (!CollectionUtils.isEmpty(projectGrandOrg)){ + projectGrandOrg.forEach(p -> { + if (a.getAreaCode().equals(p.getAreaCode())){ + a.setClosedTotal(null == p.getClosedTotal() ? NumConstant.ZERO : p.getClosedTotal()); + a.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); + a.setUnClosedTotal(null == p.getUnClosedTotal() ? NumConstant.ZERO : p.getUnClosedTotal()); + a.setProjectIncr(null == p.getProjectIncr() ? NumConstant.ZERO : p.getProjectIncr()); + } + }); + } + }); + log.info(agencyInfos.toString()); + del(customerId, monthId); + insert(agencyInfos,customerId,monthId); + } + + /** + * @Description 多客户处理 + * @Param customerId + * @Param monthId + * @author zxc + * @date 2021/4/15 下午2:18 + */ + public void extractionProjectOrgMonthlyMoreCustomer(String customerId,String monthId){ + CustomerAgencyEntity rootAgency=customerAgencyService.getRootAgencyInfo(customerId); + List screenProjectOrgDailyDTOS=agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); if (CollectionUtils.isEmpty(screenProjectOrgDailyDTOS)){ log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); return; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml index 7e0a5cee0e..17385c6462 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyDao.xml @@ -127,5 +127,35 @@ + + + + \ No newline at end of file From 5f1930356c504279e434d763bbf6987e5f09779a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Apr 2021 15:05:58 +0800 Subject: [PATCH 07/17] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=9B=B4=E6=8E=A5=E7=AB=8B=E9=A1=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=20gridId=E4=BF=AE=E6=94=B9=20=3D=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectCategoryDailyDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml index a2aa82a555..8115c5d1ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml @@ -75,7 +75,7 @@ P.PIDS, COUNT(DISTINCT p.ID) AS projectTotal FROM fact_origin_project_main_daily p - LEFT JOIN fact_origin_project_category_daily c ON ( c.PROJECT_Id = p.id AND p.del_flag='0' AND p.GRID_ID IS NULL) + LEFT JOIN fact_origin_project_category_daily c ON ( c.PROJECT_Id = p.id AND p.del_flag='0' AND p.GRID_ID = '') WHERE c.DEL_FLAG = '0' AND c.CUSTOMER_ID = #{customerId} AND ( @@ -95,7 +95,7 @@ P.PIDS, COUNT(distinct p.ID) AS projectTotal FROM fact_origin_project_main_daily p - LEFT JOIN fact_origin_project_category_daily c ON ( c.PROJECT_Id = p.id AND p.del_flag='0' AND p.GRID_ID IS NULL) + LEFT JOIN fact_origin_project_category_daily c ON ( c.PROJECT_Id = p.id AND p.del_flag='0' AND p.GRID_ID = '') WHERE c.DEL_FLAG = '0' AND c.CUSTOMER_ID = #{customerId} AND ( From ddafed730216ad474b340867ae758512e42a33a7 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 15 Apr 2021 17:32:26 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E6=9E=90=20?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E7=9B=B4=E6=8E=A5=E7=AB=8B=E9=A1=B9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=20gridId=E4=BF=AE=E6=94=B9=20=3D=20''?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/ScreenProjectOrgDailyDTO.java | 11 ++ .../ScreenProjectOrgDailyServiceImpl.java | 104 +++++++++++++++--- .../extract/FactOriginProjectMainDailyDao.xml | 13 ++- 3 files changed, 109 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java index 7b449b50fe..da3ce096ec 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectOrgDailyDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto.screen; +import com.epmet.commons.tools.constant.NumConstant; import lombok.Data; import java.io.Serializable; @@ -144,4 +145,14 @@ public class ScreenProjectOrgDailyDTO implements Serializable { */ private String areaCode; + public ScreenProjectOrgDailyDTO() { + this.projectTotal = NumConstant.ZERO; + this.resolvedNum = NumConstant.ZERO; + this.resolvedRatio = NumConstant.ZERO_DECIMAL; + this.evaluateTotal = NumConstant.ZERO; + this.goodTotal = NumConstant.ZERO; + this.badTotal = NumConstant.ZERO; + this.goodRatio = NumConstant.ZERO_DECIMAL; + this.badRatio = NumConstant.ZERO_DECIMAL; + } } \ 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/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index e1241d23e7..628a632c8d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -179,7 +179,7 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl agencyInfos=agencyDao.selectAgencyByCustomer(customerId); + List agencyInfos = agencyDao.selectAgencyByCustomer(customerId); if (CollectionUtils.isEmpty(agencyInfos)){ log.warn(String.format(PingYinConstants.AGENCY_INFO_IS_ZERO,customerId)); return; @@ -189,14 +189,8 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl { - p.setBadTotal(null == p.getBadTotal() ? NumConstant.ZERO : p.getBadTotal()); - p.setEvaluateTotal(null == p.getEvaluateTotal() ? NumConstant.ZERO : p.getEvaluateTotal()); - p.setGoodTotal(null == p.getGoodTotal() ? NumConstant.ZERO : p.getGoodTotal()); - p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); - p.setResolvedNum(null == p.getResolvedNum() ? NumConstant.ZERO : p.getResolvedNum()); - }); log.info(projectOrgDaily.toString()); + List createProjects = disposeCreateProject(agencyInfos, dateId); agencyInfos.forEach(a -> { a.setDateId(dateId); projectOrgDaily.forEach(p -> { @@ -212,6 +206,20 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl { + createProjects.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setBadTotal(p.getBadTotal() + a.getBadTotal()); + a.setEvaluateTotal(p.getEvaluateTotal() + a.getEvaluateTotal()); + a.setGoodTotal(p.getGoodTotal() + a.getGoodTotal()); + a.setProjectTotal(p.getProjectTotal() + a.getProjectTotal()); + a.setResolvedNum(p.getResolvedNum() + a.getResolvedNum()); + a.setResolvedRatio(getRatio(a.getResolvedNum(),a.getProjectTotal())); + a.setBadRatio(getRatio(a.getBadTotal(),a.getEvaluateTotal())); + a.setGoodRatio(getRatio(a.getGoodTotal(),a.getEvaluateTotal())); + } + }); + }); log.info(agencyInfos.toString()); del(customerId, dateId); insert(agencyInfos,customerId,dateId); @@ -229,13 +237,6 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl { - p.setBadTotal(null == p.getBadTotal() ? NumConstant.ZERO : p.getBadTotal()); - p.setEvaluateTotal(null == p.getEvaluateTotal() ? NumConstant.ZERO : p.getEvaluateTotal()); - p.setGoodTotal(null == p.getGoodTotal() ? NumConstant.ZERO : p.getGoodTotal()); - p.setProjectTotal(null == p.getProjectTotal() ? NumConstant.ZERO : p.getProjectTotal()); - p.setResolvedNum(null == p.getResolvedNum() ? NumConstant.ZERO : p.getResolvedNum()); - }); log.info(projectOrgDaily.toString()); agencyInfos.forEach(a -> { a.setDateId(dateId); @@ -252,10 +253,83 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl parentAgencyInfos = agencyDao.selectAgencyByCustomer(customerId); + List createProjects = disposeCreateProject(parentAgencyInfos, dateId); + agencyInfos.forEach(a -> { + createProjects.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setBadTotal(p.getBadTotal() + a.getBadTotal()); + a.setEvaluateTotal(p.getEvaluateTotal() + a.getEvaluateTotal()); + a.setGoodTotal(p.getGoodTotal() + a.getGoodTotal()); + a.setProjectTotal(p.getProjectTotal() + a.getProjectTotal()); + a.setResolvedNum(p.getResolvedNum() + a.getResolvedNum()); + a.setResolvedRatio(getRatio(a.getResolvedNum(),a.getProjectTotal())); + a.setBadRatio(getRatio(a.getBadTotal(),a.getEvaluateTotal())); + a.setGoodRatio(getRatio(a.getGoodTotal(),a.getEvaluateTotal())); + } + }); + }); log.info(agencyInfos.toString()); del(customerId, dateId); insert(agencyInfos,customerId,dateId); } + + public List disposeCreateProject(List agencyInfos,String dateId){ + List orgIds = agencyInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); + List projectTotal = projectMainDailyService.selectProjectTotalByOrg(orgIds, dateId, null); + List resolvedNum = projectMainDailyService.selectResolvedNumByOrg(orgIds, dateId); + //查询 参与满意度评价的总次数 + String[] activeCodesAll = {PingYinConstants.EVALUATE_BAD,PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; + List evaluateTotal = projectMainDailyService.selectEvaluateCountByOrg(orgIds, dateId, getActiveCode(activeCodesAll)); + //查询 满意+非常满意的总次数 + String[] activeCodesGood = {PingYinConstants.EVALUATE_GOOD,PingYinConstants.EVALUATE_PERFECT}; + List evaluateGood = projectMainDailyService.selectEvaluateCountByOrg(orgIds, dateId, getActiveCode(activeCodesGood)); + agencyInfos.forEach(a -> { + // 项目总数 + if (!CollectionUtils.isEmpty(projectTotal)){ + projectTotal.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setProjectTotal(p.getProjectTotal()); + } + }); + } + // 未解决项目数 + if (!CollectionUtils.isEmpty(resolvedNum)){ + resolvedNum.forEach(r -> { + if (a.getOrgId().equals(r.getOrgId())){ + a.setResolvedNum(r.getResolvedNum()); + } + }); + } + // 参与满意度评价的总次数 + if (!CollectionUtils.isEmpty(evaluateTotal)){ + evaluateTotal.forEach(e -> { + if (a.getOrgId().equals(e.getOrgId())){ + a.setEvaluateTotal(e.getEvaluateCount()); + } + }); + } + + // 满意+非常满意的总次数 + if (!CollectionUtils.isEmpty(evaluateGood)){ + evaluateGood.forEach(e -> { + if (a.getOrgId().equals(e.getOrgId())){ + a.setGoodTotal(e.getEvaluateCount()); + } + }); + } + // 解决率 + a.setResolvedRatio(getRatio(a.getResolvedNum(),a.getProjectTotal())); + // 不满意总次数 + a.setBadTotal(a.getEvaluateTotal()==NumConstant.ZERO ? NumConstant.ZERO : a.getEvaluateTotal() - a.getGoodTotal()); + // 满意率 + a.setGoodRatio(getRatio(a.getGoodTotal(),a.getEvaluateTotal())); + // 不满意率 + a.setBadRatio(getRatio(a.getBadTotal(),a.getEvaluateTotal())); + }); + return agencyInfos; + } + /** * @Description activeCode处理 * @Param actCode diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 18635a23df..c5846fe3fc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -459,7 +459,7 @@ SELECT - GRID_ID, + GRID_ID AS orgId, COUNT(ID) AS resolvedNum FROM fact_origin_project_main_daily WHERE DEL_FLAG = 0 @@ -614,7 +614,7 @@ IFNULL(COUNT(m.ID),0) AS projectTotal FROM fact_origin_project_main_daily m WHERE m.DEL_FLAG = 0 - AND m.GRID_ID IS NULL + AND m.GRID_ID = '' AND ( m.AGENCY_ID = #{orgId} @@ -639,7 +639,12 @@ AND DATE_ID #{dateId} AND PROJECT_STATUS = 'closed' AND IS_RESOLVED = 'resolved' - AND GRID_ID IS NULL + AND ( + + AGENCY_ID = #{orgId} + + ) + AND GRID_ID = '' GROUP BY AGENCY_ID From 5e410685a9e3e78a502e7fdcd86d7f249dbd3aec Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 16 Apr 2021 10:03:54 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E8=AF=B7=E9=80=89=E6=8B=A9=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E5=8C=BA=E5=88=92=E9=87=8D=E5=A4=8D=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java index e5b775c067..21867756d5 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/AddAgencyV2FormDTO.java @@ -85,6 +85,6 @@ public class AddAgencyV2FormDTO implements Serializable { // private String community; //区域编码名称 - @NotBlank(message = "请选择组织区划", groups = AreaCodeGroup.class) + @NotBlank(message = "", groups = AreaCodeGroup.class) private String areaName; } From efcf6d4d2aced66715b2d11d4dd427eab3120786 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 16 Apr 2021 10:05:26 +0800 Subject: [PATCH 10/17] =?UTF-8?q?agencydetail=E6=8E=A5=E5=8F=A3=E8=86=9D?= =?UTF-8?q?=E7=9B=96=EF=BC=8CareaName=E8=BF=94=E5=9B=9E=E7=A9=BA=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2not=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/AgencyServiceImpl.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 6202cc038c..e34fe06786 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -255,19 +255,19 @@ public class AgencyServiceImpl implements AgencyService { if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { switch (entity.getLevel()) { case CustomerAgencyConstant.PROVINCE_LEVEL: - agencysResultDTO.setAreaName(entity.getProvince()); + agencysResultDTO.setAreaName(null == entity.getProvince() ? StrConstant.EPMETY_STR : entity.getProvince()); break; case CustomerAgencyConstant.CITY_LEVEL: - agencysResultDTO.setAreaName(entity.getCity()); + agencysResultDTO.setAreaName(null == entity.getCity() ? StrConstant.EPMETY_STR : entity.getCity()); break; case CustomerAgencyConstant.DISTRICT: - agencysResultDTO.setAreaName(entity.getDistrict()); + agencysResultDTO.setAreaName(null == entity.getDistrict() ? StrConstant.EPMETY_STR : entity.getDistrict()); break; case CustomerAgencyConstant.STREET_LEVEL: - agencysResultDTO.setAreaName(entity.getStreet()); + agencysResultDTO.setAreaName(null == entity.getStreet() ? StrConstant.EPMETY_STR : entity.getStreet()); break; case CustomerAgencyConstant.COMMUNITY_LEVEL: - agencysResultDTO.setAreaName(entity.getCommunity()); + agencysResultDTO.setAreaName(null == entity.getCommunity() ? StrConstant.EPMETY_STR : entity.getCommunity()); break; default: agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); From d6b180806f606744042566ad7c95345b5fd17593 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Fri, 16 Apr 2021 10:16:38 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90=20or?= =?UTF-8?q?g-=E6=9C=88=20=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pingyin/result/ClosedIncrResultDTO.java | 2 + .../pingyin/result/ProjectIncrResultDTO.java | 2 + .../result/UnClosedTotalResultDTO.java | 2 + .../FactOriginProjectMainDailyDao.java | 28 ++++++ .../FactOriginProjectMainDailyService.java | 28 ++++++ ...FactOriginProjectMainDailyServiceImpl.java | 49 ++++++++++ .../ScreenProjectOrgDailyServiceImpl.java | 15 +++ ...nProjectQuantityOrgMonthlyServiceImpl.java | 98 ++++++++++++++++++- .../extract/FactOriginProjectMainDailyDao.xml | 59 +++++++++++ 9 files changed, 282 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java index d1f9083b30..c253849ab5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ClosedIncrResultDTO.java @@ -16,4 +16,6 @@ public class ClosedIncrResultDTO implements Serializable { private String gridId; private Integer closedIncr; + + private String orgId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java index 6200eb8add..8f880dcf5b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/ProjectIncrResultDTO.java @@ -16,4 +16,6 @@ public class ProjectIncrResultDTO implements Serializable { private String gridId; private Integer projectIncr; + + private String orgId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java index d31e85ec28..b4d001fa56 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/pingyin/result/UnClosedTotalResultDTO.java @@ -16,4 +16,6 @@ public class UnClosedTotalResultDTO implements Serializable { private String gridId; private Integer projectCount; + + private String orgId; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index badbd6197c..82ea30952a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -286,6 +286,15 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectProjectIncr(@Param("customerId")String customerId, @Param("monthId")String monthId); + /** + * @Description 组织查询本月新增项目数 + * @Param orgIds + * @Param monthId + * @author zxc + * @date 2021/4/16 上午9:21 + */ + List selectProjectIncrByOrg(@Param("orgIds") List orgIds, @Param("monthId")String monthId); + /** * @Description 根据状态查询项目数 * @Param customerId @@ -296,6 +305,16 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectProjectCount(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("status") String status); + /** + * @Description 组织根据状态查询项目数 + * @Param orgIds + * @Param monthId + * @Param status + * @author zxc + * @date 2021/4/16 上午9:26 + */ + List selectProjectCountByOrg(@Param("orgIds") List orgIds, @Param("monthId")String monthId, @Param("status") String status); + /** * @Description 本月新增结案项目数 * @Param customerId @@ -305,6 +324,15 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectClosedIncr(@Param("customerId")String customerId, @Param("monthId")String monthId); + /** + * @Description 组织本月新增结案项目数 + * @Param orgIds + * @Param monthId + * @author zxc + * @date 2021/4/16 上午9:35 + */ + List selectClosedIncrByOrg(@Param("orgIds") List orgIds, @Param("monthId")String monthId); + /** * @Description 初始化screen_project_data数据 * 如果是dateId不为空,则查询前一天的数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 7b3a3b8d61..f77a01bf4a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -271,6 +271,15 @@ public interface FactOriginProjectMainDailyService extends BaseService selectProjectIncr(String customerId, String monthId); + /** + * @Description 组织查询本月新增项目数 + * @Param orgIds + * @Param monthId + * @author zxc + * @date 2021/4/16 上午9:19 + */ + List selectProjectIncrByOrg(List orgIds, String monthId); + /** * @Description 根据状态查询项目数 * @Param customerId @@ -281,6 +290,16 @@ public interface FactOriginProjectMainDailyService extends BaseService selectProjectCount(String customerId, String monthId, String status); + /** + * @Description 组织根据状态查询项目数 + * @Param orgIds + * @Param monthId + * @Param status + * @author zxc + * @date 2021/4/16 上午9:24 + */ + List selectProjectCountByOrg(List orgIds, String monthId, String status); + /** * @Description 本月新增结案项目数 * @Param customerId @@ -290,6 +309,15 @@ public interface FactOriginProjectMainDailyService extends BaseService selectClosedIncr(String customerId, String monthId); + /** + * @Description 组织本月新增结案项目数 + * @Param orgIds + * @Param monthId + * @author zxc + * @date 2021/4/16 上午9:33 + */ + List selectClosedIncrByOrg(List orgIds, String monthId); + /** * @Description 初始化screen_project_data数据 * 如果是dateId不为空,则查询前一天的数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index 643ddba8d4..cfb902162f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -329,6 +329,22 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl(); } + /** + * @Description 组织查询本月新增项目数 + * @Param orgIds + * @Param monthId + * @author zxc + * @date 2021/4/16 上午9:19 + */ + @Override + public List selectProjectIncrByOrg(List orgIds, String monthId) { + if (!CollectionUtils.isEmpty(orgIds) && StringUtils.isNotBlank(monthId)){ + List projectIncrResultDTOS = baseDao.selectProjectIncrByOrg(orgIds, monthId); + return projectIncrResultDTOS; + } + return new ArrayList<>(); + } + /** * @Description 根据状态查询项目数 * @Param customerId @@ -346,6 +362,23 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl(); } + /** + * @Description 组织根据状态查询项目数 + * @Param orgIds + * @Param monthId + * @Param status + * @author zxc + * @date 2021/4/16 上午9:24 + */ + @Override + public List selectProjectCountByOrg(List orgIds, String monthId, String status) { + if (!CollectionUtils.isEmpty(orgIds) && StringUtils.isNotBlank(monthId)){ + List resultDTOS = baseDao.selectProjectCountByOrg(orgIds, monthId, status); + return resultDTOS; + } + return new ArrayList<>(); + } + /** * @Description 本月新增结案项目数 * @Param customerId @@ -362,6 +395,22 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl(); } + /** + * @Description 组织本月新增结案项目数 + * @Param orgIds + * @Param monthId + * @author zxc + * @date 2021/4/16 上午9:33 + */ + @Override + public List selectClosedIncrByOrg(List orgIds, String monthId) { + if (!CollectionUtils.isEmpty(orgIds) && StringUtils.isNotBlank(monthId)){ + List result = baseDao.selectClosedIncrByOrg(orgIds, monthId); + return result; + } + return new ArrayList<>(); + } + /** * @Description 初始化screen_project_data数据 * 如果是dateId不为空,则查询前一天的数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index 628a632c8d..3a37d17a40 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -225,6 +225,13 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl agencyInfos = agencyDao.selectAgencyByAreaCode(rootAgency.getAreaCode()); @@ -253,6 +260,7 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl parentAgencyInfos = agencyDao.selectAgencyByCustomer(customerId); List createProjects = disposeCreateProject(parentAgencyInfos, dateId); agencyInfos.forEach(a -> { @@ -274,6 +282,13 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl disposeCreateProject(List agencyInfos,String dateId){ List orgIds = agencyInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); List projectTotal = projectMainDailyService.selectProjectTotalByOrg(orgIds, dateId, null); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java index 2c4182eee3..b03f7f65b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -29,13 +29,14 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.constant.PingYinConstants; import com.epmet.dao.evaluationindex.screen.ScreenCustomerAgencyDao; import com.epmet.dao.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyDao; -import com.epmet.dto.pingyin.result.ProjectOrgMonthlyResultDTO; +import com.epmet.dto.pingyin.result.*; import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; import com.epmet.dto.screen.ScreenProjectQuantityOrgMonthlyDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.crm.CustomerRelationService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; import com.epmet.service.evaluationindex.screen.ScreenProjectQuantityOrgMonthlyService; import com.epmet.service.org.CustomerAgencyService; import com.google.common.collect.Lists; @@ -51,6 +52,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 项目(事件)数量分析按组织_按月统计 @@ -69,6 +71,9 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< private CustomerRelationService customerRelationService; @Autowired private CustomerAgencyService customerAgencyService; + @Autowired + private FactOriginProjectMainDailyService projectMainDailyService; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -213,6 +218,19 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< }); } }); + // 直接立项处理 + List agencyCreateProject = agencyCreateProject(agencyInfos, monthId); + agencyInfos.forEach(a -> { + agencyCreateProject.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setProjectIncr(a.getProjectIncr() + p.getProjectIncr()); + a.setProjectTotal(a.getProjectTotal() + p.getProjectTotal()); + a.setUnClosedTotal(a.getUnClosedTotal() + p.getUnClosedTotal()); + a.setClosedTotal(a.getClosedTotal() + p.getClosedTotal()); + a.setClosedIncr(a.getClosedIncr() + p.getClosedIncr()); + } + }); + }); log.info(agencyInfos.toString()); del(customerId, monthId); insert(agencyInfos,customerId,monthId); @@ -271,11 +289,89 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< }); } }); + List parentAgency = agencyDao.selectAgencyByCustomer(customerId); + List parentAgencyInfos = ConvertUtils.sourceToTarget(parentAgency, ScreenProjectQuantityOrgMonthlyDTO.class); + List agencyCreateProject = agencyCreateProject(parentAgencyInfos, monthId); + agencyInfos.forEach(a -> { + agencyCreateProject.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setProjectIncr(a.getProjectIncr() + p.getProjectIncr()); + a.setProjectTotal(a.getProjectTotal() + p.getProjectTotal()); + a.setUnClosedTotal(a.getUnClosedTotal() + p.getUnClosedTotal()); + a.setClosedTotal(a.getClosedTotal() + p.getClosedTotal()); + a.setClosedIncr(a.getClosedIncr() + p.getClosedIncr()); + } + }); + }); log.info(agencyInfos.toString()); del(customerId, monthId); insert(agencyInfos,customerId,monthId); } + /** + * @Description 组织直接立项处理 + * @Param agencyInfos + * @Param monthId + * @author zxc + * @date 2021/4/16 上午10:03 + */ + public List agencyCreateProject(List agencyInfos, String monthId){ + List orgIds = agencyInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList()); + // 本月新增的项目数量 转项目日期在当前月份内 + List projectIncr = projectMainDailyService.selectProjectIncrByOrg(orgIds, monthId); + // 截止到当前月份:累计项目总数 + List projectTotal = projectMainDailyService.selectProjectTotalByOrg(orgIds, null, monthId); + // 截止到当前月份:累计未结项目总数 + List projectUnClosed = projectMainDailyService.selectProjectCountByOrg(orgIds, monthId, PingYinConstants.UN_CLOSED); + // 截止到当前月份:累计已结项目 + List projectClosed = projectMainDailyService.selectProjectCountByOrg(orgIds, monthId, PingYinConstants.CLOSED); + // 本月新增结案项目数 + List closedIncr = projectMainDailyService.selectClosedIncrByOrg(orgIds, monthId); + agencyInfos.forEach(a -> { + a.setMonthId(monthId); + if (!CollectionUtils.isEmpty(projectIncr)){ + projectIncr.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setProjectIncr(p.getProjectIncr()); + } + }); + } + // 截止到当前月份:累计项目总数 + if (!CollectionUtils.isEmpty(projectTotal)){ + projectTotal.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setProjectTotal(p.getProjectTotal()); + } + }); + } + // 截止到当前月份:累计未结项目总数 + if (!CollectionUtils.isEmpty(projectUnClosed)){ + projectUnClosed.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setUnClosedTotal(p.getProjectCount()); + } + }); + } + // 截止到当前月份:累计已结项目 + if (!CollectionUtils.isEmpty(projectClosed)){ + projectClosed.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setClosedTotal(p.getProjectCount()); + } + }); + } + // 本月新增结案项目数 + if (!CollectionUtils.isEmpty(closedIncr)){ + closedIncr.forEach(p -> { + if (a.getOrgId().equals(p.getOrgId())){ + a.setClosedIncr(p.getClosedIncr()); + } + }); + } + }); + return agencyInfos; + } + @Transactional(rollbackFor = Exception.class) public void del(String customerId,String monthId){ Integer flag; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index c5846fe3fc..4e2d66473a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -671,4 +671,63 @@ GROUP BY ORG_ID + + + + + + + + + From 8d647eab78eb1cbc320c189c0406d4ff475177ec Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 16 Apr 2021 10:46:49 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/exception/EpmetErrorCode.java | 3 +- .../dto/govorg/form/NextAreaCodeFormDTO.java | 7 ++- .../govorg/impl/GovOrgServiceImpl.java | 9 ++-- .../com/epmet/dto/form/EditAgencyFormDTO.java | 30 ++++++++++- .../epmet/controller/AgencyController.java | 11 ++-- .../java/com/epmet/dao/CustomerAgencyDao.java | 8 ++- .../epmet/service/CustomerAgencyService.java | 2 +- .../epmet/service/impl/AgencyServiceImpl.java | 52 ++++++++++++++----- .../impl/CustomerAgencyServiceImpl.java | 6 +-- .../resources/mapper/CustomerAgencyDao.xml | 18 +++++++ 10 files changed, 116 insertions(+), 30 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java index 79f5421789..2f340981fa 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/EpmetErrorCode.java @@ -71,7 +71,8 @@ public enum EpmetErrorCode { NOT_DEL_DEPARTMENT(8206, "该部门存在工作人员,不允许删除"), NOT_DEL_AGENCY_GRID(8207, "该机关存在网格,不允许删除"), AREA_CODE_ALREADY_EXISTS(8208,"组织区划已被占用,请重新选择"), - AGENCY_NAME_ALREADY_EXISTS(8209,"您当前的组织名称已存在,请重新修改"), + AGENCY_NAME_ALREADY_EXISTS(8209,"当前组织名称已存在,请重新修改"), + SET_PARENT_AREA_CODE(8210,"请先设置上级组织区划"), REQUIRE_PERMISSION(8301, "您没有足够的操作权限"), THIRD_PLAT_REQUEST_ERROR(8302, "请求第三方平台错误"), diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/NextAreaCodeFormDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/NextAreaCodeFormDTO.java index ad3783df46..5bdd66cf68 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/NextAreaCodeFormDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/govorg/form/NextAreaCodeFormDTO.java @@ -14,8 +14,11 @@ import java.io.Serializable; @Data public class NextAreaCodeFormDTO implements Serializable { private static final long serialVersionUID = -1974456701949979946L; + public interface AddUserInternalGroup { + } + @NotBlank(message = "parentAgencyId不能为空",groups = AddUserInternalGroup.class) + private String parentAgencyId; - @NotBlank(message = "areaCode不能为空") private String areaCode; /** @@ -25,7 +28,7 @@ public class NextAreaCodeFormDTO implements Serializable { * 市级: city * 省级:province */ - @NotBlank(message = "level不能为空") + @NotBlank(message = "level不能为空",groups = AddUserInternalGroup.class) private String level; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index ebc8cac4b3..b09414f1bd 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.dataaggre.service.govorg.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.dataaggre.constant.DataSourceConstant; import com.epmet.dataaggre.dao.govorg.CustomerAgencyDao; @@ -20,8 +21,7 @@ import com.epmet.dataaggre.service.govorg.GovOrgService; import com.epmet.dataaggre.service.opercrm.CustomerRelation; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -37,7 +37,6 @@ import java.util.List; @DataSource(DataSourceConstant.GOV_ORG) @Slf4j public class GovOrgServiceImpl implements GovOrgService { - private static final Logger logger = LoggerFactory.getLogger(GovOrgServiceImpl.class); @Autowired private CustomerAgencyDao customerAgencyDao; @@ -133,6 +132,10 @@ public class GovOrgServiceImpl implements GovOrgService { @Override public List queryNextLevelAreaCodeList(NextAreaCodeFormDTO formDTO) { + CustomerAgencyEntity parent=customerAgencyDao.selectById(formDTO.getParentAgencyId()); + if (null == parent || StringUtils.isBlank(parent.getAreaCode())) { + throw new RenException(EpmetErrorCode.SET_PARENT_AREA_CODE.getCode(),EpmetErrorCode.SET_PARENT_AREA_CODE.getMsg()); + } //全部下级 List allList = areaCodeService.queryNextLevelAreaCodeList(formDTO); if (CollectionUtils.isNotEmpty(allList)) { diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index 276099576a..0202ecd894 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -17,6 +17,7 @@ package com.epmet.dto.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; import org.hibernate.validator.constraints.Length; @@ -33,23 +34,48 @@ import java.io.Serializable; public class EditAgencyFormDTO implements Serializable { private static final long serialVersionUID = 1L; + public interface AddUserInternalGroup { + } + + public interface DefaultUserShowGroup extends CustomerClientShowGroup { + } + + public interface AreaCodeGroup extends CustomerClientShowGroup { + } /** * 机关组织Id */ - @NotBlank(message = "机关组织ID不能为空") + @NotBlank(message = "机关组织ID不能为空", groups = AddUserInternalGroup.class) private String agencyId; /** * 机关组织名称 */ @NotBlank(message = "机关组织名称不能为空") - @Length(max=50,message = "机构名称不能超过50个字") + @Length(max=50,message = "机构名称不能超过50个字",groups = DefaultUserShowGroup.class) private String agencyName; /** * token中用户Id */ + @NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class) private String userId; + //2021.04.16 area_code需求 新增入参 + /** + * open: 选择地区编码必填;closed: 无需选择地区编码;0409新增返参 + */ + @NotBlank(message = "areaCodeSwitch不能为空", groups = AddUserInternalGroup.class) + private String areaCodeSwitch; + + /** + * 地区编码 + */ + @NotBlank(message = "请选择组织区划", groups = AreaCodeGroup.class) + private String areaCode; + + //区域编码名称 + @NotBlank(message = "", groups = AreaCodeGroup.class) + private String areaName; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index 74e095de3e..ddd60b569a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -93,13 +93,13 @@ public class AgencyController { **/ @PostMapping("addagency-v2") @RequirePermission(requirePermission = RequirePermissionEnum.ORG_SUBAGENCY_CREATE) - public Result addAgencyV2(@RequestBody AddAgencyV2FormDTO formDTO) { + public Result addAgencyV2(@LoginUser TokenDto tokenDTO,@RequestBody AddAgencyV2FormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, AddAgencyV2FormDTO.DefaultUserShowGroup.class, AddAgencyV2FormDTO.AddUserInternalGroup.class); if (formDTO.getAreaCodeSwitch().equals(CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN)) { ValidatorUtils.validateEntity(formDTO, AddAgencyV2FormDTO.AreaCodeGroup.class); } - //组织名称是否存在 - customerAgencyService.checkAgencyName(formDTO.getAgencyName()); + //当前客户下,同级组织中,组织名称不允许重复 + customerAgencyService.checkAgencyName(formDTO.getAgencyName(),tokenDTO.getCustomerId(),formDTO.getLevel(),null); return new Result().ok(agencyService.addAgencyV2(formDTO)); } @@ -127,7 +127,10 @@ public class AgencyController { @RequirePermission(requirePermission = RequirePermissionEnum.ORG_AGENCY_UPDATE) public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) { formDTO.setUserId(tokenDTO.getUserId()); - ValidatorUtils.validateEntity(formDTO); + ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class); + if (formDTO.getAreaCodeSwitch().equals(CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN)) { + ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.AreaCodeGroup.class); + } return agencyService.editAgency(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java index f9742f72e3..bdc8814ff4 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/CustomerAgencyDao.java @@ -225,5 +225,11 @@ public interface CustomerAgencyDao extends BaseDao { **/ int delByAgencyId(@Param("agencyId") String agencyId, @Param("operateUserId") String operateUserId); - List selectAgencyIdsByAreaCode(String areaCode); + List selectAgencyIdsByAreaCode(@Param("areaCode") String areaCode, + @Param("agencyId") String agencyId); + + List checkAgencyName(@Param("agencyName") String agencyName, + @Param("customerId") String customerId, + @Param("level") String level, + @Param("agencyId") String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java index 464c46c8dc..59941f1f60 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/CustomerAgencyService.java @@ -235,5 +235,5 @@ public interface CustomerAgencyService extends BaseService **/ OrganizeTreeResultDTO organizeTree(String agencyId); - void checkAgencyName(String agencyName); + void checkAgencyName(String agencyName,String customerId,String level,String agencyId); } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index e34fe06786..d3af8846f0 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -51,7 +51,6 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.Arrays; -import java.util.Date; import java.util.List; /** @@ -133,9 +132,45 @@ public class AgencyServiceImpl implements AgencyService { @Transactional(rollbackFor = Exception.class) public Result editAgency(EditAgencyFormDTO formDTO) { Result result = new Result(); - CustomerAgencyEntity entity = getUpdateEntity(formDTO); + CustomerAgencyEntity originalEntity = customerAgencyDao.selectById(formDTO.getAgencyId()); + //当前客户下,同级组织中,组织名称不允许重复 + customerAgencyService.checkAgencyName(formDTO.getAgencyName(),originalEntity.getCustomerId(),originalEntity.getLevel(),originalEntity.getId()); + + if (formDTO.getAreaCodeSwitch().equals(CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN)) { + //开关开启,areaCode,areaName必填 + if(!formDTO.getAreaCode().equals(originalEntity.getAreaCode())){ + //重新选择了新的area_code + CustomerAgencyDTO parent = customerAgencyService.get(originalEntity.getPid()); + if (null == parent ||StringUtils.isBlank(parent.getAreaCode())) { + throw new RenException(EpmetErrorCode.SET_PARENT_AREA_CODE.getCode(),EpmetErrorCode.SET_PARENT_AREA_CODE.getMsg()); + } + originalEntity.setParentAreaCode(parent.getAreaCode()); + if (!"other".equals(formDTO.getAreaCode())) { + //校验areaCode是否被使用过 + List agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(),formDTO.getAgencyId()); + if (CollectionUtils.isNotEmpty(agencyIds)) { + //已经被占用,提示 + throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); + } + originalEntity.setAreaCode(formDTO.getAreaCode()); + }else{ + //如果选择的是other,需要自定义一个编码 + AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); + addAreaCodeFormDTO.setCurrentAreaLevel(originalEntity.getLevel()); + addAreaCodeFormDTO.setParentAreaCode(parent.getAreaCode()); + addAreaCodeFormDTO.setName(formDTO.getAgencyName()); + Result addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO); + if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) { + throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg()); + } + originalEntity.setAreaCode(addAreaCodeResult.getData()); + } + } + } + originalEntity.setOrganizationName(formDTO.getAgencyName()); + //1:更新当前组织信息 - if (customerAgencyDao.updateById(entity) < NumConstant.ONE) { + if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) { log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); throw new RenException(CustomerAgencyConstant.UPDATE_EXCEPTION); } @@ -148,7 +183,6 @@ public class AgencyServiceImpl implements AgencyService { } //3:循环组织列表,查询每一个组织的所有上级组织重新拼接所有上级名称(allParentName)字段值 List editList = new ArrayList<>(); - Date date = new Date(); agencyList.forEach(agency->{ //3-1:查询当前组织的所有上级组织 List listStr = Arrays.asList(agency.getPids().split(":")); @@ -178,12 +212,6 @@ public class AgencyServiceImpl implements AgencyService { return result; } - private CustomerAgencyEntity getUpdateEntity(EditAgencyFormDTO formDTO) { - CustomerAgencyEntity entity = customerAgencyDao.selectById(formDTO.getAgencyId()); - entity.setOrganizationName(formDTO.getAgencyName()); - return entity; - } - /** * @param formDTO * @return @@ -429,7 +457,7 @@ public class AgencyServiceImpl implements AgencyService { public AddAgencyResultDTO addAgencyV2(AddAgencyV2FormDTO formDTO) { CustomerAgencyDTO parent = customerAgencyService.get(formDTO.getParentAgencyId()); if (null == parent) { - throw new RenException(String.format("添加组织失败:没有找到跟组织信息,parentAgencyId=%s", formDTO.getParentAgencyId())); + throw new RenException(String.format("添加组织失败:没有找到上级组织信息,agencyId=%s", formDTO.getParentAgencyId())); } AddAgencyResultDTO resultDTO = new AddAgencyResultDTO(); resultDTO.setAreaCodeSwitch(formDTO.getAreaCodeSwitch()); @@ -438,7 +466,7 @@ public class AgencyServiceImpl implements AgencyService { if (CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN.equals(formDTO.getAreaCodeSwitch())) { //校验areaCode是否被使用过 if (!"other".equals(formDTO.getAreaCode())) { - List agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(insertEntity.getAreaCode()); + List agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(insertEntity.getAreaCode(),null); if (CollectionUtils.isNotEmpty(agencyIds)) { //已经被占用,提示 throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java index dc81a51b47..3753412331 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java @@ -1060,10 +1060,8 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl wrapper = new QueryWrapper<>(); - wrapper.eq(StringUtils.isNotBlank(agencyName), "ORGANIZATION_NAME", agencyName); - List entityList = baseDao.selectList(wrapper); + public void checkAgencyName(String agencyName,String customerId,String level,String agencyId) { + List entityList = baseDao.checkAgencyName(agencyName,customerId,level,agencyId); if (CollectionUtils.isNotEmpty(entityList)) { throw new RenException(EpmetErrorCode.AGENCY_NAME_ALREADY_EXISTS.getCode(), EpmetErrorCode.AGENCY_NAME_ALREADY_EXISTS.getMsg()); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml index 27d446f644..ea6f94a1e8 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerAgencyDao.xml @@ -408,5 +408,23 @@ WHERE ca.DEL_FLAG = '0' AND ca.AREA_CODE = #{areaCode} + + AND ca.id !=#{agencyId} + + + + \ No newline at end of file From 3d7e1af75cf2ce17d953efb18fac84920aec7da8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 16 Apr 2021 10:56:28 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/form/EditAgencyFormDTO.java | 19 ----------- .../epmet/controller/AgencyController.java | 3 -- .../epmet/service/impl/AgencyServiceImpl.java | 33 ------------------- 3 files changed, 55 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java index 0202ecd894..66984fc62e 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/form/EditAgencyFormDTO.java @@ -40,9 +40,6 @@ public class EditAgencyFormDTO implements Serializable { public interface DefaultUserShowGroup extends CustomerClientShowGroup { } - public interface AreaCodeGroup extends CustomerClientShowGroup { - } - /** * 机关组织Id */ @@ -62,20 +59,4 @@ public class EditAgencyFormDTO implements Serializable { @NotBlank(message = "tokenDto获取userId为空", groups = AddUserInternalGroup.class) private String userId; - //2021.04.16 area_code需求 新增入参 - /** - * open: 选择地区编码必填;closed: 无需选择地区编码;0409新增返参 - */ - @NotBlank(message = "areaCodeSwitch不能为空", groups = AddUserInternalGroup.class) - private String areaCodeSwitch; - - /** - * 地区编码 - */ - @NotBlank(message = "请选择组织区划", groups = AreaCodeGroup.class) - private String areaCode; - - //区域编码名称 - @NotBlank(message = "", groups = AreaCodeGroup.class) - private String areaName; } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java index ddd60b569a..b0ec95dfd2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/controller/AgencyController.java @@ -128,9 +128,6 @@ public class AgencyController { public Result editAgency(@LoginUser TokenDto tokenDTO, @RequestBody EditAgencyFormDTO formDTO) { formDTO.setUserId(tokenDTO.getUserId()); ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.DefaultUserShowGroup.class, EditAgencyFormDTO.AddUserInternalGroup.class); - if (formDTO.getAreaCodeSwitch().equals(CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN)) { - ValidatorUtils.validateEntity(formDTO, EditAgencyFormDTO.AreaCodeGroup.class); - } return agencyService.editAgency(formDTO); } diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index d3af8846f0..8134ff776a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -135,40 +135,7 @@ public class AgencyServiceImpl implements AgencyService { CustomerAgencyEntity originalEntity = customerAgencyDao.selectById(formDTO.getAgencyId()); //当前客户下,同级组织中,组织名称不允许重复 customerAgencyService.checkAgencyName(formDTO.getAgencyName(),originalEntity.getCustomerId(),originalEntity.getLevel(),originalEntity.getId()); - - if (formDTO.getAreaCodeSwitch().equals(CustomerAgencyConstant.AREA_CODE_SWITCH_OPEN)) { - //开关开启,areaCode,areaName必填 - if(!formDTO.getAreaCode().equals(originalEntity.getAreaCode())){ - //重新选择了新的area_code - CustomerAgencyDTO parent = customerAgencyService.get(originalEntity.getPid()); - if (null == parent ||StringUtils.isBlank(parent.getAreaCode())) { - throw new RenException(EpmetErrorCode.SET_PARENT_AREA_CODE.getCode(),EpmetErrorCode.SET_PARENT_AREA_CODE.getMsg()); - } - originalEntity.setParentAreaCode(parent.getAreaCode()); - if (!"other".equals(formDTO.getAreaCode())) { - //校验areaCode是否被使用过 - List agencyIds = customerAgencyDao.selectAgencyIdsByAreaCode(formDTO.getAreaCode(),formDTO.getAgencyId()); - if (CollectionUtils.isNotEmpty(agencyIds)) { - //已经被占用,提示 - throw new RenException(EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getCode(), EpmetErrorCode.AREA_CODE_ALREADY_EXISTS.getMsg()); - } - originalEntity.setAreaCode(formDTO.getAreaCode()); - }else{ - //如果选择的是other,需要自定义一个编码 - AddAreaCodeFormDTO addAreaCodeFormDTO = new AddAreaCodeFormDTO(); - addAreaCodeFormDTO.setCurrentAreaLevel(originalEntity.getLevel()); - addAreaCodeFormDTO.setParentAreaCode(parent.getAreaCode()); - addAreaCodeFormDTO.setName(formDTO.getAgencyName()); - Result addAreaCodeResult = epmetCommonServiceOpenFeignClient.addAreaCode(addAreaCodeFormDTO); - if (!addAreaCodeResult.success() || StringUtils.isBlank(addAreaCodeResult.getData())) { - throw new RenException("自定义area_code异常" + addAreaCodeResult.getInternalMsg()); - } - originalEntity.setAreaCode(addAreaCodeResult.getData()); - } - } - } originalEntity.setOrganizationName(formDTO.getAgencyName()); - //1:更新当前组织信息 if (customerAgencyDao.updateById(originalEntity) < NumConstant.ONE) { log.error(CustomerAgencyConstant.UPDATE_EXCEPTION); From bf753487ff7a813f475a82c631f5ddce11e53b0f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 16 Apr 2021 11:09:45 +0800 Subject: [PATCH 14/17] agencyDetail --- .../main/java/com/epmet/service/impl/AgencyServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 8134ff776a..9cb313c547 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -246,6 +246,7 @@ public class AgencyServiceImpl implements AgencyService { parentList = customerAgencyDao.selectPAgencyById(listStr); agencysResultDTO.setParentList(parentList); agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); + agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); //查询组织区划的名称 if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { switch (entity.getLevel()) { @@ -271,6 +272,10 @@ public class AgencyServiceImpl implements AgencyService { return new Result().ok(agencysResultDTO); } + public static void main(String[] args) { + String m="1234"; + System.out.println(m.equals("1234") ? "yes" : "no"); + } /** * @param formDTO * @return From 54106eccd32dd8482cd39ed6e6c68dd41e1dcfd5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Fri, 16 Apr 2021 11:12:08 +0800 Subject: [PATCH 15/17] agencyDetail --- .../src/main/java/com/epmet/service/impl/AgencyServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java index 9cb313c547..e83b78ba77 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/AgencyServiceImpl.java @@ -247,6 +247,7 @@ public class AgencyServiceImpl implements AgencyService { agencysResultDTO.setParentList(parentList); agencysResultDTO.setAreaCodeSwitch(customerOrgParameterService.getAreaCodeSwitch(entity.getCustomerId())); agencysResultDTO.setAreaName(StrConstant.EPMETY_STR); + agencysResultDTO.setAreaCode(StringUtils.isNotBlank(entity.getAreaCode())?entity.getAreaCode():StrConstant.EPMETY_STR); //查询组织区划的名称 if (null != entity && StringUtils.isNotBlank(entity.getAreaCode())) { switch (entity.getLevel()) { From ebfa49c6cc46e550f99993d9d54568f0d4c9f9e5 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 16 Apr 2021 16:24:56 +0800 Subject: [PATCH 16/17] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AB=8B=E9=A1=B9?= =?UTF-8?q?=E6=A0=87=E9=A2=9820=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java | 1 + 1 file changed, 1 insertion(+) diff --git a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java index d86d4873c1..dd2001e970 100644 --- a/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java +++ b/epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectApprovalFormDTO.java @@ -18,6 +18,7 @@ public class ProjectApprovalFormDTO implements Serializable { public interface ApprovalCategory{} @NotBlank(message = "项目标题不能为空",groups = {ApprovalCategory.class}) + @Length(max=20,message = "项目标题不能超过20位") private String title; @NotBlank(message = "项目背景不能为空",groups = {ApprovalCategory.class}) From 1c49996f52d18a0aea949e927fa43eac3500dd7a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 16 Apr 2021 16:32:18 +0800 Subject: [PATCH 17/17] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=AB=8B=E9=A1=B9?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=93=8D=E4=BD=9C=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/enums/RequirePermissionEnum.java | 7 ++++++- .../java/com/epmet/controller/ProjectTraceController.java | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java index 60c16f0c01..72d2e072b4 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/enums/RequirePermissionEnum.java @@ -164,7 +164,12 @@ public enum RequirePermissionEnum { MORE_BADGE_MANAGE_LIST("more_badge_manage_list","更多:徽章:徽章管理:列表","徽章列表"), MORE_BADGE_MANAGE_CREATE("more_badge_manage_create","更多:徽章:徽章管理:添加","添加徽章"), MORE_BADGE_MANAGE_EDIT("more_badge_manage_edit","更多:徽章:徽章管理:编辑","编辑徽章"), - MORE_BADGE_MANAGE_DELETE("more_badge_manage_delete","更多:徽章:徽章管理:删除","删除徽章"); + MORE_BADGE_MANAGE_DELETE("more_badge_manage_delete","更多:徽章:徽章管理:删除","删除徽章"), + + /** + * 项目立项 + */ + WORK_PROJECT_APPROVAL("work_project_approval","政务管理:项目立项","项目立项"); private String key; private String name; diff --git a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java index 199d762a85..a91cc3513b 100644 --- a/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java +++ b/epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java @@ -351,6 +351,7 @@ public class ProjectTraceController { * @Description 项目立项 **/ @PostMapping("projectapproval") + @RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_APPROVAL) public Result projectApproval(@LoginUser TokenDto tokenDTO, @RequestBody ProjectApprovalFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO,ProjectApprovalFormDTO.ApprovalCategory.class); formDTO.setCustomerId(tokenDTO.getCustomerId());