From 9a56db476d45bb14f5eaab0e174033d03b7a543c Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Mar 2021 13:20:09 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=86=85=E6=8C=89?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=BB=9F=E8=AE=A1=E9=A1=B9=E7=9B=AE=E6=95=B0?= =?UTF-8?q?=E9=87=8F=20start3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java | 3 +++ .../extract/FactOriginProjectCategoryDailyDao.xml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java index 5901e47b35..3a8752e20e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java @@ -144,6 +144,9 @@ public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl listDTO= factOriginProjectCategoryDailyService.selectListProjectCategoryGridDailyDTO(customerId); + listDTO.forEach(dto->{ + dto.setDateId(dateId); + }); boolean insertRes=insertBatch(ConvertUtils.sourceToTarget(listDTO, ScreenProjectCategoryGridDailyEntity.class)); log.info("insertRes is {}",insertRes); } 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 451acb81d5..7836274c05 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 @@ -43,7 +43,7 @@ SELECT c.CUSTOMER_ID, left(c.CATEGORY_CODE, 4) as CATEGORY_CODE, - c.`LEVEL`, + '1'as `LEVEL`, p.GRID_ID, p.AGENCY_ID AS PID, P.PIDS, From 4fa14db16bd61ad9da5983e26a9fd72cbf36e81b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Mar 2021 13:37:28 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E8=A7=A3=E5=86=B3sql=E8=84=9A=E6=9C=AC?= =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=86=B2=E7=AA=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ..._category_tag_field.sql => V0.0.9__del_category_tag_field.sql} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/{V0.0.8__del_category_tag_field.sql => V0.0.9__del_category_tag_field.sql} (100%) diff --git a/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.8__del_category_tag_field.sql b/epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.9__del_category_tag_field.sql similarity index 100% rename from epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.8__del_category_tag_field.sql rename to epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.9__del_category_tag_field.sql From b5f2aab02997ed9e718f20ea9b95304d580ed49d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Mar 2021 13:56:07 +0800 Subject: [PATCH 3/9] =?UTF-8?q?/data/report/project/categorydict=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/project/ProjectController.java | 11 ++++------- .../datareport/service/project/ProjectService.java | 4 ++-- .../service/project/impl/ProjectServiceImpl.java | 8 ++++---- 3 files changed, 10 insertions(+), 13 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 2bb49d5c25..2f704b6b16 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 @@ -16,10 +16,7 @@ import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -134,13 +131,13 @@ public class ProjectController { * 002、项目分类字典查询 * 查询当前客户的父客户下,项目分类字典 * - * @param tokenDto + * @param customerId * @return com.epmet.commons.tools.utils.Result> * @Author zhangyong * @Date 10:41 2021-03-22 **/ @PostMapping("categorydict") - public Result> categoryDict(@LoginUser TokenDto tokenDto) { - return new Result>().ok(projectService.getCategoryDict(tokenDto)); + public Result> categoryDict(@RequestHeader("CustomerId") String customerId) { + return new Result>().ok(projectService.getCategoryDict(customerId)); } } 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 bb2ffedd9c..917113fe12 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 @@ -74,10 +74,10 @@ public interface ProjectService { /** * 002、项目分类字典查询 * - * @param tokenDto + * @param customerId * @return java.util.List * @Author zhangyong * @Date 14:26 2021-03-22 **/ - List getCategoryDict(TokenDto tokenDto); + List getCategoryDict(String customerId); } 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 4da82573c9..4d2df70470 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 @@ -358,12 +358,12 @@ public class ProjectServiceImpl implements ProjectService { } @Override - public List getCategoryDict(TokenDto tokenDto) { + public List getCategoryDict(String customerId) { List result = new ArrayList<>(); - Result parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(tokenDto.getCustomerId()); + Result parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(customerId); if (!parentCustomerId.success() && null == parentCustomerId.getData()) { logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER, - JSON.toJSONString(tokenDto.getCustomerId()))); + JSON.toJSONString(customerId))); return result; } CustomerCategoryDTO argDto = new CustomerCategoryDTO(); @@ -373,7 +373,7 @@ public class ProjectServiceImpl implements ProjectService { Result> parentCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto); if (!parentCategoryDict.success()) { logger.warn(String.format("调用%s服务查询当前客户的父客户下,项目分类字典失败,入参%s", ServiceConstant.GOV_ISSUE_SERVER, - JSON.toJSONString(tokenDto.getCustomerId()))); + JSON.toJSONString(customerId))); } else { result = parentCategoryDict.getData(); // 获取客户二级分类 From e391ab9b13183c1f50bad960ba01079c601f87c4 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Mar 2021 14:09:22 +0800 Subject: [PATCH 4/9] =?UTF-8?q?/data/report/project/categorydict=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E6=95=B42?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/project/dto/result/ProjectCategoryDictResultDTO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java index ca534db2a9..ad19f97e1c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.project.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -32,10 +33,12 @@ public class ProjectCategoryDictResultDTO implements Serializable { /** * 主键 **/ + @JsonIgnore private String id; /** * 上级分类ID 顶级此列存储0 **/ + @JsonIgnore private String pid; } From 7d7975a4ae7683a626bfa719c592ed2d2d289607 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Mar 2021 14:16:09 +0800 Subject: [PATCH 5/9] =?UTF-8?q?/data/report/project/categorydict=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E8=B0=83=E6=95=B4back?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/project/dto/result/ProjectCategoryDictResultDTO.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java index ad19f97e1c..ca534db2a9 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java @@ -1,6 +1,5 @@ package com.epmet.project.dto.result; -import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -33,12 +32,10 @@ public class ProjectCategoryDictResultDTO implements Serializable { /** * 主键 **/ - @JsonIgnore private String id; /** * 上级分类ID 顶级此列存储0 **/ - @JsonIgnore private String pid; } From b3b2e51df83211dbb50e4d1b6242e9e076f53220 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Mar 2021 14:19:38 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E5=88=86=E7=B1=BB=E3=80=81=E6=A0=87=E7=AD=BE=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gov-issue/gov-issue-server/pom.xml | 6 +++ .../IssueProjectCategoryDictServiceImpl.java | 51 ++++++++++++------- .../mapper/IssueProjectCategoryDictDao.xml | 1 + 3 files changed, 39 insertions(+), 19 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 673a33aeb9..54a2ff009c 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -102,6 +102,12 @@ 2.0.0 compile + + com.epmet + oper-crm-client + 2.0.0 + compile + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 0a9a266b67..1ba11ff550 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -30,10 +30,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dao.IssueCategoryDao; import com.epmet.dao.IssueProjectCategoryDictDao; import com.epmet.dao.IssueProjectRelationDao; -import com.epmet.dto.IssueCategoryDTO; -import com.epmet.dto.IssueDTO; -import com.epmet.dto.IssueProjectCategoryDictDTO; -import com.epmet.dto.ProjectCategoryDTO; +import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.CustomerCategoryListResultDTO; import com.epmet.dto.result.ProjectCategoryDTOResultDTO; @@ -42,6 +39,7 @@ import com.epmet.dto.result.ProjectIssueDTOResultDTO; import com.epmet.entity.IssueProjectCategoryDictEntity; import com.epmet.entity.IssueProjectTagDictEntity; import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.feign.OperCrmOpenFeignClient; import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import com.epmet.redis.IssueProjectCategoryDictRedis; import com.epmet.service.IssueProjectCategoryDictService; @@ -76,11 +74,12 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl page(Map params) { @@ -199,21 +198,35 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl list = baseDao.selectCategoryListByCustomer(formDTO.getCustomerId()); - if (CollectionUtils.isEmpty(list)) { - //分类初始化 - List categoryList = baseDao.selectCategoryListByCustomer("default"); - categoryList.forEach(item -> { - item.setCustomerId(formDTO.getCustomerId()); - }); - this.insertBatch(categoryList); - //标签初始化 - List tagList = issueProjectTagDictService.getTagListByCustomer("default"); - tagList.forEach(item -> { - item.setCustomerId(formDTO.getCustomerId()); - }); - issueProjectTagDictService.insertBatch(tagList); + //2021.3.23 sun 不传客户Id时默认查询所有有效客户列表 循环添加 + List customerIdList = new ArrayList<>(); + if(StringUtils.isBlank(formDTO.getCustomerId())){ + Result> resultList = operCrmOpenFeignClient.getAllCustomerList(); + if(!resultList.success()){ + throw new RuntimeException("crm库获取有效客户列表失败!"); + } + customerIdList = resultList.getData().stream().map(cu->cu.getId()).collect(Collectors.toList()); + }else { + customerIdList.add(formDTO.getCustomerId()); } + //end sun + customerIdList.forEach(cu->{ + List list = baseDao.selectCategoryListByCustomer(formDTO.getCustomerId()); + if (CollectionUtils.isEmpty(list)) { + //分类初始化 + List categoryList = baseDao.selectCategoryListByCustomer("default"); + categoryList.forEach(item -> { + item.setCustomerId(formDTO.getCustomerId()); + }); + this.insertBatch(categoryList); + //标签初始化 + List tagList = issueProjectTagDictService.getTagListByCustomer("default"); + tagList.forEach(item -> { + item.setCustomerId(formDTO.getCustomerId()); + }); + issueProjectTagDictService.insertBatch(tagList); + } + }); } /** diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 7752ab2c35..4d1bc0da0b 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -46,6 +46,7 @@ ID, PID, PIDS, + PARENT_CATEGORY_CODE, CATEGORY_CODE, CATEGORY_NAME, CATEGORY_TYPE, From 945d994c15b76043b258aa1ef47f6955236ceabb Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Mar 2021 14:28:30 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=BC=8F=E6=8F=90=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IssueProjectCategoryDictDao.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml index 4d1bc0da0b..20f8c5cfdd 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectCategoryDictDao.xml @@ -50,7 +50,8 @@ CATEGORY_CODE, CATEGORY_NAME, CATEGORY_TYPE, - SORT + SORT, + IS_DISABLE FROM issue_project_category_dict WHERE From b129219f2722c67272330129ebd91ef53f89360d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Mar 2021 14:35:07 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=AD=97=E6=AE=B5=20sql=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/IssueProjectTagDictDao.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml index ec80fe2af3..5988ddbbbd 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml +++ b/epmet-module/gov-issue/gov-issue-server/src/main/resources/mapper/IssueProjectTagDictDao.xml @@ -77,7 +77,8 @@ CATEGORY_ID, IS_DEFAULT, ISSUE_USE_COUNT, - PROJECT_USE_COUNT + PROJECT_USE_COUNT, + IS_DISABLE FROM issue_project_tag_dict WHERE From 322701126842c472acaee3c4c3adad8bc5e24adc Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Mar 2021 14:53:58 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=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 --- .../service/impl/IssueProjectCategoryDictServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java index 1ba11ff550..c4faa05e5d 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueProjectCategoryDictServiceImpl.java @@ -211,18 +211,18 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl{ - List list = baseDao.selectCategoryListByCustomer(formDTO.getCustomerId()); + List list = baseDao.selectCategoryListByCustomer(cu); if (CollectionUtils.isEmpty(list)) { //分类初始化 List categoryList = baseDao.selectCategoryListByCustomer("default"); categoryList.forEach(item -> { - item.setCustomerId(formDTO.getCustomerId()); + item.setCustomerId(cu); }); this.insertBatch(categoryList); //标签初始化 List tagList = issueProjectTagDictService.getTagListByCustomer("default"); tagList.forEach(item -> { - item.setCustomerId(formDTO.getCustomerId()); + item.setCustomerId(cu); }); issueProjectTagDictService.insertBatch(tagList); }