From a3657d869a147cbf1b27b6c28c25ea99de8b46e6 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 12 Sep 2020 09:41:33 +0800 Subject: [PATCH 01/27] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=8E=AF=E5=A2=83?= =?UTF-8?q?=E5=8F=98=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/epmet-common-service/common-service-server/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/epmet-common-service/common-service-server/pom.xml b/epmet-module/epmet-common-service/common-service-server/pom.xml index a81498d9a8..b22388767b 100644 --- a/epmet-module/epmet-common-service/common-service-server/pom.xml +++ b/epmet-module/epmet-common-service/common-service-server/pom.xml @@ -178,7 +178,7 @@ --> 8103 - dev + test From 7d8f9497e645722731281f6727f7be078f140017 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 14 Sep 2020 17:57:01 +0800 Subject: [PATCH 02/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E4=B8=BB=E9=99=84?= =?UTF-8?q?=E8=A1=A8=E7=9B=B8=E5=BA=94=E6=96=87=E4=BB=B6=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginIssueLogDailyDTO.java | 136 ++++++++++++++++ .../extract/FactOriginIssueMainDailyDTO.java | 151 ++++++++++++++++++ .../extract/form/IssueLogDailyFormDTO.java | 107 +++++++++++++ .../extract/form/IssueMainDailyFormDTO.java | 107 +++++++++++++ .../extract/FactOriginIssueLogDailyDao.java | 45 ++++++ .../extract/FactOriginIssueMainDailyDao.java | 46 ++++++ .../FactOriginIssueLogDailyEntity.java | 106 ++++++++++++ .../FactOriginIssueMainDailyEntity.java | 121 ++++++++++++++ .../extract/IssueExtractService.java | 8 + .../extract/impl/IssueExtractServiceImpl.java | 17 ++ .../extract/FactOriginIssueLogDailyDao.xml | 39 +++++ .../extract/FactOriginIssueMainDailyDao.xml | 35 ++++ 12 files changed, 918 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java new file mode 100644 index 0000000000..cff1116f7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题记录附表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class FactOriginIssueLogDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织上级ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 党员 热心居民 居民 + */ + private String userIdentity; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java new file mode 100644 index 0000000000..d9616a373b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java @@ -0,0 +1,151 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题主表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Data +public class FactOriginIssueMainDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * id + */ + private String id; + + /** + * 日ID(指议题创建的yyyymmdd) + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户身份标识 + */ + private String userIdentity; + + /** + * 转议题用户ID + */ + private String userId; + + /** + * 创建话题用户的ID + */ + private String createTopicUserId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 议题网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + /** + * 议题组织ID(网格所属组织ID) + */ + private String agencyId; + + /** + * 议题状态 + */ + private String issueStatus; + + /** + * 创建话题用户身份标识 + */ + private String topicUserIdentity; + + /** + * 删除状态,0:正常,1:删除 + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java new file mode 100644 index 0000000000..772df16bd8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java @@ -0,0 +1,107 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:42 下午 + */ +@Data +public class IssueLogDailyFormDTO implements Serializable { + + private static final long serialVersionUID = 7036617958351476594L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织上级ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 党员 热心居民 居民 + */ + private String userIdentity; + + /** + * 是否已删除(0-未删除,1-已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者 + */ + private String createdBy; + + /** + * 修改者 + */ + private String updatedBy; + + public IssueLogDailyFormDTO() { + this.delFlag = delFlag = 0; + this.revision = revision = 0; + this.createdBy = createdBy = "APP_USER"; + this.updatedBy = updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java new file mode 100644 index 0000000000..d96e7b3f2e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java @@ -0,0 +1,107 @@ +package com.epmet.dto.extract.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:47 下午 + */ +@Data +public class IssueMainDailyFormDTO implements Serializable { + + private static final long serialVersionUID = -5288003778076157611L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织上级ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 党员 热心居民 居民 + */ + private String userIdentity; + + /** + * 是否已删除(0-未删除,1-已删除) + */ + private Integer delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建者 + */ + private String createdBy; + + /** + * 修改者 + */ + private String updatedBy; + + public IssueMainDailyFormDTO() { + this.delFlag = delFlag = 0; + this.revision = revision = 0; + this.createdBy = createdBy = "APP_USER"; + this.updatedBy = updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java new file mode 100644 index 0000000000..eee5e51287 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.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.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.IssueLogDailyFormDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueLogDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题记录附表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Mapper +public interface FactOriginIssueLogDailyDao extends BaseDao { + + /** + * @Description 议题记录附表插入 + * @param issueLogList + * @author zxc + * @date 2020/9/14 5:53 下午 + */ + void insertIssueLogList(@Param("issueLogList")List issueLogList); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java new file mode 100644 index 0000000000..4a147fb807 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -0,0 +1,46 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.form.IssueLogDailyFormDTO; +import com.epmet.dto.extract.form.IssueMainDailyFormDTO; +import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 议题主表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-14 + */ +@Mapper +public interface FactOriginIssueMainDailyDao extends BaseDao { + + /** + * @Description 议题主表插入 + * @param issueMainList + * @author zxc + * @date 2020/9/14 5:53 下午 + */ + void insertIssueMainList(@Param("issueMainList") List issueMainList); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java new file mode 100644 index 0000000000..51f4e58c3a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueLogDailyEntity.java @@ -0,0 +1,106 @@ +/** + * 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.evaluationindex.extract; + +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 2020-09-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_issue_log_daily") +public class FactOriginIssueLogDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织上级ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 操作用户ID + */ + private String operationUserId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 党员 热心居民 居民 + */ + private String userIdentity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java new file mode 100644 index 0000000000..a64aec4525 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginIssueMainDailyEntity.java @@ -0,0 +1,121 @@ +/** + * 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.evaluationindex.extract; + +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 2020-09-14 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_issue_main_daily") +public class FactOriginIssueMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 日ID(指议题创建的yyyymmdd) + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 用户身份标识 + */ + private String userIdentity; + + /** + * 转议题用户ID + */ + private String userId; + + /** + * 创建话题用户的ID + */ + private String createTopicUserId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 议题网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + /** + * 议题组织ID(网格所属组织ID) + */ + private String agencyId; + + /** + * 议题状态 + */ + private String issueStatus; + + /** + * 创建话题用户身份标识 + */ + private String topicUserIdentity; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java new file mode 100644 index 0000000000..9a257fbe6d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -0,0 +1,8 @@ +package com.epmet.service.evaluationindex.extract; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:07 下午 + */ +public interface IssueExtractService { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java new file mode 100644 index 0000000000..5d3c3d6eac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -0,0 +1,17 @@ +package com.epmet.service.evaluationindex.extract.impl; + +import com.epmet.service.evaluationindex.extract.IssueExtractService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/9/14 5:08 下午 + */ +@Service +@Slf4j +public class IssueExtractServiceImpl implements IssueExtractService { + + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml new file mode 100644 index 0000000000..58e9202e70 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -0,0 +1,39 @@ + + + + + + + + INSERT INTO fact_origin_issue_log_daily ( ID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, CUSTOMER_ID, USER_IDENTITY, USER_ID, CREATE_TOPIC_USER_ID, ISSUE_ID, TOPIC_ID, GRID_ID, + PID, AGENCY_ID, ISSUE_STATUS, TOPIC_USER_IDENTITY, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.customerId}, + #{item.userIdentity}, + #{item.userId}, + #{item.createTopicUserId}, + #{item.issueId}, + #{item.topicId}, + #{item.gridId}, + #{item.pid}, + #{item.agencyId}, + #{item.issueStatus}, + #{item.topicUserIdentity}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml new file mode 100644 index 0000000000..c467a9d5f9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -0,0 +1,35 @@ + + + + + + + + INSERT INTO fact_origin_issue_main_daily(ID, CUSTOMER_ID, GRID_ID, PID, AGENCY_ID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, ISSUE_ID, OPERATION_USER_ID, ACTION_CODE, USER_IDENTITY, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.gridId}, + #{item.pid}, + #{item.agencyId}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.issueId}, + #{item.operationUserId}, + #{item.actionCode}, + #{item.userIdentity}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + \ No newline at end of file From b19799bab77e42d8c964577c4f2d1ce8ca11e951 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Sep 2020 10:02:29 +0800 Subject: [PATCH 03/27] =?UTF-8?q?dim=5Fobject=5Faction,dim=5Fobject=5Fstat?= =?UTF-8?q?us=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/extract/DimObjectActionDTO.java | 91 +++++++++++++++++++ .../epmet/dto/extract/DimObjectStatusDTO.java | 86 ++++++++++++++++++ .../extract/DimObjectActionDao.java | 33 +++++++ .../extract/DimObjectStatusDao.java | 33 +++++++ .../extract/DimObjectActionEntity.java | 61 +++++++++++++ .../extract/DimObjectStatusEntity.java | 56 ++++++++++++ .../extract/DimObjectActionDao.xml | 7 ++ .../extract/DimObjectStatusDao.xml | 8 ++ 8 files changed, 375 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java new file mode 100644 index 0000000000..fc179c63e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectActionDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 对象行为动作维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +public class DimObjectActionDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 行为code + */ + private String actionCode; + + /** + * 行为描述 + */ + private String actionDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String actionType; + + /** + * 父级ID(本表id) + */ + private String pid; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java new file mode 100644 index 0000000000..28128a83ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/DimObjectStatusDTO.java @@ -0,0 +1,86 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.extract; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 对象行为状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Data +public class DimObjectStatusDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 行为code + */ + private String statusCode; + + /** + * 行为描述 + */ + private String statusDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String statusType; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.java new file mode 100644 index 0000000000..090c9b9488 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectActionDao.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.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.DimObjectActionEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 对象行为动作维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface DimObjectActionDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.java new file mode 100644 index 0000000000..012d6a15a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/DimObjectStatusDao.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.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.DimObjectStatusEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 对象行为状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface DimObjectStatusDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java new file mode 100644 index 0000000000..2cf22199a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectActionEntity.java @@ -0,0 +1,61 @@ +/** + * 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.evaluationindex.extract; + +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 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_object_action") +public class DimObjectActionEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 行为code + */ + private String actionCode; + + /** + * 行为描述 + */ + private String actionDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String actionType; + + /** + * 父级ID(本表id) + */ + private String pid; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java new file mode 100644 index 0000000000..121ff1a40e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/DimObjectStatusEntity.java @@ -0,0 +1,56 @@ +/** + * 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.evaluationindex.extract; + +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 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_object_status") +public class DimObjectStatusEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 行为code + */ + private String statusCode; + + /** + * 行为描述 + */ + private String statusDesc; + + /** + * 行为类型 topic,issue,project,article,group + */ + private String statusType; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml new file mode 100644 index 0000000000..1190fcb7d4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectActionDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml new file mode 100644 index 0000000000..e29c6c19f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/DimObjectStatusDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 9ec9bedc052362311e1b912fe5c8db366000ce52 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Sep 2020 11:09:41 +0800 Subject: [PATCH 04/27] =?UTF-8?q?=E6=96=B0=E5=A2=9Efactorigin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/controller/FactOriginController.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java new file mode 100644 index 0000000000..a8babf8e8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -0,0 +1,15 @@ +package com.epmet.controller; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 原始数据清洗 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/15 11:06 + */ +@RestController +@RequestMapping("factorigin") +public class FactOriginController { +} From 034ca215ca890c770889a4bf37038d46f323d39a Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Sep 2020 12:04:04 +0800 Subject: [PATCH 05/27] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/FactOriginTopicLogDailyDao.java | 33 +++++ .../extract/FactOriginTopicMainDailyDao.java | 33 +++++ .../FactOriginTopicLogDailyEntity.java | 121 ++++++++++++++++++ .../FactOriginTopicMainDailyEntity.java | 106 +++++++++++++++ .../extract/FactOriginTopicLogDailyDao.xml | 7 + .../extract/FactOriginTopicMainDailyDao.xml | 8 ++ 6 files changed, 308 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java new file mode 100644 index 0000000000..60f1ddb2a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.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.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface FactOriginTopicLogDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java new file mode 100644 index 0000000000..980560c32e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.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.evaluationindex.extract; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Mapper +public interface FactOriginTopicMainDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java new file mode 100644 index 0000000000..9e67eeec59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java @@ -0,0 +1,121 @@ +/** + * 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.evaluationindex.extract; + +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 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_topic_log_daily") +public class FactOriginTopicLogDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属的网格ID + */ + private String gridId; + + /** + * 网格所属上级组织ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 业务的发生时间 格式:日期ID + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 话题id + */ + private String topicId; + + /** + * 话题所属小组id + */ + private String groupId; + + /** + * 话题状态 来自dim_object_status表 + */ + private String topicStatus; + + /** + * 行为code 来自dim_object_action表 + */ + private String actionCode; + + /** + * 本条数据操作用户Id + */ + private String operateUserId; + + /** + * 本条数据操作用户是否是党员, 1是0不是 + */ + private String operateUserIsParty; + + /** + * 原始业务发生时间 + */ + private Date originalBusinessTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java new file mode 100644 index 0000000000..92b03d933e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java @@ -0,0 +1,106 @@ +/** + * 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.evaluationindex.extract; + +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 2020-09-15 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_origin_topic_main_daily") +public class FactOriginTopicMainDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 话题所属的网格ID + */ + private String gridId; + + /** + * 所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 话题的发布日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 话题所属小组id + */ + private String groupId; + + /** + * 话题状态 来自dim_object_status表 + */ + private String topicStatus; + + /** + * 话题发布人id + */ + private String createTopicUserId; + + /** + * 话题发布人是否是党员:1是党员0不是。 默认0 + */ + private Integer createTopicUserIsParty; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml new file mode 100644 index 0000000000..3c92cd5651 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml new file mode 100644 index 0000000000..29e2e075f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From a7fa19bf69e15475c31ccd477b7f3ecb10656a9f Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Sep 2020 14:19:58 +0800 Subject: [PATCH 06/27] topicDataCleaning --- .../controller/FactOriginController.java | 26 +++++++++++++ .../FactOriginTopicLogDailyService.java | 35 ++++++++++++++++++ .../FactOriginTopicMainDailyService.java | 32 ++++++++++++++++ .../FactOriginTopicLogDailyServiceImpl.java | 36 ++++++++++++++++++ .../FactOriginTopicMainDailyServiceImpl.java | 37 +++++++++++++++++++ .../com/epmet/service/topic/TopicService.java | 9 +++++ .../service/topic/impl/TopicServiceImpl.java | 12 ++++++ 7 files changed, 187 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index a8babf8e8b..bfb0155e98 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -1,8 +1,14 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.topic.TopicService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + /** * 原始数据清洗 * @@ -12,4 +18,24 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("factorigin") public class FactOriginController { + + @Autowired + private TopicService topicService; + + /** + * @param customerId yyyyMMdd + * @param dateId yyyyMMdd + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 话题 (fact_origin_topic_main_daily 话题主表_日统计 fact_origin_topic_log_daily 话题明细_日统计) + * @Date 2020/9/15 13:39 + **/ + @PostMapping("topic") + public Result topicDataCleaning(String customerId, String dateId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { + topicService.topicDataCleaning(customerId, dateId); + } + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.java new file mode 100644 index 0000000000..76c118972b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicLogDailyService.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.evaluationindex.extract; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +public interface FactOriginTopicLogDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java new file mode 100644 index 0000000000..0c96a3d682 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java @@ -0,0 +1,32 @@ +/** + * 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.evaluationindex.extract; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; + + +/** + * 话题主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +public interface FactOriginTopicMainDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java new file mode 100644 index 0000000000..b95bc36cb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicLogDailyServiceImpl.java @@ -0,0 +1,36 @@ +/** + * 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.evaluationindex.extract.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactOriginTopicLogDailyDao; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; +import com.epmet.service.evaluationindex.extract.FactOriginTopicLogDailyService; +import org.springframework.stereotype.Service; + +/** + * 话题明细_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Service +public class FactOriginTopicLogDailyServiceImpl extends BaseServiceImpl implements FactOriginTopicLogDailyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java new file mode 100644 index 0000000000..26b71e08d0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.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.evaluationindex.extract.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao; +import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; +import org.springframework.stereotype.Service; + + +/** + * 话题主表_日统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-15 + */ +@Service +public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl implements FactOriginTopicMainDailyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index a83bc3a5c0..a14dc274ce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -25,4 +25,13 @@ public interface TopicService { **/ TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension); + /** + * @return void + * @param customerId 客户id + * @param dateId yyyyMMdd + * @author yinzuomei + * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 + * @Date 2020/9/15 13:40 + **/ + void topicDataCleaning(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 0bc3aacd65..18db52ef4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -1252,4 +1252,16 @@ public class TopicServiceImpl implements TopicService { } + /** + * @param customerId 客户id + * @param dateId yyyyMMdd + * @return void + * @author yinzuomei + * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 + * @Date 2020/9/15 13:40 + **/ + @Override + public void topicDataCleaning(String customerId, String dateId) { + //TODO + } } From f385d21df9e0f15218c3e4da5bf63f5d3f0ec013 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Tue, 15 Sep 2020 18:07:52 +0800 Subject: [PATCH 07/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E4=B8=BB=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E5=85=AC=E5=85=B1=E6=96=B9=E6=B3=95=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=20=E6=A0=B9=E6=8D=AEdateId=E8=8E=B7=E5=8F=96=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E9=9B=86=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/dto/form/TimeListResultDTO.java | 21 ++++ .../epmet/commons/tools/utils/DateUtils.java | 20 ++++ .../extract/FactOriginIssueLogDailyDTO.java | 40 ++++---- .../extract/FactOriginIssueMainDailyDTO.java | 57 +++++------ .../dto/extract/form/IssueInfoFormDTO.java | 33 +++++++ .../extract/form/IssueLogDailyFormDTO.java | 12 +-- .../extract/form/IssueMainDailyFormDTO.java | 74 ++++++++------ .../extract/result/IssueInfoResultDTO.java | 50 ++++++++++ .../extract/result/TopicInfoResultDTO.java | 21 ++++ .../extract/result/UserPartyResultDTO.java | 19 ++++ .../controller/FactOriginController.java | 16 +++ .../extract/FactOriginIssueMainDailyDao.java | 2 - .../com/epmet/dao/issue/StatsIssueDao.java | 2 + .../java/com/epmet/dao/topic/TopicDao.java | 9 ++ .../main/java/com/epmet/dao/user/UserDao.java | 9 ++ .../com/epmet/service/Issue/IssueService.java | 10 ++ .../service/Issue/impl/IssueServiceImpl.java | 13 +++ .../extract/IssueExtractService.java | 10 ++ .../extract/impl/IssueExtractServiceImpl.java | 97 +++++++++++++++++++ .../com/epmet/service/topic/TopicService.java | 9 ++ .../service/topic/impl/TopicServiceImpl.java | 12 +++ .../com/epmet/service/user/UserService.java | 8 ++ .../service/user/impl/UserServiceImpl.java | 28 ++++++ .../resources/mapper/issue/StatsIssueDao.xml | 17 ++++ .../main/resources/mapper/topic/TopicDao.xml | 17 ++++ .../main/resources/mapper/user/UserDao.xml | 16 +++ 26 files changed, 537 insertions(+), 85 deletions(-) create mode 100644 epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java new file mode 100644 index 0000000000..89aed6547c --- /dev/null +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/dto/form/TimeListResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.commons.tools.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 5:41 下午 + */ +@Data +public class TimeListResultDTO implements Serializable { + + private static final long serialVersionUID = 1482639109300981626L; + + private String dateId; + private String weekId; + private String monthId; + private String quarterId; + private String yearId; +} diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java index 75174f4216..37abbb5878 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/utils/DateUtils.java @@ -10,6 +10,7 @@ package com.epmet.commons.tools.utils; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; +import com.epmet.commons.tools.dto.form.TimeListResultDTO; import org.apache.commons.lang3.StringUtils; import org.joda.time.DateTime; import org.joda.time.LocalDate; @@ -593,4 +594,23 @@ public class DateUtils { } return StrConstant.EPMETY_STR; } + + public static TimeListResultDTO getTimeList(String dateId){ + TimeListResultDTO result = new TimeListResultDTO(); + result.setDateId(dateId); + String monthId = dateId.substring(NumConstant.ZERO, NumConstant.SIX); + result.setMonthId(monthId); + result.setQuarterId(getQuarterId(monthId)); + result.setYearId(getYearId(monthId)); + SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd"); + try { + Date date = formatter.parse(dateId); + int weekOfYear = getWeekOfYear(date); + String weekId = dateId.substring(NumConstant.ZERO,NumConstant.FOUR).concat("W").concat(String.valueOf(weekOfYear)); + result.setWeekId(weekId); + } catch (ParseException e) { + e.printStackTrace(); + } + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java index cff1116f7f..433f95177e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueLogDailyDTO.java @@ -36,101 +36,101 @@ public class FactOriginIssueLogDailyDTO implements Serializable { /** * id */ - private String id; + private String id; /** * 客户ID */ - private String customerId; + private String customerId; /** * 网格ID */ - private String gridId; + private String gridId; /** * 组织上级ID */ - private String pid; + private String pid; /** * 机关ID */ - private String agencyId; + private String agencyId; /** * 日期ID */ - private String dateId; + private String dateId; /** * 周ID */ - private String weekId; + private String weekId; /** * 月份ID */ - private String monthId; + private String monthId; /** * 季度ID */ - private String quarterId; + private String quarterId; /** * 年度ID */ - private String yearId; + private String yearId; /** * 议题ID */ - private String issueId; + private String issueId; /** * 操作用户ID */ - private String operationUserId; + private String operationUserId; /** * 动作CODE */ - private String actionCode; + private String actionCode; /** * 党员 热心居民 居民 */ - private String userIdentity; + private Integer isParty; /** * 删除状态,0:正常,1:删除 */ - private Integer delFlag; + private Integer delFlag; /** * 乐观锁 */ - private Integer revision; + private Integer revision; /** * 创建人 */ - private String createdBy; + private String createdBy; /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java index d9616a373b..a77815e3ea 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/FactOriginIssueMainDailyDTO.java @@ -34,118 +34,119 @@ public class FactOriginIssueMainDailyDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * id + * 议题ID */ - private String id; + private String id; /** * 日ID(指议题创建的yyyymmdd) */ - private String dateId; + private String dateId; /** * 周ID */ - private String weekId; + private String weekId; /** * 月份ID */ - private String monthId; + private String monthId; /** * 季度ID */ - private String quarterId; + private String quarterId; /** * 年度ID */ - private String yearId; + private String yearId; /** * 客户ID */ - private String customerId; + private String customerId; /** * 用户身份标识 */ - private String userIdentity; + private Integer isParty; /** * 转议题用户ID */ - private String userId; + private String userId; /** * 创建话题用户的ID */ - private String createTopicUserId; - - /** - * 议题ID - */ - private String issueId; + private String createTopicUserId; /** * 转为议题的话题ID */ - private String topicId; + private String topicId; /** * 议题网格ID */ - private String gridId; + private String gridId; /** * 上级ID */ - private String pid; + private String pid; /** * 议题组织ID(网格所属组织ID) */ - private String agencyId; + private String agencyId; /** * 议题状态 */ - private String issueStatus; + private String issueStatus; /** * 创建话题用户身份标识 */ - private String topicUserIdentity; + private Integer topicUserIsParty; /** * 删除状态,0:正常,1:删除 */ - private Integer delFlag; + private Integer delFlag; /** * 乐观锁 */ - private Integer revision; + private Integer revision; /** * 创建人 */ - private String createdBy; + private String createdBy; /** * 创建时间 */ - private Date createdTime; + private Date createdTime; /** * 更新人 */ - private String updatedBy; + private String updatedBy; /** * 更新时间 */ - private Date updatedTime; + private Date updatedTime; + public FactOriginIssueMainDailyDTO() { + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java new file mode 100644 index 0000000000..7ab1f8d280 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueInfoFormDTO.java @@ -0,0 +1,33 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.AllArgsConstructor; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 2:23 下午 + */ +@Data +@AllArgsConstructor +public class IssueInfoFormDTO implements Serializable { + + private static final long serialVersionUID = 8805754438522195653L; + + public interface IssueInfo extends CustomerClientShowGroup{} + + /** + * 客户ID + */ + @NotBlank(message = "customerId",groups = IssueInfo.class) + private String customerId; + + /** + * 日期ID(实际为议题创建的 "yyyymmdd" ) + */ + @NotBlank(message = "dateId",groups = IssueInfo.class) + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java index 772df16bd8..5b54d4c289 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java @@ -13,6 +13,11 @@ public class IssueLogDailyFormDTO implements Serializable { private static final long serialVersionUID = 7036617958351476594L; + /** + * 议题ID + */ + private String id; + /** * 客户ID */ @@ -58,11 +63,6 @@ public class IssueLogDailyFormDTO implements Serializable { */ private String yearId; - /** - * 议题ID - */ - private String issueId; - /** * 操作用户ID */ @@ -76,7 +76,7 @@ public class IssueLogDailyFormDTO implements Serializable { /** * 党员 热心居民 居民 */ - private String userIdentity; + private Integer isParty; /** * 是否已删除(0-未删除,1-已删除) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java index d96e7b3f2e..f180014be9 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.extract.form; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * @Author zxc @@ -14,27 +15,12 @@ public class IssueMainDailyFormDTO implements Serializable { private static final long serialVersionUID = -5288003778076157611L; /** - * 客户ID - */ - private String customerId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 组织上级ID - */ - private String pid; - - /** - * 机关ID + * 议题ID */ - private String agencyId; + private String id; /** - * 日期ID + * 日ID(指议题创建的yyyymmdd) */ private String dateId; @@ -59,27 +45,57 @@ public class IssueMainDailyFormDTO implements Serializable { private String yearId; /** - * 议题ID + * 客户ID */ - private String issueId; + private String customerId; /** - * 操作用户ID + * 用户身份标识 */ - private String operationUserId; + private Integer isParty; + + /** + * 转议题用户ID + */ + private String userId; + + /** + * 创建话题用户的ID + */ + private String createTopicUserId; + + /** + * 转为议题的话题ID + */ + private String topicId; + + /** + * 议题网格ID + */ + private String gridId; + + /** + * 上级ID + */ + private String pid; + + /** + * 议题组织ID(网格所属组织ID) + */ + private String agencyId; /** - * 动作CODE + * 议题状态 */ - private String actionCode; + private String issueStatus; /** - * 党员 热心居民 居民 + * 创建话题用户身份标识 */ - private String userIdentity; + private Integer topicUserIsParty; /** - * 是否已删除(0-未删除,1-已删除) + * 删除状态,0:正常,1:删除 */ private Integer delFlag; @@ -89,12 +105,12 @@ public class IssueMainDailyFormDTO implements Serializable { private Integer revision; /** - * 创建者 + * 创建人 */ private String createdBy; /** - * 修改者 + * 更新人 */ private String updatedBy; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java new file mode 100644 index 0000000000..4dd3bcac07 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueInfoResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 2:04 下午 + */ +@Data +public class IssueInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 3097591617162404015L; + + /** + * 议题ID + */ + private String issueId; + + /** + * 议题状态 + */ + private String issueStatus; + + /** + * 话题ID + */ + private String topicId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 用户ID + */ + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java new file mode 100644 index 0000000000..4e22a2908f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/TopicInfoResultDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 4:52 下午 + */ +@Data +public class TopicInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -5902552728088278104L; + + private String topicId; + + private String userId; + + private Integer isParty; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java new file mode 100644 index 0000000000..c0011ab7c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/UserPartyResultDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 4:20 下午 + */ +@Data +public class UserPartyResultDTO implements Serializable { + + private static final long serialVersionUID = 6688297568032159824L; + + private String userId; + + private String roleName; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index bfb0155e98..d195a327ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -1,5 +1,9 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.evaluationindex.extract.IssueExtractService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; import com.epmet.commons.tools.utils.Result; import com.epmet.service.topic.TopicService; import org.apache.commons.lang3.StringUtils; @@ -19,6 +23,18 @@ import org.springframework.web.bind.annotation.RestController; @RequestMapping("factorigin") public class FactOriginController { + @Autowired + private IssueExtractService issueExtractService; + + @PostMapping("issueextract") + public Result issueExtract(){ + String customerId = "3ef7e4bb195eb9e622d68b52509aa940"; + String dateId = "20200811"; + issueExtractService.issueExtract(customerId,dateId); + return new Result(); + } + + @Autowired private TopicService topicService; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index 4a147fb807..e33f4255b1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -18,7 +18,6 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginIssueMainDailyEntity; import org.apache.ibatis.annotations.Mapper; @@ -42,5 +41,4 @@ public interface FactOriginIssueMainDailyDao extends BaseDao issueMainList); - } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index f09091487f..359d5d535d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -4,6 +4,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -112,4 +113,5 @@ public interface StatsIssueDao extends BaseDao { */ List selectIssueProjectList(@Param("customerId") String customerId); + List selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 9244b799b1..171ca82796 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -7,6 +7,7 @@ package com.epmet.dao.topic; * @since v1.0.0 2020-05-11 */ +import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -56,4 +57,12 @@ public interface TopicDao { * @date 2020.06.22 11:07 **/ List selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate); + + /** + * @Description 查询话题创建者信息 + * @param topicIds + * @author zxc + * @date 2020/9/15 4:55 下午 + */ + List selectTopicInfo(@Param("topicIds")List topicIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index d96d1787e1..9e50c2d7d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -1,5 +1,6 @@ package com.epmet.dao.user; +import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -97,4 +98,12 @@ public interface UserDao { * @date 2020.06.18 18:50 **/ Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("gridIds") Set gridIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询用户是不是党员 + * @param userIds + * @author zxc + * @date 2020/9/15 4:23 下午 + */ + List selectUserIsParty(@Param("userIds") List userIds);; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index d2a9ef721a..ea2d98a94b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -3,6 +3,7 @@ package com.epmet.service.Issue; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.entity.issue.IssueEntity; import java.util.List; @@ -109,4 +110,13 @@ public interface IssueService { * @return java.util.List */ List getIssueProjectList(String customerId); + + /** + * @Description 查询议题信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/15 2:28 下午 + */ + List selectIssueInfo(String customerId,String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index 25cd62b30a..88e82eb9f2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.dao.issue.StatsIssueDao; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; @@ -80,4 +81,16 @@ public class IssueServiceImpl implements IssueService { public List getIssueProjectList(String customerId) { return statsIssueDao.selectIssueProjectList(customerId); } + + /** + * @Description 查询议题信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/15 2:28 下午 + */ + @Override + public List selectIssueInfo(String customerId,String dateId) { + return statsIssueDao.selectIssueInfo(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java index 9a257fbe6d..8731b47e9b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -5,4 +5,14 @@ package com.epmet.service.evaluationindex.extract; * @DateTime 2020/9/14 5:07 下午 */ public interface IssueExtractService { + + /** + * @Description 议题抽取 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/15 2:02 下午 + */ + Boolean issueExtract(String customerId,String dateId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index 5d3c3d6eac..b8c01d6305 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -1,8 +1,26 @@ package com.epmet.service.evaluationindex.extract.impl; +import com.epmet.commons.tools.dto.form.TimeListResultDTO; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; +import com.epmet.dto.extract.FactOriginIssueMainDailyDTO; +import com.epmet.dto.extract.result.IssueInfoResultDTO; +import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.service.Issue.IssueService; import com.epmet.service.evaluationindex.extract.IssueExtractService; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author zxc @@ -12,6 +30,85 @@ import org.springframework.stereotype.Service; @Slf4j public class IssueExtractServiceImpl implements IssueExtractService { + @Autowired + private FactOriginIssueMainDailyDao issueMainDailyDao; + @Autowired + private IssueService issueService; + @Autowired + private UserService userService; + @Autowired + private TopicService topicService; + + /** + * @Description 议题抽取 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/15 2:02 下午 + */ + @Override + public Boolean issueExtract(String customerId, String dateId) { + + // 议题信息查询 + List listResult = issueService.selectIssueInfo(customerId, dateId); + List result = new ArrayList<>(); + if (CollectionUtils.isEmpty(listResult)){ + throw new RenException("查询议题信息为空"); + } + listResult.forEach(issue -> { + FactOriginIssueMainDailyDTO factOriginIssueMainDailyDTO = ConvertUtils.sourceToTarget(issue, FactOriginIssueMainDailyDTO.class); + factOriginIssueMainDailyDTO.setId(issue.getIssueId()); + result.add(factOriginIssueMainDailyDTO); + }); + + // 创建议题人ID + List userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); + Map map = userService.selectUserIsParty(userIds); + if (null != map){ + result.forEach(r -> { + map.forEach((userId,isParty) -> { + if (r.getUserId().equals(userId)){ + r.setIsParty(isParty); + } + }); + }); + } + + // 创建话题用户身份信息查询 + List topicIds = listResult.stream().map(issue -> issue.getTopicId()).collect(Collectors.toList()); + List topicInfoList = topicService.selectTopicInfo(topicIds); + if (CollectionUtils.isEmpty(topicInfoList)){ + throw new RenException("查询创建话题用户身份信息为空"); + } + List createTopicUserIds = topicInfoList.stream().map(topic -> topic.getUserId()).distinct().collect(Collectors.toList()); + Map topicUserIsParty = userService.selectUserIsParty(createTopicUserIds); + topicInfoList.forEach(topic -> { + topicUserIsParty.forEach((userId,isParty) -> { + if (topic.getUserId().equals(userId)){ + topic.setIsParty(isParty); + } + }); + }); + // 根据dateId赋值 + TimeListResultDTO timeList = DateUtils.getTimeList(dateId); + result.forEach(r -> { + r.setDateId(dateId); + r.setWeekId(timeList.getWeekId()); + r.setMonthId(timeList.getMonthId()); + r.setQuarterId(timeList.getQuarterId()); + r.setYearId(timeList.getYearId()); + topicInfoList.forEach(topic -> { + if (r.getTopicId().equals(topic.getTopicId())){ + r.setCreateTopicUserId(topic.getUserId()); + r.setTopicUserIsParty(topic.getIsParty()); + } + }); + }); + + + + return true; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index a14dc274ce..b7a010bbab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -1,6 +1,7 @@ package com.epmet.service.topic; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; import com.epmet.util.DimIdGenerator; @@ -34,4 +35,12 @@ public interface TopicService { * @Date 2020/9/15 13:40 **/ void topicDataCleaning(String customerId, String dateId); + /** + * @Description 查询话题创建者信息 + * @param topicIds + * @author zxc + * @date 2020/9/15 4:55 下午 + */ + List selectTopicInfo(List topicIds); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 18db52ef4e..94ed43d771 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; import com.epmet.dto.stats.topic.result.GridTopicData; @@ -94,6 +95,17 @@ public class TopicServiceImpl implements TopicService { } + /** + * @Description 查询话题创建者信息 + * @param topicIds + * @author zxc + * @date 2020/9/15 4:55 下午 + */ + @Override + public List selectTopicInfo(List topicIds) { + return topicDao.selectTopicInfo(topicIds); + } + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index cd4c70287b..60934ed2c1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -27,4 +27,12 @@ public interface UserService { * @date 2020.06.18 10:03 **/ UserStatisticalData traverseGridUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension); + + /** + * @Description 查询用户是不是党员 + * @param userIds + * @author zxc + * @date 2020/9/15 4:23 下午 + */ + Map selectUserIsParty(List userIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 3882b0d524..781b139558 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.result.UserPartyResultDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; @@ -16,11 +17,13 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** @@ -118,6 +121,31 @@ public class UserServiceImpl implements UserService { return dataPacket; } + /** + * @Description 查询用户是不是党员 + * @param userIds + * @author zxc + * @date 2020/9/15 4:23 下午 + */ + @Override + public Map selectUserIsParty(List userIds) { + List userPartyResultDTOS = userDao.selectUserIsParty(userIds); + Map result = new HashMap<>(); + if (!CollectionUtils.isEmpty(userPartyResultDTOS)){ + Map> collect = userPartyResultDTOS.stream().collect(Collectors.groupingBy(UserPartyResultDTO::getUserId)); + collect.forEach((userId,c) -> { + AtomicReference isParty = new AtomicReference<>(false); + c.forEach(user -> { + if (user.getRoleName().equals("党员")){ + isParty.set(true); + } + }); + result.put(userId,isParty.get() == true ? NumConstant.ONE : NumConstant.ZERO); + }); + } + return result; + } + /** * @Description 初始化机关-所有下级网格Map diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 2b6c50fb7f..094da63178 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -182,4 +182,21 @@ + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index c567d0c842..832302588b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -129,4 +129,21 @@ order by TOPIC_ID + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 6b796d944e..67e2ab9442 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -408,4 +408,20 @@ AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) AND erole.ROLE_NAME = '热心居民' + + + From 23fb72f96df8800f590c178bc1b9362f5738ae73 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Sep 2020 18:20:30 +0800 Subject: [PATCH 08/27] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=9A=82=E5=AD=98v0.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/topic/TopicOriginInfoDTO.java | 19 ++++++++ .../controller/FactOriginController.java | 9 ++-- .../java/com/epmet/dao/topic/TopicDao.java | 11 +++++ .../FactOriginTopicMainDailyService.java | 23 ++++++++++ .../FactOriginTopicMainDailyServiceImpl.java | 45 +++++++++++++++++++ .../com/epmet/service/topic/TopicService.java | 11 ++--- .../service/topic/impl/TopicServiceImpl.java | 18 ++++---- .../main/resources/mapper/topic/TopicDao.xml | 24 ++++++++++ 8 files changed, 144 insertions(+), 16 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java new file mode 100644 index 0000000000..932cdb4284 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java @@ -0,0 +1,19 @@ +package com.epmet.dto.topic; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 原始话题相关信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/15 18:01 + */ +@Data +public class TopicOriginInfoDTO implements Serializable { + private static final long serialVersionUID = -182136873047614269L; + + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index bfb0155e98..490735ad7d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -1,7 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.service.topic.TopicService; +import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -20,7 +20,7 @@ import org.springframework.web.bind.annotation.RestController; public class FactOriginController { @Autowired - private TopicService topicService; + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; /** * @param customerId yyyyMMdd @@ -33,9 +33,12 @@ public class FactOriginController { @PostMapping("topic") public Result topicDataCleaning(String customerId, String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { - topicService.topicDataCleaning(customerId, dateId); + factOriginTopicMainDailyService.topicCleaning(customerId,dateId); + factOriginTopicMainDailyService.topicCommentCleaning(customerId,dateId); } return new Result(); } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 9244b799b1..439723928d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -7,6 +7,7 @@ package com.epmet.dao.topic; * @since v1.0.0 2020-05-11 */ +import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import org.apache.ibatis.annotations.Mapper; @@ -56,4 +57,14 @@ public interface TopicDao { * @date 2020.06.22 11:07 **/ List selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate); + + /** + * @return java.util.List + * @param customerId + * @param dateId yyyyMMdd + * @author yinzuomei + * @description 根据日期查询resi_topic_operation,返回所有对话体的操作记录 + * @Date 2020/9/15 18:14 + **/ + List selectTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java index 0c96a3d682..1fef99bf21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java @@ -18,8 +18,11 @@ package com.epmet.service.evaluationindex.extract; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; +import java.util.List; + /** * 话题主表_日统计 @@ -29,4 +32,24 @@ import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; */ public interface FactOriginTopicMainDailyService extends BaseService { + /** + * @return void + * @param customerId 客户id + * @param dateId yyyyMMdd + * @author yinzuomei 数据采集:话题本身 + * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 + * @Date 2020/9/15 13:40 + **/ + Boolean topicCleaning(String customerId, String dateId); + + /** + * @return java.lang.Boolean + * @param customerId 客户id + * @param dateId yyyyMMdd + * @author yinzuomei + * @description 数据采集:话题的评论 + * @Date 2020/9/15 17:56 + **/ + Boolean topicCommentCleaning(String customerId, String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java index 26b71e08d0..0c9e92305a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java @@ -19,9 +19,17 @@ package com.epmet.service.evaluationindex.extract.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.evaluationindex.extract.FactOriginTopicMainDailyDao; +import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; +import com.epmet.service.topic.TopicService; +import lombok.extern.slf4j.Slf4j; +import net.bytebuddy.asm.Advice; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** @@ -30,8 +38,45 @@ import org.springframework.stereotype.Service; * @author generator generator@elink-cn.com * @since v1.0.0 2020-09-15 */ +@Slf4j @Service public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl implements FactOriginTopicMainDailyService { + @Autowired + private TopicService topicService; + + + /** + * @param customerId 客户id + * @param dateId yyyyMMdd + * @return void + * @author yinzuomei 数据采集:话题本身 + * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 + * @Date 2020/9/15 13:40 + **/ + @Override + public Boolean topicCleaning(String customerId, String dateId) { + //TODO + List topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId); + if (CollectionUtils.isEmpty(topicOriginInfoList)) { + log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record",customerId,dateId)); + return true; + } + + return true; + } + /** + * @param customerId 客户id + * @param dateId yyyyMMdd + * @return java.lang.Boolean + * @author yinzuomei + * @description 数据采集:话题的评论 + * @Date 2020/9/15 17:56 + **/ + @Override + public Boolean topicCommentCleaning(String customerId, String dateId) { + //TODO + return true; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index a14dc274ce..f37720f5ba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -3,6 +3,7 @@ package com.epmet.service.topic; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.util.DimIdGenerator; import java.util.Date; @@ -26,12 +27,12 @@ public interface TopicService { TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension); /** - * @return void - * @param customerId 客户id + * @return java.util.List + * @param customerId * @param dateId yyyyMMdd * @author yinzuomei - * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 - * @Date 2020/9/15 13:40 + * @description 根据日期查询resi_topic_operation,返回所有对话体的操作记录 + * @Date 2020/9/15 18:12 **/ - void topicDataCleaning(String customerId, String dateId); + List queryTopicOriginInfoList(String customerId, String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 18db52ef4e..942f9d1560 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -10,6 +10,7 @@ import com.epmet.dto.stats.topic.*; import com.epmet.dto.stats.topic.result.GridTopicData; import com.epmet.dto.stats.topic.result.GroupTopicData; import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.dto.topic.TopicOriginInfoDTO; import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; import com.epmet.dto.topic.result.ResiTopicResultDTO; @@ -94,6 +95,7 @@ public class TopicServiceImpl implements TopicService { } + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id @@ -1251,17 +1253,17 @@ public class TopicServiceImpl implements TopicService { } - /** - * @param customerId 客户id - * @param dateId yyyyMMdd - * @return void + * @return java.util.List + * @param customerId + * @param dateId * @author yinzuomei - * @description fact_origin_topic_log_daily 话题明细_日统计 fact_origin_topic_main_daily 话题主表_日统计 - * @Date 2020/9/15 13:40 + * @description 根据日期查询resi_topic_operation,返回所有对话体的操作记录 + * @Date 2020/9/15 18:13 **/ + @DataSource(DataSourceConstant.RESI_GROUP) @Override - public void topicDataCleaning(String customerId, String dateId) { - //TODO + public List queryTopicOriginInfoList(String customerId, String dateId) { + return topicDao.selectTopicOriginInfo(customerId,dateId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index c567d0c842..d8a4a8c48d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -129,4 +129,28 @@ order by TOPIC_ID + + \ No newline at end of file From be3dc766deb1176cb3b99bf6e9de7ca10b59b3b6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 15 Sep 2020 18:24:08 +0800 Subject: [PATCH 09/27] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=9A=82=E5=AD=98v0.1-?= =?UTF-8?q?hebing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/FactOriginController.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index ad1776a40a..1d98f65935 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -25,6 +25,8 @@ public class FactOriginController { @Autowired private IssueExtractService issueExtractService; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @PostMapping("issueextract") public Result issueExtract(){ @@ -35,9 +37,6 @@ public class FactOriginController { } - @Autowired - private FactOriginTopicMainDailyService factOriginTopicMainDailyService; - /** * @param customerId yyyyMMdd * @param dateId yyyyMMdd From 72a0ef2529a6cae921a3b976c1a65c615cf1f123 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 09:38:35 +0800 Subject: [PATCH 10/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E4=B8=BB=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/form/IssueMainDailyFormDTO.java | 8 +-- .../extract/result/AgencyInfoResultDTO.java | 25 +++++++++ .../extract/FactOriginIssueMainDailyDao.java | 9 ++++ .../com/epmet/dao/stats/DimAgencyDao.java | 9 ++++ .../extract/impl/IssueExtractServiceImpl.java | 33 +++++++++--- .../extract/FactOriginIssueMainDailyDao.xml | 54 +++++++++++++++---- .../resources/mapper/stats/DimAgencyDao.xml | 17 ++++++ 7 files changed, 134 insertions(+), 21 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java index f180014be9..bb7a5b5ea7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueMainDailyFormDTO.java @@ -115,9 +115,9 @@ public class IssueMainDailyFormDTO implements Serializable { private String updatedBy; public IssueMainDailyFormDTO() { - this.delFlag = delFlag = 0; - this.revision = revision = 0; - this.createdBy = createdBy = "APP_USER"; - this.updatedBy = updatedBy = "APP_USER"; + this.delFlag = 0; + this.revision = 0; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java new file mode 100644 index 0000000000..6434fd6836 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/AgencyInfoResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/15 6:13 下午 + */ +@Data +public class AgencyInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 2823049943836552367L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 机关的父ID + */ + private String pid; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index e33f4255b1..ddfc9134e6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -41,4 +41,13 @@ public interface FactOriginIssueMainDailyDao extends BaseDao issueMainList); + + /** + * @Description 删除旧的记录 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 9:33 上午 + */ + void deleteOldRecord(@Param("customerId")String customerId,@Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java index 8788232a7b..7e20babbeb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java @@ -21,6 +21,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.extract.result.AgencyInfoResultDTO; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.stats.DimAgencyEntity; import org.apache.ibatis.annotations.Mapper; @@ -126,4 +127,12 @@ public interface DimAgencyDao extends BaseDao { DimAgencyEntity getLatestCreatedAgencyDimEntity(); DimAgencyEntity getLatestUpdatedAgencyDimEntity(); + + /** + * @Description 查询pid信息 + * @param agencyIds + * @author zxc + * @date 2020/9/15 6:15 下午 + */ + List selectAgencyInfo(@Param("agencyIds")List agencyIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index b8c01d6305..6e6ac11bd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -5,7 +5,10 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; +import com.epmet.dao.stats.DimAgencyDao; import com.epmet.dto.extract.FactOriginIssueMainDailyDTO; +import com.epmet.dto.extract.form.IssueMainDailyFormDTO; +import com.epmet.dto.extract.result.AgencyInfoResultDTO; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.service.Issue.IssueService; @@ -15,6 +18,7 @@ import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; import java.util.ArrayList; @@ -38,6 +42,8 @@ public class IssueExtractServiceImpl implements IssueExtractService { private UserService userService; @Autowired private TopicService topicService; + @Autowired + private DimAgencyDao dimAgencyDao; /** * @Description 议题抽取 @@ -47,18 +53,19 @@ public class IssueExtractServiceImpl implements IssueExtractService { * @date 2020/9/15 2:02 下午 */ @Override + @Transactional(rollbackFor = Exception.class) public Boolean issueExtract(String customerId, String dateId) { // 议题信息查询 List listResult = issueService.selectIssueInfo(customerId, dateId); - List result = new ArrayList<>(); + List result = new ArrayList<>(); if (CollectionUtils.isEmpty(listResult)){ throw new RenException("查询议题信息为空"); } listResult.forEach(issue -> { - FactOriginIssueMainDailyDTO factOriginIssueMainDailyDTO = ConvertUtils.sourceToTarget(issue, FactOriginIssueMainDailyDTO.class); - factOriginIssueMainDailyDTO.setId(issue.getIssueId()); - result.add(factOriginIssueMainDailyDTO); + IssueMainDailyFormDTO issueMainDailyFormDTO = ConvertUtils.sourceToTarget(issue, IssueMainDailyFormDTO.class); + issueMainDailyFormDTO.setId(issue.getIssueId()); + result.add(issueMainDailyFormDTO); }); // 创建议题人ID @@ -105,9 +112,21 @@ public class IssueExtractServiceImpl implements IssueExtractService { }); }); - - - + // 查询pid + List agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList()); + List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); + if (CollectionUtils.isEmpty(agencyInfoList)){ + throw new RenException("查询组织上级ID集合为空......"); + } + result.forEach(r -> { + agencyInfoList.forEach(pid -> { + if (r.getAgencyId().equals(pid.getAgencyId())){ + r.setPid(pid.getPid()); + } + }); + }); + issueMainDailyDao.deleteOldRecord(customerId, dateId); + issueMainDailyDao.insertIssueMainList(result); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index c467a9d5f9..9b5420adde 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -5,24 +5,48 @@ - INSERT INTO fact_origin_issue_main_daily(ID, CUSTOMER_ID, GRID_ID, PID, AGENCY_ID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, ISSUE_ID, OPERATION_USER_ID, ACTION_CODE, USER_IDENTITY, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + INSERT INTO fact_origin_issue_main_daily( + ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + CUSTOMER_ID, + IS_PARTY, + USER_ID, + CREATE_TOPIC_USER_ID, + TOPIC_ID, + GRID_ID, + PID, + AGENCY_ID, + ISSUE_STATUS, + TOPIC_USER_IS_PARTY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) VALUES ( - REPLACE ( UUID(), '-', '' ), - #{item.customerId}, - #{item.gridId}, - #{item.pid}, - #{item.agencyId}, + #{item.id}, #{item.dateId}, #{item.weekId}, #{item.monthId}, #{item.quarterId}, #{item.yearId}, - #{item.issueId}, - #{item.operationUserId}, - #{item.actionCode}, - #{item.userIdentity}, + #{item.customerId}, + #{item.isParty}, + #{item.userId}, + #{item.createTopicUserId}, + #{item.topicId}, + #{item.gridId}, + #{item.pid}, + #{item.agencyId}, + #{item.issueStatus}, + #{item.topicUserIsParty}, #{item.delFlag}, #{item.revision}, #{item.createdBy}, @@ -32,4 +56,14 @@ ) + + + + DELETE + FROM + fact_origin_issue_main_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml index 3b7fb8b8ba..357265ee82 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml @@ -299,4 +299,21 @@ limit 1 + + + \ No newline at end of file From d77bb61d275e37f727e19245a38f65a91a572b80 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 16 Sep 2020 09:39:57 +0800 Subject: [PATCH 11/27] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/topic/TopicService.java | 1 - .../service/topic/impl/TopicServiceImpl.java | 24 ++++++++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index 0253aac0f7..ee6181accb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -36,7 +36,6 @@ public interface TopicService { * @Date 2020/9/15 18:12 **/ List queryTopicOriginInfoList(String customerId, String dateId); - void topicDataCleaning(String customerId, String dateId); /** * @Description 查询话题创建者信息 * @param topicIds diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 0532f7732e..c32d3180ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -233,8 +233,9 @@ public class TopicServiceImpl implements TopicService { List groupList = new LinkedList<>(); for(Map.Entry> entry : gridGroupMap.entrySet()){ - if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO) + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ groupList.addAll(entry.getValue()); + } } //key -> groupId @@ -367,8 +368,9 @@ public class TopicServiceImpl implements TopicService { List groupListBetweenTimeRange = new LinkedList<>(); for(Map.Entry> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){ - if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO) + if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO){ groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); + } } List operationsBetweenTimeRange = topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDateCheck); @@ -461,9 +463,9 @@ public class TopicServiceImpl implements TopicService { * @date 2020.06.22 16:03 **/ Map traverseGroupTopic(List groups, Map> topicOperationMap){ - if(null == groups || groups.size() < NumConstant.ONE) + if(null == groups || groups.size() < NumConstant.ONE){ return null; - + } Map groupTopicStatistical = new HashMap<>(); groups.forEach(group -> { @@ -491,7 +493,9 @@ public class TopicServiceImpl implements TopicService { //}else{ for (ResiTopicResultDTO topic : group.getTopics()) { - if(StringUtils.isBlank(topic.getTopicId())) continue; + if(StringUtils.isBlank(topic.getTopicId())){ + continue; + } if (StringUtils.equals(NumConstant.ONE_STR, topic.getIncrFlag())) { groupTopicData.setTopicIncr(groupTopicData.getTopicIncr() + NumConstant.ONE); } @@ -980,8 +984,9 @@ public class TopicServiceImpl implements TopicService { List groupList = new LinkedList<>(); for(Map.Entry> entry : gridGroupMap.entrySet()){ - if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO) + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ groupList.addAll(entry.getValue()); + } } //key -> groupId @@ -1148,8 +1153,9 @@ public class TopicServiceImpl implements TopicService { List groupListBetweenTimeRange = new LinkedList<>(); for(Map.Entry> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){ - if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO) + if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO){ groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); + } } List operationsBetweenTimeRange = topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate); @@ -1266,9 +1272,9 @@ public class TopicServiceImpl implements TopicService { } /** - * @return java.util.List * @param customerId * @param dateId + * @return java.util.List * @author yinzuomei * @description 根据日期查询resi_topic_operation,返回所有对话体的操作记录 * @Date 2020/9/15 18:13 @@ -1276,6 +1282,6 @@ public class TopicServiceImpl implements TopicService { @DataSource(DataSourceConstant.RESI_GROUP) @Override public List queryTopicOriginInfoList(String customerId, String dateId) { - return topicDao.selectTopicOriginInfo(customerId,dateId); + return topicDao.selectTopicOriginInfo(customerId, dateId); } } From 2373259a218b9647137e88e62721830d5844df01 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 16 Sep 2020 14:23:39 +0800 Subject: [PATCH 12/27] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/org/GridInfoDTO.java | 35 ++++ .../epmet/dto/topic/TopicOriginInfoDTO.java | 63 +++++++ .../constant/DimObjectActionConstant.java | 14 ++ .../constant/DimObjectStatusConstant.java | 10 ++ .../controller/FactOriginController.java | 1 - .../extract/FactOriginTopicLogDailyDao.java | 24 ++- .../extract/FactOriginTopicMainDailyDao.java | 26 ++- .../com/epmet/dao/org/CustomerGridDao.java | 10 ++ .../java/com/epmet/dao/topic/TopicDao.java | 5 +- .../FactOriginTopicLogDailyEntity.java | 7 +- .../FactOriginTopicMainDailyEntity.java | 2 +- .../FactOriginTopicMainDailyService.java | 9 - .../FactOriginTopicMainDailyServiceImpl.java | 156 ++++++++++++++++-- .../service/org/CustomerGridService.java | 10 ++ .../org/impl/CustomerGridServiceImpl.java | 13 ++ .../service/topic/impl/TopicServiceImpl.java | 6 +- .../extract/FactOriginTopicLogDailyDao.xml | 63 ++++++- .../extract/FactOriginTopicMainDailyDao.xml | 59 ++++++- .../resources/mapper/org/CustomerGridDao.xml | 14 ++ .../main/resources/mapper/topic/TopicDao.xml | 29 +++- 20 files changed, 515 insertions(+), 41 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java new file mode 100644 index 0000000000..894e6e3d7d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/org/GridInfoDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.org; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 网格基本信息 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/16 14:00 + */ +@Data +public class GridInfoDTO implements Serializable { + private static final long serialVersionUID = -5328705277000477630L; + /** + * 话题所属的网格ID + */ + private String gridId; + + /** + * 所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 客户id + */ + private String customerId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java index 932cdb4284..6ba7b323da 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java @@ -3,6 +3,7 @@ package com.epmet.dto.topic; import lombok.Data; import java.io.Serializable; +import java.util.Date; /** * 原始话题相关信息 @@ -14,6 +15,68 @@ import java.io.Serializable; public class TopicOriginInfoDTO implements Serializable { private static final long serialVersionUID = -182136873047614269L; + /** + * 话题id + */ + private String topicId; + + /** + * 操作类型(发布 - discussing 、 屏蔽 - hidden、 取消屏蔽 - hidden_cancelled、 关闭话题 - closed) + * 补充 转议题:shift_issue 、评论话题:comment + */ + private String actionCode; + + /** + * 本条记录的操作人 resi_topic_operation.CREATED_BY + */ + private String operateUserId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyyMMdd + */ + private String dateId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyyMM + */ + private String monthId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME 对应的yyyy + */ + private String yearId; + + /** + * 用户操作时间 resi_topic_operation.CREATED_TIME + */ + private Date originalBusinessTime; + + /** + * 话题状态(讨论中 - discussing、 已屏蔽 - hidden、 已关闭 - closed) + */ + private String groupId; + + /** + * 话题的状态 + */ + private String topicStatus; + + /** + * 话题关闭时的状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 网格id ( 其实就是小组所属的网格id) + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java new file mode 100644 index 0000000000..660cbf4e4b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java @@ -0,0 +1,14 @@ +package com.epmet.constant; + +/** + * 对象行为动作维度表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/16 10:13 + */ +public interface DimObjectActionConstant { + /** + * 发布话题 + */ + String TOPIC_PUBLISH="disscussing"; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java new file mode 100644 index 0000000000..5ceae84d44 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectStatusConstant.java @@ -0,0 +1,10 @@ +package com.epmet.constant; + +/** + * 对象行为状态维度表 + * + * @author yinzuomei@elink-cn.com + * @date 2020/9/16 10:14 + */ +public interface DimObjectStatusConstant { +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index 1d98f65935..30fb66b1a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -49,7 +49,6 @@ public class FactOriginController { public Result topicDataCleaning(String customerId, String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { factOriginTopicMainDailyService.topicCleaning(customerId,dateId); - factOriginTopicMainDailyService.topicCommentCleaning(customerId,dateId); } return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java index 60f1ddb2a3..ef66cc0c73 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicLogDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.evaluationindex.extract.FactOriginTopicLogDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 话题明细_日统计 @@ -29,5 +32,24 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactOriginTopicLogDailyDao extends BaseDao { - + /** + * @return int + * @param customerId + * @param dateId + * @param deleteSize + * @author yinzuomei + * @description 批量删除 + * @Date 2020/9/16 12:54 + **/ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("deleteSize") Integer deleteSize); + /** + * @return int + * @param list + * @author yinzuomei + * @description 批量插入 + * @Date 2020/9/16 12:54 + **/ + int insertBatchEntity(@Param("list") List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java index 980560c32e..26738dc2b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginTopicMainDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 话题主表_日统计 @@ -29,5 +32,26 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactOriginTopicMainDailyDao extends BaseDao { - + + /** + * @param customerId + * @param dateId + * @param deleteSize + * @return int + * @author yinzuomei + * @description 批量删除 + * @Date 2020/9/16 11:16 + **/ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, + @Param("dateId") String dateId, + @Param("deleteSize") Integer deleteSize); + + /** + * @return int + * @param list + * @author yinzuomei + * @description 批量插入 + * @Date 2020/9/16 12:48 + **/ + int insertBatchEntity(@Param("list") List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java index 9f26b8b98d..b8d9093631 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -67,4 +68,13 @@ public interface CustomerGridDao extends BaseDao { * @return */ List listUpdatedGridsByUpdateTime(@Param("startTime") Date startTime, @Param("endTime") Date endTime); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询客户下的网格的agencyId, 还有pid + * @Date 2020/9/16 14:03 + **/ + List selectListGridInfo(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 42e9f83233..b317ee0d7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -72,8 +72,9 @@ public interface TopicDao { * @param customerId * @param dateId yyyyMMdd * @author yinzuomei - * @description 根据日期查询resi_topic_operation,返回所有对话体的操作记录 + * @description 根据日期查询resi_topic_operation,返回当前日期这一天内所有话题相关的操作记录 * @Date 2020/9/15 18:14 **/ - List selectTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + List selectListTopicOriginInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java index 9e67eeec59..a1da41988a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicLogDailyEntity.java @@ -93,11 +93,6 @@ public class FactOriginTopicLogDailyEntity extends BaseEpmetEntity { */ private String groupId; - /** - * 话题状态 来自dim_object_status表 - */ - private String topicStatus; - /** * 行为code 来自dim_object_action表 */ @@ -111,7 +106,7 @@ public class FactOriginTopicLogDailyEntity extends BaseEpmetEntity { /** * 本条数据操作用户是否是党员, 1是0不是 */ - private String operateUserIsParty; + private Boolean operateUserIsParty; /** * 原始业务发生时间 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java index 92b03d933e..39e5304527 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/extract/FactOriginTopicMainDailyEntity.java @@ -101,6 +101,6 @@ public class FactOriginTopicMainDailyEntity extends BaseEpmetEntity { /** * 话题发布人是否是党员:1是党员0不是。 默认0 */ - private Integer createTopicUserIsParty; + private Boolean createTopicUserIsParty; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java index 1fef99bf21..cb68dadf3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/FactOriginTopicMainDailyService.java @@ -42,14 +42,5 @@ public interface FactOriginTopicMainDailyService extends BaseService implements FactOriginTopicMainDailyService { @Autowired private TopicService topicService; - + @Autowired + private CustomerGridService customerGridService; + @Autowired + private FactOriginTopicLogDailyDao factOriginTopicLogDailyDao; /** * @param customerId 客户id @@ -55,28 +71,142 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl topicOriginInfoList = topicService.queryTopicOriginInfoList(customerId, dateId); if (CollectionUtils.isEmpty(topicOriginInfoList)) { log.info(String.format("customerId%s,dateId%s,doesn't have any topic operation record",customerId,dateId)); return true; } - + Map gridMap=getGridInfoMap(customerId); + Map map=this.constructFactOriginData(topicOriginInfoList,gridMap); + List mainDailyEntityList= (List) map.get("main"); + List logDailyEntityList= (List) map.get("log"); + //删除之前统计的数据 + deleteFactOriginData(customerId,dateId); + //批量保存主表 + saveFactOriginTopicMainDailyEntity(mainDailyEntityList); + //批量保存明细表 + saveFactOriginTopicLogDailyEntity(logDailyEntityList); return true; } + private Map getGridInfoMap(String customerId) { + Map map=new HashMap<>(); + List list=customerGridService.queryGridInfoList(customerId); + if(!CollectionUtils.isEmpty(list)){ + return list.stream().collect(Collectors.toMap(GridInfoDTO::getGridId, gridInfoDTO -> gridInfoDTO)); + } + return map; + } + + /** - * @param customerId 客户id - * @param dateId yyyyMMdd - * @return java.lang.Boolean + * @return void + * @param mainDailyEntityList * @author yinzuomei - * @description 数据采集:话题的评论 - * @Date 2020/9/15 17:56 + * @description 批量插入 fact_origin_topic_main_daily + * @Date 2020/9/16 11:21 **/ - @Override - public Boolean topicCommentCleaning(String customerId, String dateId) { - //TODO - return true; + private void saveFactOriginTopicMainDailyEntity(List mainDailyEntityList) { + //批量插入 + List> partition = ListUtils.partition(mainDailyEntityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + baseDao.insertBatchEntity(list); + }); } + /** + * @return void + * @param logDailyEntityList + * @author yinzuomei + * @description 批量插入fact_origin_topic_log_daily + * @Date 2020/9/16 12:53 + **/ + private void saveFactOriginTopicLogDailyEntity(List logDailyEntityList) { + //批量插入 + List> partition = ListUtils.partition(logDailyEntityList, IndexCalConstant.INSERT_SIZE); + partition.forEach(list -> { + factOriginTopicLogDailyDao.insertBatchEntity(list); + }); + } + + /** + * @return java.util.Map + * @param topicOriginInfoList + * @author yinzuomei + * @description 构造好要插入的数据 + * @Date 2020/9/16 11:21 + **/ + private Map constructFactOriginData(List topicOriginInfoList,Map gridMap) { + Map map=new HashMap<>(); + List mainDailyEntityList=new ArrayList<>(); + List logDailyEntityList=new ArrayList<>(); + for(TopicOriginInfoDTO topicOriginInfoDTO:topicOriginInfoList){ + GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId()); + if(null==gridInfoDTO){ + log.error("没有找到 gridId="+topicOriginInfoDTO.getGridId()+" 的基本信息"); + continue; + } + // 一年的第几周 + String weekId = DateUtils.format(topicOriginInfoDTO.getOriginalBusinessTime(), DateUtils.DATE_PATTERN_YYYY).concat("W").concat(String.valueOf(DateUtils.getWeekOfYear(topicOriginInfoDTO.getOriginalBusinessTime()))); + String quarterId=DateUtils.getQuarterId(topicOriginInfoDTO.getMonthId()); + if(DimObjectActionConstant.TOPIC_PUBLISH.equals(topicOriginInfoDTO.getActionCode())){ + //如果是新发布的话题需要插入主表 + FactOriginTopicMainDailyEntity mainDailyEntity=ConvertUtils.sourceToTarget(topicOriginInfoDTO, FactOriginTopicMainDailyEntity.class); + mainDailyEntity.setId(topicOriginInfoDTO.getTopicId()); + mainDailyEntity.setWeekId(weekId); + mainDailyEntity.setQuarterId(quarterId); + mainDailyEntity.setCreateTopicUserId(topicOriginInfoDTO.getOperateUserId()); + //网格所属的组织id + mainDailyEntity.setAgencyId(gridInfoDTO.getAgencyId()); + //网格的上上级组织id=街道id + mainDailyEntity.setPid(gridInfoDTO.getPid()); + //TODO + //话题发布人是否是党员:1是党员0不是。 默认0 + mainDailyEntity.setCreateTopicUserIsParty(false); + + mainDailyEntityList.add(mainDailyEntity); + } + FactOriginTopicLogDailyEntity logDailyEntity= ConvertUtils.sourceToTarget(topicOriginInfoDTO, FactOriginTopicLogDailyEntity.class); + logDailyEntity.setCustomerId(topicOriginInfoDTO.getCustomerId()); + logDailyEntity.setGridId(topicOriginInfoDTO.getGridId()); + logDailyEntity.setWeekId(weekId); + logDailyEntity.setQuarterId(quarterId); + logDailyEntity.setAgencyId(gridInfoDTO.getAgencyId()); + logDailyEntity.setPid(gridInfoDTO.getPid()); + //TODO + logDailyEntity.setOperateUserIsParty(false); + logDailyEntityList.add(logDailyEntity); + } + map.put("main",mainDailyEntityList); + map.put("log",logDailyEntityList); + return map; + } + + /** + * @return void + * @param customerId + * @param dateId + * @author yinzuomei + * @description 删除之前统计过的数据 + * @Date 2020/9/16 11:21 + **/ + private void deleteFactOriginData(String customerId, String dateId) { + int mainDeleteNum; + do { + //一次删除50条 + mainDeleteNum = baseDao.deleteByDateIdAndCustomerId(customerId, + dateId, + IndexCalConstant.DELETE_SIZE); + } while (mainDeleteNum > NumConstant.ZERO); + int logDeleteNum; + do { + //一次删除50条 + logDeleteNum = factOriginTopicLogDailyDao.deleteByDateIdAndCustomerId(customerId, + dateId, + IndexCalConstant.DELETE_SIZE); + } while (logDeleteNum > NumConstant.ZERO); + } + + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java index b2b7a5b129..2cdee8ccad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -3,6 +3,7 @@ package com.epmet.service.org; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import java.util.Date; @@ -40,4 +41,13 @@ public interface CustomerGridService { * @return */ List listUpdatedGridsByUpdateTime(Date lastInitTime, Date now); + + /** + * @return java.util.List + * @param customerId + * @author yinzuomei + * @description 查询客户下的网格的agencyId, 还有pid + * @Date 2020/9/16 14:02 + **/ + List queryGridInfoList(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java index 5bab5596a7..fa8018e1e1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -6,6 +6,7 @@ import com.epmet.dao.org.CustomerGridDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.dto.group.result.GridIdListByCustomerResultDTO; +import com.epmet.dto.org.GridInfoDTO; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -51,4 +52,16 @@ public class CustomerGridServiceImpl implements CustomerGridService { public List listUpdatedGridsByUpdateTime(Date lastInitTime, Date now) { return customerGridDao.listUpdatedGridsByUpdateTime(lastInitTime, now); } + + /** + * @param customerId + * @return java.util.List + * @author yinzuomei + * @description 查询客户下的网格的agencyId, 还有pid + * @Date 2020/9/16 14:02 + **/ + @Override + public List queryGridInfoList(String customerId) { + return customerGridDao.selectListGridInfo(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index c32d3180ae..6c80ecd8cf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -108,6 +108,8 @@ public class TopicServiceImpl implements TopicService { return topicDao.selectTopicInfo(topicIds); } + + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id @@ -1276,12 +1278,12 @@ public class TopicServiceImpl implements TopicService { * @param dateId * @return java.util.List * @author yinzuomei - * @description 根据日期查询resi_topic_operation,返回所有对话体的操作记录 + * @description 根据日期查询resi_topic_operation,返回所有对话题操作记录 * @Date 2020/9/15 18:13 **/ @DataSource(DataSourceConstant.RESI_GROUP) @Override public List queryTopicOriginInfoList(String customerId, String dateId) { - return topicDao.selectTopicOriginInfo(customerId, dateId); + return topicDao.selectListTopicOriginInfo(customerId, dateId); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml index 3c92cd5651..3efebcd69f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicLogDailyDao.xml @@ -2,6 +2,67 @@ + + DELETE + FROM + fact_origin_topic_log_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + LIMIT #{deleteSize} + - + + insert into fact_origin_topic_log_daily + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + PID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + TOPIC_ID, + GROUP_ID, + ACTION_CODE, + OPERATE_USER_ID, + OPERATE_USER_IS_PARTY, + ORIGINAL_BUSINESS_TIME, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + #{item.id}, + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.pid}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.topicId}, + #{item.groupId}, + #{item.actionCode}, + #{item.operateUserId}, + #{item.operateUserIsParty}, + #{item.originalBusinessTime}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml index 29e2e075f2..377f09bd45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginTopicMainDailyDao.xml @@ -3,6 +3,63 @@ + + DELETE + FROM + fact_origin_topic_main_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + LIMIT #{deleteSize} + - + + insert into fact_origin_topic_main_daily + ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + PID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + GROUP_ID, + TOPIC_STATUS, + CREATE_TOPIC_USER_ID, + CREATE_TOPIC_USER_IS_PARTY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) values + + ( + #{item.id}, + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.pid}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.groupId}, + #{item.topicStatus}, + #{item.createTopicUserId}, + #{item.createTopicUserIsParty}, + 0, + 0, + 'APP_USER', + now(), + 'APP_USER', + now() + ) + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml index 48c5176a78..c12feef84b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -68,4 +68,18 @@ WHERE UPDATED_TIME >= #{startTime} AND UPDATED_TIME #{endTime} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index 91724d7a97..3a0cc38e8b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -146,11 +146,11 @@ ) - - SELECT rto.TOPIC_ID, - rto.OPERATION_TYPE, + rto.OPERATION_TYPE as ACTION_CODE, rto.CREATED_BY as OPERATE_USER_ID, DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d') as DATE_ID, DATE_FORMAT(rto.CREATED_TIME,'%Y%m') as MONTH_ID, @@ -169,5 +169,28 @@ rto.DEL_FLAG = '0' AND DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d')=#{dateId} AND RG.CUSTOMER_ID=#{customerId} + union all + SELECT + rtc.TOPIC_ID, + 'comment' as ACTION_CODE, + rtc.CREATED_BY as OPERATE_USER_ID, + DATE_FORMAT(rtc.CREATED_TIME,'%Y%m%d') as DATE_ID, + DATE_FORMAT(rtc.CREATED_TIME,'%Y%m') as MONTH_ID, + DATE_FORMAT(rtc.CREATED_TIME,'%Y') as YEAR_ID, + rtc.CREATED_TIME AS ORIGINAL_BUSINESS_TIME, + rt.GROUP_ID , + rt.STATUS as TOPIC_STATUS, + RT.CLOSED_STATUS, + rg.GRID_ID, + rg.CUSTOMER_ID + FROM + resi_topic_comment rtc + LEFT JOIN resi_topic rt ON ( rtc.TOPIC_ID = rt.id AND rt.DEL_FLAG = '0' ) + LEFT JOIN resi_group rg ON ( rt.GROUP_ID = rg.id AND rg.DEL_FLAG = '0' ) + WHERE + rtc.DEL_FLAG = '0' + AND DATE_FORMAT( rtc.CREATED_TIME, '%Y%m%d' )=#{dateId} + AND RG.CUSTOMER_ID =#{customerId} + \ No newline at end of file From 8d7d55debf26f4c61d2c3f4dce05c114e3c018e5 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 16 Sep 2020 14:44:12 +0800 Subject: [PATCH 13/27] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactOriginTopicMainDailyServiceImpl.java | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java index 88b9e87ae2..8d2da496ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.entity.evaluationindex.extract.FactOriginTopicMainDailyEntity; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.ListUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -60,7 +61,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl map=new HashMap<>(); List mainDailyEntityList=new ArrayList<>(); List logDailyEntityList=new ArrayList<>(); + List userIds = topicOriginInfoList.stream().map(topic -> topic.getOperateUserId()).distinct().collect(Collectors.toList()); + Map userIsPartyMap = userService.selectUserIsParty(userIds); for(TopicOriginInfoDTO topicOriginInfoDTO:topicOriginInfoList){ GridInfoDTO gridInfoDTO=gridMap.get(topicOriginInfoDTO.getGridId()); if(null==gridInfoDTO){ @@ -162,7 +166,11 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl Date: Wed, 16 Sep 2020 15:05:01 +0800 Subject: [PATCH 14/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/IssueProcessInfoResultDTO.java | 45 ++++++++++++++ .../controller/FactOriginController.java | 17 ++++-- .../extract/FactOriginIssueLogDailyDao.java | 9 +++ .../extract/FactOriginIssueMainDailyDao.java | 2 +- .../com/epmet/dao/issue/StatsIssueDao.java | 17 ++++++ .../com/epmet/service/Issue/IssueService.java | 10 ++++ .../service/Issue/impl/IssueServiceImpl.java | 13 ++++ .../extract/IssueExtractService.java | 12 +++- .../extract/impl/IssueExtractServiceImpl.java | 59 ++++++++++++++++++- .../extract/FactOriginIssueLogDailyDao.xml | 45 ++++++++++---- .../extract/FactOriginIssueMainDailyDao.xml | 6 +- .../resources/mapper/issue/StatsIssueDao.xml | 19 ++++++ 12 files changed, 227 insertions(+), 27 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java new file mode 100644 index 0000000000..5d9bbb0cf2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/IssueProcessInfoResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/16 1:27 下午 + */ +@Data +public class IssueProcessInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 104679947108492259L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 用户ID + */ + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index 30fb66b1a9..97057a396d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -4,11 +4,8 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.service.evaluationindex.extract.IssueExtractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; -import com.epmet.commons.tools.utils.Result; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -28,11 +25,19 @@ public class FactOriginController { @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; - @PostMapping("issueextract") - public Result issueExtract(){ + @PostMapping("issueextractmain") + public Result issueExtractMain(){ + String customerId = "3ef7e4bb195eb9e622d68b52509aa940"; + String dateId = "20200811"; + issueExtractService.issueExtractMain(customerId,dateId); + return new Result(); + } + + @PostMapping("issueextractlog") + public Result issueExtractLog(){ String customerId = "3ef7e4bb195eb9e622d68b52509aa940"; String dateId = "20200811"; - issueExtractService.issueExtract(customerId,dateId); + issueExtractService.issueExtractLog(customerId,dateId); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java index eee5e51287..a98372928e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueLogDailyDao.java @@ -42,4 +42,13 @@ public interface FactOriginIssueLogDailyDao extends BaseDao issueLogList); + /** + * @Description 删除旧的记录 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 9:33 上午 + */ + void deleteOldLogRecord(@Param("customerId")String customerId,@Param("dateId")String dateId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java index ddfc9134e6..1866a593a5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginIssueMainDailyDao.java @@ -49,5 +49,5 @@ public interface FactOriginIssueMainDailyDao extends BaseDao { */ List selectIssueProjectList(@Param("customerId") String customerId); + /** + * @Description 查询议题信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/15 2:28 下午 + */ List selectIssueInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询议题process信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index ea2d98a94b..9fe7edf6d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -1,5 +1,6 @@ package com.epmet.service.Issue; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; @@ -119,4 +120,13 @@ public interface IssueService { * @date 2020/9/15 2:28 下午 */ List selectIssueInfo(String customerId,String dateId); + + /** + * @Description 查询议题process信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueProcessInfo(String customerId,String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index 88e82eb9f2..aaa6c3844d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.Issue.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; import com.epmet.dto.issue.IssueProjectDTO; @@ -93,4 +94,16 @@ public class IssueServiceImpl implements IssueService { public List selectIssueInfo(String customerId,String dateId) { return statsIssueDao.selectIssueInfo(customerId, dateId); } + + /** + * @Description 查询议题process信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + @Override + public List selectIssueProcessInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueProcessInfo(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java index 8731b47e9b..97373f53e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -7,12 +7,20 @@ package com.epmet.service.evaluationindex.extract; public interface IssueExtractService { /** - * @Description 议题抽取 + * @Description 议题抽取(main) * @param customerId * @param dateId * @author zxc * @date 2020/9/15 2:02 下午 */ - Boolean issueExtract(String customerId,String dateId); + Boolean issueExtractMain(String customerId, String dateId); + /** + * @Description 议题抽取(log) + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 9:41 上午 + */ + Boolean issueExtractLog(String customerId,String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index 6e6ac11bd2..e622555cd6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -1,15 +1,19 @@ package com.epmet.service.evaluationindex.extract.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.dto.form.TimeListResultDTO; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dao.stats.DimAgencyDao; -import com.epmet.dto.extract.FactOriginIssueMainDailyDTO; +import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; import com.epmet.dto.extract.result.AgencyInfoResultDTO; import com.epmet.dto.extract.result.IssueInfoResultDTO; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.service.Issue.IssueService; import com.epmet.service.evaluationindex.extract.IssueExtractService; @@ -32,6 +36,7 @@ import java.util.stream.Collectors; */ @Service @Slf4j +@DataSource(DataSourceConstant.STATS) public class IssueExtractServiceImpl implements IssueExtractService { @Autowired @@ -44,6 +49,8 @@ public class IssueExtractServiceImpl implements IssueExtractService { private TopicService topicService; @Autowired private DimAgencyDao dimAgencyDao; + @Autowired + private FactOriginIssueLogDailyDao issueLogDailyDao; /** * @Description 议题抽取 @@ -54,7 +61,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { */ @Override @Transactional(rollbackFor = Exception.class) - public Boolean issueExtract(String customerId, String dateId) { + public Boolean issueExtractMain(String customerId, String dateId) { // 议题信息查询 List listResult = issueService.selectIssueInfo(customerId, dateId); @@ -125,9 +132,55 @@ public class IssueExtractServiceImpl implements IssueExtractService { } }); }); - issueMainDailyDao.deleteOldRecord(customerId, dateId); + issueMainDailyDao.deleteOldMainRecord(customerId, dateId); issueMainDailyDao.insertIssueMainList(result); return true; } + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean issueExtractLog(String customerId, String dateId) { + + // 查询议题process + List listResult = issueService.selectIssueProcessInfo(customerId, dateId); + if (CollectionUtils.isEmpty(listResult)){ + throw new RenException("查询查询议题process集合为空"); + } + List result = new ArrayList<>(); + listResult.forEach(issueProcess -> { + IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class); + issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId()); + result.add(issueLogDailyFormDTO); + }); + + // 动作操作人的身份标识是否是党员 + List userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); + Map map = userService.selectUserIsParty(userIds); + if (null != map){ + result.forEach(r -> { + map.forEach((userId,isParty) -> { + if (r.getOperationUserId().equals(userId)){ + r.setIsParty(isParty); + } + }); + }); + } + + List agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList()); + List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); + if (CollectionUtils.isEmpty(agencyInfoList)){ + throw new RenException("查询组织上级ID集合为空......"); + } + result.forEach(r -> { + agencyInfoList.forEach(agency -> { + if (r.getAgencyId().equals(agency.getAgencyId())){ + r.setPid(agency.getPid()); + } + }); + }); + issueLogDailyDao.deleteOldLogRecord(customerId, dateId); + issueLogDailyDao.insertIssueLogList(result); + return true; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 58e9202e70..610d323513 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -5,28 +5,44 @@ - INSERT INTO fact_origin_issue_log_daily ( ID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, CUSTOMER_ID, USER_IDENTITY, USER_ID, CREATE_TOPIC_USER_ID, ISSUE_ID, TOPIC_ID, GRID_ID, - PID, AGENCY_ID, ISSUE_STATUS, TOPIC_USER_IDENTITY, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME ) + INSERT INTO fact_origin_issue_log_daily ( + ID, + CUSTOMER_ID, + GRID_ID, + PID, + AGENCY_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + ISSUE_ID, + OPERATION_USER_ID, + ACTION_CODE, + IS_PARTY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME) VALUES ( REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.gridId}, + #{item.pid}, + #{item.agencyId}, #{item.dateId}, #{item.weekId}, #{item.monthId}, #{item.quarterId}, #{item.yearId}, - #{item.customerId}, - #{item.userIdentity}, - #{item.userId}, - #{item.createTopicUserId}, #{item.issueId}, - #{item.topicId}, - #{item.gridId}, - #{item.pid}, - #{item.agencyId}, - #{item.issueStatus}, - #{item.topicUserIdentity}, + #{item.operationUserId}, + #{item.actionCode}, + #{item.isParty}, #{item.delFlag}, #{item.revision}, #{item.createdBy}, @@ -36,4 +52,9 @@ ) + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index 9b5420adde..992c189d52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -58,12 +58,12 @@ - + DELETE FROM - fact_origin_issue_main_daily + fact_origin_issue_log_daily WHERE CUSTOMER_ID = #{customerId} - AND DATE_ID = #{dateId} + AND DATE_ID = #{dateId} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 094da63178..1439aa721a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -199,4 +199,23 @@ AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId} + + + \ No newline at end of file From 0146781bfcf0c1d3a1b88cff661206be88bb9397 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 15:19:46 +0800 Subject: [PATCH 15/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/impl/IssueExtractServiceImpl.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index e622555cd6..4cbef41109 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -36,7 +36,6 @@ import java.util.stream.Collectors; */ @Service @Slf4j -@DataSource(DataSourceConstant.STATS) public class IssueExtractServiceImpl implements IssueExtractService { @Autowired @@ -166,12 +165,19 @@ public class IssueExtractServiceImpl implements IssueExtractService { }); } + // 上级ID List agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList()); List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); if (CollectionUtils.isEmpty(agencyInfoList)){ throw new RenException("查询组织上级ID集合为空......"); } + TimeListResultDTO timeList = DateUtils.getTimeList(dateId); result.forEach(r -> { + r.setDateId(dateId); + r.setWeekId(timeList.getWeekId()); + r.setMonthId(timeList.getMonthId()); + r.setQuarterId(timeList.getQuarterId()); + r.setYearId(timeList.getYearId()); agencyInfoList.forEach(agency -> { if (r.getAgencyId().equals(agency.getAgencyId())){ r.setPid(agency.getPid()); From 8f591e262ca6c3adc5190c576c704a42ef274dd0 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 16 Sep 2020 15:50:02 +0800 Subject: [PATCH 16/27] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/topic/TopicOriginInfoDTO.java | 2 +- .../constant/DimObjectActionConstant.java | 2 +- .../com/epmet/controller/DemoController.java | 62 ++++++++++++++----- .../controller/FactOriginController.java | 12 ++-- .../FactOriginTopicMainDailyServiceImpl.java | 4 +- .../main/resources/mapper/topic/TopicDao.xml | 9 ++- 6 files changed, 60 insertions(+), 31 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java index 6ba7b323da..9514d388c5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/TopicOriginInfoDTO.java @@ -64,7 +64,7 @@ public class TopicOriginInfoDTO implements Serializable { /** * 话题关闭时的状态:已解决 resolved,未解决 unresolved */ - private String closedStatus; +// private String closedStatus; /** * 网格id ( 其实就是小组所属的网格id) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java index 660cbf4e4b..5476a93a1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/DimObjectActionConstant.java @@ -10,5 +10,5 @@ public interface DimObjectActionConstant { /** * 发布话题 */ - String TOPIC_PUBLISH="disscussing"; + String TOPIC_PUBLISH="discussing"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 360571a1e4..018857ae8e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -1,5 +1,6 @@ package com.epmet.controller; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.DateUtils; @@ -11,6 +12,8 @@ import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDa import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyDao; import com.epmet.dao.evaluationindex.screen.ScreenCustomerGridDao; +import com.epmet.dao.stats.DimCustomerDao; +import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.indexcal.CalculateCommonFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; @@ -18,15 +21,16 @@ import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthl import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.screen.ScreenCustomerGridEntity; import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimCustomerEntity; +import com.epmet.entity.stats.DimDateEntity; import com.epmet.service.StatsDemoService; +import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.math.BigDecimal; import java.time.LocalDateTime; @@ -57,6 +61,24 @@ public class DemoController { private DeptScoreService deptScoreService; @Autowired private IndexCalculateDistrictService indexCalculateDistrictService; + @Autowired + private GridScoreDao gridScoreDao; + @Autowired + private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; + @Autowired + private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; + @Autowired + private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; + @Autowired + private ScreenCustomerGridDao screenCustomerGridDao; + @Autowired + private CpcIndexCalculateService cpcIndexCalculateService; + @Autowired + private DimDateDao dimDateDao; + @Autowired + private DimCustomerDao dimCustomerDao; + @Autowired + private FactOriginTopicMainDailyService factOriginTopicMainDailyService; @GetMapping("testAlarm") public void testAlarm() { @@ -147,19 +169,6 @@ public class DemoController { return new Result(); } - @Autowired - private GridScoreDao gridScoreDao; - @Autowired - private FactIndexPartyAblityGridMonthlyDao factIndexPartyAblityGridMonthlyDao; - @Autowired - private FactIndexGovrnAblityGridMonthlyDao factIndexGovrnAblityGridMonthlyDao; - @Autowired - private FactIndexServiceAblityGridMonthlyDao factIndexServiceAblityGridMonthlyDao; - @Autowired - private ScreenCustomerGridDao screenCustomerGridDao; - @Autowired - private CpcIndexCalculateService cpcIndexCalculateService; -// private static Integer testcal=100; @PostMapping("testcal") public Result testCal(){ @@ -487,4 +496,23 @@ public class DemoController { c.setMonthId(monthId); deptScoreService.calculateDeptCorreLation(c); } + + + @PostMapping("inserttopicorigin") + public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { + if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { + factOriginTopicMainDailyService.topicCleaning(customerId,dateId); + }else{ + QueryWrapper customerEntityQueryWrapper = new QueryWrapper<>(); + List customerEntityList=dimCustomerDao.selectList(customerEntityQueryWrapper); + QueryWrapper wrapper = new QueryWrapper<>(); + List dimDateEntityList= dimDateDao.selectList(wrapper); + for(DimCustomerEntity customerEntity:customerEntityList){ + for(DimDateEntity dateEntity:dimDateEntityList){ + factOriginTopicMainDailyService.topicCleaning(customerEntity.getId(),dateEntity.getId()); + } + } + } + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index 30fb66b1a9..30f1d9bc06 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -2,15 +2,12 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.service.evaluationindex.extract.IssueExtractService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import com.epmet.commons.tools.utils.Result; -import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; + /** @@ -36,7 +33,6 @@ public class FactOriginController { return new Result(); } - /** * @param customerId yyyyMMdd * @param dateId yyyyMMdd @@ -46,7 +42,7 @@ public class FactOriginController { * @Date 2020/9/15 13:39 **/ @PostMapping("topic") - public Result topicDataCleaning(String customerId, String dateId) { + public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { factOriginTopicMainDailyService.topicCleaning(customerId,dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java index 8d2da496ee..6b4c2391fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/FactOriginTopicMainDailyServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.evaluationindex.extract.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DimObjectActionConstant; @@ -148,7 +149,8 @@ public class FactOriginTopicMainDailyServiceImpl extends BaseServiceImpl SELECT rto.TOPIC_ID, - rto.OPERATION_TYPE as ACTION_CODE, + (case + when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='resolved' then 'closed_resolved' + when rto.OPERATION_TYPE='closed' and rt.CLOSED_STATUS='unresolved' then 'closed_unresolved' + else rto.OPERATION_TYPE + end + )as ACTION_CODE, rto.CREATED_BY as OPERATE_USER_ID, DATE_FORMAT(rto.CREATED_TIME,'%Y%m%d') as DATE_ID, DATE_FORMAT(rto.CREATED_TIME,'%Y%m') as MONTH_ID, @@ -158,7 +163,6 @@ rto.CREATED_TIME AS ORIGINAL_BUSINESS_TIME, rt.GROUP_ID, rt.STATUS as TOPIC_STATUS, - RT.CLOSED_STATUS, rg.GRID_ID, RG.CUSTOMER_ID FROM @@ -180,7 +184,6 @@ rtc.CREATED_TIME AS ORIGINAL_BUSINESS_TIME, rt.GROUP_ID , rt.STATUS as TOPIC_STATUS, - RT.CLOSED_STATUS, rg.GRID_ID, rg.CUSTOMER_ID FROM From 5a3e7c4cbec9706943998af8348474e70671f897 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Wed, 16 Sep 2020 15:51:15 +0800 Subject: [PATCH 17/27] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/controller/FactOriginController.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index 30f0ed324f..1fce253f62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -8,10 +8,6 @@ import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService import org.apache.commons.lang3.StringUtils; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; -import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; -import org.springframework.web.bind.annotation.PostMapping; @@ -55,7 +51,7 @@ public class FactOriginController { * @Date 2020/9/15 13:39 **/ @PostMapping("topic") - public Result topicDataCleaning(@RequestParam("customerId") String customerId, @RequestParam("dateId")String dateId) { + public Result topicDataCleaning(String customerId,String dateId) { if (StringUtils.isNotBlank(customerId) && StringUtils.isNotBlank(dateId)) { factOriginTopicMainDailyService.topicCleaning(customerId,dateId); } From eae7a7ebcaf363ed1e1e82486bdc31a76313fb1c Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 16:42:49 +0800 Subject: [PATCH 18/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ExtractConstant.java | 13 ++++++++ .../extract/form/IssueLogDailyFormDTO.java | 5 +++ .../extract/impl/IssueExtractServiceImpl.java | 32 ++++++++++++++++--- .../service/user/impl/UserServiceImpl.java | 8 ++++- .../extract/FactOriginIssueLogDailyDao.xml | 7 +++- .../extract/FactOriginIssueMainDailyDao.xml | 2 +- 6 files changed, 60 insertions(+), 7 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java new file mode 100644 index 0000000000..070e6547f7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java @@ -0,0 +1,13 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/9/16 3:56 下午 + */ +public interface ExtractConstant { + + String PARTY = "党员"; + + String STRANGER = "陌生人"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java index 5b54d4c289..4e0e26026c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/IssueLogDailyFormDTO.java @@ -38,6 +38,11 @@ public class IssueLogDailyFormDTO implements Serializable { */ private String agencyId; + /** + * 议题ID + */ + private String issueId; + /** * 日期ID */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index 4cbef41109..480d178c73 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -59,7 +59,6 @@ public class IssueExtractServiceImpl implements IssueExtractService { * @date 2020/9/15 2:02 下午 */ @Override - @Transactional(rollbackFor = Exception.class) public Boolean issueExtractMain(String customerId, String dateId) { // 议题信息查询 @@ -131,13 +130,25 @@ public class IssueExtractServiceImpl implements IssueExtractService { } }); }); + delAndInsertMain(customerId,dateId,result); + return true; + } + + /** + * @Description 议题主表删除插入 + * @param customerId + * @param dateId + * @param result + * @author zxc + * @date 2020/9/16 3:32 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertMain(String customerId,String dateId,List result){ issueMainDailyDao.deleteOldMainRecord(customerId, dateId); issueMainDailyDao.insertIssueMainList(result); - return true; } @Override - @Transactional(rollbackFor = Exception.class) public Boolean issueExtractLog(String customerId, String dateId) { // 查询议题process @@ -184,9 +195,22 @@ public class IssueExtractServiceImpl implements IssueExtractService { } }); }); + delAndInsertLog(customerId,dateId,result); + return true; + } + + /** + * @Description 议题附表删除插入 + * @param customerId + * @param dateId + * @param result + * @author zxc + * @date 2020/9/16 3:32 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertLog(String customerId,String dateId,List result){ issueLogDailyDao.deleteOldLogRecord(customerId, dateId); issueLogDailyDao.insertIssueLogList(result); - return true; } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index 781b139558..3d230f476b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.user.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.ExtractConstant; import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.UserPartyResultDTO; @@ -136,13 +137,18 @@ public class UserServiceImpl implements UserService { collect.forEach((userId,c) -> { AtomicReference isParty = new AtomicReference<>(false); c.forEach(user -> { - if (user.getRoleName().equals("党员")){ + if (user.getRoleName().equals(ExtractConstant.PARTY)){ isParty.set(true); } }); result.put(userId,isParty.get() == true ? NumConstant.ONE : NumConstant.ZERO); }); } + for (String userId : userIds) { + if (!result.containsKey(userId)){ + result.put(userId,NumConstant.ZERO); + } + } return result; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml index 610d323513..ab19b88e80 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueLogDailyDao.xml @@ -55,6 +55,11 @@ - + DELETE + FROM + fact_origin_issue_log_daily + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml index 992c189d52..9d3ad44198 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginIssueMainDailyDao.xml @@ -61,7 +61,7 @@ DELETE FROM - fact_origin_issue_log_daily + fact_origin_issue_main_daily WHERE CUSTOMER_ID = #{customerId} AND DATE_ID = #{dateId} From da6830fd62584a9681c6bd512b8dbec79b9f8618 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 17:49:27 +0800 Subject: [PATCH 19/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ExtractConstant.java | 8 +++ .../result/SatisfactionInfoResultDTO.java | 45 +++++++++++++++ .../com/epmet/dao/issue/StatsIssueDao.java | 19 +++++++ .../com/epmet/service/Issue/IssueService.java | 19 +++++++ .../service/Issue/impl/IssueServiceImpl.java | 25 +++++++++ .../extract/impl/IssueExtractServiceImpl.java | 37 ++++++++++--- .../resources/mapper/issue/StatsIssueDao.xml | 55 +++++++++++++++++-- 7 files changed, 194 insertions(+), 14 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java index 070e6547f7..7bf337367d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/ExtractConstant.java @@ -10,4 +10,12 @@ public interface ExtractConstant { String STRANGER = "陌生人"; + String ISSUE_INFO = "查询议题信息为空"; + + String CREATED_TOPIC_USER_IDENTITY = "查询创建话题用户身份信息为空"; + + String PARENT_AGENCY_ID_LIST = "查询组织上级ID集合为空......"; + + String ISSUE_PROCESS = "查询查询议题process集合为空"; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java new file mode 100644 index 0000000000..7d9f03f897 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/result/SatisfactionInfoResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.extract.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/16 5:14 下午 + */ +@Data +public class SatisfactionInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1194031573388458848L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 议题ID + */ + private String issueId; + + /** + * 动作CODE + */ + private String actionCode; + + /** + * 用户ID + */ + private String userId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index 68fd2b48e7..2ad3653c87 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -1,6 +1,7 @@ package com.epmet.dao.issue; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; @@ -131,4 +132,22 @@ public interface StatsIssueDao extends BaseDao { * @date 2020/9/16 1:48 下午 */ List selectIssueProcessInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询议题满意度评价信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueSatisfactionInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); + + /** + * @Description 查询议题支持反对信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(@Param("customerId")String customerId, @Param("dateId")String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 9fe7edf6d9..1ace044dc5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -1,5 +1,6 @@ package com.epmet.service.Issue; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; @@ -129,4 +130,22 @@ public interface IssueService { * @date 2020/9/16 1:48 下午 */ List selectIssueProcessInfo(String customerId,String dateId); + + /** + * @Description 查询议题满意度评价信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueSatisfactionInfo(String customerId,String dateId); + + /** + * @Description 查询议题支持反对信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + List selectIssueVoteInfo(String customerId,String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index aaa6c3844d..9518266148 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.Issue.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.dto.issue.IssueGridDTO; @@ -106,4 +107,28 @@ public class IssueServiceImpl implements IssueService { public List selectIssueProcessInfo(String customerId, String dateId) { return statsIssueDao.selectIssueProcessInfo(customerId, dateId); } + + /** + * @Description 查询议题满意度评价信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + @Override + public List selectIssueSatisfactionInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueSatisfactionInfo(customerId, dateId); + } + + /** + * @Description 查询议题支持反对信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 1:48 下午 + */ + @Override + public List selectIssueVoteInfo(String customerId, String dateId) { + return statsIssueDao.selectIssueVoteInfo(customerId, dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index 480d178c73..8854de47ff 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -1,16 +1,16 @@ package com.epmet.service.evaluationindex.extract.impl; -import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.dto.form.TimeListResultDTO; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.ExtractConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dao.stats.DimAgencyDao; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; import com.epmet.dto.extract.result.AgencyInfoResultDTO; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; @@ -65,7 +65,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { List listResult = issueService.selectIssueInfo(customerId, dateId); List result = new ArrayList<>(); if (CollectionUtils.isEmpty(listResult)){ - throw new RenException("查询议题信息为空"); + throw new RenException(ExtractConstant.ISSUE_INFO); } listResult.forEach(issue -> { IssueMainDailyFormDTO issueMainDailyFormDTO = ConvertUtils.sourceToTarget(issue, IssueMainDailyFormDTO.class); @@ -90,7 +90,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { List topicIds = listResult.stream().map(issue -> issue.getTopicId()).collect(Collectors.toList()); List topicInfoList = topicService.selectTopicInfo(topicIds); if (CollectionUtils.isEmpty(topicInfoList)){ - throw new RenException("查询创建话题用户身份信息为空"); + throw new RenException(ExtractConstant.CREATED_TOPIC_USER_IDENTITY); } List createTopicUserIds = topicInfoList.stream().map(topic -> topic.getUserId()).distinct().collect(Collectors.toList()); Map topicUserIsParty = userService.selectUserIsParty(createTopicUserIds); @@ -121,7 +121,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { List agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList()); List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); if (CollectionUtils.isEmpty(agencyInfoList)){ - throw new RenException("查询组织上级ID集合为空......"); + throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST); } result.forEach(r -> { agencyInfoList.forEach(pid -> { @@ -150,19 +150,38 @@ public class IssueExtractServiceImpl implements IssueExtractService { @Override public Boolean issueExtractLog(String customerId, String dateId) { - + List result = new ArrayList<>(); // 查询议题process List listResult = issueService.selectIssueProcessInfo(customerId, dateId); if (CollectionUtils.isEmpty(listResult)){ - throw new RenException("查询查询议题process集合为空"); + throw new RenException(ExtractConstant.ISSUE_PROCESS); } - List result = new ArrayList<>(); listResult.forEach(issueProcess -> { IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(issueProcess, IssueLogDailyFormDTO.class); issueLogDailyFormDTO.setOperationUserId(issueProcess.getUserId()); result.add(issueLogDailyFormDTO); }); + // 查询议题满意度 + List satisfactionInfoList = issueService.selectIssueSatisfactionInfo(customerId, dateId); + if (!CollectionUtils.isEmpty(satisfactionInfoList)){ + satisfactionInfoList.forEach(s -> { + IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(s, IssueLogDailyFormDTO.class); + issueLogDailyFormDTO.setOperationUserId(s.getUserId()); + result.add(issueLogDailyFormDTO); + }); + } + + // 查询议题支持反对 + List voteInfoList = issueService.selectIssueVoteInfo(customerId, dateId); + if (!CollectionUtils.isEmpty(voteInfoList)){ + voteInfoList.forEach(v -> { + IssueLogDailyFormDTO issueLogDailyFormDTO = ConvertUtils.sourceToTarget(v, IssueLogDailyFormDTO.class); + issueLogDailyFormDTO.setOperationUserId(v.getUserId()); + result.add(issueLogDailyFormDTO); + }); + } + // 动作操作人的身份标识是否是党员 List userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); Map map = userService.selectUserIsParty(userIds); @@ -180,7 +199,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { List agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList()); List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); if (CollectionUtils.isEmpty(agencyInfoList)){ - throw new RenException("查询组织上级ID集合为空......"); + throw new RenException(ExtractConstant.PARENT_AGENCY_ID_LIST); } TimeListResultDTO timeList = DateUtils.getTimeList(dateId); result.forEach(r -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 1439aa721a..3cf6957432 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -207,15 +207,60 @@ i.CUSTOMER_ID AS customerId, ip.ISSUE_ID AS issueId, ip.CREATED_BY AS userId, - ip.ISSUE_STATUS AS actionCode + (case when i.RESOLVE_TYPE = 'resolved' then 'closed_resolved' + when i.RESOLVE_TYPE = 'unresolved' then 'closed_unresolved' + else i.ISSUE_STATUS end ) AS actionCode FROM issue_process ip - LEFT JOIN issue i ON i.id = ip.issue_id + LEFT JOIN issue i ON i.id = ip.issue_id WHERE i.DEL_FLAG = '0' - AND ip.DEL_FLAG = '0' - AND i.CUSTOMER_ID = #{customerId} - AND DATE_FORMAT(i.CREATED_TIME,'%Y%m%d') = #{dateId} + AND ip.DEL_FLAG = '0' + AND i.CUSTOMER_ID = #{customerId} + AND DATE_FORMAT(i.CREATED_TIME,'%Y%m%d') = #{dateId} + + + + + + + \ No newline at end of file From aecd177bdf6d245db331c5e9a8c139fd02494297 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 17:54:04 +0800 Subject: [PATCH 20/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/impl/IssueExtractServiceImpl.java | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index 8854de47ff..e9e35033e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -60,8 +60,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { */ @Override public Boolean issueExtractMain(String customerId, String dateId) { - - // 议题信息查询 + // 1. 议题信息查询 List listResult = issueService.selectIssueInfo(customerId, dateId); List result = new ArrayList<>(); if (CollectionUtils.isEmpty(listResult)){ @@ -73,7 +72,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { result.add(issueMainDailyFormDTO); }); - // 创建议题人ID + // 2. 创建议题人ID List userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); Map map = userService.selectUserIsParty(userIds); if (null != map){ @@ -85,8 +84,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { }); }); } - - // 创建话题用户身份信息查询 + // 3. 创建话题用户身份信息查询 List topicIds = listResult.stream().map(issue -> issue.getTopicId()).collect(Collectors.toList()); List topicInfoList = topicService.selectTopicInfo(topicIds); if (CollectionUtils.isEmpty(topicInfoList)){ @@ -101,7 +99,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { } }); }); - // 根据dateId赋值 + // 4. 根据dateId赋值 TimeListResultDTO timeList = DateUtils.getTimeList(dateId); result.forEach(r -> { r.setDateId(dateId); @@ -116,8 +114,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { } }); }); - - // 查询pid + // 5. 查询pid List agencyIds = result.stream().map(r -> r.getAgencyId()).distinct().collect(Collectors.toList()); List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); if (CollectionUtils.isEmpty(agencyInfoList)){ @@ -148,10 +145,17 @@ public class IssueExtractServiceImpl implements IssueExtractService { issueMainDailyDao.insertIssueMainList(result); } + /** + * @Description 议题抽取(log) + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/16 9:41 上午 + */ @Override public Boolean issueExtractLog(String customerId, String dateId) { List result = new ArrayList<>(); - // 查询议题process + // 1. 查询议题process List listResult = issueService.selectIssueProcessInfo(customerId, dateId); if (CollectionUtils.isEmpty(listResult)){ throw new RenException(ExtractConstant.ISSUE_PROCESS); @@ -162,7 +166,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { result.add(issueLogDailyFormDTO); }); - // 查询议题满意度 + // 2. 查询议题满意度 List satisfactionInfoList = issueService.selectIssueSatisfactionInfo(customerId, dateId); if (!CollectionUtils.isEmpty(satisfactionInfoList)){ satisfactionInfoList.forEach(s -> { @@ -172,7 +176,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { }); } - // 查询议题支持反对 + // 3. 查询议题支持反对 List voteInfoList = issueService.selectIssueVoteInfo(customerId, dateId); if (!CollectionUtils.isEmpty(voteInfoList)){ voteInfoList.forEach(v -> { @@ -182,7 +186,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { }); } - // 动作操作人的身份标识是否是党员 + // 4. 动作操作人的身份标识是否是党员 List userIds = listResult.stream().map(issue -> issue.getUserId()).distinct().collect(Collectors.toList()); Map map = userService.selectUserIsParty(userIds); if (null != map){ @@ -195,7 +199,7 @@ public class IssueExtractServiceImpl implements IssueExtractService { }); } - // 上级ID + // 5. 上级ID List agencyIds = listResult.stream().map(process -> process.getAgencyId()).distinct().collect(Collectors.toList()); List agencyInfoList = dimAgencyDao.selectAgencyInfo(agencyIds); if (CollectionUtils.isEmpty(agencyInfoList)){ From 42550f5ba1db3c427db524fd8b8cf15874e8be21 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Sep 2020 18:08:04 +0800 Subject: [PATCH 21/27] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E9=99=84=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/extract/form/ExtractFormDTO.java | 25 ++++++++++++++++ .../controller/FactOriginController.java | 29 ++++++++++++++----- .../extract/IssueExtractService.java | 12 ++++---- .../extract/impl/IssueExtractServiceImpl.java | 16 ++++++---- 4 files changed, 62 insertions(+), 20 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java new file mode 100644 index 0000000000..50b3a91f5c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/extract/form/ExtractFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.extract.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/16 6:01 下午 + */ +@Data +public class ExtractFormDTO implements Serializable { + + private static final long serialVersionUID = -6180252151765854242L; + + public interface ExtractForm extends CustomerClientShowGroup{} + + @NotBlank(message = "客户ID不能为空",groups = ExtractForm.class) + private String customerId; + + @NotBlank(message = "dateId不能为空",groups = ExtractForm.class) + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java index 1fce253f62..a8c2eff94f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/FactOriginController.java @@ -1,11 +1,14 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.service.evaluationindex.extract.IssueExtractService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import org.apache.commons.lang3.StringUtils; +import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -26,19 +29,29 @@ public class FactOriginController { @Autowired private FactOriginTopicMainDailyService factOriginTopicMainDailyService; + /** + * @Description 议题抽取(main) + * @param extractFormDTO + * @author zxc + * @date 2020/9/15 2:02 下午 + */ @PostMapping("issueextractmain") - public Result issueExtractMain(){ - String customerId = "3ef7e4bb195eb9e622d68b52509aa940"; - String dateId = "20200811"; - issueExtractService.issueExtractMain(customerId,dateId); + public Result issueExtractMain(@RequestBody ExtractFormDTO extractFormDTO){ + ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); + issueExtractService.issueExtractMain(extractFormDTO); return new Result(); } + /** + * @Description 议题抽取(log) + * @param extractFormDTO + * @author zxc + * @date 2020/9/16 9:41 上午 + */ @PostMapping("issueextractlog") - public Result issueExtractLog(){ - String customerId = "3ef7e4bb195eb9e622d68b52509aa940"; - String dateId = "20200811"; - issueExtractService.issueExtractLog(customerId,dateId); + public Result issueExtractLog(@RequestBody ExtractFormDTO extractFormDTO){ + ValidatorUtils.validateEntity(extractFormDTO, ExtractFormDTO.ExtractForm.class); + issueExtractService.issueExtractLog(extractFormDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java index 97373f53e2..4d05ba19d7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/IssueExtractService.java @@ -1,5 +1,7 @@ package com.epmet.service.evaluationindex.extract; +import com.epmet.dto.extract.form.ExtractFormDTO; + /** * @Author zxc * @DateTime 2020/9/14 5:07 下午 @@ -8,19 +10,17 @@ public interface IssueExtractService { /** * @Description 议题抽取(main) - * @param customerId - * @param dateId + * @param extractFormDTO * @author zxc * @date 2020/9/15 2:02 下午 */ - Boolean issueExtractMain(String customerId, String dateId); + Boolean issueExtractMain(ExtractFormDTO extractFormDTO); /** * @Description 议题抽取(log) - * @param customerId - * @param dateId + * @param extractFormDTO * @author zxc * @date 2020/9/16 9:41 上午 */ - Boolean issueExtractLog(String customerId,String dateId); + Boolean issueExtractLog(ExtractFormDTO extractFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java index e9e35033e3..d277675b03 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/IssueExtractServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.constant.ExtractConstant; import com.epmet.dao.evaluationindex.extract.FactOriginIssueLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginIssueMainDailyDao; import com.epmet.dao.stats.DimAgencyDao; +import com.epmet.dto.extract.form.ExtractFormDTO; import com.epmet.dto.extract.form.IssueLogDailyFormDTO; import com.epmet.dto.extract.form.IssueMainDailyFormDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; @@ -25,6 +26,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.util.CollectionUtils; +import javax.validation.constraints.NotBlank; import java.util.ArrayList; import java.util.List; import java.util.Map; @@ -53,13 +55,14 @@ public class IssueExtractServiceImpl implements IssueExtractService { /** * @Description 议题抽取 - * @param customerId - * @param dateId + * @param extractFormDTO * @author zxc * @date 2020/9/15 2:02 下午 */ @Override - public Boolean issueExtractMain(String customerId, String dateId) { + public Boolean issueExtractMain(ExtractFormDTO extractFormDTO) { + String customerId = extractFormDTO.getCustomerId(); + String dateId = extractFormDTO.getDateId(); // 1. 议题信息查询 List listResult = issueService.selectIssueInfo(customerId, dateId); List result = new ArrayList<>(); @@ -147,13 +150,14 @@ public class IssueExtractServiceImpl implements IssueExtractService { /** * @Description 议题抽取(log) - * @param customerId - * @param dateId + * @param extractFormDTO * @author zxc * @date 2020/9/16 9:41 上午 */ @Override - public Boolean issueExtractLog(String customerId, String dateId) { + public Boolean issueExtractLog(ExtractFormDTO extractFormDTO) { + String customerId = extractFormDTO.getCustomerId(); + String dateId = extractFormDTO.getDateId(); List result = new ArrayList<>(); // 1. 查询议题process List listResult = issueService.selectIssueProcessInfo(customerId, dateId); From bafcf3b0f05fd357cdf8ea7116a0523b9bf73ef3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Sep 2020 14:16:32 +0800 Subject: [PATCH 22/27] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/DataSourceConstant.java | 1 + .../dto/stats/DimCustomerPartymemberDTO.java | 131 ++++++++++++++++++ .../form/CustomerIdAndDateIdFormDTO.java | 25 ++++ .../form/DimCustomerPartyMemberFormDTO.java | 104 ++++++++++++++ .../data-statistical-server/pom.xml | 24 ++++ .../com/epmet/controller/DemoController.java | 11 ++ .../epmet/dao/partymember/PartyMemberDao.java | 29 ++++ .../dao/stats/DimCustomerPartymemberDao.java | 45 ++++++ .../stats/DimCustomerPartymemberEntity.java | 101 ++++++++++++++ .../partymember/PartyMemberService.java | 22 +++ .../impl/PartyMemberServiceImpl.java | 38 +++++ .../stats/DimCustomerPartymemberService.java | 104 ++++++++++++++ .../DimCustomerPartymemberServiceImpl.java | 123 ++++++++++++++++ .../src/main/resources/bootstrap.yml | 5 + .../mapper/partymember/PartyMemberDao.xml | 27 ++++ .../stats/DimCustomerPartymemberDao.xml | 54 ++++++++ .../externalapp/ExtAppJwtTokenUtils.java | 6 +- 17 files changed, 847 insertions(+), 3 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java index f89ede1ba6..ce0dccf1a5 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DataSourceConstant.java @@ -12,5 +12,6 @@ public interface DataSourceConstant { String RESI_GROUP = "resiGroup"; String EPMET_USER = "epmetuser"; String EVALUATION_INDEX = "evaluationIndex"; + String PARTY_MEMBER = "partyMember"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java new file mode 100644 index 0000000000..8e1612fa8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerPartymemberDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +@Data +public class DimCustomerPartymemberDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员认证时的网格id + */ + private String gridId; + + /** + * 所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String parentId; + + /** + * 党员认证成功的日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 用户id + */ + private String userId; + + /** + * 身份证 + */ + private String idCard; + + /** + * 生日 + */ + private Date birthday; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java new file mode 100644 index 0000000000..749d52a1a0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.stats.form; + +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/17 11:02 上午 + */ +@Data +public class CustomerIdAndDateIdFormDTO implements Serializable { + + private static final long serialVersionUID = -3381286960911634231L; + + public interface CustomerIdAndDateId extends CustomerClientShowGroup{} + + @NotBlank(message = "客户ID不能为空",groups = CustomerIdAndDateId.class) + private String customerId; + + @NotBlank(message = "日期Id不能为空",groups = CustomerIdAndDateId.class) + private String dateId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java new file mode 100644 index 0000000000..9a57ade5e6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/DimCustomerPartyMemberFormDTO.java @@ -0,0 +1,104 @@ +package com.epmet.dto.stats.form; + +import com.epmet.commons.tools.constant.NumConstant; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @DateTime 2020/9/17 11:15 上午 + */ +@Data +public class DimCustomerPartyMemberFormDTO implements Serializable { + + private static final long serialVersionUID = -9178779369245037701L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员认证时的网格id + */ + private String gridId; + + /** + * 所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String parentId; + + /** + * 党员认证成功的日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 用户id + */ + private String userId; + + /** + * 身份证 + */ + private String idCard; + + /** + * 生日 + */ + private Date birthday; + + /** + * 删除标识0未删除1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 更新人 + */ + private String updatedBy; + + public DimCustomerPartyMemberFormDTO() { + this.delFlag = NumConstant.ZERO_STR; + this.revision = NumConstant.ZERO; + this.createdBy = "APP_USER"; + this.updatedBy = "APP_USER"; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index d930651a68..70dc12bf01 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -192,6 +192,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -290,6 +296,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -388,6 +400,12 @@ epmet elink@833066 + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com @@ -482,6 +500,12 @@ epmet_evaluation_index_user EpmEt-db-UsEr + + + + epmet_resi_partymember_user + EpmEt-db-UsEr + 0 r-m5ez3n1j0qc3ykq2ut.redis.rds.aliyuncs.com diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 018857ae8e..6db7fd4245 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -16,6 +16,7 @@ import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.indexcal.CalculateCommonFormDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.entity.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyEntity; import com.epmet.entity.evaluationindex.indexcoll.FactIndexServiceAblityGridMonthlyEntity; @@ -27,6 +28,7 @@ import com.epmet.service.StatsDemoService; import com.epmet.service.evaluationindex.extract.FactOriginTopicMainDailyService; import com.epmet.service.evaluationindex.indexcal.*; import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimCustomerPartymemberService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -515,4 +517,13 @@ public class DemoController { } return new Result(); } + + @Autowired + private DimCustomerPartymemberService partymemberService; + + @PostMapping("statsparty") + public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO){ + partymemberService.statsPartyMember(customerIdAndDateIdFormDTO); + return new Result(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java new file mode 100644 index 0000000000..02c0b76a95 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/partymember/PartyMemberDao.java @@ -0,0 +1,29 @@ +package com.epmet.dao.partymember; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.extract.result.IssueInfoResultDTO; +import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; +import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.entity.issue.IssueEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface PartyMemberDao{ + + /** + * @Description 查询党员信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 1:58 下午 + */ + List selectPartyMemberInfo(@Param("customerId") String customerId,@Param("dateId") String dateId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java new file mode 100644 index 0000000000..f8d3e8c295 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.entity.stats.DimCustomerPartymemberEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +@Mapper +public interface DimCustomerPartymemberDao extends BaseDao { + + /** + * @Description 批量插入党员信息 + * @param partyMemberInfos + * @author zxc + * @date 2020/9/17 11:18 上午 + */ + void insertPartyMemberInfo(@Param("partyMemberInfos")List partyMemberInfos); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java new file mode 100644 index 0000000000..2c84bf98c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerPartymemberEntity.java @@ -0,0 +1,101 @@ +/** + * 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 2020-09-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_customer_partymember") +public class DimCustomerPartymemberEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 党员认证时的网格id + */ + private String gridId; + + /** + * 所属机关ID + */ + private String agencyId; + + /** + * agencyId的上一级组织id + */ + private String pid; + + /** + * 党员认证成功的日期yyyyMMdd + */ + private String dateId; + + /** + * 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 用户id + */ + private String userId; + + /** + * 身份证 + */ + private String idCard; + + /** + * 生日 + */ + private Date birthday; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java new file mode 100644 index 0000000000..9f8cdde947 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/PartyMemberService.java @@ -0,0 +1,22 @@ +package com.epmet.service.partymember; + +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/17 1:52 下午 + */ +public interface PartyMemberService { + + /** + * @Description 查询党员信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 1:58 下午 + */ + List selectPartyMemberInfo(String customerId, String dateId); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java new file mode 100644 index 0000000000..6e346a01d7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/partymember/impl/PartyMemberServiceImpl.java @@ -0,0 +1,38 @@ +package com.epmet.service.partymember.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.partymember.PartyMemberDao; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.service.partymember.PartyMemberService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @Author zxc + * @DateTime 2020/9/17 1:53 下午 + */ +@Service +@Slf4j +@DataSource(DataSourceConstant.PARTY_MEMBER) +public class PartyMemberServiceImpl implements PartyMemberService { + + @Autowired + private PartyMemberDao partyMemberDao; + + /** + * @Description 查询党员信息 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 1:58 下午 + */ + @Override + public List selectPartyMemberInfo(String customerId, String dateId){ + return partyMemberDao.selectPartyMemberInfo(customerId, dateId); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java new file mode 100644 index 0000000000..267eca8c73 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerPartymemberService.java @@ -0,0 +1,104 @@ +/** + * 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.commons.tools.page.PageData; +import com.epmet.dto.stats.DimCustomerPartymemberDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.entity.stats.DimCustomerPartymemberEntity; + +import java.util.List; +import java.util.Map; + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +public interface DimCustomerPartymemberService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-09-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-09-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimCustomerPartymemberDTO + * @author generator + * @date 2020-09-17 + */ + DimCustomerPartymemberDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-17 + */ + void save(DimCustomerPartymemberDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-09-17 + */ + void update(DimCustomerPartymemberDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-09-17 + */ + void delete(String[] ids); + + /** + * @Description 统计党员 + * @param customerIdAndDateIdFormDTO + * @author zxc + * @date 2020/9/17 11:05 上午 + */ + Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java new file mode 100644 index 0000000000..5585cebb89 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -0,0 +1,123 @@ +/** + * 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.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.DimCustomerPartymemberDao; +import com.epmet.dto.stats.DimCustomerPartymemberDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.entity.stats.DimCustomerPartymemberEntity; +import com.epmet.service.partymember.PartyMemberService; +import com.epmet.service.stats.DimCustomerPartymemberService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 党员维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-09-17 + */ +@Service +public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl implements DimCustomerPartymemberService { + + @Autowired + private DimCustomerPartymemberDao partyMemberDao; + @Autowired + private PartyMemberService partyMemberService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimCustomerPartymemberDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimCustomerPartymemberDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public DimCustomerPartymemberDTO get(String id) { + DimCustomerPartymemberEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimCustomerPartymemberDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimCustomerPartymemberDTO dto) { + DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimCustomerPartymemberDTO dto) { + DimCustomerPartymemberEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerPartymemberEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 统计党员 + * @param customerIdAndDateIdFormDTO + * @author zxc + * @date 2020/9/17 11:05 上午 + */ + @Override + public Boolean statsPartyMember(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + String customerId = customerIdAndDateIdFormDTO.getCustomerId(); + String dateId = customerIdAndDateIdFormDTO.getDateId(); + List partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); + + return true; + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml index c2b2f726f4..7e0ac4e99d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/bootstrap.yml @@ -170,6 +170,11 @@ dynamic: url: @datasource.druid.evaluationIndex.url@ username: @datasource.druid.evaluationIndex.username@ password: @datasource.druid.evaluationIndex.password@ + partyMember: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.partyMember.url@ + username: @datasource.druid.partyMember.username@ + password: @datasource.druid.partyMember.password@ thread: # 线程池配置 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml new file mode 100644 index 0000000000..85079be740 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml new file mode 100644 index 0000000000..9b8009c7a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -0,0 +1,54 @@ + + + + + + + + INSERT INTO dim_customer_partymember ( + ID, + CUSTOMER_ID, + GRID_ID, + AGENCY_ID, + PARENT_ID, + DATE_ID, + WEEK_ID, + MONTH_ID, + QUARTER_ID, + YEAR_ID, + USER_ID, + ID_CARD, + BIRTHDAY, + DEL_FLAG, + REVISION, + CREATED_BY, + CREATED_TIME, + UPDATED_BY, + UPDATED_TIME + ) + VALUES + + ( + REPLACE ( UUID(), '-', '' ), + #{item.customerId}, + #{item.gridId}, + #{item.agencyId}, + #{item.parentId}, + #{item.dateId}, + #{item.weekId}, + #{item.monthId}, + #{item.quarterId}, + #{item.yearId}, + #{item.userId}, + #{item.idCard}, + #{item.birthday}, + #{item.delFlag}, + #{item.revision}, + #{item.createdBy}, + NOW(), + #{item.updatedBy}, + NOW() + ) + + + \ No newline at end of file diff --git a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java index 2e49c80102..de4de9ed21 100644 --- a/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java +++ b/epmet-module/epmet-common-service/common-service-server/src/main/java/com/epmet/utils/externalapp/ExtAppJwtTokenUtils.java @@ -75,13 +75,13 @@ public class ExtAppJwtTokenUtils { public static void genToken() { HashMap claim = new HashMap<>(); - claim.put("appId", "2c448b7da527055fbeebb628f8d3dcb0"); - claim.put("customerId", "c1"); + claim.put("appId", "acc4ad66c82a7b46e741364b4c62dce2"); + claim.put("customerId", "b09527201c4409e19d1dbc5e3c3429a1"); long ts = System.currentTimeMillis() - 1000 * 60 * 4; System.out.println("时间戳:" + ts); claim.put("ts", ts); - String abc = new ExtAppJwtTokenUtils().createToken(claim, "d4b73db4cf8e46ef99fa1f95149c2791ef2396fded114dd09e406cbce83fc88a"); + String abc = new ExtAppJwtTokenUtils().createToken(claim, "612d304095c50369c3ef06e490f05779eeb8f19ff16566c73aeafafc5fa01970"); System.out.println(abc); } From 2d300f6962dfd05b911a49d85eba281c636af5a6 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Sep 2020 14:55:31 +0800 Subject: [PATCH 23/27] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../result/GridBelongAgencyResultDTO.java | 30 +++++++++++++ .../dao/stats/DimCustomerPartymemberDao.java | 8 ++++ .../java/com/epmet/dao/stats/DimGridDao.java | 9 ++++ .../epmet/service/stats/DimGridService.java | 9 ++++ .../DimCustomerPartymemberServiceImpl.java | 43 ++++++++++++++++++- .../stats/impl/DimGridServiceImpl.java | 12 ++++++ .../mapper/partymember/PartyMemberDao.xml | 7 +-- .../stats/DimCustomerPartymemberDao.xml | 8 ++++ .../resources/mapper/stats/DimGridDao.xml | 20 +++++++++ 9 files changed, 139 insertions(+), 7 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java new file mode 100644 index 0000000000..a04c5fe2b4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/result/GridBelongAgencyResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.stats.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @DateTime 2020/9/17 2:32 下午 + */ +@Data +public class GridBelongAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 6781297915444918432L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所属机关ID + */ + private String agencyId; + + /** + * 机关的上级ID + */ + private String parentId; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java index f8d3e8c295..afab95849a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerPartymemberDao.java @@ -42,4 +42,12 @@ public interface DimCustomerPartymemberDao extends BaseDao partyMemberInfos); + /** + * @Description 删除旧党员记录 + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 2:43 下午 + */ + void deleteOldPartyRecord(@Param("customerId")String customerId,@Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java index c1671131b1..dd2338bb69 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -60,4 +61,12 @@ public interface DimGridDao extends BaseDao { List selectSubAgencyId(@Param("formDTO")List formDTO); DimGridEntity getLastUpdatedGridDim(); + + /** + * @Description 查询网格属于哪个机关 + * @param gridIds + * @author zxc + * @date 2020/9/17 2:34 下午 + */ + List selectGridBelongAgencyInfo(@Param("gridIds") List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java index b937efdf9e..399781d3d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java @@ -23,6 +23,7 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.LastExecRecordEntity; @@ -129,4 +130,12 @@ public interface DimGridService extends BaseService { List selectSubAgencyId(List formDTO); DimGridEntity getLastUpdatedGridDim(); + + /** + * @Description 查询网格属于哪个机关 + * @param gridIds + * @author zxc + * @date 2020/9/17 2:34 下午 + */ + List selectGridBelongAgencyInfo(List gridIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 5585cebb89..b1c349daae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -20,24 +20,32 @@ package com.epmet.service.stats.impl; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.dto.form.TimeListResultDTO; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dao.stats.DimCustomerPartymemberDao; import com.epmet.dto.stats.DimCustomerPartymemberDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.dto.stats.form.DimCustomerPartyMemberFormDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimCustomerPartymemberEntity; import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.DimCustomerPartymemberService; +import com.epmet.service.stats.DimGridService; import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 党员维度表 @@ -52,6 +60,8 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl page(Map params) { @@ -116,8 +126,39 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); - + if (CollectionUtils.isEmpty(partyMemberList)){ + throw new RenException("hahah"); + } + List gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList()); + List agencyInfos = dimGridService.selectGridBelongAgencyInfo(gridIds); + TimeListResultDTO timeList = DateUtils.getTimeList(dateId); + partyMemberList.forEach(party -> { + BeanUtils.copyProperties(timeList,party); + agencyInfos.forEach(agency -> { + if (party.getGridId().equals(agency.getGridId())){ + party.setAgencyId(agency.getAgencyId()); + party.setParentId(agency.getParentId()); + } + }); + }); + delAndInsertParty(partyMemberList,customerId,dateId); return true; } + /** + * @Description 删除旧纪录,插入新纪录 + * @param partyMemberList + * @param customerId + * @param dateId + * @author zxc + * @date 2020/9/17 2:46 下午 + */ + @Transactional(rollbackFor = Exception.class) + public void delAndInsertParty(List partyMemberList,String customerId,String dateId){ + if (!CollectionUtils.isEmpty(partyMemberList)){ + partyMemberDao.deleteOldPartyRecord(customerId, dateId); + partyMemberDao.insertPartyMemberInfo(partyMemberList); + } + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java index cf1b8810ea..241a4b6ddc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java @@ -32,6 +32,7 @@ import com.epmet.dto.group.AgencyDTO; import com.epmet.dto.group.result.AgencyGridInfoResultDTO; import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimGridService; @@ -164,4 +165,15 @@ public class DimGridServiceImpl extends BaseServiceImpl selectGridBelongAgencyInfo(List gridIds) { + return baseDao.selectGridBelongAgencyInfo(gridIds); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml index 85079be740..847228f46a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/partymember/PartyMemberDao.xml @@ -10,12 +10,7 @@ GRID_ID, USER_ID, ID_CARD, - CONCAT( - SUBSTRING( ID_CARD, 7, 4 ), - '-', - SUBSTRING( ID_CARD, 11, 2 ), - '-', - SUBSTRING( ID_CARD, 12, 2 )) AS birthday + STR_TO_DATE( SUBSTRING( ID_CARD, 7, 8 ),'%Y%m%d') AS birthday FROM partymember_info WHERE diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml index 9b8009c7a9..8dbc158531 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerPartymemberDao.xml @@ -51,4 +51,12 @@ ) + + + + DELETE FROM dim_customer_partymember + WHERE + CUSTOMER_ID = #{customerId} + AND DATE_ID = #{dateId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml index eef43456f7..d3f6c044a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml @@ -69,4 +69,24 @@ limit 1; + + + \ No newline at end of file From 286c0edfdf94b415bb57c875ff15be7b2a54b95b Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Sep 2020 14:59:08 +0800 Subject: [PATCH 24/27] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/constant/StatsConstant.java | 11 +++++++++++ .../stats/impl/DimCustomerPartymemberServiceImpl.java | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java new file mode 100644 index 0000000000..15cd8fadc5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java @@ -0,0 +1,11 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @DateTime 2020/9/17 2:56 下午 + */ +public interface StatsConstant { + + String PARTY_INFO_LIST = "查询党员信息集合为空......"; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index b1c349daae..c7d8898a19 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -26,6 +26,7 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.StatsConstant; import com.epmet.dao.stats.DimCustomerPartymemberDao; import com.epmet.dto.stats.DimCustomerPartymemberDTO; import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; @@ -127,7 +128,7 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); if (CollectionUtils.isEmpty(partyMemberList)){ - throw new RenException("hahah"); + throw new RenException(StatsConstant.PARTY_INFO_LIST); } List gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList()); List agencyInfos = dimGridService.selectGridBelongAgencyInfo(gridIds); From ade004c33eb108e5fbdd66ffc51a8f7dc4ca8498 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Sep 2020 15:02:17 +0800 Subject: [PATCH 25/27] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DimController.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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 3318ef39a0..ee8dea833d 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,8 +1,10 @@ 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; import com.epmet.service.StatsDimService; import com.epmet.service.stats.*; import org.slf4j.Logger; @@ -39,6 +41,9 @@ public class DimController { @Autowired private DimAgencyService dimAgencyService; + @Autowired + private DimCustomerPartymemberService partyMemberService; + /** * 初始化所有维度 * @@ -250,4 +255,16 @@ public class DimController { return dimAgencyService.getTopAgencyWithDept(); } + /** + * @Description + * @param customerIdAndDateIdFormDTO + * @author zxc + * @date 2020/9/17 3:01 下午 + */ + @PostMapping("statsparty") + public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + ValidatorUtils.validateEntity(customerIdAndDateIdFormDTO, CustomerIdAndDateIdFormDTO.CustomerIdAndDateId.class); + return new Result().ok(partyMemberService.statsPartyMember(customerIdAndDateIdFormDTO)); + } + } From ccb6c9c9ce13a9faaee014a0624b5a123be58983 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Sep 2020 15:37:45 +0800 Subject: [PATCH 26/27] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=BB=9F=E8=AE=A1,?= =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/StatsConstant.java | 2 + .../form/CustomerIdAndDateIdFormDTO.java | 1 - .../feign/DataStatisticalOpenFeignClient.java | 9 ++++ ...ataStatisticalOpenFeignClientFallBack.java | 6 +++ .../com/epmet/controller/DimController.java | 4 +- .../com/epmet/dao/stats/DimCustomerDao.java | 7 ++++ .../service/stats/DimCustomerService.java | 7 ++++ .../DimCustomerPartymemberServiceImpl.java | 41 +++++++++++-------- .../stats/impl/DimCustomerServiceImpl.java | 10 +++++ .../resources/mapper/stats/DimCustomerDao.xml | 5 +++ .../epmet/service/DimPartyMemberService.java | 13 ++++++ .../impl/DimPartyMemberServiceImpl.java | 27 ++++++++++++ .../com/epmet/task/DimPartyMemberTask.java | 30 ++++++++++++++ 13 files changed, 143 insertions(+), 19 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java index 15cd8fadc5..4102fb9e63 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java @@ -8,4 +8,6 @@ public interface StatsConstant { String PARTY_INFO_LIST = "查询党员信息集合为空......"; + String CUSTOMER_INFO_NULL = "查询所有客户ID为空"; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java index 749d52a1a0..820d3a5447 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/form/CustomerIdAndDateIdFormDTO.java @@ -17,7 +17,6 @@ public class CustomerIdAndDateIdFormDTO implements Serializable { public interface CustomerIdAndDateId extends CustomerClientShowGroup{} - @NotBlank(message = "客户ID不能为空",groups = CustomerIdAndDateId.class) private String customerId; @NotBlank(message = "日期Id不能为空",groups = CustomerIdAndDateId.class) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java index 1f1c1b10fe..c9ca758964 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/DataStatisticalOpenFeignClient.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; @@ -173,4 +174,12 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/statstopic/execute") Result execTopicStatistical(@RequestParam(value = "date",required = false) String date); + /** + * @Description 统计党员 + * @param customerIdAndDateIdFormDTO + * @author zxc + * @date 2020/9/17 3:10 下午 + */ + @PostMapping("/data/stats/dim/statsparty") + Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java index d58fa69ec4..629b2e6762 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -6,6 +6,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.dto.StatsFormDTO; import com.epmet.dto.group.form.GroupStatsFormDTO; import com.epmet.dto.issue.form.IssueJobFromDTO; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; import com.epmet.feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; @@ -170,4 +171,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result execTopicStatistical(String date) { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "execTopicStatistical",date); } + + @Override + public Result getPartyInfo(CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL_SERVER, "getPartyInfo",customerIdAndDateIdFormDTO); + } } 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 ee8dea833d..8796c77d71 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 @@ -262,9 +262,9 @@ public class DimController { * @date 2020/9/17 3:01 下午 */ @PostMapping("statsparty") - public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { + public Result getPartyInfo(@RequestBody CustomerIdAndDateIdFormDTO customerIdAndDateIdFormDTO) { ValidatorUtils.validateEntity(customerIdAndDateIdFormDTO, CustomerIdAndDateIdFormDTO.CustomerIdAndDateId.class); - return new Result().ok(partyMemberService.statsPartyMember(customerIdAndDateIdFormDTO)); + return new Result().ok(partyMemberService.statsPartyMember(customerIdAndDateIdFormDTO)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java index 8bd2c3cf8d..12244e2076 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java @@ -49,4 +49,11 @@ public interface DimCustomerDao extends BaseDao { DimCustomerEntity getLatestCreatedDimEntity(); DimCustomerEntity getLatestUpdatedDimEntity(); + + /** + * @Description 查询所有客户ID + * @author zxc + * @date 2020/9/17 3:30 下午 + */ + List getAllCustomerId(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java index 9d53593957..5a02299b44 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java @@ -116,4 +116,11 @@ public interface DimCustomerService extends BaseService { DimCustomerEntity getLatestCreatedDimEntity(); DimCustomerEntity getLatestUpdatedDimEntity(); + + /** + * @Description 查询所有客户ID + * @author zxc + * @date 2020/9/17 3:30 下午 + */ + List getAllCustomerId(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index c7d8898a19..960ea40b77 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -35,6 +35,7 @@ import com.epmet.dto.stats.result.GridBelongAgencyResultDTO; import com.epmet.entity.stats.DimCustomerPartymemberEntity; import com.epmet.service.partymember.PartyMemberService; import com.epmet.service.stats.DimCustomerPartymemberService; +import com.epmet.service.stats.DimCustomerService; import com.epmet.service.stats.DimGridService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -63,6 +64,8 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl page(Map params) { @@ -124,25 +127,31 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); - if (CollectionUtils.isEmpty(partyMemberList)){ - throw new RenException(StatsConstant.PARTY_INFO_LIST); + + List allCustomerId = dimCustomerService.getAllCustomerId(); + if (CollectionUtils.isEmpty(allCustomerId)){ + throw new RenException(StatsConstant.CUSTOMER_INFO_NULL); } - List gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList()); - List agencyInfos = dimGridService.selectGridBelongAgencyInfo(gridIds); - TimeListResultDTO timeList = DateUtils.getTimeList(dateId); - partyMemberList.forEach(party -> { - BeanUtils.copyProperties(timeList,party); - agencyInfos.forEach(agency -> { - if (party.getGridId().equals(agency.getGridId())){ - party.setAgencyId(agency.getAgencyId()); - party.setParentId(agency.getParentId()); - } + allCustomerId.forEach(customerId -> { + String dateId = customerIdAndDateIdFormDTO.getDateId(); + List partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); + if (CollectionUtils.isEmpty(partyMemberList)){ + throw new RenException(StatsConstant.PARTY_INFO_LIST); + } + List gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList()); + List agencyInfos = dimGridService.selectGridBelongAgencyInfo(gridIds); + TimeListResultDTO timeList = DateUtils.getTimeList(dateId); + partyMemberList.forEach(party -> { + BeanUtils.copyProperties(timeList,party); + agencyInfos.forEach(agency -> { + if (party.getGridId().equals(agency.getGridId())){ + party.setAgencyId(agency.getAgencyId()); + party.setParentId(agency.getParentId()); + } + }); }); + delAndInsertParty(partyMemberList,customerId,dateId); }); - delAndInsertParty(partyMemberList,customerId,dateId); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java index 384c07c6da..85c035160f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -156,4 +156,14 @@ public class DimCustomerServiceImpl extends BaseServiceImpl getAllCustomerId() { + return baseDao.getAllCustomerId(); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml index 13bc6a3e01..54914e24d0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml @@ -40,4 +40,9 @@ order by UPDATED_TIME desc limit 1; + + + \ No newline at end of file diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java new file mode 100644 index 0000000000..d33490b2eb --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/DimPartyMemberService.java @@ -0,0 +1,13 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Author zxc + * @DateTime 2020/9/17 3:05 下午 + */ +public interface DimPartyMemberService { + + Result getPartyInfo(String date); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java new file mode 100644 index 0000000000..e5b86e6d73 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/DimPartyMemberServiceImpl.java @@ -0,0 +1,27 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.stats.form.CustomerIdAndDateIdFormDTO; +import com.epmet.feign.DataStatisticalOpenFeignClient; +import com.epmet.service.DimPartyMemberService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Author zxc + * @DateTime 2020/9/17 3:06 下午 + */ +@Service +public class DimPartyMemberServiceImpl implements DimPartyMemberService { + + @Autowired + private DataStatisticalOpenFeignClient statsFeignClient; + + + @Override + public Result getPartyInfo(String dateId) { + CustomerIdAndDateIdFormDTO c = new CustomerIdAndDateIdFormDTO(); + c.setDateId(dateId); + return statsFeignClient.getPartyInfo(c); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java new file mode 100644 index 0000000000..1998cbe6fa --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DimPartyMemberTask.java @@ -0,0 +1,30 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.DimPartyMemberService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @DateTime 2020/9/17 3:04 下午 + */ +@Slf4j +@Component("dimPartyMemberTask") +public class DimPartyMemberTask implements ITask{ + + @Autowired + private DimPartyMemberService dimPartyMemberService; + + @Override + public void run(String params) { + log.info("dimPartyMemberTask定时任务正在执行,参数为:{}", params); + Result result = dimPartyMemberService.getPartyInfo(params); + if (result.success()){ + log.info("dimPartyMemberTask定时任务执行成功"); + }else { + log.error("dimPartyMemberTask定时任务执行失败:" + result.getMsg()); + } + } +} From 7d9da3f9387d01ad9a9cbfef1196fc29cc8b02c3 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 17 Sep 2020 15:55:14 +0800 Subject: [PATCH 27/27] =?UTF-8?q?=E5=85=9A=E5=91=98=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/constant/StatsConstant.java | 2 +- .../service/stats/impl/DimCustomerPartymemberServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java index 4102fb9e63..a5bec0da20 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsConstant.java @@ -6,7 +6,7 @@ package com.epmet.constant; */ public interface StatsConstant { - String PARTY_INFO_LIST = "查询党员信息集合为空......"; + String PARTY_INFO_LIST = "客户【%s】查询党员信息集合为空......"; String CUSTOMER_INFO_NULL = "查询所有客户ID为空"; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java index 960ea40b77..69f09d0ce0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerPartymemberServiceImpl.java @@ -136,7 +136,7 @@ public class DimCustomerPartymemberServiceImpl extends BaseServiceImpl partyMemberList = partyMemberService.selectPartyMemberInfo(customerId, dateId); if (CollectionUtils.isEmpty(partyMemberList)){ - throw new RenException(StatsConstant.PARTY_INFO_LIST); + throw new RenException(String.format(StatsConstant.PARTY_INFO_LIST,customerId)); } List gridIds = partyMemberList.stream().map(party -> party.getGridId()).distinct().collect(Collectors.toList()); List agencyInfos = dimGridService.selectGridBelongAgencyInfo(gridIds);