From a4b49c3ba996f1d6b099bc3594e0b24a5dd6f5d2 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 22 Mar 2021 10:31:05 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=BD=93=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IssueProjectCategoryDictController.java | 22 +++++++++++++++++++ .../IssueProjectCategoryDictService.java | 12 ++++++++++ .../IssueProjectCategoryDictServiceImpl.java | 20 +++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java index d6fb36123d..b0d5a7fd1f 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java @@ -144,4 +144,26 @@ public class IssueProjectCategoryDictController { return new Result().ok(issueProjectCategoryDictService.getProjectAndCategoryInfo(formDTO)); } + /** + * @param formDTO + * @return + * @Description 分类启用与禁用 + * @Author sun + **/ + @PostMapping("isdisablecategory") + public Result isDisableCategory(@RequestBody ProjectSaveCategoryFormDTO formDTO) { + return new Result().ok(issueProjectCategoryDictService.isDisableCategory(formDTO)); + } + + /** + * @param formDTO + * @return + * @Description 分类删除 + * @Author sun + **/ + @PostMapping("delcategory") + public Result delCategory(@RequestBody ProjectSaveCategoryFormDTO formDTO) { + return new Result().ok(issueProjectCategoryDictService.delCategory(formDTO)); + } + } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java index 3b1fa1def1..9de4150e08 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java @@ -130,4 +130,16 @@ public interface IssueProjectCategoryDictService extends BaseService Date: Mon, 22 Mar 2021 11:04:13 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E6=8A=BD=E5=8F=96=E5=88=B0=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DimController.java | 8 +- .../issue/IssueProjectCategoryDictDao.java | 39 ++++++++ .../stats/CustomerProjectCategoryDictDao.java | 39 ++++++++ .../stats/FactOrginProjectCategoryDao.java | 33 +++++++ .../issue/IssueProjectCategoryDictEntity.java | 83 ++++++++++++++++ .../CustomerProjectCategoryDictEntity.java | 95 ++++++++++++++++++ .../stats/FactOrginProjectCategoryEntity.java | 63 ++++++++++++ .../IssueProjectCategoryDictService.java | 37 +++++++ .../IssueProjectCategoryDictServiceImpl.java | 36 +++++++ .../com/epmet/service/StatsDimService.java | 2 + .../service/impl/StatsDimServiceImpl.java | 51 ++++++++++ .../CustomerProjectCategoryDictService.java | 45 +++++++++ .../FactOrginProjectCategoryService.java | 31 ++++++ ...ustomerProjectCategoryDictServiceImpl.java | 97 +++++++++++++++++++ .../FactOrginProjectCategoryServiceImpl.java | 35 +++++++ .../issue/IssueProjectCategoryDictDao.xml | 44 +++++++++ .../stats/CustomerProjectCategoryDictDao.xml | 41 ++++++++ .../stats/FactOrginProjectCategoryDao.xml | 8 ++ 18 files changed, 786 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactOrginProjectCategoryDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerProjectCategoryDictEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactOrginProjectCategoryEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactOrginProjectCategoryService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactOrginProjectCategoryServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactOrginProjectCategoryDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java index 3e2a78b716..68dedbd4a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java @@ -1,7 +1,6 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -105,6 +104,13 @@ public class DimController { } catch (Exception e) { logger.error("初始化按周维度失败:", e); } + //项目分类字典维度 初始化 每天晚上凌晨10分执行 + try { + statsDimService.customerInitProjectCategory(); + logger.info("初始化项目分类成功"); + } catch (Exception e) { + logger.error("初始化项目分类失败:", e); + } return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java new file mode 100644 index 0000000000..9cc59cf996 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/IssueProjectCategoryDictDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.issue; + +import com.epmet.entity.issue.IssueProjectCategoryDictEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Mapper +public interface IssueProjectCategoryDictDao { + + List listInsertCategoies(@Param("start") Date start, @Param("end") Date end); + + List listByUpdatedTime(@Param("start") Date start, @Param("end") Date end); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java new file mode 100644 index 0000000000..fd0cdd6eb2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 客户项目分类字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +@Mapper +public interface CustomerProjectCategoryDictDao extends BaseDao { + + CustomerProjectCategoryDictEntity getLatestProjectCategory(); + + CustomerProjectCategoryDictEntity getLatestUpdatedEntity(); + + CustomerProjectCategoryDictEntity selectByCustomerIdAndId(@Param("customerId") String customerId, @Param("categoryId") String categoryId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactOrginProjectCategoryDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactOrginProjectCategoryDao.java new file mode 100644 index 0000000000..789dc926bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactOrginProjectCategoryDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactOrginProjectCategoryEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +@Mapper +public interface FactOrginProjectCategoryDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java new file mode 100644 index 0000000000..67c82fee00 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueProjectCategoryDictEntity.java @@ -0,0 +1,83 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.issue; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("issue_project_category_dict") +public class IssueProjectCategoryDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id, 产品默认default + */ + private String customerId; + + /** + * 上级分类ID 顶级此列存储0 + */ + private String pid; + + /** + * 所有上级分类ID,用逗号分开 + */ + private String pids; + + /** + * 上级分类编码 + */ + private String parentCategoryCode; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 分类类别1,2,3,4.... + */ + private String categoryType; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否禁用(enable:启用 disable:禁用) + */ + private String isDisable; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerProjectCategoryDictEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerProjectCategoryDictEntity.java new file mode 100644 index 0000000000..82afefb88c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/CustomerProjectCategoryDictEntity.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 客户项目分类字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_project_category_dict") +public class CustomerProjectCategoryDictEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 外部客户:external;内部客户:internal + */ + private String customerType; + + /** + * 客户自己的分类编码 + */ + private String categoryCode; + + /** + * 客户自己的分类名称 + */ + private String categoryName; + + /** + * 父类分类编码,如果是一级分类,此列赋值为0 + */ + private String parentCategoryCode; + + /** + * 分类等级:1、2....;产品只有2级分类 + */ + private Integer level; + + /** + * 排序 + */ + private Integer sort; + + /** + * 是否禁用(enable:启用 disable:禁用) + */ + private String isDisable; + + /** + * 对应e世通中的分类编码,没有此列为空 + */ + private String epmetCategoryCode; + + /** + * 创建时间 + */ + private Date originCreatedTime; + /** + * 修改时间 + */ + private Date originUpdatedTime; + + private String categoryId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactOrginProjectCategoryEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactOrginProjectCategoryEntity.java new file mode 100644 index 0000000000..294bdfd92e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactOrginProjectCategoryEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_orgin_project_category") +public class FactOrginProjectCategoryEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类编码 + */ + private String categoryCode; + + /** + * 所属父类分类编码 + */ + private String parentCategoryCode; + + /** + * 分类等级:1、2....;产品目前只有2级分类 + */ + private Integer level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java new file mode 100644 index 0000000000..3067657abb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueProjectCategoryDictService.java @@ -0,0 +1,37 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.Issue; + +import com.epmet.entity.issue.IssueProjectCategoryDictEntity; + +import java.util.Date; +import java.util.List; + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ + +public interface IssueProjectCategoryDictService{ + + List listInsertCategoies(Date start, Date end); + + List listByUpdatedTime(Date start, Date end); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java new file mode 100644 index 0000000000..98c18ec1fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueProjectCategoryDictServiceImpl.java @@ -0,0 +1,36 @@ +package com.epmet.service.Issue.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.issue.IssueProjectCategoryDictDao; +import com.epmet.entity.issue.IssueProjectCategoryDictEntity; +import com.epmet.service.Issue.IssueProjectCategoryDictService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2021/3/19 15:29 + */ +@Service +@DataSource(DataSourceConstant.GOV_ISSUE) +public class IssueProjectCategoryDictServiceImpl implements IssueProjectCategoryDictService { + @Autowired + private IssueProjectCategoryDictDao issueProjectCategoryDictDao; + + @Override + public List listInsertCategoies(Date start, Date end) { + return issueProjectCategoryDictDao.listInsertCategoies(start, end); + } + + @Override + public List listByUpdatedTime(Date start, Date end) { + return issueProjectCategoryDictDao.listByUpdatedTime(start, end); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java index 1e2f05991b..0bdac4cb04 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java @@ -10,4 +10,6 @@ public interface StatsDimService { void initCustomerDim(); void initDepartmentDim(); + + void customerInitProjectCategory(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index 6338145260..09db5e717d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -3,10 +3,12 @@ package com.epmet.service.impl; import com.epmet.constant.RobotConstant; import com.epmet.dto.org.result.CustomerAreaCodeResultDTO; import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.issue.IssueProjectCategoryDictEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.stats.*; +import com.epmet.service.Issue.IssueProjectCategoryDictService; import com.epmet.service.StatsDimService; import com.epmet.service.crm.CustomerService; import com.epmet.service.org.CustomerAgencyService; @@ -52,6 +54,12 @@ public class StatsDimServiceImpl implements StatsDimService { @Autowired private DimDepartmentService dimDepartmentService; + @Autowired + private CustomerProjectCategoryDictService projectCategoryDictService; + + @Autowired + private IssueProjectCategoryDictService issueProjectCategoryDictService; + @Override public void initGridDim() { List newDimGrids = getNewDimGrids(); @@ -264,4 +272,47 @@ public class StatsDimServiceImpl implements StatsDimService { } return new ArrayList<>(); } + + /** + * @return void + * @author yinzuomei + * @description 初始化项目分类字典表 + * @Date 2021/3/19 15:44 + **/ + @Override + public void customerInitProjectCategory() { + Date now = new Date(); + List insertCategoies = listInsertCategoies(); + List updateCategoies = listUpdateCategoies(now); + projectCategoryDictService.initProjectCategory(insertCategoies,updateCategoies); + } + + /** + * @author yinzuomei + * @description 构造需要插入的分类字典 + * @Date 2021/3/19 15:52 + **/ + private List listInsertCategoies() { + CustomerProjectCategoryDictEntity lastInsertProjectCategory = projectCategoryDictService.getLatestProjectCategory(); + Date now = new Date(); + Date lastInitTime = null; + if (null != lastInsertProjectCategory) { + lastInitTime = lastInsertProjectCategory.getOriginCreatedTime(); + } + return issueProjectCategoryDictService.listInsertCategoies(lastInitTime, now); + } + + /** + * @param initTime + * @author yinzuomei + * @description + * @Date 2021/3/19 15:55 + **/ + private List listUpdateCategoies(Date initTime) { + CustomerProjectCategoryDictEntity lastUpdated = projectCategoryDictService.getLatestUpdatedEntity(); + if (lastUpdated != null) { + return issueProjectCategoryDictService.listByUpdatedTime(lastUpdated.getOriginUpdatedTime(), initTime); + } + return new ArrayList<>(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java new file mode 100644 index 0000000000..36861d7b35 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.issue.IssueProjectCategoryDictEntity; +import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; + +import java.util.List; + +/** + * 客户项目分类字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +public interface CustomerProjectCategoryDictService extends BaseService { + + void initProjectCategory(List insertCategoies, + List updateCategoies); + + /** + * @author yinzuomei + * @description 获取内部客户最近一次初始记录 + * @Date 2021/3/19 14:57 + **/ + CustomerProjectCategoryDictEntity getLatestProjectCategory(); + + CustomerProjectCategoryDictEntity getLatestUpdatedEntity(); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactOrginProjectCategoryService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactOrginProjectCategoryService.java new file mode 100644 index 0000000000..1d3a614ead --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactOrginProjectCategoryService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactOrginProjectCategoryEntity; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +public interface FactOrginProjectCategoryService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java new file mode 100644 index 0000000000..e81c8568ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/CustomerProjectCategoryDictServiceImpl.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.stats.CustomerProjectCategoryDictDao; +import com.epmet.entity.issue.IssueProjectCategoryDictEntity; +import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; +import com.epmet.service.stats.CustomerProjectCategoryDictService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 客户项目分类字典表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +@Slf4j +@DataSource(DataSourceConstant.EVALUATION_INDEX) +@Service +public class CustomerProjectCategoryDictServiceImpl extends BaseServiceImpl implements CustomerProjectCategoryDictService { + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + @Transactional(rollbackFor = Exception.class) + @Override + public void initProjectCategory(List insertCategoies, List updateCategoies) { + log.info(String.format("=============需要插入的条数=%s,更新的条数=%s",insertCategoies.size(),updateCategoies.size())); + insertCategoies.forEach(insertEntity -> { + CustomerProjectCategoryDictEntity entityInsert=new CustomerProjectCategoryDictEntity(); + entityInsert.setCustomerId(insertEntity.getCustomerId()); + entityInsert.setCustomerType("internal"); + entityInsert.setCategoryCode(insertEntity.getCategoryCode()); + entityInsert.setCategoryName(insertEntity.getCategoryName()); + entityInsert.setParentCategoryCode(insertEntity.getParentCategoryCode()); + entityInsert.setLevel(Integer.valueOf(insertEntity.getCategoryType())); + entityInsert.setSort(insertEntity.getSort()); + entityInsert.setIsDisable(insertEntity.getIsDisable()); + entityInsert.setOriginCreatedTime(insertEntity.getCreatedTime()); + entityInsert.setOriginUpdatedTime(insertEntity.getUpdatedTime()); + entityInsert.setCategoryId(insertEntity.getId()); + baseDao.insert(entityInsert); + }); + updateCategoies.forEach(updatedEntity -> { + CustomerProjectCategoryDictEntity entity=baseDao.selectByCustomerIdAndId(updatedEntity.getCustomerId(),updatedEntity.getId()); + if(null!=entity){ + entity.setCategoryCode(updatedEntity.getCategoryCode()); + entity.setCategoryName(updatedEntity.getCategoryName()); + entity.setParentCategoryCode(updatedEntity.getParentCategoryCode()); + entity.setLevel(Integer.valueOf(updatedEntity.getCategoryType())); + entity.setSort(updatedEntity.getSort()); + entity.setIsDisable(updatedEntity.getIsDisable()); + entity.setOriginCreatedTime(updatedEntity.getCreatedTime()); + entity.setOriginUpdatedTime(updatedEntity.getUpdatedTime()); + } + baseDao.updateById(entity); + }); + } + + /** + * @author yinzuomei + * @description 获取内部客户最近一次初始记录 + * @Date 2021/3/19 14:57 + **/ + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + @Override + public CustomerProjectCategoryDictEntity getLatestProjectCategory() { + return baseDao.getLatestProjectCategory(); + } + + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + @Override + public CustomerProjectCategoryDictEntity getLatestUpdatedEntity() { + return baseDao.getLatestUpdatedEntity(); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactOrginProjectCategoryServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactOrginProjectCategoryServiceImpl.java new file mode 100644 index 0000000000..c2190ca008 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactOrginProjectCategoryServiceImpl.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactOrginProjectCategoryDao; +import com.epmet.entity.stats.FactOrginProjectCategoryEntity; +import com.epmet.service.stats.FactOrginProjectCategoryService; +import org.springframework.stereotype.Service; + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-03-19 + */ +@Service +public class FactOrginProjectCategoryServiceImpl extends BaseServiceImpl implements FactOrginProjectCategoryService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml new file mode 100644 index 0000000000..a1207ecd06 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/IssueProjectCategoryDictDao.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml new file mode 100644 index 0000000000..63b47e4456 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml @@ -0,0 +1,41 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactOrginProjectCategoryDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactOrginProjectCategoryDao.xml new file mode 100644 index 0000000000..572c1dc091 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactOrginProjectCategoryDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 6702899ec7e270317fb54df4c00d9d42192e9da8 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Mar 2021 13:28:14 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=86=85=E3=80=81?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E5=86=85=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=A1=B9=E7=9B=AE=E6=95=B0=E9=87=8F=E9=87=87?= =?UTF-8?q?=E9=9B=86API=E8=B0=83=E6=95=B4=EF=BC=8C=20=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E7=B1=BB=E5=9E=8B=E5=88=86=E6=9E=90=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScreenProjectCategoryGridDailyDTO.java | 42 ++--------------- .../dto/ScreenProjectCategoryOrgDailyDTO.java | 42 ++--------------- .../ScreenProjectCategoryOrgDailyDao.xml | 40 +++++++++-------- .../ScreenProjectCategoryGridDailyDTO.java | 44 ++---------------- .../ScreenProjectCategoryOrgDailyDTO.java | 44 ++---------------- .../ScreenProjectCategoryGridDailyEntity.java | 45 +------------------ .../ScreenProjectCategoryOrgDailyEntity.java | 43 +----------------- .../ScreenProjectCategoryGridDailyDao.xml | 23 ---------- .../ScreenProjectCategoryOrgDailyDao.xml | 25 ----------- 9 files changed, 36 insertions(+), 312 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java index b9cd6657b6..166be073a1 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java @@ -17,11 +17,10 @@ package com.epmet.dto; -import java.io.Serializable; -import java.util.Date; import lombok.Data; -import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; /** * 项目(事件)分类按网格_按天统计 @@ -67,48 +66,13 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable { /** * e世通中的项目类别编码 */ - private String epmetCategoryCode; + private String categoryCode; /** * 该分类下所有项目总数 */ private Integer projectTotal; - /** - * 该分类下,正在处理中的项目总数 - */ - private Integer pendingTotal; - - /** - * 该分类下已结案的项目总数 - */ - private Integer closedTotal; - - /** - * 该分类下已结案无需解决的项目总数 - */ - private Integer unResolvedTotal; - - /** - * 该分类下已结案已解决的项目总数 - */ - private Integer resolvedTotal; - - /** - * 该分类下项目结案率 - */ - private BigDecimal closedRatio; - - /** - * 该分类下已结案项目解决率 - */ - private BigDecimal resolvedRatio; - - /** - * 该分类下已结案项目未解决率 - */ - private BigDecimal unResolvedRatio; - /** * 删除标识 */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java index 1507a1f88a..0404581cf7 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java @@ -17,11 +17,10 @@ package com.epmet.dto; -import java.io.Serializable; -import java.util.Date; import lombok.Data; -import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; /** * 项目(事件)分类按组织_按天统计 @@ -72,48 +71,13 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable { /** * e世通中的项目类别编码 */ - private String epmetCategoryCode; + private String categoryCode; /** * 该分类下所有项目总数 */ private Integer projectTotal; - /** - * 该分类下,正在处理中的项目总数 - */ - private Integer pendingTotal; - - /** - * 该分类下已结案的项目总数 - */ - private Integer closedTotal; - - /** - * 该分类下已结案无需解决的项目总数 - */ - private Integer unResolvedTotal; - - /** - * 该分类下已结案已解决的项目总数 - */ - private Integer resolvedTotal; - - /** - * 该分类下项目结案率 - */ - private BigDecimal closedRatio; - - /** - * 该分类下已结案项目解决率 - */ - private BigDecimal resolvedRatio; - - /** - * 该分类下已结案项目未解决率 - */ - private BigDecimal unResolvedRatio; - /** * 删除标识 */ diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml index 5816def044..d2ac38a7f7 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -5,24 +5,26 @@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java index 50afc350ef..582fc6d842 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java @@ -17,11 +17,10 @@ package com.epmet.dto.screen; -import java.io.Serializable; -import java.util.Date; import lombok.Data; -import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; /** * 项目(事件)分类按网格_按天统计 @@ -67,50 +66,13 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable { /** * e世通中的项目类别编码 */ - private String epmetCategoryCode; - - private String epmetCategoryName; + private String categoryCode; /** * 该分类下所有项目总数 */ private Integer projectTotal; - /** - * 该分类下,正在处理中的项目总数 - */ - private Integer pendingTotal; - - /** - * 该分类下已结案的项目总数 - */ - private Integer closedTotal; - - /** - * 该分类下已结案无需解决的项目总数 - */ - private Integer unResolvedTotal; - - /** - * 该分类下已结案已解决的项目总数 - */ - private Integer resolvedTotal; - - /** - * 该分类下项目结案率 - */ - private BigDecimal closedRatio; - - /** - * 该分类下已结案项目解决率 - */ - private BigDecimal resolvedRatio; - - /** - * 该分类下已结案项目未解决率 - */ - private BigDecimal unResolvedRatio; - /** * 删除标识 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java index 49c85be67e..ed598e903f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java @@ -17,11 +17,10 @@ package com.epmet.dto.screen; -import java.io.Serializable; -import java.util.Date; import lombok.Data; -import java.math.BigDecimal; +import java.io.Serializable; +import java.util.Date; /** * 项目(事件)分类按组织_按天统计 @@ -72,50 +71,13 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable { /** * e世通中的项目类别编码 */ - private String epmetCategoryCode; - - private String epmetCategoryName; + private String categoryCode; /** * 该分类下所有项目总数 */ private Integer projectTotal; - /** - * 该分类下,正在处理中的项目总数 - */ - private Integer pendingTotal; - - /** - * 该分类下已结案的项目总数 - */ - private Integer closedTotal; - - /** - * 该分类下已结案无需解决的项目总数 - */ - private Integer unResolvedTotal; - - /** - * 该分类下已结案已解决的项目总数 - */ - private Integer resolvedTotal; - - /** - * 该分类下项目结案率 - */ - private BigDecimal closedRatio; - - /** - * 该分类下已结案项目解决率 - */ - private BigDecimal resolvedRatio; - - /** - * 该分类下已结案项目未解决率 - */ - private BigDecimal unResolvedRatio; - /** * 删除标识 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java index ef91f696c2..5d40a12628 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java @@ -18,14 +18,10 @@ package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.math.BigDecimal; -import java.util.Date; - /** * 项目(事件)分类按网格_按天统计 * @@ -65,50 +61,13 @@ public class ScreenProjectCategoryGridDailyEntity extends BaseEpmetEntity { private String pids; /** - * e世通中的项目类别编码 + * 项目类别编码 */ - private String epmetCategoryCode; - - private String epmetCategoryName; + private String categoryCode; /** * 该分类下所有项目总数 */ private Integer projectTotal; - /** - * 该分类下,正在处理中的项目总数 - */ - private Integer pendingTotal; - - /** - * 该分类下已结案的项目总数 - */ - private Integer closedTotal; - - /** - * 该分类下已结案无需解决的项目总数 - */ - private Integer unResolvedTotal; - - /** - * 该分类下已结案已解决的项目总数 - */ - private Integer resolvedTotal; - - /** - * 该分类下项目结案率 - */ - private BigDecimal closedRatio; - - /** - * 该分类下已结案项目解决率 - */ - private BigDecimal resolvedRatio; - - /** - * 该分类下已结案项目未解决率 - */ - private BigDecimal unResolvedRatio; - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java index 1ac6c76145..7c61d7069d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java @@ -18,14 +18,10 @@ package com.epmet.entity.evaluationindex.screen; import com.baomidou.mybatisplus.annotation.TableName; - import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.math.BigDecimal; -import java.util.Date; - /** * 项目(事件)分类按组织_按天统计 * @@ -72,48 +68,11 @@ public class ScreenProjectCategoryOrgDailyEntity extends BaseEpmetEntity { /** * e世通中的项目类别编码 */ - private String epmetCategoryCode; - - private String epmetCategoryName; + private String categoryCode; /** * 该分类下所有项目总数 */ private Integer projectTotal; - /** - * 该分类下,正在处理中的项目总数 - */ - private Integer pendingTotal; - - /** - * 该分类下已结案的项目总数 - */ - private Integer closedTotal; - - /** - * 该分类下已结案无需解决的项目总数 - */ - private Integer unResolvedTotal; - - /** - * 该分类下已结案已解决的项目总数 - */ - private Integer resolvedTotal; - - /** - * 该分类下项目结案率 - */ - private BigDecimal closedRatio; - - /** - * 该分类下已结案项目解决率 - */ - private BigDecimal resolvedRatio; - - /** - * 该分类下已结案项目未解决率 - */ - private BigDecimal unResolvedRatio; - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml index bc84c6b2df..e79da541d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml @@ -3,29 +3,6 @@ - - - - - - - - - - - - - - - - - - - - - - - delete from screen_project_category_grid_daily where customer_id = #{customerId} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml index 5d8cd9a73a..20c4452e69 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -2,31 +2,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - delete from screen_project_category_org_daily where customer_id = #{customerId} From f449c114660ba9acefc3fd11fac8ad8f63e14008 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Mar 2021 14:14:20 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E6=96=B0=E5=A2=9Efact=5Forigin=5Fproject?= =?UTF-8?q?=5Fcategory=5Fdaily?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginProjectCategoryDailyDao.java} | 6 +++--- .../FactOriginProjectCategoryDailyEntity.java} | 6 +++--- .../FactOriginProjectCategoryDailyService.java} | 8 ++++---- .../todata/impl/FactOriginExtractServiceImpl.java | 7 ++++++- .../FactOriginProjectCategoryDailyServiceImpl.java} | 13 ++++++++----- .../extract/FactOriginProjectCategoryDailyDao.xml} | 2 +- 6 files changed, 25 insertions(+), 17 deletions(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/{stats/FactOrginProjectCategoryDao.java => evaluationindex/extract/FactOriginProjectCategoryDailyDao.java} (79%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/{stats/FactOrginProjectCategoryEntity.java => evaluationindex/extract/FactOriginProjectCategoryDailyEntity.java} (89%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{stats/FactOrginProjectCategoryService.java => evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java} (69%) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/{stats/impl/FactOrginProjectCategoryServiceImpl.java => evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java} (58%) rename epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/{stats/FactOrginProjectCategoryDao.xml => evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml} (59%) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactOrginProjectCategoryDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java similarity index 79% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactOrginProjectCategoryDao.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java index 789dc926bb..ff9f8c1885 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactOrginProjectCategoryDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectCategoryDailyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.dao.stats; +package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.stats.FactOrginProjectCategoryEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; import org.apache.ibatis.annotations.Mapper; /** @@ -28,6 +28,6 @@ import org.apache.ibatis.annotations.Mapper; * @since v1.0.0 2021-03-19 */ @Mapper -public interface FactOrginProjectCategoryDao extends BaseDao { +public interface FactOriginProjectCategoryDailyDao extends BaseDao { } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactOrginProjectCategoryEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectCategoryDailyEntity.java similarity index 89% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactOrginProjectCategoryEntity.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectCategoryDailyEntity.java index 294bdfd92e..4587577a2d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactOrginProjectCategoryEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginProjectCategoryDailyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity.stats; +package com.epmet.entity.evaluationindex.extract; import com.baomidou.mybatisplus.annotation.TableName; import com.epmet.commons.mybatis.entity.BaseEpmetEntity; @@ -30,8 +30,8 @@ import lombok.EqualsAndHashCode; */ @Data @EqualsAndHashCode(callSuper=false) -@TableName("fact_orgin_project_category") -public class FactOrginProjectCategoryEntity extends BaseEpmetEntity { +@TableName("fact_origin_project_category_daily") +public class FactOriginProjectCategoryDailyEntity extends BaseEpmetEntity { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactOrginProjectCategoryService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java similarity index 69% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactOrginProjectCategoryService.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java index 1d3a614ead..2eb2de215e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactOrginProjectCategoryService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectCategoryDailyService.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.service.stats; +package com.epmet.service.evaluationindex.extract.todata; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.entity.stats.FactOrginProjectCategoryEntity; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; /** * 项目所属分类表 @@ -26,6 +26,6 @@ import com.epmet.entity.stats.FactOrginProjectCategoryEntity; * @author generator generator@elink-cn.com * @since v1.0.0 2021-03-19 */ -public interface FactOrginProjectCategoryService extends BaseService { - +public interface FactOriginProjectCategoryDailyService extends BaseService { + //todo 将epmet_gov_project库中的项目分类信息(project_category)同步到统计库epmet_data_statistical } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java index f44eef01de..67ba0f0c4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginExtractServiceImpl.java @@ -46,7 +46,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { private GroupExtractService groupExtractService; @Autowired private DimCustomerPartymemberService dimCustomerPartymemberService; - + @Autowired + private FactOriginProjectCategoryDailyService originProjectCategoryDailyService; @Override public void extractAll(ExtractOriginFormDTO extractOriginFormDTO) { @@ -200,6 +201,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } catch (Exception e) { log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } + //todo 新增项目分类抽取 shaowen + // originProjectCategoryDailyService.xxxx(); } else { try { for (int i = 0; i < finalDaysBetween.size(); i++) { @@ -219,6 +222,8 @@ public class FactOriginExtractServiceImpl implements FactOriginExtractService { } catch (Exception e) { log.error("抽取【项目数据】发生异常,参数:" + JSON.toJSONString(paramNew), e); } + //todo 新增项目分类抽取 shaowen + // originProjectCategoryDailyService.xxxx(); } }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactOrginProjectCategoryServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java similarity index 58% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactOrginProjectCategoryServiceImpl.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java index c2190ca008..f9bd902765 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactOrginProjectCategoryServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectCategoryDailyServiceImpl.java @@ -15,12 +15,14 @@ * along with this program. If not, see . */ -package com.epmet.service.stats.impl; +package com.epmet.service.evaluationindex.extract.todata.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; -import com.epmet.dao.stats.FactOrginProjectCategoryDao; -import com.epmet.entity.stats.FactOrginProjectCategoryEntity; -import com.epmet.service.stats.FactOrginProjectCategoryService; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectCategoryDailyDao; +import com.epmet.entity.evaluationindex.extract.FactOriginProjectCategoryDailyEntity; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectCategoryDailyService; import org.springframework.stereotype.Service; /** @@ -30,6 +32,7 @@ import org.springframework.stereotype.Service; * @since v1.0.0 2021-03-19 */ @Service -public class FactOrginProjectCategoryServiceImpl extends BaseServiceImpl implements FactOrginProjectCategoryService { +@DataSource(DataSourceConstant.STATS) +public class FactOriginProjectCategoryDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectCategoryDailyService { } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactOrginProjectCategoryDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml similarity index 59% rename from epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactOrginProjectCategoryDao.xml rename to epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml index 572c1dc091..56ab802c01 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactOrginProjectCategoryDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectCategoryDailyDao.xml @@ -1,7 +1,7 @@ - + From d9aa8777872046597baf9ca9fe2daa4320204852 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Mar 2021 15:41:26 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0level?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java | 5 +++++ .../java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java | 5 +++++ .../epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java | 5 +++++ .../epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java | 5 +++++ .../screen/ScreenProjectCategoryGridDailyEntity.java | 4 ++++ .../screen/ScreenProjectCategoryOrgDailyEntity.java | 4 ++++ 6 files changed, 28 insertions(+) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java index 166be073a1..0a015c6762 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java @@ -73,6 +73,11 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable { */ private Integer projectTotal; + /** + * 分类等级1、2.... + */ + private Integer level; + /** * 删除标识 */ diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java index 0404581cf7..95d65184a8 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java @@ -78,6 +78,11 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable { */ private Integer projectTotal; + /** + * 分类等级1、2.... + */ + private Integer level; + /** * 删除标识 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java index 582fc6d842..0406fb26f2 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java @@ -73,6 +73,11 @@ public class ScreenProjectCategoryGridDailyDTO implements Serializable { */ private Integer projectTotal; + /** + * 分类等级1、2.... + */ + private Integer level; + /** * 删除标识 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java index ed598e903f..117db2716c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java @@ -78,6 +78,11 @@ public class ScreenProjectCategoryOrgDailyDTO implements Serializable { */ private Integer projectTotal; + /** + * 分类等级1、2.... + */ + private Integer level; + /** * 删除标识 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java index 5d40a12628..82b03555ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java @@ -70,4 +70,8 @@ public class ScreenProjectCategoryGridDailyEntity extends BaseEpmetEntity { */ private Integer projectTotal; + /** + * 分类等级1、2.... + */ + private Integer level; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java index 7c61d7069d..5c097997a6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java @@ -75,4 +75,8 @@ public class ScreenProjectCategoryOrgDailyEntity extends BaseEpmetEntity { */ private Integer projectTotal; + /** + * 分类等级1、2.... + */ + private Integer level; } From c548c5b4defc63a15094b870e6d0ab24e5388b72 Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 22 Mar 2021 15:45:26 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E3=80=8A002=E3=80=81=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E5=AD=97=E5=85=B8=E6=9F=A5=E8=AF=A2=E3=80=8B?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/dto/CustomerCategoryDTO.java | 43 +++++++++++++++ .../result/ProjectCategoryDictResultDTO.java | 41 ++++++++++++++ .../data-report/data-report-server/pom.xml | 6 +++ .../controller/project/ProjectController.java | 14 +++++ .../service/project/ProjectService.java | 10 ++++ .../project/impl/ProjectServiceImpl.java | 54 +++++++++++++++++-- .../gov-issue/gov-issue-client/pom.xml | 8 ++- .../epmet/feign/GovIssueOpenFeignClient.java | 16 ++++-- .../GovIssueOpenFeignClientFallBack.java | 10 ++-- .../gov-issue/gov-issue-server/pom.xml | 8 ++- .../IssueProjectCategoryDictController.java | 19 ++++++- .../dao/IssueProjectCategoryDictDao.java | 16 +++++- .../IssueProjectCategoryDictService.java | 16 +++++- .../IssueProjectCategoryDictServiceImpl.java | 7 ++- .../mapper/IssueProjectCategoryDictDao.xml | 19 ++++++- .../epmet/feign/OperCrmOpenFeignClient.java | 11 ++++ .../OperCrmOpenFeignClientFallback.java | 5 ++ .../epmet/controller/CustomerController.java | 17 ++++++ .../main/java/com/epmet/dao/CustomerDao.java | 11 +++- .../com/epmet/service/CustomerService.java | 10 ++++ .../service/impl/CustomerServiceImpl.java | 4 ++ .../src/main/resources/mapper/CustomerDao.xml | 10 ++++ 22 files changed, 336 insertions(+), 19 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java new file mode 100644 index 0000000000..d351ae7346 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/CustomerCategoryDTO.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.project.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@Data +public class CustomerCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 父id + * pid = 0 查询一级分类 + * pid != 0 查询二级分类 + */ + private String pid; + + /** + * 客户Id + */ + private String customerId; + +} 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 new file mode 100644 index 0000000000..ca534db2a9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectCategoryDictResultDTO.java @@ -0,0 +1,41 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Author zhangyong + * @Description 002、项目分类字典查询 + **/ +@Data +public class ProjectCategoryDictResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 一级分类编码 + */ + private String categoryCode; + + /** + * 一级分类名称 + */ + private String categoryName; + + /** + * 二级分类列表 + */ + private List children; + + /** + * 主键 + **/ + private String id; + + /** + * 上级分类ID 顶级此列存储0 + **/ + private String pid; +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 8cb39e2c6b..4480ac88e7 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -94,6 +94,12 @@ 2.0.0 compile + + com.epmet + gov-issue-client + 2.0.0 + compile + 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 ed31aef27a..2bb49d5c25 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 @@ -129,4 +129,18 @@ public class ProjectController { public Result> myNextAgency(@LoginUser TokenDto tokenDto){ return new Result>().ok(projectService.getMyNextAgency(tokenDto)); } + + /** + * 002、项目分类字典查询 + * 查询当前客户的父客户下,项目分类字典 + * + * @param tokenDto + * @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)); + } } 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 18246addc6..bb2ffedd9c 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 @@ -70,4 +70,14 @@ public interface ProjectService { * @date 2020.10.19 16:38 **/ List getMyNextAgency(TokenDto tokenDto); + + /** + * 002、项目分类字典查询 + * + * @param tokenDto + * @return java.util.List + * @Author zhangyong + * @Date 14:26 2021-03-22 + **/ + List getCategoryDict(TokenDto tokenDto); } 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 f095fb0666..4da82573c9 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 @@ -3,6 +3,7 @@ package com.epmet.datareport.service.project.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.ConvertUtils; @@ -18,20 +19,21 @@ import com.epmet.dto.form.ProcessListFormDTO; import com.epmet.dto.form.SubAgencyFormDTO; import com.epmet.dto.result.*; import com.epmet.evaluationindex.screen.dto.result.DepartmentNameListResultDTO; -import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.feign.GovOrgOpenFeignClient; -import com.epmet.feign.GovProjectOpenFeignClient; +import com.epmet.feign.*; import com.epmet.project.constant.ProjectConstant; +import com.epmet.project.dto.CustomerCategoryDTO; import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.form.DifficultyRankFormDTO; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; -import com.epmet.project.dto.result.ProjectDetailResultDTO; import com.epmet.project.dto.result.*; +import com.epmet.project.dto.result.ProjectDetailResultDTO; import com.epmet.resi.group.dto.topic.ResiTopicDTO; import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; import com.github.pagehelper.PageHelper; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -50,7 +52,7 @@ import java.util.List; @Slf4j @Service public class ProjectServiceImpl implements ProjectService { - + private Logger logger = LogManager.getLogger(getClass()); @Autowired private ProjectDao projectDao; @Autowired @@ -64,6 +66,11 @@ public class ProjectServiceImpl implements ProjectService { private GovOrgOpenFeignClient govOrgOpenFeignClient; @Autowired private ResiGroupOpenFeignClient resiGroupOpenFeignClient; + @Autowired + private GovIssueOpenFeignClient govIssueOpenFeignClient; + @Autowired + private OperCrmOpenFeignClient operCrmOpenFeignClient; + /** * @Author sun * @Description 数据-项目-获取汇总数据 @@ -350,4 +357,41 @@ public class ProjectServiceImpl implements ProjectService { return result; } + @Override + public List getCategoryDict(TokenDto tokenDto) { + List result = new ArrayList<>(); + Result parentCustomerId = operCrmOpenFeignClient.getExternalAndParentCustomerId(tokenDto.getCustomerId()); + if (!parentCustomerId.success() && null == parentCustomerId.getData()) { + logger.warn(String.format("调用%s服务查询外部客户的 父级客户ID 失败,入参%s", ServiceConstant.OPER_CRM_SERVER, + JSON.toJSONString(tokenDto.getCustomerId()))); + return result; + } + CustomerCategoryDTO argDto = new CustomerCategoryDTO(); + argDto.setCustomerId(parentCustomerId.getData()); + argDto.setPid(NumConstant.ZERO_STR); + // 获取客户一级分类 + Result> parentCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto); + if (!parentCategoryDict.success()) { + logger.warn(String.format("调用%s服务查询当前客户的父客户下,项目分类字典失败,入参%s", ServiceConstant.GOV_ISSUE_SERVER, + JSON.toJSONString(tokenDto.getCustomerId()))); + } else { + result = parentCategoryDict.getData(); + // 获取客户二级分类 + argDto.setPid(NumConstant.TWO_STR); + Result> childrenCategoryDict = govIssueOpenFeignClient.getCustomerCategoryDict(argDto); + for (ProjectCategoryDictResultDTO p : result) { + List children = new ArrayList<>(); + for (ProjectCategoryDictResultDTO c : childrenCategoryDict.getData()) { + if (p.getId().equals(c.getPid())) { + ProjectCategoryDictResultDTO dto = new ProjectCategoryDictResultDTO(); + dto.setCategoryCode(c.getCategoryCode()); + dto.setCategoryName(c.getCategoryName()); + children.add(dto); + } + } + p.setChildren(children); + } + } + return result; + } } diff --git a/epmet-module/gov-issue/gov-issue-client/pom.xml b/epmet-module/gov-issue/gov-issue-client/pom.xml index f77ec89656..9d07717da1 100644 --- a/epmet-module/gov-issue/gov-issue-client/pom.xml +++ b/epmet-module/gov-issue/gov-issue-client/pom.xml @@ -29,5 +29,11 @@ 2.0.0 compile + + com.epmet + data-report-client + 2.0.0 + compile + - \ No newline at end of file + diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java index 38bc581f8c..277239669d 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/GovIssueOpenFeignClient.java @@ -2,13 +2,12 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.IssueApplicationDTO; -import com.epmet.dto.IssueDTO; -import com.epmet.dto.IssueSuggestionDTO; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.fallback.GovIssueOpenFeignClientFallBack; +import com.epmet.project.dto.CustomerCategoryDTO; +import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import com.epmet.resi.group.dto.group.form.AllIssueFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; @@ -272,4 +271,15 @@ public interface GovIssueOpenFeignClient { @PostMapping("/gov/issue/issue/detail") Result queryIssueDetail(@RequestBody IssueDetailFormDTO formDTO); + + /** + * 获取客户 分类字典 信息 + * + * @param dto + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:10 2021-03-22 + **/ + @PostMapping(value = "/gov/issue/issueprojectcategorydict/getcustomercategorydict") + Result> getCustomerCategoryDict(@RequestBody CustomerCategoryDTO dto); } diff --git a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java index 0046975f18..a304db1fa7 100644 --- a/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java +++ b/epmet-module/gov-issue/gov-issue-client/src/main/java/com/epmet/feign/fallback/GovIssueOpenFeignClientFallBack.java @@ -3,13 +3,12 @@ package com.epmet.feign.fallback; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.dto.IssueApplicationDTO; -import com.epmet.dto.IssueDTO; -import com.epmet.dto.IssueSuggestionDTO; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.feign.GovIssueOpenFeignClient; +import com.epmet.project.dto.CustomerCategoryDTO; +import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import com.epmet.resi.group.dto.group.form.AllIssueFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationDetailFormDTO; import com.epmet.resi.group.dto.group.form.ApplicationHistoryFormDTO; @@ -237,4 +236,9 @@ public class GovIssueOpenFeignClientFallBack implements GovIssueOpenFeignClient public Result queryIssueDetail(IssueDetailFormDTO formDTO) { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "detail", formDTO); } + + @Override + public Result> getCustomerCategoryDict(CustomerCategoryDTO customerCategoryDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "getCustomerCategoryDict", customerCategoryDTO); + } } diff --git a/epmet-module/gov-issue/gov-issue-server/pom.xml b/epmet-module/gov-issue/gov-issue-server/pom.xml index 68e7b17d5b..673a33aeb9 100644 --- a/epmet-module/gov-issue/gov-issue-server/pom.xml +++ b/epmet-module/gov-issue/gov-issue-server/pom.xml @@ -96,6 +96,12 @@ 2.0.0 compile + + com.epmet + data-report-client + 2.0.0 + compile + @@ -270,4 +276,4 @@ - \ No newline at end of file + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java index b0d5a7fd1f..cbd7c63190 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/controller/IssueProjectCategoryDictController.java @@ -34,6 +34,8 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO; import com.epmet.dto.result.CustomerCategoryListResultDTO; import com.epmet.dto.result.ProjectIssueCategoryResultDTO; import com.epmet.excel.IssueProjectCategoryDictExcel; +import com.epmet.project.dto.CustomerCategoryDTO; +import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import com.epmet.service.IssueProjectCategoryDictService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -166,4 +168,19 @@ public class IssueProjectCategoryDictController { return new Result().ok(issueProjectCategoryDictService.delCategory(formDTO)); } -} \ No newline at end of file + /** + * 获取客户 分类字典 信息 + * + * @param dto + * pid = 0 查询一级分类 + * pid != 0 查询二级分类 + * @return com.epmet.commons.tools.utils.Result> + * @Author zhangyong + * @Date 14:10 2021-03-22 + **/ + @PostMapping("getcustomercategorydict") + public Result> getCustomerCategoryDict(@RequestBody CustomerCategoryDTO dto){ + return new Result>().ok(issueProjectCategoryDictService.listCategoryDict(dto.getCustomerId(), + dto.getPid())); + } +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java index 770c10cb99..1524bc1fc0 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueProjectCategoryDictDao.java @@ -22,6 +22,7 @@ import com.epmet.dto.IssueProjectCategoryDictDTO; import com.epmet.dto.form.IssueProjectCategoryDictListFormDTO; import com.epmet.dto.result.CustomerCategoryListResultDTO; import com.epmet.entity.IssueProjectCategoryDictEntity; +import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -73,4 +74,17 @@ public interface IssueProjectCategoryDictDao extends BaseDao + * @Author zhangyong + * @Date 14:10 2021-03-22 + **/ + List selectListCategoryDict(@Param("customerId") String customerId, @Param("pid") String pid); +} diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java index 9de4150e08..24e824ffff 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/IssueProjectCategoryDictService.java @@ -26,6 +26,7 @@ import com.epmet.dto.form.ProjectSaveCategoryFormDTO; import com.epmet.dto.result.CustomerCategoryListResultDTO; import com.epmet.dto.result.ProjectIssueCategoryResultDTO; import com.epmet.entity.IssueProjectCategoryDictEntity; +import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import java.util.List; import java.util.Map; @@ -142,4 +143,17 @@ public interface IssueProjectCategoryDictService extends BaseService + * @Author zhangyong + * @Date 14:10 2021-03-22 + **/ + List listCategoryDict(String customerId, String pid); +} 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 c77651b103..c154a5f7e2 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 @@ -38,6 +38,7 @@ import com.epmet.dto.result.ProjectIssueCategoryResultDTO; import com.epmet.dto.result.ProjectIssueDTOResultDTO; import com.epmet.entity.IssueProjectCategoryDictEntity; import com.epmet.entity.IssueProjectTagDictEntity; +import com.epmet.project.dto.result.ProjectCategoryDictResultDTO; import com.epmet.redis.IssueProjectCategoryDictRedis; import com.epmet.service.IssueProjectCategoryDictService; import com.epmet.service.IssueProjectTagDictService; @@ -221,4 +222,8 @@ public class IssueProjectCategoryDictServiceImpl extends BaseServiceImpl listCategoryDict(String customerId, String pid) { + return baseDao.selectListCategoryDict(customerId, pid); + } +} 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 096d54422a..5054069566 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 @@ -96,4 +96,21 @@ LIMIT 1 - \ No newline at end of file + + + diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java index 0f4313dfad..04508ac6df 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/OperCrmOpenFeignClient.java @@ -122,4 +122,15 @@ public interface OperCrmOpenFeignClient { **/ @GetMapping("/oper/crm/customer/getallsubcustomerids/{customerId}") Result> getAllSubCustomerIds(@PathVariable("customerId") String customerId); + + /** + * 获取外部客户,的父级 客户id + * + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:57 2021-03-22 + **/ + @GetMapping("/oper/crm/customer/getexternalandparentcustomerid/{customerId}") + Result getExternalAndParentCustomerId(@PathVariable("customerId") String customerId); } diff --git a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java index 5de09ce167..b718517d4b 100644 --- a/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java +++ b/epmet-module/oper-crm/oper-crm-client/src/main/java/com/epmet/feign/fallback/OperCrmOpenFeignClientFallback.java @@ -95,4 +95,9 @@ public class OperCrmOpenFeignClientFallback implements OperCrmOpenFeignClient { public Result> getAllSubCustomerIds(String customerId) { return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getAllSubCustomerIds", customerId); } + + @Override + public Result getExternalAndParentCustomerId(String customerId) { + return ModuleUtils.feignConError(ServiceConstant.OPER_CRM_SERVER, "getExternalAndParentCustomerId", customerId); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java index c5330a9abd..30fe309079 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/controller/CustomerController.java @@ -376,4 +376,21 @@ public class CustomerController { } return new Result<>(); } + + /** + * 获取外部客户,的父级 客户id + * + * @param customerId + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 14:57 2021-03-22 + **/ + @GetMapping("getexternalandparentcustomerid/{customerId}") + public Result getExternalAndParentCustomerId(@PathVariable("customerId") String customerId){ + if(StringUtils.isNotBlank(customerId)){ + String resultDTO = customerService.getExternalAndParentCustomerId(customerId); + return new Result().ok(resultDTO); + } + return new Result<>(); + } } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java index b7aed8f55a..02ae9d9890 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/dao/CustomerDao.java @@ -48,7 +48,7 @@ public interface CustomerDao extends BaseDao { * @param customerIdList * @Author yinzuomei * @Description 根据客户id查询客户信息 - * @Date 2020/4/24 9:21 + * @Date 2020/4/24 9:21 **/ List selectListByIds(@Param("customerIdList") List customerIdList); @@ -98,4 +98,13 @@ public interface CustomerDao extends BaseDao { */ List selectAllCustomerList(@Param("customerName") String customerName); + /** + * 获取外部客户,的父级 客户id + * + * @param customerId + * @return java.lang.String + * @Author zhangyong + * @Date 14:57 2021-03-22 + **/ + String getExternalAndParentCustomerId(@Param("customerId") String customerId); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java index 82e872e511..f1efa2d087 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/CustomerService.java @@ -226,4 +226,14 @@ public interface CustomerService extends BaseService { * @Date 2021/2/3 12:52 **/ CustomerRelationInfoResultDTO queryCustomerInfoByCustomerId(String customerId); + + /** + * 获取外部客户,的父级 客户id + * + * @param customerId + * @return java.lang.String + * @Author zhangyong + * @Date 14:57 2021-03-22 + **/ + String getExternalAndParentCustomerId(String customerId); } diff --git a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java index 1fadbd8443..c2677c0504 100644 --- a/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java +++ b/epmet-module/oper-crm/oper-crm-server/src/main/java/com/epmet/service/impl/CustomerServiceImpl.java @@ -785,4 +785,8 @@ public class CustomerServiceImpl extends BaseServiceImpl + + From 57888660664522e35eda80903a548170044d3f6d Mon Sep 17 00:00:00 2001 From: zhangyongzhangyong <2012005003@qq.coom> Date: Mon, 22 Mar 2021 16:40:37 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=88=86=E7=B1=BB?= =?UTF-8?q?=E5=AD=97=E5=85=B8=E4=B8=8A=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/screen/CategoryDictDataFormDTO.java | 27 +++++++ .../dto/screen/form/CategoryDictFormDTO.java | 72 +++++++++++++++++++ .../ScreenProjectDataCollController.java | 25 +++++-- .../stats/CustomerProjectCategoryDictDao.java | 26 ++++++- .../CustomerProjectCategoryDictService.java | 15 +++- ...ustomerProjectCategoryDictServiceImpl.java | 19 ++++- .../stats/CustomerProjectCategoryDictDao.xml | 56 ++++++++++++++- 7 files changed, 231 insertions(+), 9 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/CategoryDictDataFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CategoryDictFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/CategoryDictDataFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/CategoryDictDataFormDTO.java new file mode 100644 index 0000000000..bd88161f54 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/CategoryDictDataFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.screen; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import com.epmet.dto.screen.form.CategoryDictFormDTO; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.util.List; + +/** + * 项目分类字典上报 + * @Auther: zhangyong + * @Date: 2021-03-22 + */ +@Data +public class CategoryDictDataFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 当isFirst=true时,直接根据 customerId 删除原有数据,再批量insert。 + */ + private Boolean isFirst; + + private List dataList; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CategoryDictFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CategoryDictFormDTO.java new file mode 100644 index 0000000000..f60c33faa4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/CategoryDictFormDTO.java @@ -0,0 +1,72 @@ +package com.epmet.dto.screen.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * 项目分类字典上报 + * @Auther: zhangyong + * @Date: 2021-03-22 + */ +@Data +public class CategoryDictFormDTO implements Serializable { + + private static final long serialVersionUID = 1L; + +// public interface ExtractDailyForm extends CustomerClientShowGroup {} + + /** + * 客户内自己的分类编码 + */ +// @NotBlank(message = "客户分类编码不能为空", groups = { ExtractDailyForm.class }) + private String categoryCode; + + /** + * 客户内自己的分类名称 + */ +// @NotBlank(message = "客户分类名称不能为空", groups = { ExtractDailyForm.class }) + private String categoryName; + + /** + * 父类分类编码,如果是一级分类,此列赋值为0 + */ +// @NotBlank(message = "父类分类编码不能为空", groups = { ExtractDailyForm.class }) + private String parentCategoryCode; + + /** + * 分类等级:1、2....; + */ +// @NotBlank(message = "分类等级不能为空", groups = { ExtractDailyForm.class }) + private Integer level; + + /** + * 排序 + */ +// @NotBlank(message = "排序不能为空", groups = { ExtractDailyForm.class }) + private Integer sort; + + /** + * 当前分类对应产品内的分类编码,如果对应不上,此列传空 + */ + private String epmetCategoryCode; + + /** + * 原始创建时间yyyy-MM-dd HH:mm:ss + */ + private String originCreatedTime; + + /** + * 原始更新时间yyyy-MM-dd HH:mm:ss + */ + private String orginUpdatedTime; + + /** + * 分类字典表主键 + */ +// @NotBlank(message = "分类字典表主键不能为空", groups = { ExtractDailyForm.class }) + private String categoryId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java index 0af70355e9..d51ca41f31 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -3,16 +3,15 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screen.*; +import com.epmet.dto.screen.form.CategoryDictFormDTO; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.service.evaluationindex.screen.*; +import com.epmet.service.stats.CustomerProjectCategoryDictService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * @Description 事件/项目采集接口入口 @@ -41,7 +40,8 @@ public class ScreenProjectDataCollController { private ScreenProjectDataService projectDataService; @Autowired private ScreenProjectProcessService projectProcessService; - + @Autowired + private CustomerProjectCategoryDictService customerProjectCategoryDictService; /** * @author wangc * @description 【事件/项目分析】网格内月度数量统计 @@ -152,4 +152,19 @@ public class ScreenProjectDataCollController { return new Result(); } + /** + * 项目分类字典上报 + * 目标表:epmet_evaluation_index库的customer_project_category_dict + * + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author zhangyong + * @Date 16:03 2021-03-22 + **/ + @PostMapping("uploadcategorydict") + public Result uploadcategorydict(@RequestHeader("CustomerId") String customerId, @RequestBody CategoryDictDataFormDTO formDTO) { + customerProjectCategoryDictService.uploadCategoryDict(customerId, formDTO); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java index fd0cdd6eb2..3489fc5917 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/CustomerProjectCategoryDictDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.form.CategoryDictFormDTO; import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 客户项目分类字典表 * @@ -36,4 +39,25 @@ public interface CustomerProjectCategoryDictDao extends BaseDao list, @Param("customerId")String customerId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java index 36861d7b35..1b37c9448a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/CustomerProjectCategoryDictService.java @@ -18,6 +18,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.screen.CategoryDictDataFormDTO; import com.epmet.entity.issue.IssueProjectCategoryDictEntity; import com.epmet.entity.stats.CustomerProjectCategoryDictEntity; @@ -42,4 +43,16 @@ public interface CustomerProjectCategoryDictService extends BaseService NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(formDTO.getDataList())) { + baseDao.batchInsertCustomerProjectCategoryDict(formDTO.getDataList(), customerId); + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml index 63b47e4456..2802dc7625 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/CustomerProjectCategoryDictDao.xml @@ -38,4 +38,58 @@ and m.customer_id=#{customerId} and m.CATEGORY_ID=#{categoryId} - \ No newline at end of file + + + delete from customer_project_category_dict + where CUSTOMER_ID = #{customerId} + limit 1000; + + + + insert into customer_project_category_dict + ( + ID, + CUSTOMER_ID, + CUSTOMER_TYPE, + CATEGORY_CODE, + CATEGORY_NAME, + PARENT_CATEGORY_CODE, + `LEVEL`, + SORT, + IS_DISABLE, + EPMET_CATEGORY_CODE, + ORIGIN_CREATED_TIME, + ORIGIN_UPDATED_TIME, + CATEGORY_ID, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{customerId}, + 'external', + #{item.categoryCode}, + #{item.categoryName}, + #{item.parentCategoryCode}, + #{item.level}, + #{item.sort}, + 'enable', + #{item.epmetCategoryCode}, + #{item.originCreatedTime}, + #{item.orginUpdatedTime}, + #{item.categoryId}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + +