From 16cd78c0e256ea5192fcd4d90af997a28651fa4b Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 16 Jun 2020 14:37:31 +0800 Subject: [PATCH 001/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/stats/DimAgencyDTO.java | 105 ++++++++++++++++++ .../com/epmet/dto/stats/DimCustomerDTO.java | 76 +++++++++++++ .../java/com/epmet/dto/stats/DimDateDTO.java | 91 +++++++++++++++ .../com/epmet/dto/stats/DimDepartmentDTO.java | 86 ++++++++++++++ .../java/com/epmet/dto/stats/DimGridDTO.java | 91 +++++++++++++++ .../java/com/epmet/dto/stats/DimMonthDTO.java | 101 +++++++++++++++++ .../com/epmet/dto/stats/DimQuarterDTO.java | 96 ++++++++++++++++ .../epmet/dto/stats/DimTopicStatusDTO.java | 76 +++++++++++++ .../java/com/epmet/dto/stats/DimWeekDTO.java | 96 ++++++++++++++++ .../java/com/epmet/dto/stats/DimYearDTO.java | 76 +++++++++++++ .../data-statistical-server/pom.xml | 4 +- .../com/epmet/dao/stats/DimAgencyDao.java | 34 ++++++ .../com/epmet/dao/stats/DimCustomerDao.java | 33 ++++++ .../java/com/epmet/dao/stats/DimDateDao.java | 33 ++++++ .../com/epmet/dao/stats/DimDepartmentDao.java | 33 ++++++ .../java/com/epmet/dao/stats/DimGridDao.java | 33 ++++++ .../java/com/epmet/dao/stats/DimMonthDao.java | 33 ++++++ .../com/epmet/dao/stats/DimQuarterDao.java | 34 ++++++ .../epmet/dao/stats/DimTopicStatusDao.java | 34 ++++++ .../java/com/epmet/dao/stats/DimWeekDao.java | 33 ++++++ .../epmet/entity/stats/DimAgencyEntity.java | 75 +++++++++++++ .../epmet/entity/stats/DimCustomerEntity.java | 46 ++++++++ .../com/epmet/entity/stats/DimDateEntity.java | 61 ++++++++++ .../entity/stats/DimDepartmentEntity.java | 56 ++++++++++ .../com/epmet/entity/stats/DimGridEntity.java | 61 ++++++++++ .../epmet/entity/stats/DimMonthEntity.java | 71 ++++++++++++ .../epmet/entity/stats/DimQuarterEntity.java | 66 +++++++++++ .../entity/stats/DimTopicStatusEntity.java | 46 ++++++++ .../com/epmet/entity/stats/DimWeekEntity.java | 66 +++++++++++ .../epmet/service/stats/DimAgencyService.java | 95 ++++++++++++++++ .../service/stats/DimCustomerService.java | 95 ++++++++++++++++ .../epmet/service/stats/DimDateService.java | 95 ++++++++++++++++ .../service/stats/DimDepartmentService.java | 95 ++++++++++++++++ .../epmet/service/stats/DimGridService.java | 95 ++++++++++++++++ .../epmet/service/stats/DimMonthService.java | 95 ++++++++++++++++ .../service/stats/DimQuarterService.java | 95 ++++++++++++++++ .../service/stats/DimTopicStatusService.java | 95 ++++++++++++++++ .../epmet/service/stats/DimWeekService.java | 95 ++++++++++++++++ .../epmet/service/stats/DimYearService.java | 95 ++++++++++++++++ .../stats/impl/DemoDataStatsServiceImpl.java | 3 +- .../stats/impl/DimAgencyServiceImpl.java | 100 +++++++++++++++++ .../stats/impl/DimCustomerServiceImpl.java | 100 +++++++++++++++++ .../stats/impl/DimDateServiceImpl.java | 101 +++++++++++++++++ .../stats/impl/DimDepartmentServiceImpl.java | 100 +++++++++++++++++ .../stats/impl/DimGridServiceImpl.java | 100 +++++++++++++++++ .../stats/impl/DimMonthServiceImpl.java | 100 +++++++++++++++++ .../stats/impl/DimQuarterServiceImpl.java | 100 +++++++++++++++++ .../stats/impl/DimTopicStatusServiceImpl.java | 101 +++++++++++++++++ .../stats/impl/DimWeekServiceImpl.java | 100 +++++++++++++++++ .../stats/impl/DimYearServiceImpl.java | 100 +++++++++++++++++ 50 files changed, 3697 insertions(+), 4 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimAgencyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDepartmentDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimGridDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimMonthDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimQuarterDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimTopicStatusDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimWeekDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimYearDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimMonthDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimQuarterDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimTopicStatusDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimWeekDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimMonthEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimQuarterEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimWeekEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimQuarterService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimTopicStatusService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimAgencyDTO.java new file mode 100644 index 0000000000..8a8204cc54 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimAgencyDTO.java @@ -0,0 +1,105 @@ +/** + * 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-06-16 + */ +@Data +public class DimAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织IDAGENCY_ID + */ + private String id; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 删除标识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/DimCustomerDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java new file mode 100644 index 0000000000..86aff5d046 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimCustomerDTO.java @@ -0,0 +1,76 @@ +/** + * 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-06-16 + */ +@Data +public class DimCustomerDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * CUSTOMER_ID + */ + private String id; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 删除标识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/DimDateDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java new file mode 100644 index 0000000000..75c3bf51f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 日期维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimDateDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 日期eg:20200101 + */ + private String id; + + /** + * eg: 2020年01月01日 + */ + private String dateName; + + /** + * 周几:Monday、Tuesday、Wednesday、Thursday、Friday、Saturday、Sunday + */ + private String dayOfWeek; + + /** + * 周几:星期一、星期二、星期三、星期四、星期五、星期六、星期日 + */ + private String dayOfWeekName; + + /** + * dim_week.week_id + */ + private String weekId; + + /** + * 删除标识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/DimDepartmentDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDepartmentDTO.java new file mode 100644 index 0000000000..80e89b4784 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDepartmentDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户部门维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * DEPARTMENT_ID + */ + private String id; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 所属机关ID(customer_agency_dimension.id) + */ + private String agencyId; + + /** + * 来源于customer_dimension + */ + private String customerId; + + /** + * 删除标识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/DimGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimGridDTO.java new file mode 100644 index 0000000000..9b526935f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimGridDTO.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.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * GRID_ID + */ + private String id; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 删除标识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/DimMonthDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimMonthDTO.java new file mode 100644 index 0000000000..40fa150485 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimMonthDTO.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.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 月份维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimMonthDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 月:yyyyMM eg:202001 + */ + private String id; + + /** + * eg: 2020年01月 + */ + private String monthName; + + /** + * 1-12 + */ + private Integer monthOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-31 + */ + private Date endDate; + + /** + * 来源于dim_quarter.id + */ + private String quarterId; + + /** + * 来源于dim_year.id + */ + private String yearId; + + /** + * 删除标识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/DimQuarterDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimQuarterDTO.java new file mode 100644 index 0000000000..b681ef2c15 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimQuarterDTO.java @@ -0,0 +1,96 @@ +/** + * 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-06-16 + */ +@Data +public class DimQuarterDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyyQ1、yyyyQ2、yyyyQ3、yyyyQ4 + */ + private String id; + + /** + * eg: 2020年第一季度、2020年第二季度、2020 + */ + private String quarterName; + + /** + * 1、2、3、4 + */ + private Integer quarterOrder; + + /** + * yyyy-MM-dd + */ + private Date startDate; + + /** + * yyyy-MM-dd + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + + /** + * 删除标识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/DimTopicStatusDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimTopicStatusDTO.java new file mode 100644 index 0000000000..bfd5b3a79f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimTopicStatusDTO.java @@ -0,0 +1,76 @@ +/** + * 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-06-16 + */ +@Data +public class DimTopicStatusDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 话题状态ID"discussing"、"hidden"、"closed" + */ + private String id; + + /** + * 状态描述 讨论中 已屏蔽 已关闭 + */ + private String statusDesc; + + /** + * 删除标识 + */ + 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/DimWeekDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimWeekDTO.java new file mode 100644 index 0000000000..630c9834f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimWeekDTO.java @@ -0,0 +1,96 @@ +/** + * 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-06-16 + */ +@Data +public class DimWeekDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 2020W01 本年度的第几周 + */ + private String id; + + /** + * eg: 2020年第1周 + */ + private String weekName; + + /** + * 1-52 + */ + private Integer weekOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-05 + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + + /** + * 删除标识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/DimYearDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimYearDTO.java new file mode 100644 index 0000000000..5c3d213c6d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimYearDTO.java @@ -0,0 +1,76 @@ +/** + * 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-06-16 + */ +@Data +public class DimYearDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * yyyy eg: 2019 + */ + private String id; + + /** + * 2019年 + */ + private String yearName; + + /** + * 删除标识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-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index f0d1c67ade..aba8f7fd23 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -118,8 +118,8 @@ 0 - 118.190.150.119 - 47379 + 192.168.1.130 + 6379 123456 false 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 new file mode 100644 index 0000000000..a451b9e19f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimAgencyDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimAgencyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimAgencyDao extends BaseDao { + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..5a8a5351ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimCustomerDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimCustomerEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimCustomerDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java new file mode 100644 index 0000000000..f07e5fab41 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimDateEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 日期维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimDateDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java new file mode 100644 index 0000000000..ff03d03a6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户部门维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimDepartmentDao extends BaseDao { + +} \ 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 new file mode 100644 index 0000000000..4a8129f98e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimGridEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimGridDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimMonthDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimMonthDao.java new file mode 100644 index 0000000000..b12c76a4f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimMonthDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimMonthEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 月份维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimMonthDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimQuarterDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimQuarterDao.java new file mode 100644 index 0000000000..f2ec40f5ce --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimQuarterDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimQuarterEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 季度维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimQuarterDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimTopicStatusDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimTopicStatusDao.java new file mode 100644 index 0000000000..cbc26f7a33 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimTopicStatusDao.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; + +import com.epmet.entity.stats.DimTopicStatusEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimTopicStatusDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimWeekDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimWeekDao.java new file mode 100644 index 0000000000..ffabc979d6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimWeekDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.DimWeekEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 周维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface DimWeekDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java new file mode 100644 index 0000000000..4972eedb3b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java @@ -0,0 +1,75 @@ +/** + * 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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_agency") +public class DimAgencyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java new file mode 100644 index 0000000000..ccc124af53 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.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.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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_customer") +public class DimCustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java new file mode 100644 index 0000000000..8b919277a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.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.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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_date") +public class DimDateEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年01月01日 + */ + private String dateName; + + /** + * 周几:Monday、Tuesday、Wednesday、Thursday、Friday、Saturday、Sunday + */ + private String dayOfWeek; + + /** + * 周几:星期一、星期二、星期三、星期四、星期五、星期六、星期日 + */ + private String dayOfWeekName; + + /** + * dim_week.week_id + */ + private String weekId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java new file mode 100644 index 0000000000..66c325c678 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.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.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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_department") +public class DimDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 所属机关ID(customer_agency_dimension.id) + */ + private String agencyId; + + /** + * 来源于customer_dimension + */ + private String customerId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java new file mode 100644 index 0000000000..4a9f423ab0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.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.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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_grid") +public class DimGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimMonthEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimMonthEntity.java new file mode 100644 index 0000000000..d1d43f2b2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimMonthEntity.java @@ -0,0 +1,71 @@ +/** + * 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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_month") +public class DimMonthEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年01月 + */ + private String monthName; + + /** + * 1-12 + */ + private Integer monthOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-31 + */ + private Date endDate; + + /** + * 来源于dim_quarter.id + */ + private String quarterId; + + /** + * 来源于dim_year.id + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimQuarterEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimQuarterEntity.java new file mode 100644 index 0000000000..b0a4ef21f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimQuarterEntity.java @@ -0,0 +1,66 @@ +/** + * 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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_quarter") +public class DimQuarterEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年第一季度、2020年第二季度、2020 + */ + private String quarterName; + + /** + * 1、2、3、4 + */ + private Integer quarterOrder; + + /** + * yyyy-MM-dd + */ + private Date startDate; + + /** + * yyyy-MM-dd + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java new file mode 100644 index 0000000000..b3854b61c3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.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.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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_topic_status") +public class DimTopicStatusEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 状态描述 讨论中 已屏蔽 已关闭 + */ + private String statusDesc; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimWeekEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimWeekEntity.java new file mode 100644 index 0000000000..2069e37477 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimWeekEntity.java @@ -0,0 +1,66 @@ +/** + * 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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("dim_week") +public class DimWeekEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * eg: 2020年第1周 + */ + private String weekName; + + /** + * 1-52 + */ + private Integer weekOrder; + + /** + * yyyy-MM-dd eg:2020-01-01 + */ + private Date startDate; + + /** + * yyyy-MM-dd eg:2020-01-05 + */ + private Date endDate; + + /** + * 来源于dim_year.id + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java new file mode 100644 index 0000000000..7cb47dbcf6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.stats.DimAgencyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimAgencyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimAgencyDTO + * @author generator + * @date 2020-06-16 + */ + DimAgencyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimAgencyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimAgencyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ 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 new file mode 100644 index 0000000000..dc19f54861 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimCustomerService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimCustomerDTO; +import com.epmet.entity.stats.DimCustomerEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimCustomerService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimCustomerDTO + * @author generator + * @date 2020-06-16 + */ + DimCustomerDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimCustomerDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimCustomerDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java new file mode 100644 index 0000000000..b191da62f7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimDateDTO; +import com.epmet.entity.stats.DimDateEntity; + +import java.util.List; +import java.util.Map; + +/** + * 日期维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimDateService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimDateDTO + * @author generator + * @date 2020-06-16 + */ + DimDateDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimDateDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimDateDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java new file mode 100644 index 0000000000..ffb1601678 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimDepartmentDTO; +import com.epmet.entity.stats.DimDepartmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户部门维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimDepartmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimDepartmentDTO + * @author generator + * @date 2020-06-16 + */ + DimDepartmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimDepartmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimDepartmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ 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 new file mode 100644 index 0000000000..dbb255500b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimGridService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.stats.DimGridEntity; + +import java.util.List; +import java.util.Map; + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimGridService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimGridDTO + * @author generator + * @date 2020-06-16 + */ + DimGridDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimGridDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimGridDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java new file mode 100644 index 0000000000..160625db05 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimMonthDTO; +import com.epmet.entity.stats.DimMonthEntity; + +import java.util.List; +import java.util.Map; + +/** + * 月份维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimMonthService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimMonthDTO + * @author generator + * @date 2020-06-16 + */ + DimMonthDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimMonthDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimMonthDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimQuarterService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimQuarterService.java new file mode 100644 index 0000000000..c81738c80f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimQuarterService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimQuarterDTO; +import com.epmet.entity.stats.DimQuarterEntity; + +import java.util.List; +import java.util.Map; + +/** + * 季度维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimQuarterService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimQuarterDTO + * @author generator + * @date 2020-06-16 + */ + DimQuarterDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimQuarterDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimQuarterDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimTopicStatusService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimTopicStatusService.java new file mode 100644 index 0000000000..98d38951a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimTopicStatusService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.entity.stats.DimTopicStatusEntity; + +import java.util.List; +import java.util.Map; + +/** + * 话题状态维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimTopicStatusService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimTopicStatusDTO + * @author generator + * @date 2020-06-16 + */ + DimTopicStatusDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimTopicStatusDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimTopicStatusDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java new file mode 100644 index 0000000000..1cd1f4fc41 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimWeekDTO; +import com.epmet.entity.stats.DimWeekEntity; + +import java.util.List; +import java.util.Map; + +/** + * 周维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimWeekService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimWeekDTO + * @author generator + * @date 2020-06-16 + */ + DimWeekDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimWeekDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimWeekDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java new file mode 100644 index 0000000000..516317f48a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.DimYearDTO; +import com.epmet.entity.stats.DimYearEntity; + +import java.util.List; +import java.util.Map; + +/** + * 年维度表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface DimYearService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return DimYearDTO + * @author generator + * @date 2020-06-16 + */ + DimYearDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(DimYearDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(DimYearDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java index 8c95530636..698a7c2881 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DemoDataStatsServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.service.stats.impl; -import com.epmet.commons.dynamic.datasource.annotation.DataSource; -import com.epmet.constant.DataSourceConstant; + import com.epmet.dao.stats.DimYearDao; import com.epmet.entity.stats.DimYearEntity; import com.epmet.service.stats.DemoDataStatsService; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java new file mode 100644 index 0000000000..817c3b774f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimAgencyDao; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.service.stats.DimAgencyService; +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-06-16 + */ +@Service +public class DimAgencyServiceImpl extends BaseServiceImpl implements DimAgencyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimAgencyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimAgencyDTO.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 DimAgencyDTO get(String id) { + DimAgencyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimAgencyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimAgencyDTO dto) { + DimAgencyEntity entity = ConvertUtils.sourceToTarget(dto, DimAgencyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimAgencyDTO dto) { + DimAgencyEntity entity = ConvertUtils.sourceToTarget(dto, DimAgencyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..4b66ed3e11 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimCustomerServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimCustomerDao; +import com.epmet.dto.stats.DimCustomerDTO; +import com.epmet.entity.stats.DimCustomerEntity; +import com.epmet.service.stats.DimCustomerService; +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-06-16 + */ +@Service +public class DimCustomerServiceImpl extends BaseServiceImpl implements DimCustomerService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimCustomerDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimCustomerDTO.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 DimCustomerDTO get(String id) { + DimCustomerEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimCustomerDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimCustomerDTO dto) { + DimCustomerEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimCustomerDTO dto) { + DimCustomerEntity entity = ConvertUtils.sourceToTarget(dto, DimCustomerEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java new file mode 100644 index 0000000000..7cd094209a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.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.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.DimDateDao; +import com.epmet.dto.stats.DimDateDTO; +import com.epmet.entity.stats.DimDateEntity; +import com.epmet.service.stats.DimDateService; +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-06-16 + */ +@Service +public class DimDateServiceImpl extends BaseServiceImpl implements DimDateService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimDateDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimDateDTO.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 DimDateDTO get(String id) { + DimDateEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimDateDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimDateDTO dto) { + DimDateEntity entity = ConvertUtils.sourceToTarget(dto, DimDateEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimDateDTO dto) { + DimDateEntity entity = ConvertUtils.sourceToTarget(dto, DimDateEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java new file mode 100644 index 0000000000..3b500d1056 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimDepartmentDao; +import com.epmet.dto.stats.DimDepartmentDTO; +import com.epmet.entity.stats.DimDepartmentEntity; +import com.epmet.service.stats.DimDepartmentService; +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-06-16 + */ +@Service +public class DimDepartmentServiceImpl extends BaseServiceImpl implements DimDepartmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimDepartmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimDepartmentDTO.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 DimDepartmentDTO get(String id) { + DimDepartmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimDepartmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimDepartmentDTO dto) { + DimDepartmentEntity entity = ConvertUtils.sourceToTarget(dto, DimDepartmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimDepartmentDTO dto) { + DimDepartmentEntity entity = ConvertUtils.sourceToTarget(dto, DimDepartmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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 new file mode 100644 index 0000000000..1a30850b2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimGridDao; +import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.service.stats.DimGridService; +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-06-16 + */ +@Service +public class DimGridServiceImpl extends BaseServiceImpl implements DimGridService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimGridDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimGridDTO.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 DimGridDTO get(String id) { + DimGridEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimGridDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimGridDTO dto) { + DimGridEntity entity = ConvertUtils.sourceToTarget(dto, DimGridEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimGridDTO dto) { + DimGridEntity entity = ConvertUtils.sourceToTarget(dto, DimGridEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java new file mode 100644 index 0000000000..b495b76284 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimMonthDao; +import com.epmet.dto.stats.DimMonthDTO; +import com.epmet.entity.stats.DimMonthEntity; +import com.epmet.service.stats.DimMonthService; +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-06-16 + */ +@Service +public class DimMonthServiceImpl extends BaseServiceImpl implements DimMonthService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimMonthDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimMonthDTO.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 DimMonthDTO get(String id) { + DimMonthEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimMonthDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimMonthDTO dto) { + DimMonthEntity entity = ConvertUtils.sourceToTarget(dto, DimMonthEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimMonthDTO dto) { + DimMonthEntity entity = ConvertUtils.sourceToTarget(dto, DimMonthEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java new file mode 100644 index 0000000000..a51815d120 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimQuarterServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimQuarterDao; +import com.epmet.dto.stats.DimQuarterDTO; +import com.epmet.entity.stats.DimQuarterEntity; +import com.epmet.service.stats.DimQuarterService; +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-06-16 + */ +@Service +public class DimQuarterServiceImpl extends BaseServiceImpl implements DimQuarterService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimQuarterDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimQuarterDTO.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 DimQuarterDTO get(String id) { + DimQuarterEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimQuarterDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimQuarterDTO dto) { + DimQuarterEntity entity = ConvertUtils.sourceToTarget(dto, DimQuarterEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimQuarterDTO dto) { + DimQuarterEntity entity = ConvertUtils.sourceToTarget(dto, DimQuarterEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.java new file mode 100644 index 0000000000..987c30dcb7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimTopicStatusServiceImpl.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.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.DimTopicStatusDao; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.entity.stats.DimTopicStatusEntity; +import com.epmet.service.stats.DimTopicStatusService; +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-06-16 + */ +@Service +public class DimTopicStatusServiceImpl extends BaseServiceImpl implements DimTopicStatusService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimTopicStatusDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimTopicStatusDTO.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 DimTopicStatusDTO get(String id) { + DimTopicStatusEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimTopicStatusDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimTopicStatusDTO dto) { + DimTopicStatusEntity entity = ConvertUtils.sourceToTarget(dto, DimTopicStatusEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimTopicStatusDTO dto) { + DimTopicStatusEntity entity = ConvertUtils.sourceToTarget(dto, DimTopicStatusEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java new file mode 100644 index 0000000000..878f32fa13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimWeekServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimWeekDao; +import com.epmet.dto.stats.DimWeekDTO; +import com.epmet.entity.stats.DimWeekEntity; +import com.epmet.service.stats.DimWeekService; +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-06-16 + */ +@Service +public class DimWeekServiceImpl extends BaseServiceImpl implements DimWeekService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimWeekDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimWeekDTO.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 DimWeekDTO get(String id) { + DimWeekEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimWeekDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimWeekDTO dto) { + DimWeekEntity entity = ConvertUtils.sourceToTarget(dto, DimWeekEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimWeekDTO dto) { + DimWeekEntity entity = ConvertUtils.sourceToTarget(dto, DimWeekEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java new file mode 100644 index 0000000000..8c2b36ecf6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimYearServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.DimYearDao; +import com.epmet.dto.stats.DimYearDTO; +import com.epmet.entity.stats.DimYearEntity; +import com.epmet.service.stats.DimYearService; +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-06-16 + */ +@Service +public class DimYearServiceImpl extends BaseServiceImpl implements DimYearService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, DimYearDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, DimYearDTO.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 DimYearDTO get(String id) { + DimYearEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, DimYearDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(DimYearDTO dto) { + DimYearEntity entity = ConvertUtils.sourceToTarget(dto, DimYearEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(DimYearDTO dto) { + DimYearEntity entity = ConvertUtils.sourceToTarget(dto, DimYearEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file From c74c526a17972e6dea7e265b03d92396eba2724a Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 16 Jun 2020 14:47:57 +0800 Subject: [PATCH 002/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=95=B0=E6=8D=AE=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/DataSourceConstant.java | 1 + .../data-statistical-server/pom.xml | 11 +++ .../controller/StatsProjectController.java | 23 ++++++ .../com/epmet/dao/project/ProjectDao.java | 33 ++++++++ .../epmet/entity/project/ProjectEntity.java | 78 +++++++++++++++++++ .../epmet/service/StatsProjectService.java | 10 +++ .../service/impl/StatsProjectServiceImpl.java | 18 +++++ .../epmet/service/project/ProjectService.java | 31 ++++++++ .../project/impl/ProjectServiceImpl.java | 41 ++++++++++ .../src/main/resources/bootstrap.yml | 7 +- .../resources/mapper/project/ProjectDao.xml | 7 ++ 11 files changed, 259 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.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 65b235f5e0..b972365b19 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 @@ -5,5 +5,6 @@ public interface DataSourceConstant { String GOV_ORG = "govOrg"; String STATS = "stats"; String GOV_ISSUE = "govIssue"; + String GOV_PROJECT = "govProject"; } diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index aba8f7fd23..90a95b59f0 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -116,6 +116,12 @@ epmet_gov_issue_user EpmEt-db-UsEr + + + + epmet_gov_project_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -162,6 +168,11 @@ epmet elink@833066 + + + + epmet_gov_project_user + EpmEt-db-UsEr 0 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java new file mode 100644 index 0000000000..2c9f83f70a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java @@ -0,0 +1,23 @@ +package com.epmet.controller; + +import com.epmet.service.StatsDemoService; +import com.epmet.service.StatsProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 数据统计-项目 + * @author sun + */ +@RequestMapping("statsProject") +@RestController +public class StatsProjectController { + + @Autowired + private StatsProjectService statsProjectService; + + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java new file mode 100644 index 0000000000..2e531e180a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.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.project; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.project.ProjectEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface ProjectDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java new file mode 100644 index 0000000000..cd696e25c6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectEntity.java @@ -0,0 +1,78 @@ +/** + * 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.project; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project") +public class ProjectEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 来源:议题issue + */ + private String origin; + + /** + * 来源ID + */ + private String originId; + + /** + * 项目标题 + */ + private String title; + + /** + * 状态:待处理 pending,结案closed + */ + private String status; + + /** + * 结案状态:已解决 resolved,未解决 unresolved + */ + private String closedStatus; + + /** + * 所属机关 11:22:33(本机关以及上级所有机关ID) + */ + private String orgIdPath; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java new file mode 100644 index 0000000000..06066f976b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -0,0 +1,10 @@ +package com.epmet.service; + +/** + * 数据统计-项目 + * @author sun + */ +public interface StatsProjectService { + + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java new file mode 100644 index 0000000000..7427ba994d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -0,0 +1,18 @@ +package com.epmet.service.impl; + +import com.epmet.service.StatsProjectService; +import com.epmet.service.project.ProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 数据统计-项目(独立于任何具体数据源外层的service) + * @author sun + */ +@Service +public class StatsProjectServiceImpl implements StatsProjectService { + + @Autowired + private ProjectService projectService; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java new file mode 100644 index 0000000000..a9b03ae838 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.project; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.project.ProjectEntity; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +public interface ProjectService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java new file mode 100644 index 0000000000..702ebf8d89 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -0,0 +1,41 @@ +/** + * 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.project.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.project.ProjectDao; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.service.project.ProjectService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.GOV_PROJECT) +public class ProjectServiceImpl extends BaseServiceImpl implements ProjectService { + @Autowired + private ProjectDao projectDao; + +} \ 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 e9e53f6acb..b25b8a540e 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 @@ -142,4 +142,9 @@ dynamic: driver-class-name: com.mysql.cj.jdbc.Driver url: @datasource.druid.issue.url@ username: @datasource.druid.issue.username@ - password: @datasource.druid.issue.password@ \ No newline at end of file + password: @datasource.druid.issue.password@ + govProject: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.project.url@ + username: @datasource.druid.project.username@ + password: @datasource.druid.project.password@ \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml new file mode 100644 index 0000000000..425f22e0a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file From 52b95b6c7f6c651491d310a88fa9646cfd4216c5 Mon Sep 17 00:00:00 2001 From: wangchao Date: Tue, 16 Jun 2020 14:52:17 +0800 Subject: [PATCH 003/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=B4=E5=BA=A6map?= =?UTF-8?q?per.xml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/stats/DimAgencyDao.xml | 9 +++++++++ .../src/main/resources/mapper/stats/DimCustomerDao.xml | 9 +++++++++ .../src/main/resources/mapper/stats/DimDateDao.xml | 8 ++++++++ .../src/main/resources/mapper/stats/DimDepartmentDao.xml | 9 +++++++++ .../src/main/resources/mapper/stats/DimGridDao.xml | 9 +++++++++ .../src/main/resources/mapper/stats/DimMonthDao.xml | 8 ++++++++ .../src/main/resources/mapper/stats/DimQuarterDao.xml | 8 ++++++++ .../main/resources/mapper/stats/DimTopicStatusDao.xml | 9 +++++++++ .../src/main/resources/mapper/stats/DimWeekDao.xml | 9 +++++++++ 9 files changed, 78 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimMonthDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimQuarterDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimTopicStatusDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimWeekDao.xml 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 new file mode 100644 index 0000000000..c819753376 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimAgencyDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ 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 new file mode 100644 index 0000000000..ed01bed0da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimCustomerDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml new file mode 100644 index 0000000000..899d853e10 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml new file mode 100644 index 0000000000..b644d7c1a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ 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 new file mode 100644 index 0000000000..6c1d1f28ca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimGridDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimMonthDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimMonthDao.xml new file mode 100644 index 0000000000..ffffa6903e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimMonthDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimQuarterDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimQuarterDao.xml new file mode 100644 index 0000000000..e9a609876a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimQuarterDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimTopicStatusDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimTopicStatusDao.xml new file mode 100644 index 0000000000..3c7aec1c8e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimTopicStatusDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimWeekDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimWeekDao.xml new file mode 100644 index 0000000000..04575603f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimWeekDao.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file From 2d8a4ad3d074ba14883c4ce87a022db125aea58c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 16 Jun 2020 15:05:31 +0800 Subject: [PATCH 004/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9C=8D=E5=8A=A1?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=A1=B9=E7=9B=AE=E7=BB=9F=E8=AE=A1=E8=A1=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/stats/FactAgencyProjectDailyDTO.java | 177 ++++++++++++++++++ .../stats/FactAgencyProjectMonthlyDTO.java | 172 +++++++++++++++++ .../dto/stats/FactGridProjectDailyDTO.java | 172 +++++++++++++++++ .../dto/stats/FactGridProjectMonthlyDTO.java | 172 +++++++++++++++++ .../dao/stats/FactAgencyProjectDailyDao.java | 33 ++++ .../stats/FactAgencyProjectMonthlyDao.java | 33 ++++ .../dao/stats/FactGridProjectDailyDao.java | 33 ++++ .../dao/stats/FactGridProjectMonthlyDao.java | 33 ++++ .../stats/FactAgencyProjectDailyEntity.java | 147 +++++++++++++++ .../stats/FactAgencyProjectMonthlyEntity.java | 142 ++++++++++++++ .../stats/FactGridProjectDailyEntity.java | 142 ++++++++++++++ .../stats/FactGridProjectMonthlyEntity.java | 142 ++++++++++++++ .../stats/FactAgencyProjectDailyService.java | 31 +++ .../FactAgencyProjectMonthlyService.java | 31 +++ .../stats/FactGridProjectDailyService.java | 31 +++ .../stats/FactGridProjectMonthlyService.java | 31 +++ .../FactAgencyProjectDailyServiceImpl.java | 36 ++++ .../FactAgencyProjectMonthlyServiceImpl.java | 36 ++++ .../impl/FactGridProjectDailyServiceImpl.java | 36 ++++ .../FactGridProjectMonthlyServiceImpl.java | 36 ++++ .../stats/FactAgencyProjectDailyDao.xml | 8 + .../stats/FactAgencyProjectMonthlyDao.xml | 8 + .../mapper/stats/FactGridProjectDailyDao.xml | 8 + .../stats/FactGridProjectMonthlyDao.xml | 8 + 24 files changed, 1698 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java new file mode 100644 index 0000000000..04ae53b189 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java @@ -0,0 +1,177 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactAgencyProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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/stats/FactAgencyProjectMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java new file mode 100644 index 0000000000..3c56190036 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectMonthlyDTO.java @@ -0,0 +1,172 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactAgencyProjectMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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/stats/FactGridProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java new file mode 100644 index 0000000000..eb25380fb9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java @@ -0,0 +1,172 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactGridProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 截止当日网格下项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日网格下处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日网格下处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日网格下已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日网格下已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 当日网格下项目总数 【该网格下项目总数】 + */ + private Integer gridIncr; + + /** + * 当日网格下处理中项目数 【该网格下未结案项目总数】 + */ + private Integer pendingIncr; + + /** + * 当日网格下已结案项目数 【该网格下已结案项目总数】 + */ + private String closedIncr; + + /** + * 删除标识 【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/stats/FactGridProjectMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java new file mode 100644 index 0000000000..277e87e27e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectMonthlyDTO.java @@ -0,0 +1,172 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据,每月月初定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactGridProjectMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java new file mode 100644 index 0000000000..6e961d85c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactAgencyProjectDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java new file mode 100644 index 0000000000..6cd1e39250 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactAgencyProjectMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactAgencyProjectMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java new file mode 100644 index 0000000000..bc4602ff38 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGridProjectDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactGridProjectDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java new file mode 100644 index 0000000000..ea7b4c0353 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGridProjectMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactGridProjectMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java new file mode 100644 index 0000000000..2fbb30284a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java @@ -0,0 +1,147 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_project_daily") +public class FactAgencyProjectDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java new file mode 100644 index 0000000000..8b147a3f18 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectMonthlyEntity.java @@ -0,0 +1,142 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_agency_project_monthly") +public class FactAgencyProjectMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java new file mode 100644 index 0000000000..509217111d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java @@ -0,0 +1,142 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_project_daily") +public class FactGridProjectDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 截止当日网格下项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日网格下处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日网格下处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日网格下已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日网格下已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 当日网格下项目总数 【该网格下项目总数】 + */ + private Integer gridIncr; + + /** + * 当日网格下处理中项目数 【该网格下未结案项目总数】 + */ + private Integer pendingIncr; + + /** + * 当日网格下已结案项目数 【该网格下已结案项目总数】 + */ + private String closedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java new file mode 100644 index 0000000000..dd79ecc9fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectMonthlyEntity.java @@ -0,0 +1,142 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_grid_project_monthly") +public class FactGridProjectMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 网格Id 【dim_grid.id】 + */ + private String gridId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季维度Id 【dim_quarter.id】 + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当月项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当月处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当月处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当月已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当月已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当月已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当月已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当月已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当月已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当月项目总数 【当前组织及下级前一月新增项目数】 + */ + private Integer projectIncr; + + /** + * 当月处理中项目数 【当前组织及下级前一月新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当月已结案项目数 【当前组织及下级前一月新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当月已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当月已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java new file mode 100644 index 0000000000..49a1030a1e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectDailyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactAgencyProjectDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java new file mode 100644 index 0000000000..38f18b9a8c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactAgencyProjectMonthlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactAgencyProjectMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java new file mode 100644 index 0000000000..88c6aa3286 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactGridProjectDailyEntity; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGridProjectDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java new file mode 100644 index 0000000000..7beb0d019d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactGridProjectMonthlyEntity; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGridProjectMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.java new file mode 100644 index 0000000000..c523aef2a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectDailyServiceImpl.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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactAgencyProjectDailyDao; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; +import com.epmet.service.stats.FactAgencyProjectDailyService; +import org.springframework.stereotype.Service; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactAgencyProjectDailyServiceImpl extends BaseServiceImpl implements FactAgencyProjectDailyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.java new file mode 100644 index 0000000000..5ad3f8eeda --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactAgencyProjectMonthlyServiceImpl.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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactAgencyProjectMonthlyDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import com.epmet.service.stats.FactAgencyProjectMonthlyService; +import org.springframework.stereotype.Service; + +/** + * 机关下月项目数据统计 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactAgencyProjectMonthlyServiceImpl extends BaseServiceImpl implements FactAgencyProjectMonthlyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java new file mode 100644 index 0000000000..2665db9d91 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactGridProjectDailyDao; +import com.epmet.entity.stats.FactGridProjectDailyEntity; +import com.epmet.service.stats.FactGridProjectDailyService; +import org.springframework.stereotype.Service; + +/** + * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactGridProjectDailyServiceImpl extends BaseServiceImpl implements FactGridProjectDailyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java new file mode 100644 index 0000000000..e2f5fb654c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactGridProjectMonthlyDao; +import com.epmet.entity.stats.FactGridProjectMonthlyEntity; +import com.epmet.service.stats.FactGridProjectMonthlyService; +import org.springframework.stereotype.Service; + +/** + * 网格下月项目数据统计表 存放机关下截止到当前月份的各项总数据以及上月新增各项数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Service +public class FactGridProjectMonthlyServiceImpl extends BaseServiceImpl implements FactGridProjectMonthlyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml new file mode 100644 index 0000000000..1b56baee0a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml new file mode 100644 index 0000000000..15e59960ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml new file mode 100644 index 0000000000..42e8b29c51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml new file mode 100644 index 0000000000..67b5a3bfdd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file From 9c580dff2ce17110fd08e9f4eadf9c23ca7e1e85 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 16 Jun 2020 16:11:10 +0800 Subject: [PATCH 005/101] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9C=BA=E5=85=B3?= =?UTF-8?q?=E3=80=81=E6=97=A5=E7=BB=B4=E5=BA=A6=E8=A1=A8=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E5=85=B1=E7=94=A8=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StatsProjectController.java | 19 +++++++++--- .../com/epmet/dao/stats/DimAgencyDao.java | 12 ++++++- .../java/com/epmet/dao/stats/DimDateDao.java | 12 ++++++- .../epmet/service/StatsProjectService.java | 7 +++++ .../service/impl/StatsProjectServiceImpl.java | 31 +++++++++++++++++++ .../epmet/service/stats/DimAgencyService.java | 8 +++++ .../epmet/service/stats/DimDateService.java | 8 +++++ .../stats/impl/DimAgencyServiceImpl.java | 11 +++++++ .../stats/impl/DimDateServiceImpl.java | 11 +++++++ .../resources/mapper/stats/DimAgencyDao.xml | 12 ++++++- .../resources/mapper/stats/DimDateDao.xml | 13 +++++++- 11 files changed, 135 insertions(+), 9 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java index 2c9f83f70a..6c7c907c15 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java @@ -1,23 +1,32 @@ package com.epmet.controller; +import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsDemoService; import com.epmet.service.StatsProjectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; /** * 数据统计-项目 * @author sun */ -@RequestMapping("statsProject") +@RequestMapping("statsproject") @RestController public class StatsProjectController { @Autowired private StatsProjectService statsProjectService; - + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + @PostMapping("agencyproject/{customerId}") + public Result statsAgencyProject(@PathVariable("customerId") String customerId) { + statsProjectService.statsAgencyProject(customerId); + return new Result(); + } } 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 a451b9e19f..9ead9c7114 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 @@ -19,9 +19,12 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.stats.DimAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 机关维度 * @@ -30,5 +33,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DimAgencyDao extends BaseDao { - + + /** + * @param dto + * @return + * @Author sun + * @Description 根据客户Id查询机关维度列表数据 + **/ + List selectDimAgencyList(DimAgencyDTO dto); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java index f07e5fab41..b5716a6108 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java @@ -18,9 +18,12 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.DimDateDTO; import com.epmet.entity.stats.DimDateEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 日期维度表 * @@ -29,5 +32,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DimDateDao extends BaseDao { - + + /** + * @param dto + * @return + * @Author sun + * @Description 根据创建时间查询日维度信息 + **/ + List selectDimDate(DimDateDTO dto); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java index 06066f976b..c2d837d172 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -7,4 +7,11 @@ package com.epmet.service; public interface StatsProjectService { + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + void statsAgencyProject(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index 7427ba994d..24214d1262 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -2,6 +2,7 @@ package com.epmet.service.impl; import com.epmet.service.StatsProjectService; import com.epmet.service.project.ProjectService; +import com.epmet.service.stats.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -12,7 +13,37 @@ import org.springframework.stereotype.Service; @Service public class StatsProjectServiceImpl implements StatsProjectService { + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private DimDateService dimDateService; + @Autowired + private DimWeekService dimWeekService; + @Autowired + private DimMonthService dimMonthService; + @Autowired + private DimQuarterService dimQuarterService; + @Autowired + private DimYearService dimYearService; @Autowired private ProjectService projectService; + @Autowired + private FactAgencyProjectDailyService factAgencyProjectDailyService; + @Autowired + private FactAgencyProjectMonthlyService factAgencyProjectMonthlyService; + @Autowired + private FactGridProjectDailyService factGridProjectDailyService; + @Autowired + private FactGridProjectMonthlyService factGridProjectMonthlyService; + + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + @Override + public void statsAgencyProject(String customerId) { + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index 7cb47dbcf6..87fcd68627 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -92,4 +92,12 @@ public interface DimAgencyService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + /** + * @param dto + * @return + * @Author sun + * @Description 根据客户Id查询机关维度列表数据 + **/ + List getDimAgencyList(DimAgencyDTO dto); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java index b191da62f7..4960ea3629 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java @@ -92,4 +92,12 @@ public interface DimDateService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + /** + * @param dto + * @return + * @Author sun + * @Description 根据创建时间查询日维度信息 + **/ + List getDimDate(DimDateDTO dto); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 817c3b774f..c9de98bb4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -97,4 +97,15 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getDimAgencyList(DimAgencyDTO dto) { + return baseDao.selectDimAgencyList(dto); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index 7cd094209a..a52e25c05b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -98,4 +98,15 @@ public class DimDateServiceImpl extends BaseServiceImpl getDimDate(DimDateDTO dto) { + return baseDao.selectDimDate(dto); + } + } \ 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 c819753376..5ca1ddca1c 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 @@ -4,6 +4,16 @@ - + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml index 899d853e10..c79644a662 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml @@ -3,6 +3,17 @@ - + \ No newline at end of file From 62bb828309e57c8ab2cc511e0cc10b4ef7b26328 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 16 Jun 2020 16:18:24 +0800 Subject: [PATCH 006/101] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/controller/DemoController.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 ae5394b285..85c82b47dd 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 @@ -7,7 +7,6 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import java.time.LocalDateTime; -import java.util.concurrent.Callable; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Future; @@ -32,6 +31,9 @@ public class DemoController { demoService.testTx(); } + /** + * 异步方式1,手动submit + */ @GetMapping("testthreadpool") public void testThreadPool() { System.out.println(LocalDateTime.now().getSecond());; @@ -43,7 +45,7 @@ public class DemoController { Future future3 = executorService.submit(() -> demoService.testThreadPool()); try { - + // 可以获取返回值,此处会阻塞 Boolean o1 = future1.get(); System.out.println(LocalDateTime.now().getSecond()); @@ -61,6 +63,9 @@ public class DemoController { } } + /** + * 异步方式2,service方法中加注解@Async + */ @GetMapping("testthreadpoolasyncs") public void testThreadPoolAsync() { System.out.println(LocalDateTime.now().getSecond()); From 345364d980306c1cf83c4fa3c2219328bee00e6d Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 16 Jun 2020 17:51:40 +0800 Subject: [PATCH 007/101] =?UTF-8?q?sql=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/stats/DimDateDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml index c79644a662..d308ac2736 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml @@ -11,7 +11,7 @@ WHERE del_flag = '0' - AND DATE_FORMAT(created_time, "%Y-%m-%d") = #{createdTime} + AND DATE_FORMAT(created_time, "%Y-%m-%d") = DATE_FORMAT(#{createdTime}, "%Y-%m-%d") ORDER BY created_time DESC From 297a136e84e9b334725993cd5781af4172533d97 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 16 Jun 2020 23:31:56 +0800 Subject: [PATCH 008/101] =?UTF-8?q?1.=E6=8C=89=E6=97=A5=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 57 ++++++++++++++ .../epmet/constant/DatePatternConstant.java | 8 ++ .../data-statistical-server/pom.xml | 12 +-- .../epmet/controller/DimDateController.java | 27 +++++++ .../java/com/epmet/dao/stats/DimDateDao.java | 7 ++ .../epmet/service/stats/DimDateService.java | 3 + .../stats/impl/DimDateServiceImpl.java | 74 ++++++++++++++++++- .../resources/mapper/stats/DimDateDao.xml | 15 ++++ 8 files changed, 193 insertions(+), 10 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimDateController.java 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 e4fcc31010..616092ce1c 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 @@ -16,6 +16,7 @@ import org.joda.time.format.DateTimeFormatter; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; /** @@ -34,6 +35,13 @@ public class DateUtils { /** 时间格式(yyyy-MM-dd HH:mm) */ public final static String DATE_TIME_PATTERN_END_WITH_MINUTE = "yyyy-MM-dd HH:mm"; + public static final String DATE_PATTERN_YYYYMMDD = "yyyyMMdd"; + public static final String DATE_NAME_PATTERN = "yyyy年MM月dd日"; + public static final String DATE_PATTERN_YYYY = "yyyy"; + + public static final String WEEK_TYPE_ENGLISH = "english"; + public static final String WEEK_TYPE_CHINESE = "chinese"; + /** * 日期格式化 日期格式为:yyyy-MM-dd * @param date 日期 @@ -184,4 +192,53 @@ public class DateUtils { DateTime dateTime = new DateTime(date); return dateTime.plusYears(years).toDate(); } + + /** + * 获取星期几,例如:星期一 + * @param date + * @return + */ + public static String getWeekNameOfWeek(Date date, String type) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); + String[] chineseWeekDayName = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" }; + String[] englishWeekDayName = { "Sunday", "Monday","Tuesday","Wednesday","Thursday","Friday","Saturday" }; + + String weekDayName; + switch (type) { + case WEEK_TYPE_ENGLISH: + weekDayName = englishWeekDayName[dayOfWeek - 1]; + break; + case WEEK_TYPE_CHINESE: + weekDayName = chineseWeekDayName[dayOfWeek - 1]; + break; + default: + weekDayName = ""; + } + + return weekDayName; + } + + //public static String getEnglishWeekName(Date date) { + // new SimpleDateFormat("E"); + //} + + /** + * 获取属于一年的第几周 + * @param date + * @return + */ + public static int getWeekOfYear(Date date) { + DateTime dateTime = new DateTime(date); + return dateTime.getWeekOfWeekyear(); + } + + public static void main(String[] args) { + //int weekOfYear = getWeekOfYear(new Date()); + + String e = DateUtils.format(new Date(), "E"); + + System.out.println(e); + } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java new file mode 100644 index 0000000000..867752ebdc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java @@ -0,0 +1,8 @@ +package com.epmet.constant; + +/** + * 日期格式常量 + */ +public interface DatePatternConstant { + +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index b89a0a789e..6d9b40adcd 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -99,33 +99,33 @@ - + epmet_data_statistical_user EpmEt-db-UsEr - + epmet_gov_org_user EpmEt-db-UsEr - + epmet_gov_issue_user EpmEt-db-UsEr - + epmet_gov_project_user EpmEt-db-UsEr 0 - 192.168.1.130 - 6379 + 118.190.150.119 + 47379 123456 false diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimDateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimDateController.java new file mode 100644 index 0000000000..ed44578476 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimDateController.java @@ -0,0 +1,27 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.stats.DimDateService; +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; + +@RestController +@RequestMapping("dim") +public class DimDateController { + + @Autowired + private DimDateService dimDateService; + + /** + * 初始化按日维度 + * @return + */ + @PostMapping("/date/init") + public Result initDim() { + dimDateService.initDimDate(); + return new Result(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java index b5716a6108..3a1436cbcc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java @@ -40,4 +40,11 @@ public interface DimDateDao extends BaseDao { * @Description 根据创建时间查询日维度信息 **/ List selectDimDate(DimDateDTO dto); + + /** + * 最新的按日维度 + */ + DimDateDTO getLatestDimDate(); + + int insertOne(DimDateEntity dimDateEntity); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java index 4960ea3629..8c376e33e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDateService.java @@ -100,4 +100,7 @@ public interface DimDateService extends BaseService { * @Description 根据创建时间查询日维度信息 **/ List getDimDate(DimDateDTO dto); + + void initDimDate(); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index a52e25c05b..4ec6214798 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -23,6 +23,8 @@ 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.commons.tools.utils.DateUtils; +import com.epmet.constant.DatePatternConstant; import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.stats.DimDateDTO; import com.epmet.entity.stats.DimDateEntity; @@ -32,9 +34,8 @@ 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; +import java.time.LocalDateTime; +import java.util.*; /** * 日期维度表 @@ -45,7 +46,6 @@ import java.util.Map; @Service public class DimDateServiceImpl extends BaseServiceImpl implements DimDateService { - @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -109,4 +109,70 @@ public class DimDateServiceImpl extends BaseServiceImpl + + + + + INSERT INTO dim_date + (ID, DATE_NAME, DAY_OF_WEEK, DAY_OF_WEEK_NAME, WEEK_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + (#{id}, #{dateName}, #{dayOfWeek}, #{dayOfWeekName}, #{weekId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + \ No newline at end of file From dfa7e3d7b220f2a3dd03e5fe9ed3a294470881e6 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 16 Jun 2020 23:34:28 +0800 Subject: [PATCH 009/101] =?UTF-8?q?1.DimController=E9=87=8D=E5=91=BD?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/{DimDateController.java => DimController.java} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/{DimDateController.java => DimController.java} (95%) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimDateController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java similarity index 95% rename from epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimDateController.java rename to epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java index ed44578476..6a33c586ae 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimDateController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DimController.java @@ -9,7 +9,7 @@ import org.springframework.web.bind.annotation.RestController; @RestController @RequestMapping("dim") -public class DimDateController { +public class DimController { @Autowired private DimDateService dimDateService; From 75d5d7ae43cc7675c2242631c71228237546f4c1 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 17 Jun 2020 10:46:41 +0800 Subject: [PATCH 010/101] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E7=BB=B4=E5=BA=A6=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical-server/pom.xml | 20 ++--- .../com/epmet/controller/DimController.java | 16 +++- .../com/epmet/dao/org/CustomerGridDao.java | 44 ++++++++++ .../java/com/epmet/dao/stats/DimGridDao.java | 8 +- .../epmet/entity/org/CustomerGridEntity.java | 82 +++++++++++++++++++ .../com/epmet/service/StatsDimService.java | 7 ++ .../service/impl/StatsDimServiceImpl.java | 68 +++++++++++++++ .../service/org/CustomerGridService.java | 17 ++++ .../org/impl/CustomerGridServiceImpl.java | 25 ++++++ .../epmet/service/stats/DimGridService.java | 7 ++ .../stats/impl/DimGridServiceImpl.java | 15 +++- .../src/main/resources/bootstrap.yml | 13 --- .../resources/mapper/org/CustomerGridDao.xml | 21 +++++ .../resources/mapper/stats/DimGridDao.xml | 8 +- 14 files changed, 324 insertions(+), 27 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 6d9b40adcd..a69f4c06b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -99,33 +99,33 @@ - + epmet_data_statistical_user EpmEt-db-UsEr - + epmet_gov_org_user EpmEt-db-UsEr - + epmet_gov_issue_user EpmEt-db-UsEr - + epmet_gov_project_user EpmEt-db-UsEr 0 - 118.190.150.119 - 47379 + 192.168.1.130 + 6379 123456 false @@ -140,8 +140,8 @@ false - 10 - 20 + 5 + 8 10 30 @@ -198,8 +198,8 @@ true - 10 - 30 + 5 + 8 10 30 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 6a33c586ae..9c53f16bab 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,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsDimService; import com.epmet.service.stats.DimDateService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -14,14 +15,27 @@ public class DimController { @Autowired private DimDateService dimDateService; + @Autowired + private StatsDimService statsDimService; + /** * 初始化按日维度 * @return */ @PostMapping("/date/init") - public Result initDim() { + public Result initDateDim() { dimDateService.initDimDate(); return new Result(); } + /** + * 初始化网格维度 + * @return + */ + @PostMapping("/grid/init") + public Result initGridDim() { + statsDimService.initGridDim(); + return new Result(); + } + } 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 new file mode 100644 index 0000000000..ee1547a190 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerGridDao.java @@ -0,0 +1,44 @@ +/** + * 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.org; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.org.CustomerGridEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Mapper +public interface CustomerGridDao extends BaseDao { + + /** + * 根据创建时间,截取时间段内的网格 + * @param start + * @param end + * @return + */ + List listGridsByCreateTime(@Param("start") Date start, @Param("end") Date end); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimGridDao.java index 4a8129f98e..a2d36e2481 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 @@ -18,9 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.Date; +import java.util.List; + /** * 客户网格维度 * @@ -29,5 +33,7 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DimGridDao extends BaseDao { - + + DimGridEntity getLastCreatedGridDimEntity(); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java new file mode 100644 index 0000000000..6c01df7df8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerGridEntity.java @@ -0,0 +1,82 @@ +/** + * 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.org; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户网格表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_grid") +public class CustomerGridEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格名称 + */ + private String gridName; + + /** + * 中心位置经度 + */ + private String longitude; + + /** + * 中心位置纬度 + */ + private String latitude; + + /** + * 所属地区码(所属组织地区码) + */ + private String areaCode; + + /** + * 管辖区域 + */ + private String manageDistrict; + + /** + * 当前网格总人数 + */ + private Integer totalUser; + + /** + * 所属组织机构ID(customer_organization.id) + */ + private String pid; + + /** + * 所有上级组织ID + */ + private String pids; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java new file mode 100644 index 0000000000..d678c16447 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java @@ -0,0 +1,7 @@ +package com.epmet.service; + +public interface StatsDimService { + + void initGridDim(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java new file mode 100644 index 0000000000..50a83f3489 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -0,0 +1,68 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.service.StatsDimService; +import com.epmet.service.org.CustomerGridService; +import com.epmet.service.stats.DimGridService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; +import java.util.stream.Collectors; + +@Service +public class StatsDimServiceImpl implements StatsDimService { + + @Autowired + private DimGridService dimGridService; + + @Autowired + private CustomerGridService customerGridService; + + @Override + public void initGridDim() { + DimGridEntity lastCreatedGridDim = dimGridService.getLastCreatedGridDim(); + List grids; + if (lastCreatedGridDim == null) { + // 首次初始化 + grids = customerGridService.listGridsByCreateTime(null, null); + } else { + // 非首次初始化 + // 结束时间边界与开始时间边界,包含开始时间不包含结束时间。结束时间可以为空,则查询从开始时间往后的所有新创建网格 + //Date endTimeBorder = DateUtils.parse(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD); + Date startTimeBorder = DateUtils.parse(DateUtils.format(lastCreatedGridDim.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD); + + grids = customerGridService.listGridsByCreateTime(startTimeBorder, null); + } + + List gridDims = convertCustomerGrid2GridDim(grids); + dimGridService.addGridDims(gridDims); + } + + /** + * 将网格信息转换成网格维度信息 + * @param grids + * @return + */ + private List convertCustomerGrid2GridDim(List grids) { + Date now = new Date(); + return grids.stream().map(grid -> { + DimGridEntity dimGrid = new DimGridEntity(); + dimGrid.setAgencyId(grid.getPid()); + dimGrid.setAreaCode(grid.getAreaCode()); + dimGrid.setCustomerId(grid.getCustomerId()); + dimGrid.setGridName(grid.getGridName()); + dimGrid.setCreatedBy("APP_USER"); + dimGrid.setCreatedTime(now); + dimGrid.setDelFlag("0"); + dimGrid.setId(grid.getId()); + dimGrid.setRevision(0); + dimGrid.setUpdatedBy("APP_USER"); + dimGrid.setUpdatedTime(now); + return dimGrid; + }).collect(Collectors.toList()); + } +} 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 new file mode 100644 index 0000000000..b8308aede1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerGridService.java @@ -0,0 +1,17 @@ +package com.epmet.service.org; + +import com.epmet.entity.org.CustomerGridEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerGridService { + /** + * 根据创建时间,截取时间段内的网格 + * @param start + * @param end + * @return + * @Param("start") Date start, @Param("end") Date end + */ + List listGridsByCreateTime(Date start, Date end); +} 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 new file mode 100644 index 0000000000..191b074d19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerGridServiceImpl.java @@ -0,0 +1,25 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.CustomerGridDao; +import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.service.org.CustomerGridService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class CustomerGridServiceImpl implements CustomerGridService { + + @Autowired + private CustomerGridDao customerGridDao; + + @Override + public List listGridsByCreateTime(Date start, Date end) { + return customerGridDao.listGridsByCreateTime(start, end); + } +} 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 dbb255500b..989d20704b 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 @@ -20,8 +20,11 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.stats.DimGridEntity; +import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; import java.util.Map; @@ -92,4 +95,8 @@ public interface DimGridService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + DimGridEntity getLastCreatedGridDim(); + + void addGridDims(List gridDims); } \ 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 1a30850b2c..10f4dd0db2 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 @@ -28,7 +28,6 @@ import com.epmet.dto.stats.DimGridDTO; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.stats.DimGridService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -97,4 +96,18 @@ public class DimGridServiceImpl extends BaseServiceImpl gridDims) { + for (DimGridEntity gridDim : gridDims) { + baseDao.insert(gridDim); + } + } + + } \ 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 1fa687b8a9..4d0a2dce64 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 @@ -61,19 +61,6 @@ spring: baseline-on-migrate: true baseline-version: 0 -#stats: -# datasources: -# - name: statsDatasource -# driver-class-name: com.mysql.cj.jdbc.Driver -# url: @datasource.druid.stats.url@ -# username: @datasource.druid.stats.username@ -# password: @datasource.druid.stats.password@ -# - name: orgDatasource -# driver-class-name: com.mysql.cj.jdbc.Driver -# url: @datasource.druid.org.url@ -# username: @datasource.druid.org.username@ -# password: @datasource.druid.org.password@ - management: endpoints: web: 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 new file mode 100644 index 0000000000..54e81a8d69 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerGridDao.xml @@ -0,0 +1,21 @@ + + + + + + + + \ 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 6c1d1f28ca..67d130dfde 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 @@ -3,7 +3,13 @@ - + \ No newline at end of file From 157c09ec119be9ce4701b6f7e38faf2150788059 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Wed, 17 Jun 2020 16:34:54 +0800 Subject: [PATCH 011/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E6=A8=A1=E5=9D=97sql?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../db/migration/data_statistical.sql | 650 ++++++++++++++++++ 1 file changed, 650 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql new file mode 100644 index 0000000000..adeeac3769 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -0,0 +1,650 @@ +/*================================ 宣传能力 ======================================*/ + +/* + Navicat Premium Data Transfer + + Source Server : localhost + Source Server Type : MySQL + Source Server Version : 50720 + Source Host : localhost:3306 + Source Schema : pd + + Target Server Type : MySQL + Target Server Version : 50720 + File Encoding : 65001 + + Date: 16/06/2020 18:04:53 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for fact_article_published_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_article_published_agency_daily`; +CREATE TABLE `fact_article_published_agency_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【机关】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_article_published_agency_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_article_published_department_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_article_published_department_daily`; +CREATE TABLE `fact_article_published_department_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布文章单位所属机关ID 发布文章单位所属机关ID', + `DEPSARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【部门】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_article_published_department_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_article_published_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_article_published_grid_daily`; +CREATE TABLE `fact_article_published_grid_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布单位所属机关ID 发布单位所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', + `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【网格】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_article_published_grid_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_daily`; +CREATE TABLE `fact_tag_used_agency_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_agency_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_monthly`; +CREATE TABLE `fact_tag_used_agency_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_agency_monthly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_agency_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_quarterly`; +CREATE TABLE `fact_tag_used_agency_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_agency_quarterly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_agency_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_agency_yearly`; +CREATE TABLE `fact_tag_used_agency_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_agency_yearly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_department_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_daily`; +CREATE TABLE `fact_tag_used_department_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID', + `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_department_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_department_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_monthly`; +CREATE TABLE `fact_tag_used_department_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_department_monthly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_department_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_quarterly`; +CREATE TABLE `fact_tag_used_department_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_department_quarterly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_department_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_department_yearly`; +CREATE TABLE `fact_tag_used_department_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_department_yearly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_daily`; +CREATE TABLE `fact_tag_used_grid_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_grid_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_monthly`; +CREATE TABLE `fact_tag_used_grid_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_grid_monthly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_quarterly`; +CREATE TABLE `fact_tag_used_grid_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_grid_quarterly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_used_grid_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_used_grid_yearly`; +CREATE TABLE `fact_tag_used_grid_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_used_grid_yearly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_daily`; +CREATE TABLE `fact_tag_viewed_agency_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_agency_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_monthly`; +CREATE TABLE `fact_tag_viewed_agency_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_agency_monthly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_quarterly`; +CREATE TABLE `fact_tag_viewed_agency_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_agency_quarterly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_agency_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_agency_yearly`; +CREATE TABLE `fact_tag_viewed_agency_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `PID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '上级机关ID 上级机关ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '机关ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_agency_yearly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_daily +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_daily`; +CREATE TABLE `fact_tag_viewed_grid_daily` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日', + `WEEK_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '周ID 周ID eg:2020W01 = 2020年第一周', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】日统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_grid_daily +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_monthly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_monthly`; +CREATE TABLE `fact_tag_viewed_grid_monthly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】月统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_grid_monthly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_quarterly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_quarterly`; +CREATE TABLE `fact_tag_viewed_grid_quarterly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】季度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_grid_quarterly +-- ---------------------------- + +-- ---------------------------- +-- Table structure for fact_tag_viewed_grid_yearly +-- ---------------------------- +DROP TABLE IF EXISTS `fact_tag_viewed_grid_yearly`; +CREATE TABLE `fact_tag_viewed_grid_yearly` ( + `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', + `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', + `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '文章发布所属机关ID 文章发布所属机关ID', + `GRID_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '网格ID', + `TAG_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签ID 标签ID', + `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', + `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', + `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', + `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', + `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', + `CREATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '创建时间', + `UPDATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新人', + `UPDATED_TIME` datetime(0) NULL DEFAULT NULL COMMENT '更新时间', + PRIMARY KEY (`ID`) USING BTREE +) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】年度统计表' ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- Records of fact_tag_viewed_grid_yearly +-- ---------------------------- + +SET FOREIGN_KEY_CHECKS = 1; From 99ce197cc2a697fb0bf912bb5cac8053808246ae Mon Sep 17 00:00:00 2001 From: jianjun Date: Wed, 17 Jun 2020 18:00:56 +0800 Subject: [PATCH 012/101] =?UTF-8?q?=E9=85=8D=E7=BD=AEgov=5Fvoice=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.yml | 2 +- .../epmet/constant/DataSourceConstant.java | 1 + .../stats/ArticleGridPublishedSummaryDTO.java | 38 ++++++ .../data-statistical-server/pom.xml | 12 ++ .../epmet/controller/PublicityController.java | 29 ++++ .../com/epmet/dao/stats/DimCustomerDao.java | 15 ++- .../java/com/epmet/dao/voice/ArticleDao.java | 33 +++++ .../dao/voice/ArticlePublishRangeDao.java | 46 +++++++ .../com/epmet/entity/voice/ArticleEntity.java | 125 ++++++++++++++++++ .../voice/ArticlePublishRangeEntity.java | 85 ++++++++++++ .../epmet/service/StatsPublicityService.java | 15 +++ .../service/impl/StatsDemoServiceImpl.java | 2 + .../impl/StatsPublicityServiceImpl.java | 68 ++++++++++ .../service/stats/DimCustomerService.java | 12 ++ .../stats/impl/DimCustomerServiceImpl.java | 16 ++- .../voice/ArticlePublishRangeService.java | 46 +++++++ .../epmet/service/voice/ArticleService.java | 33 +++++ .../impl/ArticlePublishRangeServiceImpl.java | 47 +++++++ .../voice/impl/ArticleServiceImpl.java | 41 ++++++ .../src/main/resources/bootstrap.yml | 5 + .../resources/mapper/stats/DimCustomerDao.xml | 5 +- .../resources/mapper/voice/ArticleDao.xml | 34 +++++ .../mapper/voice/ArticlePublishRangeDao.xml | 40 ++++++ 23 files changed, 744 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml diff --git a/epmet-cloud-generator/src/main/resources/application.yml b/epmet-cloud-generator/src/main/resources/application.yml index f759f036b9..8e526e2a73 100644 --- a/epmet-cloud-generator/src/main/resources/application.yml +++ b/epmet-cloud-generator/src/main/resources/application.yml @@ -9,7 +9,7 @@ spring: type: com.alibaba.druid.pool.DruidDataSource #MySQL配置 driverClassName: com.mysql.jdbc.Driver - url: jdbc:mysql://192.168.1.130:3306/epmet_user?useUnicode=true&characterEncoding=UTF-8&useSSL=false + url: jdbc:mysql://192.168.1.130:3306/epmet_gov_voice?useUnicode=true&characterEncoding=UTF-8&useSSL=false username: epmet_dba password: EpmEt-dbA-UsEr #oracle配置 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 b972365b19..47a18e3a72 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 @@ -6,5 +6,6 @@ public interface DataSourceConstant { String STATS = "stats"; String GOV_ISSUE = "govIssue"; String GOV_PROJECT = "govProject"; + String GOV_VOICE = "govVoice"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java new file mode 100644 index 0000000000..138ae7efec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java @@ -0,0 +1,38 @@ +package com.epmet.dto.stats; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:文章总数 统计返回结果 dto + * + * @author liujianjun + * @date 2020/6/17 16:43 + */ +@Data +public class ArticleGridPublishedSummaryDTO implements Serializable { + private static final long serialVersionUID = 6755654148306711602L; + + /** + * 客户id + */ + private String customerId; + /** + * 网格Id + */ + private String gridId; + /** + * 发布文章总数 + */ + private Integer publishedCount; + /** + * 状态为发布中的文章总数 + */ + private Integer publishingCount; +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index a69f4c06b4..3a323fce2f 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -122,6 +122,12 @@ epmet_gov_project_user EpmEt-db-UsEr + + + + epmet_gov_voice_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -180,6 +186,12 @@ epmet_gov_project_user EpmEt-db-UsEr + + + + epmet + elink@833066 + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java new file mode 100644 index 0000000000..a8860b0cff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/PublicityController.java @@ -0,0 +1,29 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsDemoService; +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; + +import java.util.concurrent.ExecutorService; + +/** + * desc:宣传能力controller + */ +@RequestMapping("publicity") +@RestController +public class PublicityController { + + @Autowired + private StatsDemoService demoService; + + @Autowired + private ExecutorService executorService; + + @PostMapping(value = "publicitySummaryStatsjob") + public Result publicitySummaryStatsjob(){ + return null; + } +} 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 5a8a5351ce..66ea22ad59 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 @@ -21,6 +21,8 @@ import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.DimCustomerEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 客户维度 * @@ -29,5 +31,16 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface DimCustomerDao extends BaseDao { - + + /** + * desc: 分页获取客户id + * + * @param pageNo + * @param offset + * return: List + * @date: 2020/6/17 16:33 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectCustomerIdPage(Integer pageNo, int offset); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java new file mode 100644 index 0000000000..4609722502 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.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.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.voice.ArticleEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticleDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java new file mode 100644 index 0000000000..13b47c66b5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.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.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticlePublishRangeDao extends BaseDao { + + /** + * desc:查询网格发布文章总数及状态为发布中的文章总数 + * + * @param customerId + * @param createDate + * @return + */ + List selectByCreatedDate(@Param("customerId") String customerId, @Param("createDate") Date createDate); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java new file mode 100644 index 0000000000..98d9beb507 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleEntity.java @@ -0,0 +1,125 @@ +/** + * 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.voice; + +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-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article") +public class ArticleEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 草稿ID + */ + private String draftId; + + /** + * 文章标题 + */ + private String title; + + /** + * 文章内容 精简内容 + */ + private String previewContent; + + /** + * 是否置顶 1是;0否; + */ + private Integer isTop; + + /** + * 发布范围描述 所有发布范围集合,顿号隔开 + */ + private String publishRangeDesc; + + /** + * 发布单位ID + */ + private String publisherId; + + /** + * 发布单位名称 + */ + private String publisherName; + + /** + * 发布单位类型 机关:agency;部门:department;网格:grid + */ + private String publisherType; + + /** + * 发布时间 + */ + private Date publishDate; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String statusFlag; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 文章标签串 竖杠分割的标签名称 + */ + private String tags; + + /** + * 组织ID + */ + private String orgId; + + /** + * 组织ID路径 eg:字段为def:abc + */ + private String orgIdPath; + + /** + * 网格ID 数据权限使用 + */ + private String gridId; + + /** + * 部门ID 数据权限使用 + */ + private String departmentId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java new file mode 100644 index 0000000000..1aac103337 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticlePublishRangeEntity.java @@ -0,0 +1,85 @@ +/** + * 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.voice; + +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-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_publish_range") +public class ArticlePublishRangeEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 组织-网格名称 + */ + private String agencyGridName; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 所有上级组织机构ID 以英文:隔开 + */ + private String pids; + + /** + * 所有上级名称 以横杠隔开 + */ + private String allParentName; + + /** + * 下线时间 + */ + private Date offLineTime; + + /** + * 发布状态 已发布:published;已下线:offline + */ + private String publishStatus; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java new file mode 100644 index 0000000000..e861ab90fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -0,0 +1,15 @@ +package com.epmet.service; + + +public interface StatsPublicityService { + /** + * desc: 统计宣传能力的汇总信息 + * + * return: + * @date: 2020/6/17 16:11 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean publicitySummary(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index 59c2907d10..ef4d1d6167 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -28,6 +28,7 @@ public class StatsDemoServiceImpl implements StatsDemoService { @Autowired private DemoDataStatsService demoDataStatsService; + @Override public void testList() { List agencies = demoGovOrgService.listAllEntities(); List issues = demoIssueService.listAllEntities(); @@ -36,6 +37,7 @@ public class StatsDemoServiceImpl implements StatsDemoService { //该service不加事务 //@Transactional(rollbackFor = Exception.class) + @Override public void testTx() { demoDataStatsService.testTx(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java new file mode 100644 index 0000000000..844d11d04c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -0,0 +1,68 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.service.StatsPublicityService; +import com.epmet.service.stats.*; +import com.epmet.service.voice.ArticlePublishRangeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Date; +import java.util.List; + +/** + * desc: 宣传能力数据统计 service + * + * @date: 2020/6/17 16:08 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Service +public class StatsPublicityServiceImpl implements StatsPublicityService { + + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private DimDateService dimDateService; + @Autowired + private DimWeekService dimWeekService; + @Autowired + private DimMonthService dimMonthService; + @Autowired + private DimQuarterService dimQuarterService; + @Autowired + private DimYearService dimYearService; + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private ArticlePublishRangeService articlePublishRangeService; + + @Override + public Boolean publicitySummary() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo, (pageNo - 1) * pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + customerIdList.forEach(customerId -> { + + }); + } + + } while (!CollectionUtils.isEmpty(customerIdList) || customerIdList.size() >= pageSize); + return null; + } + + private String statsPublishArticle(String customerId, Date statsDate) { + //1.先查询昨天的 有没有数据 有则 昨日发布文章总数 = 昨日的发布文章数增量 + 统计表中已有的昨日的网格总数 ; + // 否则 昨日发布文章总数 = 发布范围表中计算所有发布文章总数 + + List articleCount = articlePublishRangeService.selectByCreatedDate(customerId, statsDate == null ? DateUtils.addDateDays(new Date(), -1) : statsDate); + + return null; + } +} 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 dc19f54861..96eabb77ce 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 @@ -92,4 +92,16 @@ public interface DimCustomerService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + /** + * desc: 分页获取 客户id + * + * @param pageNo + * @param pageSize + * return: List + * @date: 2020/6/17 16:26 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectCustomerIdPage(Integer pageNo, Integer pageSize); } \ No newline at end of file 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 4b66ed3e11..1b8bf1e474 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 @@ -20,15 +20,17 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +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.dao.stats.DimCustomerDao; import com.epmet.dto.stats.DimCustomerDTO; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.service.stats.DimCustomerService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -43,6 +45,7 @@ import java.util.Map; * @since v1.0.0 2020-06-16 */ @Service +@Slf4j public class DimCustomerServiceImpl extends BaseServiceImpl implements DimCustomerService { @Override @@ -97,4 +100,13 @@ public class DimCustomerServiceImpl extends BaseServiceImpl selectCustomerIdPage(Integer pageNo, Integer pageSize) { + if (pageNo ==null || pageNo <1 || pageSize == null || pageSize < 0){ + log.error("selectCustomerIdPage param error,pageNo:{},pageSize:{}",pageNo,pageSize); + throw new RenException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(),EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getMsg()); + } + return baseDao.selectCustomerIdPage(pageNo,(pageNo-1)*pageSize); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java new file mode 100644 index 0000000000..0f6ac51535 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.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.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticlePublishRangeService extends BaseService { + + /** + * desc: 根据客户Id 、创建日期查询 发布范围数据 + * + * @param customerId + * @param createDate + * return: + * @date: 2020/6/17 16:59 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List selectByCreatedDate(String customerId, Date createDate); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java new file mode 100644 index 0000000000..366e167ad1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.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.service.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.voice.ArticleEntity; + +/** + * desc: 数据统计文章service + * + * return: + * @date: 2020/6/17 15:28 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +public interface ArticleService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java new file mode 100644 index 0000000000..47b2e194ec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java @@ -0,0 +1,47 @@ +/** + * 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.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticlePublishRangeDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.voice.ArticlePublishRangeEntity; +import com.epmet.service.voice.ArticlePublishRangeService; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章发布范围表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { + + + @Override + public List selectByCreatedDate(String customerId, Date createDate) { + return baseDao.selectByCreatedDate(customerId,createDate); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java new file mode 100644 index 0000000000..f1a788fc30 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -0,0 +1,41 @@ +/** + * 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.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleDao; +import com.epmet.entity.voice.ArticleEntity; +import com.epmet.service.voice.ArticleService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 项目表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { + @Autowired + private ArticleDao articleDao; + +} \ 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 4d0a2dce64..16f8408da1 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 @@ -135,6 +135,11 @@ dynamic: url: @datasource.druid.project.url@ username: @datasource.druid.project.username@ password: @datasource.druid.project.password@ + govVoice: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.voice.url@ + username: @datasource.druid.voice.username@ + password: @datasource.druid.voice.password@ thread: # 线程池配置 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 ed01bed0da..6cc8b750fd 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 @@ -4,6 +4,7 @@ - - + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml new file mode 100644 index 0000000000..d411b3513e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml new file mode 100644 index 0000000000..19691045f1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 193560dcd660d2e1f2438d240dd66dd5a6a19fc4 Mon Sep 17 00:00:00 2001 From: wxz Date: Wed, 17 Jun 2020 18:23:05 +0800 Subject: [PATCH 013/101] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=EF=BC=9A=E6=9C=BA?= =?UTF-8?q?=E5=85=B3=E5=8D=95=E4=BD=8D=E7=BB=B4=E5=BA=A6=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 10 +++ .../epmet/constant/DatePatternConstant.java | 8 --- .../java/com/epmet/constant/StatsSubject.java | 66 +++++++++++++++++++ .../com/epmet/controller/DimController.java | 11 ++++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 5 ++ .../epmet/dao/stats/LastExecRecordDao.java | 35 ++++++++++ .../entity/stats/LastExecRecordEntity.java | 51 ++++++++++++++ .../com/epmet/service/StatsDimService.java | 1 + .../service/impl/StatsDimServiceImpl.java | 38 +++++++++++ .../service/org/CustomerAgencyService.java | 10 +++ .../org/impl/CustomerAgencyServiceImpl.java | 25 +++++++ .../epmet/service/stats/DimAgencyService.java | 3 + .../epmet/service/stats/DimGridService.java | 1 + .../service/stats/LastExecRecordService.java | 10 +++ .../stats/impl/DimAgencyServiceImpl.java | 24 +++++++ .../stats/impl/DimDateServiceImpl.java | 3 - .../stats/impl/DimGridServiceImpl.java | 5 +- .../stats/impl/LastExecRecordServiceImpl.java | 45 +++++++++++++ .../mapper/org/StatsCustomerAgencyDao.xml | 14 ++++ .../mapper/stats/LastExecRecordDao.xml | 25 +++++++ epmet-module/pom.xml | 1 - 21 files changed, 377 insertions(+), 14 deletions(-) delete mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java create mode 100755 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java create mode 100755 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/LastExecRecordServiceImpl.java create mode 100755 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/LastExecRecordDao.xml 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 616092ce1c..a83670615d 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 @@ -234,6 +234,16 @@ public class DateUtils { return dateTime.getWeekOfWeekyear(); } + /** + * 按照格式进行时间取整 + * @param targetDate + * @param pattern + * @return + */ + public static Date integrate(Date targetDate, String pattern) { + return DateUtils.parse(DateUtils.format(targetDate, pattern), pattern); + } + public static void main(String[] args) { //int weekOfYear = getWeekOfYear(new Date()); diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java deleted file mode 100644 index 867752ebdc..0000000000 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DatePatternConstant.java +++ /dev/null @@ -1,8 +0,0 @@ -package com.epmet.constant; - -/** - * 日期格式常量 - */ -public interface DatePatternConstant { - -} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java new file mode 100644 index 0000000000..4573d9daf8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/StatsSubject.java @@ -0,0 +1,66 @@ +package com.epmet.constant; + +public interface StatsSubject { + String DIM_AGENCY = "dim_agency"; + String DIM_CUSTOMER = "dim_customer"; + String DIM_DATE = "dim_date"; + String DIM_DEPARTMENT = "dim_department"; + String DIM_GRID = "dim_grid"; + String DIM_MONTH = "dim_month"; + String DIM_QUARTER = "dim_quarter"; + String DIM_TOPIC_STATUS = "dim_topic_status"; + String DIM_WEEK = "dim_week"; + String DIM_YEAR = "dim_year"; + String FACT_AGENCY_PROJECT_DAILY = "fact_agency_project_daily"; + String FACT_AGENCY_PROJECT_MONTHLY = "fact_agency_project_monthly"; + String FACT_ARTICLE_PUBLISHED_AGENCY_DAILY = "fact_article_published_agency_daily"; + String FACT_ARTICLE_PUBLISHED_DEPARTMENT_DAILY = "fact_article_published_department_daily"; + String FACT_ARTICLE_PUBLISHED_GRID_DAILY = "fact_article_published_grid_daily"; + String FACT_GRID_PROJECT_DAILY = "fact_grid_project_daily"; + String FACT_GRID_PROJECT_MONTHLY = "fact_grid_project_monthly"; + String FACT_GROUP_AGENCY_DAILY = "fact_group_agency_daily"; + String FACT_GROUP_AGENCY_MONTHLY = "fact_group_agency_monthly"; + String FACT_GROUP_GRID_DAILY = "fact_group_grid_daily"; + String FACT_ISSUE_AGENCY_DAILY = "fact_issue_agency_daily"; + String FACT_ISSUE_AGENCY_MONTHLY = "fact_issue_agency_monthly"; + String FACT_ISSUE_GRID_DAILY = "fact_issue_grid_daily"; + String FACT_ISSUE_GRID_MONTHLY = "fact_issue_grid_monthly"; + String FACT_PARTICIPATION_USER_AGENCY_DAILY = "fact_participation_user_agency_daily"; + String FACT_PARTICIPATION_USER_AGENCY_MONTHLY = "fact_participation_user_agency_monthly"; + String FACT_PARTICIPATION_USER_GRID_DAILY = "fact_participation_user_grid_daily"; + String FACT_PARTICIPATION_USER_GRID_MONTHLY = "fact_participation_user_grid_monthly"; + String FACT_REG_USER_AGENCY_DAILY = "fact_reg_user_agency_daily"; + String FACT_REG_USER_AGENCY_MONTHLY = "fact_reg_user_agency_monthly"; + String FACT_REG_USER_GRID_DAILY = "fact_reg_user_grid_daily"; + String FACT_REG_USER_GRID_MONTHLY = "fact_reg_user_grid_monthly"; + String FACT_TAG_USED_AGENCY_DAILY = "fact_tag_used_agency_daily"; + String FACT_TAG_USED_AGENCY_MONTHLY = "fact_tag_used_agency_monthly"; + String FACT_TAG_USED_AGENCY_QUARTERLY = "fact_tag_used_agency_quarterly"; + String FACT_TAG_USED_AGENCY_YEARLY = "fact_tag_used_agency_yearly"; + String FACT_TAG_USED_DEPARTMENT_DAILY = "fact_tag_used_department_daily"; + String FACT_TAG_USED_DEPARTMENT_MONTHLY = "fact_tag_used_department_monthly"; + String FACT_TAG_USED_DEPARTMENT_QUARTERLY = "fact_tag_used_department_quarterly"; + String FACT_TAG_USED_DEPARTMENT_YEARLY = "fact_tag_used_department_yearly"; + String FACT_TAG_USED_GRID_DAILY = "fact_tag_used_grid_daily"; + String FACT_TAG_USED_GRID_MONTHLY = "fact_tag_used_grid_monthly"; + String FACT_TAG_USED_GRID_QUARTERLY = "fact_tag_used_grid_quarterly"; + String FACT_TAG_USED_GRID_YEARLY = "fact_tag_used_grid_yearly"; + String FACT_TAG_VIEWED_AGENCY_DAILY = "fact_tag_viewed_agency_daily"; + String FACT_TAG_VIEWED_AGENCY_MONTHLY = "fact_tag_viewed_agency_monthly"; + String FACT_TAG_VIEWED_AGENCY_QUARTERLY = "fact_tag_viewed_agency_quarterly"; + String FACT_TAG_VIEWED_AGENCY_YEARLY = "fact_tag_viewed_agency_yearly"; + String FACT_TAG_VIEWED_GRID_DAILY = "fact_tag_viewed_grid_daily"; + String FACT_TAG_VIEWED_GRID_MONTHLY = "fact_tag_viewed_grid_monthly"; + String FACT_TAG_VIEWED_GRID_QUARTERLY = "fact_tag_viewed_grid_quarterly"; + String FACT_TAG_VIEWED_GRID_YEARLY = "fact_tag_viewed_grid_yearly"; + String FACT_TOPIC_ISSUE_AGENCY_DAILY = "fact_topic_issue_agency_daily"; + String FACT_TOPIC_ISSUE_AGENCY_MONTHLY = "fact_topic_issue_agency_monthly"; + String FACT_TOPIC_ISSUE_GRID_DAILY = "fact_topic_issue_grid_daily"; + String FACT_TOPIC_ISSUE_GRID_MONTHLY = "fact_topic_issue_grid_monthly"; + String FACT_TOPIC_STATUS_AGENCY_DAILY = "fact_topic_status_agency_daily"; + String FACT_TOPIC_STATUS_AGENCY_MONTHLY = "fact_topic_status_agency_monthly"; + String FACT_TOPIC_STATUS_GRID_DAILY = "fact_topic_status_grid_daily"; + String FACT_TOPIC_TOTAL_AGENCY_DAILY = "fact_topic_total_agency_daily"; + String FACT_TOPIC_TOTAL_GRID_DAILY = "fact_topic_total_grid_daily"; + String LAST_EXEC_RECORD = "last_exec_record"; +} 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 9c53f16bab..d9439f5b67 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 @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsDimService; import com.epmet.service.stats.DimDateService; +import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestMapping; @@ -38,4 +39,14 @@ public class DimController { return new Result(); } + /** + * 初始化机关单位维度 + * @return + */ + @PostMapping("/agency/init") + public Result intiAgencyDim() { + statsDimService.initAgencyDim(); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 8e6b2330bd..58fbbac089 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -3,7 +3,9 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.org.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; @Mapper @@ -11,4 +13,7 @@ public interface StatsCustomerAgencyDao extends BaseDao { List listAllEntities(); + List listAgenciesByCreateTime( + @Param("statsStartTime") Date statsStartTime, + @Param("statsEndTime") Date statsEndTime); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java new file mode 100755 index 0000000000..b90c6c6856 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.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.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.LastExecRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 最后一次执行记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface LastExecRecordDao extends BaseDao { + + LastExecRecordEntity getLastExecRecord(@Param("statsSubject") String statsSubject); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java new file mode 100755 index 0000000000..833954276d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/LastExecRecordEntity.java @@ -0,0 +1,51 @@ +/** + * 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-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("last_exec_record") +public class LastExecRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 执行主体,即每一个统计表 + */ + private String subject; + + /** + * 最后一次执行时间 + */ + private Date execTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java index d678c16447..8e99082086 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java @@ -4,4 +4,5 @@ public interface StatsDimService { void initGridDim(); + void initAgencyDim(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index 50a83f3489..b919440cbe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -1,11 +1,18 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.StatsSubject; +import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.StatsDimService; +import com.epmet.service.org.CustomerAgencyService; import com.epmet.service.org.CustomerGridService; +import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimGridService; +import com.epmet.service.stats.LastExecRecordService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -19,9 +26,18 @@ public class StatsDimServiceImpl implements StatsDimService { @Autowired private DimGridService dimGridService; + @Autowired + private DimAgencyService dimAgencyService; + @Autowired private CustomerGridService customerGridService; + @Autowired + private LastExecRecordService lastExecRecordService; + + @Autowired + private CustomerAgencyService customerAgencyService; + @Override public void initGridDim() { DimGridEntity lastCreatedGridDim = dimGridService.getLastCreatedGridDim(); @@ -65,4 +81,26 @@ public class StatsDimServiceImpl implements StatsDimService { return dimGrid; }).collect(Collectors.toList()); } + + /** + * 初始化机关单位维度 + */ + @Override + public void initAgencyDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_AGENCY); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_AGENCY); + } + + Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsStartTime = null; + if (lastExecRecord.getExecTime() != null) { + statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + + List agencies = customerAgencyService.listAgenciesByCreateTime(statsStartTime, statsEndTime); + dimAgencyService.addAgencyDims(agencies); + lastExecRecord.setExecTime(new Date()); + lastExecRecordService.updateById(lastExecRecord); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java new file mode 100644 index 0000000000..034499e955 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerAgencyService.java @@ -0,0 +1,10 @@ +package com.epmet.service.org; + +import com.epmet.entity.org.CustomerAgencyEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerAgencyService { + List listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java new file mode 100644 index 0000000000..2912ca0cca --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerAgencyServiceImpl.java @@ -0,0 +1,25 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.service.org.CustomerAgencyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class CustomerAgencyServiceImpl implements CustomerAgencyService { + + @Autowired + private StatsCustomerAgencyDao customerAgencyDao; + + @Override + public List listAgenciesByCreateTime(Date statsStartTime, Date statsEndTime) { + return customerAgencyDao.listAgenciesByCreateTime(statsStartTime, statsEndTime); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index 87fcd68627..d5e978046f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -20,6 +20,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; import java.util.List; @@ -100,4 +101,6 @@ public interface DimAgencyService extends BaseService { * @Description 根据客户Id查询机关维度列表数据 **/ List getDimAgencyList(DimAgencyDTO dto); + + void addAgencyDims(List agencies); } \ 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 989d20704b..5bcf8f1e48 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 @@ -20,6 +20,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java new file mode 100644 index 0000000000..35bf90a324 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/LastExecRecordService.java @@ -0,0 +1,10 @@ +package com.epmet.service.stats; + +import com.epmet.entity.stats.LastExecRecordEntity; + +public interface LastExecRecordService { + LastExecRecordEntity getLastExecRecord(String statsSubject); + LastExecRecordEntity createLastExecRecord(String statsSubject); + + void updateById(LastExecRecordEntity lastExecRecord); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index c9de98bb4f..9824d21721 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -25,6 +25,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.DimAgencyDao; import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.stats.DimAgencyService; import org.apache.commons.lang3.StringUtils; @@ -33,6 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -108,4 +110,26 @@ public class DimAgencyServiceImpl extends BaseServiceImpl agencies) { + Date now = new Date(); + for (CustomerAgencyEntity agency : agencies) { + DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); + dimAgencyEntity.setAgencyName(agency.getOrganizationName()); + dimAgencyEntity.setAllParentName(agency.getAllParentName()); + dimAgencyEntity.setCustomerId(agency.getCustomerId()); + dimAgencyEntity.setLevel(agency.getLevel()); + dimAgencyEntity.setPid(agency.getPid()); + dimAgencyEntity.setPids(agency.getPid()); + dimAgencyEntity.setCreatedBy("APP_USER"); + dimAgencyEntity.setUpdatedBy("APP_USER"); + dimAgencyEntity.setCreatedTime(now); + dimAgencyEntity.setUpdatedTime(now); + dimAgencyEntity.setRevision(0); + dimAgencyEntity.setDelFlag("0"); + baseDao.insert(dimAgencyEntity); + } + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index 4ec6214798..5c3fdb96aa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -24,17 +24,14 @@ 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.DatePatternConstant; import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.stats.DimDateDTO; import com.epmet.entity.stats.DimDateEntity; import com.epmet.service.stats.DimDateService; 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.time.LocalDateTime; import java.util.*; /** 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 10f4dd0db2..1a0af837a4 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 @@ -25,6 +25,8 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.dao.stats.DimGridDao; import com.epmet.dto.stats.DimGridDTO; +import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.stats.DimGridService; import org.apache.commons.lang3.StringUtils; @@ -32,6 +34,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -108,6 +111,4 @@ public class DimGridServiceImpl extends BaseServiceImpl select * from customer_agency + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/LastExecRecordDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/LastExecRecordDao.xml new file mode 100755 index 0000000000..53f2846161 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/LastExecRecordDao.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/pom.xml b/epmet-module/pom.xml index 6a43dfe29f..aa37ab3129 100644 --- a/epmet-module/pom.xml +++ b/epmet-module/pom.xml @@ -39,7 +39,6 @@ resi-voice data-statistical data-report - data-report From ea5522a6522a1a98dea41356e08e8fe8f5a15d21 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 Jun 2020 00:54:34 +0800 Subject: [PATCH 014/101] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=B7?= =?UTF-8?q?=EF=BC=8C=E9=83=A8=E9=97=A8=EF=BC=8C=E6=8C=89=E6=9C=88=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E7=9A=84=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 37 +++++++- .../epmet/constant/DataSourceConstant.java | 1 + .../java/com/epmet/dto/stats/DimDateDTO.java | 2 + .../data-statistical-server/pom.xml | 14 ++- .../com/epmet/controller/DimController.java | 34 +++++++ .../java/com/epmet/dao/crm/CustomerDao.java | 46 ++++++++++ .../epmet/dao/org/CustomerDepartmentDao.java | 41 +++++++++ .../com/epmet/entity/crm/CustomerEntity.java | 91 +++++++++++++++++++ .../entity/org/CustomerDepartmentEntity.java | 63 +++++++++++++ .../com/epmet/entity/stats/DimDateEntity.java | 2 + .../com/epmet/service/StatsDimService.java | 4 + .../epmet/service/crm/CustomerService.java | 12 +++ .../service/crm/impl/CustomerServiceImpl.java | 25 +++++ .../service/impl/StatsDimServiceImpl.java | 72 ++++++++++++++- .../org/CustomerDepartmentService.java | 11 +++ .../impl/CustomerDepartmentServiceImpl.java | 31 +++++++ .../service/stats/DimCustomerService.java | 8 ++ .../service/stats/DimDepartmentService.java | 3 + .../epmet/service/stats/DimMonthService.java | 2 + .../stats/impl/DimCustomerServiceImpl.java | 32 +++++-- .../stats/impl/DimDateServiceImpl.java | 5 +- .../stats/impl/DimDepartmentServiceImpl.java | 20 ++++ .../stats/impl/DimMonthServiceImpl.java | 67 ++++++++++++++ .../src/main/resources/bootstrap.yml | 5 + .../main/resources/mapper/crm/CustomerDao.xml | 44 +++++++++ .../mapper/org/CustomerDepartmentDao.xml | 19 ++++ 26 files changed, 678 insertions(+), 13 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/crm/CustomerDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml 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 a83670615d..2887ed1adf 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 @@ -26,6 +26,7 @@ import java.util.Date; * @since 1.0.0 */ public class DateUtils { + /** 时间格式(yyyy-MM-dd) */ public final static String DATE_PATTERN = "yyyy-MM-dd"; /** 时间格式(yyyy-MM-dd HH:mm:ss) */ @@ -37,7 +38,9 @@ public class DateUtils { public static final String DATE_PATTERN_YYYYMMDD = "yyyyMMdd"; public static final String DATE_NAME_PATTERN = "yyyy年MM月dd日"; + public static final String MONTH_NAME_PATTERN = "yyyy年MM月"; public static final String DATE_PATTERN_YYYY = "yyyy"; + public static final String DATE_PATTERN_YYYYMM = "yyyyMM"; public static final String WEEK_TYPE_ENGLISH = "english"; public static final String WEEK_TYPE_CHINESE = "chinese"; @@ -244,11 +247,41 @@ public class DateUtils { return DateUtils.parse(DateUtils.format(targetDate, pattern), pattern); } + /** + * 查询指定日期是几月 + * @param date + * @return + */ + public static int getMonthOfYear(Date date) { + LocalDate localDate = new LocalDate(date); + return localDate.getMonthOfYear(); + } + + /** + * 获取季度 + * @param date + * @return + */ + public static int getQuarterIndex(Date date) { + LocalDate localDate = new LocalDate(date); + int monthOfYear = localDate.getMonthOfYear(); + if (monthOfYear == 1 || monthOfYear == 2 || monthOfYear == 3) { + return 1; + } + if (monthOfYear == 4 || monthOfYear == 5 || monthOfYear == 6) { + return 2; + } + if (monthOfYear == 7 || monthOfYear == 8 || monthOfYear == 9) { + return 3; + } + return 4; + } + public static void main(String[] args) { //int weekOfYear = getWeekOfYear(new Date()); - String e = DateUtils.format(new Date(), "E"); + int quarterIndex = DateUtils.getQuarterIndex(DateUtils.parse("20201001", DateUtils.DATE_PATTERN_YYYYMMDD)); - System.out.println(e); + System.out.println(666); } } 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 47a18e3a72..f79ab899cf 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 @@ -7,5 +7,6 @@ public interface DataSourceConstant { String GOV_ISSUE = "govIssue"; String GOV_PROJECT = "govProject"; String GOV_VOICE = "govVoice"; + String OPER_CRM = "operCrm"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java index 75c3bf51f8..e539cda274 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/DimDateDTO.java @@ -88,4 +88,6 @@ public class DimDateDTO implements Serializable { */ private Date updatedTime; + private String monthId; + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index a68e4b48d3..dcd55b9ad9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -129,6 +129,12 @@ epmet_gov_voice_user EpmEt-db-UsEr + + + + epmet_oper_crm_user + EpmEt-db-UsEr + 0 192.168.1.130 @@ -191,7 +197,13 @@ epmet - elink@833066 + elink@8473066 + + + + + epmet + elink@8473066 0 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 d9439f5b67..c393a74bb3 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 @@ -3,6 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsDimService; import com.epmet.service.stats.DimDateService; +import com.epmet.service.stats.DimMonthService; import oracle.jdbc.proxy.annotation.Post; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; @@ -16,6 +17,9 @@ public class DimController { @Autowired private DimDateService dimDateService; + @Autowired + private DimMonthService dimMonthService; + @Autowired private StatsDimService statsDimService; @@ -49,4 +53,34 @@ public class DimController { return new Result(); } + /** + * 客户维度 + * @return + */ + @PostMapping("/customer/init") + public Result intiCustomerDim() { + statsDimService.initCustomerDim(); + return new Result(); + } + + /** + * 部门维度 + * @return + */ + @PostMapping("/department/init") + public Result intiDepartmentDim() { + statsDimService.initDepartmentDim(); + return new Result(); + } + + /** + * 月维度 + * @return + */ + @PostMapping("/month/init") + public Result initMonthDim() { + dimMonthService.initMonthDim(); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.java new file mode 100644 index 0000000000..bfe699c25e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/crm/CustomerDao.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.crm; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.crm.CustomerEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 客户表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-03-11 + */ +@Mapper +public interface CustomerDao extends BaseDao { + + /** + * 根据创建时间起止查询有效客户列表 + * @param createTimeFrom + * @param createTimeTo + * @return + */ + List listValidCustomersByCreateTime( + @Param("createTimeFrom") Date createTimeFrom, + @Param("createTimeTo") Date createTimeTo); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java new file mode 100644 index 0000000000..2b9b4705ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/CustomerDepartmentDao.java @@ -0,0 +1,41 @@ +/** + * 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.org; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.org.CustomerDepartmentEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Mapper +public interface CustomerDepartmentDao extends BaseDao { + + List listDepartmentsByCreatedTime( + @Param("createdTimeFrom") Date createdTimeFrom, + @Param("createdTimeTo") Date createdTimeTo); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.java new file mode 100644 index 0000000000..a2fa408a43 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/crm/CustomerEntity.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.entity.crm; + +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-03-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer") +public class CustomerEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户名称 + */ + private String customerName; + + /** + * 产品标题 显示在产品顶端的标题 + */ + private String title; + + /** + * 组织机构代码 + */ + private String organizationNumber; + + /** + * 组织机构代码证图片 + */ + private String organizationImg; + + /** + * 有效期 + */ + private Date validityTime; + + /** + * 客户管理员 + */ + private String customerAdmin; + + /** + * 密码 加密存储 + */ + private String customerPassword; + + /** + * 客户组织级别:机关级别 + * (社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) 机关级别(社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province) + */ + private String organizationLevel; + + /** + * 客户logo + */ + private String logo; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java new file mode 100644 index 0000000000..0f46e25ffd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/org/CustomerDepartmentEntity.java @@ -0,0 +1,63 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.org; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 客户部门表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-04-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("customer_department") +public class CustomerDepartmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 所属组织机构ID(customer_agency.id) + */ + private String agencyId; + + /** + * 部门名称 + */ + private String departmentName; + + /** + * 部门职责 + */ + private String departmentDuty; + + /** + * 总人数 + */ + private Integer totalUser; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java index 8b919277a1..8048c15070 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java @@ -58,4 +58,6 @@ public class DimDateEntity extends BaseEpmetEntity { */ private String weekId; + private String monthId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java index 8e99082086..b566f3d160 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java @@ -5,4 +5,8 @@ public interface StatsDimService { void initGridDim(); void initAgencyDim(); + + void initCustomerDim(); + + void initDepartmentDim(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java new file mode 100644 index 0000000000..e562a08365 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/CustomerService.java @@ -0,0 +1,12 @@ +package com.epmet.service.crm; + +import com.epmet.entity.crm.CustomerEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerService { + + List listValidCustomersByCreateTime(Date createTimeFrom, Date createTimeTo); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java new file mode 100644 index 0000000000..3db2f197bd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/crm/impl/CustomerServiceImpl.java @@ -0,0 +1,25 @@ +package com.epmet.service.crm.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.crm.CustomerDao; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.service.crm.CustomerService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.OPER_CRM) +public class CustomerServiceImpl implements CustomerService { + + @Autowired + private CustomerDao customerDao; + + @Override + public List listValidCustomersByCreateTime(Date createTimeFrom, Date createTimeTo) { + return customerDao.listValidCustomersByCreateTime(createTimeFrom, createTimeTo); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index b919440cbe..c4666ba77b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -2,17 +2,20 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.StatsSubject; +import com.epmet.dao.org.CustomerDepartmentDao; import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.entity.crm.CustomerEntity; import com.epmet.entity.org.CustomerAgencyEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.StatsDimService; +import com.epmet.service.crm.CustomerService; import com.epmet.service.org.CustomerAgencyService; +import com.epmet.service.org.CustomerDepartmentService; import com.epmet.service.org.CustomerGridService; -import com.epmet.service.stats.DimAgencyService; -import com.epmet.service.stats.DimGridService; -import com.epmet.service.stats.LastExecRecordService; +import com.epmet.service.stats.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -38,6 +41,18 @@ public class StatsDimServiceImpl implements StatsDimService { @Autowired private CustomerAgencyService customerAgencyService; + @Autowired + private CustomerService customerService; + + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private CustomerDepartmentService departmentService; + + @Autowired + private DimDepartmentService dimDepartmentService; + @Override public void initGridDim() { DimGridEntity lastCreatedGridDim = dimGridService.getLastCreatedGridDim(); @@ -101,6 +116,57 @@ public class StatsDimServiceImpl implements StatsDimService { List agencies = customerAgencyService.listAgenciesByCreateTime(statsStartTime, statsEndTime); dimAgencyService.addAgencyDims(agencies); lastExecRecord.setExecTime(new Date()); + + // 记录最后一次统计时间 lastExecRecordService.updateById(lastExecRecord); } + + /** + * 初始化网格维度 + */ + @Override + public void initCustomerDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_CUSTOMER); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_CUSTOMER); + } + + Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsStartTime = null; + if (lastExecRecord.getExecTime() != null) { + statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + + List customers = customerService.listValidCustomersByCreateTime(statsStartTime, statsEndTime); + dimCustomerService.addCustomerDims(customers); + + lastExecRecord.setExecTime(new Date()); + + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + } + + @Override + public void initDepartmentDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_DEPARTMENT); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_DEPARTMENT); + } + + Date statsEndTime = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + Date statsStartTime = null; + if (lastExecRecord.getExecTime() != null) { + statsStartTime = DateUtils.integrate(lastExecRecord.getExecTime(), DateUtils.DATE_PATTERN_YYYYMMDD); + } + + List departments = departmentService.listDepartmentsByCreatedTime(statsStartTime, statsEndTime); + + dimDepartmentService.addDepartmentDims(departments); + + lastExecRecord.setExecTime(new Date()); + + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java new file mode 100644 index 0000000000..1aa2c2f7db --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/CustomerDepartmentService.java @@ -0,0 +1,11 @@ +package com.epmet.service.org; + +import com.epmet.entity.org.CustomerDepartmentEntity; + +import java.util.Date; +import java.util.List; + +public interface CustomerDepartmentService { + + List listDepartmentsByCreatedTime(Date createdTimeFrom, Date createdTimeTo); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java new file mode 100644 index 0000000000..ac430a3abd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/CustomerDepartmentServiceImpl.java @@ -0,0 +1,31 @@ +package com.epmet.service.org.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.org.CustomerDepartmentDao; +import com.epmet.entity.org.CustomerDepartmentEntity; +import com.epmet.service.org.CustomerDepartmentService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +@Service +@DataSource(DataSourceConstant.GOV_ORG) +public class CustomerDepartmentServiceImpl implements CustomerDepartmentService { + + @Autowired + private CustomerDepartmentDao departmentDao; + + /** + * 根据创建时间查询部门列表 + * @param createdTimeFrom + * @param createdTimeTo + * @return + */ + @Override + public List listDepartmentsByCreatedTime(Date createdTimeFrom, Date createdTimeTo) { + return departmentDao.listDepartmentsByCreatedTime(createdTimeFrom, createdTimeTo); + } +} 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 96eabb77ce..85e7c06202 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 @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimCustomerDTO; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.stats.DimCustomerEntity; import java.util.List; @@ -104,4 +106,10 @@ public interface DimCustomerService extends BaseService { * email:liujianjun@git.elinkit.com.cn */ List selectCustomerIdPage(Integer pageNo, Integer pageSize); + + /** + * 添加客户维度 + * @param customers + */ + void addCustomerDims(List customers); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java index ffb1601678..0055e81fb5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java @@ -20,6 +20,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimDepartmentDTO; +import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.stats.DimDepartmentEntity; import java.util.List; @@ -92,4 +93,6 @@ public interface DimDepartmentService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + void addDepartmentDims(List departments); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java index 160625db05..d6f8a75943 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimMonthService.java @@ -92,4 +92,6 @@ public interface DimMonthService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + void initMonthDim(); } \ No newline at end of file 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 1b8bf1e474..87ab6d789d 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 @@ -27,6 +27,8 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dto.stats.DimCustomerDTO; +import com.epmet.entity.crm.CustomerEntity; +import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; @@ -35,6 +37,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; +import java.util.Date; import java.util.List; import java.util.Map; @@ -64,8 +67,8 @@ public class DimCustomerServiceImpl extends BaseServiceImpl getWrapper(Map params){ - String id = (String)params.get(FieldConstant.ID_HUMP); + 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); @@ -102,11 +105,28 @@ public class DimCustomerServiceImpl extends BaseServiceImpl selectCustomerIdPage(Integer pageNo, Integer pageSize) { - if (pageNo ==null || pageNo <1 || pageSize == null || pageSize < 0){ - log.error("selectCustomerIdPage param error,pageNo:{},pageSize:{}",pageNo,pageSize); - throw new RenException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(),EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getMsg()); + if (pageNo == null || pageNo < 1 || pageSize == null || pageSize < 0) { + log.error("selectCustomerIdPage param error,pageNo:{},pageSize:{}", pageNo, pageSize); + throw new RenException(EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getCode(), EpmetErrorCode.CUSTOMER_VALIDATE_ERROR.getMsg()); } - return baseDao.selectCustomerIdPage(pageNo,(pageNo-1)*pageSize); + return baseDao.selectCustomerIdPage(pageNo, (pageNo - 1) * pageSize); } + @Transactional + @Override + public void addCustomerDims(List customers) { + Date now = new Date(); + for (CustomerEntity customer : customers) { + DimCustomerEntity dim = new DimCustomerEntity(); + dim.setCustomerName(customer.getCustomerName()); + dim.setCreatedBy("APP_USER"); + dim.setCreatedTime(now); + dim.setUpdatedBy("APP_USER"); + dim.setUpdatedTime(now); + dim.setDelFlag("0"); + dim.setRevision(0); + dim.setId(customer.getId()); + baseDao.insert(dim); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index 5c3fdb96aa..0d0d756c12 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -148,8 +148,10 @@ public class DimDateServiceImpl extends BaseServiceImpl departments) { + Date now = new Date(); + for (CustomerDepartmentEntity department : departments) { + DimDepartmentEntity dim = new DimDepartmentEntity(); + dim.setAgencyId(department.getAgencyId()); + dim.setCustomerId(department.getCustomerId()); + dim.setDepartmentName(department.getDepartmentName()); + dim.setCreatedBy("APP_USER"); + dim.setUpdatedBy("APP_USER"); + dim.setCreatedTime(now); + dim.setUpdatedTime(now); + dim.setRevision(0); + dim.setDelFlag("0"); + baseDao.insert(dim); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java index b495b76284..39db16d77f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java @@ -23,16 +23,22 @@ 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.commons.tools.utils.DateUtils; +import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.stats.DimMonthDTO; import com.epmet.entity.stats.DimMonthEntity; +import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimMonthService; +import com.epmet.service.stats.LastExecRecordService; import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; 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.Date; import java.util.List; import java.util.Map; @@ -45,6 +51,9 @@ import java.util.Map; @Service public class DimMonthServiceImpl extends BaseServiceImpl implements DimMonthService { + @Autowired + private LastExecRecordService lastExecRecordService; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -97,4 +106,62 @@ public class DimMonthServiceImpl extends BaseServiceImpl + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml new file mode 100644 index 0000000000..6d3bc43ce3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/CustomerDepartmentDao.xml @@ -0,0 +1,19 @@ + + + + + + + \ No newline at end of file From 270d59862cbb9fe4f2b60fed395aea061379342a Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 18 Jun 2020 09:02:54 +0800 Subject: [PATCH 015/101] =?UTF-8?q?cascadegencyinfo,=E7=BA=A7=E8=81=94?= =?UTF-8?q?=E6=9F=A5=E5=87=BA=E4=B8=8B=E7=BA=A7=E6=9C=BA=E5=85=B3=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/AgencySubTreeDto.java | 41 +++++++++++++++ .../com/epmet/controller/DemoController.java | 9 ++++ .../epmet/dao/org/StatsCustomerAgencyDao.java | 5 ++ .../com/epmet/service/StatsDemoService.java | 6 ++- .../service/impl/StatsDemoServiceImpl.java | 5 ++ .../epmet/service/org/DemoGovOrgService.java | 3 ++ .../org/impl/DemoGovOrgServiceImpl.java | 6 +++ .../mapper/org/StatsCustomerAgencyDao.xml | 51 +++++++++++++++++++ 8 files changed, 125 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java new file mode 100644 index 0000000000..f68be23990 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java @@ -0,0 +1,41 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName AgencySubTreeDto + * @Auth wangc + * @Date 2020-06-16 16:51 + */ +@Data +public class AgencySubTreeDto implements Serializable { + private static final long serialVersionUID = 312765293830315198L; + /** + * 机构Id + * */ + private String agencyId; + + /** + * 机构名称 + * */ + private String agencyName; + + /** + * 直属网格Id + * */ + List gridIds; + + /** + * 客户Id + * */ + String customerId; + + /** + * 下级机关集合 + * */ + List subAgencies; +} 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 08b6880295..69cdd8776f 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,11 +1,14 @@ package com.epmet.controller; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.service.StatsDemoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + @RequestMapping("demo") @RestController public class DemoController { @@ -23,5 +26,11 @@ public class DemoController { demoService.testTx(); } + @GetMapping("cascadegencyinfo") + public List selectAllAgency(){ + List result = demoService.getAllAgency(); + return result; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java index 8e6b2330bd..ef6ab4005d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/org/StatsCustomerAgencyDao.java @@ -1,8 +1,10 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.org.CustomerAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -11,4 +13,7 @@ public interface StatsCustomerAgencyDao extends BaseDao { List listAllEntities(); + List selectAllAgency(); + + List selectSubAgencyByPid(@Param("pid")String pid); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java index 1952ade8bf..3ee8455f70 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java @@ -1,8 +1,12 @@ package com.epmet.service; +import com.epmet.dto.AgencySubTreeDto; + +import java.util.List; + public interface StatsDemoService { void testList(); void testTx(); - + List getAllAgency(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index 19cd01f578..cde6df48b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.issue.IssueEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.Issue.DemoIssueService; @@ -37,4 +38,8 @@ public class StatsDemoServiceImpl implements StatsDemoService { public void testTx() { demoDataStatsService.testTx(); } + + public List getAllAgency(){ + return demoGovOrgService.getAllAgency(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java index e0f0c7369a..d5086c6b4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/DemoGovOrgService.java @@ -1,9 +1,12 @@ package com.epmet.service.org; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.org.CustomerAgencyEntity; import java.util.List; public interface DemoGovOrgService { List listAllEntities(); + + List getAllAgency(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java index 643510086b..0d1f46e0cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/org/impl/DemoGovOrgServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.org.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.StatsCustomerAgencyDao; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.service.org.DemoGovOrgService; import org.springframework.beans.factory.annotation.Autowired; @@ -20,4 +21,9 @@ public class DemoGovOrgServiceImpl implements DemoGovOrgService { public List listAllEntities() { return govOrgDao.listAllEntities(); } + + @Override + public List getAllAgency() { + return govOrgDao.selectAllAgency(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml index 789a79dfe1..937233021b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/org/StatsCustomerAgencyDao.xml @@ -10,4 +10,55 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file From d402ef92b6afef54a13d29a17d6424697ae774a2 Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 18 Jun 2020 09:08:27 +0800 Subject: [PATCH 016/101] =?UTF-8?q?=E6=96=B9=E6=B3=95=E5=8A=A0override?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/impl/StatsDemoServiceImpl.java | 1 + .../com/epmet/service/impl/RegisterRelationServiceImpl.java | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index 343c0bed94..b29ca1c98a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -69,6 +69,7 @@ public class StatsDemoServiceImpl implements StatsDemoService { } } + @Override public List getAllAgency(){ return demoGovOrgService.getAllAgency(); } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index 279232667f..b2cba9216e 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -216,11 +216,11 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl registerRecordWithDiffCustAndGrid = registerRecords.stream().filter(obj -> !customerId.equals(obj.getCustomerId()) && !gridId.equals(obj.getGridId())).findAny(); if(registerRecordWithDiffCustAndGrid.isPresent()){ - //如果存在不同客户不同网格的注册信息 + //如果存在不同客户不同网格的注册信息(当前用户已经在别的客户下的网格注册过) //注册用户 参与用户 registerRelationToSave.setFirstRegister(NumConstant.ZERO_STR); registerRelationToSave.setRegister(NumConstant.ONE_STR); From a668d5a7a25eed3a0d915f47b884f47bba04b718 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Thu, 18 Jun 2020 09:23:35 +0800 Subject: [PATCH 017/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=97=A5=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 + .../com/epmet/constant/GroupConstant.java | 19 +++ .../group/form/GridGroupPeopleFormDTO.java | 30 ++++ .../form/GridGroupPeopleTotalFormDTO.java | 30 ++++ .../dto/group/form/GridGroupTotalFormDTO.java | 25 +++ .../dto/group/form/GroupIncrFormDTO.java | 30 ++++ .../result/CustomerGridInfoResultDTO.java | 30 ++++ .../dto/group/result/DimTimeResultDTO.java | 37 +++++ .../result/GridGroupPeopleResultDTO.java | 30 ++++ .../result/GridGroupPeopleTotalResultDTO.java | 25 +++ .../group/result/GridGroupTotalResultDTO.java | 25 +++ .../group/result/GroupGridDailyResultDTO.java | 125 ++++++++++++++ .../dto/group/result/GroupIncrResultDTO.java | 25 +++ .../dto/stats/FactGroupAgencyDailyDTO.java | 156 ++++++++++++++++++ .../dto/stats/FactGroupAgencyMonthlyDTO.java | 146 ++++++++++++++++ .../dto/stats/FactGroupGridDailyDTO.java | 156 ++++++++++++++++++ .../data-statistical-server/pom.xml | 20 ++- .../controller/StatsGroupController.java | 36 ++++ .../com/epmet/dao/group/GroupDataDao.java | 50 ++++++ .../java/com/epmet/dao/stats/DimDateDao.java | 4 + .../java/com/epmet/dao/stats/DimGridDao.java | 6 + .../dao/stats/FactGroupAgencyDailyDao.java | 33 ++++ .../dao/stats/FactGroupAgencyMonthlyDao.java | 33 ++++ .../dao/stats/FactGroupGridDailyDao.java | 44 +++++ .../stats/FactGroupAgencyDailyEntity.java | 126 ++++++++++++++ .../stats/FactGroupAgencyMonthlyEntity.java | 116 +++++++++++++ .../stats/FactGroupGridDailyEntity.java | 126 ++++++++++++++ .../com/epmet/service/StatsGroupService.java | 15 ++ .../epmet/service/group/GroupDataService.java | 22 +++ .../group/impl/GroupDataServiceImpl.java | 118 +++++++++++++ .../service/impl/StatsGroupServiceImpl.java | 60 +++++++ .../stats/FactGroupAgencyDailyService.java | 95 +++++++++++ .../stats/FactGroupAgencyMonthlyService.java | 95 +++++++++++ .../stats/FactGroupGridDailyService.java | 103 ++++++++++++ .../impl/FactGroupAgencyDailyServiceImpl.java | 100 +++++++++++ .../FactGroupAgencyMonthlyServiceImpl.java | 99 +++++++++++ .../impl/FactGroupGridDailyServiceImpl.java | 117 +++++++++++++ .../src/main/resources/bootstrap.yml | 7 +- .../resources/mapper/group/GroupDataDao.xml | 71 ++++++++ .../resources/mapper/stats/DimDateDao.xml | 18 ++ .../resources/mapper/stats/DimGridDao.xml | 12 ++ .../mapper/stats/FactGroupAgencyDailyDao.xml | 34 ++++ .../stats/FactGroupAgencyMonthlyDao.xml | 32 ++++ .../mapper/stats/FactGroupGridDailyDao.xml | 68 ++++++++ 44 files changed, 2545 insertions(+), 5 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/CustomerGridInfoResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleTotalResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupTotalResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupIncrResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.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 f79ab899cf..196aa19dcf 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 @@ -8,5 +8,6 @@ public interface DataSourceConstant { String GOV_PROJECT = "govProject"; String GOV_VOICE = "govVoice"; String OPER_CRM = "operCrm"; + String RESI_GROUP = "resiGroup"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java new file mode 100644 index 0000000000..b5465e4a7b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java @@ -0,0 +1,19 @@ +package com.epmet.constant; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:02 + */ +public interface GroupConstant { + + /** + * eg: 2020W10 = 2020年第10周 + */ + String W = "W"; + + /** + * eg: 2020Q01 = 2020年第一季度 + */ + String Q = "Q"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java new file mode 100644 index 0000000000..b3d731a8d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:34 + */ +@Data +public class GridGroupPeopleFormDTO implements Serializable { + + private static final long serialVersionUID = -3634745091993094743L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小组状态 + */ + private String state = "approved"; + + /** + * 人员状态 + */ + private String status = "removed"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java new file mode 100644 index 0000000000..637f10be08 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:34 + */ +@Data +public class GridGroupPeopleTotalFormDTO implements Serializable { + + private static final long serialVersionUID = -6415141711878464704L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小组状态 + */ + private String state = "approved"; + + /** + * 人员状态 + */ + private String status = "removed"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java new file mode 100644 index 0000000000..3e97445cea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:34 + */ +@Data +public class GridGroupTotalFormDTO implements Serializable { + + private static final long serialVersionUID = 4605386326533905365L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 小组状态 + */ + private String state = "approved"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java new file mode 100644 index 0000000000..6d6e981037 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 16:45 + */ +@Data +public class GroupIncrFormDTO implements Serializable { + + private static final long serialVersionUID = 4498126701378094617L; + + /** + * 小组状态 只算 state = “approved” + */ + private String state = "approved"; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期(昨日) + */ + private String yesterday; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/CustomerGridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/CustomerGridInfoResultDTO.java new file mode 100644 index 0000000000..e81d03439f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/CustomerGridInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 14:48 + */ +@Data +public class CustomerGridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 6635092874863425910L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格所属机关ID + */ + private String agencyId; + + /** + * 客户ID + */ + private String customerId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java new file mode 100644 index 0000000000..fad5e3ed86 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.dto.group.result; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 19:16 + */ +public class DimTimeResultDTO implements Serializable { + + private static final long serialVersionUID = -2863598069938303232L; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月Id + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleResultDTO.java new file mode 100644 index 0000000000..ce1667a123 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class GridGroupPeopleResultDTO implements Serializable { + + private static final long serialVersionUID = -7251423227553175946L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 网格下-每个小组内成员的数量【人员状态 不为 removed】 + */ + private Integer groupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleTotalResultDTO.java new file mode 100644 index 0000000000..ae7bc8a19f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupPeopleTotalResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class GridGroupPeopleTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -6131166787256682153L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格下的小组成员总数量 + */ + private Integer gridGroupPeopleTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupTotalResultDTO.java new file mode 100644 index 0000000000..055fd3f947 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridGroupTotalResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class GridGroupTotalResultDTO implements Serializable { + + private static final long serialVersionUID = 1099735509481708988L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格下的小组数量 + */ + private Integer gridGroupTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java new file mode 100644 index 0000000000..23a9312e63 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java @@ -0,0 +1,125 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 17:25 + */ +@Data +public class GroupGridDailyResultDTO implements Serializable { + + private static final long serialVersionUID = 3206418216410331158L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 年ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 网格数 当前网格下的网格数 + */ + private Integer gridTotal = 0; + + /** + * 小组数 + */ + private Integer groupTotal = 0; + + /** + * 网格下所有组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr = 0; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount = 1; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag = "0"; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupIncrResultDTO.java new file mode 100644 index 0000000000..df09ee4bf3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupIncrResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 16:48 + */ +@Data +public class GroupIncrResultDTO implements Serializable { + + private static final long serialVersionUID = 5536872354876581582L; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组日增数 + */ + private Integer groupIncr = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyDailyDTO.java new file mode 100644 index 0000000000..a33b74dac2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyDailyDTO.java @@ -0,0 +1,156 @@ +/** + * 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-06-16 + */ +@Data +public class FactGroupAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格总数 截至统计日期 + */ + private Integer gridTotal; + + /** + * 网格小组数(包含所有下级机关的网格小组) 截至统计日期 + */ + private Integer groupTotalCount; + + /** + * 机关下网格小组人数总计 不去重 + */ + private Integer groupMemberTotalCount; + + /** + * 小组平均人数 截至统计日期 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 当天小组增量 + */ + private Integer groupIncr; + + /** + * 小组最大成员数 + */ + private String groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组最小成员数 + */ + private String groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除: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/FactGroupAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyMonthlyDTO.java new file mode 100644 index 0000000000..54b01164a4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupAgencyMonthlyDTO.java @@ -0,0 +1,146 @@ +/** + * 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-06-16 + */ +@Data +public class FactGroupAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份ID 关联月份dim表 + */ + private String monthId; + + /** + * 统计季度ID + */ + private String quarterId; + + /** + * 统计年份ID + */ + private String yearId; + + /** + * 网格数 截至到月末的机关下网格数 + */ + private Integer gridTotal; + + /** + * 小组数 截止到月末的新增数(该月内所有的新增数字之和) + */ + private Integer groupTotal; + + /** + * 机关下网格组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 月末一天的平均数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 月末一天的中位数(人) + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 成员最多小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 成员最少小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除: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/FactGroupGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupGridDailyDTO.java new file mode 100644 index 0000000000..48503b3623 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGroupGridDailyDTO.java @@ -0,0 +1,156 @@ +/** + * 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-06-16 + */ +@Data +public class FactGroupGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 年ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 网格数 当前网格下的网格数 + */ + private Integer gridTotal; + + /** + * 小组数 + */ + private Integer groupTotal; + + /** + * 网格下所有组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除: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-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index dcd55b9ad9..0ff2d4d849 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -129,11 +129,17 @@ epmet_gov_voice_user EpmEt-db-UsEr - + - - epmet_oper_crm_user - EpmEt-db-UsEr + + epmet_oper_crm_user + EpmEt-db-UsEr + + + + + epmet_resi_group_user + EpmEt-db-UsEr 0 @@ -205,6 +211,12 @@ epmet elink@8473066 + + + + epmet_resi_group_user + EpmEt-db-UsEr + 0 r-m5eoz5b6tkx09y6bpz.redis.rds.aliyuncs.com diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java new file mode 100644 index 0000000000..7f2dd5ee76 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -0,0 +1,36 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.service.StatsGroupService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.stats.FactGroupGridDailyService; +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; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:21 + */ +@RestController +@RequestMapping("statsgroup") +public class StatsGroupController { + + @Autowired + private StatsGroupService statsGroupService; + + /** + * @Description 统计 “小组” 有关数据, dim:【网格-日】 + * 网格数、小组数、网格下所有组内人数(不去重) + * 小组平均人数、小组人数中位数、小组增量 + * 小组成员最大数、最多成员小组ID + * 小组成员最小数、最少成员小组ID + * @author zxc + */ + @PostMapping("groupgriddaily") + public void groupGridDaily(){ + statsGroupService.groupGridDaily(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java new file mode 100644 index 0000000000..bd93d50689 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -0,0 +1,50 @@ +package com.epmet.dao.group; + +import com.epmet.dto.group.form.GridGroupPeopleFormDTO; +import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; +import com.epmet.dto.group.form.GridGroupTotalFormDTO; +import com.epmet.dto.group.form.GroupIncrFormDTO; +import com.epmet.dto.group.result.GridGroupPeopleResultDTO; +import com.epmet.dto.group.result.GridGroupPeopleTotalResultDTO; +import com.epmet.dto.group.result.GridGroupTotalResultDTO; +import com.epmet.dto.group.result.GroupIncrResultDTO; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:22 + */ +@Mapper +public interface GroupDataDao { + + /** + * @Description 查询网格下的小组总数,状态为 “approved” + * @param formDTO + * @author zxc + */ + List selectGridGroupTotal(GridGroupTotalFormDTO formDTO); + + /** + * @Description 查询网格下的小组成员总数 , 人员状态不为 “removed” + * @param formDTO + * @author zxc + */ + List selectGridGroupPeopleTotal(GridGroupPeopleTotalFormDTO formDTO); + + /** + * @Description 查询每个小组的人数 + * @param formDTO + * @author zxc + */ + List selectEveryGroupPeopleCount(GridGroupPeopleFormDTO formDTO); + + /** + * @Description 查询网格下的小组日增数 + * @param formDTO + * @author zxc + */ + List selectGroupIncr(GroupIncrFormDTO formDTO); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java index 3a1436cbcc..f9091f4be4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDateDao.java @@ -18,9 +18,11 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.result.DimTimeResultDTO; import com.epmet.dto.stats.DimDateDTO; import com.epmet.entity.stats.DimDateEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -47,4 +49,6 @@ public interface DimDateDao extends BaseDao { DimDateDTO getLatestDimDate(); int insertOne(DimDateEntity dimDateEntity); + + DimTimeResultDTO selectDimTime(@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 a2d36e2481..4793b49558 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 @@ -19,12 +19,15 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.org.CustomerGridEntity; +import com.epmet.dto.group.result.CustomerGridInfoResultDTO; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; import java.util.Date; import java.util.List; +import java.util.List; + /** * 客户网格维度 * @@ -36,4 +39,7 @@ public interface DimGridDao extends BaseDao { DimGridEntity getLastCreatedGridDimEntity(); + + List selectCustomerGrid(); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java new file mode 100644 index 0000000000..6a3f343a9a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactGroupAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java new file mode 100644 index 0000000000..7928b13b0a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组-机关月统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Mapper +public interface FactGroupAgencyMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java new file mode 100644 index 0000000000..8c1a636d3c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -0,0 +1,44 @@ +/** + * 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.group.result.GroupGridDailyResultDTO; +import com.epmet.entity.stats.FactGroupGridDailyEntity; +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-06-16 + */ +@Mapper +public interface FactGroupGridDailyDao extends BaseDao { + + /** + * @Description 插入小组【网格-日】 + * @param formDto + * @author zxc + */ + void insertGroupGridDaily(@Param("formDto") List formDto); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyDailyEntity.java new file mode 100644 index 0000000000..e3ee31e7ec --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyDailyEntity.java @@ -0,0 +1,126 @@ +/** + * 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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_agency_daily") +public class FactGroupAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格总数 截至统计日期 + */ + private Integer gridTotal; + + /** + * 网格小组数(包含所有下级机关的网格小组) 截至统计日期 + */ + private Integer groupTotalCount; + + /** + * 机关下网格小组人数总计 不去重 + */ + private Integer groupMemberTotalCount; + + /** + * 小组平均人数 截至统计日期 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 当天小组增量 + */ + private Integer groupIncr; + + /** + * 小组最大成员数 + */ + private String groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组最小成员数 + */ + private String groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyMonthlyEntity.java new file mode 100644 index 0000000000..b7902589c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupAgencyMonthlyEntity.java @@ -0,0 +1,116 @@ +/** + * 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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_agency_monthly") +public class FactGroupAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份ID 关联月份dim表 + */ + private String monthId; + + /** + * 统计季度ID + */ + private String quarterId; + + /** + * 统计年份ID + */ + private String yearId; + + /** + * 网格数 截至到月末的机关下网格数 + */ + private Integer gridTotal; + + /** + * 小组数 截止到月末的新增数(该月内所有的新增数字之和) + */ + private Integer groupTotal; + + /** + * 机关下网格组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 月末一天的平均数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 月末一天的中位数(人) + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 成员最多小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 成员最少小组ID + */ + private String minMemberGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupGridDailyEntity.java new file mode 100644 index 0000000000..3c23206bc8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGroupGridDailyEntity.java @@ -0,0 +1,126 @@ +/** + * 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-06-16 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_group_grid_daily") +public class FactGroupGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID 关联机关dim表 + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月份ID + */ + private String monthId; + + /** + * 年ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 网格数 当前网格下的网格数 + */ + private Integer gridTotal; + + /** + * 小组数 + */ + private Integer groupTotal; + + /** + * 网格下所有组内总人数 不去重 + */ + private Integer groupMemberTotal; + + /** + * 小组平均人数 + */ + private Integer groupMemberAvgCount; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian; + + /** + * 小组增量 + */ + private Integer groupIncr; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java new file mode 100644 index 0000000000..d792170796 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -0,0 +1,15 @@ +package com.epmet.service; + +/** + * @Author zxc + * @CreateTime 2020/6/16 14:14 + */ +public interface StatsGroupService { + + /** + * @Description 统计 “小组” 有关数据, dim:【网格-日】 + * @author zxc + */ + void groupGridDaily(); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java new file mode 100644 index 0000000000..2b921314cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -0,0 +1,22 @@ +package com.epmet.service.group; + +import com.epmet.dto.group.result.CustomerGridInfoResultDTO; +import com.epmet.dto.group.result.GroupGridDailyResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:22 + */ +public interface GroupDataService { + + /** + * @Description 统计 “小组” 有关数据, dim:【网格-日】 + * @param customerId + * @param gridsInfo + * @author zxc + */ + List groupGridDaily(String customerId, List gridsInfo); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java new file mode 100644 index 0000000000..c143d10a28 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -0,0 +1,118 @@ +package com.epmet.service.group.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.group.GroupDataDao; +import com.epmet.dao.stats.DimDateDao; +import com.epmet.dto.group.form.GridGroupPeopleFormDTO; +import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; +import com.epmet.dto.group.form.GridGroupTotalFormDTO; +import com.epmet.dto.group.form.GroupIncrFormDTO; +import com.epmet.dto.group.result.*; +import com.epmet.service.group.GroupDataService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @CreateTime 2020/6/16 13:23 + */ +@Service +@DataSource(DataSourceConstant.RESI_GROUP) +public class GroupDataServiceImpl implements GroupDataService { + + @Autowired + private GroupDataDao groupDataDao; + @Autowired + private DimDateDao dimDateDao; + + /** + * @Description 统计 “小组” 有关数据, dim:【网格-日】 + * @param customerId + * @param gridsInfo + * @author zxc + */ + @Override + public List groupGridDaily(String customerId, List gridsInfo) { + String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); + DimTimeResultDTO dimTime = dimDateDao.selectDimTime(dateId); + List result = new ArrayList<>(); + + // 1. 网格下有多少小组,只算 state = ‘approved’ + GridGroupTotalFormDTO formDTO = new GridGroupTotalFormDTO(); + formDTO.setCustomerId(customerId); + List gridGroupTotalResultDTOS = groupDataDao.selectGridGroupTotal(formDTO); + gridsInfo.forEach(grid -> { + GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); + BeanUtils.copyProperties(dimTime,dailyResult); + dailyResult.setAgencyId(grid.getAgencyId()); + gridGroupTotalResultDTOS.forEach(groupTotal -> { + if (grid.getGridId().equals(groupTotal.getGridId())){ + dailyResult.setGroupTotal(groupTotal.getGridGroupTotal()); + dailyResult.setGridId(grid.getGridId()); + } + }); + result.add(dailyResult); + }); + // 2. 网格下所有组内人数和(不需要去重) 人员状态 != "removed" + GridGroupPeopleTotalFormDTO peopleTotalFormDTO = new GridGroupPeopleTotalFormDTO(); + peopleTotalFormDTO.setCustomerId(customerId); + List gridGroupPeopleTotalResultDTOS = groupDataDao.selectGridGroupPeopleTotal(peopleTotalFormDTO); + result.forEach(grid -> { + gridGroupPeopleTotalResultDTOS.forEach(groupPeopleTotal -> { + if (grid.getGridId().equals(groupPeopleTotal.getGridId())){ + grid.setGroupMemberTotal(groupPeopleTotal.getGridGroupPeopleTotal()); + } + }); + }); + // 3. 网格下小组平均人数 + result.forEach(grid -> { + grid.setGroupMemberAvgCount(grid.getGroupMemberTotal()/grid.getGroupTotal()); + }); + // 4. 网格下小组人数中位数 + GridGroupPeopleFormDTO everyGroupPeople = new GridGroupPeopleFormDTO(); + everyGroupPeople.setCustomerId(customerId); + List everyGroupPeopleCount = groupDataDao.selectEveryGroupPeopleCount(everyGroupPeople); + Map> collect = everyGroupPeopleCount.stream().collect(Collectors.groupingBy(every -> every.getGridId())); + Set>> entries = collect.entrySet(); + entries.forEach(everyGroup -> { + List value = everyGroup.getValue(); + List groupPeopleSorted = value.stream().sorted(Comparator.comparing(GridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); + Integer groupPeopleMedian = groupPeopleSorted.size() % 2 == 0 ? + (groupPeopleSorted.get(groupPeopleSorted.size() / 2 - 1).getGroupCount() + groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount()) / 2 : + groupPeopleSorted.get(groupPeopleSorted.size() / 2).getGroupCount(); + result.forEach(grid -> { + if (groupPeopleSorted.get(0).getGridId().equals(grid.getGridId())){ + grid.setGroupMedian(groupPeopleMedian);//中位数 + //网格下小组成员最大数 + grid.setGroupMemberMaxCount(groupPeopleSorted.get(NumConstant.ZERO).getGroupCount()); + //最多成员小组ID + grid.setMaxMemberGroupId(groupPeopleSorted.get(NumConstant.ZERO).getGroupId()); + //网格下小组成员最小数 + grid.setGroupMemberMinCount(groupPeopleSorted.get(groupPeopleSorted.size()-NumConstant.ONE).getGroupCount()); + //最少成员小组ID + grid.setMinMemberGroupId(groupPeopleSorted.get(groupPeopleSorted.size()-NumConstant.ONE).getGroupId()); + } + }); + }); + //TODO 网格下小组增量 + GroupIncrFormDTO groupIncr = new GroupIncrFormDTO(); + groupIncr.setCustomerId(customerId); + groupIncr.setYesterday(dateId); + List groupIncrResult = groupDataDao.selectGroupIncr(groupIncr); + result.forEach(grid -> { + groupIncrResult.forEach(gridIncr -> { + if (grid.getGridId().equals(gridIncr.getGridId())){ + grid.setGroupIncr(gridIncr.getGroupIncr()); + } + }); + }); + return result; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java new file mode 100644 index 0000000000..f647c7439a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -0,0 +1,60 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.stats.DimGridDao; +import com.epmet.dao.stats.FactGroupGridDailyDao; +import com.epmet.dto.group.result.CustomerGridInfoResultDTO; +import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.service.StatsGroupService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.stats.FactGroupGridDailyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @CreateTime 2020/6/16 14:14 + */ +@Service +public class StatsGroupServiceImpl implements StatsGroupService { + + @Autowired + private DimGridDao dimGridDao; + @Autowired + private GroupDataService groupDataService; + @Autowired + private FactGroupGridDailyService factGroupGridDailyService; + + /** + * @Description 统计【网格-日】 + * @param + * @author zxc + */ + @Override + public void groupGridDaily() { + + //每个客户下的网格信息 + List customerGridInfos = dimGridDao.selectCustomerGrid(); + if (customerGridInfos.size() == NumConstant.ZERO){ + return; + } + //根据customerId分组 + Map> collect = customerGridInfos.stream().collect(Collectors.groupingBy(gridInfo -> gridInfo.getCustomerId())); + Set>> entries = collect.entrySet(); + entries.forEach(customerGridInfo -> { + String customerId = customerGridInfo.getKey(); + List gridsInfo = customerGridInfo.getValue(); + if (gridsInfo.size() != NumConstant.ZERO){ + List resultDTOS = groupDataService.groupGridDaily(customerId, gridsInfo); + //执行插入 fact_group_grid_daily + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + } + }); + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java new file mode 100644 index 0000000000..3801b7b9b2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactGroupAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 组-机关日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGroupAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupAgencyDailyDTO + * @author generator + * @date 2020-06-16 + */ + FactGroupAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(FactGroupAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(FactGroupAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java new file mode 100644 index 0000000000..7e851aa6da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactGroupAgencyMonthlyDTO; +import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 组-机关月统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGroupAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupAgencyMonthlyDTO + * @author generator + * @date 2020-06-16 + */ + FactGroupAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(FactGroupAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(FactGroupAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java new file mode 100644 index 0000000000..b8e1ad06ab --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java @@ -0,0 +1,103 @@ +/** + * 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.group.result.GroupGridDailyResultDTO; +import com.epmet.dto.stats.FactGroupGridDailyDTO; +import com.epmet.entity.stats.FactGroupGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 组-网格日统计数据 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +public interface FactGroupGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-16 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-16 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactGroupGridDailyDTO + * @author generator + * @date 2020-06-16 + */ + FactGroupGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void save(FactGroupGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-16 + */ + void update(FactGroupGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-16 + */ + void delete(String[] ids); + + /** + * @Description 统计小组【网格-日】 + * @param formDto + * @author zxc + */ + void statisticsGroupGridDaily(List formDto); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..7f2822e763 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.FactGroupAgencyDailyDao; +import com.epmet.dto.stats.FactGroupAgencyDailyDTO; +import com.epmet.entity.stats.FactGroupAgencyDailyEntity; +import com.epmet.service.stats.FactGroupAgencyDailyService; +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-06-16 + */ +@Service +public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl implements FactGroupAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupAgencyDailyDTO.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 FactGroupAgencyDailyDTO get(String id) { + FactGroupAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupAgencyDailyDTO dto) { + FactGroupAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupAgencyDailyDTO dto) { + FactGroupAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..bf8da031c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java @@ -0,0 +1,99 @@ +/** + * 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.FactGroupAgencyMonthlyDao; +import com.epmet.dto.stats.FactGroupAgencyMonthlyDTO; +import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; +import com.epmet.service.stats.FactGroupAgencyMonthlyService; +import org.apache.commons.lang3.StringUtils; +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-06-16 + */ +@Service +public class FactGroupAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactGroupAgencyMonthlyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupAgencyMonthlyDTO.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 FactGroupAgencyMonthlyDTO get(String id) { + FactGroupAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupAgencyMonthlyDTO dto) { + FactGroupAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupAgencyMonthlyDTO dto) { + FactGroupAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupAgencyMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java new file mode 100644 index 0000000000..68ddd26178 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java @@ -0,0 +1,117 @@ +/** + * 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.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.dto.stats.FactGroupGridDailyDTO; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactGroupGridDailyDao; +import com.epmet.entity.stats.FactGroupGridDailyEntity; +import com.epmet.service.StatsGroupService; +import com.epmet.service.group.GroupDataService; +import com.epmet.service.stats.FactGroupGridDailyService; +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-06-16 + */ +@Service +public class FactGroupGridDailyServiceImpl extends BaseServiceImpl implements FactGroupGridDailyService { + + @Autowired + private StatsGroupService statsGroupService; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactGroupGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactGroupGridDailyDTO.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 FactGroupGridDailyDTO get(String id) { + FactGroupGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactGroupGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactGroupGridDailyDTO dto) { + FactGroupGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactGroupGridDailyDTO dto) { + FactGroupGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactGroupGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * @Description 统计小组【网格-日】 + * @param + * @author zxc + */ + @Override + @Transactional(rollbackFor = Exception.class) + public void statisticsGroupGridDaily(List formDto) { + baseDao.insertGroupGridDaily(formDto); + } + +} \ 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 5bfa6c0bb7..3bed21f9fe 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 @@ -145,7 +145,12 @@ dynamic: url: @datasource.druid.crm.url@ username: @datasource.druid.crm.username@ password: @datasource.druid.crm.password@ - + resiGroup: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.group.url@ + username: @datasource.druid.group.username@ + password: @datasource.druid.group.password@ + thread: # 线程池配置 threadPool: diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml new file mode 100644 index 0000000000..e0f4ee8be0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml index c0d460ae90..94eb88062b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDateDao.xml @@ -31,4 +31,22 @@ VALUES (#{id}, #{dateName}, #{dayOfWeek}, #{dayOfWeekName}, #{weekId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + \ 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 67d130dfde..d71a9799a7 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 @@ -11,5 +11,17 @@ LIMIT 1 + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml new file mode 100644 index 0000000000..2e526090dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml new file mode 100644 index 0000000000..956e399ed0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml new file mode 100644 index 0000000000..03b90c7c14 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + INSERT INTO fact_group_grid_daily (ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, + GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, + GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + VALUES + + ( + REPLACE(UUID(),'-',''), + #{grid.agencyId}, + #{grid.gridId}, + #{grid.dateId}, + #{grid.weekId}, + #{grid.monthId}, + #{grid.yearId}, + #{grid.quarterId}, + #{grid.gridTotal}, + #{grid.groupTotal}, + #{grid.groupMemberTotal}, + #{grid.groupMemberAvgCount}, + #{grid.groupMedian}, + #{grid.groupIncr}, + #{grid.groupMemberMaxCount}, + #{grid.maxMemberGroupId}, + #{grid.groupMemberMinCount}, + #{grid.minMemberGroupId}, + #{grid.delFlag}, + #{grid.revision}, + #{grid.createdBy}, + NOW(), + #{grid.updatedBy}, + NOW() + ) + + + + \ No newline at end of file From 62a26d92fe304f3cdba70bdb40d460efcc48e7e7 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 Jun 2020 09:46:19 +0800 Subject: [PATCH 018/101] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-statistical/data-statistical-server/pom.xml | 8 ++++---- .../epmet/service/stats/impl/DimAgencyServiceImpl.java | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index dcd55b9ad9..cd40a2601b 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -129,11 +129,11 @@ epmet_gov_voice_user EpmEt-db-UsEr - + - - epmet_oper_crm_user - EpmEt-db-UsEr + + epmet_oper_crm_user + EpmEt-db-UsEr 0 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 9824d21721..208a785cca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -121,7 +121,7 @@ public class DimAgencyServiceImpl extends BaseServiceImpl Date: Thu, 18 Jun 2020 10:06:26 +0800 Subject: [PATCH 019/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E6=9C=BA=E5=85=B3=E6=97=A5=E7=BB=9F=E8=AE=A1=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ProjectConstant.java | 34 +++ .../controller/StatsProjectController.java | 12 + .../com/epmet/dao/project/ProjectDao.java | 9 + .../epmet/dao/project/ProjectProcessDao.java | 43 ++++ .../entity/project/ProjectProcessEntity.java | 90 ++++++++ .../epmet/service/StatsProjectService.java | 8 + .../service/impl/StatsProjectServiceImpl.java | 205 ++++++++++++++++++ .../project/ProjectProcessService.java | 39 ++++ .../epmet/service/project/ProjectService.java | 8 + .../impl/ProjectProcessServiceImpl.java | 46 ++++ .../project/impl/ProjectServiceImpl.java | 14 +- .../resources/mapper/project/ProjectDao.xml | 12 + .../mapper/project/ProjectProcessDao.xml | 23 ++ .../resources/mapper/stats/DimAgencyDao.xml | 2 +- 14 files changed, 542 insertions(+), 3 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java new file mode 100644 index 0000000000..3d55c8436c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -0,0 +1,34 @@ +package com.epmet.constant; + +/** + * @author sun + * @dscription 数据-项目-常量 + */ +public interface ProjectConstant { + + /** + * 状态-待处理 + */ + String PENDING = "pending"; + /** + * 状态-结案 + */ + String CLOSED = "closed"; + /** + * 结案状态-已解决 + */ + String RESOLVED = "resolved"; + /** + * 结案状态-未解决 + */ + String UNRESOLVED = "unresolved"; + /** + * 项目处理进展-创建项目 + */ + String CREATED = "created"; + /** + * 项目处理进展-结案 + */ + String CLOSE = "close"; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java index 6c7c907c15..5a09fd0ba7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java @@ -29,4 +29,16 @@ public class StatsProjectController { return new Result(); } + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + @PostMapping("gridproject/{customerId}") + public Result statsGridProject(@PathVariable("customerId") String customerId) { + statsProjectService.statsGridProject(customerId); + return new Result(); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 2e531e180a..5ffba5ec49 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 项目表 @@ -30,4 +33,10 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ProjectDao extends BaseDao { + /** + * @param customerId + * @Author sun + * @Description 根据客户Id查询客户项目业务表有效数据 + **/ + List selectProjectList(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java new file mode 100644 index 0000000000..33e3840ea5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -0,0 +1,43 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.project; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.project.ProjectProcessEntity; +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-05-11 + */ +@Mapper +public interface ProjectProcessDao extends BaseDao { + + /** + * @param customerId + * @Author sun + * @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + **/ + List selectProcessList(@Param("customerId") String customerId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java new file mode 100644 index 0000000000..d6f4cd5467 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/project/ProjectProcessEntity.java @@ -0,0 +1,90 @@ +/** + * 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.project; + +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-05-11 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("project_process") +public class ProjectProcessEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 项目所属机关Id + */ + private String agencyId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 部门名 + */ + private String departmentName; + + /** + * 负负责人ID + */ + private String staffId; + + /** + * 处理:结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 处理名 + */ + private String operationName; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 结束时间 + */ + private Date endTime; + + /** + * 耗费天数 + */ + private String costWorkdays; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java index c2d837d172..75a71c1b38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -14,4 +14,12 @@ public interface StatsProjectService { * @Description 数据-项目-机关日(月)统计 **/ void statsAgencyProject(String customerId); + + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + void statsGridProject(String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index 24214d1262..6b20e06655 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -1,13 +1,30 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.dto.stats.DimDateDTO; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.entity.project.ProjectProcessEntity; +import com.epmet.entity.stats.DimDateEntity; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; import com.epmet.service.StatsProjectService; +import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.text.DateFormat; +import java.text.NumberFormat; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.concurrent.atomic.AtomicInteger; + /** * 数据统计-项目(独立于任何具体数据源外层的service) + * * @author sun */ @Service @@ -28,6 +45,8 @@ public class StatsProjectServiceImpl implements StatsProjectService { @Autowired private ProjectService projectService; @Autowired + private ProjectProcessService projectProcessService; + @Autowired private FactAgencyProjectDailyService factAgencyProjectDailyService; @Autowired private FactAgencyProjectMonthlyService factAgencyProjectMonthlyService; @@ -44,6 +63,192 @@ public class StatsProjectServiceImpl implements StatsProjectService { **/ @Override public void statsAgencyProject(String customerId) { + //1:执行机关日数据统计 + agencyDateProjectStats(customerId); + //2:执行机关月数据统计 + if (Calendar.getInstance().get(Calendar.DATE) == 1) { + agencyMonthProjectStats(customerId); + } + + } + + /** + * @param customerId + * @Author sun + * @Description 数据-项目-机关日统计 + **/ + private String agencyDateProjectStats(String customerId) { + Date date = yesterDay(); + //1:查询各维度表Id,方便使用 //TODO + DimDateDTO dimDateDTO = new DimDateDTO(); + dimDateDTO.setCreatedTime(date); + dimDateDTO = dimDateService.getDimDate(dimDateDTO).get(0); + //2:根据客户Id查询机关维度表数据 + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + if (null == dimAgencyList || dimAgencyList.size() < NumConstant.ONE) { + return null; + } + + //3:根据客户Id查询项目业务表数据 + List projectList = projectService.getProjectList(customerId); + + //4:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + List processList = projectProcessService.getProcessList(customerId); + + //5:遍历统计每个机关各项指标数 + //批量机关日统计新增对象 + List dimDateEntityList = new ArrayList<>(); + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(2); + //遍历机关维度数据 + for (DimAgencyDTO agency : dimAgencyList) { + //存放当前机关及所有下级机关Id + Map map = new HashMap<>(); + map.put(agency.getId(), agency.getId()); + String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); + dimAgencyList.forEach(sub -> { + if (sub.getPids().contains(subPids)) { + map.put(sub.getId(), sub.getId()); + } + }); + //机关下截止当前日期的项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger projectTotal = new AtomicInteger(0); + AtomicInteger pendingTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger resolvedTotal = new AtomicInteger(0); + AtomicInteger unResolvedTotal = new AtomicInteger(0); + //存放当前机关及下级已结案切已解决的项目信息 + Map resolvedMap = new HashMap<>(); + //存放当前机关及下级已结案切未解决的项目信息 + Map unResolvedMap = new HashMap<>(); + //遍历项目数据,统计不同数据值 + projectList.forEach(project -> { + if (map.containsKey(project.getAgencyId())) { + projectTotal.addAndGet(1); + if (ProjectConstant.PENDING.equals(project.getStatus())) { + pendingTotal.addAndGet(1); + } + if (ProjectConstant.CLOSED.equals(project.getStatus())) { + closedTotal.addAndGet(1); + if (ProjectConstant.RESOLVED.equals(project.getClosedStatus())) { + resolvedTotal.addAndGet(1); + resolvedMap.put(project.getAgencyId(), project.getClosedStatus()); + } + if (ProjectConstant.UNRESOLVED.equals(project.getClosedStatus())) { + unResolvedTotal.addAndGet(1); + unResolvedMap.put(project.getAgencyId(), project.getClosedStatus()); + } + } + } + }); + //日增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger pendingIncr = new AtomicInteger(0); + AtomicInteger closedIncr = new AtomicInteger(0); + AtomicInteger resolvedIncr = new AtomicInteger(0); + AtomicInteger unResolvedIncr = new AtomicInteger(0); + //遍历项目进展列表数据,统计日增量数据 + processList.forEach(process -> { + if (date.equals(process.getCreatedTime())) { + if (ProjectConstant.CREATED.equals(process.getOperation())) { + pendingIncr.addAndGet(1); + } + if (ProjectConstant.CLOSE.equals(process.getOperation())) { + closedIncr.addAndGet(1); + } + if (resolvedMap.containsKey(process.getAgencyId())) { + resolvedIncr.addAndGet(1); + } + if (unResolvedMap.containsKey(process.getAgencyId())) { + unResolvedIncr.addAndGet(1); + } + } + }); + //封装日数据对象 + FactAgencyProjectDailyEntity agencyDailyEntity = new FactAgencyProjectDailyEntity(); + agencyDailyEntity.setCustomerId(customerId); + agencyDailyEntity.setAgencyId(agency.getId()); + agencyDailyEntity.setParentId(agency.getPid()); + //TODO + agencyDailyEntity.setDateId(""); + agencyDailyEntity.setWeekId(""); + agencyDailyEntity.setMonthId(""); + agencyDailyEntity.setYearId(""); + agencyDailyEntity.setProjectTotal(projectTotal.intValue()); + agencyDailyEntity.setPendingTotal(pendingTotal.intValue()); + agencyDailyEntity.setClosedTotal(closedTotal.intValue()); + agencyDailyEntity.setResolvedTotal(resolvedTotal.intValue()); + agencyDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); + if (projectTotal.intValue() > NumConstant.ZERO) { + agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) pendingTotal.intValue() / (float) projectTotal.intValue() * 100))); + agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100))); + } + if (closedTotal.intValue() > NumConstant.ZERO) { + agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + } + agencyDailyEntity.setProjectIncr(pendingIncr.intValue() + closedIncr.intValue()); + agencyDailyEntity.setPendingIncr(pendingIncr.intValue()); + agencyDailyEntity.setClosedIncr(closedIncr.intValue()); + agencyDailyEntity.setResolvedIncr(resolvedIncr.intValue()); + agencyDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); + + dimDateEntityList.add(agencyDailyEntity); + } + + //6:批量保存机关日统计数据 + if (null != dimDateEntityList && dimDateEntityList.size() > NumConstant.ZERO) { + factAgencyProjectDailyService.insertBatch(dimDateEntityList); + } + return null; } + + /** + * @param customerId + * @Author sun + * @Description 数据-项目-机关月统计 + **/ + private void agencyMonthProjectStats(String customerId) { + + } + + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + @Override + public void statsGridProject(String customerId) { + //1:查询各维度表Id,方便使用 + //2:根据客户Id查询网格维度表数据 + //3:根据客户Id查询项目业务表数据 + //4:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + //5:根据客户Id查询议题表已转项目的议题数据(为了匹配项目所属的网格Id) + //6:遍历统计每个网格各项指标数据 + //7:批量保存网格日统计数据 + //8:判断当前日期是否为当月首日,执行网格月数据统计 + } + + /** + * @Author sun + * @Description 获取当前日期的前一天日期(yyyy-mm-dd) + **/ + private Date yesterDay() { + Date date = new Date(); + try { + DateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.HOUR_OF_DAY, -24); + String str = sdf.format(calendar.getTime()); + date = sdf.parse(str); + } catch (Exception e) { + e.printStackTrace(); + } + return date; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java new file mode 100644 index 0000000000..08f61350b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.project; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.project.ProjectProcessEntity; + +import java.util.List; + +/** + * 项目处理进展表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +public interface ProjectProcessService extends BaseService { + + /** + * @param customerId + * @Author sun + * @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + **/ + List getProcessList(String customerId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index a9b03ae838..d271b95ca3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -20,6 +20,8 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.project.ProjectEntity; +import java.util.List; + /** * 项目表 * @@ -28,4 +30,10 @@ import com.epmet.entity.project.ProjectEntity; */ public interface ProjectService extends BaseService { + /** + * @param customerId + * @Author sun + * @Description 根据客户Id查询客户项目业务表有效数据 + **/ + List getProjectList(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java new file mode 100644 index 0000000000..78eee70af2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.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.service.project.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.project.ProjectProcessDao; +import com.epmet.entity.project.ProjectProcessEntity; +import com.epmet.service.project.ProjectProcessService; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 项目处理进展表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Service +public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectProcessService { + + /** + * @param customerId + * @Author sun + * @Description 查询客户项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + **/ + @Override + public List getProcessList(String customerId) { + return baseDao.selectProcessList(customerId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 702ebf8d89..b551e62c89 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -26,6 +26,8 @@ import com.epmet.service.project.ProjectService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.List; + /** * 项目表 * @@ -35,7 +37,15 @@ import org.springframework.stereotype.Service; @Service @DataSource(DataSourceConstant.GOV_PROJECT) public class ProjectServiceImpl extends BaseServiceImpl implements ProjectService { - @Autowired - private ProjectDao projectDao; + + /** + * @param customerId + * @Author sun + * @Description 根据客户Id查询客户项目业务表有效数据 + **/ + @Override + public List getProjectList(String customerId) { + return baseDao.selectProjectList(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 425f22e0a3..b64db5c5f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -3,5 +3,17 @@ + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml new file mode 100644 index 0000000000..01daae5a72 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ 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 5ca1ddca1c..dc4bf6dba4 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 @@ -12,7 +12,7 @@ WHERE del_flag = '0' - AND customerId = #{customerId} + AND customer_id = #{customerId} From a29faa69834220902d843e6dadd6a033c12637ae Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Thu, 18 Jun 2020 10:23:35 +0800 Subject: [PATCH 020/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=97=A5=E7=BB=9F=E8=AE=A1=E8=A1=A5=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/group/impl/GroupDataServiceImpl.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index c143d10a28..01a8cd979d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -32,6 +32,11 @@ public class GroupDataServiceImpl implements GroupDataService { @Autowired private DimDateDao dimDateDao; + public DimTimeResultDTO getTimeDim(){ + String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); + return dimDateDao.selectDimTime(dateId); + } + /** * @Description 统计 “小组” 有关数据, dim:【网格-日】 * @param customerId @@ -40,8 +45,7 @@ public class GroupDataServiceImpl implements GroupDataService { */ @Override public List groupGridDaily(String customerId, List gridsInfo) { - String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); - DimTimeResultDTO dimTime = dimDateDao.selectDimTime(dateId); + DimTimeResultDTO dimTime = this.getTimeDim(); List result = new ArrayList<>(); // 1. 网格下有多少小组,只算 state = ‘approved’ @@ -104,7 +108,7 @@ public class GroupDataServiceImpl implements GroupDataService { //TODO 网格下小组增量 GroupIncrFormDTO groupIncr = new GroupIncrFormDTO(); groupIncr.setCustomerId(customerId); - groupIncr.setYesterday(dateId); + groupIncr.setYesterday(dimTime.getDateId()); List groupIncrResult = groupDataDao.selectGroupIncr(groupIncr); result.forEach(grid -> { groupIncrResult.forEach(gridIncr -> { From d2412080202cfe06394f3bf850502c7cead77513 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Thu, 18 Jun 2020 10:24:34 +0800 Subject: [PATCH 021/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E6=97=A5=E7=BB=9F=E8=AE=A1=E8=A1=A5=E6=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/group/result/DimTimeResultDTO.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java index fad5e3ed86..e0bd6c6c6c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/DimTimeResultDTO.java @@ -1,11 +1,14 @@ package com.epmet.dto.group.result; +import lombok.Data; + import java.io.Serializable; /** * @Author zxc * @CreateTime 2020/6/17 19:16 */ +@Data public class DimTimeResultDTO implements Serializable { private static final long serialVersionUID = -2863598069938303232L; From 83b9fbb20409c9b48562aeafb12808f25e8ada0e Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 11:04:20 +0800 Subject: [PATCH 022/101] =?UTF-8?q?=E7=94=9F=E6=88=90=E5=AE=A3=E4=BC=A0?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E5=AF=B9=E5=BA=94=E7=9A=84=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FactArticlePublishedAgencyDailyDTO.java | 122 ++++++++++++++++ ...actArticlePublishedDepartmentDailyDTO.java | 122 ++++++++++++++++ .../FactArticlePublishedGridDailyDTO.java | 122 ++++++++++++++++ .../dto/stats/FactTagUsedAgencyDailyDTO.java | 127 +++++++++++++++++ .../stats/FactTagUsedAgencyMonthlyDTO.java | 107 ++++++++++++++ .../stats/FactTagUsedAgencyQuarterlyDTO.java | 107 ++++++++++++++ .../dto/stats/FactTagUsedAgencyYearlyDTO.java | 107 ++++++++++++++ .../stats/FactTagUsedDepartmentDailyDTO.java | 132 ++++++++++++++++++ .../FactTagUsedDepartmentMonthlyDTO.java | 107 ++++++++++++++ .../FactTagUsedDepartmentQuarterlyDTO.java | 107 ++++++++++++++ .../stats/FactTagUsedDepartmentYearlyDTO.java | 107 ++++++++++++++ .../dto/stats/FactTagUsedGridDailyDTO.java | 127 +++++++++++++++++ .../dto/stats/FactTagUsedGridMonthlyDTO.java | 107 ++++++++++++++ .../stats/FactTagUsedGridQuarterlyDTO.java | 107 ++++++++++++++ .../dto/stats/FactTagUsedGridYearlyDTO.java | 107 ++++++++++++++ .../stats/FactTagViewedAgencyDailyDTO.java | 127 +++++++++++++++++ .../stats/FactTagViewedAgencyMonthlyDTO.java | 107 ++++++++++++++ .../FactTagViewedAgencyQuarterlyDTO.java | 107 ++++++++++++++ .../stats/FactTagViewedAgencyYearlyDTO.java | 107 ++++++++++++++ .../dto/stats/FactTagViewedGridDailyDTO.java | 127 +++++++++++++++++ .../stats/FactTagViewedGridMonthlyDTO.java | 107 ++++++++++++++ .../stats/FactTagViewedGridQuarterlyDTO.java | 107 ++++++++++++++ .../dto/stats/FactTagViewedGridYearlyDTO.java | 107 ++++++++++++++ .../FactArticlePublishedAgencyDailyDao.java | 33 +++++ ...actArticlePublishedDepartmentDailyDao.java | 33 +++++ .../FactArticlePublishedGridDailyDao.java | 45 ++++++ .../dao/stats/FactTagUsedAgencyDailyDao.java | 33 +++++ .../stats/FactTagUsedAgencyMonthlyDao.java | 33 +++++ .../stats/FactTagUsedAgencyQuarterlyDao.java | 33 +++++ .../dao/stats/FactTagUsedAgencyYearlyDao.java | 33 +++++ .../stats/FactTagUsedDepartmentDailyDao.java | 33 +++++ .../FactTagUsedDepartmentMonthlyDao.java | 33 +++++ .../FactTagUsedDepartmentQuarterlyDao.java | 33 +++++ .../stats/FactTagUsedDepartmentYearlyDao.java | 33 +++++ .../dao/stats/FactTagUsedGridDailyDao.java | 33 +++++ .../dao/stats/FactTagUsedGridMonthlyDao.java | 33 +++++ .../stats/FactTagUsedGridQuarterlyDao.java | 33 +++++ .../dao/stats/FactTagUsedGridYearlyDao.java | 33 +++++ .../stats/FactTagViewedAgencyDailyDao.java | 33 +++++ .../stats/FactTagViewedAgencyMonthlyDao.java | 33 +++++ .../FactTagViewedAgencyQuarterlyDao.java | 33 +++++ .../stats/FactTagViewedAgencyYearlyDao.java | 33 +++++ .../dao/stats/FactTagViewedGridDailyDao.java | 33 +++++ .../stats/FactTagViewedGridMonthlyDao.java | 33 +++++ .../stats/FactTagViewedGridQuarterlyDao.java | 33 +++++ .../dao/stats/FactTagViewedGridYearlyDao.java | 33 +++++ .../dao/voice/ArticlePublishRangeDao.java | 12 +- ...FactArticlePublishedAgencyDailyEntity.java | 88 ++++++++++++ ...ArticlePublishedDepartmentDailyEntity.java | 88 ++++++++++++ .../FactArticlePublishedGridDailyEntity.java | 88 ++++++++++++ .../stats/FactTagUsedAgencyDailyEntity.java | 93 ++++++++++++ .../stats/FactTagUsedAgencyMonthlyEntity.java | 73 ++++++++++ .../FactTagUsedAgencyQuarterlyEntity.java | 73 ++++++++++ .../stats/FactTagUsedAgencyYearlyEntity.java | 73 ++++++++++ .../FactTagUsedDepartmentDailyEntity.java | 98 +++++++++++++ .../FactTagUsedDepartmentMonthlyEntity.java | 73 ++++++++++ .../FactTagUsedDepartmentQuarterlyEntity.java | 73 ++++++++++ .../FactTagUsedDepartmentYearlyEntity.java | 73 ++++++++++ .../stats/FactTagUsedGridDailyEntity.java | 93 ++++++++++++ .../stats/FactTagUsedGridMonthlyEntity.java | 73 ++++++++++ .../stats/FactTagUsedGridQuarterlyEntity.java | 73 ++++++++++ .../stats/FactTagUsedGridYearlyEntity.java | 73 ++++++++++ .../stats/FactTagViewedAgencyDailyEntity.java | 93 ++++++++++++ .../FactTagViewedAgencyMonthlyEntity.java | 73 ++++++++++ .../FactTagViewedAgencyQuarterlyEntity.java | 73 ++++++++++ .../FactTagViewedAgencyYearlyEntity.java | 73 ++++++++++ .../stats/FactTagViewedGridDailyEntity.java | 93 ++++++++++++ .../stats/FactTagViewedGridMonthlyEntity.java | 73 ++++++++++ .../FactTagViewedGridQuarterlyEntity.java | 73 ++++++++++ .../stats/FactTagViewedGridYearlyEntity.java | 73 ++++++++++ .../epmet/service/StatsPublicityService.java | 2 +- .../impl/StatsPublicityServiceImpl.java | 41 +++++- .../epmet/service/stats/DimGridService.java | 14 +- ...actArticlePublishedAgencyDailyService.java | 32 +++++ ...rticlePublishedDepartmentDailyService.java | 31 ++++ .../FactArticlePublishedGridDailyService.java | 44 ++++++ .../stats/impl/DimGridServiceImpl.java | 13 +- ...rticlePublishedAgencyDailyServiceImpl.java | 38 +++++ ...lePublishedDepartmentDailyServiceImpl.java | 36 +++++ ...tArticlePublishedGridDailyServiceImpl.java | 52 +++++++ .../voice/ArticlePublishRangeService.java | 35 +++-- .../impl/ArticlePublishRangeServiceImpl.java | 28 +++- .../FactArticlePublishedAgencyDailyDao.xml | 27 ++++ ...FactArticlePublishedDepartmentDailyDao.xml | 27 ++++ .../FactArticlePublishedGridDailyDao.xml | 42 ++++++ .../stats/FactTagUsedAgencyDailyDao.xml | 28 ++++ .../stats/FactTagUsedAgencyMonthlyDao.xml | 24 ++++ .../stats/FactTagUsedAgencyQuarterlyDao.xml | 24 ++++ .../stats/FactTagUsedAgencyYearlyDao.xml | 24 ++++ .../stats/FactTagUsedDepartmentDailyDao.xml | 29 ++++ .../stats/FactTagUsedDepartmentMonthlyDao.xml | 24 ++++ .../FactTagUsedDepartmentQuarterlyDao.xml | 24 ++++ .../stats/FactTagUsedDepartmentYearlyDao.xml | 24 ++++ .../mapper/stats/FactTagUsedGridDailyDao.xml | 28 ++++ .../stats/FactTagUsedGridMonthlyDao.xml | 24 ++++ .../stats/FactTagUsedGridQuarterlyDao.xml | 24 ++++ .../mapper/stats/FactTagUsedGridYearlyDao.xml | 24 ++++ .../stats/FactTagViewedAgencyDailyDao.xml | 28 ++++ .../stats/FactTagViewedAgencyMonthlyDao.xml | 24 ++++ .../stats/FactTagViewedAgencyQuarterlyDao.xml | 24 ++++ .../stats/FactTagViewedAgencyYearlyDao.xml | 24 ++++ .../stats/FactTagViewedGridDailyDao.xml | 28 ++++ .../stats/FactTagViewedGridMonthlyDao.xml | 24 ++++ .../stats/FactTagViewedGridQuarterlyDao.xml | 24 ++++ .../stats/FactTagViewedGridYearlyDao.xml | 24 ++++ .../mapper/voice/ArticlePublishRangeDao.xml | 20 ++- 106 files changed, 6174 insertions(+), 32 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedDepartmentDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyQuarterlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyYearlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentQuarterlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentYearlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridQuarterlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridYearlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyQuarterlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyYearlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridQuarterlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridYearlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyYearlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentYearlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridYearlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyYearlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridYearlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedAgencyDailyDTO.java new file mode 100644 index 0000000000..36f35bdc12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedAgencyDailyDTO.java @@ -0,0 +1,122 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactArticlePublishedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactArticlePublishedDepartmentDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedDepartmentDailyDTO.java new file mode 100644 index 0000000000..622e88d01c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedDepartmentDailyDTO.java @@ -0,0 +1,122 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactArticlePublishedDepartmentDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String depsartmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactArticlePublishedGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedGridDailyDTO.java new file mode 100644 index 0000000000..91f19b4517 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactArticlePublishedGridDailyDTO.java @@ -0,0 +1,122 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactArticlePublishedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyDailyDTO.java new file mode 100644 index 0000000000..7b5d06b166 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyMonthlyDTO.java new file mode 100644 index 0000000000..6f6566c465 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyMonthlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedAgencyQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyQuarterlyDTO.java new file mode 100644 index 0000000000..c052c70b33 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyQuarterlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedAgencyYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyYearlyDTO.java new file mode 100644 index 0000000000..568839ed7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedAgencyYearlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedAgencyYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedDepartmentDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentDailyDTO.java new file mode 100644 index 0000000000..d0b4a2d7ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentDailyDTO.java @@ -0,0 +1,132 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedDepartmentMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentMonthlyDTO.java new file mode 100644 index 0000000000..5acf3c7452 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentMonthlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedDepartmentQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentQuarterlyDTO.java new file mode 100644 index 0000000000..01c5a63353 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentQuarterlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedDepartmentYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentYearlyDTO.java new file mode 100644 index 0000000000..c4867a89b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedDepartmentYearlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedDepartmentYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridDailyDTO.java new file mode 100644 index 0000000000..f0fa8b8248 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridMonthlyDTO.java new file mode 100644 index 0000000000..7d0915cd48 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridMonthlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedGridQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridQuarterlyDTO.java new file mode 100644 index 0000000000..9a3fda80f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridQuarterlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/stats/FactTagUsedGridYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridYearlyDTO.java new file mode 100644 index 0000000000..b68737c5e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagUsedGridYearlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagUsedGridYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyDailyDTO.java new file mode 100644 index 0000000000..24eaf450de --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyMonthlyDTO.java new file mode 100644 index 0000000000..34bd1bd0a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyMonthlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedAgencyQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyQuarterlyDTO.java new file mode 100644 index 0000000000..d8d0fd6e8b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyQuarterlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedAgencyYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyYearlyDTO.java new file mode 100644 index 0000000000..5531dbf1b7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedAgencyYearlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedAgencyYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridDailyDTO.java new file mode 100644 index 0000000000..22bb0f0e76 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridDailyDTO.java @@ -0,0 +1,127 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridMonthlyDTO.java new file mode 100644 index 0000000000..1a9b7112d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridMonthlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedGridQuarterlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridQuarterlyDTO.java new file mode 100644 index 0000000000..f73e782445 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridQuarterlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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/stats/FactTagViewedGridYearlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridYearlyDTO.java new file mode 100644 index 0000000000..da404525e9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactTagViewedGridYearlyDTO.java @@ -0,0 +1,107 @@ +/** + * 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 lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +public class FactTagViewedGridYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java new file mode 100644 index 0000000000..ee299f316c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactArticlePublishedAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java new file mode 100644 index 0000000000..eb09ed6ce3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.java new file mode 100644 index 0000000000..bbbaf288b9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedGridDailyDao.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.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; +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-06-18 + */ +@Mapper +public interface FactArticlePublishedGridDailyDao extends BaseDao { + + /** + * desc:获取客户 指定日期内的数据 + * + * @param customerId + * @param dateId + * @return + */ + List getByBeforeDay(@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/FactTagUsedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java new file mode 100644 index 0000000000..9163b9a587 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java new file mode 100644 index 0000000000..74676b13e6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedAgencyMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..05a61832b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedAgencyQuarterlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java new file mode 100644 index 0000000000..83bb23460a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedAgencyYearlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java new file mode 100644 index 0000000000..d0a2bfcfe3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedDepartmentDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java new file mode 100644 index 0000000000..9f8d4efb02 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedDepartmentMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java new file mode 100644 index 0000000000..4a0b782090 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedDepartmentQuarterlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java new file mode 100644 index 0000000000..77e61837dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedDepartmentYearlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java new file mode 100644 index 0000000000..1139dfe31f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java new file mode 100644 index 0000000000..a9c34c0110 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedGridMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java new file mode 100644 index 0000000000..49f5172fbd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedGridQuarterlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java new file mode 100644 index 0000000000..218b643eb8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagUsedGridYearlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java new file mode 100644 index 0000000000..0726fa3c22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java new file mode 100644 index 0000000000..d41f55eabc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedAgencyMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java new file mode 100644 index 0000000000..7816c9b477 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedAgencyQuarterlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java new file mode 100644 index 0000000000..67554b31e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedAgencyYearlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java new file mode 100644 index 0000000000..aec2bd6862 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java new file mode 100644 index 0000000000..eed19fc006 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedGridMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java new file mode 100644 index 0000000000..61488aa9df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedGridQuarterlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java new file mode 100644 index 0000000000..7e4e436b42 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Mapper +public interface FactTagViewedGridYearlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java index 13b47c66b5..f70feecf13 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java @@ -42,5 +42,15 @@ public interface ArticlePublishRangeDao extends BaseDao selectByCreatedDate(@Param("customerId") String customerId, @Param("createDate") Date createDate); + List getAllPublishedCount(@Param("customerId") String customerId, @Param("createDate") Date createDate); + + /** + * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 + * + * @param customerId + * @param startDate + * @param endDate + * @return: List + */ + List getOneDayPublishedCount(@Param("customerId") String customerId, @Param("startDate") Date startDate, @Param("endDate") Date endDate); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java new file mode 100644 index 0000000000..631f21fa49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedAgencyDailyEntity.java @@ -0,0 +1,88 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_agency_daily") +public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java new file mode 100644 index 0000000000..c91d318a87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java @@ -0,0 +1,88 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_department_daily") +public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String depsartmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java new file mode 100644 index 0000000000..94d209d414 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedGridDailyEntity.java @@ -0,0 +1,88 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_article_published_grid_daily") +public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyDailyEntity.java new file mode 100644 index 0000000000..51b1c1cf47 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_daily") +public class FactTagUsedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java new file mode 100644 index 0000000000..1e27d21287 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_monthly") +public class FactTagUsedAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java new file mode 100644 index 0000000000..b68c76a874 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_quarterly") +public class FactTagUsedAgencyQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyYearlyEntity.java new file mode 100644 index 0000000000..dcdc366f74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_agency_yearly") +public class FactTagUsedAgencyYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentDailyEntity.java new file mode 100644 index 0000000000..7087d8dd5f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentDailyEntity.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_daily") +public class FactTagUsedDepartmentDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java new file mode 100644 index 0000000000..29ecd87dae --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_monthly") +public class FactTagUsedDepartmentMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java new file mode 100644 index 0000000000..ceac4e9d86 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_quarterly") +public class FactTagUsedDepartmentQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentYearlyEntity.java new file mode 100644 index 0000000000..62b2bb91c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_department_yearly") +public class FactTagUsedDepartmentYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridDailyEntity.java new file mode 100644 index 0000000000..8dcdb3f73c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_daily") +public class FactTagUsedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 日期ID 天ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java new file mode 100644 index 0000000000..eecc92bb6d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_monthly") +public class FactTagUsedGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java new file mode 100644 index 0000000000..fbe54ea535 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_quarterly") +public class FactTagUsedGridQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridYearlyEntity.java new file mode 100644 index 0000000000..b502950800 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_used_grid_yearly") +public class FactTagUsedGridYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 标签使用次数 标签的使用次数 + */ + private Integer usedCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyDailyEntity.java new file mode 100644 index 0000000000..6df781bc22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_daily") +public class FactTagViewedAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java new file mode 100644 index 0000000000..1b357bbfc4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_monthly") +public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java new file mode 100644 index 0000000000..dadd68ae40 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_quarterly") +public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyYearlyEntity.java new file mode 100644 index 0000000000..1850099d9d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_agency_yearly") +public class FactTagViewedAgencyYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridDailyEntity.java new file mode 100644 index 0000000000..97457851dc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridDailyEntity.java @@ -0,0 +1,93 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_daily") +public class FactTagViewedGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java new file mode 100644 index 0000000000..49cb7ba97c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_monthly") +public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java new file mode 100644 index 0000000000..e48167f458 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_quarterly") +public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridYearlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridYearlyEntity.java new file mode 100644 index 0000000000..eaf149fc22 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridYearlyEntity.java @@ -0,0 +1,73 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_tag_viewed_grid_yearly") +public class FactTagViewedGridYearlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index e861ab90fc..1a31ac74ad 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -5,7 +5,7 @@ public interface StatsPublicityService { /** * desc: 统计宣传能力的汇总信息 * - * return: + * @return: Boolean * @date: 2020/6/17 16:11 * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 844d11d04c..5c27913655 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -2,6 +2,8 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; @@ -36,9 +38,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private DimYearService dimYearService; @Autowired private DimCustomerService dimCustomerService; + @Autowired + private DimGridService dimGridService; @Autowired private ArticlePublishRangeService articlePublishRangeService; + @Autowired + private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @Override public Boolean publicitySummary() { @@ -46,23 +52,48 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { int pageSize = 100; List customerIdList = null; do { - customerIdList = dimCustomerService.selectCustomerIdPage(pageNo, (pageNo - 1) * pageSize); + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { customerIdList.forEach(customerId -> { + //获取所有网格 + List gridDTOList = dimGridService.getGridListByCustomerId(customerId); }); } - } while (!CollectionUtils.isEmpty(customerIdList) || customerIdList.size() >= pageSize); return null; } - private String statsPublishArticle(String customerId, Date statsDate) { + private List statsPublishArticle(String customerId, Date statsDate) { + if (statsDate == null) { + statsDate = DateUtils.addDateDays(new Date(), -1); + } + //昨日的 dateId + String dateId = DateUtils.format(statsDate, DateUtils.DATE_PATTERN_YYYYMMDD); + //1.先查询昨天的 有没有数据 有则 昨日发布文章总数 = 昨日的发布文章数增量 + 统计表中已有的昨日的网格总数 ; // 否则 昨日发布文章总数 = 发布范围表中计算所有发布文章总数 + List articleCount = null; + List gridBeforeData = factArticlePublishedGridDailyService.getByBeforeDay(customerId, dateId); + boolean selectAll = false; + if (CollectionUtils.isEmpty(gridBeforeData)){ + selectAll = true; + } - List articleCount = articlePublishRangeService.selectByCreatedDate(customerId, statsDate == null ? DateUtils.addDateDays(new Date(), -1) : statsDate); + if (selectAll) { + articleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate); + } else { + Date startDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + Date endDate = DateUtils.integrate(DateUtils.addDateDays(startDate, 1), DateUtils.DATE_PATTERN); + articleCount = articlePublishRangeService.getOneDayPublishedCount(customerId, startDate, endDate); + //如果没有查到 + if (CollectionUtils.isEmpty(articleCount)){ - return null; + } + //累加昨日的数据 + + } + + return articleCount; } } 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 5bcf8f1e48..c6105c9570 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 @@ -20,12 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimGridDTO; -import com.epmet.entity.org.CustomerAgencyEntity; -import com.epmet.entity.org.CustomerGridEntity; import com.epmet.entity.stats.DimGridEntity; -import org.apache.ibatis.annotations.Param; -import java.util.Date; import java.util.List; import java.util.Map; @@ -100,4 +96,14 @@ public interface DimGridService extends BaseService { DimGridEntity getLastCreatedGridDim(); void addGridDims(List gridDims); + + /** + * desc: 根据客户Id获取 该客户下所有的网格数据 + * + * @param customerId + * @return: List + * @date: 2020/6/18 10:28 + * @author: jianjun liu + */ + List getGridListByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java new file mode 100644 index 0000000000..b674d6ae3e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactArticlePublishedAgencyDailyService extends BaseService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java new file mode 100644 index 0000000000..26f2c2089c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactArticlePublishedDepartmentDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java new file mode 100644 index 0000000000..3f52f8679e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedGridDailyService.java @@ -0,0 +1,44 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; + +import java.util.List; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactArticlePublishedGridDailyService extends BaseService { + + /** + * desc: 根据客户Id 获取统计日期的 数据 + * + * @param customerId + * @param dateId + * @return: List + * @date: 2020/6/18 9:53 + * @author: jianjun liu + */ + List getByBeforeDay(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/stats/impl/DimGridServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimGridServiceImpl.java index 1a0af837a4..410c92d282 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 @@ -20,13 +20,11 @@ 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.constant.FieldConstant; 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.DimGridDao; import com.epmet.dto.stats.DimGridDTO; -import com.epmet.entity.org.CustomerAgencyEntity; -import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.stats.DimGridService; import org.apache.commons.lang3.StringUtils; @@ -34,7 +32,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; -import java.util.Date; import java.util.List; import java.util.Map; @@ -111,4 +108,12 @@ public class DimGridServiceImpl extends BaseServiceImpl getGridListByCustomerId(String customerId) { + if (StringUtils.isBlank(customerId)){ + } + //baseDao.getGridListByCustomerId(customerId); + return null; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..074d917144 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactArticlePublishedAgencyDailyDao; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import org.springframework.stereotype.Service; + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedAgencyDailyService { + + + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java new file mode 100644 index 0000000000..47c9667c59 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.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.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.dao.stats.FactArticlePublishedDepartmentDailyDao; +import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; +import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; +import org.springframework.stereotype.Service; + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedDepartmentDailyService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java new file mode 100644 index 0000000000..3e8fe9bc65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactArticlePublishedGridDailyDao; +import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; +import com.epmet.service.stats.FactArticlePublishedGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedGridDailyService { + + + @Override + public List getByBeforeDay(String customerId, String dateId) { + log.debug("getByBeforeDay param customerId:{},dateId:{}",customerId,dateId); + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(dateId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getByBeforeDay(customerId,dateId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java index 0f6ac51535..040f126cd8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java @@ -32,15 +32,28 @@ import java.util.List; */ public interface ArticlePublishRangeService extends BaseService { - /** - * desc: 根据客户Id 、创建日期查询 发布范围数据 - * - * @param customerId - * @param createDate - * return: - * @date: 2020/6/17 16:59 - * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn - */ - List selectByCreatedDate(String customerId, Date createDate); + /** + * desc: 根据客户Id 、创建日期查询 有史以来所有的发布文章总数 + * + * @param customerId + * @param createDate + * @return: List + * @date: 2020/6/17 16:59 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List getAllPublishedCount(String customerId, Date createDate); + + /** + * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 + * + * @param customerId + * @param startDate + * @param endDate + * @return: List + * @date: 2020/6/17 21:43 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + List getOneDayPublishedCount(String customerId, Date startDate, Date endDate); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java index 47b2e194ec..372ee5de50 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.dao.voice.ArticlePublishRangeDao; import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticlePublishRangeEntity; import com.epmet.service.voice.ArticlePublishRangeService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import java.util.Date; @@ -35,13 +36,32 @@ import java.util.List; * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-17 */ +@Slf4j @Service @DataSource(DataSourceConstant.GOV_VOICE) public class ArticlePublishRangeServiceImpl extends BaseServiceImpl implements ArticlePublishRangeService { - @Override - public List selectByCreatedDate(String customerId, Date createDate) { - return baseDao.selectByCreatedDate(customerId,createDate); - } + @Override + public List getAllPublishedCount(String customerId, Date createDate) { + log.debug("getAllPublishedCount param customerId:{},createDate:{}", customerId, createDate); + return baseDao.getAllPublishedCount(customerId, createDate); + } + + /** + * desc: 根据客户Id、创建日期查询某一天的 文章发布数据 + * + * @param customerId + * @param startDate + * @param endDate + * @return: List + * @date: 2020/6/17 21:43 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + @Override + public List getOneDayPublishedCount(String customerId, Date startDate, Date endDate) { + log.debug("getOneDayPublishedCount param startDate:{},endDate:{}", startDate, endDate); + return baseDao.getOneDayPublishedCount(customerId, startDate, endDate); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml new file mode 100644 index 0000000000..301fb3fe9f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.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/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml new file mode 100644 index 0000000000..1dd50f6c6c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.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/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml new file mode 100644 index 0000000000..6c66ecec83 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedGridDailyDao.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml new file mode 100644 index 0000000000..a8ea896aa1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..5fd7739c25 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..8bdf8f1947 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml new file mode 100644 index 0000000000..55b6b6d481 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml new file mode 100644 index 0000000000..8b2352e685 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml new file mode 100644 index 0000000000..58cfb41a8d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml new file mode 100644 index 0000000000..669cc48e5e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml new file mode 100644 index 0000000000..223c11d725 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml new file mode 100644 index 0000000000..8a7e9a0508 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml new file mode 100644 index 0000000000..24e1248529 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml new file mode 100644 index 0000000000..5ce90cf523 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml new file mode 100644 index 0000000000..b9a1ab68ac --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml new file mode 100644 index 0000000000..e01c2c7f77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..ed0778ec54 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..84e1e796e5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml new file mode 100644 index 0000000000..0064d6b545 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml new file mode 100644 index 0000000000..5d419f1683 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml new file mode 100644 index 0000000000..ae0f963af5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml new file mode 100644 index 0000000000..9c456d703e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml new file mode 100644 index 0000000000..3e6f1bfff7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml index 19691045f1..db2c1131a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml @@ -21,7 +21,7 @@ - SELECT GRID_ID, count(ID) publishedCount, @@ -29,12 +29,28 @@ FROM article_publish_range WHERE - CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} and + DEL_FLAG = 0 AND + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND CREATED_TIME GROUP BY CUSTOMER_ID, GRID_ID + \ No newline at end of file From a975e2ee2c072c082542fc55e766b1ffbc278beb Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 18 Jun 2020 11:27:37 +0800 Subject: [PATCH 023/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/AgencySubTreeDto.java | 15 ++ .../FactParticipationUserAgencyDailyDTO.java | 147 +++++++++++++++++ ...FactParticipationUserAgencyMonthlyDTO.java | 147 +++++++++++++++++ .../FactParticipationUserGridDailyDTO.java | 152 ++++++++++++++++++ .../FactParticipationUserGridMonthlyDTO.java | 152 ++++++++++++++++++ .../stats/user/FactRegUserAgencyDailyDTO.java | 147 +++++++++++++++++ .../user/FactRegUserAgencyMonthlyDTO.java | 147 +++++++++++++++++ .../stats/user/FactRegUserGridDailyDTO.java | 152 ++++++++++++++++++ .../stats/user/FactRegUserGridMonthlyDTO.java | 152 ++++++++++++++++++ .../data-statistical-server/pom.xml | 9 +- .../com/epmet/controller/DimController.java | 31 ++++ .../com/epmet/dao/stats/DimAgencyDao.java | 29 ++++ .../FactParticipationUserAgencyDailyDao.java | 33 ++++ ...FactParticipationUserAgencyMonthlyDao.java | 33 ++++ .../FactParticipationUserGridDailyDao.java | 33 ++++ .../FactParticipationUserGridMonthlyDao.java | 33 ++++ .../stats/user/FactRegUserAgencyDailyDao.java | 33 ++++ .../user/FactRegUserAgencyMonthlyDao.java | 33 ++++ .../stats/user/FactRegUserGridDailyDao.java | 33 ++++ .../stats/user/FactRegUserGridMonthlyDao.java | 33 ++++ .../main/java/com/epmet/dao/user/UserDao.java | 14 ++ .../epmet/entity/stats/DimAgencyEntity.java | 2 +- .../epmet/entity/stats/DimCustomerEntity.java | 2 +- .../com/epmet/entity/stats/DimDateEntity.java | 2 +- .../entity/stats/DimDepartmentEntity.java | 2 +- .../com/epmet/entity/stats/DimGridEntity.java | 1 - .../entity/stats/DimTopicStatusEntity.java | 2 +- ...actParticipationUserAgencyDailyEntity.java | 117 ++++++++++++++ ...tParticipationUserAgencyMonthlyEntity.java | 117 ++++++++++++++ .../FactParticipationUserGridDailyEntity.java | 122 ++++++++++++++ ...actParticipationUserGridMonthlyEntity.java | 122 ++++++++++++++ .../user/FactRegUserAgencyDailyEntity.java | 117 ++++++++++++++ .../user/FactRegUserAgencyMonthlyEntity.java | 117 ++++++++++++++ .../user/FactRegUserGridDailyEntity.java | 122 ++++++++++++++ .../user/FactRegUserGridMonthlyEntity.java | 122 ++++++++++++++ .../com/epmet/service/StatsDimService.java | 1 + .../service/impl/StatsDimServiceImpl.java | 3 +- .../epmet/service/stats/DimAgencyService.java | 19 +++ .../stats/impl/DimAgencyServiceImpl.java | 27 ++++ ...ctParticipationUserAgencyDailyService.java | 96 +++++++++++ ...ParticipationUserAgencyMonthlyService.java | 96 +++++++++++ ...FactParticipationUserGridDailyService.java | 96 +++++++++++ ...ctParticipationUserGridMonthlyService.java | 96 +++++++++++ .../user/FactRegUserAgencyDailyService.java | 96 +++++++++++ .../user/FactRegUserAgencyMonthlyService.java | 96 +++++++++++ .../user/FactRegUserGridDailyService.java | 96 +++++++++++ .../user/FactRegUserGridMonthlyService.java | 96 +++++++++++ ...rticipationUserAgencyDailyServiceImpl.java | 101 ++++++++++++ ...icipationUserAgencyMonthlyServiceImpl.java | 102 ++++++++++++ ...ParticipationUserGridDailyServiceImpl.java | 102 ++++++++++++ ...rticipationUserGridMonthlyServiceImpl.java | 102 ++++++++++++ .../FactRegUserAgencyDailyServiceImpl.java | 102 ++++++++++++ .../FactRegUserAgencyMonthlyServiceImpl.java | 102 ++++++++++++ .../impl/FactRegUserGridDailyServiceImpl.java | 102 ++++++++++++ .../FactRegUserGridMonthlyServiceImpl.java | 102 ++++++++++++ .../com/epmet/service/user/UserService.java | 19 +++ .../service/user/impl/UserServiceImpl.java | 31 ++++ .../resources/mapper/stats/DimAgencyDao.xml | 82 ++++++++++ 58 files changed, 4278 insertions(+), 12 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java index f68be23990..d582cdfccc 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubTreeDto.java @@ -35,6 +35,21 @@ public class AgencySubTreeDto implements Serializable { String customerId; /** + * 父级机关Id,当为最顶层是pid为0 + * */ + String pid; + + /** + * 级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + * */ + String level; + + /** * 下级机关集合 * */ List subAgencies; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java new file mode 100644 index 0000000000..19d6f97b07 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyDailyDTO.java @@ -0,0 +1,147 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日(参与用户中)注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日(参与用户中)热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日(参与用户中)党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java new file mode 100644 index 0000000000..72f772c956 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserAgencyMonthlyDTO.java @@ -0,0 +1,147 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关下(按月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月(参与用户中)注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月(参与用户中)热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月(参与用户中)党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java new file mode 100644 index 0000000000..63d34f3139 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridDailyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java new file mode 100644 index 0000000000..15221181a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactParticipationUserGridMonthlyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格下(月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactParticipationUserGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java new file mode 100644 index 0000000000..b5c7ef980c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyDailyDTO.java @@ -0,0 +1,147 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日:居民总数=注册用户总数 + */ + private Integer resiTotal; + + /** + * 截止到本日:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日:注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日:热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日:党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java new file mode 100644 index 0000000000..a97d7b4b7b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserAgencyMonthlyDTO.java @@ -0,0 +1,147 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 机关(按月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底:注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底:居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月:注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月:热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月:党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java new file mode 100644 index 0000000000..cf2d64b687 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridDailyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java new file mode 100644 index 0000000000..51308b4d4c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/FactRegUserGridMonthlyDTO.java @@ -0,0 +1,152 @@ +/** + * 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.user; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格(月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactRegUserGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 删除标识 + */ + private String delFlag; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index dcd55b9ad9..c6605f5fef 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -129,11 +129,12 @@ epmet_gov_voice_user EpmEt-db-UsEr - + - - epmet_oper_crm_user - EpmEt-db-UsEr + + epmet_oper_crm_user + EpmEt-db-UsEr + 0 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 c393a74bb3..9f091f4ccb 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,15 +1,20 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.service.StatsDimService; +import com.epmet.service.stats.DimAgencyService; import com.epmet.service.stats.DimDateService; import com.epmet.service.stats.DimMonthService; import oracle.jdbc.proxy.annotation.Post; 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 java.util.List; + @RestController @RequestMapping("dim") public class DimController { @@ -23,6 +28,9 @@ public class DimController { @Autowired private StatsDimService statsDimService; + @Autowired + private DimAgencyService dimAgencyService; + /** * 初始化按日维度 * @return @@ -83,4 +91,27 @@ public class DimController { return new Result(); } + /** + * @Description 所有机构 + * @param + * @return + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("allagency") + public List allAgency(){ + return dimAgencyService.getAllAgency(); + } + + /** + * @Description 顶级机构 + * @param + * @return + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("topagency") + public List topAgency(){ + return dimAgencyService.getTopAgency(); + } } 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 9ead9c7114..3839fd7ecb 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 @@ -19,9 +19,11 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.stats.DimAgencyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -41,4 +43,31 @@ public interface DimAgencyDao extends BaseDao { * @Description 根据客户Id查询机关维度列表数据 **/ List selectDimAgencyList(DimAgencyDTO dto); + + /** + * @Description 获取所有机关 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectAllAgency(); + + /** + * @Description 根据PID获取下级机关 + * @param pid + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectSubAgencyByPid(@Param("pid")String pid); + + /** + * @Description 获取顶层级机关机关 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectTopAgency(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java new file mode 100644 index 0000000000..463dbca50d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactParticipationUserAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java new file mode 100644 index 0000000000..d303685b38 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关下(按月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactParticipationUserAgencyMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java new file mode 100644 index 0000000000..18593b3807 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactParticipationUserGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java new file mode 100644 index 0000000000..81fd930f20 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格下(月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactParticipationUserGridMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java new file mode 100644 index 0000000000..d4fb9b5fe5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactRegUserAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java new file mode 100644 index 0000000000..4ed08b1f00 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 机关(按月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactRegUserAgencyMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java new file mode 100644 index 0000000000..944732d786 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactRegUserGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java new file mode 100644 index 0000000000..df808eb3be --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.user; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格(月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactRegUserGridMonthlyDao extends BaseDao { + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..88cf420e8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -0,0 +1,14 @@ +package com.epmet.dao.user; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 用户Dao EpmetUser + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Mapper +public interface UserDao { + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java index 4972eedb3b..2ca7c2a168 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java @@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; + /** * 机关维度 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java index ccc124af53..a287006414 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimCustomerEntity.java @@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; + /** * 客户维度 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java index 8048c15070..c6281eecca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDateEntity.java @@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; + /** * 日期维度表 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java index 66c325c678..da22ff4fe7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimDepartmentEntity.java @@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; + /** * 客户部门维度 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java index 4a9f423ab0..8c49f7f9d9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimGridEntity.java @@ -23,7 +23,6 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; /** * 客户网格维度 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java index b3854b61c3..4bce308c22 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimTopicStatusEntity.java @@ -23,7 +23,7 @@ import com.epmet.commons.mybatis.entity.BaseEpmetEntity; import lombok.Data; import lombok.EqualsAndHashCode; -import java.util.Date; + /** * 话题状态维度表 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java new file mode 100644 index 0000000000..512ff89b3e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyDailyEntity.java @@ -0,0 +1,117 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_agency_daily") +public class FactParticipationUserAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日(参与用户中)注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日(参与用户中)热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日(参与用户中)党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java new file mode 100644 index 0000000000..7e261e70e0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserAgencyMonthlyEntity.java @@ -0,0 +1,117 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下(按月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_agency_monthly") +public class FactParticipationUserAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底(参与用户中)党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月(参与用户中)注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月(参与用户中)热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月(参与用户中)党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java new file mode 100644 index 0000000000..18f6b295f6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridDailyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_grid_daily") +public class FactParticipationUserGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java new file mode 100644 index 0000000000..8fc4d93d16 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactParticipationUserGridMonthlyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格下(月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_participation_user_grid_monthly") +public class FactParticipationUserGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java new file mode 100644 index 0000000000..aeffaeb3c5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyDailyEntity.java @@ -0,0 +1,117 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_agency_daily") +public class FactRegUserAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日:居民总数=注册用户总数 + */ + private Integer resiTotal; + + /** + * 截止到本日:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日:注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日:热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日:党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java new file mode 100644 index 0000000000..daa07e392d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserAgencyMonthlyEntity.java @@ -0,0 +1,117 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关(按月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_agency_monthly") +public class FactRegUserAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底:注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底:居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底:热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底:党员总数 + */ + private Integer partymemberTotal; + + /** + * 本月:注册居民月增量 + */ + private Integer regIncr; + + /** + * 本月:热心居民月增量 + */ + private Integer warmIncr; + + /** + * 本月:党员认证月增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java new file mode 100644 index 0000000000..17e41d1a65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridDailyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_grid_daily") +public class FactRegUserGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String dateId; + + /** + * + */ + private String weekId; + + /** + * + */ + private String yearId; + + /** + * 截止到本日注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日党员总数 + */ + private Integer partymemberTotal; + + /** + * 本日注册居民日增量 + */ + private Integer regIncr; + + /** + * 本日热心居民日增量 + */ + private Integer warmIncr; + + /** + * 本日党员认证日增量 + */ + private Integer partymemberIncr; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java new file mode 100644 index 0000000000..9030105ef1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/user/FactRegUserGridMonthlyEntity.java @@ -0,0 +1,122 @@ +/** + * 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.user; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格(月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_reg_user_grid_monthly") +public class FactRegUserGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 网格id + */ + private String gridId; + + /** + * 客户id + */ + private String customerId; + + /** + * 机关id + */ + private String agencyId; + + /** + * + */ + private String monthId; + + /** + * + */ + private String quarterId; + + /** + * + */ + private String yearId; + + /** + * 截止到本月底的注册用户总数 + */ + private Integer regTotal; + + /** + * 截止到本月底的居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本月底的热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本月底的党员总数 + */ + private Integer partymemberTotal; + + /** + * 注册居民本月增量 + */ + private Integer regIncr; + + /** + * 热心居民本月增量 + */ + private Integer warmIncr; + + /** + * 党员认证本月增量 + */ + private Integer partymemberIncr; + + /** + * 热心居民占比 + */ + private BigDecimal warmHeartedProportion; + + /** + * 居民总数占比 + */ + private BigDecimal resiProportion; + + /** + * 党员总数占比 + */ + private BigDecimal partymemberProportion; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java index b566f3d160..1e2f05991b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDimService.java @@ -1,5 +1,6 @@ package com.epmet.service; + public interface StatsDimService { void initGridDim(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index c4666ba77b..7d79ead2cf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -2,8 +2,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.StatsSubject; -import com.epmet.dao.org.CustomerDepartmentDao; -import com.epmet.dao.stats.LastExecRecordDao; import com.epmet.entity.crm.CustomerEntity; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.org.CustomerDepartmentEntity; @@ -169,4 +167,5 @@ public class StatsDimServiceImpl implements StatsDimService { lastExecRecordService.updateById(lastExecRecord); } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index d5e978046f..9bb3b433d3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -19,6 +19,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; @@ -103,4 +104,22 @@ public interface DimAgencyService extends BaseService { List getDimAgencyList(DimAgencyDTO dto); void addAgencyDims(List agencies); + + /** + * @Description 查询所有机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getAllAgency(); + + /** + * @Description 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getTopAgency(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 9824d21721..715ac2c234 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -24,6 +24,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.dao.stats.DimAgencyDao; +import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; @@ -37,6 +38,7 @@ import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 机关维度 @@ -132,4 +134,29 @@ public class DimAgencyServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getAllAgency() { + return baseDao.selectAllAgency(); + } + + + /** + * @Description 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getTopAgency() { + return baseDao.selectTopAgency(); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java new file mode 100644 index 0000000000..f489c17788 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyDailyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserAgencyDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java new file mode 100644 index 0000000000..913b9140f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserAgencyMonthlyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关下(按月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserAgencyMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java new file mode 100644 index 0000000000..5b4ef692c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridDailyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格下(按日)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserGridDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java new file mode 100644 index 0000000000..729f51a276 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactParticipationUserGridMonthlyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactParticipationUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格下(月)参与用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactParticipationUserGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactParticipationUserGridMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactParticipationUserGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactParticipationUserGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactParticipationUserGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java new file mode 100644 index 0000000000..4b83259245 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyDailyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserAgencyDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java new file mode 100644 index 0000000000..6f5f7c4963 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserAgencyMonthlyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 机关(按月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserAgencyMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java new file mode 100644 index 0000000000..b3ed088fb3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridDailyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; +import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格(按日)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserGridDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java new file mode 100644 index 0000000000..11c7dd2e12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/FactRegUserGridMonthlyService.java @@ -0,0 +1,96 @@ +/** + * 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.user; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 网格(月)注册用户数分析 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactRegUserGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactRegUserGridMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactRegUserGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactRegUserGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactRegUserGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..f606044f1f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyDailyServiceImpl.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.service.stats.user.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.user.FactParticipationUserAgencyDailyDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; +import com.epmet.service.stats.user.FactParticipationUserAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +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-06-17 + */ +@Service +public class FactParticipationUserAgencyDailyServiceImpl extends BaseServiceImpl implements FactParticipationUserAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserAgencyDailyDTO.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 FactParticipationUserAgencyDailyDTO get(String id) { + FactParticipationUserAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserAgencyDailyDTO dto) { + FactParticipationUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserAgencyDailyDTO dto) { + FactParticipationUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..f9b7ac4b0c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserAgencyMonthlyServiceImpl.java @@ -0,0 +1,102 @@ +/** + * 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.user.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.user.FactParticipationUserAgencyMonthlyDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity; +import com.epmet.service.stats.user.FactParticipationUserAgencyMonthlyService; +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-06-17 + */ +@Service +public class FactParticipationUserAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactParticipationUserAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserAgencyMonthlyDTO.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 FactParticipationUserAgencyMonthlyDTO get(String id) { + FactParticipationUserAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserAgencyMonthlyDTO dto) { + FactParticipationUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserAgencyMonthlyDTO dto) { + FactParticipationUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserAgencyMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java new file mode 100644 index 0000000000..8d6915f6fa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridDailyServiceImpl.java @@ -0,0 +1,102 @@ +/** + * 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.user.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.user.FactParticipationUserGridDailyDao; +import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; +import com.epmet.service.stats.user.FactParticipationUserGridDailyService; +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-06-17 + */ +@Service +public class FactParticipationUserGridDailyServiceImpl extends BaseServiceImpl implements FactParticipationUserGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserGridDailyDTO.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 FactParticipationUserGridDailyDTO get(String id) { + FactParticipationUserGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserGridDailyDTO dto) { + FactParticipationUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserGridDailyDTO dto) { + FactParticipationUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..e6068acf90 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactParticipationUserGridMonthlyServiceImpl.java @@ -0,0 +1,102 @@ +/** + * 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.user.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.user.FactParticipationUserGridMonthlyDao; +import com.epmet.dto.stats.user.FactParticipationUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity; +import com.epmet.service.stats.user.FactParticipationUserGridMonthlyService; +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-06-17 + */ +@Service +public class FactParticipationUserGridMonthlyServiceImpl extends BaseServiceImpl implements FactParticipationUserGridMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactParticipationUserGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactParticipationUserGridMonthlyDTO.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 FactParticipationUserGridMonthlyDTO get(String id) { + FactParticipationUserGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactParticipationUserGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactParticipationUserGridMonthlyDTO dto) { + FactParticipationUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactParticipationUserGridMonthlyDTO dto) { + FactParticipationUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactParticipationUserGridMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..c97a763f61 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyDailyServiceImpl.java @@ -0,0 +1,102 @@ +/** + * 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.user.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.user.FactRegUserAgencyDailyDao; +import com.epmet.dto.stats.user.FactRegUserAgencyDailyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity; +import com.epmet.service.stats.user.FactRegUserAgencyDailyService; +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-06-17 + */ +@Service +public class FactRegUserAgencyDailyServiceImpl extends BaseServiceImpl implements FactRegUserAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserAgencyDailyDTO.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 FactRegUserAgencyDailyDTO get(String id) { + FactRegUserAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserAgencyDailyDTO dto) { + FactRegUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserAgencyDailyDTO dto) { + FactRegUserAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..55925a2b81 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserAgencyMonthlyServiceImpl.java @@ -0,0 +1,102 @@ +/** + * 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.user.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.user.FactRegUserAgencyMonthlyDao; +import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; +import com.epmet.service.stats.user.FactRegUserAgencyMonthlyService; +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-06-17 + */ +@Service +public class FactRegUserAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactRegUserAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserAgencyMonthlyDTO.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 FactRegUserAgencyMonthlyDTO get(String id) { + FactRegUserAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserAgencyMonthlyDTO dto) { + FactRegUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserAgencyMonthlyDTO dto) { + FactRegUserAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserAgencyMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.java new file mode 100644 index 0000000000..8aba7fbcd5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridDailyServiceImpl.java @@ -0,0 +1,102 @@ +/** + * 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.user.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.user.FactRegUserGridDailyDao; +import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; +import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; +import com.epmet.service.stats.user.FactRegUserGridDailyService; +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-06-17 + */ +@Service +public class FactRegUserGridDailyServiceImpl extends BaseServiceImpl implements FactRegUserGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserGridDailyDTO.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 FactRegUserGridDailyDTO get(String id) { + FactRegUserGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserGridDailyDTO dto) { + FactRegUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserGridDailyDTO dto) { + FactRegUserGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..2054ea5909 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/FactRegUserGridMonthlyServiceImpl.java @@ -0,0 +1,102 @@ +/** + * 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.user.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.user.FactRegUserGridMonthlyDao; +import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; +import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; +import com.epmet.service.stats.user.FactRegUserGridMonthlyService; +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-06-17 + */ +@Service +public class FactRegUserGridMonthlyServiceImpl extends BaseServiceImpl implements FactRegUserGridMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactRegUserGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactRegUserGridMonthlyDTO.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 FactRegUserGridMonthlyDTO get(String id) { + FactRegUserGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactRegUserGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactRegUserGridMonthlyDTO dto) { + FactRegUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactRegUserGridMonthlyDTO dto) { + FactRegUserGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactRegUserGridMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file 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 new file mode 100644 index 0000000000..71e2911e5b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -0,0 +1,19 @@ +package com.epmet.service.user; + +import com.epmet.dto.AgencySubTreeDto; + +import java.util.List; +import java.util.Map; + +public interface UserService { + + /** + * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 + * @param regOrPartiFlag - String + * @parma agencies - Map> + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + void traverseAgencyUser(String regOrPartiFlag,Map>agencies); +} 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 new file mode 100644 index 0000000000..6737398a52 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -0,0 +1,31 @@ +package com.epmet.service.user.impl; + +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.service.user.UserService; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +/** + * @Description 直连epmet-user + * @ClassName UserServiceImpl + * @Auth wangc + * @Date 2020-06-18 09:55 + */ +@Service +public class UserServiceImpl implements UserService { + + /** + * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 + * @param regOrPartiFlag - String + * @parma agencies - Map> + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + @Override + public void traverseAgencyUser(String regOrPartiFlag, Map> agencies) { + + } +} 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 5ca1ddca1c..e39b5afb4b 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 @@ -16,4 +16,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 209471a0d1d0de6facfb34c788a829c7edd46f4d Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 12:03:08 +0800 Subject: [PATCH 024/101] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id=E8=8E=B7=E5=8F=96=E7=BD=91=E6=A0=BC?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dao/stats/DimGridDao.java | 15 +++++++++------ .../service/stats/impl/DimGridServiceImpl.java | 6 ++++-- .../main/resources/mapper/stats/DimGridDao.xml | 11 +++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) 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 4793b49558..0582f19669 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 @@ -18,13 +18,10 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.org.CustomerGridEntity; import com.epmet.dto.group.result.CustomerGridInfoResultDTO; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; - -import java.util.Date; -import java.util.List; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -37,9 +34,15 @@ import java.util.List; @Mapper public interface DimGridDao extends BaseDao { - DimGridEntity getLastCreatedGridDimEntity(); + DimGridEntity getLastCreatedGridDimEntity(); - List selectCustomerGrid(); + List selectCustomerGrid(); + /** + * desc:根据客户Id获取 该客户下的网格数据 + * @param customerId + * @return + */ + List getGridListByCustomerId(@Param("customerId") String customerId); } \ 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 410c92d282..0a12646bb2 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 @@ -21,6 +21,8 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.stats.DimGridDao; @@ -112,8 +114,8 @@ public class DimGridServiceImpl extends BaseServiceImpl getGridListByCustomerId(String customerId) { if (StringUtils.isBlank(customerId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - //baseDao.getGridListByCustomerId(customerId); - return null; + return baseDao.getGridListByCustomerId(customerId); } } \ 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 d71a9799a7..03e73a3289 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 @@ -23,5 +23,16 @@ dc.del_flag = 0 AND dg.del_flag = 0 + \ No newline at end of file From 65629d13cae375ed740aee27742694e6576ea087 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 13:30:24 +0800 Subject: [PATCH 025/101] =?UTF-8?q?=E5=88=86=E9=A1=B5=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=AE=A2=E6=88=B7id=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/stats/DimCustomerDao.java | 8 ++-- .../epmet/service/StatsPublicityService.java | 4 +- .../impl/StatsPublicityServiceImpl.java | 42 +++++-------------- .../stats/impl/DimCustomerServiceImpl.java | 3 +- .../resources/mapper/stats/DimCustomerDao.xml | 2 +- 5 files changed, 19 insertions(+), 40 deletions(-) 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 66ea22ad59..f8b317848c 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 @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.DimCustomerEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -35,12 +36,11 @@ public interface DimCustomerDao extends BaseDao { /** * desc: 分页获取客户id * - * @param pageNo - * @param offset - * return: List + * @param pageSize + * @param offset return: List * @date: 2020/6/17 16:33 * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - List selectCustomerIdPage(Integer pageNo, int offset); + List selectCustomerIdPage(@Param("offset") Integer offset, @Param("pageSize") Integer pageSize); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 1a31ac74ad..6574563a45 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -1,6 +1,8 @@ package com.epmet.service; +import java.util.Date; + public interface StatsPublicityService { /** * desc: 统计宣传能力的汇总信息 @@ -10,6 +12,6 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean publicitySummary(); + Boolean publicitySummary(Date statsDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 5c27913655..b86c1ee772 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.stats.DimGridEntity; -import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; @@ -47,52 +46,31 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @Override - public Boolean publicitySummary() { + public Boolean publicitySummary(Date statsDate) { + if (statsDate == null) { + statsDate = DateUtils.addDateDays(new Date(), -1); + } int pageNo = 1; int pageSize = 100; List customerIdList = null; do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { - customerIdList.forEach(customerId -> { - //获取所有网格 + for (String customerId : customerIdList) {//获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); + if (!CollectionUtils.isEmpty(gridDTOList)) { + List publishedArticleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate); + } - }); + } } } while (!CollectionUtils.isEmpty(customerIdList) || customerIdList.size() >= pageSize); return null; } private List statsPublishArticle(String customerId, Date statsDate) { - if (statsDate == null) { - statsDate = DateUtils.addDateDays(new Date(), -1); - } - //昨日的 dateId - String dateId = DateUtils.format(statsDate, DateUtils.DATE_PATTERN_YYYYMMDD); + List articleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate); - //1.先查询昨天的 有没有数据 有则 昨日发布文章总数 = 昨日的发布文章数增量 + 统计表中已有的昨日的网格总数 ; - // 否则 昨日发布文章总数 = 发布范围表中计算所有发布文章总数 - List articleCount = null; - List gridBeforeData = factArticlePublishedGridDailyService.getByBeforeDay(customerId, dateId); - boolean selectAll = false; - if (CollectionUtils.isEmpty(gridBeforeData)){ - selectAll = true; - } - - if (selectAll) { - articleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate); - } else { - Date startDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); - Date endDate = DateUtils.integrate(DateUtils.addDateDays(startDate, 1), DateUtils.DATE_PATTERN); - articleCount = articlePublishRangeService.getOneDayPublishedCount(customerId, startDate, endDate); - //如果没有查到 - if (CollectionUtils.isEmpty(articleCount)){ - - } - //累加昨日的数据 - - } return articleCount; } 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 87ab6d789d..3ea9113a5d 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 @@ -28,7 +28,6 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.dao.stats.DimCustomerDao; import com.epmet.dto.stats.DimCustomerDTO; import com.epmet.entity.crm.CustomerEntity; -import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.stats.DimCustomerEntity; import com.epmet.service.stats.DimCustomerService; import lombok.extern.slf4j.Slf4j; @@ -109,7 +108,7 @@ public class DimCustomerServiceImpl extends BaseServiceImpl - select ID FROM dim_customer WHERE DEL_FLAG = '0' + select ID FROM dim_customer WHERE DEL_FLAG = '0' limit #{offset,jdbcType=INTEGER},#{pageSize,jdbcType=INTEGER} \ No newline at end of file From 71bb0961c38895fb54dd424cc16f0c50ba3302ba Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 Jun 2020 13:53:14 +0800 Subject: [PATCH 026/101] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E7=BB=B4=E5=BA=A6I?= =?UTF-8?q?D=E7=94=9F=E6=88=90=E5=B7=A5=E5=85=B7=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/util/DimIdGenerator.java | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java new file mode 100644 index 0000000000..49ef3170ba --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java @@ -0,0 +1,77 @@ +package com.epmet.util; + +import com.epmet.commons.tools.utils.DateUtils; +import lombok.Data; + +import java.util.Date; + +public class DimIdGenerator { + + /** + * 生成日期维度ID + * @param targetDate + * @return + */ + public static String getDateDimId(Date targetDate) { + return DateUtils.format(targetDate, DateUtils.DATE_PATTERN_YYYYMMDD); + } + + /** + * 获取月维度ID + * @param date + * @return + */ + public static String getMonthDimId(Date date) { + return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMM); + } + + /** + * 获取季度维度ID + * @param date + * @return + */ + public static String getQuarterDimId(Date date) { + String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); + return yyyy.concat("Q").concat(DateUtils.getQuarterIndex(date) + ""); + } + + /** + * 获取年维度ID + * @param date + * @return + */ + public static String getYearDimId(Date date) { + return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); + } + + /** + * 获取封装了所有ID的对象 + * @return + */ + public static DimIdBean getDimIdBean(Date date) { + DimIdBean dimIdBean = new DimIdBean(); + dimIdBean.setDateId(getDateDimId(date)); + dimIdBean.setMonthId(getMonthDimId(date)); + dimIdBean.setQuarterId(getQuarterDimId(date)); + dimIdBean.setYearId(getYearDimId(date)); + //dimIdBean.setWeekId(); + return dimIdBean; + } + + public static void main(String[] args) { + DimIdBean dimIdBean = getDimIdBean(new Date()); + System.out.println(dimIdBean); + } + + @Data + public static class DimIdBean { + private String dateId; + private String monthId; + private String quarterId; + private String yearId; + private String weekId; + + public DimIdBean() { + } + } +} From 0247505e40d1596880adf643a7ae22fbfd7de53f Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 14:26:45 +0800 Subject: [PATCH 027/101] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E5=91=A8Id=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/util/DimIdGenerator.java | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java index 49ef3170ba..9a2d5ce6e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java @@ -3,6 +3,7 @@ package com.epmet.util; import com.epmet.commons.tools.utils.DateUtils; import lombok.Data; +import java.util.Calendar; import java.util.Date; public class DimIdGenerator { @@ -25,6 +26,19 @@ public class DimIdGenerator { return DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMM); } + /** + * 获取周维度ID ,每周的星期一为 周的开始 + * @param date + * @return + */ + public static String getWeekDimId(Date date) { + String yyyy = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYY); + Calendar calendar = Calendar.getInstance(); + calendar.setFirstDayOfWeek(Calendar.MONDAY); + calendar.setTime(date); + return yyyy.concat("W").concat(calendar.get(Calendar.WEEK_OF_YEAR)+""); + } + /** * 获取季度维度ID * @param date @@ -52,15 +66,16 @@ public class DimIdGenerator { DimIdBean dimIdBean = new DimIdBean(); dimIdBean.setDateId(getDateDimId(date)); dimIdBean.setMonthId(getMonthDimId(date)); + dimIdBean.setWeekId(getWeekDimId(date)); dimIdBean.setQuarterId(getQuarterDimId(date)); dimIdBean.setYearId(getYearDimId(date)); - //dimIdBean.setWeekId(); return dimIdBean; } public static void main(String[] args) { - DimIdBean dimIdBean = getDimIdBean(new Date()); + DimIdBean dimIdBean = getDimIdBean(DateUtils.stringToDate("2020-06-14",DateUtils.DATE_PATTERN)); System.out.println(dimIdBean); + } @Data From e44bc020462803dce825dcbea91f81d6f22464ae Mon Sep 17 00:00:00 2001 From: wangchao Date: Thu, 18 Jun 2020 14:37:01 +0800 Subject: [PATCH 028/101] =?UTF-8?q?=E6=9C=BA=E5=85=B3=E7=BB=B4=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/mapper/stats/DimAgencyDao.xml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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 e39b5afb4b..c3f57496ca 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 @@ -38,14 +38,14 @@ SELECT agency.id AS agencyId, - agency.ORGANIZATION_NAME AS agencyName,-- agency.PID,agency.PIDS , + agency.AGENCY_NAME AS agencyName,-- agency.PID,agency.PIDS , grid.ID AS gridId, -- ,GRID_NAME agency.CUSTOMER_ID, agency.PID, agency.LEVEL FROM dim_agency agency - LEFT JOIN dim_grid grid ON agency.ID = grid.PID + LEFT JOIN dim_grid grid ON agency.ID = grid.AGENCY_ID AND grid.DEL_FLAG = '0' WHERE agency.DEL_FLAG = '0' @@ -80,14 +80,14 @@ + + DELETE FROM fact_article_published_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml index db2c1131a0..6330c003b8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml @@ -24,8 +24,8 @@ SELECT 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 069287b182..120be8603a 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 @@ -2,6 +2,10 @@ + + INSERT INTO dim_customer(id, customer_name, del_flag, revision, created_by, created_time, updated_by, updated_time) + VALUES (#{id}, #{customerName}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + - SELECT - * - FROM - `dim_date` - WHERE - del_flag = '0' - - AND DATE_FORMAT(created_time, "%Y-%m-%d") = DATE_FORMAT(#{createdTime}, "%Y-%m-%d") - - ORDER BY created_time DESC - - + SELECT + * + FROM + fact_agency_project_daily + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND agency_id = #{agencyId} + AND ( + DATE_FORMAT(created_time, "%Y-%m-%d") + BETWEEN DATE_FORMAT(#{startTime}, "%Y-%m-%d") + AND DATE_FORMAT(#{endTime}, "%Y-%m-%d") + ) + ORDER BY created_time DESC,project_total DESC + + + DELETE + FROM + fact_agency_project_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/FactAgencyProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml index 15e59960ea..846b2c7a26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectMonthlyDao.xml @@ -3,6 +3,13 @@ - + + DELETE + FROM + fact_agency_project_monthly + WHERE + customer_id = #{customerId} + AND month_id = #{monthId} + \ No newline at end of file From c5d0299961f38e55d7ef4a39328480131337f27c Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 18 Jun 2020 16:48:54 +0800 Subject: [PATCH 034/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E6=9C=BA=E5=85=B3=E6=97=A5=E3=80=81=E6=9C=88=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?-=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatsProjectServiceImpl.java | 41 ++++++++++++++++--- .../resources/mapper/project/ProjectDao.xml | 1 + .../mapper/project/ProjectProcessDao.xml | 1 + 3 files changed, 38 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index 433a951a0c..9518447709 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -93,10 +93,10 @@ public class StatsProjectServiceImpl implements StatsProjectService { //1:查询各维度表Id,方便使用 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay()); - //2:根据客户Id查询项目业务表数据 + //2:根据客户Id查询项目业务表数据(查询当前日期之前的数据不包含当天的) List projectList = projectService.getProjectList(customerId); - //3:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) + //3:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的) List processList = projectProcessService.getProcessList(customerId); //4:遍历统计每个机关各项指标数 @@ -298,14 +298,45 @@ public class StatsProjectServiceImpl implements StatsProjectService { **/ @Override public void statsGridProject(String customerId) { + //1:根据客户Id查询网格维度表数据 + + if (true) { + //2:执行机关日数据统计 + gridDateProjectStats(customerId); + + //3:执行机关月数据统计 + if (Calendar.getInstance().get(Calendar.DATE) == 1) { + gridMonthProjectStats(customerId); + } + } + } + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-网格日统计 + **/ + private String gridDateProjectStats(String customerId){ //1:查询各维度表Id,方便使用 //2:根据客户Id查询网格维度表数据 - //3:根据客户Id查询项目业务表数据 - //4:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值) - //5:根据客户Id查询议题表已转项目的议题数据(为了匹配项目所属的网格Id) + //3:根据客户Id查询项目业务表数据(查询当前日期之前的数据不包含当天的) + //4:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的) + //5:根据客户Id查询议题表已转项目的网格项目关系数据 //6:遍历统计每个网格各项指标数据 //7:批量保存网格日统计数据 //8:判断当前日期是否为当月首日,执行网格月数据统计 + + return null; + } + /** + * @param customerId + * @return + * @Author sun + * @Description 数据-项目-网格月统计 + **/ + private String gridMonthProjectStats(String customerId){ + + return null; } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index b64db5c5f7..ed2e125d99 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -13,6 +13,7 @@ AND customer_id = #{customerId} + ORDER BY created_time DESC diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 01daae5a72..30f433efb4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -16,6 +16,7 @@ pro.del_flag = '0' AND p.del_flag = '0' AND p.customer_id = #{customerId} + ORDER BY pro.project_id From d1c1cf825906ccad8652776f18d99dc7723df0ac Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Thu, 18 Jun 2020 17:35:16 +0800 Subject: [PATCH 035/101] =?UTF-8?q?=E6=9C=BA=E5=85=B3=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E6=97=A5=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/IssueConstant.java | 29 ++ .../com/epmet/dto/issue/IssueAgencyDTO.java | 35 ++ .../epmet/dto/project/ProjectAgencyDTO.java | 31 ++ .../dto/stats/FactIssueAgencyDailyDTO.java | 237 ++++++++++ .../dto/stats/FactIssueAgencyMonthlyDTO.java | 227 ++++++++++ .../dto/stats/FactIssueGridDailyDTO.java | 237 ++++++++++ .../dto/stats/FactIssueGridMonthlyDTO.java | 227 ++++++++++ .../com/epmet/dao/issue/StatsIssueDao.java | 43 +- .../com/epmet/dao/project/ProjectDao.java | 21 + .../dao/stats/FactIssueAgencyDailyDao.java | 33 ++ .../dao/stats/FactIssueAgencyMonthlyDao.java | 33 ++ .../dao/stats/FactIssueGridDailyDao.java | 33 ++ .../dao/stats/FactIssueGridMonthlyDao.java | 33 ++ .../stats/FactIssueAgencyDailyEntity.java | 207 +++++++++ .../stats/FactIssueAgencyMonthlyEntity.java | 197 ++++++++ .../stats/FactIssueGridDailyEntity.java | 207 +++++++++ .../stats/FactIssueGridMonthlyEntity.java | 197 ++++++++ .../com/epmet/service/Issue/IssueService.java | 51 +++ .../service/Issue/impl/IssueServiceImpl.java | 61 +++ .../com/epmet/service/StatsIssueService.java | 20 + .../service/impl/StatsIssueServiceImpl.java | 422 ++++++++++++++++++ .../epmet/service/project/ProjectService.java | 21 + .../project/impl/ProjectServiceImpl.java | 11 + .../stats/FactIssueAgencyDailyService.java | 95 ++++ .../stats/FactIssueAgencyMonthlyService.java | 95 ++++ .../stats/FactIssueGridDailyService.java | 95 ++++ .../stats/FactIssueGridMonthlyService.java | 95 ++++ .../impl/FactIssueAgencyDailyServiceImpl.java | 100 +++++ .../FactIssueAgencyMonthlyServiceImpl.java | 101 +++++ .../impl/FactIssueGridDailyServiceImpl.java | 100 +++++ .../impl/FactIssueGridMonthlyServiceImpl.java | 100 +++++ .../resources/mapper/issue/StatsIssueDao.xml | 67 ++- .../resources/mapper/project/ProjectDao.xml | 33 ++ .../mapper/stats/FactIssueAgencyDailyDao.xml | 50 +++ .../stats/FactIssueAgencyMonthlyDao.xml | 48 ++ .../mapper/stats/FactIssueGridDailyDao.xml | 50 +++ .../mapper/stats/FactIssueGridMonthlyDao.xml | 48 ++ 37 files changed, 3687 insertions(+), 3 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java new file mode 100644 index 0000000000..338b35e1a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java @@ -0,0 +1,29 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 17:23 + */ +public interface IssueConstant { + /** + *表决中 + */ + String VOTING = "voting"; + /** + *已转项目 + */ + String SHIFT_PROJECT = "shift_project"; + /** + *已关闭 + */ + String CLOSED = "closed"; + /** + *已解决 + */ + String RESLOVED = "resloved"; + /** + *未解决 + */ + String UNRESLOVED = "unresloved"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java new file mode 100644 index 0000000000..065f10279f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 14:06 + */ +@Data +public class IssueAgencyDTO implements Serializable { + private static final long serialVersionUID = 8258586413692513595L; + /** + * 组织ID + */ + private String agencyId; + /** + * 上级ID + */ + private String pId; + /** + * 所有上级ID + */ + private String pIds; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java new file mode 100644 index 0000000000..add4fd14ff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/18 16:48 + */ +@Data +public class ProjectAgencyDTO implements Serializable { + private static final long serialVersionUID = 4581232825130630169L; + /** + * 组织ID + */ + private String agencyId; + /** + * 所有上级ID + */ + private String pIds; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java new file mode 100644 index 0000000000..b32a9d9b87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java @@ -0,0 +1,237 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + 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/FactIssueAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java new file mode 100644 index 0000000000..ea2b5cd11f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java @@ -0,0 +1,227 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + 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/FactIssueGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java new file mode 100644 index 0000000000..c63ab13574 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java @@ -0,0 +1,237 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + 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/FactIssueGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java new file mode 100644 index 0000000000..d79586998b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java @@ -0,0 +1,227 @@ +/** + * 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; + +import java.math.BigDecimal; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + 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/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index 6b44fc5c5e..1b64aa85e8 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,14 +1,55 @@ package com.epmet.dao.issue; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.issue.IssueAgencyDTO; 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 StatsIssueDao extends BaseDao { - List listAllEntities(); + + /** + * 获取当前日期组织下议题统计结果 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/17 14:13 + */ + List selectAgencyIssueTotal(@Param("customerId") String customerId); + + /** + * 获取当前日期组织下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:55 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 5ffba5ec49..472e3d50f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -39,4 +40,24 @@ public interface ProjectDao extends BaseDao { * @Description 根据客户Id查询客户项目业务表有效数据 **/ List selectProjectList(@Param("customerId") String customerId); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedProjectTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java new file mode 100644 index 0000000000..be302f14a7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactIssueAgencyDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java new file mode 100644 index 0000000000..0621b2526e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactIssueAgencyMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java new file mode 100644 index 0000000000..7249383370 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactIssueGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactIssueGridDailyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java new file mode 100644 index 0000000000..6c11e47904 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface FactIssueGridMonthlyDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java new file mode 100644 index 0000000000..377757ab2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyDailyEntity.java @@ -0,0 +1,207 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_agency_daily") +public class FactIssueAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java new file mode 100644 index 0000000000..a06e51b59d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java @@ -0,0 +1,197 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_agency_monthly") +public class FactIssueAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java new file mode 100644 index 0000000000..50d7d2ddaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java @@ -0,0 +1,207 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_grid_daily") +public class FactIssueGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java new file mode 100644 index 0000000000..713d48f3f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java @@ -0,0 +1,197 @@ +/** + * 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.math.BigDecimal; +import java.util.Date; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_grid_monthly") +public class FactIssueGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} 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 new file mode 100644 index 0000000000..c5503ddefa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -0,0 +1,51 @@ +package com.epmet.service.Issue; + +import com.epmet.dto.issue.IssueAgencyDTO; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:01 + */ +public interface IssueService { + /** + * 获取以组织为单位议题统计结果 + * @author zhaoqifeng + * @date 2020/6/17 16:04 + * @param customerId + * @return java.util.List + */ + List getAgencyIssueTotal(String customerId); + + /** + * 获取当前日期组织下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyIssueInc(String customerId, String date); + + /** + * 获取截止当前日期组织下已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedIssueTotal(String customerId, String date); + + /** + * 获取当前日期组织下已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedIssueInc(String customerId, String date); +} 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 new file mode 100644 index 0000000000..8b19129687 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -0,0 +1,61 @@ +package com.epmet.service.Issue.impl; + +import com.epmet.dao.issue.StatsIssueDao; +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.service.Issue.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:02 + */ +@Service +public class IssueServiceImpl implements IssueService { + + @Autowired + private StatsIssueDao statsIssueDao; + + @Override + public List getAgencyIssueTotal(String customerId) { + List list = statsIssueDao.selectAgencyIssueTotal(customerId); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } + + @Override + public List getAgencyIssueInc(String customerId, String date) { + List list = statsIssueDao.selectAgencyIssueInc(customerId, date); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } + + @Override + public List getAgencyClosedIssueTotal(String customerId, String date) { + List list = statsIssueDao.selectAgencyClosedIssueTotal(customerId, date); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } + + @Override + public List getAgencyClosedIssueInc(String customerId, String date) { + List list = statsIssueDao.selectAgencyClosedIssueInc(customerId, date); + list.forEach(dto -> { + String[] pIds = dto.getPIds().split(":"); + dto.setPId(pIds[pIds.length - 2]); + }); + return list; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java new file mode 100644 index 0000000000..89bd89f22e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -0,0 +1,20 @@ +package com.epmet.service; + +import java.util.Date; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:51 + */ +public interface StatsIssueService { + /** + * 机关下议题统计 + * @author zhaoqifeng + * @date 2020/6/17 16:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueAgencyDaily(String customerId, Date date); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java new file mode 100644 index 0000000000..080e79dc7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -0,0 +1,422 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.IssueConstant; +import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import com.epmet.service.Issue.IssueService; +import com.epmet.service.StatsIssueService; +import com.epmet.service.project.ProjectService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.FactIssueAgencyDailyService; +import com.epmet.util.DimIdGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 16:51 + */ +@Service +public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private IssueService issueService; + @Autowired + private DimAgencyService dimAgencyService; + @Autowired + private ProjectService projectService; + @Autowired + private FactIssueAgencyDailyService factIssueAgencyDailyService; + + @Override + public void saveIssueAgencyDaily(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取当前客户下所有机关 + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + //获取机关下议题各种状态的数目统计 + List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId); + //获取机关下议题各种状态的数目增量 + List issueAgencyIncList = issueService.getAgencyIssueInc(customerId, dateString); + //获取机关下已关闭议题统计 + List issueAgencyClosedTotalList = issueService.getAgencyIssueInc(customerId, dateString); + //获取机关下已关闭议题增量 + List issueAgencyClosedIncList = issueService.getAgencyIssueInc(customerId, dateString); + //已结案项目统计 + List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); + //已结案项目增量 + List projectAgencyClosedIncList = projectService.getAgencyClosedProjectInc(customerId, dateString); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + List list = new ArrayList<>(); + for (DimAgencyDTO agency : agencyList) { + FactIssueAgencyDailyEntity entity = initIssueAgencyDaily(dimId); + entity.setCustomerId(agency.getCustomerId()); + entity.setAgencyId(agency.getId()); + entity.setPid(agency.getPid()); + + String pIds; + if (null == agency.getPids() || agency.getPids().isEmpty()) { + pIds = agency.getPid().concat(":").concat(agency.getId()); + } else { + pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId()); + } + //总量统计 + saveTotal(issueAgencyTotalList, agency, entity, pIds); + //增量统计 + saveInc(issueAgencyIncList, agency, entity, pIds); + //已关闭议题已解决未解决统计 + if (entity.getClosedTotal() > NumConstant.ZERO) { + saveClosedTotal(issueAgencyClosedTotalList, agency, entity, pIds); + //已关闭议题已解决未解决增量统计 + if (entity.getClosedIncr() > NumConstant.ZERO) { + saveClosedInc(issueAgencyClosedIncList, agency, entity, pIds); + } + } + //已关闭项目已解决未解决统计 + if (entity.getShiftProjectTotal() > NumConstant.ZERO) { + saveClosedProjectTotal(projectAgencyClosedTotalList, agency, entity, pIds); + //已关闭项目已解决未解决增量统计 + if (entity.getClosedCaseTotal() > NumConstant.ZERO) { + saveClosedProjectInc(projectAgencyClosedIncList, agency, entity, pIds); + } + } + list.add(entity); + + factIssueAgencyDailyService.insertBatch(list); + } + } + + /** + * 已关闭项目已解决未解决增量统计 + * @author zhaoqifeng + * @date 2020/6/18 17:23 + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + */ + private void saveClosedProjectInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (ProjectAgencyDTO project : list) { + if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(project.getStatus())) { + //已解决数量 + resolvedCount = resolvedCount + project.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) { + //未解决数量 + unresolvedCount = unresolvedCount + project.getCount(); + } + } + } + int total = resolvedCount + unresolvedCount; + entity.setClosedCaseResolvedIncr(resolvedCount); + entity.setClosedCaseUnresolvedIncr(unresolvedCount); + entity.setClosedCaseIncr(total); + } + + /** + * 已关闭项目已解决未解决统计 + * @author zhaoqifeng + * @date 2020/6/18 17:23 + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + */ + private void saveClosedProjectTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (ProjectAgencyDTO project : list) { + if (agency.getId().equals(project.getAgencyId()) || project.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(project.getStatus())) { + //已解决数量 + resolvedCount = resolvedCount + project.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(project.getStatus())) { + //未解决数量 + unresolvedCount = unresolvedCount + project.getCount(); + } + } + } + int total = resolvedCount + unresolvedCount; + entity.setClosedCaseResolvedTotal(resolvedCount); + entity.setClosedCaseUnresolvedTotal(unresolvedCount); + entity.setClosedCaseTotal(total); + if (total > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(total); + entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } + } + + /** + * 议题各状态增量统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:55 + */ + private void saveInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //表决中增量 + int votingInc = NumConstant.ZERO; + //已转项目增量 + int shiftInc = NumConstant.ZERO; + //已关闭增量 + int closedInc = NumConstant.ZERO; + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.VOTING.equals(issueAgency.getStatus())) { + //表决中议题数量 + votingInc = votingInc + issueAgency.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + //已转项目议题数量 + shiftInc = shiftInc + issueAgency.getCount(); + } else { + //已关闭议题数量 + closedInc = closedInc + issueAgency.getCount(); + } + } + } + int issueInc = votingInc + shiftInc + closedInc; + entity.setVotingIncr(votingInc); + entity.setShiftProjectIncr(shiftInc); + entity.setClosedIncr(closedInc); + entity.setIssueIncr(issueInc); + } + + /** + * 议题各状态数量统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:54 + */ + private void saveTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //表决中数量 + Integer votingCount = NumConstant.ZERO; + //已转项目数量 + Integer shiftCount = NumConstant.ZERO; + //已关闭数量 + Integer closedCount = NumConstant.ZERO; + + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.VOTING.equals(issueAgency.getStatus())) { + //表决中议题数量 + votingCount = votingCount + issueAgency.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + //已转项目议题数量 + shiftCount = shiftCount + issueAgency.getCount(); + } else { + //已关闭议题数量 + closedCount = closedCount + issueAgency.getCount(); + } + } + } + int issueTotal = votingCount + shiftCount + closedCount; + entity.setVotingTotal(votingCount); + entity.setShiftProjectTotal(shiftCount); + entity.setClosedTotal(closedCount); + entity.setIssueTotal(issueTotal); + if (NumConstant.ZERO != issueTotal) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal voting = new BigDecimal(votingCount); + BigDecimal shift = new BigDecimal(shiftCount); + BigDecimal closed = new BigDecimal(closedCount); + BigDecimal total = new BigDecimal(issueTotal); + entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + + } + } + + /** + * 已关闭议题中已解决和未解决总数统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:48 + */ + private void saveClosedTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { + //表决中议题数量 + resolvedCount = resolvedCount + issueAgency.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + //已转项目议题数量 + unresolvedCount = unresolvedCount + issueAgency.getCount(); + } + } + } + entity.setClosedResolvedTotal(resolvedCount); + entity.setClosedUnresolvedTotal(unresolvedCount); + + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } + + /** + * 已关闭议题中已解决和未解决增量统计 + * + * @param list + * @param agency + * @param entity + * @param pIds + * @return void + * @author zhaoqifeng + * @date 2020/6/18 15:48 + */ + private void saveClosedInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { + //已解决数 + int resolvedInc = NumConstant.ZERO; + //未解决数 + int unresolvedInc = NumConstant.ZERO; + + for (IssueAgencyDTO issueAgency : list) { + if (agency.getId().equals(issueAgency.getAgencyId()) || issueAgency.getPIds().contains(pIds)) { + if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { + //表决中议题数量 + resolvedInc = resolvedInc + issueAgency.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + //已转项目议题数量 + unresolvedInc = unresolvedInc + issueAgency.getCount(); + } + } + } + entity.setClosedResolvedIncr(resolvedInc); + entity.setClosedUnresolvedIncr(unresolvedInc); + } + + + /** + * 初始化数据 + * + * @param dimIdBean + * @return com.epmet.entity.stats.FactIssueAgencyDailyEntity + * @author zhaoqifeng + * @date 2020/6/18 10:57 + */ + private FactIssueAgencyDailyEntity initIssueAgencyDaily(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueAgencyDailyEntity entity = new FactIssueAgencyDailyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setWeekId(dimIdBean.getWeekId()); + entity.setDateId(dimIdBean.getDateId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } + + /** + * 初始化数据 + * + * @param dimIdBean + * @return com.epmet.entity.stats.FactIssueAgencyMonthlyEntity + * @author zhaoqifeng + * @date 2020/6/18 10:58 + */ + private FactIssueAgencyMonthlyEntity initIssueAgencyMonthly(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueAgencyMonthlyEntity entity = new FactIssueAgencyMonthlyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index d271b95ca3..4b07934509 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -18,6 +18,7 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.entity.project.ProjectEntity; import java.util.List; @@ -36,4 +37,24 @@ public interface ProjectService extends BaseService { * @Description 根据客户Id查询客户项目业务表有效数据 **/ List getProjectList(String customerId); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedProjectTotal(String customerId, String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getAgencyClosedProjectInc(String customerId, String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index b551e62c89..1872e0f27b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -21,6 +21,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; +import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.springframework.beans.factory.annotation.Autowired; @@ -48,4 +49,14 @@ public class ProjectServiceImpl extends BaseServiceImpl getAgencyClosedProjectTotal(String customerId, String date) { + return baseDao.selectAgencyClosedProjectTotal(customerId, date); + } + + @Override + public List getAgencyClosedProjectInc(String customerId, String date) { + return baseDao.selectAgencyClosedProjectInc(customerId, date); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java new file mode 100644 index 0000000000..40f9c9e472 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueAgencyDailyDTO; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueAgencyDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java new file mode 100644 index 0000000000..0e96cc1835 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueAgencyMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java new file mode 100644 index 0000000000..58beae9049 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueGridDailyDTO; +import com.epmet.entity.stats.FactIssueGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueGridDailyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java new file mode 100644 index 0000000000..99a9a36769 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface FactIssueGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactIssueGridMonthlyDTO + * @author generator + * @date 2020-06-17 + */ + FactIssueGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void save(FactIssueGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-17 + */ + void update(FactIssueGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..b43614cc43 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.FactIssueAgencyDailyDao; +import com.epmet.dto.stats.FactIssueAgencyDailyDTO; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; +import com.epmet.service.stats.FactIssueAgencyDailyService; +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-06-17 + */ +@Service +public class FactIssueAgencyDailyServiceImpl extends BaseServiceImpl implements FactIssueAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyDailyDTO.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 FactIssueAgencyDailyDTO get(String id) { + FactIssueAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueAgencyDailyDTO dto) { + FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueAgencyDailyDTO dto) { + FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..a4d64c92c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.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.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.FactIssueAgencyMonthlyDao; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import com.epmet.service.stats.FactIssueAgencyMonthlyService; +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-06-17 + */ +@Service +public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactIssueAgencyMonthlyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyMonthlyDTO.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 FactIssueAgencyMonthlyDTO get(String id) { + FactIssueAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueAgencyMonthlyDTO dto) { + FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueAgencyMonthlyDTO dto) { + FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java new file mode 100644 index 0000000000..feebc25a82 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.FactIssueGridDailyDao; +import com.epmet.dto.stats.FactIssueGridDailyDTO; +import com.epmet.entity.stats.FactIssueGridDailyEntity; +import com.epmet.service.stats.FactIssueGridDailyService; +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-06-17 + */ +@Service +public class FactIssueGridDailyServiceImpl extends BaseServiceImpl implements FactIssueGridDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueGridDailyDTO.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 FactIssueGridDailyDTO get(String id) { + FactIssueGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueGridDailyDTO dto) { + FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueGridDailyDTO dto) { + FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..33b00ffd2e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * 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.FactIssueGridMonthlyDao; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +import com.epmet.service.stats.FactIssueGridMonthlyService; +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-06-17 + */ +@Service +public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactIssueGridMonthlyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.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 FactIssueGridMonthlyDTO get(String id) { + FactIssueGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueGridMonthlyDTO dto) { + FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueGridMonthlyDTO dto) { + FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ 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 6a0a0c8e2f..2174226182 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 @@ -2,7 +2,70 @@ - + SELECT ORG_ID AS "agencyId", + ORG_ID_PATH AS "pIds", + ISSUE_STATUS AS "status", + COUNT(ID) AS "count" + FROM + issue + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + GROUP BY + ORG_ID, ISSUE_STATUS + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index ed2e125d99..721f5a38ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -16,5 +16,38 @@ ORDER BY created_time DESC + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml new file mode 100644 index 0000000000..59d538fe2f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml new file mode 100644 index 0000000000..24e3e22dad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml new file mode 100644 index 0000000000..c2b1aaf819 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml new file mode 100644 index 0000000000..69538d9534 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 090bf3fed3634c2686cdc2e2275fe325eb556538 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 17:38:54 +0800 Subject: [PATCH 036/101] =?UTF-8?q?=E6=8C=89=E6=97=A5=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/ArticleGridPublishedSummaryDTO.java | 10 ++ .../com/epmet/constant/ProjectConstant.java | 12 ++ .../com/epmet/dao/stats/DimDepartmentDao.java | 10 ++ ...actArticlePublishedDepartmentDailyDao.java | 10 +- .../java/com/epmet/dao/voice/ArticleDao.java | 16 ++- ...ArticlePublishedDepartmentDailyEntity.java | 2 +- .../impl/StatsPublicityServiceImpl.java | 126 +++++++++++++++++- ...rticlePublishedDepartmentDailyService.java | 13 ++ .../stats/impl/DimDepartmentServiceImpl.java | 13 +- ...lePublishedDepartmentDailyServiceImpl.java | 11 ++ .../epmet/service/voice/ArticleService.java | 11 ++ .../voice/impl/ArticleServiceImpl.java | 18 ++- .../db/migration/data_statistical.sql | 2 +- .../mapper/stats/DimDepartmentDao.xml | 11 ++ ...FactArticlePublishedDepartmentDailyDao.xml | 5 +- .../resources/mapper/voice/ArticleDao.xml | 17 +++ .../mapper/voice/ArticlePublishRangeDao.xml | 1 + 17 files changed, 272 insertions(+), 16 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java index bcd0beaed9..301099d52b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java @@ -23,10 +23,20 @@ public class ArticleGridPublishedSummaryDTO implements Serializable { * 客户id */ private String customerId; + + /** + * 机关id + */ + private String agencyId; /** * 网格Id */ private String gridId; + /** + * 发布者Id publish_type类型为 部门时 是部门id;类型为 机关时 是机关Id + */ + private String publisherId; + /** * 发布文章总数 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 3d55c8436c..0df16681dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -30,5 +30,17 @@ public interface ProjectConstant { * 项目处理进展-结案 */ String CLOSE = "close"; + /** + * 发布单位类型 机关:agency + */ + String PUBLISH_TYPE_AGENCY = "agency"; + /** + * 发布单位类型 部门:department + */ + String PUBLISH_TYPE_DEPT = "department"; + /** + * 发布单位类型 网格:grid + */ + String PUBLISH_TYPE_GRID = "grid"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java index 42ec2905b8..c7848dffcb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/DimDepartmentDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.DimDepartmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 客户部门维度 @@ -30,4 +33,11 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface DimDepartmentDao extends BaseDao { int insertOne(DimDepartmentEntity dim); + + /** + * desc:根据客户Id获取所有的部门信息 + * @param customerId + * @return + */ + List getDepartmentListByCustomerId(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java index eb09ed6ce3..1cff4fa1a8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedDepartmentDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文章发布数量【部门】日统计表 @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { - + + /** + * desc:根据客户id,日期 删除数据 + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@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/voice/ArticleDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java index 4609722502..6622ffe700 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java @@ -18,8 +18,13 @@ package com.epmet.dao.voice; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; /** * 文章表 @@ -29,5 +34,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface ArticleDao extends BaseDao { - + + /** + * desc:根据客户Id 和发布时间 获取文章总数 + * + * @param customerId + * @param publishDate + * @param publishType + * @return + */ + List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publishType") String publishType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java index c91d318a87..96e8ae407f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactArticlePublishedDepartmentDailyEntity.java @@ -48,7 +48,7 @@ public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { /** * 部门ID */ - private String depsartmentId; + private String departmentId; /** * 文章累计发文数量 文章数量 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 4e182db209..cd230fc4f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -3,11 +3,11 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.stats.DimGridEntity; -import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; +import com.epmet.entity.stats.*; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; +import com.epmet.service.voice.ArticleService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -46,11 +46,17 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private DimCustomerService dimCustomerService; @Autowired private DimGridService dimGridService; + @Autowired + private DimDepartmentService dimDepartmentService; + @Autowired + private ArticleService articleService; @Autowired private ArticlePublishRangeService articlePublishRangeService; @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; + @Autowired + private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; @Autowired private ExecutorService executorService; @@ -71,21 +77,78 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { /*executorService.submit(()->{ });*/ - statsPublishedGridDaily(statsDate, dimIdBean, customerId); + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + statsPublishedGridDaily(statsDate, dimIdBean, customerId,agencySummaryMap); + statsPublishedDepartmentDaily(statsDate, dimIdBean, customerId,agencySummaryMap); + statsPublishedAgencyDaily(statsDate, dimIdBean, customerId,agencySummaryMap); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); return true; } + private void statsPublishedDepartmentDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //获取所有客户 + List departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId); + if (CollectionUtils.isEmpty(departmentDTOList)) { + log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); + return; + } + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + } + } + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + } + + /** + * desc:同一个机关下的数据进行类型处理 + * @param result + * @param summaryDTO + */ + private void buildAgencySummaryData(Map result, ArticleGridPublishedSummaryDTO summaryDTO) { + //同一个机关下数据累加 + ArticleGridPublishedSummaryDTO publishedSummaryDTO = result.get(summaryDTO.getAgencyId()); + if (publishedSummaryDTO == null) { + ArticleGridPublishedSummaryDTO summary = new ArticleGridPublishedSummaryDTO(); + summary.setCustomerId(summaryDTO.getCustomerId()); + summary.setAgencyId(summaryDTO.getAgencyId()); + summary.setGridId(summaryDTO.getGridId()); + summary.setPublisherId(summaryDTO.getPublisherId()); + summary.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + result.put(summaryDTO.getPublisherId(),summaryDTO); + }else{ + publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount()+summaryDTO.getArticlePublishedCount()); + publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount()+summaryDTO.getArticlePublishedCount()); + } + } + /** * desc:按日统计 网格纬度的 文章总数数据 - * - * @param statsDate + * @param statsDate * @param dimIdBean * @param customerId + * @param agencySummaryMap */ - private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { + private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //key:所在机关Id + Map result = new HashMap<>(); //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { @@ -106,11 +169,41 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } } boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); } + private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //获取所有客户 + List departmentDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(departmentDTOList)) { + log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); + return; + } + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + } + } + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + } + /** * desc:将网格对象构建为 gridDaily 对象 * @@ -131,4 +224,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); return result; } + + /** + * desc:将网格对象构建为 gridDaily 对象 + * + * @param dimDepartmentEntities + * @param dimIdBean + * @return + */ + private Map convertDepartmentDailyEntity(List dimDepartmentEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimDepartmentEntities.forEach(dimGridEntity -> { + FactArticlePublishedDepartmentDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedDepartmentDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setAgencyId(dimGridEntity.getAgencyId()); + entity.setDepartmentId(dimGridEntity.getId()); + entity.setArticleTotalCount(0); + entity.setArticlePublishedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java index 26f2c2089c..40ae1d8002 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedDepartmentDailyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; +import java.util.Collection; + /** * 文章发布数量【部门】日统计表 * @@ -28,4 +30,15 @@ import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; */ public interface FactArticlePublishedDepartmentDailyService extends BaseService { + /** + * desc: 删除并插入数据 + * + * @param dateId + * @param values + * @return: + * @date: 2020/6/18 14:54 + * @author: jianjun liu + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java index ac58403913..567b211aa3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDepartmentServiceImpl.java @@ -20,16 +20,16 @@ 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.constant.FieldConstant; 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.DimDepartmentDao; import com.epmet.dto.stats.DimDepartmentDTO; import com.epmet.entity.org.CustomerDepartmentEntity; import com.epmet.entity.stats.DimDepartmentEntity; import com.epmet.service.stats.DimDepartmentService; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -44,6 +44,7 @@ import java.util.Map; * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-16 */ +@Slf4j @Service public class DimDepartmentServiceImpl extends BaseServiceImpl implements DimDepartmentService { @@ -118,4 +119,12 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl getDepartmentListByCustomerId(String customerId) { + if (StringUtils.isBlank(customerId)){ + log.warn("getDepartmentListByCustomerId param is blank "); + } + return baseDao.getDepartmentListByCustomerId(customerId); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java index 47c9667c59..cf40d35c1e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java @@ -21,16 +21,27 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.stats.FactArticlePublishedDepartmentDailyDao; import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.Collection; + /** * 文章发布数量【部门】日统计表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-18 */ +@Slf4j @Service public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedDepartmentDailyService { + @Override + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java index 366e167ad1..3a1c321c9c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java @@ -18,8 +18,12 @@ package com.epmet.service.voice; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; +import java.util.Date; +import java.util.List; + /** * desc: 数据统计文章service * @@ -30,4 +34,11 @@ import com.epmet.entity.voice.ArticleEntity; */ public interface ArticleService extends BaseService { + /** + * desc:根据客户id、发布时间 获取文章总数 + * @param customerId + * @param publishDate + * @return + */ + List getAllPublishedCount(String customerId, Date publishDate); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java index f1a788fc30..27821e8a41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -19,13 +19,20 @@ package com.epmet.service.voice.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; +import com.epmet.constant.ProjectConstant; import com.epmet.dao.voice.ArticleDao; +import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import com.epmet.service.voice.ArticleService; -import org.springframework.beans.factory.annotation.Autowired; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import java.util.Date; +import java.util.List; + /** * 项目表 * @@ -35,7 +42,12 @@ import org.springframework.stereotype.Service; @Service @DataSource(DataSourceConstant.GOV_VOICE) public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { - @Autowired - private ArticleDao articleDao; + @Override + public List getAllPublishedCount(String customerId, Date publishDate) { + if (StringUtils.isBlank(customerId) || publishDate == null){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISH_TYPE_DEPT); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql index adeeac3769..f188d95e6a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -56,7 +56,7 @@ CREATE TABLE `fact_article_published_department_daily` ( `ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT 'ID ID', `CUSTOMER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '客户ID 客户ID', `AGENCY_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发布文章单位所属机关ID 发布文章单位所属机关ID', - `DEPSARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', + `DEPARTMENT_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '部门ID', `ARTICLE_TOTAL_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章累计发文数量 文章数量', `ARTICLE_PUBLISHED_COUNT` int(11) NULL DEFAULT NULL COMMENT '当前发文数量 当前未下线的文章数量', `DATE_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '日期ID 日期ID', diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml index c1c6c56899..8941d496fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/DimDepartmentDao.xml @@ -8,4 +8,15 @@ updated_by, updated_time) VALUE (#{id}, #{departmentName}, #{agencyId}, #{customerId}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml index 1dd50f6c6c..abe5fafc0a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedDepartmentDailyDao.xml @@ -7,7 +7,7 @@ - + @@ -22,6 +22,9 @@ + + DELETE FROM fact_article_published_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml index d411b3513e..69f1ddc5e3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml @@ -29,6 +29,23 @@ + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml index 6330c003b8..4b7f1cfc9b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml @@ -23,6 +23,7 @@ From 7d8befb142ab1a79cacf019c8f9d33a9e4e5dc43 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 17:52:21 +0800 Subject: [PATCH 039/101] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/StatsPublicityServiceImpl.java | 7 +++++-- .../com/epmet/service/stats/DimDepartmentService.java | 10 ++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 8cca6658da..8dab26fefe 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -3,7 +3,10 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.stats.*; +import com.epmet.entity.stats.DimDepartmentEntity; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; +import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; @@ -178,7 +181,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { //获取所有客户 - List departmentDTOList = null;//dimAgencyService.getAgencyListByCustomerId(customerId); + List departmentDTOList = null;//dimAgencyService.getAgencyListByCustomerId(customerId); if (CollectionUtils.isEmpty(departmentDTOList)) { log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java index 0055e81fb5..8ae4e1e1bd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java @@ -95,4 +95,14 @@ public interface DimDepartmentService extends BaseService { void delete(String[] ids); void addDepartmentDims(List departments); + + /** + * desc: 根据客户Id获取 部门数据 + * + * @param null + * @return: + * @date: 2020/6/18 17:45 + * @author: jianjun liu + */ + List getDepartmentListByCustomerId(String customerId); } \ No newline at end of file From 8796f34f80c0d96148637cc179d914f73c779a21 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 18 Jun 2020 18:27:11 +0800 Subject: [PATCH 040/101] =?UTF-8?q?1.=E6=96=B0=E5=A2=9E=E5=B9=B4=E7=BB=B4?= =?UTF-8?q?=E5=BA=A6=E5=92=8C=E5=AD=A3=E7=BB=B4=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DimController.java | 18 ++++- .../service/impl/StatsDimServiceImpl.java | 47 +++++++----- .../epmet/service/stats/DimYearService.java | 3 + .../stats/impl/DimDateServiceImpl.java | 46 ++++++++---- .../stats/impl/DimMonthServiceImpl.java | 58 ++++++++------- .../stats/impl/DimQuarterServiceImpl.java | 29 +++++--- .../stats/impl/DimYearServiceImpl.java | 73 +++++++++++++++++++ 7 files changed, 200 insertions(+), 74 deletions(-) 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 764c960452..0964efb49f 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 @@ -3,10 +3,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.AgencySubTreeDto; import com.epmet.service.StatsDimService; -import com.epmet.service.stats.DimAgencyService; -import com.epmet.service.stats.DimDateService; -import com.epmet.service.stats.DimMonthService; -import com.epmet.service.stats.DimQuarterService; +import com.epmet.service.stats.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -28,6 +25,9 @@ public class DimController { @Autowired private DimQuarterService quarterService; + @Autowired + private DimYearService dimYearService; + @Autowired private StatsDimService statsDimService; @@ -104,6 +104,16 @@ public class DimController { return new Result(); } + /** + * 年度维度 + * @return + */ + @PostMapping("/year/init") + public Result initYearDim() { + dimYearService.initYearDim(); + return new Result(); + } + /** * @Description 所有机构 * @param diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index 7d79ead2cf..d4b435a6d8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -16,6 +16,7 @@ import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.Date; import java.util.List; @@ -53,6 +54,11 @@ public class StatsDimServiceImpl implements StatsDimService { @Override public void initGridDim() { + LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_GRID); + if (lastExecRecord == null) { + lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_GRID); + } + DimGridEntity lastCreatedGridDim = dimGridService.getLastCreatedGridDim(); List grids; if (lastCreatedGridDim == null) { @@ -68,7 +74,11 @@ public class StatsDimServiceImpl implements StatsDimService { } List gridDims = convertCustomerGrid2GridDim(grids); - dimGridService.addGridDims(gridDims); + if (!CollectionUtils.isEmpty(gridDims)) { + dimGridService.addGridDims(gridDims); + lastExecRecord.setExecTime(new Date()); + lastExecRecordService.updateById(lastExecRecord); + } } /** @@ -112,11 +122,13 @@ public class StatsDimServiceImpl implements StatsDimService { } List agencies = customerAgencyService.listAgenciesByCreateTime(statsStartTime, statsEndTime); - dimAgencyService.addAgencyDims(agencies); - lastExecRecord.setExecTime(new Date()); + if (!CollectionUtils.isEmpty(agencies)) { + dimAgencyService.addAgencyDims(agencies); + lastExecRecord.setExecTime(new Date()); - // 记录最后一次统计时间 - lastExecRecordService.updateById(lastExecRecord); + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + } } /** @@ -136,12 +148,14 @@ public class StatsDimServiceImpl implements StatsDimService { } List customers = customerService.listValidCustomersByCreateTime(statsStartTime, statsEndTime); - dimCustomerService.addCustomerDims(customers); + if (!CollectionUtils.isEmpty(customers)) { + dimCustomerService.addCustomerDims(customers); - lastExecRecord.setExecTime(new Date()); + lastExecRecord.setExecTime(new Date()); - // 记录最后一次统计时间 - lastExecRecordService.updateById(lastExecRecord); + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + } } @Override @@ -158,14 +172,11 @@ public class StatsDimServiceImpl implements StatsDimService { } List departments = departmentService.listDepartmentsByCreatedTime(statsStartTime, statsEndTime); - - dimDepartmentService.addDepartmentDims(departments); - - lastExecRecord.setExecTime(new Date()); - - // 记录最后一次统计时间 - lastExecRecordService.updateById(lastExecRecord); - + if (!CollectionUtils.isEmpty(departments)) { + dimDepartmentService.addDepartmentDims(departments); + lastExecRecord.setExecTime(new Date()); + // 记录最后一次统计时间 + lastExecRecordService.updateById(lastExecRecord); + } } - } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java index 516317f48a..ed840f7636 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimYearService.java @@ -92,4 +92,7 @@ public interface DimYearService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + + void initYearDim(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index 102111c92e..9f6281c20b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -24,12 +24,17 @@ 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.StatsSubject; import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.stats.DimDateDTO; import com.epmet.entity.stats.DimDateEntity; +import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimDateService; +import com.epmet.service.stats.LastExecRecordService; import com.epmet.util.DimIdGenerator; import org.apache.commons.lang3.StringUtils; +import org.joda.time.LocalDate; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -44,6 +49,9 @@ import java.util.*; @Service public class DimDateServiceImpl extends BaseServiceImpl implements DimDateService { + @Autowired + private LastExecRecordService lastExecRecordService; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -109,32 +117,44 @@ public class DimDateServiceImpl extends BaseServiceImpl implements DimYearService { + @Autowired + private LastExecRecordService lastExecRecordService; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -97,4 +106,68 @@ public class DimYearServiceImpl extends BaseServiceImpl Date: Thu, 18 Jun 2020 19:07:34 +0800 Subject: [PATCH 041/101] =?UTF-8?q?1.=E5=88=A0=E9=99=A4=E6=97=A0=E7=94=A8d?= =?UTF-8?q?emo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 9 +++++++ .../epmet/service/Issue/DemoIssueService.java | 10 -------- .../Issue/impl/DemoIssueServiceImpl.java | 25 ------------------- 3 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/DemoIssueService.java delete mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/DemoIssueServiceImpl.java 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 d23d021799..2db20b4501 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 @@ -117,6 +117,15 @@ public class DateUtils { return new Date[]{beginDate, endDate}; } + /** + * 根据日期,获取周开始日期、结束日期 + * @param date + * @return + */ + public static Date[] getWeekStartAndEnd(Date date) { + return getWeekStartAndEnd(getWeekOfYear(date)); + } + /** * 对日期的【秒】进行加/减 * diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/DemoIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/DemoIssueService.java deleted file mode 100644 index bf6e62fe3f..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/DemoIssueService.java +++ /dev/null @@ -1,10 +0,0 @@ -package com.epmet.service.Issue; - -import com.epmet.entity.issue.IssueEntity; - -import java.util.List; - -public interface DemoIssueService { - - List listAllEntities(); -} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/DemoIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/DemoIssueServiceImpl.java deleted file mode 100644 index 423e9fc91f..0000000000 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/DemoIssueServiceImpl.java +++ /dev/null @@ -1,25 +0,0 @@ -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.entity.issue.IssueEntity; -import com.epmet.service.Issue.DemoIssueService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.List; - - -@Service -@DataSource(DataSourceConstant.GOV_ISSUE) -public class DemoIssueServiceImpl implements DemoIssueService { - - @Autowired - private StatsIssueDao statsIssueDao; - - @Override - public List listAllEntities() { - return statsIssueDao.listAllEntities(); - } -} From 69d01daaf51ce9c7bdd1de79c6ce310976c943bd Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 20:23:25 +0800 Subject: [PATCH 042/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/ArticleGridPublishedSummaryDTO.java | 5 +- .../com/epmet/dao/stats/DimAgencyDao.java | 25 ++++--- .../FactArticlePublishedAgencyDailyDao.java | 10 ++- .../impl/StatsPublicityServiceImpl.java | 75 +++++++++++++++---- .../epmet/service/stats/DimAgencyService.java | 10 +++ ...actArticlePublishedAgencyDailyService.java | 13 ++++ .../stats/impl/DimAgencyServiceImpl.java | 14 +++- ...rticlePublishedAgencyDailyServiceImpl.java | 13 +++- .../epmet/service/voice/ArticleService.java | 16 +++- .../voice/impl/ArticleServiceImpl.java | 18 ++++- .../resources/mapper/stats/DimAgencyDao.xml | 12 +++ .../FactArticlePublishedAgencyDailyDao.xml | 3 + 12 files changed, 182 insertions(+), 32 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java index 301099d52b..c1bd1e7043 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java @@ -23,7 +23,10 @@ public class ArticleGridPublishedSummaryDTO implements Serializable { * 客户id */ private String customerId; - + /** + * 上级机关id,顶级为"0" + */ + private String pid; /** * 机关id */ 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 056c65bace..493fade14e 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 @@ -47,29 +47,36 @@ public interface DimAgencyDao extends BaseDao { List selectDimAgencyList(DimAgencyDTO dto); /** - * @Description 获取所有机关 * @param - * @return List + * @return List + * @Description 获取所有机关 * @author wangc * @date 2020.06.18 09:26 - **/ + **/ List selectAllAgency(); /** - * @Description 根据PID获取下级机关 * @param pid - * @return List + * @return List + * @Description 根据PID获取下级机关 * @author wangc * @date 2020.06.18 09:26 - **/ - List selectSubAgencyByPid(@Param("pid")String pid); + **/ + List selectSubAgencyByPid(@Param("pid") String pid); /** - * @Description 获取顶层级机关机关 * @param - * @return List + * @return List + * @Description 获取顶层级机关机关 * @author wangc * @date 2020.06.18 09:26 **/ List selectTopAgency(); + + /** + * desc:根据客户id 获取机关列表 + * @param customerId + * @return + */ + List getAgencyListByCustomerId(@Param("customerId") String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java index ee299f316c..5a7e9dbfc7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactArticlePublishedAgencyDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文章发布数量【机关】日统计表 @@ -29,5 +30,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactArticlePublishedAgencyDailyDao extends BaseDao { - + /** + * desc:删除数据 + * + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@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/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 8dab26fefe..452d484077 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -1,12 +1,10 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; -import com.epmet.entity.stats.DimDepartmentEntity; -import com.epmet.entity.stats.DimGridEntity; -import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; -import com.epmet.entity.stats.FactArticlePublishedGridDailyEntity; +import com.epmet.entity.stats.*; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; @@ -60,6 +58,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @Autowired private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; + @Autowired + private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; + @Autowired private ExecutorService executorService; @@ -101,7 +102,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { @@ -162,12 +163,12 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articlePublishRangeService.getAllPublishedCount(customerId, statsDate); + List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { FactArticlePublishedGridDailyEntity gridDailyEntities = gridDailyEntityMap.get(summaryDTO.getGridId()); if (gridDailyEntities == null) { - log.error("publicitySummary bizData gridId:{} not exist in dimGrid", summaryDTO.getGridId()); + log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); continue; } gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); @@ -180,20 +181,20 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { - //获取所有客户 - List departmentDTOList = null;//dimAgencyService.getAgencyListByCustomerId(customerId); - if (CollectionUtils.isEmpty(departmentDTOList)) { + //获取所有机关 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } //转换为 需要插入的Entity - Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); if (gridDailyEntities == null) { log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); continue; @@ -204,7 +205,32 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { buildAgencySummaryData(agencySummaryMap, summaryDTO); } } - boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + //数据向上级机关添加 + if (!CollectionUtils.isEmpty(agencySummaryMap)){ + for (Map.Entry entry : agencySummaryMap.entrySet()) { + String agencyId = entry.getKey(); + ArticleGridPublishedSummaryDTO summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); + if (dailyEntity == null) { + log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setData2ParentAgency(agencySummaryMap, summary); + } + } + + boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + } + + private void setData2ParentAgency(Map agencySummaryMap, ArticleGridPublishedSummaryDTO summary) { + String pid = summary.getPid(); + ArticleGridPublishedSummaryDTO parentAgency = agencySummaryMap.get(pid); + parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount()+summary.getArticleTotalCount()); + parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount()+summary.getArticlePublishedCount()); + pid = parentAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)){ + setData2ParentAgency(agencySummaryMap,parentAgency); + } } /** @@ -248,4 +274,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); return result; } + + /** + * desc:将机关卫队对象构建为 agencyDaily 对象 + * + * @param dimDepartmentEntities + * @param dimIdBean + * @return + */ + private Map convertAgencyDailyEntity(List dimDepartmentEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimDepartmentEntities.forEach(dimGridEntity -> { + FactArticlePublishedAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setPid(dimGridEntity.getPid()); + entity.setAgencyId(dimGridEntity.getId()); + entity.setArticleTotalCount(0); + entity.setArticlePublishedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index 9bb3b433d3..8de5b0045f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -122,4 +122,14 @@ public interface DimAgencyService extends BaseService { * @date 2020.06.18 09:45 **/ List getTopAgency(); + + /** + * desc: 根据客户Id 获取机关列表数据 + * + * @param customerId + * @return: + * @date: 2020/6/18 17:54 + * @author: jianjun liu + */ + List getAgencyListByCustomerId(String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java index b674d6ae3e..dc9d7e3d63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactArticlePublishedAgencyDailyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; +import java.util.Collection; + /** * 文章发布数量【机关】日统计表 * @@ -28,5 +30,16 @@ import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; */ public interface FactArticlePublishedAgencyDailyService extends BaseService { + /** + * desc: 删除并插入数据 + * + * @param customerId + * @param dateId + * @param values + * @return: + * @date: 2020/6/18 18:59 + * @author: jianjun liu + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index bab14194e3..71b04b1a69 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -20,9 +20,11 @@ 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.constant.FieldConstant; +import com.epmet.commons.tools.exception.EpmetErrorCode; +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.dao.stats.DimAgencyDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; @@ -30,7 +32,6 @@ import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.service.stats.DimAgencyService; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -38,7 +39,6 @@ import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 机关维度 @@ -160,4 +160,12 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyListByCustomerId(String customerId) { + if (StringUtils.isBlank(customerId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getAgencyListByCustomerId(customerId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java index 074d917144..1b7f79a281 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -21,18 +21,27 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.stats.FactArticlePublishedAgencyDailyDao; import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import java.util.Collection; + /** * 文章发布数量【机关】日统计表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-18 */ +@Slf4j @Service public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl implements FactArticlePublishedAgencyDailyService { - - + @Override + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java index 3a1c321c9c..e1aee5a20a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java @@ -40,5 +40,19 @@ public interface ArticleService extends BaseService { * @param publishDate * @return */ - List getAllPublishedCount(String customerId, Date publishDate); + List getAllDepartmentPublishedCount(String customerId, Date publishDate); + /** + * desc:根据客户id、发布时间 获取文章总数 + * @param customerId + * @param publishDate + * @return + */ + List getAllAgencyPublishedCount(String customerId, Date publishDate); + /** + * desc:根据客户id、发布时间 获取文章总数 + * @param customerId + * @param publishDate + * @return + */ + List getAllGridPublishedCount(String customerId, Date publishDate); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java index 27821e8a41..9e9674fbe8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -44,10 +44,26 @@ import java.util.List; public class ArticleServiceImpl extends BaseServiceImpl implements ArticleService { @Override - public List getAllPublishedCount(String customerId, Date publishDate) { + public List getAllDepartmentPublishedCount(String customerId, Date publishDate) { if (StringUtils.isBlank(customerId) || publishDate == null){ throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISH_TYPE_DEPT); } + + @Override + public List getAllAgencyPublishedCount(String customerId, Date publishDate) { + if (StringUtils.isBlank(customerId) || publishDate == null){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISH_TYPE_AGENCY); + } + + @Override + public List getAllGridPublishedCount(String customerId, Date publishDate) { + if (StringUtils.isBlank(customerId) || publishDate == null){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISH_TYPE_GRID); + } } \ 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 d78bbb4eae..ad8ed78057 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 @@ -103,5 +103,17 @@ agency.CUSTOMER_ID, agency.PID + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml index 301fb3fe9f..ea4debe1dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactArticlePublishedAgencyDailyDao.xml @@ -22,6 +22,9 @@ + + DELETE FROM fact_article_published_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + \ No newline at end of file From 4ca3633f40db97839feb9f2bcf8b055442487620 Mon Sep 17 00:00:00 2001 From: jianjun Date: Thu, 18 Jun 2020 21:45:43 +0800 Subject: [PATCH 043/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/ProjectConstant.java | 6 ++--- .../java/com/epmet/dao/voice/ArticleDao.java | 4 ++-- .../service/impl/StatsDemoServiceImpl.java | 8 +++---- .../impl/StatsPublicityServiceImpl.java | 23 ++++++++++++------- ...rticlePublishedAgencyDailyServiceImpl.java | 2 ++ .../voice/impl/ArticleServiceImpl.java | 6 ++--- .../resources/mapper/voice/ArticleDao.xml | 8 +++---- 7 files changed, 32 insertions(+), 25 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java index 0df16681dc..96461ec01a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/constant/ProjectConstant.java @@ -33,14 +33,14 @@ public interface ProjectConstant { /** * 发布单位类型 机关:agency */ - String PUBLISH_TYPE_AGENCY = "agency"; + String PUBLISHER_TYPE_AGENCY = "agency"; /** * 发布单位类型 部门:department */ - String PUBLISH_TYPE_DEPT = "department"; + String PUBLISHER_TYPE_DEPT = "department"; /** * 发布单位类型 网格:grid */ - String PUBLISH_TYPE_GRID = "grid"; + String PUBLISHER_TYPE_GRID = "grid"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java index 6622ffe700..2b23d16345 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java @@ -40,8 +40,8 @@ public interface ArticleDao extends BaseDao { * * @param customerId * @param publishDate - * @param publishType + * @param publisherType * @return */ - List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publishType") String publishType); + List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index b29ca1c98a..4321be3ceb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -1,9 +1,7 @@ package com.epmet.service.impl; import com.epmet.dto.AgencySubTreeDto; -import com.epmet.entity.issue.IssueEntity; import com.epmet.entity.org.CustomerAgencyEntity; -import com.epmet.service.Issue.DemoIssueService; import com.epmet.service.StatsDemoService; import com.epmet.service.org.DemoGovOrgService; import com.epmet.service.stats.DemoDataStatsService; @@ -23,8 +21,8 @@ public class StatsDemoServiceImpl implements StatsDemoService { @Autowired private DemoGovOrgService demoGovOrgService; - @Autowired - private DemoIssueService demoIssueService; +// @Autowired +// private DemoIssueService demoIssueService; @Autowired private DemoDataStatsService demoDataStatsService; @@ -32,7 +30,7 @@ public class StatsDemoServiceImpl implements StatsDemoService { @Override public void testList() { List agencies = demoGovOrgService.listAllEntities(); - List issues = demoIssueService.listAllEntities(); + //List issues = demoIssueService.listAllEntities(); System.out.println(666); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 452d484077..c5dd27ec08 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -67,8 +67,12 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Override public Boolean publicitySummary(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { - statsDate = DateUtils.addDateDays(new Date(), -1); + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(),DateUtils.DATE_PATTERN); + }else{ + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate,1),DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); int pageNo = 1; @@ -190,7 +194,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId,statsDate); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { @@ -215,21 +219,24 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); continue; } - setData2ParentAgency(agencySummaryMap, summary); + setData2ParentAgency(agencyDailyEntityMap,summary, dailyEntity); } } boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); } - private void setData2ParentAgency(Map agencySummaryMap, ArticleGridPublishedSummaryDTO summary) { + private void setData2ParentAgency(Map agencyDailyEntityMap, ArticleGridPublishedSummaryDTO agencySummary, FactArticlePublishedAgencyDailyEntity summary) { String pid = summary.getPid(); - ArticleGridPublishedSummaryDTO parentAgency = agencySummaryMap.get(pid); - parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount()+summary.getArticleTotalCount()); - parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount()+summary.getArticlePublishedCount()); + FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); + if (parentAgency == null){ + return; + } + parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount()+agencySummary.getArticleTotalCount()); + parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount()+agencySummary.getArticlePublishedCount()); pid = parentAgency.getPid(); if (!NumConstant.ZERO_STR.equals(pid)){ - setData2ParentAgency(agencySummaryMap,parentAgency); + setData2ParentAgency(agencyDailyEntityMap, agencySummary,parentAgency); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java index 1b7f79a281..601d8110a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.entity.stats.FactArticlePublishedAgencyDailyEntity; import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; import java.util.Collection; @@ -38,6 +39,7 @@ public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl< @Override + @Transactional(rollbackFor = Exception.class) public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { int i = baseDao.deleteByDateId(customerId, dateId); log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java index 9e9674fbe8..82166605ed 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -48,7 +48,7 @@ public class ArticleServiceImpl extends BaseServiceImpl + AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR} + AND PUBLISH_DATE GROUP BY CUSTOMER_ID, PUBLISHER_ID From fd120e70c697726df3e4d7d05713cc2e7c6e0776 Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 19 Jun 2020 00:23:08 +0800 Subject: [PATCH 044/101] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=EF=BC=9A=E4=BD=BF?= =?UTF-8?q?=E7=94=A8DimRobot=202.=E4=BF=AE=E6=94=B9=EF=BC=9AMetaObjectFiel?= =?UTF-8?q?d=E7=9A=84=E7=94=9F=E6=88=90=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../handler/FieldMetaObjectHandler.java | 37 +++++++-- .../epmet/commons/tools/utils/DateUtils.java | 8 +- .../com/epmet/constant/RobotConstant.java | 5 ++ .../com/epmet/controller/DemoController.java | 5 -- .../com/epmet/controller/DimController.java | 13 ++++ .../com/epmet/service/StatsDemoService.java | 1 - .../service/impl/StatsDemoServiceImpl.java | 11 --- .../service/impl/StatsDimServiceImpl.java | 10 +-- .../epmet/service/stats/DimWeekService.java | 2 + .../stats/impl/DimAgencyServiceImpl.java | 14 ++-- .../stats/impl/DimCustomerServiceImpl.java | 14 ++-- .../stats/impl/DimDateServiceImpl.java | 13 ++-- .../stats/impl/DimDepartmentServiceImpl.java | 11 +-- .../stats/impl/DimGridServiceImpl.java | 2 +- .../stats/impl/DimMonthServiceImpl.java | 11 +-- .../stats/impl/DimQuarterServiceImpl.java | 12 +-- .../stats/impl/DimWeekServiceImpl.java | 77 +++++++++++++++++++ .../stats/impl/DimYearServiceImpl.java | 11 +-- .../stats/impl/LastExecRecordServiceImpl.java | 9 +-- 19 files changed, 171 insertions(+), 95 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/RobotConstant.java diff --git a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java index 1b9215e22a..1015ade75d 100644 --- a/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java +++ b/epmet-commons/epmet-commons-mybatis/src/main/java/com/epmet/commons/mybatis/handler/FieldMetaObjectHandler.java @@ -48,14 +48,11 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { public void insertFill(MetaObject metaObject) { Date date = new Date(); if (metaObject.getOriginalObject() instanceof BaseEpmetEntity) { - String loginUserId = loginUserUtil.getLoginUserId(); // epmet项目新增的 - loginUserId = StringUtils.isBlank(loginUserId) ? Constant.APP_USER_FLAG : loginUserId; - //Long deptId = user == null ? null : user.getDeptId(); setFieldValByName(FieldConstant.CREATED_TIME_HUMP, date, metaObject); - setFieldValByName(FieldConstant.CREATED_BY_HUMP, loginUserId, metaObject); + setFieldValByName(FieldConstant.CREATED_BY_HUMP, getCreatedByFieldValue(metaObject), metaObject); setFieldValByName(FieldConstant.UPDATED_TIME_HUMP, date, metaObject); - setFieldValByName(FieldConstant.UPDATED_BY_HUMP, loginUserId, metaObject); + setFieldValByName(FieldConstant.UPDATED_BY_HUMP, getUpdatedByFieldValue(metaObject), metaObject); setFieldValByName(FieldConstant.REVISION_HUMP, NumConstant.ZERO, metaObject); //删除标识 setFieldValByName(FieldConstant.DEL_FLAG_HUMP, EpmetDelFlagEnum.NORMAL.value(), metaObject); @@ -82,6 +79,32 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { } } + public Object getCreatedByFieldValue(MetaObject metaObject) { + Object value = loginUserUtil.getLoginUserId(); + if (value == null) { + if (metaObject.hasGetter(FieldConstant.CREATED_BY_HUMP)) { + value = metaObject.getValue(FieldConstant.CREATED_BY_HUMP); + } + if (value == null) { + value = Constant.APP_USER_FLAG; + } + } + return value; + } + + public Object getUpdatedByFieldValue(MetaObject metaObject) { + Object value = loginUserUtil.getLoginUserId(); + if (value == null) { + if (metaObject.hasGetter(FieldConstant.UPDATED_BY_HUMP)) { + value = metaObject.getValue(FieldConstant.UPDATED_BY_HUMP); + } + if (value == null) { + value = Constant.APP_USER_FLAG; + } + } + return value; + } + @Override public void updateFill(MetaObject metaObject) { @@ -111,9 +134,7 @@ public class FieldMetaObjectHandler implements MetaObjectHandler { //更新时间 setFieldValByName(UPDATE_DATE, new Date(), metaObject); } else if (fillEsuaEntity) { - String loginUserId = loginUserUtil.getLoginUserId(); - String userId = StringUtils.isBlank(loginUserId) ? Constant.APP_USER_FLAG : loginUserId; - setFieldValByName(FieldConstant.UPDATED_BY_HUMP, userId, metaObject); + setFieldValByName(FieldConstant.UPDATED_BY_HUMP, getUpdatedByFieldValue(metaObject), metaObject); setFieldValByName(FieldConstant.UPDATED_TIME_HUMP, new Date(), metaObject); } } 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 2db20b4501..9864888cf5 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 @@ -123,7 +123,13 @@ public class DateUtils { * @return */ public static Date[] getWeekStartAndEnd(Date date) { - return getWeekStartAndEnd(getWeekOfYear(date)); + DateTime dateTime = new DateTime(date); + LocalDate localDate = new LocalDate(dateTime); + + localDate = localDate.dayOfWeek().withMinimumValue(); + Date beginDate = localDate.toDate(); + Date endDate = localDate.plusDays(6).toDate(); + return new Date[]{beginDate, endDate}; } /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/RobotConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/RobotConstant.java new file mode 100644 index 0000000000..e548b35a1a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/RobotConstant.java @@ -0,0 +1,5 @@ +package com.epmet.constant; + +public interface RobotConstant { + String DIMENSION_ROBOT = "DimensionRobot"; +} 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 85dcc1ae04..2f6e7ac226 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 @@ -24,11 +24,6 @@ public class DemoController { @Autowired private ExecutorService executorService; - @GetMapping("testlist") - public void testList() { - demoService.testList(); - } - @GetMapping("testtx") public void testTx() { demoService.testTx(); 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 0964efb49f..8a4e4833f3 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 @@ -28,6 +28,9 @@ public class DimController { @Autowired private DimYearService dimYearService; + @Autowired + private DimWeekService dimWeekService; + @Autowired private StatsDimService statsDimService; @@ -114,6 +117,16 @@ public class DimController { return new Result(); } + /** + * 按周维度 + * @return + */ + @PostMapping("/week/init") + public Result initWeekDim() { + dimWeekService.initWeekDim(); + return new Result(); + } + /** * @Description 所有机构 * @param diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java index 0f5524072c..e03d5844ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsDemoService.java @@ -6,7 +6,6 @@ import java.util.List; public interface StatsDemoService { - void testList(); void testTx(); Boolean testThreadPool(); void testThreadPoolAsync(); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index b29ca1c98a..6c662d9760 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -3,7 +3,6 @@ package com.epmet.service.impl; import com.epmet.dto.AgencySubTreeDto; import com.epmet.entity.issue.IssueEntity; import com.epmet.entity.org.CustomerAgencyEntity; -import com.epmet.service.Issue.DemoIssueService; import com.epmet.service.StatsDemoService; import com.epmet.service.org.DemoGovOrgService; import com.epmet.service.stats.DemoDataStatsService; @@ -23,19 +22,9 @@ public class StatsDemoServiceImpl implements StatsDemoService { @Autowired private DemoGovOrgService demoGovOrgService; - @Autowired - private DemoIssueService demoIssueService; - @Autowired private DemoDataStatsService demoDataStatsService; - @Override - public void testList() { - List agencies = demoGovOrgService.listAllEntities(); - List issues = demoIssueService.listAllEntities(); - System.out.println(666); - } - //该service不加事务 //@Transactional(rollbackFor = Exception.class) @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index d4b435a6d8..c435ec4720 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.impl; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.entity.crm.CustomerEntity; import com.epmet.entity.org.CustomerAgencyEntity; @@ -87,20 +88,15 @@ public class StatsDimServiceImpl implements StatsDimService { * @return */ private List convertCustomerGrid2GridDim(List grids) { - Date now = new Date(); return grids.stream().map(grid -> { DimGridEntity dimGrid = new DimGridEntity(); dimGrid.setAgencyId(grid.getPid()); dimGrid.setAreaCode(grid.getAreaCode()); dimGrid.setCustomerId(grid.getCustomerId()); dimGrid.setGridName(grid.getGridName()); - dimGrid.setCreatedBy("APP_USER"); - dimGrid.setCreatedTime(now); - dimGrid.setDelFlag("0"); + dimGrid.setCreatedBy(RobotConstant.DIMENSION_ROBOT); dimGrid.setId(grid.getId()); - dimGrid.setRevision(0); - dimGrid.setUpdatedBy("APP_USER"); - dimGrid.setUpdatedTime(now); + dimGrid.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); return dimGrid; }).collect(Collectors.toList()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java index 1cd1f4fc41..1737b3354b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimWeekService.java @@ -92,4 +92,6 @@ public interface DimWeekService extends BaseService { * @date 2020-06-16 */ void delete(String[] ids); + + void initWeekDim(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index bab14194e3..6f0c1b3046 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -23,6 +23,7 @@ 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.constant.RobotConstant; import com.epmet.dao.stats.DimAgencyDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; @@ -112,10 +113,9 @@ public class DimAgencyServiceImpl extends BaseServiceImpl agencies) { - Date now = new Date(); for (CustomerAgencyEntity agency : agencies) { DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); dimAgencyEntity.setAgencyName(agency.getOrganizationName()); @@ -124,14 +124,10 @@ public class DimAgencyServiceImpl extends BaseServiceImpl customers) { - Date now = new Date(); for (CustomerEntity customer : customers) { DimCustomerEntity dim = new DimCustomerEntity(); dim.setCustomerName(customer.getCustomerName()); - dim.setCreatedBy("APP_USER"); - dim.setCreatedTime(now); - dim.setUpdatedBy("APP_USER"); - dim.setUpdatedTime(now); - dim.setDelFlag("0"); - dim.setRevision(0); + dim.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dim.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); dim.setId(customer.getId()); - baseDao.insertOne(dim); + baseDao.insert(dim); } } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java index 8462972e2d..f6f0d9ee55 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimDateServiceImpl.java @@ -24,6 +24,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.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.stats.DimDateDTO; @@ -104,6 +105,7 @@ public class DimDateServiceImpl extends BaseServiceImpl gridDims) { for (DimGridEntity gridDim : gridDims) { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java index 1f09b868e9..d732bb5c47 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimMonthServiceImpl.java @@ -24,6 +24,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.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimMonthDao; import com.epmet.dto.stats.DimMonthDTO; @@ -108,7 +109,7 @@ public class DimMonthServiceImpl extends BaseServiceImpl implements DimWeekService { + @Autowired + private LastExecRecordService lastExecRecordService; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -97,4 +107,71 @@ public class DimWeekServiceImpl extends BaseServiceImpl Date: Fri, 19 Jun 2020 00:31:17 +0800 Subject: [PATCH 045/101] =?UTF-8?q?1.=E8=A7=A3=E5=86=B3=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/service/impl/StatsDemoServiceImpl.java | 3 --- 1 file changed, 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java index fe0d53cf8e..a549215ccd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDemoServiceImpl.java @@ -1,9 +1,6 @@ package com.epmet.service.impl; import com.epmet.dto.AgencySubTreeDto; -import com.epmet.entity.issue.IssueEntity; -import com.epmet.entity.org.CustomerAgencyEntity; -import com.epmet.service.Issue.DemoIssueService; import com.epmet.service.StatsDemoService; import com.epmet.service.org.DemoGovOrgService; import com.epmet.service.stats.DemoDataStatsService; From 80ad274a44cae65ed33c234061a1c1909fc1c96b Mon Sep 17 00:00:00 2001 From: wxz Date: Fri, 19 Jun 2020 09:41:27 +0800 Subject: [PATCH 046/101] =?UTF-8?q?1.=E4=BC=98=E5=8C=96=E7=BB=B4=E5=BA=A6?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/controller/DimController.java | 99 +++++++++++++++++-- .../com/epmet/dao/stats/DimAgencyDao.java | 2 + .../epmet/dao/stats/LastExecRecordDao.java | 10 ++ .../service/impl/StatsDimServiceImpl.java | 28 ++---- .../epmet/service/stats/DimAgencyService.java | 8 +- .../service/stats/DimCustomerService.java | 2 +- .../service/stats/DimDepartmentService.java | 2 +- .../epmet/service/stats/DimGridService.java | 7 +- .../stats/impl/DimAgencyServiceImpl.java | 12 ++- .../stats/impl/DimCustomerServiceImpl.java | 9 +- .../stats/impl/DimDepartmentServiceImpl.java | 12 ++- .../stats/impl/DimGridServiceImpl.java | 19 +++- .../resources/mapper/stats/DimAgencyDao.xml | 1 - .../mapper/stats/LastExecRecordDao.xml | 4 + 14 files changed, 173 insertions(+), 42 deletions(-) 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 8a4e4833f3..6efd8bf7da 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,9 +1,12 @@ package com.epmet.controller; +import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.AgencySubTreeDto; import com.epmet.service.StatsDimService; import com.epmet.service.stats.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -16,6 +19,8 @@ import java.util.List; @RequestMapping("dim") public class DimController { + Logger logger = LoggerFactory.getLogger(getClass()); + @Autowired private DimDateService dimDateService; @@ -37,8 +42,82 @@ public class DimController { @Autowired private DimAgencyService dimAgencyService; + /** + * 初始化所有维度 + * + * @return + */ + @PostMapping("/all/init") + public Result initAll() { + try { + dimDateService.initDimDate(); + logger.info("初始化按日维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化按日维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initGridDim(); + logger.info("初始化网格维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化网格维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initAgencyDim(); + logger.info("初始化机关维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化机关维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initCustomerDim(); + logger.info("初始化客户维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化客户维度失败:%s", errorStackTrace)); + } + try { + statsDimService.initDepartmentDim(); + logger.info("初始化部门维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化部门维度失败:%s", errorStackTrace)); + } + try { + dimMonthService.initMonthDim(); + logger.info("初始化按月维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化按月维度失败:%s", errorStackTrace)); + } + try { + quarterService.initQuarterDim(); + logger.info("初始化季度维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化季度维度失败:%s", errorStackTrace)); + } + try { + dimYearService.initYearDim(); + logger.info("初始化年度维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化年度维度失败:%s", errorStackTrace)); + } + try { + dimWeekService.initWeekDim(); + logger.info("初始化按周维度成功"); + } catch (Exception e) { + String errorStackTrace = ExceptionUtils.getErrorStackTrace(e); + logger.error(String.format("初始化按周维度失败:%s", errorStackTrace)); + } + return new Result(); + } + /** * 初始化按日维度 + * * @return */ @PostMapping("/date/init") @@ -49,6 +128,7 @@ public class DimController { /** * 初始化网格维度 + * * @return */ @PostMapping("/grid/init") @@ -59,6 +139,7 @@ public class DimController { /** * 初始化机关单位维度 + * * @return */ @PostMapping("/agency/init") @@ -69,6 +150,7 @@ public class DimController { /** * 客户维度 + * * @return */ @PostMapping("/customer/init") @@ -79,6 +161,7 @@ public class DimController { /** * 部门维度 + * * @return */ @PostMapping("/department/init") @@ -89,6 +172,7 @@ public class DimController { /** * 月维度 + * * @return */ @PostMapping("/month/init") @@ -99,6 +183,7 @@ public class DimController { /** * 季度维度 + * * @return */ @PostMapping("/quarter/init") @@ -109,6 +194,7 @@ public class DimController { /** * 年度维度 + * * @return */ @PostMapping("/year/init") @@ -119,6 +205,7 @@ public class DimController { /** * 按周维度 + * * @return */ @PostMapping("/week/init") @@ -128,26 +215,26 @@ public class DimController { } /** - * @Description 所有机构 * @param * @return + * @Description 所有机构 * @author wangc * @date 2020.06.18 10:34 - **/ + **/ @GetMapping("allagency") - public List allAgency(){ + public List allAgency() { return dimAgencyService.getAllAgency(); } /** - * @Description 顶级机构 * @param * @return + * @Description 顶级机构 * @author wangc * @date 2020.06.18 10:34 - **/ + **/ @GetMapping("topagency") - public List topAgency(){ + public List topAgency() { return dimAgencyService.getTopAgency(); } } 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 493fade14e..958df384be 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 @@ -25,6 +25,7 @@ import com.epmet.entity.stats.DimAgencyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.Date; import java.util.List; /** @@ -79,4 +80,5 @@ public interface DimAgencyDao extends BaseDao { * @return */ List getAgencyListByCustomerId(@Param("customerId") String customerId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java index b90c6c6856..b6adba1ec7 100755 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/LastExecRecordDao.java @@ -22,6 +22,8 @@ import com.epmet.entity.stats.LastExecRecordEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.Date; + /** * 最后一次执行记录表 * @@ -32,4 +34,12 @@ import org.apache.ibatis.annotations.Param; public interface LastExecRecordDao extends BaseDao { LastExecRecordEntity getLastExecRecord(@Param("statsSubject") String statsSubject); + + /** + * 更新统计主体的执行时间 + * @param date + * @param subject + * @return + */ + int updateExecTimeBySubject(@Param("date") Date date, @Param("subject") String subject); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java index c435ec4720..ff97cf767b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsDimServiceImpl.java @@ -55,11 +55,6 @@ public class StatsDimServiceImpl implements StatsDimService { @Override public void initGridDim() { - LastExecRecordEntity lastExecRecord = lastExecRecordService.getLastExecRecord(StatsSubject.DIM_GRID); - if (lastExecRecord == null) { - lastExecRecord = lastExecRecordService.createLastExecRecord(StatsSubject.DIM_GRID); - } - DimGridEntity lastCreatedGridDim = dimGridService.getLastCreatedGridDim(); List grids; if (lastCreatedGridDim == null) { @@ -68,17 +63,15 @@ public class StatsDimServiceImpl implements StatsDimService { } else { // 非首次初始化 // 结束时间边界与开始时间边界,包含开始时间不包含结束时间。结束时间可以为空,则查询从开始时间往后的所有新创建网格 - //Date endTimeBorder = DateUtils.parse(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD); Date startTimeBorder = DateUtils.parse(DateUtils.format(lastCreatedGridDim.getCreatedTime(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD); + Date endTimeBorder = DateUtils.parse(DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD), DateUtils.DATE_PATTERN_YYYYMMDD); - grids = customerGridService.listGridsByCreateTime(startTimeBorder, null); + grids = customerGridService.listGridsByCreateTime(startTimeBorder, endTimeBorder); } List gridDims = convertCustomerGrid2GridDim(grids); if (!CollectionUtils.isEmpty(gridDims)) { - dimGridService.addGridDims(gridDims); - lastExecRecord.setExecTime(new Date()); - lastExecRecordService.updateById(lastExecRecord); + dimGridService.initGridDims(gridDims); } } @@ -119,11 +112,7 @@ public class StatsDimServiceImpl implements StatsDimService { List agencies = customerAgencyService.listAgenciesByCreateTime(statsStartTime, statsEndTime); if (!CollectionUtils.isEmpty(agencies)) { - dimAgencyService.addAgencyDims(agencies); - lastExecRecord.setExecTime(new Date()); - - // 记录最后一次统计时间 - lastExecRecordService.updateById(lastExecRecord); + dimAgencyService.initAgencyDims(agencies); } } @@ -145,12 +134,7 @@ public class StatsDimServiceImpl implements StatsDimService { List customers = customerService.listValidCustomersByCreateTime(statsStartTime, statsEndTime); if (!CollectionUtils.isEmpty(customers)) { - dimCustomerService.addCustomerDims(customers); - - lastExecRecord.setExecTime(new Date()); - - // 记录最后一次统计时间 - lastExecRecordService.updateById(lastExecRecord); + dimCustomerService.initCustomerDims(customers); } } @@ -169,7 +153,7 @@ public class StatsDimServiceImpl implements StatsDimService { List departments = departmentService.listDepartmentsByCreatedTime(statsStartTime, statsEndTime); if (!CollectionUtils.isEmpty(departments)) { - dimDepartmentService.addDepartmentDims(departments); + dimDepartmentService.initDepartmentDims(departments); lastExecRecord.setExecTime(new Date()); // 记录最后一次统计时间 lastExecRecordService.updateById(lastExecRecord); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index 8de5b0045f..17b8076777 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -24,6 +24,7 @@ import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; import com.epmet.entity.stats.DimAgencyEntity; +import java.util.Date; import java.util.List; import java.util.Map; @@ -103,7 +104,11 @@ public interface DimAgencyService extends BaseService { **/ List getDimAgencyList(DimAgencyDTO dto); - void addAgencyDims(List agencies); + /** + * 初始化机关维度 + * @param agencies + */ + void initAgencyDims(List agencies); /** * @Description 查询所有机关以及它下级机关的信息 @@ -132,4 +137,5 @@ public interface DimAgencyService extends BaseService { * @author: jianjun liu */ List getAgencyListByCustomerId(String customerId); + } \ 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 85e7c06202..a2d7aadaf5 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 @@ -111,5 +111,5 @@ public interface DimCustomerService extends BaseService { * 添加客户维度 * @param customers */ - void addCustomerDims(List customers); + void initCustomerDims(List customers); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java index 8ae4e1e1bd..7bf0b63b7c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimDepartmentService.java @@ -94,7 +94,7 @@ public interface DimDepartmentService extends BaseService { */ void delete(String[] ids); - void addDepartmentDims(List departments); + void initDepartmentDims(List departments); /** * desc: 根据客户Id获取 部门数据 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 c6105c9570..c31774399f 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 @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.stats.DimGridDTO; import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.LastExecRecordEntity; import java.util.List; import java.util.Map; @@ -95,7 +96,11 @@ public interface DimGridService extends BaseService { DimGridEntity getLastCreatedGridDim(); - void addGridDims(List gridDims); + /** + * 初始化网格维度 + * @param gridDims + */ + void initGridDims(List gridDims); /** * desc: 根据客户Id获取 该客户下所有的网格数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 26a692d594..af550d986c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -26,7 +26,9 @@ import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; import com.epmet.constant.RobotConstant; +import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimAgencyDao; +import com.epmet.dao.stats.LastExecRecordDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; @@ -52,6 +54,9 @@ import java.util.stream.Collectors; @Service public class DimAgencyServiceImpl extends BaseServiceImpl implements DimAgencyService { + @Autowired + private LastExecRecordDao lastExecRecordDao; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -115,10 +120,9 @@ public class DimAgencyServiceImpl extends BaseServiceImpl agencies) { - Date now = new Date(); + public void initAgencyDims(List agencies) { for (CustomerAgencyEntity agency : agencies) { DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); dimAgencyEntity.setAgencyName(agency.getOrganizationName()); @@ -132,6 +136,8 @@ public class DimAgencyServiceImpl extends BaseServiceImpl implements DimCustomerService { + @Autowired + private LastExecRecordDao lastExecRecordDao; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -114,7 +120,7 @@ public class DimCustomerServiceImpl extends BaseServiceImpl customers) { + public void initCustomerDims(List customers) { for (CustomerEntity customer : customers) { DimCustomerEntity dim = new DimCustomerEntity(); dim.setCustomerName(customer.getCustomerName()); @@ -123,5 +129,6 @@ public class DimCustomerServiceImpl extends BaseServiceImpl implements DimDepartmentService { + @Autowired + private LastExecRecordDao lastExecRecordDao; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -103,8 +109,7 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl departments) { - Date now = new Date(); + public void initDepartmentDims(List departments) { for (CustomerDepartmentEntity department : departments) { DimDepartmentEntity dim = new DimDepartmentEntity(); dim.setAgencyId(department.getAgencyId()); @@ -115,9 +120,10 @@ public class DimDepartmentServiceImpl extends BaseServiceImpl getDepartmentListByCustomerId(String customerId) { if (StringUtils.isBlank(customerId)){ log.warn("getDepartmentListByCustomerId param is blank "); 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 e84059cc38..1caeb9d473 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 @@ -25,15 +25,21 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.page.PageData; import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimGridDao; +import com.epmet.dao.stats.LastExecRecordDao; import com.epmet.dto.stats.DimGridDTO; import com.epmet.entity.stats.DimGridEntity; +import com.epmet.entity.stats.LastExecRecordEntity; import com.epmet.service.stats.DimGridService; +import com.epmet.service.stats.LastExecRecordService; 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.Date; import java.util.List; import java.util.Map; @@ -46,6 +52,9 @@ import java.util.Map; @Service public class DimGridServiceImpl extends BaseServiceImpl implements DimGridService { + @Autowired + private LastExecRecordDao lastExecRecordDao; + @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -103,15 +112,21 @@ public class DimGridServiceImpl extends BaseServiceImpl gridDims) { + public void initGridDims(List gridDims) { for (DimGridEntity gridDim : gridDims) { baseDao.insert(gridDim); } + + lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_GRID); } - @Override + @Override public List getGridListByCustomerId(String customerId) { if (StringUtils.isBlank(customerId)){ throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); 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 ad8ed78057..4c9d2a1dbb 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 @@ -9,7 +9,6 @@ VALUE (#{id}, #{agencyName}, #{customerId}, #{pid}, #{pids}, #{allParentName}, #{level}, #{delFlag}, #{revision}, #{createdBy}, #{createdTime}, #{updatedBy}, #{updatedTime}) - + + + UPDATE last_exec_record SET EXEC_TIME = #{date} WHERE SUBJECT = #{subject} + \ No newline at end of file From e36a4059567bfb0f91287c2e07b20e2e0688a6e7 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 19 Jun 2020 09:54:10 +0800 Subject: [PATCH 047/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E6=9C=BA=E5=85=B3=E6=97=A5=E3=80=81=E6=9C=88=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=80=BB=E8=BE=91=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatsProjectServiceImpl.java | 98 +++++++++++-------- .../resources/mapper/project/ProjectDao.xml | 5 +- 2 files changed, 58 insertions(+), 45 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index a5d07f16f5..b06f38e15c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -98,13 +98,14 @@ public class StatsProjectServiceImpl implements StatsProjectService { //1:查询各维度表Id,方便使用 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay()); - //2:根据客户Id查询项目业务表数据(查询当前日期之前的数据不包含当天的) + //2:根据客户Id查询项目业务表已结案数据(查询当前日期之前的数据不包含当天的) ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(yesterDay()); + projectEntity.setStatus(ProjectConstant.CLOSED); List projectList = projectService.getProjectList(projectEntity); - //3:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的) + //3:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的) List processList = projectProcessService.getProcessList(projectEntity); //4:遍历统计每个机关各项指标数 @@ -126,56 +127,69 @@ public class StatsProjectServiceImpl implements StatsProjectService { }); //机关下截止当前日期的项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 AtomicInteger projectTotal = new AtomicInteger(0); - AtomicInteger pendingTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger resolvedTotal = new AtomicInteger(0); AtomicInteger unResolvedTotal = new AtomicInteger(0); - //存放当前机关及下级已结案切已解决的项目信息 - Map resolvedMap = new HashMap<>(); - //存放当前机关及下级已结案切未解决的项目信息 - Map unResolvedMap = new HashMap<>(); - //遍历项目数据,统计不同数据值 - projectList.forEach(project -> { - if (map.containsKey(project.getAgencyId())) { - projectTotal.addAndGet(1); - if (ProjectConstant.PENDING.equals(project.getStatus())) { - pendingTotal.addAndGet(1); - } - if (ProjectConstant.CLOSED.equals(project.getStatus())) { - closedTotal.addAndGet(1); - if (ProjectConstant.RESOLVED.equals(project.getClosedStatus())) { - resolvedTotal.addAndGet(1); - resolvedMap.put(project.getAgencyId(), project.getClosedStatus()); - } - if (ProjectConstant.UNRESOLVED.equals(project.getClosedStatus())) { - unResolvedTotal.addAndGet(1); - unResolvedMap.put(project.getAgencyId(), project.getClosedStatus()); - } - } - } - }); //日增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 - AtomicInteger pendingIncr = new AtomicInteger(0); + AtomicInteger projectIncr = new AtomicInteger(0); AtomicInteger closedIncr = new AtomicInteger(0); AtomicInteger resolvedIncr = new AtomicInteger(0); AtomicInteger unResolvedIncr = new AtomicInteger(0); - //遍历项目进展列表数据,统计日增量数据 + //存放已结案项目Id,用于统计已结案中已解决未解决数 + Map closeMap = new HashMap<>(); + //存放前一日已结案项目Id,用于统计日增量中已结案项目的已解决、未解决数量 + Map closeDateMap = new HashMap<>(); + //遍历进展数据,统计截止当日的项目总量、处理中总量、已结案总量以及日增量中的项目总量、处理中总量、已结案总量 processList.forEach(process -> { - if (map.containsKey(process.getAgencyId()) && date.equals(process.getCreatedTime())) { + //当前机关及下级 + if (map.containsKey(process.getAgencyId())) { + //进展表中是创建项目状态的数据总数即为客户该机关下项目总数 if (ProjectConstant.CREATED.equals(process.getOperation())) { - pendingIncr.addAndGet(1); + projectTotal.addAndGet(1); + if (date.equals(process.getCreatedTime())) { + //日增量总数 + projectIncr.addAndGet(1); + } } if (ProjectConstant.CLOSE.equals(process.getOperation())) { - closedIncr.addAndGet(1); - } - if (resolvedMap.containsKey(process.getAgencyId())) { - resolvedIncr.addAndGet(1); + //截止当前日期的结案总数 + closedTotal.addAndGet(1); + closeMap.put(process.getProjectId(), process.getProjectId()); + if (date.equals(process.getCreatedTime())) { + //日增量已结案总数 + closedIncr.addAndGet(1); + closeDateMap.put(process.getProjectId(), process.getProjectId()); + } } - if (unResolvedMap.containsKey(process.getAgencyId())) { - unResolvedIncr.addAndGet(1); + } + }); + //遍历项目业务数据,统计截止当日的已结案已解决总量、已结案未解决总量以及日增量中的已结案已解决总量、已结案未解决总量 + projectList.forEach(project -> { + //当前机关及下级 + if (map.containsKey(project.getAgencyId())) { + if (closeMap.containsKey(project.getId())) { + //已结案已解决 + if (ProjectConstant.RESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案已解决总量 + resolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案已解决总量 + resolvedIncr.addAndGet(1); + } + } + //已结案未解决 + if (ProjectConstant.UNRESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案未解决总量 + unResolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案未解决总量 + unResolvedIncr.addAndGet(1); + } + } } } }); + //封装日数据对象 FactAgencyProjectDailyEntity agencyDailyEntity = new FactAgencyProjectDailyEntity(); agencyDailyEntity.setCustomerId(customerId); @@ -186,20 +200,20 @@ public class StatsProjectServiceImpl implements StatsProjectService { agencyDailyEntity.setMonthId(dimId.getMonthId()); agencyDailyEntity.setYearId(dimId.getYearId()); agencyDailyEntity.setProjectTotal(projectTotal.intValue()); - agencyDailyEntity.setPendingTotal(pendingTotal.intValue()); + agencyDailyEntity.setPendingTotal(projectTotal.intValue() - closedTotal.intValue()); agencyDailyEntity.setClosedTotal(closedTotal.intValue()); agencyDailyEntity.setResolvedTotal(resolvedTotal.intValue()); agencyDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); if (projectTotal.intValue() > NumConstant.ZERO) { - agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) pendingTotal.intValue() / (float) projectTotal.intValue() * 100))); + agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100))); agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100))); } if (closedTotal.intValue() > NumConstant.ZERO) { agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); } - agencyDailyEntity.setProjectIncr(pendingIncr.intValue() + closedIncr.intValue()); - agencyDailyEntity.setPendingIncr(pendingIncr.intValue()); + agencyDailyEntity.setProjectIncr(projectIncr.intValue()); + agencyDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); agencyDailyEntity.setClosedIncr(closedIncr.intValue()); agencyDailyEntity.setResolvedIncr(resolvedIncr.intValue()); agencyDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); @@ -330,7 +344,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { //1:查询各维度表Id,方便使用 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay()); - //2:根据客户Id查询项目业务表数据(查询当前日期之前的数据不包含当天的) + //2:根据客户Id查询项目业务表已结案数据(查询当前日期之前的数据不包含当天的) ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(yesterDay()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index 17972e738b..ef57855903 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -10,9 +10,8 @@ project WHERE del_flag = '0' - - AND customer_id = #{customerId} - + AND customer_id = #{customerId} + AND status = #{status} ORDER BY created_time DESC From 3823da70af9abd17afafc6c4df76d69c84865498 Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 19 Jun 2020 15:19:36 +0800 Subject: [PATCH 048/101] =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/DataSourceConstant.java | 1 + .../com/epmet/dto/AgencySubDeptTreeDto.java | 61 ++++ .../CommonTotalAndIncCountResultDTO.java | 20 ++ .../data-statistical-server/pom.xml | 8 +- .../com/epmet/controller/DimController.java | 26 ++ .../com/epmet/dao/stats/DimAgencyDao.java | 28 ++ .../main/java/com/epmet/dao/user/UserDao.java | 86 +++++ .../epmet/service/stats/DimAgencyService.java | 21 ++ .../stats/impl/DimAgencyServiceImpl.java | 28 ++ .../com/epmet/service/user/UserService.java | 15 +- .../service/user/impl/UserServiceImpl.java | 206 ++++++++++- .../java/com/epmet/util/DimIdGenerator.java | 1 - .../java/com/epmet/util/ModuleConstant.java | 19 ++ .../src/main/resources/bootstrap.yml | 5 + .../resources/mapper/stats/DimAgencyDao.xml | 101 ++++++ .../main/resources/mapper/user/UserDao.xml | 323 ++++++++++++++++++ 16 files changed, 939 insertions(+), 10 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubDeptTreeDto.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CommonTotalAndIncCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.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 196aa19dcf..920fc14e14 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 @@ -9,5 +9,6 @@ public interface DataSourceConstant { String GOV_VOICE = "govVoice"; String OPER_CRM = "operCrm"; String RESI_GROUP = "resiGroup"; + String EPMET_USER = "epmetuser"; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubDeptTreeDto.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubDeptTreeDto.java new file mode 100644 index 0000000000..c854859bc6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/AgencySubDeptTreeDto.java @@ -0,0 +1,61 @@ +package com.epmet.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description + * @ClassName AgencySubDeptTreeDto + * @Auth wangc + * @Date 2020-06-18 16:06 + */ +@Data +public class AgencySubDeptTreeDto implements Serializable { + private static final long serialVersionUID = -8179035699122094719L; + /** + * 机构Id + * */ + private String agencyId; + + /** + * 机构名称 + * */ + private String agencyName; + + /** + * 直属网格Id + * */ + List gridIds; + + /** + * 直属部门Id + * */ + List deptIds; + + /** + * 客户Id + * */ + String customerId; + + /** + * 父级机关Id,当为最顶层是pid为0 + * */ + String pid; + + /** + * 级别 + * 社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province + * */ + String level; + + /** + * 下级机关集合 + * */ + List subAgencies; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CommonTotalAndIncCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CommonTotalAndIncCountResultDTO.java new file mode 100644 index 0000000000..7296a1b236 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/user/result/CommonTotalAndIncCountResultDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName CommonTotalAndIncCountResultDTO + * @Auth wangc + * @Date 2020-06-18 17:28 + */ +@Data +public class CommonTotalAndIncCountResultDTO implements Serializable { + private static final long serialVersionUID = -5215017168317858826L; + + private Integer total; + + private Integer incr; +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 93bf1c3703..74787dff5d 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -141,13 +141,19 @@ epmet_resi_group_user EpmEt-db-UsEr + + + + epmet_user_user + EpmEt-db-UsEr + 0 192.168.1.130 6379 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b 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 6efd8bf7da..2d0cd77530 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 @@ -2,6 +2,7 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.ExceptionUtils; import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; import com.epmet.service.StatsDimService; import com.epmet.service.stats.*; @@ -237,4 +238,29 @@ public class DimController { public List topAgency() { return dimAgencyService.getTopAgency(); } + + /** + * @Description 所有机构 - 带部门 + * @param + * @return + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("allagencydept") + public List allAgencyDept(){ + return dimAgencyService.getAllAgencyWithDept(); + } + + /** + * @Description 顶级机构 - 带部门 + * @param + * @return + * @author wangc + * @date 2020.06.18 10:34 + **/ + @GetMapping("topagencydept") + public List topAgencyDept(){ + return dimAgencyService.getTopAgencyWithDept(); + } + } 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 958df384be..f4d1477562 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 @@ -19,6 +19,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.stats.DimAgencyDTO; import com.epmet.entity.stats.DimAgencyEntity; @@ -81,4 +82,31 @@ public interface DimAgencyDao extends BaseDao { */ List getAgencyListByCustomerId(@Param("customerId") String customerId); + + /** + * @Description 带部门 获取所有机关 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectAllAgencyWithDept(); + + /** + * @Description 带部门 根据PID获取下级机关 + * @param pid + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectSubAgencyWithDeptByPid(@Param("pid")String pid); + + /** + * @Description 带部门 获取顶层级机关机关 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:26 + **/ + List selectTopAgencyWithDept(); } \ No newline at end of file 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 88cf420e8a..d96d1787e1 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,6 +1,12 @@ package com.epmet.dao.user; +import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; +import java.util.Set; /** * 用户Dao EpmetUser @@ -11,4 +17,84 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface UserDao { + /** + * @Description 查询注册用户的总量与增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + CommonTotalAndIncCountResultDTO selectResiTotalAndIncrByLevel(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate")Date targetDate); + + /** + * @Description 查询党员的总量与增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + CommonTotalAndIncCountResultDTO selectPartyTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询热心居民的总量与增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + CommonTotalAndIncCountResultDTO selectWarmTotalAndIncr(@Param("userIds") List userIds, @Param("incrUserIds") List incrUserIds, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询指定网格范围下单位时间内新增的注册用户Id + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + List selectIncrUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询指定网格范围下截至指定位时间累计的注册用户Id + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + List selectTotalUserIds(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("targetDate") Date targetDate); + + /** + * @Description 查询指定时间范围内网格新增的注册/参与用户Id + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + List selectIncrUserIdsWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询指定时间范围内注册/参与用户增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + Integer selectResiIncrWithinTimeRange(@Param("regOrPartiFlag") String regOrPartiFlag, @Param("gridIds") Set gridIds, @Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询指定时间范围内党员的增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + Integer selectPartyIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); + + /** + * @Description 查询指定时间范围内热心居民的增量 + * @param + * @return + * @author wangc + * @date 2020.06.18 18:50 + **/ + Integer selectWarmIncrWithinTimeRange(@Param("incrUserIds")List incrUserIds,@Param("gridIds") Set gridIds,@Param("startDate")Date startDate,@Param("endDate")Date endDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index 17b8076777..fe9fbd9765 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -19,6 +19,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; @@ -138,4 +139,24 @@ public interface DimAgencyService extends BaseService { */ List getAgencyListByCustomerId(String customerId); + + + /** + * @Description 带部门 查询所有机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getAllAgencyWithDept(); + + + /** + * @Description 带部门 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + List getTopAgencyWithDept(); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index af550d986c..0c86f00ef4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -29,6 +29,7 @@ import com.epmet.constant.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimAgencyDao; import com.epmet.dao.stats.LastExecRecordDao; +import com.epmet.dto.AgencySubDeptTreeDto; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.org.CustomerAgencyEntity; @@ -173,4 +174,31 @@ public class DimAgencyServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getAllAgencyWithDept() { + return baseDao.selectAllAgencyWithDept(); + } + + + /** + * @Description 带部门 查询顶级机关以及它下级机关的信息 + * @param + * @return List + * @author wangc + * @date 2020.06.18 09:45 + **/ + @Override + public List getTopAgencyWithDept() { + return baseDao.selectTopAgencyWithDept(); + } + } \ No newline at end of file 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 71e2911e5b..3f20d2a9e7 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 @@ -2,6 +2,7 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; +import java.util.Date; import java.util.List; import java.util.Map; @@ -9,11 +10,19 @@ public interface UserService { /** * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 - * @param regOrPartiFlag - String - * @parma agencies - Map> + * @param topAgencies - List * @return * @author wangc * @date 2020.06.18 10:03 **/ - void traverseAgencyUser(String regOrPartiFlag,Map>agencies); + void traverseAgencyUser(List topAgencies, Date targetDate); + + /** + * @Description 遍历所有机关的直属网格统计注册用户参与用户的数据 + * @param agencies - List + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + void traverseGridUser(List agencies, Date targetDate); } 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 6737398a52..6ac8e6294b 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 @@ -1,11 +1,22 @@ 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.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import com.epmet.service.user.UserService; +import com.epmet.util.ModuleConstant; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; -import java.util.Map; +import java.text.SimpleDateFormat; +import java.util.*; +import java.util.stream.Collectors; /** * @Description 直连epmet-user @@ -13,19 +24,204 @@ import java.util.Map; * @Auth wangc * @Date 2020-06-18 09:55 */ +@DataSource(DataSourceConstant.EPMET_USER) @Service public class UserServiceImpl implements UserService { + private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + + @Autowired + private UserDao userDao; + /** * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 - * @param regOrPartiFlag - String - * @parma agencies - Map> + * @param topAgencies - List + * @return + * @author wangc + * @date 2020.06.18 10:03 + **/ + @Override + public void traverseAgencyUser(List topAgencies, Date targetDate) { + if(null == topAgencies || topAgencies.size() == NumConstant.ZERO){ + logger.warn("没有相应的机关集合"); + return ; + } + //自上向下检索 + //Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + Map> subGridOfAgency = new HashMap<>(); + topAgencies.forEach(agency -> { + initAgencyGridMap(agency,subGridOfAgency); + }); + + //对每一个机关进行数据统计 + if(subGridOfAgency.size() > NumConstant.ZERO){ + subGridOfAgency.forEach((k,v) -> { + queryUserData(v,targetDate); + }); + } + + } + + /** + * @Description 遍历所有机关的直属网格统计注册用户参与用户的数据 + * @param agencies - List * @return * @author wangc * @date 2020.06.18 10:03 **/ @Override - public void traverseAgencyUser(String regOrPartiFlag, Map> agencies) { + public void traverseGridUser(List agencies, Date targetDate) { + if(null == agencies || agencies.size() == NumConstant.ZERO){ + logger.warn("没有相应的机关集合"); + return ; + } + //自上向下检索 + Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + if(null != agencyMap && agencyMap.size() > NumConstant.ZERO){ + agencyMap.forEach((k,v) -> { + if(null != v && v.size() > NumConstant.ZERO){ + queryUserData(new HashSet<>(v.get(NumConstant.ZERO).getGridIds()),targetDate); + } + }); + } + } + + /** + * @Description 初始化机关-所有下级网格Map + * @param agency - AgencySubTreeDto + * @param subGridOfAgency - Map> + * @return + * @author wangc + * @date 2020.06.18 15:54 + **/ + void initAgencyGridMap(AgencySubTreeDto agency, Map> subGridOfAgency){ + //向map中放入数据 + if(subGridOfAgency.containsKey(agency.getAgencyId())){ + //包含key + Set grids = subGridOfAgency.get(agency.getAgencyId()); + if(null == grids){ + grids = new HashSet<>(); + subGridOfAgency.put(agency.getAgencyId(),grids); + } + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + grids.addAll(agency.getGridIds()); + } + }else{ + //不包含key + Set grids = new HashSet<>(agency.getGridIds()); + subGridOfAgency.put(agency.getAgencyId(),grids); + } + + //定义递归出口 + if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ + return ; + } + + //定义递归入口 + agency.getSubAgencies().forEach(obj -> { + initAgencyGridMap(obj,subGridOfAgency); + }); + } + + /** + * @Description 执行查询用户数据统计的逻辑 + * @param gridIds - 机关下所有网格集合/机关下直属网格集合 + * @param targetDate + * @return + * @author wangc + * @date 2020.06.19 10:01 + **/ + void queryUserData(Set gridIds,Date targetDate){ + //默认查询注册用户 + + //1.计算机关下注册用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO regData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate); + //2.查询注册用户的Id列表 + List incrRegUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate); + List totalRegUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO warmRegData = + userDao.selectWarmTotalAndIncr(totalRegUsers,incrRegUsers,gridIds,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO partyRegData = + userDao.selectPartyTotalAndIncr(totalRegUsers,incrRegUsers,targetDate); + + + //参与用户 + //1.计算机关下参与用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO partiData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate); + //2.查询参与用户的Id列表 + List incrPartiUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate); + List totalPartiUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO warmPartiData = + userDao.selectWarmTotalAndIncr(totalPartiUsers,incrPartiUsers,gridIds,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO partyPartiData = + userDao.selectPartyTotalAndIncr(totalPartiUsers,incrPartiUsers,targetDate); + + + Calendar calendar =Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.add(Calendar.DATE, NumConstant.ONE_NEG); + Date targetDateCheck = null == targetDate ? calendar.getTime() : targetDate; + + calendar.setTime(targetDateCheck); + //如果目标日期是当月的最后一天 + if(calendar.get(Calendar.DATE) == calendar.getActualMaximum(Calendar.DAY_OF_MONTH)){ + //求出这个月的第一天 + calendar.setTime(new Date()); + calendar.set(Calendar.DAY_OF_MONTH, NumConstant.ONE); + calendar.set(Calendar.HOUR_OF_DAY, NumConstant.ZERO); + calendar.set(Calendar.MINUTE, NumConstant.ZERO); + calendar.set(Calendar.SECOND, NumConstant.ZERO); + + //本月注册用户增长数 + Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck); + //本月新增注册用户Id集合 + List incrRegIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,gridIds,calendar.getTime(),targetDateCheck); + //本月新增党员数(注册用户) + Integer incrPartyOfRegMonthly = userDao.selectPartyIncrWithinTimeRange(incrRegIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(注册用户) + Integer incrWarmOfRegMonthly = userDao.selectWarmIncrWithinTimeRange(incrRegIdsMonthly,gridIds,calendar.getTime(),targetDateCheck); + + + //本月参与用户增长数 + Integer partiIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck); + //本月新增参与用户Id集合 + List incrPartiIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,gridIds,calendar.getTime(),targetDateCheck); + //本月新增党员数(参与用户) + Integer incrPartyOfPartiMonthly = userDao.selectPartyIncrWithinTimeRange(incrPartiIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(参与用户) + Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,gridIds,calendar.getTime(),targetDateCheck); + + } + } + + public static void main(String[] args) { + + SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + SimpleDateFormat format2 = new SimpleDateFormat("yyyy-MM-dd"); + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.set(Calendar.DAY_OF_MONTH, 1); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + System.out.println(format.format(calendar.getTime())); + + + calendar.setTime(calendar.getTime()); + calendar.add(Calendar.DATE, -1); + System.out.println(calendar.getTime()); + System.out.println(format.format(calendar.getTime())); + System.out.println(format2.format(calendar.getTime())); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java index 9a2d5ce6e8..35e1f6d99b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/DimIdGenerator.java @@ -75,7 +75,6 @@ public class DimIdGenerator { public static void main(String[] args) { DimIdBean dimIdBean = getDimIdBean(DateUtils.stringToDate("2020-06-14",DateUtils.DATE_PATTERN)); System.out.println(dimIdBean); - } @Data diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java new file mode 100644 index 0000000000..1ef0b26a51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/util/ModuleConstant.java @@ -0,0 +1,19 @@ +package com.epmet.util; + +public interface ModuleConstant { + + /** + * 注册用户标识 + * */ + String REG_OR_PARTI_FLAG_REG = "reg"; + + /** + * 参与用户标识 + * */ + String REG_OR_PARTI_FLAG_PARTI = "parti"; + + /** + * 机关级别-社区 + * */ + String AGENCY_LEVEL_COMMUNITY = "community"; +} 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 3bed21f9fe..ad6caadfa5 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 @@ -150,6 +150,11 @@ dynamic: url: @datasource.druid.group.url@ username: @datasource.druid.group.username@ password: @datasource.druid.group.password@ + epmetuser: + driver-class-name: com.mysql.cj.jdbc.Driver + url: @datasource.druid.user.url@ + username: @datasource.druid.user.username@ + password: @datasource.druid.user.password@ thread: # 线程池配置 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 4c9d2a1dbb..d139aff3ee 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 @@ -115,4 +115,105 @@ AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ 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 new file mode 100644 index 0000000000..91dc279ec1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -0,0 +1,323 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + From 4b4491588c7c28576da9a56e9736584aebe1bf5d Mon Sep 17 00:00:00 2001 From: wangchao Date: Fri, 19 Jun 2020 15:54:01 +0800 Subject: [PATCH 049/101] =?UTF-8?q?=E6=9F=A5=E8=AF=A2agency=E7=9A=84?= =?UTF-8?q?=E6=89=80=E6=9C=89=E4=B8=8B=E7=BA=A7=E7=BD=91=E6=A0=BCId?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/user/impl/UserServiceImpl.java | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) 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 6ac8e6294b..cef6dbe508 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 @@ -35,22 +35,22 @@ public class UserServiceImpl implements UserService { /** * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 - * @param topAgencies - List + * @param agencies - List * @return * @author wangc * @date 2020.06.18 10:03 **/ @Override - public void traverseAgencyUser(List topAgencies, Date targetDate) { - if(null == topAgencies || topAgencies.size() == NumConstant.ZERO){ + public void traverseAgencyUser(List agencies, Date targetDate) { + if(null == agencies || agencies.size() == NumConstant.ZERO){ logger.warn("没有相应的机关集合"); return ; } //自上向下检索 //Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); Map> subGridOfAgency = new HashMap<>(); - topAgencies.forEach(agency -> { - initAgencyGridMap(agency,subGridOfAgency); + agencies.forEach(agency -> { + initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); }); //对每一个机关进行数据统计 @@ -86,6 +86,7 @@ public class UserServiceImpl implements UserService { } } + /** * @Description 初始化机关-所有下级网格Map * @param agency - AgencySubTreeDto @@ -93,15 +94,16 @@ public class UserServiceImpl implements UserService { * @return * @author wangc * @date 2020.06.18 15:54 - **/ - void initAgencyGridMap(AgencySubTreeDto agency, Map> subGridOfAgency){ + **/ + void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ + //向map中放入数据 - if(subGridOfAgency.containsKey(agency.getAgencyId())){ + if(subGridOfAgency.containsKey(pid)){ //包含key - Set grids = subGridOfAgency.get(agency.getAgencyId()); + Set grids = subGridOfAgency.get(pid); if(null == grids){ grids = new HashSet<>(); - subGridOfAgency.put(agency.getAgencyId(),grids); + subGridOfAgency.put(pid,grids); } if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ grids.addAll(agency.getGridIds()); @@ -109,7 +111,7 @@ public class UserServiceImpl implements UserService { }else{ //不包含key Set grids = new HashSet<>(agency.getGridIds()); - subGridOfAgency.put(agency.getAgencyId(),grids); + subGridOfAgency.put(pid,grids); } //定义递归出口 @@ -117,9 +119,10 @@ public class UserServiceImpl implements UserService { return ; } + //定义递归入口 agency.getSubAgencies().forEach(obj -> { - initAgencyGridMap(obj,subGridOfAgency); + initAgencyGridMap(pid,obj,subGridOfAgency); }); } From 726abed1bd299919573287446031a9bf683d6239 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 19 Jun 2020 18:06:30 +0800 Subject: [PATCH 050/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=97=A5=E3=80=81=E6=9C=88=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/form/MonthProjectListFormDTO.java | 5 + .../dto/stats/FactAgencyProjectDailyDTO.java | 5 + .../dto/stats/FactGridProjectDailyDTO.java | 14 +- .../controller/StatsProjectController.java | 22 +- .../com/epmet/dao/issue/StatsIssueDao.java | 7 + .../dao/stats/FactGridProjectDailyDao.java | 19 +- .../dao/stats/FactGridProjectMonthlyDao.java | 8 +- .../com/epmet/entity/issue/IssueEntity.java | 5 + .../stats/FactAgencyProjectDailyEntity.java | 5 + .../stats/FactGridProjectDailyEntity.java | 14 +- .../com/epmet/service/Issue/IssueService.java | 9 + .../service/Issue/impl/IssueServiceImpl.java | 15 + .../epmet/service/StatsProjectService.java | 15 +- .../service/impl/StatsProjectServiceImpl.java | 413 +++++++++++++----- .../impl/ProjectProcessServiceImpl.java | 3 + .../stats/FactGridProjectDailyService.java | 17 + .../stats/FactGridProjectMonthlyService.java | 6 + .../impl/FactGridProjectDailyServiceImpl.java | 22 + .../FactGridProjectMonthlyServiceImpl.java | 10 +- .../resources/mapper/issue/StatsIssueDao.xml | 15 + .../mapper/project/ProjectProcessDao.xml | 3 +- .../resources/mapper/stats/DimAgencyDao.xml | 8 +- .../mapper/stats/FactGridProjectDailyDao.xml | 24 + .../stats/FactGridProjectMonthlyDao.xml | 10 +- 24 files changed, 516 insertions(+), 158 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java index 4b47eb0237..73045ccb3c 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java @@ -24,6 +24,11 @@ public class MonthProjectListFormDTO implements Serializable { */ private String agencyId; + /** + * 网格Id + */ + private String gridId; + /** * 起始时间 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java index 04ae53b189..2a7e853f3a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactAgencyProjectDailyDTO.java @@ -69,6 +69,11 @@ public class FactAgencyProjectDailyDTO implements Serializable { */ private String monthId; + /** + * 季ID + */ + private String quarterId; + /** * 年维度Id 【dim_year.id】 */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java index eb25380fb9..e1962507f8 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactGridProjectDailyDTO.java @@ -69,6 +69,16 @@ public class FactGridProjectDailyDTO implements Serializable { */ private String monthId; + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + /** * 截止当日网格下项目总数 【当前组织及下级项目总数】 */ @@ -127,7 +137,7 @@ public class FactGridProjectDailyDTO implements Serializable { /** * 当日网格下项目总数 【该网格下项目总数】 */ - private Integer gridIncr; + private Integer projectIncr; /** * 当日网格下处理中项目数 【该网格下未结案项目总数】 @@ -137,7 +147,7 @@ public class FactGridProjectDailyDTO implements Serializable { /** * 当日网格下已结案项目数 【该网格下已结案项目总数】 */ - private String closedIncr; + private Integer closedIncr; /** * 删除标识 【0.未删除 1.已删除】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java index 5a09fd0ba7..7d6c958d66 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java @@ -18,26 +18,12 @@ public class StatsProjectController { private StatsProjectService statsProjectService; /** - * @param customerId - * @return * @Author sun - * @Description 数据-项目-机关日(月)统计 + * @Description 数据-项目-机关、网格日(月)统计 **/ - @PostMapping("agencyproject/{customerId}") - public Result statsAgencyProject(@PathVariable("customerId") String customerId) { - statsProjectService.statsAgencyProject(customerId); - return new Result(); - } - - /** - * @param customerId - * @return - * @Author sun - * @Description 数据-项目-网格日(月)统计 - **/ - @PostMapping("gridproject/{customerId}") - public Result statsGridProject(@PathVariable("customerId") String customerId) { - statsProjectService.statsGridProject(customerId); + @PostMapping("projectstats") + public Result agencyGridProjectStats() { + statsProjectService.agencyGridProjectStats(); return new Result(); } 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 1b64aa85e8..4c23a2d833 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 @@ -52,4 +52,11 @@ public interface StatsIssueDao extends BaseDao { */ List selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + /** + * @param customerId + * @return + * @Author sun + * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 + **/ + List selectGridProjectList(@Param("customerId") String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java index bc4602ff38..eae7df214a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectDailyDao.java @@ -18,9 +18,13 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; import com.epmet.entity.stats.FactGridProjectDailyEntity; import org.apache.ibatis.annotations.Mapper; +import java.util.List; + /** * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 * @@ -29,5 +33,18 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactGridProjectDailyDao extends BaseDao { - + + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateProject(FactAgencyProjectDailyEntity delEntity); + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月网格日统计数据,按时间倒序 + **/ + List selectMonthProjectList(MonthProjectListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java index ea7b4c0353..e2ae56868e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGridProjectMonthlyDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; import com.epmet.entity.stats.FactGridProjectMonthlyEntity; import org.apache.ibatis.annotations.Mapper; @@ -29,5 +30,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactGridProjectMonthlyDao extends BaseDao { - + + /** + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + **/ + void delMonthProject(FactAgencyProjectMonthlyEntity delEntity); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueEntity.java index ffaba77c09..3982fb5798 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/issue/IssueEntity.java @@ -112,4 +112,9 @@ public class IssueEntity extends BaseEpmetEntity { */ private Date closedTime; + /** + * sun-项目id + */ + private String projectId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java index 2fbb30284a..9f609723f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactAgencyProjectDailyEntity.java @@ -69,6 +69,11 @@ public class FactAgencyProjectDailyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季ID + */ + private String quarterId; + /** * 年维度Id 【dim_year.id】 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java index 509217111d..93c1f71499 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactGridProjectDailyEntity.java @@ -69,6 +69,16 @@ public class FactGridProjectDailyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + /** * 截止当日网格下项目总数 【当前组织及下级项目总数】 */ @@ -127,7 +137,7 @@ public class FactGridProjectDailyEntity extends BaseEpmetEntity { /** * 当日网格下项目总数 【该网格下项目总数】 */ - private Integer gridIncr; + private Integer projectIncr; /** * 当日网格下处理中项目数 【该网格下未结案项目总数】 @@ -137,6 +147,6 @@ public class FactGridProjectDailyEntity extends BaseEpmetEntity { /** * 当日网格下已结案项目数 【该网格下已结案项目总数】 */ - private String closedIncr; + private Integer closedIncr; } 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 c5503ddefa..547ca461dd 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,6 +1,7 @@ package com.epmet.service.Issue; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.entity.issue.IssueEntity; import java.util.List; @@ -48,4 +49,12 @@ public interface IssueService { * @return java.util.List */ List getAgencyClosedIssueInc(String customerId, String date); + + /** + * @param customerId + * @return + * @Author sun + * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 + **/ + List getGridProjectList(String customerId); } 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 8b19129687..e939aa61dc 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 @@ -1,7 +1,10 @@ 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.issue.IssueAgencyDTO; +import com.epmet.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -14,6 +17,7 @@ import java.util.List; * @date 2020/6/17 16:02 */ @Service +@DataSource(DataSourceConstant.GOV_ISSUE) public class IssueServiceImpl implements IssueService { @Autowired @@ -58,4 +62,15 @@ public class IssueServiceImpl implements IssueService { }); return list; } + + /** + * @param customerId + * @return + * @Author sun + * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 + **/ + @Override + public List getGridProjectList(String customerId) { + return statsIssueDao.selectGridProjectList(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java index 75a71c1b38..996d4c6e7d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -6,20 +6,9 @@ package com.epmet.service; */ public interface StatsProjectService { - - /** - * @param customerId - * @return - * @Author sun - * @Description 数据-项目-机关日(月)统计 - **/ - void statsAgencyProject(String customerId); - /** - * @param customerId - * @return * @Author sun - * @Description 数据-项目-网格日(月)统计 + * @Description 数据-项目-机关、网格日(月)统计 **/ - void statsGridProject(String customerId); + void agencyGridProjectStats(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index b06f38e15c..c09e064258 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -4,23 +4,20 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dto.project.form.MonthProjectListFormDTO; import com.epmet.dto.stats.DimAgencyDTO; -import com.epmet.dto.stats.DimDateDTO; -import com.epmet.dto.stats.DimGridDTO; import com.epmet.entity.issue.IssueEntity; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; -import com.epmet.entity.stats.DimDateEntity; -import com.epmet.entity.stats.DimGridEntity; -import com.epmet.entity.stats.FactAgencyProjectDailyEntity; -import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; +import com.epmet.entity.stats.*; +import com.epmet.service.Issue.IssueService; import com.epmet.service.StatsProjectService; import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; -import oracle.sql.NUMBER; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.text.DateFormat; @@ -37,25 +34,19 @@ import java.util.concurrent.atomic.AtomicInteger; @Service public class StatsProjectServiceImpl implements StatsProjectService { + @Autowired + private DimCustomerService dimCustomerService; @Autowired private DimAgencyService dimAgencyService; @Autowired private DimGridService dimGridService; @Autowired - private DimDateService dimDateService; - @Autowired - private DimWeekService dimWeekService; - @Autowired - private DimMonthService dimMonthService; - @Autowired - private DimQuarterService dimQuarterService; - @Autowired - private DimYearService dimYearService; - @Autowired private ProjectService projectService; @Autowired private ProjectProcessService projectProcessService; @Autowired + private IssueService issueService; + @Autowired private FactAgencyProjectDailyService factAgencyProjectDailyService; @Autowired private FactAgencyProjectMonthlyService factAgencyProjectMonthlyService; @@ -65,27 +56,75 @@ public class StatsProjectServiceImpl implements StatsProjectService { private FactGridProjectMonthlyService factGridProjectMonthlyService; /** - * @param customerId - * @return * @Author sun - * @Description 数据-项目-机关日(月)统计 + * @Description 数据-项目-机关、网格日(月)统计 **/ @Override - public void statsAgencyProject(String customerId) { - //1:根据客户Id查询机关维度表数据 + public void agencyGridProjectStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + customerStats(customerId); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } + + /** + * @Author sun + * @Description 一个客户一个线程, 分别统计机关/网格日/月数据 + **/ + @Async + public void customerStats(String customerId) { + Date date = new Date(); + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询机关维度表数据 DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); dimAgencyDTO.setCustomerId(customerId); List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + //3:根据客户Id查询网格维度表数据 + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //4:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(customerId); + projectEntity.setCreatedTime(date); + projectEntity.setStatus(ProjectConstant.CLOSED); + List projectList = projectService.getProjectList(projectEntity); + + //5:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) + List processList = projectProcessService.getProcessList(projectEntity); + + //6:机关层级日月统计 if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) { - //2:执行机关日数据统计 - agencyDateProjectStats(customerId, dimAgencyList); + //6.1:执行机关日数据统计 + agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList); + + //6.2:执行机关月数据统计 + if (Calendar.getInstance().get(Calendar.DATE) == 1) { + agencyMonthProjectStats(customerId, dimId, dimAgencyList); + } + } + + //7:网格层级日月统计 + if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { + //7.1:执行网格日数据统计 + gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); - //3:执行机关月数据统计 + //7.2:执行网格月数据统计 if (Calendar.getInstance().get(Calendar.DATE) == 1) { - agencyMonthProjectStats(customerId, dimAgencyList); + gridMonthProjectStats(customerId, dimId, dimGridList); } } + } /** @@ -93,31 +132,18 @@ public class StatsProjectServiceImpl implements StatsProjectService { * @Author sun * @Description 数据-项目-机关日统计 **/ - private String agencyDateProjectStats(String customerId, List dimAgencyList) { + private String agencyDateProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimAgencyList, List projectList, List processList) { Date date = yesterDay(); - //1:查询各维度表Id,方便使用 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay()); - - //2:根据客户Id查询项目业务表已结案数据(查询当前日期之前的数据不包含当天的) - ProjectEntity projectEntity = new ProjectEntity(); - projectEntity.setCustomerId(customerId); - projectEntity.setCreatedTime(yesterDay()); - projectEntity.setStatus(ProjectConstant.CLOSED); - List projectList = projectService.getProjectList(projectEntity); - - //3:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的) - List processList = projectProcessService.getProcessList(projectEntity); - - //4:遍历统计每个机关各项指标数 //批量机关日统计新增对象 - List dimDateEntityList = new ArrayList<>(); + List projectDateEntityList = new ArrayList<>(); //计算百分比使用,保留小数点后两位 NumberFormat numberFormat = NumberFormat.getInstance(); numberFormat.setMaximumFractionDigits(2); - //遍历机关维度数据 + + //1:遍历机关维度数据,统计每个机关各项指标数 for (DimAgencyDTO agency : dimAgencyList) { - //存放当前机关及所有下级机关Id - Map map = new HashMap<>(); + //1.1:存放当前机关及所有下级机关Id + Map map = new HashMap<>(); map.put(agency.getId(), agency.getId()); String subPids = ((null == agency.getPids() || "".equals(agency.getPids())) ? agency.getId() : agency.getPids() + ":" + agency.getId()); dimAgencyList.forEach(sub -> { @@ -125,21 +151,21 @@ public class StatsProjectServiceImpl implements StatsProjectService { map.put(sub.getId(), sub.getId()); } }); - //机关下截止当前日期的项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 + //机关下截止当前日期的项目总数、已结案总数、已结案已解决总数、已结案未解决总数 AtomicInteger projectTotal = new AtomicInteger(0); AtomicInteger closedTotal = new AtomicInteger(0); AtomicInteger resolvedTotal = new AtomicInteger(0); AtomicInteger unResolvedTotal = new AtomicInteger(0); - //日增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 + //日增量中项目总数、已结案总数、已结案已解决总数、已结案未解决总数 AtomicInteger projectIncr = new AtomicInteger(0); AtomicInteger closedIncr = new AtomicInteger(0); AtomicInteger resolvedIncr = new AtomicInteger(0); AtomicInteger unResolvedIncr = new AtomicInteger(0); - //存放已结案项目Id,用于统计已结案中已解决未解决数 + //存放已结案项目Id,用于统计已结案中已解决、未解决数 Map closeMap = new HashMap<>(); //存放前一日已结案项目Id,用于统计日增量中已结案项目的已解决、未解决数量 Map closeDateMap = new HashMap<>(); - //遍历进展数据,统计截止当日的项目总量、处理中总量、已结案总量以及日增量中的项目总量、处理中总量、已结案总量 + //1.2:遍历进展数据,统计截止当日的项目总量、处理中总量、已结案总量以及日增量中的项目总量、处理中总量、已结案总量 processList.forEach(process -> { //当前机关及下级 if (map.containsKey(process.getAgencyId())) { @@ -163,7 +189,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { } } }); - //遍历项目业务数据,统计截止当日的已结案已解决总量、已结案未解决总量以及日增量中的已结案已解决总量、已结案未解决总量 + //1.3:遍历项目业务数据,统计截止当日的已结案已解决总量、已结案未解决总量以及日增量中的已结案已解决总量、已结案未解决总量 projectList.forEach(project -> { //当前机关及下级 if (map.containsKey(project.getAgencyId())) { @@ -190,7 +216,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { } }); - //封装日数据对象 + //1.4:封装机关日数据对象 FactAgencyProjectDailyEntity agencyDailyEntity = new FactAgencyProjectDailyEntity(); agencyDailyEntity.setCustomerId(customerId); agencyDailyEntity.setAgencyId(agency.getId()); @@ -198,6 +224,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { agencyDailyEntity.setDateId(dimId.getDateId()); agencyDailyEntity.setWeekId(dimId.getWeekId()); agencyDailyEntity.setMonthId(dimId.getMonthId()); + agencyDailyEntity.setQuarterId(dimId.getQuarterId()); agencyDailyEntity.setYearId(dimId.getYearId()); agencyDailyEntity.setProjectTotal(projectTotal.intValue()); agencyDailyEntity.setPendingTotal(projectTotal.intValue() - closedTotal.intValue()); @@ -218,20 +245,21 @@ public class StatsProjectServiceImpl implements StatsProjectService { agencyDailyEntity.setResolvedIncr(resolvedIncr.intValue()); agencyDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); - dimDateEntityList.add(agencyDailyEntity); + projectDateEntityList.add(agencyDailyEntity); } - //先删后增 - if (null != dimDateEntityList && dimDateEntityList.size() > NumConstant.ZERO) { - //5:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + //2:批量保存数据,先删后增 + if (null != projectDateEntityList && projectDateEntityList.size() > NumConstant.ZERO) { + //2.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity(); delEntity.setCustomerId(customerId); delEntity.setDateId(dimId.getDateId()); factAgencyProjectDailyService.delDateProject(delEntity); - //6:批量保存机关日统计数据 - factAgencyProjectDailyService.insertBatch(dimDateEntityList); + //2.2:批量保存机关日统计数据 + factAgencyProjectDailyService.insertBatch(projectDateEntityList); } + return null; } @@ -240,37 +268,36 @@ public class StatsProjectServiceImpl implements StatsProjectService { * @Author sun * @Description 数据-项目-机关月统计 **/ - private String agencyMonthProjectStats(String customerId, List dimAgencyList) { - //1:获取个维度Id方便使用 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay()); + private String agencyMonthProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimAgencyList) { + Date date = yesterDay(); + //批量月数据新增对象 + List monthlyEntityList = new ArrayList<>(); - //2:获取昨天日期所在月份的起始日期和结束日期 + //1:获取昨天日期所在月份的起始日期和结束日期 MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); formDTO.setCustomerId(customerId); - formDTO.setStartTime(getMonthBegin(yesterDay())); - formDTO.setEndTime(getMonthEnd(yesterDay())); + formDTO.setStartTime(getMonthBegin(date)); + formDTO.setEndTime(getMonthEnd(date)); - //批量月数据新增对象 - List monthlyEntityList = new ArrayList<>(); - //3:遍历机关维度数据,分别统计每个组织月数据 + //2:遍历机关维度数据,分别统计每个组织月数据 for (DimAgencyDTO agency : dimAgencyList) { - //4:查询上一月机关日统计数据,按时间倒序 + //2.1:查询上一月机关日统计数据,按时间倒序 formDTO.setAgencyId(agency.getId()); List projectDailyList = factAgencyProjectDailyService.getMonthProjectList(formDTO); - //5:汇总统计上一月机关月统计数据 + //2.2:汇总统计上一月机关月统计数据 //月增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 int pendingIncr = 0; int closedIncr = 0; int resolvedIncr = 0; int unResolvedIncr = 0; - for (FactAgencyProjectDailyEntity date : projectDailyList) { - pendingIncr += date.getPendingIncr(); - closedIncr += date.getClosedIncr(); - resolvedIncr += date.getResolvedIncr(); - unResolvedIncr += date.getUnresolvedIncr(); + for (FactAgencyProjectDailyEntity daily : projectDailyList) { + pendingIncr += daily.getPendingIncr(); + closedIncr += daily.getClosedIncr(); + resolvedIncr += daily.getResolvedIncr(); + unResolvedIncr += daily.getUnresolvedIncr(); } - //6:实体字段属性赋值 + //2.3:实体字段属性赋值 FactAgencyProjectMonthlyEntity monthlyEntity = new FactAgencyProjectMonthlyEntity(); monthlyEntity.setCustomerId(customerId); monthlyEntity.setAgencyId(agency.getId()); @@ -299,65 +326,155 @@ public class StatsProjectServiceImpl implements StatsProjectService { monthlyEntityList.add(monthlyEntity); } + //3:批量新增数据,先删后增 if (null != monthlyEntityList && monthlyEntityList.size() > NumConstant.ZERO) { - //7:根据客户Id、月份Id批量删除一下可能存在的历史数据 + //3.1:根据客户Id、月份Id批量删除一下可能存在的历史数据 FactAgencyProjectMonthlyEntity delEntity = new FactAgencyProjectMonthlyEntity(); delEntity.setCustomerId(customerId); delEntity.setMonthId(dimId.getMonthId()); factAgencyProjectMonthlyService.delMonthProject(delEntity); - //8:批量保存机关月统计数据 + //3.2:批量保存机关月统计数据 factAgencyProjectMonthlyService.insertBatch(monthlyEntityList); } + return null; } + /** * @param customerId * @return * @Author sun - * @Description 数据-项目-网格日(月)统计 + * @Description 数据-项目-网格日统计 **/ - @Override - public void statsGridProject(String customerId) { - //1:根据客户Id查询网格维度表数据 - List dimGridList = dimGridService.getGridListByCustomerId(customerId); + private String gridDateProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimGridList, List projectList, List processList) { + Date date = yesterDay(); + //批量网格日统计新增对象 + List gridDateEntityList = new ArrayList<>(); + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(2); - if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { - //2:执行机关日数据统计 - gridDateProjectStats(customerId, dimGridList); + //1:根据客户Id查询议题库已转项目的网格项目关系数据 + List gridProjectList = issueService.getGridProjectList(customerId); - //3:执行机关月数据统计 - if (Calendar.getInstance().get(Calendar.DATE) == 1) { - gridMonthProjectStats(customerId, dimGridList); - } - } - } + //2:遍历网格维度数据,统计每个网格各项指标数据 + for (DimGridEntity grid : dimGridList) { + //2.1:存放网格下的项目Id + Map map = new HashMap<>(); + gridProjectList.forEach(gridProject -> { + if (grid.getId().equals(gridProject.getGridId())) { + map.put(gridProject.getProjectId(), gridProject.getGridId()); + } + }); + //网格下截止当前日期的项目总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger projectTotal = new AtomicInteger(0); + AtomicInteger closedTotal = new AtomicInteger(0); + AtomicInteger resolvedTotal = new AtomicInteger(0); + AtomicInteger unResolvedTotal = new AtomicInteger(0); + //网格日增量中项目总数、已结案总数、已结案已解决总数、已结案未解决总数 + AtomicInteger projectIncr = new AtomicInteger(0); + AtomicInteger closedIncr = new AtomicInteger(0); + AtomicInteger resolvedIncr = new AtomicInteger(0); + AtomicInteger unResolvedIncr = new AtomicInteger(0); + //存放已结案项目Id,用于统计已结案中已解决、未解决数 + Map closeMap = new HashMap<>(); + //存放前一日已结案项目Id,用于统计日增量中已结案项目的已解决、未解决数量 + Map closeDateMap = new HashMap<>(); + //2.2:遍历进展数据,统计截止当日的项目总量、处理中总量、已结案总量以及日增量中的项目总量、处理中总量、已结案总量 + //截止当日项目总数 + projectTotal.addAndGet(map.size()); + processList.forEach(process -> { + //是网格下的项目,且是已结案的 + if (map.containsKey(process.getProjectId())) { + //进展表中是创建项目状态的数据总数即为该网格下项目总数 + if (ProjectConstant.CREATED.equals(process.getOperation()) && date.equals(process.getCreatedTime())) { + //日增量总数 + projectIncr.addAndGet(1); + } + if (ProjectConstant.CLOSE.equals(process.getOperation())) { + //截止当日的已结案总数 + closedTotal.addAndGet(1); + closeMap.put(process.getProjectId(), process.getProjectId()); + if (date.equals(process.getCreatedTime())) { + //日增量中已结案总数 + closedIncr.addAndGet(1); + closeDateMap.put(process.getProjectId(), process.getProjectId()); + } + } + } + }); + //2.3:遍历项目业务数据,统计截止当日的已结案已解决总量、已结案未解决总量以及日增量中的已结案已解决总量、已结案未解决总量 + projectList.forEach(project -> { + //当前机关及下级 + if (map.containsKey(project.getId())) { + if (closeMap.containsKey(project.getId())) { + //已结案已解决 + if (ProjectConstant.RESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案已解决总量 + resolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案已解决总量 + resolvedIncr.addAndGet(1); + } + } + //已结案未解决 + if (ProjectConstant.UNRESOLVED.equals(project.getClosedStatus())) { + //截止当日的已结案未解决总量 + unResolvedTotal.addAndGet(1); + if (closeDateMap.containsKey(project.getId())) { + //日增量中的已结案未解决总量 + unResolvedIncr.addAndGet(1); + } + } + } + } + }); - /** - * @param customerId - * @return - * @Author sun - * @Description 数据-项目-网格日统计 - **/ - private String gridDateProjectStats(String customerId, List dimGridList) { - //1:查询各维度表Id,方便使用 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(yesterDay()); + //2.4:封装日数据对象 + FactGridProjectDailyEntity gridDailyEntity = new FactGridProjectDailyEntity(); + gridDailyEntity.setCustomerId(customerId); + gridDailyEntity.setAgencyId(grid.getAgencyId()); + gridDailyEntity.setGridId(grid.getId()); + gridDailyEntity.setDateId(dimId.getDateId()); + gridDailyEntity.setWeekId(dimId.getWeekId()); + gridDailyEntity.setMonthId(dimId.getMonthId()); + gridDailyEntity.setQuarterId(dimId.getQuarterId()); + gridDailyEntity.setYearId(dimId.getYearId()); + gridDailyEntity.setProjectTotal(projectTotal.intValue()); + gridDailyEntity.setPendingTotal(projectTotal.intValue() - closedTotal.intValue()); + gridDailyEntity.setClosedTotal(closedTotal.intValue()); + gridDailyEntity.setResolvedTotal(resolvedTotal.intValue()); + gridDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); + if (projectTotal.intValue() > NumConstant.ZERO) { + gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100))); + gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100))); + } + if (closedTotal.intValue() > NumConstant.ZERO) { + gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + } + gridDailyEntity.setProjectIncr(projectIncr.intValue()); + gridDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); + gridDailyEntity.setClosedIncr(closedIncr.intValue()); + gridDailyEntity.setResolvedIncr(resolvedIncr.intValue()); + gridDailyEntity.setUnresolvedIncr(unResolvedIncr.intValue()); - //2:根据客户Id查询项目业务表已结案数据(查询当前日期之前的数据不包含当天的) - ProjectEntity projectEntity = new ProjectEntity(); - projectEntity.setCustomerId(customerId); - projectEntity.setCreatedTime(yesterDay()); - List projectList = projectService.getProjectList(projectEntity); + gridDateEntityList.add(gridDailyEntity); + } - //3:查询项目处理进展表中是创建项目和结案两种进展的有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询当前日期之前的数据不包含当天的) - List processList = projectProcessService.getProcessList(projectEntity); + //3:批量新增数据,先删后增 + if (null != gridDateEntityList && gridDateEntityList.size() > NumConstant.ZERO) { + //3.1:根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + FactAgencyProjectDailyEntity delEntity = new FactAgencyProjectDailyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setDateId(dimId.getDateId()); + factGridProjectDailyService.delDateProject(delEntity); - //4:根据客户Id查询议题表已转项目的网格项目关系数据 - List gridProjectList = null; - //5:遍历统计每个网格各项指标数据 - //6:批量保存网格日统计数据 - //7:判断当前日期是否为当月首日,执行网格月数据统计 + //3.2:批量保存网格日统计数据 + factGridProjectDailyService.insertBatch(gridDateEntityList); + } return null; } @@ -368,7 +485,74 @@ public class StatsProjectServiceImpl implements StatsProjectService { * @Author sun * @Description 数据-项目-网格月统计 **/ - private String gridMonthProjectStats(String customerId, List dimGridList) { + private String gridMonthProjectStats(String customerId, DimIdGenerator.DimIdBean dimId, List dimGridList) { + //批量月数据新增对象 + List monthlyEntityList = new ArrayList<>(); + + //1:获取昨天日期所在月份的起始日期和结束日期 + MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); + formDTO.setCustomerId(customerId); + formDTO.setStartTime(getMonthBegin(yesterDay())); + formDTO.setEndTime(getMonthEnd(yesterDay())); + + //2:遍历网格维度数据,分别统计每个网格月数据 + for (DimGridEntity grid : dimGridList) { + //2.1:查询上一月网格日统计数据,按时间倒序 + formDTO.setGridId(grid.getId()); + List projectDailyList = factGridProjectDailyService.getMonthProjectList(formDTO); + + //2.2:汇总统计上一月网格月统计数据 + //月增量中项目总数、处理中总数、已结案总数、已结案已解决总数、已结案未解决总数 + int pendingIncr = 0; + int closedIncr = 0; + int resolvedIncr = 0; + int unResolvedIncr = 0; + for (FactGridProjectDailyEntity date : projectDailyList) { + pendingIncr += date.getPendingIncr(); + closedIncr += date.getClosedIncr(); + resolvedIncr += date.getResolvedIncr(); + unResolvedIncr += date.getUnresolvedIncr(); + } + //2.3:实体字段属性赋值 + FactGridProjectMonthlyEntity monthlyEntity = new FactGridProjectMonthlyEntity(); + monthlyEntity.setCustomerId(customerId); + monthlyEntity.setAgencyId(grid.getAgencyId()); + monthlyEntity.setGridId(grid.getId()); + monthlyEntity.setMonthId(dimId.getMonthId()); + monthlyEntity.setQuarterId(dimId.getQuarterId()); + monthlyEntity.setYearId(dimId.getYearId()); + if (null != projectDailyList && projectDailyList.size() > NumConstant.ZERO) { + FactGridProjectDailyEntity entity = projectDailyList.get(0); + monthlyEntity.setProjectTotal(entity.getProjectTotal()); + monthlyEntity.setPendingTotal(entity.getPendingTotal()); + monthlyEntity.setPendingRatio(entity.getPendingRatio()); + monthlyEntity.setClosedTotal(entity.getClosedTotal()); + monthlyEntity.setClosedRatio(entity.getClosedRatio()); + monthlyEntity.setResolvedTotal(entity.getResolvedTotal()); + monthlyEntity.setResolvedRatio(entity.getResolvedRatio()); + monthlyEntity.setUnresolvedTotal(entity.getUnresolvedTotal()); + monthlyEntity.setUnresolvedRatio(entity.getUnresolvedRatio()); + monthlyEntity.setProjectIncr(pendingIncr + closedIncr); + monthlyEntity.setPendingIncr(pendingIncr); + monthlyEntity.setClosedIncr(closedIncr); + monthlyEntity.setResolvedIncr(resolvedIncr); + monthlyEntity.setUnresolvedIncr(unResolvedIncr); + } + + monthlyEntityList.add(monthlyEntity); + } + + //3:批量新增数据,先删后增 + if (null != monthlyEntityList && monthlyEntityList.size() > NumConstant.ZERO) { + //3.1:根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + FactAgencyProjectMonthlyEntity delEntity = new FactAgencyProjectMonthlyEntity(); + delEntity.setCustomerId(customerId); + delEntity.setMonthId(dimId.getMonthId()); + factGridProjectMonthlyService.delMonthProject(delEntity); + + //3.2:批量保存机关月统计数据 + factGridProjectMonthlyService.insertBatch(monthlyEntityList); + } return null; } @@ -430,8 +614,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { //将毫秒至999 c.set(Calendar.MILLISECOND, 999); //获取本月最后一天的时间 - System.out.println(c.getTime()); - System.out.println(c); return c.getTime(); } -} + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index bfc402b4b5..de1a52e1c2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -17,7 +17,9 @@ package com.epmet.service.project.impl; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectProcessDao; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; @@ -33,6 +35,7 @@ import java.util.List; * @since v1.0.0 2020-05-11 */ @Service +@DataSource(DataSourceConstant.GOV_PROJECT) public class ProjectProcessServiceImpl extends BaseServiceImpl implements ProjectProcessService { /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java index 88c6aa3286..f9d0e69145 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectDailyService.java @@ -18,8 +18,12 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; import com.epmet.entity.stats.FactGridProjectDailyEntity; +import java.util.List; + /** * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 * @@ -28,4 +32,17 @@ import com.epmet.entity.stats.FactGridProjectDailyEntity; */ public interface FactGridProjectDailyService extends BaseService { + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + void delDateProject(FactAgencyProjectDailyEntity delEntity); + + /** + * @param formDTO + * @Author sun + * @Description 查询上一月网格日统计数据,按时间倒序 + **/ + List getMonthProjectList(MonthProjectListFormDTO formDTO); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java index 7beb0d019d..502ea11e62 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGridProjectMonthlyService.java @@ -18,6 +18,7 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; import com.epmet.entity.stats.FactGridProjectMonthlyEntity; /** @@ -28,4 +29,9 @@ import com.epmet.entity.stats.FactGridProjectMonthlyEntity; */ public interface FactGridProjectMonthlyService extends BaseService { + /** + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + **/ + void delMonthProject(FactAgencyProjectMonthlyEntity delEntity); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java index 2665db9d91..1b54cd7686 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectDailyServiceImpl.java @@ -19,10 +19,14 @@ package com.epmet.service.stats.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.stats.FactGridProjectDailyDao; +import com.epmet.dto.project.form.MonthProjectListFormDTO; +import com.epmet.entity.stats.FactAgencyProjectDailyEntity; import com.epmet.entity.stats.FactGridProjectDailyEntity; import com.epmet.service.stats.FactGridProjectDailyService; import org.springframework.stereotype.Service; +import java.util.List; + /** * 网格下日项目数据统计表 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据 * @@ -32,5 +36,23 @@ import org.springframework.stereotype.Service; @Service public class FactGridProjectDailyServiceImpl extends BaseServiceImpl implements FactGridProjectDailyService { + /** + * @param delEntity + * @Author sun + * @Description 根据客户Id、日维度Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delDateProject(FactAgencyProjectDailyEntity delEntity) { + baseDao.delDateProject(delEntity); + } + /** + * @param formDTO + * @Author sun + * @Description 查询上一月网格日统计数据,按时间倒序 + **/ + @Override + public List getMonthProjectList(MonthProjectListFormDTO formDTO) { + return baseDao.selectMonthProjectList(formDTO); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java index e2f5fb654c..1d026d2891 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGridProjectMonthlyServiceImpl.java @@ -19,6 +19,7 @@ package com.epmet.service.stats.impl; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.dao.stats.FactGridProjectMonthlyDao; +import com.epmet.entity.stats.FactAgencyProjectMonthlyEntity; import com.epmet.entity.stats.FactGridProjectMonthlyEntity; import com.epmet.service.stats.FactGridProjectMonthlyService; import org.springframework.stereotype.Service; @@ -32,5 +33,12 @@ import org.springframework.stereotype.Service; @Service public class FactGridProjectMonthlyServiceImpl extends BaseServiceImpl implements FactGridProjectMonthlyService { - + /** + * @Author sun + * @Description 根据客户Id、月份Id批量物理删除一下可能存在的历史数据 + **/ + @Override + public void delMonthProject(FactAgencyProjectMonthlyEntity delEntity) { + baseDao.delMonthProject(delEntity); + } } \ 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 2174226182..68c4c3fb22 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 @@ -68,4 +68,19 @@ RESOLVE_TYPE + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index bf2035774d..9f839a668e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -17,8 +17,7 @@ AND p.del_flag = '0' AND p.customer_id = #{customerId} - ORDER BY - pro.project_id + ORDER BY pro.project_id,pro.CREATED_TIME ASC \ 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 d139aff3ee..370ea99cc5 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 @@ -11,7 +11,13 @@ + SELECT + * + FROM + fact_grid_project_daily + WHERE + del_flag = '0' + AND customer_id = #{customerId} + AND grid_id = #{gridId} + AND ( + DATE_FORMAT(created_time, "%Y-%m-%d") + BETWEEN DATE_FORMAT(#{startTime}, "%Y-%m-%d") + AND DATE_FORMAT(#{endTime}, "%Y-%m-%d") + ) + ORDER BY created_time DESC,project_total DESC + + + DELETE + FROM + fact_grid_project_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/FactGridProjectMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml index 67b5a3bfdd..916ff301c8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectMonthlyDao.xml @@ -3,6 +3,12 @@ - - + + DELETE + FROM + fact_grid_project_monthly + WHERE + customer_id = #{customerId} + AND month_id = #{monthId} + \ No newline at end of file From 90d304075e2a2801652ab6b56122f54228effd2d Mon Sep 17 00:00:00 2001 From: jianjun Date: Fri, 19 Jun 2020 23:52:09 +0800 Subject: [PATCH 051/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E4=BD=BF=E7=94=A8=E6=AC=A1=E6=95=B0=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=20=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArticleGridPublishedSummaryDTO.java | 2 +- .../dto/voice/PublisherPublishedCountDTO.java | 44 ++ .../controller/StatsPublicityController.java | 24 +- .../dao/stats/FactTagUsedAgencyDailyDao.java | 16 +- .../stats/FactTagUsedAgencyMonthlyDao.java | 11 +- .../stats/FactTagUsedAgencyQuarterlyDao.java | 4 +- .../dao/stats/FactTagUsedAgencyYearlyDao.java | 4 +- .../stats/FactTagUsedDepartmentDailyDao.java | 14 +- .../FactTagUsedDepartmentMonthlyDao.java | 10 +- .../FactTagUsedDepartmentQuarterlyDao.java | 4 +- .../stats/FactTagUsedDepartmentYearlyDao.java | 4 +- .../dao/stats/FactTagUsedGridDailyDao.java | 15 +- .../dao/stats/FactTagUsedGridMonthlyDao.java | 10 +- .../stats/FactTagUsedGridQuarterlyDao.java | 4 +- .../dao/stats/FactTagUsedGridYearlyDao.java | 4 +- .../java/com/epmet/dao/voice/ArticleDao.java | 12 +- .../dao/voice/ArticlePublishRangeDao.java | 2 +- .../com/epmet/dao/voice/ArticleTagsDao.java | 46 ++ .../stats/FactTagUsedAgencyMonthlyEntity.java | 10 + .../FactTagUsedAgencyQuarterlyEntity.java | 5 + .../FactTagUsedDepartmentMonthlyEntity.java | 9 + .../FactTagUsedDepartmentQuarterlyEntity.java | 5 + .../stats/FactTagUsedGridMonthlyEntity.java | 10 + .../stats/FactTagUsedGridQuarterlyEntity.java | 5 + .../FactTagViewedAgencyMonthlyEntity.java | 10 + .../FactTagViewedAgencyQuarterlyEntity.java | 5 + .../stats/FactTagViewedGridMonthlyEntity.java | 10 + .../FactTagViewedGridQuarterlyEntity.java | 5 + .../epmet/entity/voice/ArticleTagsEntity.java | 58 +++ .../epmet/service/StatsPublicityService.java | 23 +- .../impl/StatsPublicityServiceImpl.java | 464 ++++++++++++++++-- .../stats/FactTagUsedAgencyDailyService.java | 50 ++ .../FactTagUsedAgencyMonthlyService.java | 39 ++ .../FactTagUsedAgencyQuarterlyService.java | 35 ++ .../stats/FactTagUsedAgencyYearlyService.java | 33 ++ .../FactTagUsedDepartmentDailyService.java | 49 ++ .../FactTagUsedDepartmentMonthlyService.java | 38 ++ ...FactTagUsedDepartmentQuarterlyService.java | 35 ++ .../FactTagUsedDepartmentYearlyService.java | 33 ++ .../stats/FactTagUsedGridDailyService.java | 50 ++ .../stats/FactTagUsedGridMonthlyService.java | 38 ++ .../FactTagUsedGridQuarterlyService.java | 34 ++ .../stats/FactTagUsedGridYearlyService.java | 32 ++ .../FactTagViewedAgencyDailyService.java | 32 ++ .../FactTagViewedAgencyMonthlyService.java | 31 ++ .../FactTagViewedAgencyQuarterlyService.java | 31 ++ .../FactTagViewedAgencyYearlyService.java | 32 ++ .../stats/FactTagViewedGridDailyService.java | 31 ++ .../FactTagViewedGridMonthlyService.java | 31 ++ .../FactTagViewedGridQuarterlyService.java | 31 ++ .../stats/FactTagViewedGridYearlyService.java | 31 ++ ...rticlePublishedAgencyDailyServiceImpl.java | 4 + ...lePublishedDepartmentDailyServiceImpl.java | 4 + ...tArticlePublishedGridDailyServiceImpl.java | 16 +- .../FactTagUsedAgencyDailyServiceImpl.java | 65 +++ .../FactTagUsedAgencyMonthlyServiceImpl.java | 70 +++ ...FactTagUsedAgencyQuarterlyServiceImpl.java | 53 ++ .../FactTagUsedAgencyYearlyServiceImpl.java | 47 ++ ...FactTagUsedDepartmentDailyServiceImpl.java | 64 +++ ...ctTagUsedDepartmentMonthlyServiceImpl.java | 70 +++ ...TagUsedDepartmentQuarterlyServiceImpl.java | 51 ++ ...actTagUsedDepartmentYearlyServiceImpl.java | 47 ++ .../impl/FactTagUsedGridDailyServiceImpl.java | 65 +++ .../FactTagUsedGridMonthlyServiceImpl.java | 67 +++ .../FactTagUsedGridQuarterlyServiceImpl.java | 52 ++ .../FactTagUsedGridYearlyServiceImpl.java | 46 ++ .../voice/ArticlePublishRangeService.java | 2 +- .../epmet/service/voice/ArticleService.java | 10 +- .../service/voice/ArticleTagsService.java | 42 ++ .../impl/ArticlePublishRangeServiceImpl.java | 2 +- .../voice/impl/ArticleServiceImpl.java | 28 +- .../voice/impl/ArticleTagsServiceImpl.java | 56 +++ .../stats/FactTagUsedAgencyDailyDao.xml | 45 +- .../stats/FactTagUsedAgencyMonthlyDao.xml | 62 ++- .../stats/FactTagUsedAgencyQuarterlyDao.xml | 21 +- .../stats/FactTagUsedAgencyYearlyDao.xml | 21 +- .../stats/FactTagUsedDepartmentDailyDao.xml | 47 +- .../stats/FactTagUsedDepartmentMonthlyDao.xml | 63 ++- .../FactTagUsedDepartmentQuarterlyDao.xml | 20 +- .../stats/FactTagUsedDepartmentYearlyDao.xml | 21 +- .../mapper/stats/FactTagUsedGridDailyDao.xml | 48 +- .../stats/FactTagUsedGridMonthlyDao.xml | 64 ++- .../stats/FactTagUsedGridQuarterlyDao.xml | 19 +- .../mapper/stats/FactTagUsedGridYearlyDao.xml | 20 +- .../stats/FactTagViewedGridDailyDao.xml | 21 - .../stats/FactTagViewedGridMonthlyDao.xml | 18 - .../stats/FactTagViewedGridQuarterlyDao.xml | 18 - .../stats/FactTagViewedGridYearlyDao.xml | 18 - .../resources/mapper/voice/ArticleDao.xml | 24 +- .../mapper/voice/ArticlePublishRangeDao.xml | 4 +- .../resources/mapper/voice/ArticleTagsDao.xml | 32 ++ 91 files changed, 2641 insertions(+), 371 deletions(-) rename epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/{stats => voice}/ArticleGridPublishedSummaryDTO.java (96%) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java similarity index 96% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java index c1bd1e7043..ec57f7d823 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/ArticleGridPublishedSummaryDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleGridPublishedSummaryDTO.java @@ -1,4 +1,4 @@ -package com.epmet.dto.stats; +package com.epmet.dto.voice; /** * @author jianjun liu * @email liujianjun@yunzongnet.com diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java new file mode 100644 index 0000000000..a7794e97e3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/PublisherPublishedCountDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.voice; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:每个发布者发布的文章数 返回结果 dto + * + * @author liujianjun + * @date 2020/6/19 10:43 + */ +@Data +public class PublisherPublishedCountDTO implements Serializable { + private static final long serialVersionUID = 6755654148306711602L; + + /** + * 客户id + */ + private String customerId; + /** + * 机关id + */ + private String agencyId; + /** + * 网格Id + */ + private String gridId; + /** + * 发布者Id publish_type类型为 部门时 是部门id;类型为 机关时 是机关Id + */ + private String publisherId; + + /** + * 发布文章数 + */ + private Integer publishedCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index 78ee2a3f11..c233fd1e1e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -31,6 +31,28 @@ public class StatsPublicityController { */ @PostMapping(value = "publicitySummaryStatsjob") public Result publicitySummaryStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.publicitySummary(statsDate)); + return new Result().ok(statsPublicityService.articlePublishedCountDayStats(statsDate)); + } + + /** + * desc:【日】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedDayStatsjob") + public Result tagUsedDayStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedDayStatsjob(statsDate)); + } + + /** + * desc:【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedMonthStatsjob") + public Result tagUsedMonthStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedMonthStatsjob(statsDate)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java index 9163b9a587..12569eb8cc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java @@ -19,7 +19,11 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【机关】日统计表 @@ -29,5 +33,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc:根据客户Id 和月份id 获取月的统计数 + * + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java index 74676b13e6..17ded89e6c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java @@ -19,7 +19,11 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【机关】月统计表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyMonthlyDao extends BaseDao { - + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java index 05a61832b8..9d51f34d49 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【机关】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java index 83bb23460a..0d8c942e5a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【机关】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedAgencyYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java index d0a2bfcfe3..2c74977270 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【部门】日统计表 @@ -29,5 +32,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + /** + * desc:获取部门月 统计数 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java index 9f8d4efb02..9b6a3b89cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【部门】月统计表 @@ -29,5 +32,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentMonthlyDao extends BaseDao { - + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java index 4a0b782090..6ac52ec583 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【部门】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java index 77e61837dc..d6908b860e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedDepartmentYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【部门】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedDepartmentYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java index 1139dfe31f..423d8baea0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【网格】日统计表 @@ -29,5 +32,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridDailyDao extends BaseDao { - + + /** + * desc:根据dateId 删除数据 + * + * @param customerId + * @param dateId + * @return + */ + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagUsedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java index a9c34c0110..b8eb0d9095 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 标签【网格】月统计表 @@ -29,5 +32,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridMonthlyDao extends BaseDao { - + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java index 49f5172fbd..f23190191c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【网格】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java index 218b643eb8..eb76936645 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedGridYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 标签【网格】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagUsedGridYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java index 2b23d16345..df01214d40 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleDao.java @@ -18,7 +18,7 @@ package com.epmet.dao.voice; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -44,4 +44,14 @@ public interface ArticleDao extends BaseDao { * @return */ List getAllPublishedCount(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType); + + /** + * desc:根据客户Id 和发布时间 获取文章数据 + * + * @param customerId + * @param publishDate + * @param publisherType + * @return + */ + List getPublishedArticleByDay(@Param("customerId") String customerId, @Param("publishDate") Date publishDate, @Param("publisherType") String publisherType); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java index f70feecf13..f8ff0e359b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticlePublishRangeDao.java @@ -18,7 +18,7 @@ package com.epmet.dao.voice; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticlePublishRangeEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java new file mode 100644 index 0000000000..3fa6d061da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.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.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.voice.ArticleTagsEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticleTagsDao extends BaseDao { + + /** + * desc:根据客户id 创建时间 获取文章标签数据 + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByDay(@Param("customerId") String customerId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java index 1e27d21287..992db40143 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagUsedAgencyMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java index b68c76a874..60de929fde 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedAgencyQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagUsedAgencyQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java index 29ecd87dae..d2309ee1fd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentMonthlyEntity.java @@ -70,4 +70,13 @@ public class FactTagUsedDepartmentMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java index ceac4e9d86..61050668a0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedDepartmentQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagUsedDepartmentQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java index eecc92bb6d..8315bfe68d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagUsedGridMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java index fbe54ea535..cf7f435b2d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagUsedGridQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagUsedGridQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java index 1b357bbfc4..204cd7016a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java index dadd68ae40..089be76e1d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedAgencyQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java index 49cb7ba97c..949e60222a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridMonthlyEntity.java @@ -70,4 +70,14 @@ public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { */ private String monthId; + /** + * 季度ID + */ + private String quarterId; + + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java index e48167f458..b6b3c57a61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactTagViewedGridQuarterlyEntity.java @@ -70,4 +70,9 @@ public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { */ private String quarterId; + /** + * 年D + */ + private String yearId; + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java new file mode 100644 index 0000000000..be590e8b19 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleTagsEntity.java @@ -0,0 +1,58 @@ +/** + * 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.voice; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("article_tags") +public class ArticleTagsEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 标签ID + */ + private String tagId; + + /** + * 标签名称 + */ + private String tagName; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 6574563a45..79fc0d24d1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -12,6 +12,27 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean publicitySummary(Date statsDate); + Boolean articlePublishedCountDayStats(Date statsDate); + + /** + * desc: 按日 统计每个标签被引用的使用文章数 + * + * @return: Boolean + * @date: 2020/6/17 16:11 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagUsedDayStatsjob(Date statsDate); + + /** + * desc: 按月 统计每个标签被引用的使用文章数 + * + * @param + * @return: + * @date: 2020/6/19 18:44 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagUsedMonthStatsjob(Date statsDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index c5dd27ec08..06eec21543 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -1,14 +1,20 @@ package com.epmet.service.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.constant.ProjectConstant; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.stats.*; +import com.epmet.entity.voice.ArticleEntity; +import com.epmet.entity.voice.ArticleTagsEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; import com.epmet.service.voice.ArticleService; +import com.epmet.service.voice.ArticleTagsService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -19,7 +25,9 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; +import java.util.stream.Collectors; /** * desc: 宣传能力数据统计 service @@ -49,7 +57,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private DimGridService dimGridService; @Autowired private DimDepartmentService dimDepartmentService; - + @Autowired + private ArticleTagsService articleTagsService; @Autowired private ArticleService articleService; @Autowired @@ -60,19 +69,77 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; @Autowired private FactArticlePublishedAgencyDailyService factArticlePublishedAgencyDailyService; - - + @Autowired + private FactTagUsedGridDailyService factTagUsedGridDailyService; + @Autowired + private FactTagUsedDepartmentDailyService factTagUsedDepartmentDailyService; + @Autowired + private FactTagUsedAgencyDailyService factTagUsedAgencyDailyService; + @Autowired + private FactTagUsedGridMonthlyService factTagUsedGridMonthlyService; + @Autowired + private FactTagUsedDepartmentMonthlyService factTagUsedDepartmentMonthlyService; + @Autowired + private FactTagUsedAgencyMonthlyService factTagUsedAgencyMonthlyService; + @Autowired + private FactTagUsedGridQuarterlyService factTagUsedGridQuarterlyService; + @Autowired + private FactTagUsedDepartmentQuarterlyService factTagUsedDepartmentQuarterlyService; + @Autowired + private FactTagUsedAgencyQuarterlyService factTagUsedAgencyQuarterlyService; + @Autowired + private FactTagUsedGridYearlyService factTagUsedGridYearlyService; + @Autowired + private FactTagUsedDepartmentYearlyService factTagUsedDepartmentYearlyService; + @Autowired + private FactTagUsedAgencyYearlyService factTagUsedAgencyYearlyService; @Autowired private ExecutorService executorService; @Override - public Boolean publicitySummary(Date statsDate) { + public Boolean articlePublishedCountDayStats(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + Date finalStatsDate = statsDate; + executorService.submit(() -> { + try { + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + statsPublishedGridDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsPublishedDepartmentDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsPublishedAgencyDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + } catch (Exception e) { + log.error("articlePublishedCountDayStats exception", e); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } + + @Override + public Boolean tagUsedDayStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 - statsDate = DateUtils.integrate(new Date(),DateUtils.DATE_PATTERN); - }else{ - statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate,1),DateUtils.DATE_PATTERN); + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); } DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); int pageNo = 1; @@ -82,14 +149,69 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - /*executorService.submit(()->{ + Date finalStatsDate = statsDate; + executorService.submit(() -> { + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + //统计 + statsTagUsedDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } - });*/ - //key:所在机关Id - Map agencySummaryMap = new HashMap<>(); - statsPublishedGridDaily(statsDate, dimIdBean, customerId,agencySummaryMap); - statsPublishedDepartmentDaily(statsDate, dimIdBean, customerId,agencySummaryMap); - statsPublishedAgencyDaily(statsDate, dimIdBean, customerId,agencySummaryMap); + @Override + public Boolean tagUsedMonthStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + CountDownLatch countDownLatch = new CountDownLatch(1); + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + executorService.submit(() -> { + try { + statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); + //statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + //statsTagUsedYearly(dimIdBean.getYearId(), customerId); + countDownLatch.countDown(); + } catch (Exception e) { + log.error("statsTagUsedMonthly exception", e); + } + }); + log.debug("start === statsTagUsedQuarterly "); + try { + countDownLatch.await(); + } catch (InterruptedException e) { + log.error("countDownLatch.await() interrupted", e); + } + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedQuarterly exception", e); + } + }); + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedYearly exception", e); + } + }); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); @@ -106,7 +228,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId,DateUtils.integrate(statsDate,DateUtils.DATE_PATTERN)); + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN)); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { @@ -126,6 +248,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { /** * desc:同一个机关下的数据进行类型处理 + * * @param result * @param summaryDTO */ @@ -140,23 +263,24 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { summary.setPublisherId(summaryDTO.getPublisherId()); summary.setArticleTotalCount(summaryDTO.getArticleTotalCount()); summary.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - result.put(summaryDTO.getPublisherId(),summaryDTO); - }else{ - publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount()+summaryDTO.getArticlePublishedCount()); - publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount()+summaryDTO.getArticlePublishedCount()); + result.put(summaryDTO.getPublisherId(), summaryDTO); + } else { + publishedSummaryDTO.setArticlePublishedCount(publishedSummaryDTO.getArticlePublishedCount() + summaryDTO.getArticlePublishedCount()); + publishedSummaryDTO.setArticleTotalCount(publishedSummaryDTO.getArticleTotalCount() + summaryDTO.getArticlePublishedCount()); } } /** * desc:按日统计 网格纬度的 文章总数数据 - * @param statsDate + * + * @param statsDate * @param dimIdBean * @param customerId * @param agencySummaryMap */ private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { //key:所在机关Id - Map result = new HashMap<>(); + Map result = new HashMap<>(); //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { @@ -170,13 +294,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedGridDailyEntity gridDailyEntities = gridDailyEntityMap.get(summaryDTO.getGridId()); - if (gridDailyEntities == null) { + FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); + if (gridDailyEntity == null) { log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); continue; } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); //同一个机关下数据累加 buildAgencySummaryData(agencySummaryMap, summaryDTO); } @@ -194,8 +318,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); //获取当天的业务数据 - List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId,statsDate); - + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); + Map haveDataAgencyDailyMap = new HashMap<>(); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); @@ -207,36 +331,220 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); //同一个机关下数据累加 buildAgencySummaryData(agencySummaryMap, summaryDTO); + haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } } //数据向上级机关添加 - if (!CollectionUtils.isEmpty(agencySummaryMap)){ - for (Map.Entry entry : agencySummaryMap.entrySet()) { + if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { + for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { String agencyId = entry.getKey(); - ArticleGridPublishedSummaryDTO summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); if (dailyEntity == null) { log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); continue; } - setData2ParentAgency(agencyDailyEntityMap,summary, dailyEntity); + setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } } boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); } - private void setData2ParentAgency(Map agencyDailyEntityMap, ArticleGridPublishedSummaryDTO agencySummary, FactArticlePublishedAgencyDailyEntity summary) { + /** + * desc:按日统计 网格纬度的 标签被使用的次数 + * + * @param statsDate + * @param dimIdBean + * @param customerId + * @param agencySummaryMap + */ + private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有网格 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); + return; + } + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagUsedGridDailyMap = new HashMap<>(); + Map tagUsedDeptDailyMap = new HashMap<>(); + Map tagUsedAgencyDailyMap = new HashMap<>(); + //获取当天的业务数据 + //1获取文章及机关id,网格Id + List publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, statsDate); + if (CollectionUtils.isEmpty(publishedArticleList)) { + return; + } + //KEY 文章Id + Map articleMap = publishedArticleList.stream().collect(Collectors.toMap(ArticleEntity::getId, o -> o)); + Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + //2 获取文章标签 + List articleTagsList = articleTagsService.getArticleTagsByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(articleTagsList)) { + log.error("publicitySummary getArticleTagsByCreateTime customerId:{} have not articleTags,publishedArticleList:{}", customerId, JSON.toJSONString(publishedArticleList)); + return; + } + //tagId + for (ArticleTagsEntity tagEntity : articleTagsList) { + ArticleEntity articleEntity = articleMap.get(tagEntity.getArticleId()); + if (articleEntity == null) { + log.error("publicitySummary articleMap articleId:{} ", tagEntity.getArticleId()); + return; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(articleEntity.getOrgId()); + convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + switch (articleEntity.getPublisherType()) { + case ProjectConstant.PUBLISHER_TYPE_GRID: + convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); + break; + case ProjectConstant.PUBLISHER_TYPE_DEPT: + convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); + break; + } + convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); + } + + factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); + factTagUsedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedDeptDailyMap.values()); + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); + for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagUsedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + } + factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + } + + /** + * desc:按月统计 标签使用数 + * + * @param monthId + * @param customerId + */ + private void statsTagUsedMonthly(String monthId, String customerId) { + List gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class); + factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId,monthId,gridMonthlyList); + } + List deptDailyList = factTagUsedDepartmentDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(deptDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); + factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId,monthId,gridMonthlyList); + } + List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); + factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId,monthId,(agencyMonthlyList)); + } + } + + /** + * desc:按季统计 标签使用数 + * + * @param quarterId + * @param customerId + */ + private void statsTagUsedQuarterly(String quarterId, String customerId) { + List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); + factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId,quarterId,gridQuarterlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List deptQuarterlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentQuarterlyEntity.class); + factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId,quarterId,deptQuarterlyList); + } + //TODO 机关的需要添加 pid + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); + factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId,agencyQuarterlyList); + } + } + + /** + * desc:按年统计 标签使用数 + * + * @param yearId + * @param customerId + */ + private void statsTagUsedYearly(String yearId, String customerId) { + List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class); + //TODO 改为一个方法 添加事务 + factTagUsedGridYearlyService.deleteByYearId(customerId, yearId); + factTagUsedGridYearlyService.insertBatch(gridYearlyList); + } + List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(deptMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentYearlyEntity.class); + factTagUsedDepartmentYearlyService.deleteByYearId(customerId, yearId); + factTagUsedDepartmentYearlyService.insertBatch(gridYearlyList); + } + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); + factTagUsedAgencyYearlyService.deleteByYearId(customerId, yearId); + factTagUsedAgencyYearlyService.insertBatch(agencyYearlyList); + } + } + + private void setTagUsedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagUsedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { + String pid = currentEntity.getPid(); + String tagId = currentEntity.getTagId(); + String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); + DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); + if (currentDimAgency == null) { + return; + } + if (parentAgencyDailyEntity == null) { + parentAgencyDailyEntity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + parentAgencyDailyEntity.setCustomerId(currentEntity.getCustomerId()); + parentAgencyDailyEntity.setPid(currentDimAgency.getPid()); + parentAgencyDailyEntity.setAgencyId(currentDimAgency.getId()); + parentAgencyDailyEntity.setTagId(currentEntity.getTagId()); + parentAgencyDailyEntity.setTagName(currentEntity.getTagName()); + parentAgencyDailyEntity.setUsedCount(currentEntity.getUsedCount()); + agencyDailyEntityMap.put(key, parentAgencyDailyEntity); + } else { + parentAgencyDailyEntity.setUsedCount(parentAgencyDailyEntity.getUsedCount() + currentEntity.getUsedCount()); + } + pid = currentDimAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)) { + setTagUsedData2ParentAgency(dimAgencyEntityMap, agencyDailyEntityMap, parentAgencyDailyEntity, dimIdBean); + } + } + + private void setPublishedData2ParentAgency(Map agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) { String pid = summary.getPid(); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); - if (parentAgency == null){ + if (parentAgency == null) { return; } - parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount()+agencySummary.getArticleTotalCount()); - parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount()+agencySummary.getArticlePublishedCount()); + parentAgency.setArticleTotalCount(parentAgency.getArticleTotalCount() + agencySummary.getArticleTotalCount()); + parentAgency.setArticlePublishedCount(parentAgency.getArticlePublishedCount() + agencySummary.getArticlePublishedCount()); pid = parentAgency.getPid(); - if (!NumConstant.ZERO_STR.equals(pid)){ - setData2ParentAgency(agencyDailyEntityMap, agencySummary,parentAgency); + if (!NumConstant.ZERO_STR.equals(pid)) { + setPublishedData2ParentAgency(agencyDailyEntityMap, agencySummary, parentAgency); } } @@ -302,4 +610,84 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); return result; } + + + /** + * desc:将网格对象构建为 tagUsedGridDaily 对象 + * + * @param dimGridEntities + * @param dimIdBean + * @return + */ + private Map convertTagUsedGridDailyEntity(List dimGridEntities, DimIdGenerator.DimIdBean dimIdBean) { + Map result = new HashMap<>(); + dimGridEntities.forEach(dimGridEntity -> { + FactTagUsedGridDailyEntity entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); + entity.setCustomerId(dimGridEntity.getCustomerId()); + entity.setAgencyId(dimGridEntity.getAgencyId()); + entity.setGridId(dimGridEntity.getId()); + entity.setTagId(""); + entity.setTagName(""); + entity.setUsedCount(0); + result.put(dimGridEntity.getId(), entity); + }); + return result; + } + + private void convertTagUsedGridDailyEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String gridId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedGridDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedGridDailyEntity.class); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(articleEntity.getOrgId()); + entity.setGridId(gridId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagUsedDepartmentDailyEntity(Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String publisherId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedDepartmentDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedDepartmentDailyEntity.class); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(articleEntity.getOrgId()); + entity.setDepartmentId(publisherId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + + private void convertTagUsedAgencyDailyEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String publisherId = articleEntity.getPublisherId(); + String tagId = tagEntity.getTagId(); + String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + entity.setPid(pid); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(publisherId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java new file mode 100644 index 0000000000..1dfa4bd1f3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyDailyService extends BaseService { + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据月份获取 机关汇总数据 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java new file mode 100644 index 0000000000..98568ee385 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; + +import java.util.List; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java new file mode 100644 index 0000000000..81c04f9735 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyQuarterlyService.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; + +import java.util.List; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyQuarterlyService extends BaseService { + + + boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java new file mode 100644 index 0000000000..c3102ab786 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedAgencyYearlyService extends BaseService { + + int deleteByYearId(String customerId,String yearId); + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java new file mode 100644 index 0000000000..c13158859e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentDailyService.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentDailyService extends BaseService { + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据客户Id,月份Id 按照部门Id 标签Id分组 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java new file mode 100644 index 0000000000..3eae455daa --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentMonthlyService.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; + +import java.util.List; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java new file mode 100644 index 0000000000..849a7c3d4e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentQuarterlyService.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; + +import java.util.List; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentQuarterlyService extends BaseService { + + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List deptQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java new file mode 100644 index 0000000000..0e5e152fa6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.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.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedDepartmentYearlyService extends BaseService { + + + Integer deleteByYearId(String customerId, String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java new file mode 100644 index 0000000000..b86c537b27 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridDailyService.java @@ -0,0 +1,50 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridDailyService extends BaseService { + + /** + * desc:删除并插入数据 + * @param customerId + * @param dateId + * @param values + * @return + */ + boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + /** + * desc:根据客户Id 获取网格 某月数据,按照网格分组 + * @param customerId + * @param monthId + * @return + */ + List getTagUsedCountByMonth(String customerId, String monthId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java new file mode 100644 index 0000000000..36917fcba2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridMonthlyService.java @@ -0,0 +1,38 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; + +import java.util.List; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridMonthlyService extends BaseService { + + List getTagUsedCountByYearId(String customerId, String monthId); + + List getTagUsedCountByQuarterId(String customerId, String quarterId); + + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java new file mode 100644 index 0000000000..468c28a2de --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridQuarterlyService.java @@ -0,0 +1,34 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; + +import java.util.List; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridQuarterlyService extends BaseService { + + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java new file mode 100644 index 0000000000..f9f5b35510 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagUsedGridYearlyService extends BaseService { + + Integer deleteByYearId(String customerId, String yearId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java new file mode 100644 index 0000000000..a2b2ca57e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyDailyService extends BaseService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java new file mode 100644 index 0000000000..1838e6dc72 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java new file mode 100644 index 0000000000..ef86491926 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyQuarterlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java new file mode 100644 index 0000000000..2bf9bc345e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.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.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedAgencyYearlyService extends BaseService { + + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java new file mode 100644 index 0000000000..4b07728ae9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridDailyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java new file mode 100644 index 0000000000..149364fc8d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridMonthlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java new file mode 100644 index 0000000000..481bed7ee6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridQuarterlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java new file mode 100644 index 0000000000..a62c431a0e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java @@ -0,0 +1,31 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +public interface FactTagViewedGridYearlyService extends BaseService { + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java index 601d8110a9..48d8bbe0f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedAgencyDailyServiceImpl.java @@ -24,6 +24,7 @@ import com.epmet.service.stats.FactArticlePublishedAgencyDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.Collection; @@ -41,6 +42,9 @@ public class FactArticlePublishedAgencyDailyServiceImpl extends BaseServiceImpl< @Override @Transactional(rollbackFor = Exception.class) public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } int i = baseDao.deleteByDateId(customerId, dateId); log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); this.insertBatch(values, 100); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java index cf40d35c1e..6f9e172dce 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedDepartmentDailyServiceImpl.java @@ -23,6 +23,7 @@ import com.epmet.entity.stats.FactArticlePublishedDepartmentDailyEntity; import com.epmet.service.stats.FactArticlePublishedDepartmentDailyService; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.util.Collection; @@ -39,6 +40,9 @@ public class FactArticlePublishedDepartmentDailyServiceImpl extends BaseServiceI @Override public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } int i = baseDao.deleteByDateId(customerId, dateId); log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); this.insertBatch(values, 100); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java index 38688c191a..c13a282916 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactArticlePublishedGridDailyServiceImpl.java @@ -28,6 +28,7 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; import java.util.Collection; import java.util.List; @@ -45,18 +46,21 @@ public class FactArticlePublishedGridDailyServiceImpl extends BaseServiceImpl getByBeforeDay(String customerId, String dateId) { - log.debug("getByBeforeDay param customerId:{},dateId:{}",customerId,dateId); - if (StringUtils.isBlank(customerId) || StringUtils.isBlank(dateId)){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + log.debug("getByBeforeDay param customerId:{},dateId:{}", customerId, dateId); + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(dateId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.getByBeforeDay(customerId,dateId); + return baseDao.getByBeforeDay(customerId, dateId); } @Override @Transactional(rollbackFor = Exception.class) - public boolean deleteAndInsertBatch(String customerId,String dateId, Collection values) { + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)) { + return false; + } int i = baseDao.deleteByDateId(customerId, dateId); - log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); this.insertBatch(values, 100); return true; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..97961d6b0b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyDailyDao; +import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +import com.epmet.service.stats.FactTagUsedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonth(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..eb54c6b93b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyMonthlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyMonthlyService { + + @Override + public List getTagUsedCountByYearId(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,monthId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(agencyMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(agencyMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java new file mode 100644 index 0000000000..ec83b4b9b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyQuarterlyServiceImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyQuarterlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyQuarterlyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(agencyQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(agencyQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java new file mode 100644 index 0000000000..ebe9603a35 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedAgencyYearlyDao; +import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; +import com.epmet.service.stats.FactTagUsedAgencyYearlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * 标签【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyYearlyService { + + @Override + public int deleteByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.deleteByYearId(customerId,yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java new file mode 100644 index 0000000000..f88f1f330a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentDailyServiceImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentDailyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentDailyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentDailyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonthId(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java new file mode 100644 index 0000000000..e0411038be --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentMonthlyServiceImpl.java @@ -0,0 +1,70 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentMonthlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentMonthlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentMonthlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【部门】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentMonthlyService { + + + @Override + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,yearId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(gridMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java new file mode 100644 index 0000000000..bb51750412 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentQuarterlyServiceImpl.java @@ -0,0 +1,51 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【部门】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedDepartmentQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentQuarterlyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List deptQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(deptQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(deptQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java new file mode 100644 index 0000000000..d80eb5102c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java @@ -0,0 +1,47 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedDepartmentYearlyDao; +import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; +import com.epmet.service.stats.FactTagUsedDepartmentYearlyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * 标签【部门】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedDepartmentYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentYearlyService { + + @Override + public Integer deleteByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.deleteByYearId(customerId,yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java new file mode 100644 index 0000000000..95081992f2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridDailyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridDailyDao; +import com.epmet.entity.stats.FactTagUsedGridDailyEntity; +import com.epmet.service.stats.FactTagUsedGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 标签【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagUsedGridDailyServiceImpl extends BaseServiceImpl implements FactTagUsedGridDailyService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)){ + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId,i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagUsedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByMonthId(customerId,monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..05dc9a8942 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridMonthlyServiceImpl.java @@ -0,0 +1,67 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridMonthlyDao; +import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; +import com.epmet.service.stats.FactTagUsedGridMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridMonthlyService { + + @Override + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId,yearId); + } + + @Override + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId,monthId); + return this.insertBatch(gridMonthlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java new file mode 100644 index 0000000000..4e6bf21e2c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridQuarterlyServiceImpl.java @@ -0,0 +1,52 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridQuarterlyDao; +import com.epmet.entity.stats.FactTagUsedGridQuarterlyEntity; +import com.epmet.service.stats.FactTagUsedGridQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 标签【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridQuarterlyService { + + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(gridQuarterlyList)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId,quarterId); + return this.insertBatch(gridQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java new file mode 100644 index 0000000000..e25d32852f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.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.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagUsedGridYearlyDao; +import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; +import com.epmet.service.stats.FactTagUsedGridYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +/** + * 标签【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagUsedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridYearlyService { + + @Override + public Integer deleteByYearId(String customerId, String yearId) { + + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.deleteByYearId(customerId,yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java index 040f126cd8..125e46e962 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticlePublishRangeService.java @@ -18,7 +18,7 @@ package com.epmet.service.voice; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticlePublishRangeEntity; import java.util.Date; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java index e1aee5a20a..5477d54cd2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleService.java @@ -18,7 +18,7 @@ package com.epmet.service.voice; import com.epmet.commons.mybatis.service.BaseService; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import java.util.Date; @@ -55,4 +55,12 @@ public interface ArticleService extends BaseService { * @return */ List getAllGridPublishedCount(String customerId, Date publishDate); + + /** + * desc:根据客户id,发布时间 获取文章数据 + * @param customerId + * @param statsDate + * @return + */ + List getPublishedArticleByPublishTime(String customerId, Date statsDate); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java new file mode 100644 index 0000000000..43c0518792 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java @@ -0,0 +1,42 @@ +/** + * 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.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.entity.voice.ArticleTagsEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticleTagsService extends BaseService { + + /** + * desc:根据客户Id 创建时间获取 文章便签数据 + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java index 372ee5de50..8fc2f430cd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticlePublishRangeServiceImpl.java @@ -21,7 +21,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.voice.ArticlePublishRangeDao; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticlePublishRangeEntity; import com.epmet.service.voice.ArticlePublishRangeService; import lombok.extern.slf4j.Slf4j; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java index 82166605ed..08ce42e396 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleServiceImpl.java @@ -24,7 +24,7 @@ import com.epmet.commons.tools.exception.RenException; import com.epmet.constant.DataSourceConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dao.voice.ArticleDao; -import com.epmet.dto.stats.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.entity.voice.ArticleEntity; import com.epmet.service.voice.ArticleService; import org.apache.commons.lang3.StringUtils; @@ -45,25 +45,33 @@ public class ArticleServiceImpl extends BaseServiceImpl getAllDepartmentPublishedCount(String customerId, Date publishDate) { - if (StringUtils.isBlank(customerId) || publishDate == null){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } + checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_DEPT); } @Override public List getAllAgencyPublishedCount(String customerId, Date publishDate) { - if (StringUtils.isBlank(customerId) || publishDate == null){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } + checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_AGENCY); } @Override public List getAllGridPublishedCount(String customerId, Date publishDate) { - if (StringUtils.isBlank(customerId) || publishDate == null){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); - } + checkParam(customerId, publishDate); return baseDao.getAllPublishedCount(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID); } + + + + @Override + public List getPublishedArticleByPublishTime(String customerId, Date publishDate) { + checkParam(customerId, publishDate); + return baseDao.getPublishedArticleByDay(customerId,publishDate, ProjectConstant.PUBLISHER_TYPE_GRID); + } + + private void checkParam(String customerId, Date publishDate) { + if (StringUtils.isBlank(customerId) || publishDate == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java new file mode 100644 index 0000000000..d34e2f9e06 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.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.service.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleTagsDao; +import com.epmet.entity.voice.ArticleTagsEntity; +import com.epmet.service.voice.ArticleTagsService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章标签表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleTagsServiceImpl extends BaseServiceImpl implements ArticleTagsService { + + @Override + public List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime) { + this.checkParam(customerId,endTime,endTime); + return baseDao.getArticleTagsByDay(customerId,startTime, endTime); + } + private void checkParam(String customerId, Date starTime,Date endTime) { + if (StringUtils.isBlank(customerId) || starTime == null || endTime == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml index a8ea896aa1..bd19d31fd0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -3,26 +3,31 @@ - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml index 5fd7739c25..156a284376 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -3,22 +3,52 @@ - - - - - - - - - - - - - - - - + + + + DELETE FROM fact_tag_used_agency_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml index 8bdf8f1947..ccd42622a4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyQuarterlyDao.xml @@ -3,22 +3,7 @@ - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_agency_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml index 55b6b6d481..b3851f7b5a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyYearlyDao.xml @@ -3,22 +3,7 @@ - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_agency_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml index 8b2352e685..8e8fb7e9b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentDailyDao.xml @@ -3,27 +3,32 @@ - - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_department_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml index 58cfb41a8d..af8efb5266 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentMonthlyDao.xml @@ -3,22 +3,53 @@ - - - - - - - - - - - - - - - - + + + + DELETE FROM fact_tag_used_department_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml index 669cc48e5e..fab6a6b6f4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentQuarterlyDao.xml @@ -3,22 +3,8 @@ - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_department_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml index 223c11d725..e17b6fdf3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedDepartmentYearlyDao.xml @@ -3,22 +3,7 @@ - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_department_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml index 8a7e9a0508..1970dc22a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridDailyDao.xml @@ -2,27 +2,29 @@ - - - - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml index 24e1248529..67974a20e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridMonthlyDao.xml @@ -3,22 +3,54 @@ - - - - - - - - - - - - - - - - + + + + + DELETE FROM fact_tag_used_grid_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml index 5ce90cf523..dc35b17d52 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridQuarterlyDao.xml @@ -3,22 +3,9 @@ - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_grid_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml index b9a1ab68ac..e2501f4f3d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedGridYearlyDao.xml @@ -2,23 +2,9 @@ - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_used_grid_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml index 5d419f1683..22a4e138c6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml @@ -3,26 +3,5 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml index ae0f963af5..363a48027b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml @@ -3,22 +3,4 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml index 9c456d703e..fc6b5d4b11 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml @@ -3,22 +3,4 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml index 3e6f1bfff7..a2dc843964 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml @@ -3,22 +3,4 @@ - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml index ee9e94a49d..a5fca9a9dc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleDao.xml @@ -29,7 +29,7 @@ - SELECT ORG_ID AS agencyId, PUBLISHER_ID, @@ -38,14 +38,30 @@ FROM article WHERE - DEL_FLAG = 0 - AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} - AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR} + CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND PUBLISH_DATE + AND DEL_FLAG = 0 + AND PUBLISHER_TYPE = #{publisherType,jdbcType=VARCHAR} GROUP BY CUSTOMER_ID, PUBLISHER_ID + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml index 4b7f1cfc9b..154d617001 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticlePublishRangeDao.xml @@ -21,7 +21,7 @@ - SELECT AGENCY_ID, GRID_ID, @@ -37,7 +37,7 @@ CUSTOMER_ID, GRID_ID - SELECT GRID_ID, count(ID) publishedCount, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml new file mode 100644 index 0000000000..94202f337a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 7968b940bbe8a602ec4048889afe0589b67650b8 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Sat, 20 Jun 2020 10:11:26 +0800 Subject: [PATCH 052/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/GroupConstant.java | 13 + .../java/com/epmet/dto/group/AgencyDTO.java | 44 ++++ .../form/AgencyGridTotalCountFormDTO.java | 25 ++ .../dto/group/form/AgencyMonthlyFormDTO.java | 116 +++++++++ .../AgencyGridGroupPeopleResultDTO.java | 35 +++ .../AgencyGridGroupPeopleTotalResultDTO.java | 30 +++ .../group/result/AgencyGridInfoResultDTO.java | 27 +++ .../result/AgencyGridTotalCountResultDTO.java | 27 +++ .../result/AgencyGroupDailyResultDTO.java | 126 ++++++++++ .../result/AgencyGroupIncrResultDTO.java | 29 +++ .../result/AgencyGroupMonthlyResultDTO.java | 25 ++ .../AgencyGroupTotalCountResultDTO.java | 31 +++ .../group/result/GroupGridDailyResultDTO.java | 10 +- .../result/GroupPeopleCountResultDTO.java | 25 ++ .../group/result/SubAgencyIdResultDTO.java | 30 +++ .../controller/StatsGroupController.java | 52 +++- .../com/epmet/dao/group/GroupDataDao.java | 41 +++- .../com/epmet/dao/org/CustomerGridDao.java | 9 + .../com/epmet/dao/stats/DimAgencyDao.java | 14 ++ .../java/com/epmet/dao/stats/DimGridDao.java | 21 +- .../dao/stats/FactGroupAgencyDailyDao.java | 27 +++ .../dao/stats/FactGroupAgencyMonthlyDao.java | 11 + .../com/epmet/service/StatsGroupService.java | 14 +- .../epmet/service/group/GroupDataService.java | 45 +++- .../group/impl/GroupDataServiceImpl.java | 123 ++++++++-- .../service/impl/StatsGroupServiceImpl.java | 225 ++++++++++++++++-- .../service/org/CustomerGridService.java | 9 + .../org/impl/CustomerGridServiceImpl.java | 12 + .../epmet/service/stats/DimAgencyService.java | 14 ++ .../epmet/service/stats/DimGridService.java | 17 ++ .../stats/FactGroupAgencyDailyService.java | 25 ++ .../stats/FactGroupAgencyMonthlyService.java | 9 + .../stats/impl/DimAgencyServiceImpl.java | 20 ++ .../stats/impl/DimGridServiceImpl.java | 23 ++ .../impl/FactGroupAgencyDailyServiceImpl.java | 41 ++++ .../FactGroupAgencyMonthlyServiceImpl.java | 15 ++ .../impl/FactGroupGridDailyServiceImpl.java | 4 + .../resources/mapper/group/GroupDataDao.xml | 90 +++++++ .../resources/mapper/org/CustomerGridDao.xml | 16 ++ .../resources/mapper/stats/DimAgencyDao.xml | 25 ++ .../resources/mapper/stats/DimGridDao.xml | 41 +++- .../mapper/stats/FactGroupAgencyDailyDao.xml | 78 ++++++ .../stats/FactGroupAgencyMonthlyDao.xml | 35 +++ 43 files changed, 1564 insertions(+), 85 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/AgencyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyGridTotalCountFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleTotalResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridInfoResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridTotalCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupIncrResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupMonthlyResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupTotalCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupPeopleCountResultDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/SubAgencyIdResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java index b5465e4a7b..255b463cdb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java @@ -16,4 +16,17 @@ public interface GroupConstant { */ String Q = "Q"; + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级: province + */ + String COMMUNITY = "community"; + String STREET = "street"; + String DISTRICT = "district"; + String CITY = "city"; + String PROVINCE = "province"; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/AgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/AgencyDTO.java new file mode 100644 index 0000000000..767adaad61 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/AgencyDTO.java @@ -0,0 +1,44 @@ +package com.epmet.dto.group; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 11:06 + */ +@Data +public class AgencyDTO implements Serializable { + + private static final long serialVersionUID = -1644032762160525169L; + + /** + * 组织ID AGENCY_ID + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 机关级别(社区级:community, + * 乡(镇、街道)级:street, + * 区县级: district, + * 市级: city + * 省级:province) + */ + private String level; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyGridTotalCountFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyGridTotalCountFormDTO.java new file mode 100644 index 0000000000..5990fd7de5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyGridTotalCountFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 14:39 + */ +@Data +public class AgencyGridTotalCountFormDTO implements Serializable { + + private static final long serialVersionUID = -4219157085337388583L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java new file mode 100644 index 0000000000..32c14a94a9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java @@ -0,0 +1,116 @@ +package com.epmet.dto.group.form; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +/** + * @Author zxc + * @CreateTime 2020/6/19 21:22 + */ +@Data +public class AgencyMonthlyFormDTO implements Serializable { + + private static final long serialVersionUID = -5920961528060576749L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份ID 关联月份dim表 + */ + private String monthId; + + /** + * 统计季度ID + */ + private String quarterId; + + /** + * 统计年份ID + */ + private String yearId; + + /** + * 网格数 截至到月末的机关下网格数 + */ + private Integer gridTotal = 0; + + /** + * 小组数 截止到月末的新增数(该月内所有的新增数字之和) + */ + private Integer groupTotal = 0; + + /** + * 机关下网格组内总人数 不去重 + */ + private Integer groupMemberTotal = 0; + + /** + * 小组平均人数 月末一天的平均数 + */ + private Integer groupMemberAvgCount = 0; + + /** + * 小组中位数 月末一天的中位数(人) + */ + private Integer groupMedian = 0; + + /** + * 小组增量 + */ + private Integer groupIncr = 0; + + /** + * 小组成员最大数 + */ + private Integer groupMemberMaxCount = 0; + + /** + * 成员最多小组ID + */ + private String maxMemberGroupId; + + /** + * 小组成员最小数 + */ + private Integer groupMemberMinCount = 0; + + /** + * 成员最少小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag = "0"; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleResultDTO.java new file mode 100644 index 0000000000..9c96b40583 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class AgencyGridGroupPeopleResultDTO implements Serializable { + + private static final long serialVersionUID = 225708056690809761L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组ID + */ + private String groupId; + + /** + * 网格下-每个小组内成员的数量【人员状态 不为 removed】 + */ + private Integer groupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleTotalResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleTotalResultDTO.java new file mode 100644 index 0000000000..5d1b2f259e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridGroupPeopleTotalResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/16 16:31 + */ +@Data +public class AgencyGridGroupPeopleTotalResultDTO implements Serializable { + + private static final long serialVersionUID = -8693107487048855351L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格下的小组成员总数量 + */ + private Integer gridGroupPeopleTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridInfoResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridInfoResultDTO.java new file mode 100644 index 0000000000..ea51f65bf4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridInfoResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 14:35 + */ +@Data +public class AgencyGridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -1979735889806617714L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridTotalCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridTotalCountResultDTO.java new file mode 100644 index 0000000000..73ccde44d3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGridTotalCountResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 14:35 + */ +@Data +public class AgencyGridTotalCountResultDTO implements Serializable { + + private static final long serialVersionUID = -3528033317344272299L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 机关下的网格数量 + */ + private Integer gridTotal; + + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java new file mode 100644 index 0000000000..3858767dda --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java @@ -0,0 +1,126 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 10:09 + */ +@Data +public class AgencyGroupDailyResultDTO implements Serializable { + + private static final long serialVersionUID = 7862398525119326819L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dim表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 网格总数 截至统计日期 + */ + private Integer gridTotal = 0; + + /** + * 网格小组数(包含所有下级机关的网格小组) 截至统计日期 + */ + private Integer groupTotalCount = 0; + + /** + * 机关下网格小组人数总计 不去重 + */ + private Integer groupMemberTotalCount = 0; + + /** + * 小组平均人数 截至统计日期 + */ + private Integer groupMemberAvgCount = 0; + + /** + * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 + */ + private Integer groupMedian = 0; + + /** + * 当天小组增量 + */ + private Integer groupIncr = 0; + + /** + * 小组最大成员数 + */ + private Integer groupMemberMaxCount = 0; + + /** + * 最多成员小组ID + */ + private String maxMemberGroupId; + + /** + * 小组最小成员数 + */ + private Integer groupMemberMinCount = 0; + + /** + * 最少成员小组ID + */ + private String minMemberGroupId; + + /** + * 删除标识 未删除:0,已删除:1 + */ + private String delFlag = "0"; + + /** + * 乐观锁 + */ + private Integer revision = 0; + + /** + * 创建人 + */ + private String createdBy = "APP_USER"; + + /** + * 更新人 + */ + private String updatedBy = "APP_USER"; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupIncrResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupIncrResultDTO.java new file mode 100644 index 0000000000..dcf9a9694c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupIncrResultDTO.java @@ -0,0 +1,29 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/17 16:48 + */ +@Data +public class AgencyGroupIncrResultDTO implements Serializable { + + private static final long serialVersionUID = 8397311844636364561L; + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组日增数 + */ + private Integer groupIncr = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupMonthlyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupMonthlyResultDTO.java new file mode 100644 index 0000000000..354eb918e7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupMonthlyResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/19 22:12 + */ +@Data +public class AgencyGroupMonthlyResultDTO implements Serializable { + + private static final long serialVersionUID = 8436524201080875660L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 小组月增长数量 + */ + private Integer monthGroupIncr; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupTotalCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupTotalCountResultDTO.java new file mode 100644 index 0000000000..069bddcfd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupTotalCountResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/18 17:35 + */ +@Data +public class AgencyGroupTotalCountResultDTO implements Serializable { + + private static final long serialVersionUID = 1166957004076377211L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 每个网格下的小组数 + */ + private Integer gridGroupCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java index 23a9312e63..b33c9c38ad 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java @@ -66,17 +66,17 @@ public class GroupGridDailyResultDTO implements Serializable { /** * 网格下所有组内总人数 不去重 */ - private Integer groupMemberTotal; + private Integer groupMemberTotal = 0; /** * 小组平均人数 */ - private Integer groupMemberAvgCount; + private Integer groupMemberAvgCount = 0; /** * 小组中位数 截至统计日期,小组人数依次由小到大排开取中位数 */ - private Integer groupMedian; + private Integer groupMedian = 0; /** * 小组增量 @@ -86,7 +86,7 @@ public class GroupGridDailyResultDTO implements Serializable { /** * 小组成员最大数 */ - private Integer groupMemberMaxCount; + private Integer groupMemberMaxCount = 0; /** * 最多成员小组ID @@ -96,7 +96,7 @@ public class GroupGridDailyResultDTO implements Serializable { /** * 小组成员最小数 */ - private Integer groupMemberMinCount = 1; + private Integer groupMemberMinCount = 0; /** * 最少成员小组ID diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupPeopleCountResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupPeopleCountResultDTO.java new file mode 100644 index 0000000000..6cfa4ed9f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupPeopleCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/19 15:43 + */ +@Data +public class GroupPeopleCountResultDTO implements Serializable { + + private static final long serialVersionUID = 7804052387414894768L; + + /** + * 小组ID + */ + private String groupId; + + /** + * 网格下-每个小组内成员的数量【人员状态 不为 removed】 + */ + private Integer groupCount; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/SubAgencyIdResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/SubAgencyIdResultDTO.java new file mode 100644 index 0000000000..8690179371 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/SubAgencyIdResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/19 10:41 + */ +@Data +public class SubAgencyIdResultDTO implements Serializable { + + private static final long serialVersionUID = -5375229459340391098L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 下级机关ID + */ + private String subAgencyId; + + /** + * 网格数量 + */ + private Integer gridTotal; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java index 7f2dd5ee76..c33979545d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -1,14 +1,15 @@ package com.epmet.controller; -import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.service.StatsGroupService; -import com.epmet.service.group.GroupDataService; -import com.epmet.service.stats.FactGroupGridDailyService; +import com.epmet.service.stats.DimCustomerService; 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; +import java.util.List; + /** * @Author zxc * @CreateTime 2020/6/16 13:21 @@ -19,18 +20,59 @@ public class StatsGroupController { @Autowired private StatsGroupService statsGroupService; + @Autowired + private DimCustomerService dimCustomerService; /** - * @Description 统计 “小组” 有关数据, dim:【网格-日】 * 网格数、小组数、网格下所有组内人数(不去重) * 小组平均人数、小组人数中位数、小组增量 * 小组成员最大数、最多成员小组ID * 小组成员最小数、最少成员小组ID + */ + + /** + * @Description 统计 “网格小组”, dim:【网格-日】 * @author zxc */ @PostMapping("groupgriddaily") public void groupGridDaily(){ - statsGroupService.groupGridDaily(); + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() == NumConstant.ZERO){ + return; + } + customerIds.forEach(customerId -> { + statsGroupService.groupGridDaily(customerId); + }); + } + + /** + * @Description 统计 “网格小组”, dim:【机关-日】 + * @param + * @author zxc + */ + @PostMapping("groupagencydaily") + public void groupAgencyDaily(){ + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() == NumConstant.ZERO){ + return; + } + customerIds.forEach(customerId -> { + statsGroupService.groupAgencyDaily(customerId); + }); + } + + /** + * @Description 统计 “网格小组”, dim:【机关-月】 + * @param + * @author zxc + */ + @PostMapping("groupagencymonthly") + public void groupAgencyMonthly(){ + statsGroupService.groupAgencyMonthly(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index bd93d50689..5a226cad20 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -4,11 +4,9 @@ import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; -import com.epmet.dto.group.result.GridGroupPeopleResultDTO; -import com.epmet.dto.group.result.GridGroupPeopleTotalResultDTO; -import com.epmet.dto.group.result.GridGroupTotalResultDTO; -import com.epmet.dto.group.result.GroupIncrResultDTO; +import com.epmet.dto.group.result.*; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -47,4 +45,39 @@ public interface GroupDataDao { */ List selectGroupIncr(GroupIncrFormDTO formDTO); + /** + * @Description 获取机关下网格下的小组数量 【待优化】 + * @param + * @author zxc + */ + List getAgencyGroupTotalCount(@Param("allGrid") List allGrid); + + /** + * @Description 查询机关下网格内的小组人数 【待优化】 + * @param + * @author zxc + */ + List selectAgencyGridGroupPeopleTotal(@Param("allGrid") List allGrid); + + /** + * @Description 查询机关下每个小组的人数 【待优化】 + * @param + * @author zxc + */ + List selectAgencyEveryGroupPeopleCount(@Param("allGrid") List allGrid); + + /** + * @Description 查询机关下的小组日增数 【待优化】 + * @param + * @param yesterday + * @author zxc + */ + List selectAgencyGroupIncr(@Param("allGrid") List allGrid,@Param("yesterday")String yesterday); + + /** + * @Description 查询机关下所有网格小组人数 + * @param gridIds + * @author zxc + */ + List getAgencyGrid(@Param("gridIds")List gridIds); } 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 ee1547a190..4b2c3621b3 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 @@ -18,6 +18,8 @@ package com.epmet.dao.org; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.entity.org.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -41,4 +43,11 @@ public interface CustomerGridDao extends BaseDao { * @return */ List listGridsByCreateTime(@Param("start") Date start, @Param("end") Date end); + + /** + * @Description 查询机关下的网格总数 + * @param formDto + * @author zxc + */ + List selectAgencyGridTotalCount(@Param("formDto") List formDto, @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 f4d1477562..3c70225c26 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 @@ -109,4 +109,18 @@ public interface DimAgencyDao extends BaseDao { * @date 2020.06.18 09:26 **/ List selectTopAgencyWithDept(); + + /** + * @Description 查询所有客户的机关数据 + * @author zxc + */ + List selectDimAgencyByCustomerId(@Param("customerId")String customerId); + + /** + * @Description 根据机关Id获取上级机关ID + * @param agencyId + * @author zxc + */ + String getPidByAgencyId(@Param("agencyId") String agencyId); + } \ 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 0582f19669..669e8a08a0 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 @@ -18,7 +18,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.group.result.CustomerGridInfoResultDTO; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridInfoResultDTO; +import com.epmet.dto.group.result.SubAgencyIdResultDTO; import com.epmet.entity.stats.DimGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,13 +38,24 @@ public interface DimGridDao extends BaseDao { DimGridEntity getLastCreatedGridDimEntity(); - - List selectCustomerGrid(); - /** * desc:根据客户Id获取 该客户下的网格数据 * @param customerId * @return */ List getGridListByCustomerId(@Param("customerId") String customerId); + + /** + * @Description 查询机关下的网格 + * @param formDTO + * @author zxc + */ + List selectAgencyGridInfo(@Param("formDTO") List formDTO); + + /** + * @Description 根据当前机关ID查询下级机关ID + * @param formDTO + * @author zxc + */ + List selectSubAgencyId(@Param("formDTO")List formDTO); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java index 6a3f343a9a..aaf4312dd9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -18,8 +18,14 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; +import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; import com.epmet.entity.stats.FactGroupAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 组-机关日统计数据 @@ -29,5 +35,26 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactGroupAgencyDailyDao extends BaseDao { + + /** + * @Description 插入网格小组数据 【机关-日】 + * @param agencyList + * @author zxc + */ + void insertGroupAgencyDaily(@Param("agencyList") List agencyList); + + /** + * @Description 获取 网格小组【机关-日统计】的最后一天数据 + * @param + * @author zxc + */ + List getLastDayAgency(); + + /** + * @Description 查询 月的小组增量 + * @param monthId + * @author zxc + */ + List getMonthGroupIncr(@Param("monthId")String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java index 7928b13b0a..0e0ed99f21 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 组-机关月统计数据 @@ -29,5 +33,12 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactGroupAgencyMonthlyDao extends BaseDao { + + /** + * @Description 统计网格小组 【机关-月】 + * @param agencyMonth + * @author zxc + */ + void insertAgencyGroupMonthly(@Param("agencyMonth") List agencyMonth); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index d792170796..8042fd0c83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -10,6 +10,18 @@ public interface StatsGroupService { * @Description 统计 “小组” 有关数据, dim:【网格-日】 * @author zxc */ - void groupGridDaily(); + void groupGridDaily(String customerId); + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-日】 + * @author zxc + */ + void groupAgencyDaily(String customerId); + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-月】 + * @author zxc + */ + void groupAgencyMonthly(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index 2b921314cb..babd6e6503 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -1,7 +1,9 @@ package com.epmet.service.group; -import com.epmet.dto.group.result.CustomerGridInfoResultDTO; -import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.dto.group.result.*; +import com.epmet.entity.stats.DimGridEntity; +import com.epmet.util.DimIdGenerator; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -14,9 +16,44 @@ public interface GroupDataService { /** * @Description 统计 “小组” 有关数据, dim:【网格-日】 * @param customerId - * @param gridsInfo * @author zxc */ - List groupGridDaily(String customerId, List gridsInfo); + List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List gridsInfo); + + /** + * @Description 获取同级机关下网格下的小组数量 + * @param allGrid + * @author zxc + */ + List getAgencyGroupTotalCount(List allGrid); + + /** + * @Description 查询机关下网格内的小组人数 + * @param + * @author zxc + */ + List selectAgencyGridGroupPeopleTotal(List allGrid); + + /** + * @Description 查询机关下每个小组的人数 + * @param + * @author zxc + */ + List selectAgencyEveryGroupPeopleCount(List allGrid); + + /** + * @Description 查询机关下的小组日增数 + * @param + * @param yesterday + * @author zxc + */ + List selectAgencyGroupIncr(List allGrid,String yesterday); + + /** + * @Description 查询机关下所有网格小组人数 + * @param gridIds + * @author zxc + */ + List getAgencyGrid(@Param("gridIds") List gridIds); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 01a8cd979d..2ee8c38550 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -4,18 +4,18 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.group.GroupDataDao; -import com.epmet.dao.stats.DimDateDao; import com.epmet.dto.group.form.GridGroupPeopleFormDTO; import com.epmet.dto.group.form.GridGroupPeopleTotalFormDTO; import com.epmet.dto.group.form.GridGroupTotalFormDTO; import com.epmet.dto.group.form.GroupIncrFormDTO; import com.epmet.dto.group.result.*; +import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.group.GroupDataService; +import com.epmet.util.DimIdGenerator; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.time.LocalDate; import java.util.*; import java.util.stream.Collectors; @@ -29,41 +29,47 @@ public class GroupDataServiceImpl implements GroupDataService { @Autowired private GroupDataDao groupDataDao; - @Autowired - private DimDateDao dimDateDao; - - public DimTimeResultDTO getTimeDim(){ - String dateId = LocalDate.now().minusDays(NumConstant.ONE).toString().replace("-", ""); - return dimDateDao.selectDimTime(dateId); - } /** * @Description 统计 “小组” 有关数据, dim:【网格-日】 * @param customerId - * @param gridsInfo * @author zxc */ @Override - public List groupGridDaily(String customerId, List gridsInfo) { - DimTimeResultDTO dimTime = this.getTimeDim(); + public List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List gridsInfo) { List result = new ArrayList<>(); - - // 1. 网格下有多少小组,只算 state = ‘approved’ - GridGroupTotalFormDTO formDTO = new GridGroupTotalFormDTO(); - formDTO.setCustomerId(customerId); - List gridGroupTotalResultDTOS = groupDataDao.selectGridGroupTotal(formDTO); + if (gridsInfo.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } gridsInfo.forEach(grid -> { GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); BeanUtils.copyProperties(dimTime,dailyResult); dailyResult.setAgencyId(grid.getAgencyId()); - gridGroupTotalResultDTOS.forEach(groupTotal -> { - if (grid.getGridId().equals(groupTotal.getGridId())){ - dailyResult.setGroupTotal(groupTotal.getGridGroupTotal()); - dailyResult.setGridId(grid.getGridId()); - } - }); + dailyResult.setGridId(grid.getId()); result.add(dailyResult); }); + + // 1. 网格下有多少小组,只算 state = ‘approved’ + GridGroupTotalFormDTO formDTO = new GridGroupTotalFormDTO(); + formDTO.setCustomerId(customerId); + List gridGroupTotalResultDTOS = groupDataDao.selectGridGroupTotal(formDTO); + if (gridGroupTotalResultDTOS.size() == NumConstant.ZERO){ + result.forEach(grid -> { + grid.setGroupTotal(NumConstant.ZERO); + }); + }else { + result.forEach(grid -> { + GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); + BeanUtils.copyProperties(dimTime, dailyResult); + dailyResult.setAgencyId(grid.getAgencyId()); + gridGroupTotalResultDTOS.forEach(groupTotal -> { + if (grid.getGridId().equals(groupTotal.getGridId())) { + dailyResult.setGroupTotal(groupTotal.getGridGroupTotal()); + } + }); + + }); + } // 2. 网格下所有组内人数和(不需要去重) 人员状态 != "removed" GridGroupPeopleTotalFormDTO peopleTotalFormDTO = new GridGroupPeopleTotalFormDTO(); peopleTotalFormDTO.setCustomerId(customerId); @@ -77,9 +83,9 @@ public class GroupDataServiceImpl implements GroupDataService { }); // 3. 网格下小组平均人数 result.forEach(grid -> { - grid.setGroupMemberAvgCount(grid.getGroupMemberTotal()/grid.getGroupTotal()); + grid.setGroupMemberAvgCount(grid.getGroupTotal() == NumConstant.ZERO ? NumConstant.ZERO : grid.getGroupMemberTotal()/grid.getGroupTotal()); }); - // 4. 网格下小组人数中位数 + // 4. 网格下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID GridGroupPeopleFormDTO everyGroupPeople = new GridGroupPeopleFormDTO(); everyGroupPeople.setCustomerId(customerId); List everyGroupPeopleCount = groupDataDao.selectEveryGroupPeopleCount(everyGroupPeople); @@ -105,7 +111,7 @@ public class GroupDataServiceImpl implements GroupDataService { } }); }); - //TODO 网格下小组增量 + // 5. 网格下小组增量 GroupIncrFormDTO groupIncr = new GroupIncrFormDTO(); groupIncr.setCustomerId(customerId); groupIncr.setYesterday(dimTime.getDateId()); @@ -119,4 +125,69 @@ public class GroupDataServiceImpl implements GroupDataService { }); return result; } + + /** + * @Description 获取同级机关下网格下的小组数量 + * @param + * @author zxc + */ + public List getAgencyGroupTotalCount(List allGrid){ + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.getAgencyGroupTotalCount(allGrid); + } + + /** + * @Description 查询机关下网格内的小组人数 + * @param + * @author zxc + */ + @Override + public List selectAgencyGridGroupPeopleTotal(List allGrid) { + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid); + } + + /** + * @Description 查询机关下每个小组的人数 + * @param + * @author zxc + */ + public List selectAgencyEveryGroupPeopleCount(List allGrid){ + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid); + } + + /** + * @Description 查询机关下的小组日增数 + * @param + * @param yesterday + * @author zxc + */ + public List selectAgencyGroupIncr(List allGrid,String yesterday){ + if (allGrid.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.selectAgencyGroupIncr(allGrid, yesterday); + } + + /** + * @Description 查询机关下所有网格小组人数 + * @param gridIds + * @author zxc + */ + @Override + public List getAgencyGrid(List gridIds) { + if (gridIds.size() == NumConstant.ZERO){ + return new ArrayList<>(); + } + return groupDataDao.getAgencyGrid(gridIds); + } + + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index f647c7439a..df312995fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,19 +1,26 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.dao.stats.DimGridDao; -import com.epmet.dao.stats.FactGroupGridDailyDao; -import com.epmet.dto.group.result.CustomerGridInfoResultDTO; -import com.epmet.dto.group.result.GroupGridDailyResultDTO; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.*; +import com.epmet.dto.stats.DimAgencyDTO; +import com.epmet.entity.stats.DimAgencyEntity; +import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; -import com.epmet.service.stats.FactGroupGridDailyService; +import com.epmet.service.stats.*; +import com.epmet.util.DimIdGenerator; +import com.epmet.util.ModuleConstant; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.time.LocalDate; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.util.*; import java.util.stream.Collectors; /** @@ -24,11 +31,17 @@ import java.util.stream.Collectors; public class StatsGroupServiceImpl implements StatsGroupService { @Autowired - private DimGridDao dimGridDao; + private DimGridService dimGridService; + @Autowired + private DimAgencyService dimAgencyService; @Autowired private GroupDataService groupDataService; @Autowired private FactGroupGridDailyService factGroupGridDailyService; + @Autowired + private FactGroupAgencyDailyService factGroupAgencyDailyService; + @Autowired + private FactGroupAgencyMonthlyService factGroupAgencyMonthlyService; /** * @Description 统计【网格-日】 @@ -36,25 +49,189 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc */ @Override - public void groupGridDaily() { + public void groupGridDaily(String customerId) { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); + List gridsInfo = dimGridService.getGridListByCustomerId(customerId); + List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + } + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-日】 + * @author zxc + */ + @Override + public void groupAgencyDaily(String customerId) { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); + List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily); + + } + + /** + * @Description 统计 “小组” 有关数据, dim:【机关-月】 + * @author zxc String customerId + */ + @Override + public void groupAgencyMonthly() { + List lastDayAgency = factGroupAgencyDailyService.getLastDayAgency(); + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); + List monthGroupIncr = factGroupAgencyDailyService.getMonthGroupIncr(dimIdBean.getMonthId()); + if (monthGroupIncr.size() == NumConstant.ZERO){ + lastDayAgency.forEach(agency -> { + agency.setGroupIncr(NumConstant.ZERO); + }); + }else { + lastDayAgency.forEach(agency -> { + monthGroupIncr.forEach(monthIncr -> { + if (agency.getAgencyId().equals(monthIncr.getAgencyId())){ + agency.setGroupIncr(monthIncr.getMonthGroupIncr()); + } + }); + }); + } + factGroupAgencyMonthlyService.insertAgencyGroupMonthly(lastDayAgency); + } - //每个客户下的网格信息 - List customerGridInfos = dimGridDao.selectCustomerGrid(); - if (customerGridInfos.size() == NumConstant.ZERO){ - return; + public List getAgencyGroupDaily(List customerAgencyInfos, DimIdGenerator.DimIdBean timeDim,String customerId){ + if (customerAgencyInfos.size() == NumConstant.ZERO){ + return new ArrayList<>(); } - //根据customerId分组 - Map> collect = customerGridInfos.stream().collect(Collectors.groupingBy(gridInfo -> gridInfo.getCustomerId())); - Set>> entries = collect.entrySet(); - entries.forEach(customerGridInfo -> { - String customerId = customerGridInfo.getKey(); - List gridsInfo = customerGridInfo.getValue(); - if (gridsInfo.size() != NumConstant.ZERO){ - List resultDTOS = groupDataService.groupGridDaily(customerId, gridsInfo); - //执行插入 fact_group_grid_daily - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + List result = new ArrayList<>(); + List agencyList = dimAgencyService.getAgencyListByCustomerId(customerId); + agencyList.forEach(agency -> { + AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); + String agencyId = agency.getId(); + agencyResult.setAgencyId(agencyId); + BeanUtils.copyProperties(timeDim,agencyResult); + //机关下的所有网格(包括直属网格) + List allGrid = this.getAllGrid(agencyId); + String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); + agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); + // TODO 1. 机关下有多少网格 + agencyResult.setGridTotal(allGrid.size()); + + // TODO 2. 机关下有多少小组,只算 state = ‘approved’ + List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid); + Integer groupCount = agencyGroupTotalCount.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); + agencyResult.setGroupTotalCount(groupCount); + // TODO 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" + List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid); + Integer groupPeopleCount = agencyGridGroupPeopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); + agencyResult.setGroupMemberTotalCount(groupPeopleCount); + + // TODO 4. 机关下小组平均人数 + agencyResult.setGroupMemberAvgCount( + agencyResult.getGroupTotalCount() == NumConstant.ZERO ? NumConstant.ZERO : + agencyResult.getGroupMemberTotalCount()/agencyResult.getGroupTotalCount()); + + // TODO 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID + List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid); + List sorted = agencyGridGroupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); + Integer groupPeopleMedian; + if (sorted.size() == NumConstant.ONE){ + agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + }else if (sorted.size() >= NumConstant.TWO){ + groupPeopleMedian = sorted.size() % 2 == 0 ? + (sorted.get(sorted.size() / 2 - 1).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : + sorted.get(sorted.size() / 2).getGroupCount(); + agencyResult.setGroupMedian(groupPeopleMedian); + + agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); + agencyResult.setMaxMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); + agencyResult.setGroupMemberMinCount(sorted.get(sorted.size() - NumConstant.ONE).getGroupCount()); + agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId()); + } + // TODO 6. 机关下小组增量 + List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, timeDim.getDateId()); + Integer groupIncr = agencyGroupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr)); + agencyResult.setGroupIncr(groupIncr); + result.add(agencyResult); + }); + return result; + } + + /** + * @Description 根据当前机关ID,查询出直属网格和所有下级机关的网格 + * @param agencyId + * @author zxc + */ + public List getAllGrid(String agencyId){ + List result = new ArrayList<>(); + List allAgency = dimAgencyService.getAllAgency(); + + Map> subGridOfAgency = new HashMap<>(); + allAgency.forEach(agency -> { + this.initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); + }); + Set>> entries = subGridOfAgency.entrySet(); + entries.forEach(entry -> { + String key = entry.getKey(); + Set value = entry.getValue(); + if (key.equals(agencyId)){ + result.addAll(value); + } + }); + return result; + } + + /** + * @Description 递归获取机关下的网格id【包括直属机关】 + * @param pid + * @param agency + * @param subGridOfAgency + * @author zxc + */ + void initAgencyGridMap(String pid, AgencySubTreeDto agency, Map> subGridOfAgency){ + + //向map中放入数据 + if(subGridOfAgency.containsKey(pid)){ + //包含key + Set grids = subGridOfAgency.get(pid); + if(null == grids){ + grids = new HashSet<>(); + subGridOfAgency.put(pid,grids); + } + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + grids.addAll(agency.getGridIds()); } + }else{ + //不包含key + Set grids = new HashSet<>(agency.getGridIds()); + subGridOfAgency.put(pid,grids); + } + + //定义递归出口 + if(StringUtils.equals(ModuleConstant.AGENCY_LEVEL_COMMUNITY,agency.getLevel()) || null == agency.getSubAgencies() || agency.getSubAgencies().size() == NumConstant.ZERO){ + return ; + } + + + //定义递归入口 + agency.getSubAgencies().forEach(obj -> { + initAgencyGridMap(pid,obj,subGridOfAgency); }); + } + + /** + * @Description 获取时间维度 dateId--weekId--monthId--quarterId--yearId + * @param + * @author zxc + */ + public DimIdGenerator.DimIdBean getDimIdBean(){ + ZoneId zoneId = ZoneId.systemDefault(); + LocalDate localDate = LocalDate.now(); + ZonedDateTime zdt = localDate.atStartOfDay(zoneId); + Date date = Date.from(zdt.toInstant()); + return DimIdGenerator.getDimIdBean(date); + } + + public List getAgencyAllGrid(String customerId,String agencyId){ + return null; } } 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 b8308aede1..2c7c0f523c 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 @@ -1,5 +1,7 @@ package com.epmet.service.org; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.entity.org.CustomerGridEntity; import java.util.Date; @@ -14,4 +16,11 @@ public interface CustomerGridService { * @Param("start") Date start, @Param("end") Date end */ List listGridsByCreateTime(Date start, Date end); + + /** + * @Description 查询机关下有多少网格 + * @param community + * @author zxc + */ + List selectAgencyGridTotalCount(List community, String dateId); } 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 191b074d19..3e2c071400 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 @@ -3,6 +3,8 @@ package com.epmet.service.org.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.org.CustomerGridDao; +import com.epmet.dto.group.AgencyDTO; +import com.epmet.dto.group.result.AgencyGridTotalCountResultDTO; import com.epmet.entity.org.CustomerGridEntity; import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -22,4 +24,14 @@ public class CustomerGridServiceImpl implements CustomerGridService { public List listGridsByCreateTime(Date start, Date end) { return customerGridDao.listGridsByCreateTime(start, end); } + + /** + * @Description 查询机关下有多少网格 + * @param community + * @author zxc + */ + @Override + public List selectAgencyGridTotalCount(List community, String dateId) { + return customerGridDao.selectAgencyGridTotalCount(community,dateId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java index fe9fbd9765..95c305943d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/DimAgencyService.java @@ -159,4 +159,18 @@ public interface DimAgencyService extends BaseService { * @date 2020.06.18 09:45 **/ List getTopAgencyWithDept(); + + /** + * @Description 根据customerId获取机关信息 + * @param customerId + * @author zxc + */ + List getAgencyInfoByCustomerId(String customerId); + + /** + * @Description 根据机关Id获取上级机关ID + * @param agencyId + * @author zxc + */ + String getPidByAgencyId(String agencyId); } \ 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 c31774399f..312659eb96 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 @@ -19,6 +19,9 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +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.entity.stats.DimGridEntity; import com.epmet.entity.stats.LastExecRecordEntity; @@ -111,4 +114,18 @@ public interface DimGridService extends BaseService { * @author: jianjun liu */ List getGridListByCustomerId(String customerId); + + /** + * @Description 查询机关下的网格 + * @param formDTO + * @author zxc + */ + List selectAgencyGridInfo(List formDTO); + + /** + * @Description 根据当前机关ID查询下级机关ID + * @param formDTO + * @author zxc + */ + List selectSubAgencyId(List formDTO); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java index 3801b7b9b2..30ff917431 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -19,8 +19,12 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; +import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; import com.epmet.dto.stats.FactGroupAgencyDailyDTO; import com.epmet.entity.stats.FactGroupAgencyDailyEntity; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -92,4 +96,25 @@ public interface FactGroupAgencyDailyService extends BaseService agencyList); + + /** + * @Description 获取 网格小组【机关-日统计】的最后一天数据 + * @param + * @author zxc + */ + List getLastDayAgency(); + + /** + * @Description 查询 月的小组增量 + * @param monthId + * @author zxc + */ + List getMonthGroupIncr(String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java index 7e851aa6da..75e43242c7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyMonthlyService.java @@ -19,8 +19,10 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.stats.FactGroupAgencyMonthlyDTO; import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; +import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -92,4 +94,11 @@ public interface FactGroupAgencyMonthlyService extends BaseService agencyMonth); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 0c86f00ef4..16e627c42c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -201,4 +201,24 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAgencyInfoByCustomerId(String customerId) { + return baseDao.selectDimAgencyByCustomerId(customerId); + } + + /** + * @Description 根据机关Id获取上级机关ID + * @param agencyId + * @author zxc + */ + @Override + public String getPidByAgencyId(String agencyId) { + return baseDao.getPidByAgencyId(agencyId); + } + } \ 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 1caeb9d473..72bdafb3c4 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 @@ -28,6 +28,9 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimGridDao; import com.epmet.dao.stats.LastExecRecordDao; +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.entity.stats.DimGridEntity; import com.epmet.entity.stats.LastExecRecordEntity; @@ -133,4 +136,24 @@ public class DimGridServiceImpl extends BaseServiceImpl selectAgencyGridInfo(List formDTO) { + return baseDao.selectAgencyGridInfo(formDTO); + } + + /** + * @Description 根据当前机关ID查询下级机关ID + * @param formDTO + * @author zxc + */ + @Override + public List selectSubAgencyId(List formDTO) { + return baseDao.selectSubAgencyId(formDTO); + } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java index 7f2822e763..dc34d3b9e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -20,10 +20,14 @@ 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.constant.NumConstant; 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.FactGroupAgencyDailyDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; +import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; +import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; import com.epmet.dto.stats.FactGroupAgencyDailyDTO; import com.epmet.entity.stats.FactGroupAgencyDailyEntity; import com.epmet.service.stats.FactGroupAgencyDailyService; @@ -32,6 +36,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Map; @@ -97,4 +102,40 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl agencyList) { + if (agencyList.size() != NumConstant.ZERO){ + baseDao.insertGroupAgencyDaily(agencyList); + } + + } + + /** + * @Description 获取 网格小组【机关-日统计】的最后一天数据 + * @param + * @author zxc + */ + public List getLastDayAgency(){ + return baseDao.getLastDayAgency(); + } + + /** + * @Description 查询 月的小组增量 + * @param monthId + * @author zxc + */ + @Override + public List getMonthGroupIncr(String monthId) { + if (StringUtils.isBlank(monthId)){ + return new ArrayList<>(); + } + return baseDao.getMonthGroupIncr(monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java index bf8da031c4..85a216373d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java @@ -20,10 +20,12 @@ 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.constant.NumConstant; 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.FactGroupAgencyMonthlyDao; +import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.stats.FactGroupAgencyMonthlyDTO; import com.epmet.entity.stats.FactGroupAgencyMonthlyEntity; import com.epmet.service.stats.FactGroupAgencyMonthlyService; @@ -96,4 +98,17 @@ public class FactGroupAgencyMonthlyServiceImpl extends BaseServiceImpl agencyMonth) { + if (agencyMonth.size() == NumConstant.ZERO){ + return; + } + baseDao.insertAgencyGroupMonthly(agencyMonth); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java index 68ddd26178..cfba6ff90f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java @@ -20,6 +20,7 @@ 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.constant.NumConstant; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.group.result.GroupGridDailyResultDTO; import com.epmet.dto.stats.FactGroupGridDailyDTO; @@ -111,6 +112,9 @@ public class FactGroupGridDailyServiceImpl extends BaseServiceImpl formDto) { + if (formDto.size() == NumConstant.ZERO){ + return; + } baseDao.insertGroupGridDaily(formDto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml index e0f4ee8be0..021a38a005 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/group/GroupDataDao.xml @@ -67,5 +67,95 @@ GROUP BY grid_id + + + + + + + + + + + + + + \ 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 54e81a8d69..e31a36a40a 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 @@ -18,4 +18,20 @@ ORDER BY CREATED_TIME ASC; + + + \ 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 370ea99cc5..ac14010373 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 @@ -222,4 +222,29 @@ agency.PID + + + + + \ 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 3c12538580..783230dc55 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 @@ -11,18 +11,6 @@ LIMIT 1 - + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml index 2e526090dc..283cd62e9b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -30,5 +30,83 @@ + + INSERT INTO fact_group_agency_daily ( + ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, + GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, + MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) + values + + ( + REPLACE(UUID(),'-',''), + #{agency.agencyId}, + #{agency.pid}, + #{agency.dateId}, + #{agency.weekId}, + #{agency.monthId}, + #{agency.quarterId}, + #{agency.yearId}, + #{agency.gridTotal}, + #{agency.groupTotalCount}, + #{agency.groupMemberTotalCount}, + #{agency.groupMemberAvgCount}, + #{agency.groupMedian}, + #{agency.groupIncr}, + #{agency.groupMemberMaxCount}, + IFNULL(#{agency.maxMemberGroupId},NULL), + #{agency.groupMemberMinCount}, + IFNULL(#{agency.minMemberGroupId},NULL), + #{agency.delFlag}, + #{agency.revision}, + #{agency.createdBy}, + NOW(), + #{agency.updatedBy}, + NOW() + ) + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml index 956e399ed0..73f80a1ce0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml @@ -28,5 +28,40 @@ + + INSERT INTO fact_group_agency_monthly + (ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, + GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, + GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, + UPDATED_BY, UPDATED_TIME) + VALUES + + ( + REPLACE(UUID(),'-',''), + #{agency.agencyId}, + #{agency.pid}, + #{agency.monthId}, + #{agency.quarterId}, + #{agency.yearId}, + #{agency.gridTotal}, + #{agency.groupTotal}, + #{agency.groupMemberTotal}, + #{agency.groupMemberAvgCount}, + #{agency.groupMedian}, + #{agency.groupIncr}, + #{agency.groupMemberMaxCount}, + #{agency.maxMemberGroupId}, + #{agency.groupMemberMinCount}, + #{agency.minMemberGroupId}, + #{agency.delFlag}, + #{agency.revision}, + #{agency.createdBy}, + NOW(), + #{agency.updatedBy}, + NOW() + ) + + + \ No newline at end of file From 75829224fab3fa5a1d0a3e382510ab72dea2a318 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Sat, 20 Jun 2020 10:53:26 +0800 Subject: [PATCH 053/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=A6=96=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report-client/src/main/java/com/epmet/group/.gitignore | 0 .../data-report-client/src/main/java/com/epmet/issue/.gitignore | 0 .../data-report-client/src/main/java/com/epmet/project/.gitignore | 0 .../data-report-client/src/main/java/com/epmet/topic/.gitignore | 0 .../data-report-client/src/main/java/com/epmet/user/.gitignore | 0 .../src/main/java/com/epmet/module/group/controller/.gitignore | 0 .../src/main/java/com/epmet/module/group/dao/.gitignore | 0 .../src/main/java/com/epmet/module/group/service/.gitignore | 0 .../src/main/java/com/epmet/module/issue/controller/.gitignore | 0 .../src/main/java/com/epmet/module/issue/dao/.gitignore | 0 .../src/main/java/com/epmet/module/issue/service/.gitignore | 0 .../src/main/java/com/epmet/module/project/controller/.gitignore | 0 .../src/main/java/com/epmet/module/project/dao/.gitignore | 0 .../src/main/java/com/epmet/module/project/service/.gitignore | 0 .../src/main/java/com/epmet/module/topic/controller/.gitignore | 0 .../src/main/java/com/epmet/module/topic/dao/.gitignore | 0 .../src/main/java/com/epmet/module/topic/service/.gitignore | 0 .../src/main/java/com/epmet/module/user/controller/.gitignore | 0 .../src/main/java/com/epmet/module/user/dao/.gitignore | 0 .../src/main/java/com/epmet/module/user/service/.gitignore | 0 .../data-report-server/src/main/resources/mapper/group/.gitignore | 0 .../data-report-server/src/main/resources/mapper/issue/.gitignore | 0 .../src/main/resources/mapper/project/.gitignore | 0 .../data-report-server/src/main/resources/mapper/topic/.gitignore | 0 .../data-report-server/src/main/resources/mapper/user/.gitignore | 0 25 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/.gitignore create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/.gitignore create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/.gitignore create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/group/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/project/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/user/.gitignore diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/dao/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/.gitignore b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/.gitignore new file mode 100644 index 0000000000..e69de29bb2 From 738f97c29b85589f83a6e386d05566349a276ca0 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 20 Jun 2020 12:08:09 +0800 Subject: [PATCH 054/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/voice/ArticleViewedSummaryDTO.java | 40 ++ .../controller/StatsPublicityController.java | 24 +- .../stats/FactTagUsedAgencyMonthlyDao.java | 5 +- .../stats/FactTagViewedAgencyDailyDao.java | 8 +- .../stats/FactTagViewedAgencyMonthlyDao.java | 10 +- .../FactTagViewedAgencyQuarterlyDao.java | 4 +- .../stats/FactTagViewedAgencyYearlyDao.java | 4 +- .../dao/stats/FactTagViewedGridDailyDao.java | 8 +- .../stats/FactTagViewedGridMonthlyDao.java | 10 +- .../stats/FactTagViewedGridQuarterlyDao.java | 4 +- .../dao/stats/FactTagViewedGridYearlyDao.java | 4 +- .../com/epmet/dao/voice/ArticleTagsDao.java | 2 + .../dao/voice/ArticleVisitRecordDao.java | 39 ++ .../voice/ArticleVisitRecordEntity.java | 58 +++ .../epmet/service/StatsPublicityService.java | 21 ++ .../impl/StatsPublicityServiceImpl.java | 352 ++++++++++++++++-- .../FactTagUsedAgencyMonthlyService.java | 5 +- .../stats/FactTagUsedAgencyYearlyService.java | 5 +- .../FactTagUsedDepartmentYearlyService.java | 4 +- .../stats/FactTagUsedGridYearlyService.java | 5 +- .../FactTagViewedAgencyDailyService.java | 6 + .../FactTagViewedAgencyMonthlyService.java | 7 + .../FactTagViewedAgencyQuarterlyService.java | 3 + .../FactTagViewedAgencyYearlyService.java | 3 + .../stats/FactTagViewedGridDailyService.java | 6 + .../FactTagViewedGridMonthlyService.java | 7 + .../FactTagViewedGridQuarterlyService.java | 3 + .../stats/FactTagViewedGridYearlyService.java | 3 + .../FactTagUsedAgencyMonthlyServiceImpl.java | 17 +- .../FactTagUsedAgencyYearlyServiceImpl.java | 20 +- ...actTagUsedDepartmentYearlyServiceImpl.java | 12 +- .../FactTagUsedGridYearlyServiceImpl.java | 15 +- .../FactTagViewedAgencyDailyServiceImpl.java | 62 +++ ...FactTagViewedAgencyMonthlyServiceImpl.java | 65 ++++ ...ctTagViewedAgencyQuarterlyServiceImpl.java | 49 +++ .../FactTagViewedAgencyYearlyServiceImpl.java | 49 +++ .../FactTagViewedGridDailyServiceImpl.java | 64 ++++ .../FactTagViewedGridMonthlyServiceImpl.java | 65 ++++ ...FactTagViewedGridQuarterlyServiceImpl.java | 49 +++ .../FactTagViewedGridYearlyServiceImpl.java | 49 +++ .../service/voice/ArticleTagsService.java | 19 +- .../voice/ArticleVisitRecordService.java | 44 +++ .../voice/impl/ArticleTagsServiceImpl.java | 15 +- .../impl/ArticleVisitRecordServiceImpl.java | 54 +++ .../stats/FactTagUsedAgencyMonthlyDao.xml | 4 +- .../stats/FactTagViewedAgencyDailyDao.xml | 45 ++- .../stats/FactTagViewedAgencyMonthlyDao.xml | 62 ++- .../stats/FactTagViewedAgencyQuarterlyDao.xml | 20 +- .../stats/FactTagViewedAgencyYearlyDao.xml | 19 +- .../stats/FactTagViewedGridDailyDao.xml | 25 ++ .../stats/FactTagViewedGridMonthlyDao.xml | 47 +++ .../stats/FactTagViewedGridQuarterlyDao.xml | 3 + .../stats/FactTagViewedGridYearlyDao.xml | 3 + .../resources/mapper/voice/ArticleTagsDao.xml | 13 + .../mapper/voice/ArticleVisitRecordDao.xml | 23 ++ 55 files changed, 1410 insertions(+), 152 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java new file mode 100644 index 0000000000..6db2b70ef7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/voice/ArticleViewedSummaryDTO.java @@ -0,0 +1,40 @@ +package com.epmet.dto.voice; +/** + * @author jianjun liu + * @email liujianjun@yunzongnet.com + * @date 2020-06-17 16:43 + **/ + +import lombok.Data; + +import java.io.Serializable; + +/** + * desc:文章总数 统计返回结果 dto + * + * @author liujianjun + * @date 2020/6/17 16:43 + */ +@Data +public class ArticleViewedSummaryDTO implements Serializable { + + private static final long serialVersionUID = -6430902856772516776L; + /** + * 客户id + */ + private String customerId; + + /** + * 网格Id + */ + private String gridId; + /** + * 文章Id + */ + private String articleId; + + /** + * 该篇文章被阅读的次数和 + */ + private Integer viewedCount; +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index c233fd1e1e..7db6e827c0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -24,7 +24,7 @@ public class StatsPublicityController { private ExecutorService executorService; /** - * desc:统计文章总数及在线文章总数 + * desc:【日】统计文章总数及在线文章总数 包含 机关 部门 网格 * * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return @@ -55,4 +55,26 @@ public class StatsPublicityController { public Result tagUsedMonthStatsjob(Date statsDate) { return new Result().ok(statsPublicityService.tagUsedMonthStatsjob(statsDate)); } + + /** + * desc:【日】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedDayStatsjob") + public Result tagViewedDayStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedDayStatsjob(statsDate)); + } + + /** + * desc:【月】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedMonthStatsjob") + public Result tagViewedMonthStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedMonthStatsjob(statsDate)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java index 17ded89e6c..1bc98abe5f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyMonthlyDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; -import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -34,9 +33,9 @@ import java.util.List; @Mapper public interface FactTagUsedAgencyMonthlyDao extends BaseDao { - List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); - List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + List getTagUsedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java index 0726fa3c22..4a9a248298 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 文章引用标签阅读数量【机关】日统计表 @@ -29,5 +32,8 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedAgencyDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagViewedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java index d41f55eabc..eea98354b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 文章引用标签阅读数量【机关】月统计表 @@ -29,5 +32,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedAgencyMonthlyDao extends BaseDao { - + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getTagViewedCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java index 7816c9b477..17c7c064a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文章引用标签阅读数量【机关】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedAgencyQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java index 67554b31e0..54d0564f18 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedAgencyYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文章引用标签阅读数量【机关】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedAgencyYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java index aec2bd6862..8824b13ccc 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridDailyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 文章引用标签阅读数量【网格】日统计表 @@ -29,5 +32,8 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedGridDailyDao extends BaseDao { - + + int deleteByDateId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List getTagViewedCountByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java index eed19fc006..d504edb591 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridMonthlyDao.java @@ -20,6 +20,9 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 文章引用标签阅读数量【网格】月统计表 @@ -29,5 +32,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedGridMonthlyDao extends BaseDao { - + + int deleteByMonthId(@Param("customerId") String customerId, @Param("monthId") String monthId); + + List getTagViewCountByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); + + List getTagUsedCountByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java index 61488aa9df..8e7318fba0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridQuarterlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文章引用标签阅读数量【网格】季度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedGridQuarterlyDao extends BaseDao { - + + int deleteByQuarterId(@Param("customerId") String customerId, @Param("quarterId") String quarterId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java index 7e4e436b42..a85ead0f93 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagViewedGridYearlyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 文章引用标签阅读数量【网格】年度统计表 @@ -29,5 +30,6 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactTagViewedGridYearlyDao extends BaseDao { - + + int deleteByYearId(@Param("customerId") String customerId, @Param("yearId") String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java index 3fa6d061da..b25b86e2b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleTagsDao.java @@ -43,4 +43,6 @@ public interface ArticleTagsDao extends BaseDao { * @return */ List getArticleTagsByDay(@Param("customerId") String customerId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); + + List getArticleTagsByArticleId(@Param("customerId") String customerId, @Param("articleId") String articleId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java new file mode 100644 index 0000000000..174ea937ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/voice/ArticleVisitRecordDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.voice; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Mapper +public interface ArticleVisitRecordDao extends BaseDao { + + List getArticleVisitByCreateTime(@Param("customerId") String customerId, @Param("startTime") Date startTime, @Param("endTime") Date endTime); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java new file mode 100644 index 0000000000..630b9e2685 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/voice/ArticleVisitRecordEntity.java @@ -0,0 +1,58 @@ +/** + * 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.voice; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("article_visit_record") +public class ArticleVisitRecordEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章ID + */ + private String articleId; + + /** + * 用户ID + */ + private String userId; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 79fc0d24d1..1bd0ff46be 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -35,4 +35,25 @@ public interface StatsPublicityService { */ Boolean tagUsedMonthStatsjob(Date statsDate); + /** + * desc: 按日 统计每个标签的阅读数 + * + * @param statsDate + * @return: Boolean + * @date: 2020/6/20 8:40 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagViewedDayStatsjob(Date statsDate); + + /** + * desc: + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ + Boolean tagViewedMonthStatsjob(Date statsDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 06eec21543..1fd8375faa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -7,6 +7,7 @@ import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ProjectConstant; import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; import com.epmet.entity.stats.*; import com.epmet.entity.voice.ArticleEntity; import com.epmet.entity.voice.ArticleTagsEntity; @@ -15,6 +16,7 @@ import com.epmet.service.stats.*; import com.epmet.service.voice.ArticlePublishRangeService; import com.epmet.service.voice.ArticleService; import com.epmet.service.voice.ArticleTagsService; +import com.epmet.service.voice.ArticleVisitRecordService; import com.epmet.util.DimIdGenerator; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; @@ -64,6 +66,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private ArticlePublishRangeService articlePublishRangeService; @Autowired + private ArticleVisitRecordService articleVisitRecordService; + @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @Autowired private FactArticlePublishedDepartmentDailyService factArticlePublishedDepartmentDailyService; @@ -94,6 +98,22 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private FactTagUsedAgencyYearlyService factTagUsedAgencyYearlyService; @Autowired + private FactTagViewedGridDailyService factTagViewedGridDailyService; + @Autowired + private FactTagViewedAgencyDailyService factTagViewedAgencyDailyService; + @Autowired + private FactTagViewedGridMonthlyService factTagViewedGridMonthlyService; + @Autowired + private FactTagViewedAgencyMonthlyService factTagViewedAgencyMonthlyService; + @Autowired + private FactTagViewedGridQuarterlyService factTagViewedGridQuarterlyService; + @Autowired + private FactTagViewedAgencyQuarterlyService factTagViewedAgencyQuarterlyService; + @Autowired + private FactTagViewedGridYearlyService factTagViewedGridYearlyService; + @Autowired + private FactTagViewedAgencyYearlyService factTagViewedAgencyYearlyService; + @Autowired private ExecutorService executorService; @Override @@ -151,10 +171,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; executorService.submit(() -> { - //key:所在机关Id - Map agencySummaryMap = new HashMap<>(); //统计 - statsTagUsedDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsTagUsedDaily(finalStatsDate, dimIdBean, customerId); }); } } @@ -183,21 +201,14 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { executorService.submit(() -> { try { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); - //statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); - //statsTagUsedYearly(dimIdBean.getYearId(), customerId); countDownLatch.countDown(); } catch (Exception e) { log.error("statsTagUsedMonthly exception", e); } }); - log.debug("start === statsTagUsedQuarterly "); - try { - countDownLatch.await(); - } catch (InterruptedException e) { - log.error("countDownLatch.await() interrupted", e); - } executorService.submit(() -> { try { + countDownLatch.await(); log.debug("start === statsTagUsedQuarterly "); statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); } catch (Exception e) { @@ -206,6 +217,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); executorService.submit(() -> { try { + countDownLatch.await(); log.debug("start === statsTagUsedQuarterly "); statsTagUsedYearly(dimIdBean.getYearId(), customerId); } catch (Exception e) { @@ -218,6 +230,89 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { return true; } + @Override + public Boolean tagViewedDayStatsjob(Date statsDate) { + + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(DateUtils.addDateDays(new Date(), -1), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + Date finalStatsDate = statsDate; + //executorService.submit(() -> { + //统计 + statsTagViewedDaily(finalStatsDate, dimIdBean, customerId); + //}); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } + + @Override + public Boolean tagViewedMonthStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + CountDownLatch countDownLatch = new CountDownLatch(1); + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + if (!"6c8cfc2c14afeb6d3664b3e283fc9074".equals(customerId)) { + continue; + } + executorService.submit(() -> { + try { + statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); + countDownLatch.countDown(); + } catch (Exception e) { + log.error("statsTagViewedMonthly exception", e); + } + }); + + executorService.submit(() -> { + try { + countDownLatch.await(); + log.debug("start === statsTagViewedQuarterly "); + statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedQuarterly exception", e); + } + }); + executorService.submit(() -> { + try { + countDownLatch.await(); + log.debug("start === statsTagViewedYearly "); + statsTagViewedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedYearly exception", e); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + return true; + } + private void statsPublishedDepartmentDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { //获取所有客户 List departmentDTOList = dimDepartmentService.getDepartmentListByCustomerId(customerId); @@ -357,9 +452,8 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param statsDate * @param dimIdBean * @param customerId - * @param agencySummaryMap */ - private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { + private void statsTagUsedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { //1.业务数据来源 发布时间为统计时间的 // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 // 1.1查出今天所有的文章标签 根据网格Id @@ -409,7 +503,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); break; } - convertTagUsedGridDailyEntity(tagUsedGridDailyMap, articleEntity, tagEntity, dimIdBean); } factTagUsedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagUsedGridDailyMap.values()); @@ -430,6 +523,82 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { factTagUsedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } + /** + * desc:按日统计 标签被阅读的次数 + * + * @param statsDate + * @param dimIdBean + * @param customerId + */ + private void statsTagViewedDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId) { + //1.业务数据来源 发布时间为统计时间的 + // 因为一个客户的发布文章数在同一天不会特别的多,所以以客户为单位查询今天发布的所有带有标签的文章 根据发布单位类型进行拆分 + // 1.1查出今天所有的文章标签 根据网格Id + // 1.2 + //获取所有机关 用于后面想上级添加数据 + List agencyDTOList = dimAgencyService.getAgencyListByCustomerId(customerId); + if (CollectionUtils.isEmpty(agencyDTOList)) { + log.debug("statsTagViewedDaily customerId:{} have any agency", customerId); + return; + } + + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + if (CollectionUtils.isEmpty(dimGridList)) { + log.debug("statsTagViewedDaily customerId:{} have any grid", customerId); + return; + } + Map dimGridEntityMap = dimGridList.stream().collect(Collectors.toMap(DimGridEntity::getId, o -> o)); + //转换为 需要插入的Entity + Map dimAgencyEntityMap = agencyDTOList.stream().collect(Collectors.toMap(DimAgencyEntity::getId, o -> o)); + //转换为 需要插入的Entity key gridId_tagId + Map tagViewedGridDailyMap = new HashMap<>(); + Map tagViewedAgencyDailyMap = new HashMap<>(); + //获取当天的业务数据 + //1获取今天文章的阅读记录数 + Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); + Date endTime = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + List visitRecordList = articleVisitRecordService.getArticleVisitByCreateTime(customerId, startTime, endTime); + if (CollectionUtils.isEmpty(visitRecordList)) { + return; + } + + for (ArticleViewedSummaryDTO viewedSummaryDTO : visitRecordList) { + List articleTagsList = articleTagsService.getArticleTagsByArticleId(customerId, viewedSummaryDTO.getArticleId()); + if (CollectionUtils.isEmpty(articleTagsList)) { + continue; + } + String gridId = viewedSummaryDTO.getGridId(); + DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); + + if (dimGridEntity == null) { + log.error("statsTagViewedDaily viewedRecord gridId:{} not exist in dimGridMap", gridId); + continue; + } + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); + articleTagsList.forEach(articleTag -> { + convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); + }); + } + + factTagViewedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagViewedGridDailyMap.values()); + + //向上级机关递归添加 数据 + Map finalTagUsedAgencyDailyMap = new HashMap<>(); + finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailyMap); + for (Map.Entry entry : tagViewedAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); + DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); + if (dimAgencyEntity == null) { + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); + } + factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); + } + /** * desc:按月统计 标签使用数 * @@ -440,17 +609,37 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridDailyList = factTagUsedGridDailyService.getTagUsedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(gridDailyList)) { List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagUsedGridMonthlyEntity.class); - factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId,monthId,gridMonthlyList); + factTagUsedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); } List deptDailyList = factTagUsedDepartmentDailyService.getTagUsedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(deptDailyList)) { List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); - factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId,monthId,gridMonthlyList); + factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); } List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(agencyDailyList)) { List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); - factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId,monthId,(agencyMonthlyList)); + factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); + } + } + + /** + * desc:按月统计 标签使用数 + * + * @param monthId + * @param customerId + */ + private void statsTagViewedMonthly(String monthId, String customerId) { + List gridDailyList = factTagViewedGridDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(gridDailyList)) { + List gridMonthlyList = ConvertUtils.sourceToTarget(gridDailyList, FactTagViewedGridMonthlyEntity.class); + factTagViewedGridMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); + } + + List agencyDailyList = factTagViewedAgencyDailyService.getTagViewedCountByMonth(customerId, monthId); + if (!CollectionUtils.isEmpty(agencyDailyList)) { + List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagViewedAgencyMonthlyEntity.class); + factTagViewedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); } } @@ -464,18 +653,37 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridQuarterlyEntity.class); - factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId,quarterId,gridQuarterlyList); + factTagUsedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); } List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(deptMonthlyList)) { List deptQuarterlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentQuarterlyEntity.class); - factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId,quarterId,deptQuarterlyList); + factTagUsedDepartmentQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, deptQuarterlyList); } - //TODO 机关的需要添加 pid - List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByQuarterId(customerId, quarterId); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyQuarterlyEntity.class); - factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId,agencyQuarterlyList); + factTagUsedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); + } + } + + /** + * desc:按季统计 标签查看数 + * + * @param quarterId + * @param customerId + */ + private void statsTagViewedQuarterly(String quarterId, String customerId) { + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridQuarterlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridQuarterlyEntity.class); + factTagViewedGridQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, gridQuarterlyList); + } + + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByQuarterId(customerId, quarterId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyQuarterlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyQuarterlyEntity.class); + factTagViewedAgencyQuarterlyService.deleteAndInsertByQuarterId(customerId, quarterId, agencyQuarterlyList); } } @@ -489,21 +697,36 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridMonthlyList = factTagUsedGridMonthlyService.getTagUsedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(gridMonthlyList)) { List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagUsedGridYearlyEntity.class); - //TODO 改为一个方法 添加事务 - factTagUsedGridYearlyService.deleteByYearId(customerId, yearId); - factTagUsedGridYearlyService.insertBatch(gridYearlyList); + factTagUsedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); } List deptMonthlyList = factTagUsedDepartmentMonthlyService.getTagUsedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(deptMonthlyList)) { List gridYearlyList = ConvertUtils.sourceToTarget(deptMonthlyList, FactTagUsedDepartmentYearlyEntity.class); - factTagUsedDepartmentYearlyService.deleteByYearId(customerId, yearId); - factTagUsedDepartmentYearlyService.insertBatch(gridYearlyList); + factTagUsedDepartmentYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); } - List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); + List agencyMonthlyList = factTagUsedAgencyMonthlyService.getTagUsedCountByYearId(customerId, yearId); if (!CollectionUtils.isEmpty(agencyMonthlyList)) { List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagUsedAgencyYearlyEntity.class); - factTagUsedAgencyYearlyService.deleteByYearId(customerId, yearId); - factTagUsedAgencyYearlyService.insertBatch(agencyYearlyList); + factTagUsedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); + } + } + + /** + * desc:按年统计 标签阅读数 + * + * @param yearId + * @param customerId + */ + private void statsTagViewedYearly(String yearId, String customerId) { + List gridMonthlyList = factTagViewedGridMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(gridMonthlyList)) { + List gridYearlyList = ConvertUtils.sourceToTarget(gridMonthlyList, FactTagViewedGridYearlyEntity.class); + factTagViewedGridYearlyService.deleteAndInsertByYearId(customerId, yearId, gridYearlyList); + } + List agencyMonthlyList = factTagViewedAgencyMonthlyService.getTagViewedCountByYearId(customerId, yearId); + if (!CollectionUtils.isEmpty(agencyMonthlyList)) { + List agencyYearlyList = ConvertUtils.sourceToTarget(agencyMonthlyList, FactTagViewedAgencyYearlyEntity.class); + factTagViewedAgencyYearlyService.deleteAndInsertByYearId(customerId, yearId, agencyYearlyList); } } @@ -534,6 +757,33 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } } + private void setTagViewedData2ParentAgency(Map dimAgencyEntityMap, Map agencyDailyEntityMap, FactTagViewedAgencyDailyEntity currentEntity, DimIdGenerator.DimIdBean dimIdBean) { + String pid = currentEntity.getPid(); + String tagId = currentEntity.getTagId(); + String key = pid.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagViewedAgencyDailyEntity parentAgencyDailyEntity = agencyDailyEntityMap.get(key); + DimAgencyEntity currentDimAgency = dimAgencyEntityMap.get(pid); + if (currentDimAgency == null) { + return; + } + if (parentAgencyDailyEntity == null) { + parentAgencyDailyEntity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + parentAgencyDailyEntity.setCustomerId(currentEntity.getCustomerId()); + parentAgencyDailyEntity.setPid(currentDimAgency.getPid()); + parentAgencyDailyEntity.setAgencyId(currentDimAgency.getId()); + parentAgencyDailyEntity.setTagId(currentEntity.getTagId()); + parentAgencyDailyEntity.setTagName(currentEntity.getTagName()); + parentAgencyDailyEntity.setTagReadCount(currentEntity.getTagReadCount()); + agencyDailyEntityMap.put(key, parentAgencyDailyEntity); + } else { + parentAgencyDailyEntity.setTagReadCount(parentAgencyDailyEntity.getTagReadCount() + currentEntity.getTagReadCount()); + } + pid = currentDimAgency.getPid(); + if (!NumConstant.ZERO_STR.equals(pid)) { + setTagViewedData2ParentAgency(dimAgencyEntityMap, agencyDailyEntityMap, parentAgencyDailyEntity, dimIdBean); + } + } + private void setPublishedData2ParentAgency(Map agencyDailyEntityMap, FactArticlePublishedAgencyDailyEntity agencySummary, FactArticlePublishedAgencyDailyEntity summary) { String pid = summary.getPid(); FactArticlePublishedAgencyDailyEntity parentAgency = agencyDailyEntityMap.get(pid); @@ -690,4 +940,46 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setUsedCount(entity.getUsedCount() + 1); } } + + private void convertTagViewedGridDailyEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String gridId = viewedSummaryDTO.getGridId(); + String tagId = tagEntity.getTagId(); + String key = gridId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedGridDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedGridDailyEntity.class); + entity.setGridId(gridId); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(dimAgencyEntity.getId()); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } + + private void convertTagViewedAgencyDailyEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = dimAgencyEntity.getId(); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + entity.setPid(dimAgencyEntity.getPid()); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java index 98568ee385..3c90d2003a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyMonthlyService.java @@ -19,7 +19,6 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; -import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import java.util.List; @@ -31,9 +30,9 @@ import java.util.List; */ public interface FactTagUsedAgencyMonthlyService extends BaseService { - List getTagUsedCountByYearId(String customerId, String monthId); + List getTagUsedCountByYearId(String customerId, String monthId); - List getTagUsedCountByQuarterId(String customerId, String quarterId); + List getTagUsedCountByQuarterId(String customerId, String quarterId); Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java index c3102ab786..83f4049722 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyYearlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; +import java.util.List; + /** * 标签【机关】年度统计表 * @@ -28,6 +30,7 @@ import com.epmet.entity.stats.FactTagUsedAgencyYearlyEntity; */ public interface FactTagUsedAgencyYearlyService extends BaseService { - int deleteByYearId(String customerId,String yearId); + int deleteByYearId(String customerId, String yearId); + Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java index 0e5e152fa6..672940a9fb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedDepartmentYearlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; +import java.util.List; + /** * 标签【部门】年度统计表 * @@ -29,5 +31,5 @@ import com.epmet.entity.stats.FactTagUsedDepartmentYearlyEntity; public interface FactTagUsedDepartmentYearlyService extends BaseService { - Integer deleteByYearId(String customerId, String yearId); + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java index f9f5b35510..027b00a376 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedGridYearlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; +import java.util.List; + /** * 标签【网格】年度统计表 * @@ -27,6 +29,5 @@ import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; * @since v1.0.0 2020-06-18 */ public interface FactTagUsedGridYearlyService extends BaseService { - - Integer deleteByYearId(String customerId, String yearId); + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java index a2b2ca57e7..bd24b1afd7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyDailyService.java @@ -20,6 +20,9 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; +import java.util.Collection; +import java.util.List; + /** * 文章引用标签阅读数量【机关】日统计表 * @@ -29,4 +32,7 @@ import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; public interface FactTagViewedAgencyDailyService extends BaseService { + Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + List getTagViewedCountByMonth(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java index 1838e6dc72..02c2604600 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyMonthlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【机关】月统计表 * @@ -28,4 +30,9 @@ import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; */ public interface FactTagViewedAgencyMonthlyService extends BaseService { + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList); + + List getTagViewedCountByQuarterId(String customerId, String quarterId); + + List getTagViewedCountByYearId(String customerId, String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java index ef86491926..e32ca8ad7e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyQuarterlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【机关】季度统计表 * @@ -28,4 +30,5 @@ import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; */ public interface FactTagViewedAgencyQuarterlyService extends BaseService { + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java index 2bf9bc345e..abd0e42e08 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedAgencyYearlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【机关】年度统计表 * @@ -29,4 +31,5 @@ import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; public interface FactTagViewedAgencyYearlyService extends BaseService { + Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java index 4b07728ae9..dbd488ade2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridDailyService.java @@ -20,6 +20,9 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridDailyEntity; +import java.util.Collection; +import java.util.List; + /** * 文章引用标签阅读数量【网格】日统计表 * @@ -28,4 +31,7 @@ import com.epmet.entity.stats.FactTagViewedGridDailyEntity; */ public interface FactTagViewedGridDailyService extends BaseService { + Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values); + + List getTagViewedCountByMonth(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java index 149364fc8d..6c5ccc8840 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridMonthlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【网格】月统计表 * @@ -28,4 +30,9 @@ import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; */ public interface FactTagViewedGridMonthlyService extends BaseService { + Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList); + + List getTagViewedCountByQuarterId(String customerId, String quarterId); + + List getTagViewedCountByYearId(String customerId, String yearId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java index 481bed7ee6..9e224c8802 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridQuarterlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【网格】季度统计表 * @@ -28,4 +30,5 @@ import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; */ public interface FactTagViewedGridQuarterlyService extends BaseService { + Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java index a62c431a0e..c18d0a7385 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagViewedGridYearlyService.java @@ -20,6 +20,8 @@ package com.epmet.service.stats; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; +import java.util.List; + /** * 文章引用标签阅读数量【网格】年度统计表 * @@ -28,4 +30,5 @@ import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; */ public interface FactTagViewedGridYearlyService extends BaseService { + Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java index eb54c6b93b..85c51f9fdb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyMonthlyServiceImpl.java @@ -22,7 +22,6 @@ import com.epmet.commons.tools.exception.EpmetErrorCode; import com.epmet.commons.tools.exception.RenException; import com.epmet.dao.stats.FactTagUsedAgencyMonthlyDao; import com.epmet.entity.stats.FactTagUsedAgencyMonthlyEntity; -import com.epmet.entity.stats.FactTagUsedGridMonthlyEntity; import com.epmet.service.stats.FactTagUsedAgencyMonthlyService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; @@ -43,19 +42,19 @@ import java.util.List; public class FactTagUsedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagUsedAgencyMonthlyService { @Override - public List getTagUsedCountByYearId(String customerId, String monthId) { - if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + public List getTagUsedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.getTagUsedCountByYearId(customerId,monthId); + return baseDao.getTagUsedCountByYearId(customerId, yearId); } @Override - public List getTagUsedCountByQuarterId(String customerId, String quarterId) { - if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + public List getTagUsedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.getTagUsedCountByQuarterId(customerId,quarterId); + return baseDao.getTagUsedCountByQuarterId(customerId, quarterId); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java index ebe9603a35..32f24e5836 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyYearlyServiceImpl.java @@ -26,6 +26,10 @@ import com.epmet.service.stats.FactTagUsedAgencyYearlyService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 标签【机关】年度统计表 @@ -39,9 +43,19 @@ public class FactTagUsedAgencyYearlyServiceImpl extends BaseServiceImpl agencyYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(agencyYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.deleteByYearId(customerId,yearId); + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(agencyYearlyList, 100); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java index d80eb5102c..6614095001 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedDepartmentYearlyServiceImpl.java @@ -26,6 +26,9 @@ import com.epmet.service.stats.FactTagUsedDepartmentYearlyService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 标签【部门】年度统计表 @@ -38,10 +41,11 @@ import org.springframework.stereotype.Service; public class FactTagUsedDepartmentYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedDepartmentYearlyService { @Override - public Integer deleteByYearId(String customerId, String yearId) { - if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.deleteByYearId(customerId,yearId); + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 100); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java index e25d32852f..02c7902ec2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedGridYearlyServiceImpl.java @@ -25,6 +25,10 @@ import com.epmet.entity.stats.FactTagUsedGridYearlyEntity; import com.epmet.service.stats.FactTagUsedGridYearlyService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.List; /** * 标签【网格】年度统计表 @@ -36,11 +40,12 @@ import org.springframework.stereotype.Service; public class FactTagUsedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagUsedGridYearlyService { @Override - public Integer deleteByYearId(String customerId, String yearId) { - - if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)){ - throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } - return baseDao.deleteByYearId(customerId,yearId); + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 100); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..9e9500e96e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyDailyServiceImpl.java @@ -0,0 +1,62 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyDailyDao; +import com.epmet.entity.stats.FactTagViewedAgencyDailyEntity; +import com.epmet.service.stats.FactTagViewedAgencyDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagViewedAgencyDailyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyDailyService { + + @Override + public Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)) { + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagViewedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewedCountByMonthId(customerId, monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..0b7f08a6ed --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyMonthlyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyMonthlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyMonthlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyMonthlyService { + + @Override + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List agencyMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(agencyMonthlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId, monthId); + return this.insertBatch(agencyMonthlyList, 100); + } + + @Override + public List getTagViewedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewedCountByQuarterId(customerId, quarterId); + } + + @Override + public List getTagViewedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId, yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java new file mode 100644 index 0000000000..ba226febc9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyQuarterlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyQuarterlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyQuarterlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedAgencyQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyQuarterlyService { + + @Override + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List agencyQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(agencyQuarterlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId, quarterId); + return this.insertBatch(agencyQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java new file mode 100644 index 0000000000..d5a0f0c123 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedAgencyYearlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedAgencyYearlyDao; +import com.epmet.entity.stats.FactTagViewedAgencyYearlyEntity; +import com.epmet.service.stats.FactTagViewedAgencyYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedAgencyYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedAgencyYearlyService { + + @Override + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List agencyYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(agencyYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(agencyYearlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java new file mode 100644 index 0000000000..2f3d9c0781 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridDailyServiceImpl.java @@ -0,0 +1,64 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridDailyDao; +import com.epmet.entity.stats.FactTagViewedGridDailyEntity; +import com.epmet.service.stats.FactTagViewedGridDailyService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Collection; +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Slf4j +@Service +public class FactTagViewedGridDailyServiceImpl extends BaseServiceImpl implements FactTagViewedGridDailyService { + + @Override + @Transactional(rollbackFor = Exception.class) + public Boolean deleteAndInsertBatch(String customerId, String dateId, Collection values) { + if (CollectionUtils.isEmpty(values)) { + return false; + } + int i = baseDao.deleteByDateId(customerId, dateId); + log.debug("deleteAndInsertBatch delete customerId:{},rows:{}", customerId, i); + this.insertBatch(values, 100); + return true; + } + + @Override + public List getTagViewedCountByMonth(String customerId, String monthId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewedCountByMonthId(customerId, monthId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..59e0726914 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridMonthlyServiceImpl.java @@ -0,0 +1,65 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridMonthlyDao; +import com.epmet.entity.stats.FactTagViewedGridMonthlyEntity; +import com.epmet.service.stats.FactTagViewedGridMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedGridMonthlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridMonthlyService { + + @Override + public Boolean deleteAndInsertByMonthId(String customerId, String monthId, List gridMonthlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId) || CollectionUtils.isEmpty(gridMonthlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByMonthId(customerId, monthId); + return this.insertBatch(gridMonthlyList, 100); + } + + @Override + public List getTagViewedCountByQuarterId(String customerId, String quarterId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagViewCountByQuarterId(customerId, quarterId); + } + + @Override + public List getTagViewedCountByYearId(String customerId, String yearId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getTagUsedCountByYearId(customerId, yearId); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java new file mode 100644 index 0000000000..1671a6f4ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridQuarterlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridQuarterlyDao; +import com.epmet.entity.stats.FactTagViewedGridQuarterlyEntity; +import com.epmet.service.stats.FactTagViewedGridQuarterlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedGridQuarterlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridQuarterlyService { + + @Override + public Boolean deleteAndInsertByQuarterId(String customerId, String quarterId, List gridQuarterlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(quarterId) || CollectionUtils.isEmpty(gridQuarterlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByQuarterId(customerId, quarterId); + return this.insertBatch(gridQuarterlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java new file mode 100644 index 0000000000..a7dd6a6242 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagViewedGridYearlyServiceImpl.java @@ -0,0 +1,49 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.dao.stats.FactTagViewedGridYearlyDao; +import com.epmet.entity.stats.FactTagViewedGridYearlyEntity; +import com.epmet.service.stats.FactTagViewedGridYearlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.List; + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-18 + */ +@Service +public class FactTagViewedGridYearlyServiceImpl extends BaseServiceImpl implements FactTagViewedGridYearlyService { + + @Override + public Boolean deleteAndInsertByYearId(String customerId, String yearId, List gridYearlyList) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(yearId) || CollectionUtils.isEmpty(gridYearlyList)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + baseDao.deleteByYearId(customerId, yearId); + return this.insertBatch(gridYearlyList, 100); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java index 43c0518792..07067cd1dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleTagsService.java @@ -31,12 +31,15 @@ import java.util.List; */ public interface ArticleTagsService extends BaseService { - /** - * desc:根据客户Id 创建时间获取 文章便签数据 - * @param customerId - * @param startTime - * @param endTime - * @return - */ - List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime); + /** + * desc:根据客户Id 创建时间获取 文章便签数据 + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime); + + List getArticleTagsByArticleId(String customerId, String articleId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java new file mode 100644 index 0000000000..69de820d79 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/ArticleVisitRecordService.java @@ -0,0 +1,44 @@ +/** + * 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.voice; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; + +import java.util.Date; +import java.util.List; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +public interface ArticleVisitRecordService extends BaseService { + + /** + * desc:根据客户Id + * + * @param customerId + * @param startTime + * @param endTime + * @return + */ + List getArticleVisitByCreateTime(String customerId, Date startTime, Date endTime); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java index d34e2f9e06..52a8a43295 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleTagsServiceImpl.java @@ -45,10 +45,19 @@ public class ArticleTagsServiceImpl extends BaseServiceImpl getArticleTagsByCreateTime(String customerId, Date startTime, Date endTime) { - this.checkParam(customerId,endTime,endTime); - return baseDao.getArticleTagsByDay(customerId,startTime, endTime); + this.checkParam(customerId, endTime, endTime); + return baseDao.getArticleTagsByDay(customerId, startTime, endTime); } - private void checkParam(String customerId, Date starTime,Date endTime) { + + @Override + public List getArticleTagsByArticleId(String customerId, String articleId) { + if (StringUtils.isBlank(customerId) || StringUtils.isBlank(articleId)) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getArticleTagsByArticleId(customerId, articleId); + } + + private void checkParam(String customerId, Date starTime, Date endTime) { if (StringUtils.isBlank(customerId) || starTime == null || endTime == null) { throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java new file mode 100644 index 0000000000..689a1a32e2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/voice/impl/ArticleVisitRecordServiceImpl.java @@ -0,0 +1,54 @@ +/** + * 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.voice.impl; + +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.exception.EpmetErrorCode; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.voice.ArticleVisitRecordDao; +import com.epmet.dto.voice.ArticleViewedSummaryDTO; +import com.epmet.entity.voice.ArticleVisitRecordEntity; +import com.epmet.service.voice.ArticleVisitRecordService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 文章访问记录表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Slf4j +@Service +@DataSource(DataSourceConstant.GOV_VOICE) +public class ArticleVisitRecordServiceImpl extends BaseServiceImpl implements ArticleVisitRecordService { + + @Override + public List getArticleVisitByCreateTime(String customerId, Date startTime, Date endTime) { + if (StringUtils.isBlank(customerId) || startTime == null || endTime == null) { + throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(), EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); + } + return baseDao.getArticleVisitByCreateTime(customerId, startTime, endTime); + } +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml index 156a284376..ccbe4c211b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -3,7 +3,7 @@ - SELECT CUSTOMER_ID, PID, @@ -25,7 +25,7 @@ AGENCY_ID, TAG_ID - SELECT CUSTOMER_ID, AGENCY_ID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml index e01c2c7f77..f8c7a55728 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyDailyDao.xml @@ -3,26 +3,31 @@ - - - - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml index ed0778ec54..85e33ec0ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyMonthlyDao.xml @@ -3,22 +3,52 @@ - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_agency_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml index 84e1e796e5..83c09a954d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyQuarterlyDao.xml @@ -2,23 +2,9 @@ - - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_agency_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml index 0064d6b545..25b2d6a11c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedAgencyYearlyDao.xml @@ -3,22 +3,9 @@ - - - - - - - - - - - - - - - - + + DELETE FROM fact_tag_viewed_agency_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml index 22a4e138c6..3fa886f434 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridDailyDao.xml @@ -4,4 +4,29 @@ + + DELETE FROM fact_tag_viewed_grid_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml index 363a48027b..8bde85f5a3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridMonthlyDao.xml @@ -3,4 +3,51 @@ + + DELETE FROM fact_tag_viewed_grid_monthly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND MONTH_ID = #{monthId,jdbcType=VARCHAR} + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml index fc6b5d4b11..8d2908737e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridQuarterlyDao.xml @@ -3,4 +3,7 @@ + + DELETE FROM fact_tag_viewed_grid_quarterly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND QUARTER_ID = #{quarterId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml index a2dc843964..30276d91ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagViewedGridYearlyDao.xml @@ -3,4 +3,7 @@ + + DELETE FROM fact_tag_viewed_grid_yearly WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND YEAR_ID = #{yearId,jdbcType=VARCHAR} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml index 94202f337a..a6a733f6ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleTagsDao.xml @@ -29,4 +29,17 @@ AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND CREATED_TIME BETWEEN #{startTime,jdbcType=TIMESTAMP} AND #{endTime,jdbcType=TIMESTAMP} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml new file mode 100644 index 0000000000..c5019d41f4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/voice/ArticleVisitRecordDao.xml @@ -0,0 +1,23 @@ + + + + + + + + \ No newline at end of file From 6bc4dca6510e524aaa239943b01dd484ad991ea2 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sat, 20 Jun 2020 12:10:45 +0800 Subject: [PATCH 055/101] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/service/impl/StatsProjectServiceImpl.java | 2 +- .../epmet/service/impl/StatsPublicityServiceImpl.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index c09e064258..3525e45f97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -72,7 +72,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { customerStats(customerId); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 1fd8375faa..98f5b3f2a7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -147,7 +147,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -176,7 +176,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -226,7 +226,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -255,7 +255,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //}); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } @@ -309,7 +309,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); } } - } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() >= pageSize); + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); return true; } From f1a1b861f454990f3929a1ca04565094cac39e3e Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Sat, 20 Jun 2020 12:17:48 +0800 Subject: [PATCH 056/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9LoginUserDetailsResul?= =?UTF-8?q?tDTO=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/result/LoginUserDetailsResultDTO.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java index aba19d20a8..d3f26332e6 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java @@ -33,7 +33,7 @@ public class LoginUserDetailsResultDTO { private Set deptIdList; /** - * 当前登录的组织id(顶级) + * 当前登录的组织id */ private String agencyId; From 136aaf618655518e78d7cb5ee521d4eb4a795963 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Sat, 20 Jun 2020 15:00:00 +0800 Subject: [PATCH 057/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/service/group/impl/GroupDataServiceImpl.java | 5 +---- .../java/com/epmet/service/impl/StatsGroupServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 2ee8c38550..cb548823c7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -59,12 +59,9 @@ public class GroupDataServiceImpl implements GroupDataService { }); }else { result.forEach(grid -> { - GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); - BeanUtils.copyProperties(dimTime, dailyResult); - dailyResult.setAgencyId(grid.getAgencyId()); gridGroupTotalResultDTOS.forEach(groupTotal -> { if (grid.getGridId().equals(groupTotal.getGridId())) { - dailyResult.setGroupTotal(groupTotal.getGridGroupTotal()); + grid.setGroupTotal(groupTotal.getGridGroupTotal()); } }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index df312995fb..82278d4340 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -224,7 +224,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { */ public DimIdGenerator.DimIdBean getDimIdBean(){ ZoneId zoneId = ZoneId.systemDefault(); - LocalDate localDate = LocalDate.now(); + LocalDate localDate = LocalDate.now().minusDays(NumConstant.ONE); ZonedDateTime zdt = localDate.atStartOfDay(zoneId); Date date = Date.from(zdt.toInstant()); return DimIdGenerator.getDimIdBean(date); From cf67f15c7a556d4902115c6b901b2c93b53ac592 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Sat, 20 Jun 2020 15:50:30 +0800 Subject: [PATCH 058/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../data-report/data-report-client/pom.xml | 8 ++ .../src/main/java/com/epmet/group/.gitignore | 0 .../epmet/group/constant/GroupConstant.java | 12 ++ .../group/dto/form/GroupIncrTrendFormDTO.java | 25 ++++ .../group/dto/result/GridInfoResultDTO.java | 25 ++++ .../dto/result/GroupIncrTrendResultDTO.java | 30 +++++ .../dto/result/GroupSubAgencyResultDTO.java | 37 ++++++ .../dto/result/GroupSubGridResultDTO.java | 37 ++++++ .../dto/result/GroupSummaryInfoResultDTO.java | 40 +++++++ .../group/dto/result/SubAgencyResultDTO.java | 25 ++++ .../data-report/data-report-server/pom.xml | 5 + .../epmet/module/group/controller/.gitignore | 0 .../group/controller/GroupController.java | 74 ++++++++++++ .../com/epmet/module/group/dao/.gitignore | 0 .../com/epmet/module/group/dao/GroupDao.java | 58 ++++++++++ .../com/epmet/module/group/service/.gitignore | 0 .../module/group/service/GroupService.java | 45 ++++++++ .../group/service/impl/GroupServiceImpl.java | 107 ++++++++++++++++++ .../main/resources/mapper/group/GroupDao.xml | 92 +++++++++++++++ 19 files changed, 620 insertions(+) delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/.gitignore create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/form/GroupIncrTrendFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GridInfoResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupIncrTrendResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubAgencyResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubGridResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSummaryInfoResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/SubAgencyResultDTO.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/GroupController.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/GroupDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/GroupService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/impl/GroupServiceImpl.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml diff --git a/epmet-module/data-report/data-report-client/pom.xml b/epmet-module/data-report/data-report-client/pom.xml index f001810eaa..5bba5f2cb4 100644 --- a/epmet-module/data-report/data-report-client/pom.xml +++ b/epmet-module/data-report/data-report-client/pom.xml @@ -11,5 +11,13 @@ data-report-client + + + com.epmet + epmet-commons-tools + 2.0.0 + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java new file mode 100644 index 0000000000..699090f931 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/constant/GroupConstant.java @@ -0,0 +1,12 @@ +package com.epmet.group.constant; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:24 + */ +public interface GroupConstant { + + String MONTH = "month"; + String DATE = "date"; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/form/GroupIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/form/GroupIncrTrendFormDTO.java new file mode 100644 index 0000000000..627b5504c4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/form/GroupIncrTrendFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.group.dto.form; + +import lombok.Data; +import lombok.NonNull; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 12:07 + */ +@Data +public class GroupIncrTrendFormDTO implements Serializable { + + private static final long serialVersionUID = 1788937450915240575L; + + public interface GroupJava {} + + /** + * 类型 month:月 date:日 + */ + @NotBlank(message = "type不能为空", groups = {GroupJava.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GridInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GridInfoResultDTO.java new file mode 100644 index 0000000000..d9840d841d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GridInfoResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 14:30 + */ +@Data +public class GridInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 5301902590768338888L; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格名称 + */ + private String gridName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupIncrTrendResultDTO.java new file mode 100644 index 0000000000..50637d609d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupIncrTrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 12:03 + */ +@Data +public class GroupIncrTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 5132636251609157706L; + + /** + * 日期 + */ + private String date; + + /** + * 值 【小组数量】 + */ + private Integer value; + + /** + * 类型 【小组数量】 + */ + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubAgencyResultDTO.java new file mode 100644 index 0000000000..379f55cdf5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubAgencyResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 11:56 + * 网格小组——下级机关小组数柱状图 + */ +@Data +public class GroupSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 8562403482616167221L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 机关ID + */ + private String agencyId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubGridResultDTO.java new file mode 100644 index 0000000000..af7e4e84fa --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSubGridResultDTO.java @@ -0,0 +1,37 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 11:56 + * 网格小组——下级机关小组数柱状图 + */ +@Data +public class GroupSubGridResultDTO implements Serializable { + + private static final long serialVersionUID = -3260124064513560994L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 机关ID + */ + private String gridId; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSummaryInfoResultDTO.java new file mode 100644 index 0000000000..a3e72d6f3a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/GroupSummaryInfoResultDTO.java @@ -0,0 +1,40 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 11:05 + */ +@Data +public class GroupSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 网格总数量 + */ + private Integer gridTotalCount; + + /** + * 小组总数量 + */ + private Integer groupTotalCount; + + /** + * 小组平均人数 + */ + private Integer groupPeopleAvg; + + /** + * 小组人数中位数 + */ + private Integer groupPeopleMedian; + + /** + * 数据更新至 时间 + */ + private String deadline; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/SubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/SubAgencyResultDTO.java new file mode 100644 index 0000000000..e4b182f09f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/group/dto/result/SubAgencyResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.group.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 14:02 + */ +@Data +public class SubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 2276056225590553307L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 机关名称 + */ + private String agencyName; +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index b8c65eda08..d6dd66a273 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -24,6 +24,11 @@ epmet-commons-mybatis 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + org.springframework.boot spring-boot-starter-web diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/GroupController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/GroupController.java new file mode 100644 index 0000000000..45ce9164ef --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/GroupController.java @@ -0,0 +1,74 @@ +package com.epmet.module.group.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.group.dto.form.GroupIncrTrendFormDTO; +import com.epmet.group.dto.result.GroupIncrTrendResultDTO; +import com.epmet.group.dto.result.GroupSubAgencyResultDTO; +import com.epmet.group.dto.result.GroupSubGridResultDTO; +import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; +import com.epmet.module.group.service.GroupService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:54 + */ +@RestController +@RequestMapping("group") +public class GroupController { + + @Autowired + private GroupService groupService; + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param tokenDto + * @author zxc + */ + @PostMapping("summaryinfo") + public Result summaryInfo(@LoginUser TokenDto tokenDto){ + return new Result().ok(groupService.summaryInfo(tokenDto)); + } + + /** + * @Description 网格小组——下级机关小组数柱状图 + * @param tokenDto + * @author zxc + */ + @PostMapping("subagency") + public Result> subAgency(@LoginUser TokenDto tokenDto){ + return new Result>().ok(groupService.subAgency(tokenDto)); + } + + /** + * @Description 网格小组——直属网格小组数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subgrid") + public Result> subGrid(@LoginUser TokenDto tokenDto){ + return new Result>().ok(groupService.subGrid(tokenDto)); + } + + /** + * @Description 网格小组——小组分析 + * @param tokenDto + * @author zxc + */ + @PostMapping("incrtrend") + public Result> IncrTrend(@LoginUser TokenDto tokenDto, @RequestBody GroupIncrTrendFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, GroupIncrTrendFormDTO.GroupJava.class); + return new Result>().ok(groupService.IncrTrend(tokenDto,formDTO)); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/GroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/GroupDao.java new file mode 100644 index 0000000000..c6d6f49295 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/GroupDao.java @@ -0,0 +1,58 @@ +package com.epmet.module.group.dao; + +import com.epmet.group.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:55 + */ +@Mapper +public interface GroupDao { + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param + * @author zxc + */ + GroupSummaryInfoResultDTO summaryInfo(@Param("agencyId") String agencyId); + + /** + * @Description 获取下级机关信息 + * @param agencyId + * @author zxc + */ + List getSubAgencyList(@Param("agencyId") String agencyId); + + /** + * @Description 获取下级机关的小组数 + * @param + * @author zxc + */ + List getSubGroupCount(); + + /** + * @Description 获取直属网格下的小组数 + * @param agencyId + * @author zxc + */ + List getSubGridGroupCount(@Param("agencyId") String agencyId); + + /** + * @Description 小组数量 日增长 + * @param agencyId + * @author zxc + */ + List getIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 小组数量 月增长 + * @param agencyId + * @author zxc + */ + List getIncrMonthly(@Param("agencyId") String agencyId); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/GroupService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/GroupService.java new file mode 100644 index 0000000000..7ce1df4cc7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/GroupService.java @@ -0,0 +1,45 @@ +package com.epmet.module.group.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.group.dto.form.GroupIncrTrendFormDTO; +import com.epmet.group.dto.result.GroupIncrTrendResultDTO; +import com.epmet.group.dto.result.GroupSubAgencyResultDTO; +import com.epmet.group.dto.result.GroupSubGridResultDTO; +import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:55 + */ +public interface GroupService { + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param tokenDto + * @author zxc + */ + GroupSummaryInfoResultDTO summaryInfo(TokenDto tokenDto); + + /** + * @Description 网格小组——下级机关小组数柱状图 + * @param tokenDto + * @author zxc + */ + List subAgency(TokenDto tokenDto); + + /** + * @Description 网格小组——直属网格小组数 + * @param tokenDto + * @author zxc + */ + List subGrid(TokenDto tokenDto); + + /** + * @Description 网格小组——小组分析 + * @param tokenDto + * @author zxc + */ + List IncrTrend(TokenDto tokenDto, GroupIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/impl/GroupServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/impl/GroupServiceImpl.java new file mode 100644 index 0000000000..f986a591a7 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/impl/GroupServiceImpl.java @@ -0,0 +1,107 @@ +package com.epmet.module.group.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.group.constant.GroupConstant; +import com.epmet.group.dto.form.GroupIncrTrendFormDTO; +import com.epmet.group.dto.result.*; +import com.epmet.module.group.dao.GroupDao; +import com.epmet.module.group.service.GroupService; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 10:56 + */ +@Service +public class GroupServiceImpl implements GroupService { + + @Autowired + private GroupDao groupDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Description 网格小组:网格总数、网格小组数、小组平均数、小组人数中位数 + * @param tokenDto + * @author zxc + */ + @Override + public GroupSummaryInfoResultDTO summaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + return groupDao.summaryInfo(agencyId); + } + + /** + * @Description 网格小组——下级机关小组数柱状图 + * @param tokenDto + * @author zxc + */ + @Override + public List subAgency(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subAgencyList = groupDao.getSubAgencyList(agencyId); + List subGroupCount = groupDao.getSubGroupCount(); + if (subAgencyList.size()!= NumConstant.ZERO){ + subGroupCount.forEach(group -> { + subAgencyList.forEach(subAgency -> { + if (subAgency.getAgencyId().equals(group.getAgencyId())){ + group.setName(subAgency.getAgencyName()); + result.add(group); + } + }); + }); + return result; + } + return new ArrayList<>(); + } + + /** + * @Description 网格小组——直属网格小组数 + * @param tokenDto + * @author zxc + */ + @Override + public List subGrid(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + return groupDao.getSubGridGroupCount(agencyId); + } + + /** + * @Description 网格小组——小组分析 + * @param tokenDto + * @author zxc + */ + @Override + public List IncrTrend(TokenDto tokenDto, GroupIncrTrendFormDTO formDTO) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + if (formDTO.getType().equals(GroupConstant.DATE)){ + result = groupDao.getIncrDaily(agencyId); + }else { + result = groupDao.getIncrMonthly(agencyId); + } + return result; + } + + /** + * @Description 获取机关ID + * @param tokenDto + * @author zxc + */ + public String getLoginUserDetails(TokenDto tokenDto){ + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto,dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + return data.getAgencyId(); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml new file mode 100644 index 0000000000..71de6153f9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From fe275f13df3b4dcb1992a5e1648fbf1ebede583a Mon Sep 17 00:00:00 2001 From: wxz Date: Sun, 21 Jun 2020 22:23:45 +0800 Subject: [PATCH 059/101] =?UTF-8?q?1.=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E5=88=87=E9=9D=A2=202.=E4=BF=AE=E6=94=B9compose=E9=94=99?= =?UTF-8?q?=E8=AF=AF=EF=BC=8C=E8=B0=83=E6=95=B4=E8=B5=84=E6=BA=90=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deploy/docker-compose-dev.yml | 4 +- .../deploy/docker-compose-test.yml | 6 +-- .../com/epmet/aspect/RequestLogAspect.java | 40 +++++++++++++++++++ .../deploy/docker-compose-dev.yml | 4 +- .../deploy/docker-compose-test.yml | 6 +-- .../com/epmet/aspect/RequestLogAspect.java | 40 +++++++++++++++++++ 6 files changed, 90 insertions(+), 10 deletions(-) create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml index f2b8960a42..e2981ef533 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-dev.yml @@ -9,9 +9,9 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" deploy: resources: limits: cpus: '0.1' - memory: 250M \ No newline at end of file + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml index 5181a184da..3c34b09319 100644 --- a/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-report/data-report-server/deploy/docker-compose-test.yml @@ -1,7 +1,7 @@ version: "3.7" services: data-report-server: - container_name: data-report-server-dev + container_name: data-report-server-test image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-report-server:0.3.1 ports: - "8108:8108" @@ -9,9 +9,9 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" deploy: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml index de1ff9baa5..9a3d12d95d 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-dev.yml @@ -9,9 +9,9 @@ services: volumes: - "/opt/epmet-cloud-logs/dev:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx200m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" deploy: resources: limits: cpus: '0.1' - memory: 250M \ No newline at end of file + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml index 7d80790041..bbe6d5f891 100644 --- a/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml +++ b/epmet-module/data-statistical/data-statistical-server/deploy/docker-compose-test.yml @@ -1,7 +1,7 @@ version: "3.7" services: data-statistical-server: - container_name: data-statistical-server-dev + container_name: data-statistical-server-test image: registry-vpc.cn-qingdao.aliyuncs.com/epmet-cloud-release/data-statistical-server:0.3.1 ports: - "8108:8108" @@ -9,9 +9,9 @@ services: volumes: - "/opt/epmet-cloud-logs/test:/logs" environment: - RUN_INSTRUCT: "java -Xms32m -Xmx300m -jar ./app.jar" + RUN_INSTRUCT: "java -Xms32m -Xmx250m -jar ./app.jar" deploy: resources: limits: cpus: '0.1' - memory: 400M \ No newline at end of file + memory: 300M \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java new file mode 100644 index 0000000000..49581cf63c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/aspect/RequestLogAspect.java @@ -0,0 +1,40 @@ +package com.epmet.aspect; + +import com.epmet.commons.tools.aspect.BaseRequestLogAspect; +import org.aspectj.lang.ProceedingJoinPoint; +import org.aspectj.lang.annotation.Around; +import org.aspectj.lang.annotation.Aspect; +import org.springframework.core.annotation.Order; +import org.springframework.stereotype.Component; +import org.springframework.web.context.request.RequestAttributes; +import org.springframework.web.context.request.RequestContextHolder; +import org.springframework.web.context.request.ServletRequestAttributes; + +import javax.servlet.http.HttpServletRequest; + +/** + * 日志/异常处理切面实现,调用父类方法完成日志记录和异常处理。 + */ +@Aspect +@Component +@Order(0) +public class RequestLogAspect extends BaseRequestLogAspect { + + @Override + @Around(value = "execution(* com.epmet.controller.*Controller*.*(..)) ") + public Object proceed(ProceedingJoinPoint point) throws Throwable { + return super.proceed(point, getRequest()); + } + + /** + * 获取Request对象 + * + * @return + */ + private HttpServletRequest getRequest() { + RequestAttributes ra = RequestContextHolder.getRequestAttributes(); + ServletRequestAttributes sra = (ServletRequestAttributes) ra; + return sra.getRequest(); + } + +} From 5422c8e95cca563d2f04f7ad26e85962d13164c0 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 09:55:54 +0800 Subject: [PATCH 060/101] =?UTF-8?q?=E8=AF=9D=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/topic/constant/TopicConstant.java | 30 +++ .../topic/dto/form/TopicIncrTrendFormDTO.java | 24 ++ .../dto/result/TopicIncrTrendResultDTO.java | 30 +++ .../result/TopicShiftedCountResultDTO.java | 25 ++ .../dto/result/TopicStatusResultDTO.java | 25 ++ .../dto/result/TopicSubAgencyResultDTO.java | 35 +++ .../dto/result/TopicSubGridResultDTO.java | 35 +++ .../dto/result/TopicSummaryInfoResultDTO.java | 30 +++ .../dto/result/TopicSummaryResultDTO.java | 45 ++++ .../topic/controller/TopicController.java | 81 +++++++ .../com/epmet/module/topic/dao/TopicDao.java | 108 +++++++++ .../module/topic/service/TopicService.java | 51 +++++ .../topic/service/impl/TopicServiceImpl.java | 182 +++++++++++++++ .../main/resources/mapper/topic/TopicDao.xml | 215 ++++++++++++++++++ 14 files changed, 916 insertions(+) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java new file mode 100644 index 0000000000..62c27f4b55 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/constant/TopicConstant.java @@ -0,0 +1,30 @@ +package com.epmet.topic.constant; + +/** + * @Author zxc + * @CreateTime 2020/6/20 17:19 + */ +public interface TopicConstant { + + /** + * 讨论中 + */ + String DISCUSSING = "discussing"; + + /** + * 已屏蔽 + */ + String HIDDEN = "hidden"; + + /** + * 已关闭 + */ + String CLOSED = "closed"; + + String RATIO = "%"; + + String SHIFTED = "已转议题"; + + String MONTH = "month"; + String DATE = "date"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java new file mode 100644 index 0000000000..2eecf2de34 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/form/TopicIncrTrendFormDTO.java @@ -0,0 +1,24 @@ +package com.epmet.topic.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:24 + */ +@Data +public class TopicIncrTrendFormDTO implements Serializable { + + private static final long serialVersionUID = -4929038359220814068L; + + public interface TopicIncr{} + + /** + * 类型 month:代表月 date:代表日 + */ + @NotBlank(message = "month / date 类型不能为空",groups = {TopicIncr.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java new file mode 100644 index 0000000000..24e3eae7bc --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicIncrTrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:09 + */ +@Data +public class TopicIncrTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 6905657684644153197L; + + /** + * 日期 + */ + private String date; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java new file mode 100644 index 0000000000..99b84d913f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicShiftedCountResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 17:32 + */ +@Data +public class TopicShiftedCountResultDTO implements Serializable { + + private static final long serialVersionUID = -7470748727678087785L; + + /** + * 已转议题数量 + */ + private Integer shiftedIssueCount; + + /** + * 数据更新至 时间 + */ + private String deadline; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java new file mode 100644 index 0000000000..c22ebd7176 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicStatusResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 17:10 + */ +@Data +public class TopicStatusResultDTO implements Serializable { + + private static final long serialVersionUID = -6461755954651271901L; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态 已关闭:closed、已屏蔽:hidden、 讨论中:discussing + */ + private String topicStatus; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java new file mode 100644 index 0000000000..87dd107010 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubAgencyResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:13 + */ +@Data +public class TopicSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 70586943923355457L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 机关Id + */ + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java new file mode 100644 index 0000000000..64cad1615c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSubGridResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:13 + */ +@Data +public class TopicSubGridResultDTO implements Serializable { + + private static final long serialVersionUID = -7251687622455341118L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 类型 + */ + private String type; + + /** + * 网格Id + */ + private String gridId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java new file mode 100644 index 0000000000..3112df3356 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryInfoResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:14 + */ +@Data +public class TopicSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 1103298182001744033L; + + /** + * 名称 + */ + private String name; + + /** + * 值 + */ + private Integer value; + + /** + * 百分比 + */ + private String ratio; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java new file mode 100644 index 0000000000..6f14a45fd5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/topic/dto/result/TopicSummaryResultDTO.java @@ -0,0 +1,45 @@ +package com.epmet.topic.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/20 16:04 + */ +@Data +public class TopicSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = -6051892596892952025L; + + /** + * 话题总数 + */ + private Integer topicTotalCount; + + /** + * 讨论中话题数量 + */ + private Integer talkingTotalCount; + + /** + * 已关闭话题数量 + */ + private Integer closedTotalCount; + + /** + * 已屏蔽话题数量 + */ + private Integer shieldedTotalCount; + + /** + * 话题已转议题数量 + */ + private Integer shiftedTotalCount; + + /** + * 数据更新至 时间 + */ + private String deadline; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java new file mode 100644 index 0000000000..44e058cf14 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java @@ -0,0 +1,81 @@ +package com.epmet.module.topic.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.module.topic.service.TopicService; +import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; +import com.epmet.topic.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:55 + */ +@RestController +@RequestMapping("topic") +public class TopicController { + + @Autowired + private TopicService topicService; + + /** + * @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 + * @param tokenDto + * @author zxc + */ + @PostMapping("topicsummary") + public Result topicSummary(@LoginUser TokenDto tokenDto){ + return new Result().ok(topicService.topicSummary(tokenDto)); + } + + /** + * @Description 话题——话题分析 + * @param tokenDto + * @param formDTO + * @author zxc + */ + @PostMapping("incrtrend") + public Result> topicIncrTrend(@LoginUser TokenDto tokenDto, @RequestBody TopicIncrTrendFormDTO formDTO){ + ValidatorUtils.validateEntity(formDTO, TopicIncrTrendFormDTO.TopicIncr.class); + return new Result>().ok(topicService.topicIncrTrend(tokenDto,formDTO)); + } + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subgrid") + public Result> topicSubGrid(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSubGrid(tokenDto)); + } + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + @PostMapping("subagency") + public Result> topicSubAgency(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSubAgency(tokenDto)); + } + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + @PostMapping("summaryinfo") + public Result> topicSummaryInfo(@LoginUser TokenDto tokenDto){ + return new Result>().ok(topicService.topicSummaryInfo(tokenDto)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java new file mode 100644 index 0000000000..9ea7f8d631 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java @@ -0,0 +1,108 @@ +package com.epmet.module.topic.dao; + +import com.epmet.group.dto.result.GroupIncrTrendResultDTO; +import com.epmet.topic.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:55 + */ +@Mapper +public interface TopicDao { + + /** + * @Description 获取话题数量及状态 + * @param agencyId + * @author zxc + */ + List getTopicStatus(@Param("agencyId")String agencyId); + + /** + * @Description 获取机关下已转议题数量 + * @param agencyId + * @author zxc + */ + TopicShiftedCountResultDTO getShiftedCount(@Param("agencyId")String agencyId); + + /** + * @Description 获取话题信息(状态,数量,百分比) + * @param agencyId + * @author zxc + */ + List topicSummaryInfo(@Param("agencyId")String agencyId); + + /** + * @Description 根据当前机关判断是否有下级机关 + * @param agencyId + * @author zxc + */ + List getSubAgencyIdList(@Param("agencyId")String agencyId); + + /** + * @Description 获取最后一天的所有话题数据 【fact_topic_status_agency_daily】 + * @param + * @author zxc + */ + List getAllTopicInfoLastDay(); + + /** + * @Description 获取最后一天的所有话题已转议题数据 + * @param + * @author zxc + */ + List getAllTopicShiftedInfoLastDay(); + + /** + * @Description 校验机关下是否存在直属网格 + * @param agencyId + * @author zxc + */ + List getSubGridIdList(@Param("agencyId")String agencyId); + + /** + * @Description 获取最后一天的所有话题数据 【fact_topic_status_grid_daily】【grid】 + * @param + * @author zxc + */ + List getGridAllTopicInfoLastDay(); + + /** + * @Description 获取最后一天的所有话题已转议题数据【grid】 + * @param + * @author zxc + */ + List getGridAllTopicShiftedInfoLastDay(); + + /** + * @Description 话题日增长 + * @param agencyId + * @author zxc + */ + List getTopicIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 话题转议题日增长 + * @param agencyId + * @author zxc + */ + List getTopicShiftedIncrDaily(@Param("agencyId") String agencyId); + + /** + * @Description 话题月增长 + * @param agencyId + * @author zxc + */ + List getTopicIncrMonthly(@Param("agencyId") String agencyId); + + /** + * @Description 话题转议题月增长 + * @param agencyId + * @author zxc + */ + List getTopicShiftedIncrMonthly(@Param("agencyId") String agencyId); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java new file mode 100644 index 0000000000..1bf2b6d9c3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java @@ -0,0 +1,51 @@ +package com.epmet.module.topic.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; +import com.epmet.topic.dto.result.*; + +import java.util.List; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:58 + */ +public interface TopicService { + + /** + * @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 + * @param tokenDto + * @author zxc + */ + TopicSummaryResultDTO topicSummary(TokenDto tokenDto); + + /** + * @Description 话题——话题分析 + * @param tokenDto + * @param formDTO + * @author zxc + */ + List topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO); + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + List topicSubGrid( TokenDto tokenDto); + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + List topicSubAgency(TokenDto tokenDto); + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + List topicSummaryInfo(TokenDto tokenDto); + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java new file mode 100644 index 0000000000..a66659396f --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java @@ -0,0 +1,182 @@ +package com.epmet.module.topic.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.topic.dao.TopicDao; +import com.epmet.module.topic.service.TopicService; +import com.epmet.topic.constant.TopicConstant; +import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; +import com.epmet.topic.dto.result.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @Author zxc + * @CreateTime 2020/6/20 15:58 + */ +@Service +public class TopicServiceImpl implements TopicService { + + @Autowired + private TopicDao topicDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Description 话题:话题总数、讨论中话题数量、已关闭话题数量、已屏蔽话题数量、话题已转议题数量、数据更新至2020-06-17 + * @param tokenDto + * @author zxc + */ + @Override + public TopicSummaryResultDTO topicSummary(TokenDto tokenDto) { + TopicSummaryResultDTO result = new TopicSummaryResultDTO(); + String agencyId = this.getLoginUserDetails(tokenDto); + List topicStatus = topicDao.getTopicStatus(agencyId); + if (topicStatus.size() != NumConstant.ZERO){ + topicStatus.forEach(topic -> { + if (topic.getTopicStatus().equals(TopicConstant.DISCUSSING)){ + result.setTalkingTotalCount(topic.getTopicCount()); + }else if (topic.getTopicStatus().equals(TopicConstant.CLOSED)){ + result.setClosedTotalCount(topic.getTopicCount()); + }else { + result.setShieldedTotalCount(topic.getTopicCount()); + } + }); + result.setTopicTotalCount(topicStatus.stream().collect(Collectors.summingInt(TopicStatusResultDTO::getTopicCount))); + } + TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); + if (shiftedCount != null){ + result.setShiftedTotalCount(shiftedCount.getShiftedIssueCount()); + result.setDeadline(shiftedCount.getDeadline()); + } + return result; + } + + /** + * @Description 话题——话题分析 + * @param tokenDto + * @param formDTO + * @author zxc + */ + @Override + public List topicIncrTrend(TokenDto tokenDto, TopicIncrTrendFormDTO formDTO) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + if (formDTO.getType().equals(TopicConstant.DATE)){ + List topicIncrDaily = topicDao.getTopicIncrDaily(agencyId); + List topicShiftedIncrDaily = topicDao.getTopicShiftedIncrDaily(agencyId); + topicIncrDaily.addAll(topicShiftedIncrDaily); + result = topicIncrDaily.stream().sorted(Comparator.comparing(TopicIncrTrendResultDTO::getDate).reversed()).collect(Collectors.toList()); + }else { + List topicIncrMonthly = topicDao.getTopicIncrMonthly(agencyId); + List topicShiftedIncrMonthly = topicDao.getTopicShiftedIncrMonthly(agencyId); + topicIncrMonthly.addAll(topicShiftedIncrMonthly); + result = topicIncrMonthly.stream().sorted(Comparator.comparing(TopicIncrTrendResultDTO::getDate).reversed()).collect(Collectors.toList()); + } + return result; + } + + /** + * @Description 话题——直属网格话题数 + * @param tokenDto + * @author zxc + */ + @Override + public List topicSubGrid(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subGridIdList = topicDao.getSubGridIdList(agencyId); + if (subGridIdList.size() != NumConstant.ZERO){ + List gridAllTopicInfoLastDay = topicDao.getGridAllTopicInfoLastDay(); + List gridAllTopicShiftedInfoLastDay = topicDao.getGridAllTopicShiftedInfoLastDay(); + subGridIdList.forEach(gridId -> { + gridAllTopicInfoLastDay.forEach(gridTopic -> { + if (gridId.equals(gridTopic.getGridId())){ + result.add(gridTopic); + } + }); + gridAllTopicShiftedInfoLastDay.forEach(gridShift -> { + if (gridId.equals(gridShift.getGridId())){ + result.add(gridShift); + } + }); + }); + return result; + } + return new ArrayList<>(); + } + + /** + * @Description 话题——下级机关话题数 + * @param tokenDto + * @author zxc + */ + @Override + public List topicSubAgency(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List result = new ArrayList<>(); + List subAgencyIdList = topicDao.getSubAgencyIdList(agencyId); + //存在下级机关 + if (subAgencyIdList.size() != NumConstant.ZERO){ + List allTopicInfoLastDay = topicDao.getAllTopicInfoLastDay(); + List allTopicShiftedInfoLastDay = topicDao.getAllTopicShiftedInfoLastDay(); + //话题状态为 已关闭、讨论中、已屏蔽 + subAgencyIdList.forEach(agencyIdOne -> { + allTopicInfoLastDay.forEach(agency -> { + if (agencyIdOne.equals(agency.getAgencyId())){ + result.add(agency); + } + }); + allTopicShiftedInfoLastDay.forEach(shiftTopic -> { + if (agencyIdOne.equals(shiftTopic.getAgencyId())){ + result.add(shiftTopic); + } + }); + }); + return result; + } + //不存在 + return new ArrayList<>(); + } + + /** + * @Description 话题——话题分析表 + * @param tokenDto + * @author zxc + */ + @Override + public List topicSummaryInfo(TokenDto tokenDto) { + String agencyId = this.getLoginUserDetails(tokenDto); + List topicSummaryInfo = topicDao.topicSummaryInfo(agencyId); + TopicShiftedCountResultDTO shiftedCount = topicDao.getShiftedCount(agencyId); + int i = (shiftedCount.getShiftedIssueCount() / topicSummaryInfo.stream().collect(Collectors.summingInt(TopicSummaryInfoResultDTO::getValue))) * NumConstant.ONE_HUNDRED; + String ratio = String.valueOf(i) + TopicConstant.RATIO; + TopicSummaryInfoResultDTO result = new TopicSummaryInfoResultDTO(); + result.setName(TopicConstant.SHIFTED); + result.setRatio(ratio); + result.setValue(shiftedCount.getShiftedIssueCount()); + topicSummaryInfo.add(result); + return topicSummaryInfo; + } + + /** + * @Description 获取机关ID + * @param tokenDto + * @author zxc + */ + public String getLoginUserDetails(TokenDto tokenDto){ + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto,dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + return data.getAgencyId(); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 0000000000..93f146f299 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,215 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From d915386a7ad3a6865e1657d4ebbdae1af95267a4 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Jun 2020 09:55:58 +0800 Subject: [PATCH 061/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tools/constant/ServiceConstant.java | 9 ++- .../controller/StatsPublicityController.java | 16 ++-- .../feign/StatsPublicityFeignClient.java | 64 ++++++++++++++++ .../StatsPublicityFeignClientFallBack.java | 75 +++++++++++++++++++ .../TagUsedDailyStatisticalTaskService.java | 15 ++++ ...agUsedDailyStatisticalTaskServiceImpl.java | 24 ++++++ .../task/DailyStatisticalTagUsedTask.java | 34 +++++++++ 7 files changed, 227 insertions(+), 10 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/StatsPublicityFeignClient.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/StatsPublicityFeignClientFallBack.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java index 67a0f8ea1a..cf84ae177f 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/ServiceConstant.java @@ -107,10 +107,15 @@ public interface ServiceConstant { /** * 政府端-党建声音 */ - String GOV_VOICE_SERVER="gov-voice-server"; + String GOV_VOICE_SERVER = "gov-voice-server"; /** * 居民端-党建声音 */ - String RESI_VOICE_SERVER="resi-voice-server"; + String RESI_VOICE_SERVER = "resi-voice-server"; + + /** + * 数据统计 + */ + String DATA_STATISTICAL = "data_statistical"; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index 7db6e827c0..de043dc7b3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -29,8 +29,8 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "publicitySummaryStatsjob") - public Result publicitySummaryStatsjob(Date statsDate) { + @PostMapping(value = "articleSummaryDailyStatsjob") + public Result articleSummaryDailyStatsjob(Date statsDate) { return new Result().ok(statsPublicityService.articlePublishedCountDayStats(statsDate)); } @@ -40,13 +40,13 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagUsedDayStatsjob") - public Result tagUsedDayStatsjob(Date statsDate) { + @PostMapping(value = "tagUsedDailyStatsjob") + public Result tagUsedDailyStatsjob(Date statsDate) { return new Result().ok(statsPublicityService.tagUsedDayStatsjob(statsDate)); } /** - * desc:【月】 统计发表文章最多的分类 包含 机关 部门 网格 + * desc:【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 * * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return @@ -62,13 +62,13 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagViewedDayStatsjob") - public Result tagViewedDayStatsjob(Date statsDate) { + @PostMapping(value = "tagViewedDailyStatsjob") + public Result tagViewedDailyStatsjob(Date statsDate) { return new Result().ok(statsPublicityService.tagViewedDayStatsjob(statsDate)); } /** - * desc:【月】 统计阅读最多的标签 包含 机关 网格 + * desc:【月,季,年】 统计阅读最多的标签 包含 机关 网格 * * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/StatsPublicityFeignClient.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/StatsPublicityFeignClient.java new file mode 100644 index 0000000000..737904dcc3 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/StatsPublicityFeignClient.java @@ -0,0 +1,64 @@ +package com.epmet.feign; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.impl.StatsPublicityFeignClientFallBack; +import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.web.bind.annotation.PostMapping; + +/** + * @Description 数据-宣传能力 -定时任务 + * @Author wangc + * @Date 2020/5/23 13:42 + */ +@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = StatsPublicityFeignClientFallBack.class) +public interface StatsPublicityFeignClient { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/articleSummaryDailyStatsjob") + Result articleSummaryDailyStatsjob(); + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedDailyStatsjob") + Result tagUsedDailyStatsjob(); + + /** + * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedMonthStatsjob") + Result tagUsedMonthStatsjob(); + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob") + Result tagViewedDayStatsjob(); + + /** + * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedMonthStatsjob") + Result tagViewedMonthStatsjob(); + + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/StatsPublicityFeignClientFallBack.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/StatsPublicityFeignClientFallBack.java new file mode 100644 index 0000000000..06e26cd4e6 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/StatsPublicityFeignClientFallBack.java @@ -0,0 +1,75 @@ +package com.epmet.feign.impl; + +import com.epmet.commons.tools.constant.ServiceConstant; +import com.epmet.commons.tools.utils.ModuleUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.StatsPublicityFeignClient; +import org.springframework.stereotype.Component; + +/** + * desc: + * + * @return: + * @date: 2020/6/22 9:38 + * @author: jianjun liu + * email:liujianjun@git.elinkit.com.cn + */ +@Component +public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignClient { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result articleSummaryDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "articleSummaryDailyStatsjob"); + } + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagUsedDailyStatsjob"); + } + + /** + * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedMonthStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagUsedMonthStatsjob"); + } + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedDayStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagViewedDayStatsjob"); + } + + /** + * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagViewedMonthStatsjob"); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java new file mode 100644 index 0000000000..6310d0a86c --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java @@ -0,0 +1,15 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.utils.Result; + +/** + * @Description 生成议题表决日统计数定时任务 + * @Author wangc + * @Date 2020/5/20 17:39 + */ +public interface TagUsedDailyStatisticalTaskService { + + Result issueVotingDailyStatistical(); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java new file mode 100644 index 0000000000..002e419832 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java @@ -0,0 +1,24 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.feign.GovIssueFeignClient; +import com.epmet.service.IssueVotingDailyStatisticalTaskService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description + * @ClassName IssueVotingDailyStatisticalTaskServiceImpl + * @Auth wangc + * @Date 2020-05-25 09:24 + */ +@Service +public class TagUsedDailyStatisticalTaskServiceImpl implements IssueVotingDailyStatisticalTaskService { + @Autowired + private GovIssueFeignClient govIssueFeignClient; + + @Override + public Result issueVotingDailyStatistical() { + return govIssueFeignClient.dailyStatisticalVoteJob(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java new file mode 100644 index 0000000000..f31ae3b5b9 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java @@ -0,0 +1,34 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.IssueVotingDailyStatisticalTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description + * @ClassName dailyStatisticalVoteTask + * @Auth wangc + * @Date 2020-05-25 09:22 + */ +@Component("dailyStatisticalVoteTask") +public class DailyStatisticalTagUsedTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private IssueVotingDailyStatisticalTaskService issueVotingDailyStatisticalTaskService; + + + @Override + public void run(String params) { + logger.debug("dailyStatisticalVoteTask定时任务正在执行,参数为:{}", params); + Result result = issueVotingDailyStatisticalTaskService.issueVotingDailyStatistical(); + if (result.success()) { + logger.debug("dailyStatisticalVoteTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("dailyStatisticalVoteTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} From c3946a9e503a5e2868323763c47bae4e2c63b027 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 22 Jun 2020 10:54:37 +0800 Subject: [PATCH 062/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dto/issue/IssueGridDTO.java | 31 + .../com/epmet/dto/issue/IssueProjectDTO.java | 32 + .../com/epmet/dto/project/ProjectGridDTO.java | 31 + .../com/epmet/dao/issue/StatsIssueDao.java | 52 ++ .../com/epmet/dao/project/ProjectDao.java | 22 + .../dao/stats/FactIssueAgencyMonthlyDao.java | 15 +- .../dao/stats/FactIssueGridMonthlyDao.java | 14 +- .../com/epmet/service/Issue/IssueService.java | 51 ++ .../service/Issue/impl/IssueServiceImpl.java | 27 + .../com/epmet/service/StatsIssueService.java | 32 +- .../service/impl/StatsIssueServiceImpl.java | 550 +++++++++++++++++- .../epmet/service/project/ProjectService.java | 21 + .../project/impl/ProjectServiceImpl.java | 11 + .../stats/FactIssueAgencyMonthlyService.java | 10 + .../stats/FactIssueGridMonthlyService.java | 10 + .../FactIssueAgencyMonthlyServiceImpl.java | 5 + .../impl/FactIssueGridMonthlyServiceImpl.java | 5 + .../resources/mapper/issue/StatsIssueDao.xml | 84 ++- .../resources/mapper/project/ProjectDao.xml | 28 + .../stats/FactIssueAgencyMonthlyDao.xml | 21 + .../mapper/stats/FactIssueGridMonthlyDao.xml | 23 +- 21 files changed, 1054 insertions(+), 21 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java new file mode 100644 index 0000000000..de7bacf7a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueGridDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 13:56 + */ +@Data +public class IssueGridDTO implements Serializable { + private static final long serialVersionUID = 4681179503519406263L; + /** + * 组织ID + */ + private String agencyId; + /** + * 上级ID + */ + private String gridId; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java new file mode 100644 index 0000000000..5381b77c8a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectDTO.java @@ -0,0 +1,32 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 17:28 + */ +@Data +public class IssueProjectDTO implements Serializable { + private static final long serialVersionUID = -6457792985830058324L; + /** + * 议题ID + */ + private String issueId; + /** + * 项目ID + */ + private String projectId; + /** + * 网格ID + */ + private String gridId; + /** + * 状态 + */ + private String status; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java new file mode 100644 index 0000000000..982bce9a87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectGridDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/19 16:58 + */ +@Data +public class ProjectGridDTO implements Serializable { + private static final long serialVersionUID = 7176541257563571224L; + /** + * 项目ID + */ + private String projectId; + /** + * 组织ID + */ + private String agencyId; + /** + * 议题ID + */ + private String issueId; + /** + * 状态 + */ + private String status; +} 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 4c23a2d833..98d2e0e96d 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 @@ -2,6 +2,8 @@ package com.epmet.dao.issue; 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.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -59,4 +61,54 @@ public interface StatsIssueDao extends BaseDao { * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 **/ List selectGridProjectList(@Param("customerId") String customerId); + /** + * 获取当前日期网格下议题统计结果 + * + * @param customerId + * @param date + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/17 14:13 + */ + List selectGridIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 获取当前日期网格下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:55 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 网格已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 查询客户下议题和项目关系 + * @author zhaoqifeng + * @date 2020/6/19 17:34 + * @param customerId + * @return java.util.List + */ + List selectIssueProjectList(@Param("customerId") String customerId); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 32a67d173e..a50874c99e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -60,4 +61,25 @@ public interface ProjectDao extends BaseDao { * @return java.util.List */ List selectAgencyClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); + + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedProjectTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectGridClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java index 0621b2526e..acaf6e5d1b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 组织机关议题数量(按月) @@ -29,5 +33,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueAgencyMonthlyDao extends BaseDao { - + /** + * 统计机关议题各个指标月度增量 + * @author zhaoqifeng + * @date 2020/6/19 10:13 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java index 6c11e47904..2e9c335661 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; import com.epmet.entity.stats.FactIssueGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网格议题数量(按月) @@ -29,5 +33,13 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueGridMonthlyDao extends BaseDao { - + /** + * 统计网格议题各个指标月度增量 + * @author zhaoqifeng + * @date 2020/6/19 10:41 + * @param customerId + * @param monthId + * @return java.util.List + */ + List selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 547ca461dd..c6b8a8bee0 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,6 +1,8 @@ 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.entity.issue.IssueEntity; import java.util.List; @@ -57,4 +59,53 @@ public interface IssueService { * @Description 根据客户Id查询议题库已转项目的网格项目关系数据 **/ List getGridProjectList(String customerId); + + /** + * 获取以网格为单位议题统计结果 + * @author zhaoqifeng + * @date 2020/6/19 14:34 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridIssueTotal(String customerId, String date); + + /** + * 获取当前日期网格下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridIssueInc(String customerId, String date); + + /** + * 获取截止当前日期网格下已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedIssueTotal(String customerId, String date); + + /** + * 获取当前日期网格下已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:56 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedIssueInc(String customerId, String date); + + /** + * 获取议题项目关系 + * @author zhaoqifeng + * @date 2020/6/19 17:40 + * @param customerId + * @return java.util.List + */ + List getIssueProjectList(String customerId); } 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 e939aa61dc..9cef7c5340 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 @@ -4,6 +4,8 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.constant.DataSourceConstant; 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.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; @@ -73,4 +75,29 @@ public class IssueServiceImpl implements IssueService { public List getGridProjectList(String customerId) { return statsIssueDao.selectGridProjectList(customerId); } + + @Override + public List getGridIssueTotal(String customerId, String date) { + return statsIssueDao.selectGridIssueTotal(customerId, date); + } + + @Override + public List getGridIssueInc(String customerId, String date) { + return statsIssueDao.selectGridIssueInc(customerId, date); + } + + @Override + public List getGridClosedIssueTotal(String customerId, String date) { + return statsIssueDao.selectGridClosedIssueTotal(customerId, date); + } + + @Override + public List getGridClosedIssueInc(String customerId, String date) { + return statsIssueDao.selectGridClosedIssueInc(customerId, date); + } + + @Override + public List getIssueProjectList(String customerId) { + return statsIssueDao.selectIssueProjectList(customerId); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java index 89bd89f22e..9f6884b829 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -9,7 +9,7 @@ import java.util.Date; */ public interface StatsIssueService { /** - * 机关下议题统计 + * 机关下议题日统计 * @author zhaoqifeng * @date 2020/6/17 16:53 * @param customerId @@ -17,4 +17,34 @@ public interface StatsIssueService { * @return void */ void saveIssueAgencyDaily(String customerId, Date date); + + /** + * 机关下议题月统计 + * @author zhaoqifeng + * @date 2020/6/18 17:39 + * @param customerId + * @param date + * @return void + */ + void saveIssueAgencyMonthly(String customerId, Date date); + + /** + * 机关下网格议题日统计 + * @author zhaoqifeng + * @date 2020/6/19 13:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueGridDaily(String customerId, Date date); + + /** + * 机关下网格议题月统计 + * @author zhaoqifeng + * @date 2020/6/19 13:53 + * @param customerId + * @param date + * @return void + */ + void saveIssueGridMonthly(String customerId, Date date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index 080e79dc7f..c300b22e46 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -1,27 +1,30 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.IssueConstant; import com.epmet.dto.issue.IssueAgencyDTO; +import com.epmet.dto.issue.IssueGridDTO; +import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.dto.stats.DimAgencyDTO; -import com.epmet.entity.stats.FactIssueAgencyDailyEntity; -import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.*; import com.epmet.service.Issue.IssueService; import com.epmet.service.StatsIssueService; import com.epmet.service.project.ProjectService; -import com.epmet.service.stats.DimAgencyService; -import com.epmet.service.stats.FactIssueAgencyDailyService; +import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.util.*; +import java.util.stream.Collectors; /** * @author zhaoqifeng @@ -35,9 +38,15 @@ public class StatsIssueServiceImpl implements StatsIssueService { @Autowired private DimAgencyService dimAgencyService; @Autowired + private DimGridService dimGridService; + @Autowired private ProjectService projectService; @Autowired private FactIssueAgencyDailyService factIssueAgencyDailyService; + @Autowired + private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService; + @Autowired + private FactIssueGridMonthlyService factIssueGridMonthlyService; @Override public void saveIssueAgencyDaily(String customerId, Date date) { @@ -51,9 +60,9 @@ public class StatsIssueServiceImpl implements StatsIssueService { //获取机关下议题各种状态的数目增量 List issueAgencyIncList = issueService.getAgencyIssueInc(customerId, dateString); //获取机关下已关闭议题统计 - List issueAgencyClosedTotalList = issueService.getAgencyIssueInc(customerId, dateString); + List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); //获取机关下已关闭议题增量 - List issueAgencyClosedIncList = issueService.getAgencyIssueInc(customerId, dateString); + List issueAgencyClosedIncList = issueService.getAgencyClosedIssueInc(customerId, dateString); //已结案项目统计 List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); //已结案项目增量 @@ -95,20 +104,460 @@ public class StatsIssueServiceImpl implements StatsIssueService { } } list.add(entity); + } + //批量插入 + factIssueAgencyDailyService.insertBatch(list); + } + + @Override + public void saveIssueAgencyMonthly(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取当前客户下所有机关 + List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); + //获取机关下议题各种状态的数目统计 + List issueAgencyTotalList = issueService.getAgencyIssueTotal(customerId); + //获取机关下已关闭议题统计 + List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); + //已结案项目统计 + List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //统计机关下议题各个指标月度增量 + List issueAgencyMonthlyIncList = factIssueAgencyMonthlyService.getAgencyMonthlyInc(customerId, dimId.getMonthId()); + + List list = new ArrayList<>(); + for (DimAgencyDTO agency : agencyList) { + FactIssueAgencyDailyEntity daily = initIssueAgencyDaily(dimId); + FactIssueAgencyMonthlyEntity monthly = initIssueAgencyMonthly(dimId); + + String pIds; + if (null == agency.getPids() || agency.getPids().isEmpty()) { + pIds = agency.getPid().concat(":").concat(agency.getId()); + } else { + pIds = ("0").concat(":").concat(agency.getPids()).concat(":").concat(agency.getId()); + } + //总量统计 + saveTotal(issueAgencyTotalList, agency, daily, pIds); + //已关闭议题已解决未解决统计 + if (daily.getClosedTotal() > NumConstant.ZERO) { + saveClosedTotal(issueAgencyClosedTotalList, agency, daily, pIds); + } + //已关闭项目已解决未解决统计 + if (daily.getShiftProjectTotal() > NumConstant.ZERO) { + saveClosedProjectTotal(projectAgencyClosedTotalList, agency, daily, pIds); + } + monthly = ConvertUtils.sourceToTarget(daily, FactIssueAgencyMonthlyEntity.class); + //各指标增量统计 + for (int i = 0; i < issueAgencyMonthlyIncList.size(); i++) { + FactIssueAgencyMonthlyDTO dto = issueAgencyMonthlyIncList.get(i); + if (agency.getId().equals(dto.getAgencyId())) { + monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); + monthly.setClosedIncr(dto.getClosedIncr()); + monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); + monthly.setClosedUnresolvedIncr(dto.getClosedUnresolvedIncr()); + monthly.setClosedCaseIncr(dto.getClosedCaseIncr()); + monthly.setClosedCaseResolvedIncr(dto.getClosedCaseResolvedIncr()); + monthly.setClosedCaseUnresolvedIncr(dto.getClosedCaseUnresolvedIncr()); + issueAgencyMonthlyIncList.remove(i); + break; + } + } + monthly.setCustomerId(agency.getCustomerId()); + monthly.setAgencyId(agency.getId()); + monthly.setPid(agency.getPid()); + + list.add(monthly); + } + //批量插入 + factIssueAgencyMonthlyService.insertBatch(list); + } + + @Override + public void saveIssueGridDaily(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取客户下所有网格数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + //获取网格下议题各种状态的数目统计 + List gridTotalList = issueService.getGridIssueTotal(customerId, dateString); + //获取网格下议题各种状态的增量统计 + List gridIncList = issueService.getGridIssueInc(customerId, dateString); + //获取网格下已关闭议题各种状态的数目统计 + List gridClosedTotalList = issueService.getGridClosedIssueTotal(customerId, dateString); + //获取网格下已关闭议题各种状态的增量统计 + List gridClosedIncList = issueService.getGridClosedIssueInc(customerId, dateString); + //项目议题关系 + List issueProjectList = issueService.getIssueProjectList(customerId); + //已结案项目统计 + List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); + //已结案项目增量 + List closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString); + Map resolveMap= new HashMap<>(); + Map unResolveMap = new HashMap<>(); + Map resolveIncMap = new HashMap<>(); + Map unResolveIncMap = new HashMap<>(); + if (null != issueProjectList) { + List totalList = issueProjectList.stream().flatMap(ip -> + closedProjectTotalList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> totalMap = + totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveList = totalMap.get(IssueConstant.RESLOVED); + List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + List incList = issueProjectList.stream().flatMap(ip -> + closedProjectIncList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> incMap = + incList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveIncList = incMap.get(IssueConstant.RESLOVED); + List unResolveIncList = incMap.get(IssueConstant.UNRESLOVED); + resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + unResolveIncMap = unResolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } + + List list = new ArrayList<>(); + + for (DimGridEntity grid : gridList) { + FactIssueGridDailyEntity entity = initIssueGridDaily(dimId); + entity.setCustomerId(grid.getCustomerId()); + entity.setAgencyId(grid.getId()); + //总量统计 + saveGridTotal(gridTotalList, grid, entity); + //增量统计 + saveGridInc(gridIncList, grid, entity); + + if (entity.getClosedTotal() > NumConstant.ZERO) { + //已关闭议题已解决未解决数量统计 + saveGridClosedTotal(gridClosedTotalList, grid, entity); + + if (entity.getClosedIncr() > NumConstant.ZERO) { + //已关闭议题已解决未解决增量统计 + saveGridClosedInc(gridClosedIncList, grid, entity); + } + } + //已关闭项目已解决未解决统计 + saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity); + } + + } + + @Override + public void saveIssueGridMonthly(String customerId, Date date) { + String dateString = DateUtils.format(date); + DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); + dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //获取客户下所有网格数据 + List gridList = dimGridService.getGridListByCustomerId(customerId); + //获取网格下议题各种状态的数目统计 + List gridTotalList = issueService.getGridIssueTotal(customerId, dateString); + //获取网格下已关闭议题各种状态的数目统计 + List gridClosedTotalList = issueService.getGridClosedIssueTotal(customerId, dateString); + //增量统计 + List gridMonthlyIncListList = factIssueGridMonthlyService.getGridMonthlyInc(customerId, dimId.getMonthId()); + //项目议题关系 + List issueProjectList = issueService.getIssueProjectList(customerId); + //已结案项目统计 + List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); + Map resolveMap= new HashMap<>(); + Map unResolveMap = new HashMap<>(); + if (null != issueProjectList) { + List totalList = issueProjectList.stream().flatMap(ip -> + closedProjectTotalList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { + IssueProjectDTO dto = new IssueProjectDTO(); + dto.setIssueId(ip.getIssueId()); + dto.setGridId(ip.getGridId()); + dto.setProjectId(ip.getProjectId()); + dto.setStatus(project.getStatus()); + return dto; + })).collect(Collectors.toList()); + Map> totalMap = + totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); + List resolveList = totalMap.get(IssueConstant.RESLOVED); + List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } - factIssueAgencyDailyService.insertBatch(list); + List list = new ArrayList<>(); + + for (DimGridEntity grid : gridList) { + FactIssueGridDailyEntity daily = initIssueGridDaily(dimId); + FactIssueGridMonthlyEntity monthly = initIssueGridMonthly(dimId); + + //总量统计 + saveGridTotal(gridTotalList, grid, daily); + + if (daily.getClosedTotal() > NumConstant.ZERO) { + //已关闭议题已解决未解决数量统计 + saveGridClosedTotal(gridClosedTotalList, grid, daily); + } + monthly = ConvertUtils.sourceToTarget(daily, FactIssueGridMonthlyEntity.class); + + //已关闭项目已解决未解决统计 + int resolve = null == resolveMap.get(grid.getId())?0:resolveMap.get(grid.getId()).intValue(); + int unResolve = null == unResolveMap.get(grid.getId())?0:unResolveMap.get(grid.getId()).intValue(); + int total = resolve + unResolve; + monthly.setClosedCaseTotal(total); + monthly.setClosedCaseResolvedTotal(resolve); + monthly.setClosedCaseUnresolvedTotal(unResolve); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + + //各指标增量统计 + for (int i = 0; i < gridMonthlyIncListList.size(); i++) { + FactIssueGridMonthlyDTO dto = gridMonthlyIncListList.get(i); + if (grid.getId().equals(dto.getGridId())) { + monthly.setIssueIncr(dto.getIssueIncr()); + monthly.setShiftProjectIncr(dto.getShiftProjectIncr()); + monthly.setClosedIncr(dto.getClosedIncr()); + monthly.setClosedResolvedIncr(dto.getClosedResolvedIncr()); + monthly.setClosedUnresolvedIncr(dto.getClosedUnresolvedIncr()); + monthly.setClosedCaseIncr(dto.getClosedCaseIncr()); + monthly.setClosedCaseResolvedIncr(dto.getClosedCaseResolvedIncr()); + monthly.setClosedCaseUnresolvedIncr(dto.getClosedCaseUnresolvedIncr()); + gridMonthlyIncListList.remove(i); + break; + } + } + + monthly.setCustomerId(grid.getCustomerId()); + monthly.setAgencyId(grid.getId()); + monthly.setGridId(grid.getId()); + list.add(monthly); } + factIssueGridMonthlyService.insertBatch(list); } /** - * 已关闭项目已解决未解决增量统计 + * 已关闭项目已解决未解决统计 * @author zhaoqifeng - * @date 2020/6/18 17:23 + * @date 2020/6/22 10:35 + * @param resolveMap + * @param unResolveMap + * @param resolveIncMap + * @param unResolveIncMap + * @param grid + * @param entity + * @return void + */ + private void saveClosedProject(Map resolveMap, Map unResolveMap, Map resolveIncMap, + Map unResolveIncMap, DimGridEntity grid, FactIssueGridDailyEntity entity) { + int resolve = null == resolveMap.get(grid.getId())?0:resolveMap.get(grid.getId()).intValue(); + int unResolve = null == unResolveMap.get(grid.getId())?0:unResolveMap.get(grid.getId()).intValue(); + int resolveInc = null == resolveIncMap.get(grid.getId())?0:resolveIncMap.get(grid.getId()).intValue(); + int unResolveInc = null == unResolveIncMap.get(grid.getId())?0:unResolveIncMap.get(grid.getId()).intValue(); + int total = resolve + unResolve; + int inc = resolveInc + unResolveInc; + entity.setClosedCaseTotal(total); + entity.setClosedCaseResolvedTotal(resolve); + entity.setClosedCaseUnresolvedTotal(unResolve); + entity.setClosedCaseIncr(inc); + entity.setClosedCaseResolvedIncr(resolveInc); + entity.setClosedCaseUnresolvedIncr(unResolveInc); + + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } + + /** + * 已关闭议题已解决未解决增量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:56 + */ + private void saveGridClosedInc(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //已解决数 + int resolvedInc = NumConstant.ZERO; + //未解决数 + int unresolvedInc = NumConstant.ZERO; + + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.RESLOVED.equals(dto.getStatus())) { + //表决中议题数量 + resolvedInc = dto.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) { + //已转项目议题数量 + unresolvedInc = dto.getCount(); + } + } + } + entity.setClosedResolvedIncr(resolvedInc); + entity.setClosedUnresolvedIncr(unresolvedInc); + } + + /** + * 已关闭议题已解决未解决总量级占比统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:56 + */ + private void saveGridClosedTotal(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //已解决数 + int resolvedCount = NumConstant.ZERO; + //未解决数 + int unresolvedCount = NumConstant.ZERO; + + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.RESLOVED.equals(dto.getStatus())) { + //已解决议题数量 + resolvedCount = dto.getCount(); + } else if (IssueConstant.UNRESLOVED.equals(dto.getStatus())) { + //未解决议题数量 + unresolvedCount = dto.getCount(); + } + } + } + entity.setClosedResolvedTotal(resolvedCount); + entity.setClosedUnresolvedTotal(unresolvedCount); + + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } + + /** + * 网格议题增量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:57 + */ + private void saveGridInc(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //表决中增量 + int votingInc = NumConstant.ZERO; + //已转项目增量 + int shiftInc = NumConstant.ZERO; + //已关闭增量 + int closedInc = NumConstant.ZERO; + for (IssueGridDTO dto : list) { + if (grid.getId().equals(dto.getGridId())) { + if (IssueConstant.VOTING.equals(dto.getStatus())) { + //表决中议题数量 + votingInc = dto.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) { + //已转项目议题数量 + shiftInc = dto.getCount(); + } else { + //已关闭议题数量 + closedInc = dto.getCount(); + } + } + } + int issueInc = votingInc + shiftInc + closedInc; + entity.setVotingIncr(votingInc); + entity.setShiftProjectIncr(shiftInc); + entity.setClosedIncr(closedInc); + entity.setIssueIncr(issueInc); + } + + /** + * 网格议题总量统计 + * + * @param list + * @param grid + * @param entity + * @return void + * @author zhaoqifeng + * @date 2020/6/19 15:57 + */ + private void saveGridTotal(List list, DimGridEntity grid, FactIssueGridDailyEntity entity) { + //表决中数量 + Integer votingCount = NumConstant.ZERO; + //已转项目数量 + Integer shiftCount = NumConstant.ZERO; + //已关闭数量 + Integer closedCount = NumConstant.ZERO; + for (IssueGridDTO dto : list) { + if (dto.getGridId().equals(grid.getId())) { + if (IssueConstant.VOTING.equals(dto.getStatus())) { + //表决中议题数量 + votingCount = dto.getCount(); + } else if (IssueConstant.SHIFT_PROJECT.equals(dto.getStatus())) { + //已转项目议题数量 + shiftCount = dto.getCount(); + } else { + //已关闭议题数量 + closedCount = dto.getCount(); + } + } + } + int issueTotal = votingCount + shiftCount + closedCount; + entity.setVotingTotal(votingCount); + entity.setShiftProjectTotal(shiftCount); + entity.setClosedTotal(closedCount); + entity.setIssueTotal(issueTotal); + if (NumConstant.ZERO != issueTotal) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal voting = new BigDecimal(votingCount); + BigDecimal shift = new BigDecimal(shiftCount); + BigDecimal closed = new BigDecimal(closedCount); + BigDecimal total = new BigDecimal(issueTotal); + entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + + } + } + + /** + * 已关闭项目已解决未解决增量统计 + * * @param list * @param agency * @param entity * @param pIds * @return void + * @author zhaoqifeng + * @date 2020/6/18 17:23 */ private void saveClosedProjectInc(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { //已解决数 @@ -135,13 +584,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { /** * 已关闭项目已解决未解决统计 - * @author zhaoqifeng - * @date 2020/6/18 17:23 + * * @param list * @param agency * @param entity * @param pIds * @return void + * @author zhaoqifeng + * @date 2020/6/18 17:23 */ private void saveClosedProjectTotal(List list, DimAgencyDTO agency, FactIssueAgencyDailyEntity entity, String pIds) { //已解决数 @@ -286,7 +736,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { //表决中议题数量 resolvedCount = resolvedCount + issueAgency.getCount(); - } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) { //已转项目议题数量 unresolvedCount = unresolvedCount + issueAgency.getCount(); } @@ -325,7 +775,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { if (IssueConstant.RESLOVED.equals(issueAgency.getStatus())) { //表决中议题数量 resolvedInc = resolvedInc + issueAgency.getCount(); - } else if (IssueConstant.SHIFT_PROJECT.equals(issueAgency.getStatus())) { + } else if (IssueConstant.UNRESLOVED.equals(issueAgency.getStatus())) { //已转项目议题数量 unresolvedInc = unresolvedInc + issueAgency.getCount(); } @@ -419,4 +869,72 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); return entity; } + + private FactIssueGridDailyEntity initIssueGridDaily(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueGridDailyEntity entity = new FactIssueGridDailyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setWeekId(dimIdBean.getWeekId()); + entity.setDateId(dimIdBean.getDateId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } + + private FactIssueGridMonthlyEntity initIssueGridMonthly(DimIdGenerator.DimIdBean dimIdBean) { + FactIssueGridMonthlyEntity entity = new FactIssueGridMonthlyEntity(); + entity.setYearId(dimIdBean.getYearId()); + entity.setQuarterId(dimIdBean.getQuarterId()); + entity.setMonthId(dimIdBean.getMonthId()); + entity.setIssueTotal(NumConstant.ZERO); + entity.setIssueIncr(NumConstant.ZERO); + entity.setVotingTotal(NumConstant.ZERO); + entity.setVotingIncr(NumConstant.ZERO); + entity.setVotingPercent(BigDecimal.ZERO); + entity.setShiftProjectTotal(NumConstant.ZERO); + entity.setShiftProjectIncr(NumConstant.ZERO); + entity.setShiftProjectPercent(BigDecimal.ZERO); + entity.setClosedIncr(NumConstant.ZERO); + entity.setClosedResolvedIncr(NumConstant.ZERO); + entity.setClosedUnresolvedIncr(NumConstant.ZERO); + entity.setClosedTotal(NumConstant.ZERO); + entity.setClosedResolvedTotal(NumConstant.ZERO); + entity.setClosedUnresolvedTotal(NumConstant.ZERO); + entity.setClosedPercent(BigDecimal.ZERO); + entity.setClosedResolvedPercent(BigDecimal.ZERO); + entity.setClosedUnresolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseIncr(NumConstant.ZERO); + entity.setClosedCaseResolvedIncr(NumConstant.ZERO); + entity.setClosedCaseUnresolvedIncr(NumConstant.ZERO); + entity.setClosedCaseTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedTotal(NumConstant.ZERO); + entity.setClosedCaseUnresolvedTotal(NumConstant.ZERO); + entity.setClosedCaseResolvedPercent(BigDecimal.ZERO); + entity.setClosedCaseUnresolvedPercent(BigDecimal.ZERO); + return entity; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 79342835d7..45929aebb7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java @@ -19,6 +19,7 @@ package com.epmet.service.project; import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.entity.project.ProjectEntity; import java.util.List; @@ -57,4 +58,24 @@ public interface ProjectService extends BaseService { * @return java.util.List */ List getAgencyClosedProjectInc(String customerId, String date); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedProjectTotal(String customerId, String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:04 + * @param customerId + * @param date + * @return java.util.List + */ + List getGridClosedProjectInc(String customerId, String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index b757a52799..0a5bac27b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -22,6 +22,7 @@ import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectGridDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.springframework.beans.factory.annotation.Autowired; @@ -59,4 +60,14 @@ public class ProjectServiceImpl extends BaseServiceImpl getGridClosedProjectTotal(String customerId, String date) { + return baseDao.selectGridClosedProjectTotal(customerId, date); + } + + @Override + public List getGridClosedProjectInc(String customerId, String date) { + return baseDao.selectGridClosedProjectInc(customerId, date); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java index 0e96cc1835..ebd176bb4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java @@ -92,4 +92,14 @@ public interface FactIssueAgencyMonthlyService extends BaseService + */ + List getAgencyMonthlyInc(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java index 99a9a36769..302c320653 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -92,4 +92,14 @@ public interface FactIssueGridMonthlyService extends BaseService + */ + List getGridMonthlyInc(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java index a4d64c92c4..47db53b737 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java @@ -98,4 +98,9 @@ public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl getAgencyMonthlyInc(String customerId, String monthId) { + return baseDao.selectAgencyMonthlyInc(customerId, monthId); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java index 33b00ffd2e..1c084b836a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -97,4 +97,9 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl getGridMonthlyInc(String customerId, String monthId) { + return baseDao.selectGridMonthlyInc(customerId, monthId); + } + } \ 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 68c4c3fb22..3120f939d8 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 @@ -28,7 +28,7 @@ WHERE i.DEL_FLAG = '0' AND i.CUSTOMER_ID = #{customerId} - AND DATE(ip.ip.CREATED_TIME) = #{date} + AND DATE(ip.CREATED_TIME) = #{date} GROUP BY i.ORG_ID, ip.ISSUE_STATUS @@ -67,6 +67,88 @@ ORG_ID, RESOLVE_TYPE + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml index 24e3e22dad..f6bdd808cb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -44,5 +44,26 @@ + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml index 69538d9534..56896b9f0d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -44,5 +44,26 @@ - + \ No newline at end of file From cad328edc13a4c50704630c41061e78dcb60af65 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Jun 2020 10:59:08 +0800 Subject: [PATCH 063/101] =?UTF-8?q?=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0feign?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../feign/StatsPublicityFeignClient.java | 4 +- .../StatsPublicityFeignClientFallBack.java | 4 +- .../epmet-job/epmet-job-server/pom.xml | 5 ++ .../service/StatsPublicityTaskService.java | 56 ++++++++++++++ .../TagUsedDailyStatisticalTaskService.java | 15 ---- .../impl/StatsPublicityTaskServiceImpl.java | 75 +++++++++++++++++++ ...agUsedDailyStatisticalTaskServiceImpl.java | 24 ------ .../task/DailyStatisticalTagUsedTask.java | 34 --------- ...PublicityArticleSummaryDailyStatsTask.java | 31 ++++++++ .../task/PublicityTagUsedDailyStatsTask.java | 31 ++++++++ .../PublicityTagUsedMonthlyStatsTask.java | 31 ++++++++ .../PublicityTagViewedDailyStatsTask.java | 31 ++++++++ .../PublicityTagViewedMonthlyStatsTask.java | 31 ++++++++ 13 files changed, 295 insertions(+), 77 deletions(-) rename epmet-module/{epmet-job/epmet-job-server/src/main/java/com/epmet => data-statistical/data-statistical-client/src/main/java}/feign/StatsPublicityFeignClient.java (95%) rename epmet-module/{epmet-job/epmet-job-server/src/main/java/com/epmet => data-statistical/data-statistical-client/src/main/java}/feign/impl/StatsPublicityFeignClientFallBack.java (96%) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPublicityTaskService.java delete mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java delete mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java delete mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityArticleSummaryDailyStatsTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedDailyStatsTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedMonthlyStatsTask.java diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/StatsPublicityFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java similarity index 95% rename from epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/StatsPublicityFeignClient.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java index 737904dcc3..13456bed4a 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/StatsPublicityFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java @@ -1,8 +1,8 @@ -package com.epmet.feign; +package feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.impl.StatsPublicityFeignClientFallBack; +import feign.impl.StatsPublicityFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/StatsPublicityFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java similarity index 96% rename from epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/StatsPublicityFeignClientFallBack.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java index 06e26cd4e6..4ca3c6e628 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/feign/impl/StatsPublicityFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java @@ -1,9 +1,9 @@ -package com.epmet.feign.impl; +package feign.impl; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.StatsPublicityFeignClient; +import feign.StatsPublicityFeignClient; import org.springframework.stereotype.Component; /** diff --git a/epmet-module/epmet-job/epmet-job-server/pom.xml b/epmet-module/epmet-job/epmet-job-server/pom.xml index 8b389883f0..f589819cb1 100644 --- a/epmet-module/epmet-job/epmet-job-server/pom.xml +++ b/epmet-module/epmet-job/epmet-job-server/pom.xml @@ -28,6 +28,11 @@ epmet-commons-mybatis 2.0.0 + + com.epmet + data-statistical-client + 2.0.0 + org.springframework.boot spring-boot-starter-web diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPublicityTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPublicityTaskService.java new file mode 100644 index 0000000000..460fc5075a --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsPublicityTaskService.java @@ -0,0 +1,56 @@ +package com.epmet.service; + + +import com.epmet.commons.tools.utils.Result; + +/** + * desc: 数据-宣传能力-数据统计 + * + * @return: + * @date: 2020/6/22 10:24 + * @author: jianjun liu + */ +public interface StatsPublicityTaskService { + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result articleSummaryDailyStatsjob(); + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagUsedDailyStatsjob(); + + /** + * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagUsedMonthlyStatsjob(); + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagViewedDailyStatsjob(); + + /** + * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + Result tagViewedMonthlyStatsjob(); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java deleted file mode 100644 index 6310d0a86c..0000000000 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/TagUsedDailyStatisticalTaskService.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.epmet.service; - - -import com.epmet.commons.tools.utils.Result; - -/** - * @Description 生成议题表决日统计数定时任务 - * @Author wangc - * @Date 2020/5/20 17:39 - */ -public interface TagUsedDailyStatisticalTaskService { - - Result issueVotingDailyStatistical(); - -} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java new file mode 100644 index 0000000000..5d60a862e1 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsPublicityTaskServiceImpl.java @@ -0,0 +1,75 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import feign.StatsPublicityFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @Description + * @ClassName IssueVotingDailyStatisticalTaskServiceImpl + * @Auth wangc + * @Date 2020-05-25 09:24 + */ +@Service +public class StatsPublicityTaskServiceImpl implements StatsPublicityTaskService { + @Autowired + private StatsPublicityFeignClient statsPublicityFeignClient; + + /** + * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result articleSummaryDailyStatsjob() { + return statsPublicityFeignClient.articleSummaryDailyStatsjob(); + } + + /** + * desc: 定时任务 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 + * + * @return: + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedDailyStatsjob() { + return statsPublicityFeignClient.tagUsedDailyStatsjob(); + } + + /** + * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedMonthlyStatsjob() { + return statsPublicityFeignClient.tagUsedMonthStatsjob(); + } + + /** + * desc: 【日】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedDailyStatsjob() { + return statsPublicityFeignClient.tagViewedDayStatsjob(); + } + + /** + * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthlyStatsjob() { + return statsPublicityFeignClient.tagViewedMonthStatsjob(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java deleted file mode 100644 index 002e419832..0000000000 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/TagUsedDailyStatisticalTaskServiceImpl.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.epmet.service.impl; - -import com.epmet.commons.tools.utils.Result; -import com.epmet.feign.GovIssueFeignClient; -import com.epmet.service.IssueVotingDailyStatisticalTaskService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * @Description - * @ClassName IssueVotingDailyStatisticalTaskServiceImpl - * @Auth wangc - * @Date 2020-05-25 09:24 - */ -@Service -public class TagUsedDailyStatisticalTaskServiceImpl implements IssueVotingDailyStatisticalTaskService { - @Autowired - private GovIssueFeignClient govIssueFeignClient; - - @Override - public Result issueVotingDailyStatistical() { - return govIssueFeignClient.dailyStatisticalVoteJob(); - } -} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java deleted file mode 100644 index f31ae3b5b9..0000000000 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/DailyStatisticalTagUsedTask.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.epmet.task; - -import com.epmet.commons.tools.utils.Result; -import com.epmet.service.IssueVotingDailyStatisticalTaskService; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - -/** - * @Description - * @ClassName dailyStatisticalVoteTask - * @Auth wangc - * @Date 2020-05-25 09:22 - */ -@Component("dailyStatisticalVoteTask") -public class DailyStatisticalTagUsedTask implements ITask { - private Logger logger = LoggerFactory.getLogger(getClass()); - - @Autowired - private IssueVotingDailyStatisticalTaskService issueVotingDailyStatisticalTaskService; - - - @Override - public void run(String params) { - logger.debug("dailyStatisticalVoteTask定时任务正在执行,参数为:{}", params); - Result result = issueVotingDailyStatisticalTaskService.issueVotingDailyStatistical(); - if (result.success()) { - logger.debug("dailyStatisticalVoteTask定时任务正在执行定时任务执行成功"); - } else { - logger.debug("dailyStatisticalVoteTask定时任务正在执行定时任务执行失败:" + result.getMsg()); - } - } -} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityArticleSummaryDailyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityArticleSummaryDailyStatsTask.java new file mode 100644 index 0000000000..658850ba45 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityArticleSummaryDailyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:文章总数 日统计定时任务 + */ +@Component("publicityArticleSummaryDailyStatsTask") +public class PublicityArticleSummaryDailyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityArticleSummaryDailyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.articleSummaryDailyStatsjob(); + if (result.success()) { + logger.debug("publicityArticleSummaryDailyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityArticleSummaryDailyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java new file mode 100644 index 0000000000..2d850980a4 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedDailyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被使用次数 日统计定时任务 + */ +@Component("publicityTagUsedDailyStatsjob") +public class PublicityTagUsedDailyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagUsedDailyStatsjob定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagUsedDailyStatsjob(); + if (result.success()) { + logger.debug("publicityTagUsedDailyStatsjob定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagUsedDailyStatsjob定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java new file mode 100644 index 0000000000..df99756776 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagUsedMonthlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被使用次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagUsedMonthlyStatsjob") +public class PublicityTagUsedMonthlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagUsedMonthlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagUsedMonthlyStatsjob定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedDailyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedDailyStatsTask.java new file mode 100644 index 0000000000..5484440742 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedDailyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被阅读次数 【日】统计定时任务 + */ +@Component("publicityTagViewedDailyStatsTask") +public class PublicityTagViewedDailyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagViewedDailyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagViewedDailyStatsjob(); + if (result.success()) { + logger.debug("publicityTagViewedDailyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagViewedDailyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedMonthlyStatsTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedMonthlyStatsTask.java new file mode 100644 index 0000000000..d68677fde3 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/PublicityTagViewedMonthlyStatsTask.java @@ -0,0 +1,31 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsPublicityTaskService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * desc:标签被阅读次数 【月、季、年】统计定时任务 + */ +@Component("publicityTagViewedMonthlyStatsTask") +public class PublicityTagViewedMonthlyStatsTask implements ITask { + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Autowired + private StatsPublicityTaskService statsPublicityTaskService; + + + @Override + public void run(String params) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行,参数为:{}", params); + Result result = statsPublicityTaskService.tagViewedMonthlyStatsjob(); + if (result.success()) { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行成功"); + } else { + logger.debug("publicityTagViewedMonthlyStatsTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} From 1708938b207621e75d12974f69b8afcae119b83f Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Jun 2020 12:06:16 +0800 Subject: [PATCH 064/101] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/StatsPublicityController.java | 18 +++++++++--------- .../epmet/service/StatsPublicityService.java | 10 +++++----- .../impl/StatsPublicityServiceImpl.java | 10 +++++----- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index de043dc7b3..e55a29b36a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -31,7 +31,7 @@ public class StatsPublicityController { */ @PostMapping(value = "articleSummaryDailyStatsjob") public Result articleSummaryDailyStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.articlePublishedCountDayStats(statsDate)); + return new Result().ok(statsPublicityService.articleSummaryDailyStatsjob(statsDate)); } /** @@ -42,7 +42,7 @@ public class StatsPublicityController { */ @PostMapping(value = "tagUsedDailyStatsjob") public Result tagUsedDailyStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagUsedDayStatsjob(statsDate)); + return new Result().ok(statsPublicityService.tagUsedDailyStatsjob(statsDate)); } /** @@ -51,9 +51,9 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagUsedMonthStatsjob") - public Result tagUsedMonthStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagUsedMonthStatsjob(statsDate)); + @PostMapping(value = "tagUsedMonthlyStatsjob") + public Result tagUsedMonthlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedMonthlyStatsjob(statsDate)); } /** @@ -64,7 +64,7 @@ public class StatsPublicityController { */ @PostMapping(value = "tagViewedDailyStatsjob") public Result tagViewedDailyStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagViewedDayStatsjob(statsDate)); + return new Result().ok(statsPublicityService.tagViewedDailyStatsjob(statsDate)); } /** @@ -73,8 +73,8 @@ public class StatsPublicityController { * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return */ - @PostMapping(value = "tagViewedMonthStatsjob") - public Result tagViewedMonthStatsjob(Date statsDate) { - return new Result().ok(statsPublicityService.tagViewedMonthStatsjob(statsDate)); + @PostMapping(value = "tagViewedMonthlyStatsjob") + public Result tagViewedMonthlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedMonthlyStatsjob(statsDate)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 1bd0ff46be..03b253a588 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -12,7 +12,7 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean articlePublishedCountDayStats(Date statsDate); + Boolean articleSummaryDailyStatsjob(Date statsDate); /** * desc: 按日 统计每个标签被引用的使用文章数 @@ -22,7 +22,7 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean tagUsedDayStatsjob(Date statsDate); + Boolean tagUsedDailyStatsjob(Date statsDate); /** * desc: 按月 统计每个标签被引用的使用文章数 @@ -33,7 +33,7 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean tagUsedMonthStatsjob(Date statsDate); + Boolean tagUsedMonthlyStatsjob(Date statsDate); /** * desc: 按日 统计每个标签的阅读数 @@ -44,7 +44,7 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean tagViewedDayStatsjob(Date statsDate); + Boolean tagViewedDailyStatsjob(Date statsDate); /** * desc: @@ -55,5 +55,5 @@ public interface StatsPublicityService { * @author: jianjun liu * email:liujianjun@git.elinkit.com.cn */ - Boolean tagViewedMonthStatsjob(Date statsDate); + Boolean tagViewedMonthlyStatsjob(Date statsDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index 98f5b3f2a7..c1c5505885 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -117,7 +117,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { private ExecutorService executorService; @Override - public Boolean articlePublishedCountDayStats(Date statsDate) { + public Boolean articleSummaryDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 @@ -152,7 +152,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagUsedDayStatsjob(Date statsDate) { + public Boolean tagUsedDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { @@ -181,7 +181,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagUsedMonthStatsjob(Date statsDate) { + public Boolean tagUsedMonthlyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 @@ -231,7 +231,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagViewedDayStatsjob(Date statsDate) { + public Boolean tagViewedDailyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { @@ -260,7 +260,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } @Override - public Boolean tagViewedMonthStatsjob(Date statsDate) { + public Boolean tagViewedMonthlyStatsjob(Date statsDate) { //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 if (statsDate == null) { //当天的凌晨时间 即为今天之前的数据 From 99c1bb8f7b0a8ffdc1b93a2717e4d66ccb0bb7b7 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 13:01:50 +0800 Subject: [PATCH 065/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group/form/GridGroupPeopleFormDTO.java | 5 ++ .../form/GridGroupPeopleTotalFormDTO.java | 5 ++ .../dto/group/form/GridGroupTotalFormDTO.java | 5 ++ .../dto/group/form/GroupIncrFormDTO.java | 4 +- .../controller/StatsGroupController.java | 35 +++------- .../com/epmet/dao/group/GroupDataDao.java | 10 +-- .../dao/stats/FactGroupAgencyDailyDao.java | 9 ++- .../dao/stats/FactGroupAgencyMonthlyDao.java | 7 ++ .../dao/stats/FactGroupGridDailyDao.java | 7 ++ .../com/epmet/service/StatsGroupService.java | 8 ++- .../epmet/service/group/GroupDataService.java | 6 +- .../group/impl/GroupDataServiceImpl.java | 24 ++++--- .../service/impl/StatsGroupServiceImpl.java | 66 +++++++++++++------ .../stats/FactGroupAgencyDailyService.java | 2 +- .../impl/FactGroupAgencyDailyServiceImpl.java | 7 +- .../FactGroupAgencyMonthlyServiceImpl.java | 1 + .../impl/FactGroupGridDailyServiceImpl.java | 2 + .../resources/mapper/group/GroupDataDao.xml | 10 ++- .../mapper/stats/FactGroupAgencyDailyDao.xml | 22 +++++-- .../stats/FactGroupAgencyMonthlyDao.xml | 8 +++ .../mapper/stats/FactGroupGridDailyDao.xml | 9 +++ 21 files changed, 168 insertions(+), 84 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java index b3d731a8d3..a6c73d386f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleFormDTO.java @@ -27,4 +27,9 @@ public class GridGroupPeopleFormDTO implements Serializable { * 人员状态 */ private String status = "removed"; + + /** + * dateID + */ + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java index 637f10be08..b36204f1b0 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupPeopleTotalFormDTO.java @@ -27,4 +27,9 @@ public class GridGroupPeopleTotalFormDTO implements Serializable { * 人员状态 */ private String status = "removed"; + + /** + * dateID + */ + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java index 3e97445cea..f39002e5ad 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GridGroupTotalFormDTO.java @@ -22,4 +22,9 @@ public class GridGroupTotalFormDTO implements Serializable { * 小组状态 */ private String state = "approved"; + + /** + * dateID + */ + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java index 6d6e981037..79ac84ff44 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/GroupIncrFormDTO.java @@ -24,7 +24,7 @@ public class GroupIncrFormDTO implements Serializable { private String customerId; /** - * 日期(昨日) + * dateID */ - private String yesterday; + private String dateId; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java index c33979545d..b2f6f399f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsGroupController.java @@ -1,14 +1,13 @@ package com.epmet.controller; -import com.epmet.commons.tools.constant.NumConstant; import com.epmet.service.StatsGroupService; -import com.epmet.service.stats.DimCustomerService; 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.RequestParam; import org.springframework.web.bind.annotation.RestController; -import java.util.List; +import java.util.Date; /** * @Author zxc @@ -20,8 +19,6 @@ public class StatsGroupController { @Autowired private StatsGroupService statsGroupService; - @Autowired - private DimCustomerService dimCustomerService; /** * 网格数、小组数、网格下所有组内人数(不去重) @@ -35,16 +32,8 @@ public class StatsGroupController { * @author zxc */ @PostMapping("groupgriddaily") - public void groupGridDaily(){ - Integer pageNo = NumConstant.ONE; - Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - customerIds.forEach(customerId -> { - statsGroupService.groupGridDaily(customerId); - }); + public void groupGridDaily(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupGridDaily(date); } /** @@ -53,16 +42,8 @@ public class StatsGroupController { * @author zxc */ @PostMapping("groupagencydaily") - public void groupAgencyDaily(){ - Integer pageNo = NumConstant.ONE; - Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - customerIds.forEach(customerId -> { - statsGroupService.groupAgencyDaily(customerId); - }); + public void groupAgencyDaily(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupAgencyDaily(date); } /** @@ -71,8 +52,8 @@ public class StatsGroupController { * @author zxc */ @PostMapping("groupagencymonthly") - public void groupAgencyMonthly(){ - statsGroupService.groupAgencyMonthly(); + public void groupAgencyMonthly(@RequestParam(value = "date",required = false)Date date){ + statsGroupService.groupAgencyMonthly(date); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java index 5a226cad20..28703e70e9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/group/GroupDataDao.java @@ -50,29 +50,29 @@ public interface GroupDataDao { * @param * @author zxc */ - List getAgencyGroupTotalCount(@Param("allGrid") List allGrid); + List getAgencyGroupTotalCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下网格内的小组人数 【待优化】 * @param * @author zxc */ - List selectAgencyGridGroupPeopleTotal(@Param("allGrid") List allGrid); + List selectAgencyGridGroupPeopleTotal(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下每个小组的人数 【待优化】 * @param * @author zxc */ - List selectAgencyEveryGroupPeopleCount(@Param("allGrid") List allGrid); + List selectAgencyEveryGroupPeopleCount(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下的小组日增数 【待优化】 * @param - * @param yesterday + * @param dateId * @author zxc */ - List selectAgencyGroupIncr(@Param("allGrid") List allGrid,@Param("yesterday")String yesterday); + List selectAgencyGroupIncr(@Param("allGrid") List allGrid,@Param("dateId")String dateId); /** * @Description 查询机关下所有网格小组人数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java index aaf4312dd9..853d8dea9d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -48,7 +48,7 @@ public interface FactGroupAgencyDailyDao extends BaseDao getLastDayAgency(); + List getLastDayAgency(@Param("monthId") String monthId); /** * @Description 查询 月的小组增量 @@ -56,5 +56,12 @@ public interface FactGroupAgencyDailyDao extends BaseDao getMonthGroupIncr(@Param("monthId")String monthId); + + /** + * @Description 删除当天已存在数据 + * @param dateId + * @author zxc + */ + void deleteInsertAgencyDailyByDateId(@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/FactGroupAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java index 0e0ed99f21..cf43e681ca 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyMonthlyDao.java @@ -40,5 +40,12 @@ public interface FactGroupAgencyMonthlyDao extends BaseDao agencyMonth); + + /** + * @Description 删除已存在的月数据 + * @param monthId + * @author zxc + */ + void deleteInsertAgencyMonthlyByMonthId(@Param("monthId")String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java index 8c1a636d3c..6e0ddae225 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupGridDailyDao.java @@ -40,5 +40,12 @@ public interface FactGroupGridDailyDao extends BaseDao * @author zxc */ void insertGroupGridDaily(@Param("formDto") List formDto); + + /** + * @Description 删除已存在的数据【当天】防止当天数据多条 + * @param dateId + * @author zxc + */ + void deleteInsertDateId(@Param("dateId")String dateId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java index 8042fd0c83..b3444d34d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -1,5 +1,7 @@ package com.epmet.service; +import java.util.Date; + /** * @Author zxc * @CreateTime 2020/6/16 14:14 @@ -10,18 +12,18 @@ public interface StatsGroupService { * @Description 统计 “小组” 有关数据, dim:【网格-日】 * @author zxc */ - void groupGridDaily(String customerId); + void groupGridDaily(Date date); /** * @Description 统计 “小组” 有关数据, dim:【机关-日】 * @author zxc */ - void groupAgencyDaily(String customerId); + void groupAgencyDaily(Date date); /** * @Description 统计 “小组” 有关数据, dim:【机关-月】 * @author zxc */ - void groupAgencyMonthly(); + void groupAgencyMonthly(Date date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index babd6e6503..be00cca1dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -25,21 +25,21 @@ public interface GroupDataService { * @param allGrid * @author zxc */ - List getAgencyGroupTotalCount(List allGrid); + List getAgencyGroupTotalCount(List allGrid,String dateId); /** * @Description 查询机关下网格内的小组人数 * @param * @author zxc */ - List selectAgencyGridGroupPeopleTotal(List allGrid); + List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId); /** * @Description 查询机关下每个小组的人数 * @param * @author zxc */ - List selectAgencyEveryGroupPeopleCount(List allGrid); + List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId); /** * @Description 查询机关下的小组日增数 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index cb548823c7..d938799b41 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -41,6 +41,7 @@ public class GroupDataServiceImpl implements GroupDataService { if (gridsInfo.size() == NumConstant.ZERO){ return new ArrayList<>(); } + String dateId = dimTime.getDateId(); gridsInfo.forEach(grid -> { GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); BeanUtils.copyProperties(dimTime,dailyResult); @@ -52,6 +53,7 @@ public class GroupDataServiceImpl implements GroupDataService { // 1. 网格下有多少小组,只算 state = ‘approved’ GridGroupTotalFormDTO formDTO = new GridGroupTotalFormDTO(); formDTO.setCustomerId(customerId); + formDTO.setDateId(dateId); List gridGroupTotalResultDTOS = groupDataDao.selectGridGroupTotal(formDTO); if (gridGroupTotalResultDTOS.size() == NumConstant.ZERO){ result.forEach(grid -> { @@ -70,6 +72,7 @@ public class GroupDataServiceImpl implements GroupDataService { // 2. 网格下所有组内人数和(不需要去重) 人员状态 != "removed" GridGroupPeopleTotalFormDTO peopleTotalFormDTO = new GridGroupPeopleTotalFormDTO(); peopleTotalFormDTO.setCustomerId(customerId); + peopleTotalFormDTO.setDateId(dateId); List gridGroupPeopleTotalResultDTOS = groupDataDao.selectGridGroupPeopleTotal(peopleTotalFormDTO); result.forEach(grid -> { gridGroupPeopleTotalResultDTOS.forEach(groupPeopleTotal -> { @@ -85,6 +88,7 @@ public class GroupDataServiceImpl implements GroupDataService { // 4. 网格下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID GridGroupPeopleFormDTO everyGroupPeople = new GridGroupPeopleFormDTO(); everyGroupPeople.setCustomerId(customerId); + everyGroupPeople.setDateId(dateId); List everyGroupPeopleCount = groupDataDao.selectEveryGroupPeopleCount(everyGroupPeople); Map> collect = everyGroupPeopleCount.stream().collect(Collectors.groupingBy(every -> every.getGridId())); Set>> entries = collect.entrySet(); @@ -111,7 +115,7 @@ public class GroupDataServiceImpl implements GroupDataService { // 5. 网格下小组增量 GroupIncrFormDTO groupIncr = new GroupIncrFormDTO(); groupIncr.setCustomerId(customerId); - groupIncr.setYesterday(dimTime.getDateId()); + groupIncr.setDateId(dateId); List groupIncrResult = groupDataDao.selectGroupIncr(groupIncr); result.forEach(grid -> { groupIncrResult.forEach(gridIncr -> { @@ -128,11 +132,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ - public List getAgencyGroupTotalCount(List allGrid){ + public List getAgencyGroupTotalCount(List allGrid,String dateId){ if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.getAgencyGroupTotalCount(allGrid); + return groupDataDao.getAgencyGroupTotalCount(allGrid,dateId); } /** @@ -141,11 +145,11 @@ public class GroupDataServiceImpl implements GroupDataService { * @author zxc */ @Override - public List selectAgencyGridGroupPeopleTotal(List allGrid) { + public List selectAgencyGridGroupPeopleTotal(List allGrid,String dateId) { if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid); + return groupDataDao.selectAgencyGridGroupPeopleTotal(allGrid,dateId); } /** @@ -153,24 +157,24 @@ public class GroupDataServiceImpl implements GroupDataService { * @param * @author zxc */ - public List selectAgencyEveryGroupPeopleCount(List allGrid){ + public List selectAgencyEveryGroupPeopleCount(List allGrid,String dateId){ if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid); + return groupDataDao.selectAgencyEveryGroupPeopleCount(allGrid,dateId); } /** * @Description 查询机关下的小组日增数 * @param - * @param yesterday + * @param dateId * @author zxc */ - public List selectAgencyGroupIncr(List allGrid,String yesterday){ + public List selectAgencyGroupIncr(List allGrid,String dateId){ if (allGrid.size() == NumConstant.ZERO){ return new ArrayList<>(); } - return groupDataDao.selectAgencyGroupIncr(allGrid, yesterday); + return groupDataDao.selectAgencyGroupIncr(allGrid, dateId); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 82278d4340..4ba2b1492b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -42,6 +42,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { private FactGroupAgencyDailyService factGroupAgencyDailyService; @Autowired private FactGroupAgencyMonthlyService factGroupAgencyMonthlyService; + @Autowired + private DimCustomerService dimCustomerService; /** * @Description 统计【网格-日】 @@ -49,11 +51,20 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc */ @Override - public void groupGridDaily(String customerId) { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); - List gridsInfo = dimGridService.getGridListByCustomerId(customerId); - List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + public void groupGridDaily(Date date) { + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() == NumConstant.ZERO){ + return; + } + customerIds.forEach(customerId -> { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + List gridsInfo = dimGridService.getGridListByCustomerId(customerId); + List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + }); + } /** @@ -61,12 +72,20 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc */ @Override - public void groupAgencyDaily(String customerId) { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); - List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); - List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily); + public void groupAgencyDaily(Date date) { + Integer pageNo = NumConstant.ONE; + Integer pageSize = NumConstant.ONE_HUNDRED; + List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() == NumConstant.ZERO){ + return; + } + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + customerIds.forEach(customerId -> { + List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily); + }); } /** @@ -74,10 +93,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @author zxc String customerId */ @Override - public void groupAgencyMonthly() { - List lastDayAgency = factGroupAgencyDailyService.getLastDayAgency(); - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(); - List monthGroupIncr = factGroupAgencyDailyService.getMonthGroupIncr(dimIdBean.getMonthId()); + public void groupAgencyMonthly(Date date) { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + String monthId = dimIdBean.getMonthId(); + List lastDayAgency = factGroupAgencyDailyService.getLastDayAgency(monthId); + List monthGroupIncr = factGroupAgencyDailyService.getMonthGroupIncr(monthId); if (monthGroupIncr.size() == NumConstant.ZERO){ lastDayAgency.forEach(agency -> { agency.setGroupIncr(NumConstant.ZERO); @@ -99,6 +119,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { return new ArrayList<>(); } List result = new ArrayList<>(); + String dateId = timeDim.getDateId(); List agencyList = dimAgencyService.getAgencyListByCustomerId(customerId); agencyList.forEach(agency -> { AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); @@ -113,11 +134,11 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.setGridTotal(allGrid.size()); // TODO 2. 机关下有多少小组,只算 state = ‘approved’ - List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid); + List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId); Integer groupCount = agencyGroupTotalCount.stream().collect(Collectors.summingInt(AgencyGroupTotalCountResultDTO::getGridGroupCount)); agencyResult.setGroupTotalCount(groupCount); // TODO 3. 机关下所有组内人数和(不需要去重) 人员状态 != "removed" - List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid); + List agencyGridGroupPeopleTotal = groupDataService.selectAgencyGridGroupPeopleTotal(allGrid,dateId); Integer groupPeopleCount = agencyGridGroupPeopleTotal.stream().collect(Collectors.summingInt(AgencyGridGroupPeopleTotalResultDTO::getGridGroupPeopleTotal)); agencyResult.setGroupMemberTotalCount(groupPeopleCount); @@ -127,7 +148,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.getGroupMemberTotalCount()/agencyResult.getGroupTotalCount()); // TODO 5. 机关下小组人数中位数 小组最大(小)成员数、最多(少)成员小组ID - List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid); + List agencyGridGroupPeople = groupDataService.selectAgencyEveryGroupPeopleCount(allGrid,dateId); List sorted = agencyGridGroupPeople.stream().sorted(Comparator.comparing(AgencyGridGroupPeopleResultDTO::getGroupCount).reversed()).collect(Collectors.toList()); Integer groupPeopleMedian; if (sorted.size() == NumConstant.ONE){ @@ -147,7 +168,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.setMinMemberGroupId(sorted.get(sorted.size() - NumConstant.ONE).getGroupId()); } // TODO 6. 机关下小组增量 - List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, timeDim.getDateId()); + List agencyGroupIncr = groupDataService.selectAgencyGroupIncr(allGrid, dateId); Integer groupIncr = agencyGroupIncr.stream().collect(Collectors.summingInt(AgencyGroupIncrResultDTO::getGroupIncr)); agencyResult.setGroupIncr(groupIncr); result.add(agencyResult); @@ -222,12 +243,15 @@ public class StatsGroupServiceImpl implements StatsGroupService { * @param * @author zxc */ - public DimIdGenerator.DimIdBean getDimIdBean(){ + public DimIdGenerator.DimIdBean getDimIdBean(Date date){ + if (date != null){ + return DimIdGenerator.getDimIdBean(date); + } ZoneId zoneId = ZoneId.systemDefault(); LocalDate localDate = LocalDate.now().minusDays(NumConstant.ONE); ZonedDateTime zdt = localDate.atStartOfDay(zoneId); - Date date = Date.from(zdt.toInstant()); - return DimIdGenerator.getDimIdBean(date); + Date result = Date.from(zdt.toInstant()); + return DimIdGenerator.getDimIdBean(result); } public List getAgencyAllGrid(String customerId,String agencyId){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java index 30ff917431..ba2eced61e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -109,7 +109,7 @@ public interface FactGroupAgencyDailyService extends BaseService getLastDayAgency(); + List getLastDayAgency(String monthId); /** * @Description 查询 月的小组增量 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java index dc34d3b9e7..f04d3dfe83 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -103,7 +103,7 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl agencyList) { if (agencyList.size() != NumConstant.ZERO){ + baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId()); baseDao.insertGroupAgencyDaily(agencyList); } @@ -121,8 +122,8 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl getLastDayAgency(){ - return baseDao.getLastDayAgency(); + public List getLastDayAgency(String monthId){ + return baseDao.getLastDayAgency(monthId); } /** diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java index 85a216373d..a9ba8ff7ac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyMonthlyServiceImpl.java @@ -108,6 +108,7 @@ public class FactGroupAgencyMonthlyServiceImpl extends BaseServiceImpl #{dateId} GROUP BY grid_id @@ -31,6 +32,7 @@ AND rg.state = #{state} AND rg.customer_id = #{customerId} AND rgm.status != #{status} + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rg.grid_id @@ -49,6 +51,7 @@ AND rg.state = #{state} AND rg.customer_id = #{customerId} AND rgm.STATUS != #{status} + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rgm.resi_group_id @@ -63,7 +66,7 @@ WHERE state = #{state} AND customer_id = #{customerId} - AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) = #{yesterday} + AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId} GROUP BY grid_id @@ -80,6 +83,7 @@ DEL_FLAG = 0 AND state = 'approved' AND grid_id = #{grid} + AND DATE_FORMAT(created_time,'%Y%m%d') #{dateId} GROUP BY grid_id @@ -99,6 +103,7 @@ AND rg.state = 'approved' AND rg.grid_id = #{grid} AND rgm.status != 'removed' + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rg.grid_id @@ -118,6 +123,7 @@ AND rg.state = 'approved' AND rg.grid_id = #{grid} AND rgm.STATUS != 'removed' + AND DATE_FORMAT(rgm.created_time,'%Y%m%d') #{dateId} GROUP BY rgm.resi_group_id @@ -134,7 +140,7 @@ WHERE state = 'approved' AND grid_id = #{grid} - AND DATE_FORMAT( CREATED_TIME, '%Y-%m-%d' ) = #{yesterday} + AND DATE_FORMAT( CREATED_TIME, '%Y%m%d' ) = #{dateId} GROUP BY grid_id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml index 283cd62e9b..90bcc53b5d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -67,7 +67,7 @@ - SELECT ID AS id, AGENCY_ID AS agencyId, @@ -87,11 +87,13 @@ MIN_MEMBER_GROUP_ID AS minMemberGroupId FROM fact_group_agency_daily - WHERE del_flag = '0' - GROUP BY - AGENCY_ID - ORDER BY - DATE_ID DESC + WHERE + del_flag = '0' + AND DATE_FORMAT(date_id,'%Y%m') = #{monthId} + GROUP BY + AGENCY_ID + ORDER BY + DATE_ID DESC @@ -108,5 +110,13 @@ agency_id + + + DELETE + FROM + fact_group_agency_daily + WHERE + date_id = #{dateId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml index 73f80a1ce0..35242c9a0e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml @@ -63,5 +63,13 @@ + + + DELETE + FROM + fact_group_agency_monthly + WHERE + month_id = #{monthId} + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 03b90c7c14..0692607ad3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -65,4 +65,13 @@ + + + DELETE + FROM + fact_group_grid_daily + WHERE + date_id = #{dateId} + + \ No newline at end of file From b13dd3e85834b26ca1172f441a69472595deffc9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Jun 2020 14:22:28 +0800 Subject: [PATCH 066/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/user/form/UserIncrTrendFormDTO.java | 27 +++++ .../epmet/user/form/UserSubAgencyFormDTO.java | 22 ++++ .../epmet/user/form/UserSubGridFormDTO.java | 22 ++++ .../user/form/UserSummaryInfoFormDTO.java | 23 ++++ .../user/result/UserIncrTrendResultDTO.java | 30 +++++ .../user/result/UserSubAgencyResultDTO.java | 34 ++++++ .../user/result/UserSubGridResultDTO.java | 35 ++++++ .../user/result/UserSummaryInfoResultDTO.java | 54 +++++++++ .../user/controller/UserController.java | 88 ++++++++++++++ .../module/user/service/UserService.java | 54 +++++++++ .../user/service/impl/UserServiceImpl.java | 110 ++++++++++++++++++ .../dto/result/LoginUserDetailsResultDTO.java | 2 +- 12 files changed, 500 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java new file mode 100644 index 0000000000..3267d88ac7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java @@ -0,0 +1,27 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 按日、按月查询注册用户数(参与用户数)增量折线图 入参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:57 + */ +@Data +public class UserIncrTrendFormDTO implements Serializable { + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPartiFlag不能为空") + private String regOrPartiFlag; + + /** + * day:日维度 | month:月维度 | (周、季、年)… + */ + @NotBlank(message = "type不能为空") + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java new file mode 100644 index 0000000000..1116bc33b0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 各机关注册用户数入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:47 + */ +@Data +public class UserSubAgencyFormDTO implements Serializable { + private static final long serialVersionUID = -4558978951554887536L; + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPartiFlag不能为空") + private String regOrPartiFlag; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java new file mode 100644 index 0000000000..6a19060ae5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java @@ -0,0 +1,22 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 直属网格注册用户数 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:52 + */ +@Data +public class UserSubGridFormDTO implements Serializable { + private static final long serialVersionUID = -1815903503939673149L; + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPartiFlag不能为空") + private String regOrPartiFlag; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java new file mode 100644 index 0000000000..3a25b4ac24 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java @@ -0,0 +1,23 @@ +package com.epmet.user.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * 用户汇总信息 入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:31 + */ +@Data +public class UserSummaryInfoFormDTO implements Serializable { + private static final long serialVersionUID = -1802471335671321322L; + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + @NotBlank(message = "regOrPartiFlag不能为空") + private String regOrPartiFlag; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java new file mode 100644 index 0000000000..38436e3533 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.user.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 按日、按月查询注册用户数(参与用户数)增量折线图 返参 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:17 + */ +@Data +public class UserIncrTrendResultDTO implements Serializable { + /** + * 日期如果按日查询返回yyyy-MM-dd,如果按月返回yyyy-MM + */ + private String date; + + /** + * 居民、党员、热心居民返回中文描述 + */ + private String type; + + /** + * 增量值 + */ + private Integer value; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java new file mode 100644 index 0000000000..f1552b799c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.user.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 各机关注册用户数入参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:49 + */ +@Data +public class UserSubAgencyResultDTO implements Serializable { + private static final long serialVersionUID = 3038896791082755087L; + /** + * 辽阳路街道 + */ + private String name; + + /** + * 数值 + */ + private Integer value; + + /** + * 类型:居民、党员、热心居民 + */ + private String type; + + @JsonIgnore + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java new file mode 100644 index 0000000000..bf0df3cd4e --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java @@ -0,0 +1,35 @@ +package com.epmet.user.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 直属网格注册用户数 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:54 + */ +@Data +public class UserSubGridResultDTO implements Serializable { + private static final long serialVersionUID = -7432747804212305863L; + + /** + * 网格名称:eg:第一网格 + */ + private String name; + + /** + * 数值 + */ + private Integer value; + + /** + * 类型:居民、党员、热心居民 + */ + private String type; + + @JsonIgnore + private String gridId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java new file mode 100644 index 0000000000..f745321971 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.user.result; + +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户汇总信息 返参DTO + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 12:34 + */ +@Data +public class UserSummaryInfoResultDTO implements Serializable { + private static final long serialVersionUID = -4270726421611289755L; + /** + * 数据更新至yyyy.MM.dd + */ + private String currentDate; + + /** + * 注册居民数 + */ + private Integer regTotal; + + /** + * 参与用户数 + */ + private Integer partiTotal; + + /** + * 党员数 + */ + private Integer partymemberTotal; + + /** + * 党员占比 + */ + private String partymemberProportion; + + /** + * 热心居民数 + */ + private String warmHeartedTotal; + + /** + * 热心居民占比 + */ + private String warmHeartedProportion; + + @JsonIgnore + private String id; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java new file mode 100644 index 0000000000..795d3cd8b9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java @@ -0,0 +1,88 @@ +package com.epmet.module.user.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.module.user.service.UserService; +import com.epmet.user.form.UserIncrTrendFormDTO; +import com.epmet.user.form.UserSubAgencyFormDTO; +import com.epmet.user.form.UserSubGridFormDTO; +import com.epmet.user.form.UserSummaryInfoFormDTO; +import com.epmet.user.result.UserIncrTrendResultDTO; +import com.epmet.user.result.UserSubAgencyResultDTO; +import com.epmet.user.result.UserSubGridResultDTO; +import com.epmet.user.result.UserSummaryInfoResultDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +/** + * 组织能力用户相关接口入口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:22 + */ +@RestController +@RequestMapping("user") +public class UserController { + @Autowired + private UserService userService; + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 用户汇总信息查询 + * @Date 2020/6/22 13:27 + **/ + @PostMapping("summaryinfo") + public Result summaryInfo(@RequestBody UserSummaryInfoFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserSummaryInfoResultDTO userSummaryInfoResultDTO = userService.summaryInfo(formDTO); + return new Result().ok(userSummaryInfoResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:30 + **/ + @PostMapping("subagency") + public Result subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserSubAgencyResultDTO userSubAgencyResultDTO = userService.subAgency(formDTO); + return new Result().ok(userSubAgencyResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:33 + **/ + @PostMapping("subgrid") + public Result subGrid(@RequestBody UserSubGridFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserSubGridResultDTO userSubGridResultDTO = userService.subGrid(formDTO); + return new Result().ok(userSubGridResultDTO); + } + + /** + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:36 + **/ + @PostMapping("incrtrend") + public Result incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO); + UserIncrTrendResultDTO userIncrTrendResultDTO = userService.incrTrend(formDTO); + return new Result().ok(userIncrTrendResultDTO); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java new file mode 100644 index 0000000000..4d0f812b72 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java @@ -0,0 +1,54 @@ +package com.epmet.module.user.service; + +import com.epmet.user.form.UserIncrTrendFormDTO; +import com.epmet.user.form.UserSubAgencyFormDTO; +import com.epmet.user.form.UserSubGridFormDTO; +import com.epmet.user.form.UserSummaryInfoFormDTO; +import com.epmet.user.result.UserIncrTrendResultDTO; +import com.epmet.user.result.UserSubAgencyResultDTO; +import com.epmet.user.result.UserSubGridResultDTO; +import com.epmet.user.result.UserSummaryInfoResultDTO; + +/** + * 组织能力用户相关接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:23 + */ +public interface UserService { + /** + * @param formDTO + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 用户汇总信息查询 + * @Date 2020/6/22 13:41 + **/ + UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubAgencyResultDTO + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:42 + **/ + UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubGridResultDTO + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:42 + **/ + UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO); + + /** + * @param formDTO + * @return com.epmet.user.result.UserIncrTrendResultDTO + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:42 + **/ + UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java new file mode 100644 index 0000000000..c155265090 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java @@ -0,0 +1,110 @@ +package com.epmet.module.user.service.impl; + +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.Result; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.user.service.UserService; +import com.epmet.user.form.UserIncrTrendFormDTO; +import com.epmet.user.form.UserSubAgencyFormDTO; +import com.epmet.user.form.UserSubGridFormDTO; +import com.epmet.user.form.UserSummaryInfoFormDTO; +import com.epmet.user.result.UserIncrTrendResultDTO; +import com.epmet.user.result.UserSubAgencyResultDTO; +import com.epmet.user.result.UserSubGridResultDTO; +import com.epmet.user.result.UserSummaryInfoResultDTO; +import org.apache.commons.lang.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 组织能力用户相关接口 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 13:23 + */ +@Service +public class UserServiceImpl implements UserService { + private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + @Autowired + private LoginUserUtil loginUserUtil; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @return java.lang.String + * @param + * @author yinzuomei + * @description 查询当前用户直属机关单位id + * @Date 2020/6/22 14:19 + **/ + public String getMyAgency(){ + LoginUserDetailsFormDTO loginUserDetailsFormDTO=new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp(loginUserUtil.getLoginUserApp()); + loginUserDetailsFormDTO.setClient(loginUserUtil.getLoginUserClient()); + loginUserDetailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); + Result result=epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); + if(!result.success()){ + throw new RenException("查询用户所属组织信息失败"); + } + if(result.success()){ + if (null == result.getData() || StringUtils.isBlank(result.getData().getAgencyId())) { + throw new RenException("查询用户所属组织信息失败"); + } + } + return result.getData().getAgencyId(); + } + /** + * @param formDTO + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 用户汇总信息查询 + * @Date 2020/6/22 13:41 + **/ + @Override + public UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO) { + String myAgencyId=this.getMyAgency(); + //TODO + return null; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubAgencyResultDTO + * @author yinzuomei + * @description 直属机关柱状图查询 + * @Date 2020/6/22 13:42 + **/ + @Override + public UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO) { + return null; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserSubGridResultDTO + * @author yinzuomei + * @description 直属网格柱状图查询 + * @Date 2020/6/22 13:42 + **/ + @Override + public UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO) { + return null; + } + + /** + * @param formDTO + * @return com.epmet.user.result.UserIncrTrendResultDTO + * @author yinzuomei + * @description 按日、按月查询注册用户数(参与用户数)增量折线图 + * @Date 2020/6/22 13:42 + **/ + @Override + public UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO) { + return null; + } +} diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java index d3f26332e6..30acef4ea8 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/LoginUserDetailsResultDTO.java @@ -33,7 +33,7 @@ public class LoginUserDetailsResultDTO { private Set deptIdList; /** - * 当前登录的组织id + * 当前登录用户所属的机关id */ private String agencyId; From 113820e0eb073f37aa40eac7a59d9e9c1118b09f Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 15:00:26 +0800 Subject: [PATCH 067/101] =?UTF-8?q?job=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 --- epmet-gateway/pom.xml | 4 +++ .../src/main/resources/bootstrap.yml | 9 +++++ .../java/feign/StatsPublicityFeignClient.java | 23 +++++++++++++ .../StatsPublicityFeignClientFallBack.java | 15 +++++++++ .../com/epmet/service/StatsGroupService.java | 32 ++++++++++++++++++ .../service/impl/StatsGroupServiceImpl.java | 30 +++++++++++++++++ .../epmet/task/StatsGroupAgencyDailyTask.java | 32 ++++++++++++++++++ .../task/StatsGroupAgencyMonthlyTask.java | 32 ++++++++++++++++++ .../epmet/task/StatsGroupGridDailyTask.java | 33 +++++++++++++++++++ 9 files changed, 210 insertions(+) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsGroupService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index a7c4228a85..5d56b23a15 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -175,6 +175,8 @@ lb://resi-voice-server + lb://data-report-server + @@ -251,6 +253,8 @@ lb://gov-voice-server lb://resi-voice-server + + lb://data-report-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index 7ece7e0123..f8a8c8f75b 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -259,6 +259,15 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #政府端-数据首页 + - id: data-report-server + uri: @gateway.routes.data-report-server.uri@ + order: 28 + predicates: + - Path=${server.servlet.context-path}/data/report/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java index 13456bed4a..f8a20e31cb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java @@ -60,5 +60,28 @@ public interface StatsPublicityFeignClient { @PostMapping(value = "data/stats/statspublicity/tagViewedMonthStatsjob") Result tagViewedMonthStatsjob(); + /** + * @Description 统计 “网格小组”, dim:【网格-日】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupgriddaily") + Result groupGridDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-日】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencydaily") + Result groupAgencyDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-月】 + * @param + * @author zxc + */ + @PostMapping("/data/stats/statsgroup/groupagencymonthly") + Result groupAgencyMonthly(); } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java index 4ca3c6e628..ec17c4a3e4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java @@ -72,4 +72,19 @@ public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignCli public Result tagViewedMonthStatsjob() { return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagViewedMonthStatsjob"); } + + @Override + public Result groupGridDaily() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupGridDaily"); + } + + @Override + public Result groupAgencyDaily() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyDaily"); + } + + @Override + public Result groupAgencyMonthly() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly"); + } } diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsGroupService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsGroupService.java new file mode 100644 index 0000000000..db3ed102d1 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsGroupService.java @@ -0,0 +1,32 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:12 + */ +public interface StatsGroupService { + + /** + * @Description 统计 “网格小组”, dim:【网格-日】 + * @param + * @author zxc + */ + Result groupGridDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-日】 + * @param + * @author zxc + */ + Result groupAgencyDaily(); + + /** + * @Description 统计 “网格小组”, dim:【机关-月】 + * @param + * @author zxc + */ + Result groupAgencyMonthly(); + +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java new file mode 100644 index 0000000000..1a5e3eb03e --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -0,0 +1,30 @@ +package com.epmet.service.impl; + +import com.epmet.service.StatsGroupService; +import feign.StatsPublicityFeignClient; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:13 + */ +public class StatsGroupServiceImpl implements StatsGroupService { + + @Autowired + private StatsPublicityFeignClient statsPublicityFeignClient; + + @Override + public void groupGridDaily() { + statsPublicityFeignClient.groupGridDaily(); + } + + @Override + public void groupAgencyDaily() { + statsPublicityFeignClient.groupAgencyDaily(); + } + + @Override + public void groupAgencyMonthly() { + statsPublicityFeignClient.groupAgencyMonthly(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java new file mode 100644 index 0000000000..fb754ac396 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsGroupService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【机关-日】 + */ +public class StatsGroupAgencyDailyTask implements ITask { + + @Autowired + private StatsGroupService statsGroupService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + logger.debug("StatsGroupAgencyDailyTask定时任务正在执行,参数为:{}", params); + Result result = statsGroupService.groupGridDaily(); + if (result.success()){ + logger.debug("StatsGroupAgencyDailyTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsGroupAgencyDailyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java new file mode 100644 index 0000000000..dd4fcc2d2f --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsGroupService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【机关-日】 + */ +public class StatsGroupAgencyMonthlyTask implements ITask { + + @Autowired + private StatsGroupService statsGroupService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + logger.debug("StatsGroupAgencyMonthlyTask定时任务正在执行,参数为:{}", params); + Result result = statsGroupService.groupAgencyMonthly(); + if (result.success()){ + logger.debug("StatsGroupAgencyMonthlyTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsGroupAgencyMonthlyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java new file mode 100644 index 0000000000..2b1271eb81 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java @@ -0,0 +1,33 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsGroupService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【网格-日】 + * + */ +public class StatsGroupGridDailyTask implements ITask { + + @Autowired + private StatsGroupService statsGroupService; + + private Logger logger = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + logger.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params); + Result result = statsGroupService.groupAgencyDaily(); + if (result.success()){ + logger.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功"); + }else { + logger.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} From 03b20e20b135b49284df88aecf67b062a600324a Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 22 Jun 2020 15:16:43 +0800 Subject: [PATCH 068/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 15 ++ .../controller/StatsIssueController.java | 33 +++++ .../com/epmet/service/StatsIssueService.java | 9 ++ .../service/impl/StatsIssueServiceImpl.java | 140 +++++++++++++----- 4 files changed, 158 insertions(+), 39 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java 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 9864888cf5..6e2e440f38 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 @@ -14,6 +14,7 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; +import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -347,4 +348,18 @@ public class DateUtils { System.out.println(666); } + + /** + * 获取日期前一天 + * @author zhaoqifeng + * @date 2020/6/22 11:08 + * @param date + * @return java.util.Date + */ + public static Date getBeforeDay(Date date) { + Calendar calendar = Calendar.getInstance(); + calendar.setTime(date); + calendar.add(Calendar.DATE, -1); + return calendar.getTime(); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java new file mode 100644 index 0000000000..850c3b7a75 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsIssueController.java @@ -0,0 +1,33 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +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; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:26 + */ +@RequestMapping("statsissue") +@RestController +public class StatsIssueController { + @Autowired + private StatsIssueService statsIssueService; + + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/22 14:28 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("issuestats") + public Result agencyGridIssueStats() { + statsIssueService.agencyGridIssueStats(); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java index 9f6884b829..5d0e6b4292 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -8,6 +8,15 @@ import java.util.Date; * @date 2020/6/17 16:51 */ public interface StatsIssueService { + /** + * 机关和网格议题统计 + * @author zhaoqifeng + * @date 2020/6/22 10:58 + * @param + * @return void + */ + void agencyGridIssueStats(); + /** * 机关下议题日统计 * @author zhaoqifeng diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index c300b22e46..6da113060e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -19,7 +19,9 @@ import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; import java.math.BigDecimal; import java.math.RoundingMode; @@ -33,6 +35,8 @@ import java.util.stream.Collectors; */ @Service public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private DimCustomerService dimCustomerService; @Autowired private IssueService issueService; @Autowired @@ -46,8 +50,47 @@ public class StatsIssueServiceImpl implements StatsIssueService { @Autowired private FactIssueAgencyMonthlyService factIssueAgencyMonthlyService; @Autowired + private FactIssueGridDailyService factIssueGridDailyService; + @Autowired private FactIssueGridMonthlyService factIssueGridMonthlyService; + @Override + public void agencyGridIssueStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + customerStats(customerId); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + /** + * 一个客户一个线程, 分别统计机关日/月数据和网格日/月数据 + * @author zhaoqifeng + * @date 2020/6/22 11:03 + * @param customerId + * @return void + */ + @Async + public void customerStats(String customerId) { + //获取当前日期前一天 + Date date = DateUtils.getBeforeDay(new Date()); + //机关议题日统计 + saveIssueAgencyDaily(customerId, date); + //机关议题月统计 + saveIssueAgencyMonthly(customerId, date); + //网格议题日统计 + saveIssueGridDaily(customerId, date); + //网格议题月统计 + saveIssueGridMonthly(customerId, date); + } + @Override public void saveIssueAgencyDaily(String customerId, Date date) { String dateString = DateUtils.format(date); @@ -216,9 +259,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); List resolveList = totalMap.get(IssueConstant.RESLOVED); List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); - resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); - unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, - Collectors.counting())); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } List incList = issueProjectList.stream().flatMap(ip -> closedProjectIncList.stream().filter(closed -> ip.getIssueId().equals(closed.getIssueId())).map(project -> { IssueProjectDTO dto = new IssueProjectDTO(); @@ -232,9 +279,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { incList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); List resolveIncList = incMap.get(IssueConstant.RESLOVED); List unResolveIncList = incMap.get(IssueConstant.UNRESLOVED); - resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); - unResolveIncMap = unResolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, - Collectors.counting())); + if (null != resolveIncList) { + resolveIncMap = resolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveIncList) { + unResolveIncMap = unResolveIncList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } } List list = new ArrayList<>(); @@ -242,7 +293,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { for (DimGridEntity grid : gridList) { FactIssueGridDailyEntity entity = initIssueGridDaily(dimId); entity.setCustomerId(grid.getCustomerId()); - entity.setAgencyId(grid.getId()); + entity.setAgencyId(grid.getAgencyId()); + entity.setGridId(grid.getId()); //总量统计 saveGridTotal(gridTotalList, grid, entity); //增量统计 @@ -259,8 +311,9 @@ public class StatsIssueServiceImpl implements StatsIssueService { } //已关闭项目已解决未解决统计 saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity); + list.add(entity); } - + factIssueGridDailyService.insertBatch(list); } @Override @@ -298,9 +351,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { totalList.stream().collect(Collectors.groupingBy(IssueProjectDTO::getStatus)); List resolveList = totalMap.get(IssueConstant.RESLOVED); List unResolveList = totalMap.get(IssueConstant.UNRESLOVED); - resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); - unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, - Collectors.counting())); + if (null != resolveList) { + resolveMap = resolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, Collectors.counting())); + } + if (null != unResolveList) { + unResolveMap = unResolveList.stream().collect(Collectors.groupingBy(IssueProjectDTO:: getGridId, + Collectors.counting())); + } } List list = new ArrayList<>(); @@ -325,12 +382,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { monthly.setClosedCaseTotal(total); monthly.setClosedCaseResolvedTotal(resolve); monthly.setClosedCaseUnresolvedTotal(unResolve); - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - BigDecimal resolved = new BigDecimal(resolve); - BigDecimal unresolved = new BigDecimal(unResolve); - BigDecimal closed = new BigDecimal(total); - monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + if(total > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } //各指标增量统计 for (int i = 0; i < gridMonthlyIncListList.size(); i++) { @@ -350,7 +409,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { } monthly.setCustomerId(grid.getCustomerId()); - monthly.setAgencyId(grid.getId()); + monthly.setAgencyId(grid.getAgencyId()); monthly.setGridId(grid.getId()); list.add(monthly); } @@ -383,13 +442,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseIncr(inc); entity.setClosedCaseResolvedIncr(resolveInc); entity.setClosedCaseUnresolvedIncr(unResolveInc); - - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - BigDecimal resolved = new BigDecimal(resolve); - BigDecimal unresolved = new BigDecimal(unResolve); - BigDecimal closed = new BigDecimal(total); - entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + if(total != NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolve); + BigDecimal unresolved = new BigDecimal(unResolve); + BigDecimal closed = new BigDecimal(total); + entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } } /** @@ -452,13 +512,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { } entity.setClosedResolvedTotal(resolvedCount); entity.setClosedUnresolvedTotal(unresolvedCount); - - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - BigDecimal resolved = new BigDecimal(resolvedCount); - BigDecimal unresolved = new BigDecimal(unresolvedCount); - BigDecimal closed = new BigDecimal(entity.getClosedTotal()); - entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + if(entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } } /** @@ -744,13 +805,14 @@ public class StatsIssueServiceImpl implements StatsIssueService { } entity.setClosedResolvedTotal(resolvedCount); entity.setClosedUnresolvedTotal(unresolvedCount); - - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - BigDecimal resolved = new BigDecimal(resolvedCount); - BigDecimal unresolved = new BigDecimal(unresolvedCount); - BigDecimal closed = new BigDecimal(entity.getClosedTotal()); - entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + if (entity.getClosedTotal() > NumConstant.ZERO) { + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + BigDecimal resolved = new BigDecimal(resolvedCount); + BigDecimal unresolved = new BigDecimal(unresolvedCount); + BigDecimal closed = new BigDecimal(entity.getClosedTotal()); + entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + } } /** From b80ebe5311da2e2364269f4fe86c0eb52b5d7899 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 15:38:29 +0800 Subject: [PATCH 069/101] =?UTF-8?q?job=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 --- .../epmet/service/impl/StatsGroupServiceImpl.java | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 1a5e3eb03e..2cca60f2ea 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.impl; +import com.epmet.commons.tools.utils.Result; import com.epmet.service.StatsGroupService; import feign.StatsPublicityFeignClient; import org.springframework.beans.factory.annotation.Autowired; @@ -14,17 +15,17 @@ public class StatsGroupServiceImpl implements StatsGroupService { private StatsPublicityFeignClient statsPublicityFeignClient; @Override - public void groupGridDaily() { - statsPublicityFeignClient.groupGridDaily(); + public Result groupGridDaily() { + return statsPublicityFeignClient.groupGridDaily(); } @Override - public void groupAgencyDaily() { - statsPublicityFeignClient.groupAgencyDaily(); + public Result groupAgencyDaily() { + return statsPublicityFeignClient.groupAgencyDaily(); } @Override - public void groupAgencyMonthly() { - statsPublicityFeignClient.groupAgencyMonthly(); + public Result groupAgencyMonthly() { + return statsPublicityFeignClient.groupAgencyMonthly(); } } From c31210c538a52ffc08514c2fcc222830f4e6acdc Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 15:45:19 +0800 Subject: [PATCH 070/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/dto/group/form/AgencyMonthlyFormDTO.java | 5 +++++ .../dto/group/result/AgencyGroupDailyResultDTO.java | 5 +++++ .../dto/group/result/GroupGridDailyResultDTO.java | 5 +++++ .../com/epmet/dao/stats/FactGroupAgencyDailyDao.java | 2 +- .../com/epmet/dao/stats/FactGroupGridDailyDao.java | 2 +- .../service/group/impl/GroupDataServiceImpl.java | 1 + .../com/epmet/service/impl/StatsGroupServiceImpl.java | 11 ++++++----- .../service/stats/FactGroupAgencyDailyService.java | 3 +-- .../service/stats/FactGroupGridDailyService.java | 2 +- .../stats/impl/FactGroupAgencyDailyServiceImpl.java | 4 ++-- .../stats/impl/FactGroupGridDailyServiceImpl.java | 4 ++-- .../mapper/stats/FactGroupAgencyDailyDao.xml | 7 +++++-- .../mapper/stats/FactGroupAgencyMonthlyDao.xml | 3 ++- .../resources/mapper/stats/FactGroupGridDailyDao.xml | 6 ++++-- 14 files changed, 41 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java index 32c14a94a9..ec00bcc11f 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/form/AgencyMonthlyFormDTO.java @@ -19,6 +19,11 @@ public class AgencyMonthlyFormDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机关ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java index 3858767dda..139917240b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/AgencyGroupDailyResultDTO.java @@ -18,6 +18,11 @@ public class AgencyGroupDailyResultDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机构ID */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java index b33c9c38ad..b95bedeb9b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GroupGridDailyResultDTO.java @@ -18,6 +18,11 @@ public class GroupGridDailyResultDTO implements Serializable { */ private String id; + /** + * 客户ID + */ + private String customerId; + /** * 机构ID 关联机关dim表 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java index 853d8dea9d..4a41fe25a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactGroupAgencyDailyDao.java @@ -62,6 +62,6 @@ public interface FactGroupAgencyDailyDao extends BaseDao * @param dateId * @author zxc */ - void deleteInsertDateId(@Param("dateId")String dateId); + void deleteInsertDateId(@Param("dateId")String dateId,@Param("customerId")String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index d938799b41..0aa22e72ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -47,6 +47,7 @@ public class GroupDataServiceImpl implements GroupDataService { BeanUtils.copyProperties(dimTime,dailyResult); dailyResult.setAgencyId(grid.getAgencyId()); dailyResult.setGridId(grid.getId()); + dailyResult.setCustomerId(customerId); result.add(dailyResult); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 4ba2b1492b..7c2d74e34e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -62,7 +62,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); List gridsInfo = dimGridService.getGridListByCustomerId(customerId); List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); }); } @@ -84,7 +84,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); }); } @@ -125,6 +125,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { AgencyGroupDailyResultDTO agencyResult = new AgencyGroupDailyResultDTO(); String agencyId = agency.getId(); agencyResult.setAgencyId(agencyId); + agencyResult.setCustomerId(customerId); BeanUtils.copyProperties(timeDim,agencyResult); //机关下的所有网格(包括直属网格) List allGrid = this.getAllGrid(agencyId); @@ -157,9 +158,9 @@ public class StatsGroupServiceImpl implements StatsGroupService { agencyResult.setGroupMemberMinCount(sorted.get(NumConstant.ZERO).getGroupCount()); agencyResult.setMinMemberGroupId(sorted.get(NumConstant.ZERO).getGroupId()); }else if (sorted.size() >= NumConstant.TWO){ - groupPeopleMedian = sorted.size() % 2 == 0 ? - (sorted.get(sorted.size() / 2 - 1).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : - sorted.get(sorted.size() / 2).getGroupCount(); + groupPeopleMedian = sorted.size() % NumConstant.TWO == NumConstant.ZERO ? + (sorted.get(sorted.size() / NumConstant.TWO - NumConstant.ONE).getGroupCount() + sorted.get(sorted.size() / 2).getGroupCount()) / 2 : + sorted.get(sorted.size() / NumConstant.TWO).getGroupCount(); agencyResult.setGroupMedian(groupPeopleMedian); agencyResult.setGroupMemberMaxCount(sorted.get(NumConstant.ZERO).getGroupCount()); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java index ba2eced61e..913525715a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupAgencyDailyService.java @@ -24,7 +24,6 @@ import com.epmet.dto.group.result.AgencyGroupDailyResultDTO; import com.epmet.dto.group.result.AgencyGroupMonthlyResultDTO; import com.epmet.dto.stats.FactGroupAgencyDailyDTO; import com.epmet.entity.stats.FactGroupAgencyDailyEntity; -import org.apache.ibatis.annotations.Param; import java.util.List; import java.util.Map; @@ -102,7 +101,7 @@ public interface FactGroupAgencyDailyService extends BaseService agencyList); + void insertGroupAgencyDaily(List agencyList,String customerId); /** * @Description 获取 网格小组【机关-日统计】的最后一天数据 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java index b8e1ad06ab..bcf2157ecd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactGroupGridDailyService.java @@ -99,5 +99,5 @@ public interface FactGroupGridDailyService extends BaseService formDto); + void statisticsGroupGridDaily(List formDto,String customerId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java index f04d3dfe83..6dd5a0705b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupAgencyDailyServiceImpl.java @@ -109,9 +109,9 @@ public class FactGroupAgencyDailyServiceImpl extends BaseServiceImpl agencyList) { + public void insertGroupAgencyDaily(List agencyList,String customerId) { if (agencyList.size() != NumConstant.ZERO){ - baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId()); + baseDao.deleteInsertAgencyDailyByDateId(agencyList.get(NumConstant.ZERO).getDateId(),customerId); baseDao.insertGroupAgencyDaily(agencyList); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java index 6e7fdaa64c..6556ba92b6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactGroupGridDailyServiceImpl.java @@ -111,12 +111,12 @@ public class FactGroupGridDailyServiceImpl extends BaseServiceImpl formDto) { + public void statisticsGroupGridDaily(List formDto,String customerId) { if (formDto.size() == NumConstant.ZERO){ return; } String dateId = formDto.get(NumConstant.ZERO).getDateId(); - baseDao.deleteInsertDateId(dateId); + baseDao.deleteInsertDateId(dateId,customerId); baseDao.insertGroupGridDaily(formDto); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml index 90bcc53b5d..d2ef1b2a30 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyDailyDao.xml @@ -32,13 +32,14 @@ INSERT INTO fact_group_agency_daily ( - ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, + ID, CUSTOMER_ID, AGENCY_ID, PID, DATE_ID, WEEK_ID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL_COUNT, GROUP_MEMBER_TOTAL_COUNT, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) values ( REPLACE(UUID(),'-',''), + #{agency.customerId}, #{agency.agencyId}, #{agency.pid}, #{agency.dateId}, @@ -70,6 +71,7 @@ - + DELETE FROM fact_group_agency_daily WHERE date_id = #{dateId} + AND customer_id = #{customerId} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml index 35242c9a0e..cb0187485f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupAgencyMonthlyDao.xml @@ -30,7 +30,7 @@ INSERT INTO fact_group_agency_monthly - (ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, + (ID, CUSTOMER_ID, AGENCY_ID, PID, MONTH_ID, QUARTER_ID, YEAR_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) @@ -38,6 +38,7 @@ ( REPLACE(UUID(),'-',''), + #{agency.customerId}, #{agency.agencyId}, #{agency.pid}, #{agency.monthId}, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml index 0692607ad3..8c8ab22e50 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGroupGridDailyDao.xml @@ -31,13 +31,14 @@ - INSERT INTO fact_group_grid_daily (ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, + INSERT INTO fact_group_grid_daily (ID, CUSTOMER_ID, AGENCY_ID, GRID_ID, DATE_ID, WEEK_ID, MONTH_ID, YEAR_ID, QUARTER_ID, GRID_TOTAL, GROUP_TOTAL, GROUP_MEMBER_TOTAL, GROUP_MEMBER_AVG_COUNT, GROUP_MEDIAN, GROUP_INCR, GROUP_MEMBER_MAX_COUNT, MAX_MEMBER_GROUP_ID, GROUP_MEMBER_MIN_COUNT, MIN_MEMBER_GROUP_ID, DEL_FLAG, REVISION, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME) VALUES ( REPLACE(UUID(),'-',''), + #{grid.customerId}, #{grid.agencyId}, #{grid.gridId}, #{grid.dateId}, @@ -66,12 +67,13 @@ - + DELETE FROM fact_group_grid_daily WHERE date_id = #{dateId} + AND customer_id = #{customerId} \ No newline at end of file From 0eaca07f8f608aa582012b76a62e82a40c28a781 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 22 Jun 2020 16:17:01 +0800 Subject: [PATCH 071/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E9=A1=B9=E7=9B=AE-N?= =?UTF-8?q?EI=E6=8E=A5=E5=8F=A3=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/project/.gitignore | 0 .../project/constant/ProjectConstant.java | 17 ++ .../dto/FactAgencyProjectDailyDTO.java | 182 ++++++++++++++ .../dto/form/ProjectIncrTrendFormDTO.java | 25 ++ .../dto/result/ProjectIncrTrendResultDTO.java | 31 +++ .../dto/result/ProjectSubAgencyResultDTO.java | 36 +++ .../dto/result/ProjectSubGridResultDTO.java | 36 +++ .../result/ProjectSummaryInfoResultDTO.java | 31 +++ .../dto/result/ProjectSummaryResultDTO.java | 50 ++++ .../module/project/controller/.gitignore | 0 .../project/controller/ProjectController.java | 76 ++++++ .../com/epmet/module/project/dao/.gitignore | 0 .../epmet/module/project/dao/ProjectDao.java | 58 +++++ .../epmet/module/project/service/.gitignore | 0 .../project/service/ProjectService.java | 44 ++++ .../service/impl/ProjectServiceImpl.java | 150 ++++++++++++ .../resources/mapper/project/ProjectDao.xml | 228 ++++++++++++++++++ 17 files changed, 964 insertions(+) delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java new file mode 100644 index 0000000000..7a50f4afb0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -0,0 +1,17 @@ +package com.epmet.project.constant; + +/** + * @Author sun + * @Description 数据-项目 + **/ +public interface ProjectConstant { + + String DATE = "date"; + String MONTH = "month"; + + /** + * 根据Token获取组织信息失败 + */ + String GET_AGENCYID = "根据Token获取组织信息失败"; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java new file mode 100644 index 0000000000..ab608a0184 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/FactAgencyProjectDailyDTO.java @@ -0,0 +1,182 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.project.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 机关下日项目数据统计 存放机关下截止到当前日期的各项总数据以及昨日新增各项数据,每日定时执行,先删后增 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class FactAgencyProjectDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户Id 【dim_customer.id】 + */ + private String customerId; + + /** + * 机关Id 【dim_agency.id】 + */ + private String agencyId; + + /** + * 上级组织Id【dim_agency.pid】 + */ + private String parentId; + + /** + * 日维度Id 【dim_date.id】 + */ + private String dateId; + + /** + * 周维度Id 【dim_week.id】 + */ + private String weekId; + + /** + * 月维度Id 【dim_month.id】 + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年维度Id 【dim_year.id】 + */ + private String yearId; + + /** + * 截止当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectTotal; + + /** + * 截止当日处理中项目数 【当前组织及下级所有未结案项目总数】 + */ + private Integer pendingTotal; + + /** + * 截止当日处理中项目占比 【当前组织及下级未结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal pendingRatio; + + /** + * 截止当日已结案项目数 【当前组织及下级已结案项目总数】 + */ + private Integer closedTotal; + + /** + * 截止当日已结案项目占比 【当前组织及下级已结案项目百分比(存百分比数,小数点后两位)】 + */ + private BigDecimal closedRatio; + + /** + * 截止当日已结案中已解决项目数 【当前组织及下级已结案项目中已解决总数】 + */ + private Integer resolvedTotal; + + /** + * 截止当日已结案中已解决项目占比 【当前组织及下级已结案项目中已解决占比】 + */ + private BigDecimal resolvedRatio; + + /** + * 截止当日已结案中未解决项目数 【当前组织及下级已结案项目中未解决总数】 + */ + private Integer unresolvedTotal; + + /** + * 截止当日已结案中未解决项目占比 【当前组织及下级已结案项目中未解决占比】 + */ + private BigDecimal unresolvedRatio; + + /** + * 当日项目总数 【当前组织及下级项目总数】 + */ + private Integer projectIncr; + + /** + * 当日处理中项目数 【当前组织及下级前一日新增处理中项目数】 + */ + private Integer pendingIncr; + + /** + * 当日已结案项目数 【当前组织及下级前一日新增结案项目数】 + */ + private Integer closedIncr; + + /** + * 当日已结案项目中已解决数 【当前组织及下级前一日新增结案中已解决项目数】 + */ + private Integer resolvedIncr; + + /** + * 当日已结案项目组未解决数 【当前组织及下级前一日新增结案中未解决项目数】 + */ + private Integer unresolvedIncr; + + /** + * 删除标识 【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-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java new file mode 100644 index 0000000000..a7364cfac9 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/form/ProjectIncrTrendFormDTO.java @@ -0,0 +1,25 @@ +package com.epmet.project.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-日/月数据查询-接口入参 + */ +@Data +public class ProjectIncrTrendFormDTO implements Serializable { + + private static final long serialVersionUID = -4929038359220814068L; + + public interface ProjectIncr { + } + + /** + * 类型 month:代表月 date:代表日 + */ + @NotBlank(message = "month / date 类型不能为空", groups = {ProjectIncr.class}) + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java new file mode 100644 index 0000000000..b53b2a9f14 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectIncrTrendResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectIncrTrendResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 日期(2020/1/1;2020/1/2...) + */ + private String date; + + /** + * 类型对应数量 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java new file mode 100644 index 0000000000..31d25fe6bb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubAgencyResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String name; + + /** + * 不同类型对应数据 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java new file mode 100644 index 0000000000..19f1632be0 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSubGridResultDTO.java @@ -0,0 +1,36 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSubGridResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String name; + + /** + * 不同类型对应数据 + */ + private Integer value; + + /** + * 类型名称(处理中;已结案) + */ + private String type; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java new file mode 100644 index 0000000000..e371fce1f5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据-接口返参 + **/ +@Data +public class ProjectSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 类型名称(处理中;已结案) + */ + private String name; + + /** + * 类型对应数量 + */ + private Integer value; + + /** + * 类型对应百分比(10% 10.1% 10.01%小数点后两位) + */ + private String ratio; + +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java new file mode 100644 index 0000000000..0223644b78 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java @@ -0,0 +1,50 @@ +package com.epmet.project.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author sun + * @Description 数据-项目-汇总数据-接口返参 + **/ +@Data +public class ProjectSummaryResultDTO implements Serializable { + + private static final long serialVersionUID = 8529179932504931368L; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 项目总数 + */ + private Integer projectTotal; + + /** + * 更新日期 + */ + private String dateName; + + /** + * 处理中总数 + */ + private Integer pendingTotal; + + /** + * 处理中占比 + */ + private String pendingRatio; + + /** + * 已结案总数 + */ + private Integer closedTotal; + + /** + * 已结案占比 + */ + private String closedRatio; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java new file mode 100644 index 0000000000..e0a1e26fb3 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java @@ -0,0 +1,76 @@ +package com.epmet.module.project.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.module.project.service.ProjectService; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@RestController +@RequestMapping("project") +public class ProjectController { + + @Autowired + private ProjectService projectService; + + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + @PostMapping("projectsummary") + public Result projectSummary(@LoginUser TokenDto tokenDto) { + return new Result().ok(projectService.getProjectSummary(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @PostMapping("summaryinfo") + public Result> summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSummaryInfo(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @PostMapping("subagency") + public Result> subAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubAgency(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + @PostMapping("subgrid") + public Result> subGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(projectService.getSubGrid(tokenDto)); + } + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + @PostMapping("incrtrend") + public Result> incrTrend(@LoginUser TokenDto tokenDto, @RequestBody ProjectIncrTrendFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, ProjectIncrTrendFormDTO.ProjectIncr.class); + return new Result>().ok(projectService.getProjectIncrTrend(tokenDto,formDTO)); + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java new file mode 100644 index 0000000000..09bb4293f0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java @@ -0,0 +1,58 @@ +package com.epmet.module.project.dao; + +import com.epmet.project.dto.FactAgencyProjectDailyDTO; +import com.epmet.project.dto.result.*; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@Mapper +public interface ProjectDao { + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + ProjectSummaryResultDTO selectProjectSummary(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + List selectSummaryInfo(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询组织最近日期的日统计数据 + **/ + FactAgencyProjectDailyDTO selectAgencyProjectDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 数据-项目-获取最近日期下级组织柱状图数据(按项目总量降序) + **/ + List selectSubAgency(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关下直属网格最近一天的日统计数据,按项目总数降序 + **/ + List selectSubGrid(FactAgencyProjectDailyDTO agencyProjectDailyDTO); + + /** + * @Author sun + * @Description 查询机关日统计近九十天数据 + **/ + List selectIncrTrendDaily(@Param("agencyId") String agencyId); + + /** + * @Author sun + * @Description 查询机关月统计近十二个月数据 + **/ + List selectIncrTrendMonthly(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java new file mode 100644 index 0000000000..baa6e664e0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java @@ -0,0 +1,44 @@ +package com.epmet.module.project.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; + +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +public interface ProjectService { + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + List getSummaryInfo(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + List getSubAgency(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + List getSubGrid(TokenDto tokenDto); + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询 + **/ + List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java new file mode 100644 index 0000000000..502f613d1c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java @@ -0,0 +1,150 @@ +package com.epmet.module.project.service.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.exception.RenException; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.module.project.dao.ProjectDao; +import com.epmet.module.project.service.ProjectService; +import com.epmet.project.constant.ProjectConstant; +import com.epmet.project.dto.FactAgencyProjectDailyDTO; +import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; +import com.epmet.project.dto.result.*; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +/** + * @Author sun + * @Description 数据-项目 + **/ +@Service +public class ProjectServiceImpl implements ProjectService { + + @Autowired + private ProjectDao projectDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + + /** + * @Author sun + * @Description 数据-项目-获取汇总数据 + **/ + @Override + public ProjectSummaryResultDTO getProjectSummary(TokenDto tokenDto) { + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据agencyId查询项目统计数据 + ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId); + if (null != resultDTO) { + resultDTO.setPendingRatio(resultDTO.getPendingRatio() + "%"); + resultDTO.setClosedRatio(resultDTO.getClosedRatio() + "%"); + } + return resultDTO; + } + + /** + * @Author sun + * @Description 数据-项目-获取组织下饼图数据 + **/ + @Override + public List getSummaryInfo(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据agencyId查询各状态统计数据 + resultList = projectDao.selectSummaryInfo(agencyId); + if (null != resultList && resultList.size() > NumConstant.ZERO) { + resultList.forEach(sum -> { + sum.setRatio(sum.getRatio() + "%"); + }); + } + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-获取下级组织柱状图数据 + **/ + @Override + public List getSubAgency(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据机关Id查询最近日期的日统计数据 + FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); + if (null == agencyProjectDailyDTO) { + return resultList; + } + //2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序 + resultList = projectDao.selectSubAgency(agencyProjectDailyDTO); + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-获取机关直属网格项目数据 + **/ + @Override + public List getSubGrid(TokenDto tokenDto) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:根据机关Id查询最近日期的日统计数据 + FactAgencyProjectDailyDTO agencyProjectDailyDTO = projectDao.selectAgencyProjectDaily(agencyId); + if (null == agencyProjectDailyDTO) { + return resultList; + } + //2:获取当前组织最近日期的直属下级组织项目统计数据,按项目总量降序 + resultList = projectDao.selectSubGrid(agencyProjectDailyDTO); + return resultList; + } + + /** + * @Author sun + * @Description 数据-项目-日/月数据查询(日查询进九十天数据,月查询进十二个月数据) + **/ + @Override + public List getProjectIncrTrend(TokenDto tokenDto, ProjectIncrTrendFormDTO formDTO) { + List resultList = new ArrayList<>(); + //1:根据token获取agencyId + String agencyId = getLoginUserDetails(tokenDto); + + //2:查询机关过去九十天日统计数据(sql降序取前九十条) + if (ProjectConstant.DATE.equals(formDTO.getType())){ + resultList = projectDao.selectIncrTrendDaily(agencyId); + } + + //3:查询机关过去十二个月月统计数据 + if (ProjectConstant.MONTH.equals(formDTO.getType())) { + resultList = projectDao.selectIncrTrendMonthly(agencyId); + } + + return null; + } + + /** + * @author sun + * @Description 获取机关ID + */ + private String getLoginUserDetails(TokenDto tokenDto) { + LoginUserDetailsFormDTO dto = new LoginUserDetailsFormDTO(); + BeanUtils.copyProperties(tokenDto, dto); + LoginUserDetailsResultDTO data = epmetUserOpenFeignClient.getLoginUserDetails(dto).getData(); + String agencyId = data.getAgencyId(); + if (null == agencyId || "".equals(agencyId)) { + throw new RenException(ProjectConstant.GET_AGENCYID); + } + return agencyId; + } + +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml new file mode 100644 index 0000000000..ac9ecd9ad6 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -0,0 +1,228 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From e982425493b0ce56255f2603a129f1a2bea62320 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 16:53:53 +0800 Subject: [PATCH 072/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/dao/org/CustomerGridDao.java | 8 ++++++++ .../service/impl/StatsGroupServiceImpl.java | 19 ++++++++++++++++++- .../service/org/CustomerGridService.java | 8 ++++++++ .../org/impl/CustomerGridServiceImpl.java | 11 +++++++++++ .../resources/mapper/org/CustomerGridDao.xml | 12 ++++++++++++ 5 files changed, 57 insertions(+), 1 deletion(-) 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 4b2c3621b3..846dde48e8 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 @@ -50,4 +50,12 @@ public interface CustomerGridDao extends BaseDao { * @author zxc */ List selectAgencyGridTotalCount(@Param("formDto") List formDto, @Param("dateId")String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(@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/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 7c2d74e34e..15ad3e0b3a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -9,6 +9,7 @@ import com.epmet.entity.stats.DimAgencyEntity; import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; +import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; @@ -21,6 +22,7 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.ZonedDateTime; import java.util.*; +import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; /** @@ -44,6 +46,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { private FactGroupAgencyMonthlyService factGroupAgencyMonthlyService; @Autowired private DimCustomerService dimCustomerService; + @Autowired + private CustomerGridService customerGridService; /** * @Description 统计【网格-日】 @@ -132,7 +136,20 @@ public class StatsGroupServiceImpl implements StatsGroupService { String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); // TODO 1. 机关下有多少网格 - agencyResult.setGridTotal(allGrid.size()); + List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); + AtomicReference gridSize = new AtomicReference<>(0); + if (customerGridIdList.size() != NumConstant.ZERO){ + customerGridIdList.forEach(gridId -> { + allGrid.forEach(allAgencyGrid -> { + if (gridId.equals(allAgencyGrid)){ + gridSize.updateAndGet(v -> v + NumConstant.ONE); + } + }); + }); + agencyResult.setGridTotal(gridSize.get()); + }else { + agencyResult.setGridTotal(NumConstant.ZERO); + } // TODO 2. 机关下有多少小组,只算 state = ‘approved’ List agencyGroupTotalCount = groupDataService.getAgencyGroupTotalCount(allGrid,dateId); 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 2c7c0f523c..cd82c81628 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 @@ -23,4 +23,12 @@ public interface CustomerGridService { * @author zxc */ List selectAgencyGridTotalCount(List community, String dateId); + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + List getCustomerGridIdList(String customerId,String dateId); } 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 3e2c071400..d3e7a51087 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 @@ -34,4 +34,15 @@ public class CustomerGridServiceImpl implements CustomerGridService { public List selectAgencyGridTotalCount(List community, String dateId) { return customerGridDao.selectAgencyGridTotalCount(community,dateId); } + + /** + * @Description 获取客户下某个时间点以前的网格ID + * @param customerId + * @param dateId + * @author zxc + */ + @Override + public List getCustomerGridIdList(String customerId, String dateId) { + return customerGridDao.getCustomerGridIdList(customerId, dateId); + } } 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 e31a36a40a..0eb2f74b45 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 @@ -34,4 +34,16 @@ AND DATE_FORMAT(CREATED_TIME,'%Y-%m-%d') #{dateId} + + + \ No newline at end of file From 48e3fede0289cba5fea40d0ccefacb8d00e669ff Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 17:05:56 +0800 Subject: [PATCH 073/101] =?UTF-8?q?=E7=99=BE=E5=88=86=E6=AF=94=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/topic/TopicDao.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml index 93f146f299..78aca74a1c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/topic/TopicDao.xml @@ -42,7 +42,7 @@ WHEN topic_status_id = 'hidden' THEN '已屏蔽' WHEN topic_status_id = 'closed' THEN '已关闭' ELSE '无' END) AS name, - topic_proportion AS ratio + CONCAT(topic_proportion,'%') AS ratio FROM fact_topic_status_agency_daily WHERE From 766458b22a54a8d4f71ede2a04042124957ca80a Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 22 Jun 2020 17:35:41 +0800 Subject: [PATCH 074/101] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/issue/constant/IssueConstant.java | 14 ++ .../issue/dto/form/IssueIncrtrendFormDTO.java | 19 ++ .../epmet/issue/dto/result/IssueDataDTO.java | 206 ++++++++++++++++++ .../dto/result/IssueIncrtrendResultDTO.java | 30 +++ .../dto/result/IssueSubAgencyResultDTO.java | 34 +++ .../dto/result/IssueSubGridResultDTO.java | 27 +++ .../dto/result/IssueSummaryInfoResultDTO.java | 54 +++++ .../dto/result/IssueSummaryPieResultDTO.java | 30 +++ .../data-report/data-report-server/pom.xml | 2 +- .../issue/controller/IssueController.java | 95 ++++++++ .../com/epmet/module/issue/dao/IssueDao.java | 60 +++++ .../module/issue/service/IssueService.java | 65 ++++++ .../issue/service/impl/IssueServiceImpl.java | 172 +++++++++++++++ .../main/resources/mapper/issue/IssueDao.xml | 88 ++++++++ 14 files changed, 895 insertions(+), 1 deletion(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java new file mode 100644 index 0000000000..88d4f44c78 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/constant/IssueConstant.java @@ -0,0 +1,14 @@ +package com.epmet.issue.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:07 + */ +public interface IssueConstant { + String MONTH = "month"; + String DATE = "date"; + String VOTING_NAME = "表决中"; + String SHIFT_NAME = "已转项目"; + String CLOSED_NAME = "已关闭"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java new file mode 100644 index 0000000000..b4577b2811 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/form/IssueIncrtrendFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.issue.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:32 + */ +@Data +public class IssueIncrtrendFormDTO implements Serializable { + private static final long serialVersionUID = 4408419854627376175L; + /** + * 类型,按日date 按月month + */ + private String type; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java new file mode 100644 index 0000000000..961727e31c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueDataDTO.java @@ -0,0 +1,206 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 14:11 + */ +@Data +public class IssueDataDTO implements Serializable { + + private static final long serialVersionUID = 9136989870868730175L; + /** + * 组织ID + */ + private String agencyId; + + /** + * 组织名 + */ + private String agencyName; + + /** + * 网格ID + */ + private String gridId; + + /** + * 网格名 + */ + private String gridName; + + /** + * 年度ID + */ + private String yearId; + + /** + * 年度名 + */ + private String yearName; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 季度名 + */ + private String quarterName; + + /** + * 月度ID + */ + private String monthId; + + /** + * 月度名 + */ + private String monthName; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 日期名 + */ + private String dateName; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java new file mode 100644 index 0000000000..d63d332a9b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueIncrtrendResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:30 + */ +@NoArgsConstructor +@Data +public class IssueIncrtrendResultDTO implements Serializable { + + private static final long serialVersionUID = 7762529188251385355L; + /** + * 日期 + */ + private String date; + /** + * 状态(表决中,已转项目,已关闭) + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java new file mode 100644 index 0000000000..c401d5ecc4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubAgencyResultDTO.java @@ -0,0 +1,34 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:24 + */ +@NoArgsConstructor +@Data +public class IssueSubAgencyResultDTO implements Serializable { + + private static final long serialVersionUID = 2640337888693960513L; + /** + * 组织ID + */ + private String agencyId; + /** + * 组织名 + */ + private String name; + /** + * 类型 表决中,已转项目,已关闭 + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java new file mode 100644 index 0000000000..3313f0a8e7 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSubGridResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:27 + */ +@Data +public class IssueSubGridResultDTO implements Serializable { + private static final long serialVersionUID = -3318384216762207856L; + /** + * 网格名 + */ + private String name; + /** + * 类型 表决中,已转项目,已关闭 + */ + private String type; + /** + * 数量 + */ + private Integer value; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java new file mode 100644 index 0000000000..c53707c0a1 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryInfoResultDTO.java @@ -0,0 +1,54 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:17 + */ +@NoArgsConstructor +@Data +public class IssueSummaryInfoResultDTO implements Serializable { + + private static final long serialVersionUID = -7959140755148294338L; + /** + * 机关ID + */ + private String agencyId; + /** + * 议题总数 + */ + private Integer issueTotal; + /** + * 表决中数量 + */ + private Integer votingTotal; + /** + * 已转项目数量 + */ + private Integer shiftProjectTotal; + /** + * 已关闭数量 + */ + private Integer closedTotal; + /** + * 表决中占比 + */ + private String votingRatio; + /** + * 已转项目占比 + */ + private String shiftProjectRatio; + /** + * 已关闭占比 + */ + private String closedRatio; + /** + * 更新至日期 + */ + private String dateName; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java new file mode 100644 index 0000000000..f6940edeeb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/issue/dto/result/IssueSummaryPieResultDTO.java @@ -0,0 +1,30 @@ +package com.epmet.issue.dto.result; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 16:21 + */ +@NoArgsConstructor +@Data +public class IssueSummaryPieResultDTO implements Serializable { + + private static final long serialVersionUID = -971115426789868580L; + /** + * 名称 表决中,已转项目,已关闭 + */ + private String name; + /** + * 值 + */ + private Integer value; + /** + * 百分比 + */ + private String ratio; +} diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index d6dd66a273..d0933af706 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -112,7 +112,7 @@ 123456 - false + true 122.152.200.70:8848 fcd6fc8f-ca3a-4b01-8026-2b05cdc5976b diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java new file mode 100644 index 0000000000..39b61b637a --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java @@ -0,0 +1,95 @@ +package com.epmet.module.issue.controller; + +import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.commons.tools.utils.Result; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; +import com.epmet.module.issue.service.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:47 + */ +@RestController +@RequestMapping("issue") +public class IssueController { + @Autowired + private IssueService issueService; + + /** + * 数据汇总 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summaryinfo") + public Result getSummaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(issueService.getSummaryInfo(tokenDto)); + } + + /** + * 数据汇总饼状图 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("summarypie") + public Result> getSummaryPie(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSummaryPie(tokenDto)); + } + + /** + * 下级机关议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subagency") + public Result> getSubAgency(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubAgency(tokenDto)); + } + + /** + * 网格议题统计 + * + * @param tokenDto + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("subgrid") + public Result> getSubGrid(@LoginUser TokenDto tokenDto) { + return new Result>().ok(issueService.getSubGrid(tokenDto)); + } + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + * @author zhaoqifeng + * @date 2020/6/22 17:31 + */ + @PostMapping("incrtrend") + public Result> getIncrtrend(@LoginUser TokenDto tokenDto, @RequestBody IssueIncrtrendFormDTO formDTO) { + return new Result>().ok(issueService.getIncrtrend(tokenDto, formDTO)); + } + + +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java new file mode 100644 index 0000000000..bd530dd616 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java @@ -0,0 +1,60 @@ +package com.epmet.module.issue.dao; + +import com.epmet.issue.dto.result.IssueDataDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:48 + */ +@Mapper +public interface IssueDao { + /** + * 获取当前机关统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:19 + * @param agencyId + * @return com.epmet.issue.dto.result.IssueDataDTO + */ + IssueDataDTO selectAgencyInfo(@Param("agencyId") String agencyId); + + /** + * 获取下级机关统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:20 + * @param agencyId + * @return java.util.List + */ + List selectSubAgencyList(@Param("agencyId") String agencyId); + + /** + * 获取机关下网格统计信息 + * @author zhaoqifeng + * @date 2020/6/22 15:21 + * @param agencyId + * @return java.util.List + */ + List selectGridList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关日增量 + * @author zhaoqifeng + * @date 2020/6/22 15:22 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncDailyList(@Param("agencyId") String agencyId); + + /** + * 获取当前机关月增量 + * @author zhaoqifeng + * @date 2020/6/22 15:23 + * @param agencyId + * @return java.util.List + */ + List selectAgencyIncMonthlyList(@Param("agencyId") String agencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java new file mode 100644 index 0000000000..410930bffe --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java @@ -0,0 +1,65 @@ +package com.epmet.module.issue.service; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; + +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:48 + */ +public interface IssueService { + /** + * 议题汇总 + * + * @param tokenDto + * @return com.epmet.issue.dto.result.IssueSummaryInfoResultDTO + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto); + + /** + * 议题汇总饼状图 + * + * @param tokenDto + * @return com.epmet.issue.dto.result.IssueSummaryPieResultDTO + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + List getSummaryPie(TokenDto tokenDto); + + /** + * 下级机关 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:40 + */ + List getSubAgency(TokenDto tokenDto); + + /** + * 网格 + * + * @param tokenDto + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getSubGrid(TokenDto tokenDto); + + /** + * 议题分析 + * + * @param tokenDto + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/22 16:41 + */ + List getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java new file mode 100644 index 0000000000..562cfc25fc --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java @@ -0,0 +1,172 @@ +package com.epmet.module.issue.service.impl; + +import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.feign.EpmetUserOpenFeignClient; +import com.epmet.issue.constant.IssueConstant; +import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; +import com.epmet.issue.dto.result.*; +import com.epmet.module.issue.dao.IssueDao; +import com.epmet.module.issue.service.IssueService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.List; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/22 13:49 + */ +@Service +public class IssueServiceImpl implements IssueService { + @Autowired + private IssueDao issueDao; + @Autowired + private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Override + public IssueSummaryInfoResultDTO getSummaryInfo(TokenDto tokenDto) { + IssueSummaryInfoResultDTO result = new IssueSummaryInfoResultDTO(); + String agencyId = getAgencyId(tokenDto); + IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); + result.setAgencyId(agencyId); + result.setDateName(data.getDateName()); + result.setIssueTotal(data.getIssueTotal()); + result.setVotingTotal(data.getVotingTotal()); + result.setShiftProjectTotal(data.getShiftProjectTotal()); + result.setClosedTotal(data.getClosedTotal()); + result.setVotingRatio(toRatio(data.getVotingPercent())); + result.setShiftProjectRatio(toRatio(data.getShiftProjectPercent())); + result.setClosedRatio(toRatio(data.getClosedPercent())); + return result; + } + + @Override + public List getSummaryPie(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + IssueDataDTO data = issueDao.selectAgencyInfo(agencyId); + IssueSummaryPieResultDTO voting = new IssueSummaryPieResultDTO(); + voting.setName(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + voting.setRatio(toRatio(data.getVotingPercent())); + list.add(voting); + IssueSummaryPieResultDTO shift = new IssueSummaryPieResultDTO(); + shift.setName(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + shift.setRatio(toRatio(data.getShiftProjectPercent())); + list.add(shift); + IssueSummaryPieResultDTO closed = new IssueSummaryPieResultDTO(); + closed.setName(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + closed.setRatio(toRatio(data.getClosedPercent())); + list.add(closed); + return list; + } + + @Override + public List getSubAgency(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList = issueDao.selectSubAgencyList(agencyId); + if(null != dataList) { + dataList.forEach(data -> { + IssueSubAgencyResultDTO voting = new IssueSubAgencyResultDTO(); + voting.setAgencyId(data.getAgencyId()); + voting.setName(data.getAgencyName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + list.add(voting); + IssueSubAgencyResultDTO shift = new IssueSubAgencyResultDTO(); + shift.setAgencyId(data.getAgencyId()); + shift.setName(data.getAgencyName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + list.add(shift); + IssueSubAgencyResultDTO closed = new IssueSubAgencyResultDTO(); + closed.setAgencyId(data.getAgencyId()); + closed.setName(data.getAgencyName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + list.add(closed); + }); + } + return list; + } + + @Override + public List getSubGrid(TokenDto tokenDto) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList = issueDao.selectGridList(agencyId); + if(null != dataList) { + dataList.forEach(data -> { + IssueSubGridResultDTO voting = new IssueSubGridResultDTO(); + voting.setName(data.getGridName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingTotal()); + list.add(voting); + IssueSubGridResultDTO shift = new IssueSubGridResultDTO(); + shift.setName(data.getGridName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectTotal()); + list.add(shift); + IssueSubGridResultDTO closed = new IssueSubGridResultDTO(); + closed.setName(data.getGridName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedTotal()); + list.add(closed); + }); + } + return list; + } + + @Override + public List getIncrtrend(TokenDto tokenDto, IssueIncrtrendFormDTO formDTO) { + List list = new ArrayList<>(); + String agencyId = getAgencyId(tokenDto); + List dataList; + if (IssueConstant.DATE.equals(formDTO.getType())) { + dataList = issueDao.selectAgencyIncDailyList(agencyId); + } else { + dataList = issueDao.selectAgencyIncMonthlyList(agencyId); + } + if (null != dataList) { + dataList.forEach(data -> { + IssueIncrtrendResultDTO voting = new IssueIncrtrendResultDTO(); + voting.setDate(data.getDateName()); + voting.setType(IssueConstant.VOTING_NAME); + voting.setValue(data.getVotingIncr()); + list.add(voting); + IssueIncrtrendResultDTO shift = new IssueIncrtrendResultDTO(); + shift.setDate(data.getDateName()); + shift.setType(IssueConstant.SHIFT_NAME); + shift.setValue(data.getShiftProjectIncr()); + list.add(shift); + IssueIncrtrendResultDTO closed = new IssueIncrtrendResultDTO(); + closed.setDate(data.getDateName()); + closed.setType(IssueConstant.CLOSED_NAME); + closed.setValue(data.getClosedIncr()); + list.add(closed); + }); + } + return list; + } + + private String getAgencyId(TokenDto tokenDto) { + LoginUserDetailsFormDTO loginUserDetailsFormDTO = new LoginUserDetailsFormDTO(); + loginUserDetailsFormDTO.setApp(tokenDto.getApp()); + loginUserDetailsFormDTO.setClient(tokenDto.getClient()); + loginUserDetailsFormDTO.setUserId(tokenDto.getUserId()); + LoginUserDetailsResultDTO userInfo = epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO).getData(); + String[] orgIdPath = userInfo.getOrgIdPath().split(":"); + return orgIdPath[orgIdPath.length - 1]; + } + + private String toRatio(BigDecimal data) { + return data.stripTrailingZeros().toString().concat("%"); + } +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml new file mode 100644 index 0000000000..d558e62d86 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + \ No newline at end of file From 99ee7dffb63869b17ea849820186c8b75b73a98b Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Jun 2020 17:53:17 +0800 Subject: [PATCH 075/101] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...va => DataStatisticalOpenFeignClient.java} | 46 +++- ...taStatisticalOpenFeignClientFallBack.java} | 46 +++- .../controller/StatsPublicityController.java | 24 +- .../dao/stats/FactTagUsedAgencyDailyDao.java | 3 +- .../epmet/service/StatsPublicityService.java | 27 +- .../impl/StatsPublicityServiceImpl.java | 254 ++++++++++-------- .../stats/FactTagUsedAgencyDailyService.java | 2 +- .../FactTagUsedAgencyDailyServiceImpl.java | 2 +- .../db/migration/data_statistical.sql | 120 ++------- .../stats/FactTagUsedAgencyDailyDao.xml | 2 +- .../stats/FactTagUsedAgencyMonthlyDao.xml | 1 + .../service/StatsPublicityTaskService.java | 18 +- .../service/impl/StatsGroupServiceImpl.java | 4 +- .../impl/StatsPublicityTaskServiceImpl.java | 45 +++- 14 files changed, 330 insertions(+), 264 deletions(-) rename epmet-module/data-statistical/data-statistical-client/src/main/java/feign/{StatsPublicityFeignClient.java => DataStatisticalOpenFeignClient.java} (60%) rename epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/{StatsPublicityFeignClientFallBack.java => DataStatisticalOpenFeignClientFallBack.java} (51%) diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java similarity index 60% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java index f8a20e31cb..01c9953043 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/StatsPublicityFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java @@ -2,17 +2,19 @@ package feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; -import feign.impl.StatsPublicityFeignClientFallBack; +import feign.impl.DataStatisticalOpenFeignClientFallBack; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.PostMapping; /** - * @Description 数据-宣传能力 -定时任务 - * @Author wangc - * @Date 2020/5/23 13:42 + * desc: 数据统计 对外feign client + * + * @return: + * @date: 2020/6/22 17:39 + * @author: jianjun liu */ -@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = StatsPublicityFeignClientFallBack.class) -public interface StatsPublicityFeignClient { +@FeignClient(name = ServiceConstant.DATA_STATISTICAL, fallback = DataStatisticalOpenFeignClientFallBack.class) +public interface DataStatisticalOpenFeignClient { /** * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 @@ -34,13 +36,22 @@ public interface StatsPublicityFeignClient { Result tagUsedDailyStatsjob(); /** - * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ - @PostMapping(value = "data/stats/statspublicity/tagUsedMonthStatsjob") - Result tagUsedMonthStatsjob(); + @PostMapping(value = "data/stats/statspublicity/tagUsedMonthlyStatsjob") + Result tagUsedMonthlyStatsjob(); + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagUsedQuarterlyStatsjob") + Result tagUsedQuarterlyStatsjob(); /** * desc: 【日】 统计阅读最多的标签 包含 机关 网格 @@ -49,16 +60,25 @@ public interface StatsPublicityFeignClient { * @author: jianjun liu */ @PostMapping(value = "data/stats/statspublicity/tagViewedDailyStatsjob") - Result tagViewedDayStatsjob(); + Result tagViewedDailyStatsjob(); + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @PostMapping(value = "data/stats/statspublicity/tagViewedMonthlyStatsjob") + Result tagViewedMonthlyStatsjob(); /** - * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ - @PostMapping(value = "data/stats/statspublicity/tagViewedMonthStatsjob") - Result tagViewedMonthStatsjob(); + @PostMapping(value = "data/stats/statspublicity/tagViewedQuarterlyStatsjob") + Result tagViewedQuarterlyStatsjob(); /** * @Description 统计 “网格小组”, dim:【网格-日】 diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java similarity index 51% rename from epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java rename to epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java index ec17c4a3e4..1ccec983eb 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/StatsPublicityFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -3,7 +3,7 @@ package feign.impl; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; -import feign.StatsPublicityFeignClient; +import feign.DataStatisticalOpenFeignClient; import org.springframework.stereotype.Component; /** @@ -15,7 +15,7 @@ import org.springframework.stereotype.Component; * email:liujianjun@git.elinkit.com.cn */ @Component -public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignClient { +public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOpenFeignClient { /** * desc: 【日】统计文章总数及在线文章总数 包含 机关 部门 网格 @@ -25,7 +25,7 @@ public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignCli */ @Override public Result articleSummaryDailyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "articleSummaryDailyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "articleSummaryDailyStatsjob"); } /** @@ -37,18 +37,29 @@ public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignCli */ @Override public Result tagUsedDailyStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagUsedDailyStatsjob"); + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedDailyStatsjob"); } /** - * desc: 【月,季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * desc: 【月】 统计发表文章最多的分类 包含 机关 部门 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ @Override - public Result tagUsedMonthStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagUsedMonthStatsjob"); + public Result tagUsedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedMonthlyStatsjob"); + } + + /** + * desc: 【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagUsedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagUsedQuarterlyStatsjob"); } /** @@ -58,19 +69,30 @@ public class StatsPublicityFeignClientFallBack implements StatsPublicityFeignCli * @author: jianjun liu */ @Override - public Result tagViewedDayStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagViewedDayStatsjob"); + public Result tagViewedDailyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedDailyStatsjob"); + } + + /** + * desc: 【月】 统计阅读最多的标签 包含 机关 网格 + * + * @date: 2020/6/22 9:09 + * @author: jianjun liu + */ + @Override + public Result tagViewedMonthlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedMonthlyStatsjob"); } /** - * desc: 【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * desc: 【季,年】 统计阅读最多的标签 包含 机关 网格 * * @date: 2020/6/22 9:09 * @author: jianjun liu */ @Override - public Result tagViewedMonthStatsjob() { - return ModuleUtils.feignConError(ServiceConstant.GOV_ISSUE_SERVER, "tagViewedMonthStatsjob"); + public Result tagViewedQuarterlyStatsjob() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "tagViewedQuarterlyStatsjob"); } @Override diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java index e55a29b36a..79ca1d0acf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsPublicityController.java @@ -56,6 +56,17 @@ public class StatsPublicityController { return new Result().ok(statsPublicityService.tagUsedMonthlyStatsjob(statsDate)); } + /** + * desc:【季,年】 统计发表文章最多的分类 包含 机关 部门 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagUsedQuarterlyStatsjob") + public Result tagUsedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagUsedQuarterlyStatsjob(statsDate)); + } + /** * desc:【日】 统计阅读最多的标签 包含 机关 网格 * @@ -68,7 +79,7 @@ public class StatsPublicityController { } /** - * desc:【月,季,年】 统计阅读最多的标签 包含 机关 网格 + * desc:【月】 统计阅读最多的标签 包含 机关 网格 * * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 * @return @@ -77,4 +88,15 @@ public class StatsPublicityController { public Result tagViewedMonthlyStatsjob(Date statsDate) { return new Result().ok(statsPublicityService.tagViewedMonthlyStatsjob(statsDate)); } + + /** + * desc:【季,年】 统计阅读最多的标签 包含 机关 网格 + * + * @param statsDate 默认:为T-1天,如果传 则统计的是【statsDate】的数据 + * @return + */ + @PostMapping(value = "tagViewedQuarterlyStatsjob") + public Result tagViewedQuarterlyStatsjob(Date statsDate) { + return new Result().ok(statsPublicityService.tagViewedQuarterlyStatsjob(statsDate)); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java index 12569eb8cc..bb53792085 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactTagUsedAgencyDailyDao.java @@ -19,7 +19,6 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactTagUsedAgencyDailyEntity; -import com.epmet.entity.stats.FactTagUsedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -43,5 +42,5 @@ public interface FactTagUsedAgencyDailyDao extends BaseDao getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); + List getTagUsedCountByMonth(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java index 03b253a588..772d48e788 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsPublicityService.java @@ -10,7 +10,6 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/17 16:11 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean articleSummaryDailyStatsjob(Date statsDate); @@ -20,7 +19,6 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/17 16:11 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagUsedDailyStatsjob(Date statsDate); @@ -31,10 +29,19 @@ public interface StatsPublicityService { * @return: * @date: 2020/6/19 18:44 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagUsedMonthlyStatsjob(Date statsDate); + /** + * desc: 按季年统计标签被使用次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagUsedQuarterlyStatsjob(Date statsDate); + /** * desc: 按日 统计每个标签的阅读数 * @@ -42,18 +49,26 @@ public interface StatsPublicityService { * @return: Boolean * @date: 2020/6/20 8:40 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagViewedDailyStatsjob(Date statsDate); /** - * desc: + * desc: 按月统计标签被查看次数 * * @param statsDate * @return: * @date: 2020/6/20 10:44 * @author: jianjun liu - * email:liujianjun@git.elinkit.com.cn */ Boolean tagViewedMonthlyStatsjob(Date statsDate); + + /** + * desc: 按季年统计标签被查看次数 + * + * @param statsDate + * @return: + * @date: 2020/6/20 10:44 + * @author: jianjun liu + */ + Boolean tagViewedQuarterlyStatsjob(Date statsDate); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index c1c5505885..baadc98ac0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -13,7 +13,6 @@ import com.epmet.entity.voice.ArticleEntity; import com.epmet.entity.voice.ArticleTagsEntity; import com.epmet.service.StatsPublicityService; import com.epmet.service.stats.*; -import com.epmet.service.voice.ArticlePublishRangeService; import com.epmet.service.voice.ArticleService; import com.epmet.service.voice.ArticleTagsService; import com.epmet.service.voice.ArticleVisitRecordService; @@ -27,7 +26,6 @@ import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; @@ -44,16 +42,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private DimAgencyService dimAgencyService; @Autowired - private DimDateService dimDateService; - @Autowired - private DimWeekService dimWeekService; - @Autowired - private DimMonthService dimMonthService; - @Autowired - private DimQuarterService dimQuarterService; - @Autowired - private DimYearService dimYearService; - @Autowired private DimCustomerService dimCustomerService; @Autowired private DimGridService dimGridService; @@ -64,8 +52,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { @Autowired private ArticleService articleService; @Autowired - private ArticlePublishRangeService articlePublishRangeService; - @Autowired private ArticleVisitRecordService articleVisitRecordService; @Autowired private FactArticlePublishedGridDailyService factArticlePublishedGridDailyService; @@ -134,7 +120,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; - executorService.submit(() -> { + try { //key:所在机关Id Map agencySummaryMap = new HashMap<>(); @@ -144,7 +130,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } catch (Exception e) { log.error("articlePublishedCountDayStats exception", e); } - }); + } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -193,7 +179,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { int pageNo = 1; int pageSize = 100; List customerIdList = null; - CountDownLatch countDownLatch = new CountDownLatch(1); do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { @@ -201,29 +186,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { executorService.submit(() -> { try { statsTagUsedMonthly(dimIdBean.getMonthId(), customerId); - countDownLatch.countDown(); } catch (Exception e) { log.error("statsTagUsedMonthly exception", e); } }); - executorService.submit(() -> { - try { - countDownLatch.await(); - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); - } catch (Exception e) { - log.error("statsTagUsedQuarterly exception", e); - } - }); - executorService.submit(() -> { - try { - countDownLatch.await(); - log.debug("start === statsTagUsedQuarterly "); - statsTagUsedYearly(dimIdBean.getYearId(), customerId); - } catch (Exception e) { - log.error("statsTagUsedYearly exception", e); - } - }); } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -272,26 +238,81 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { int pageNo = 1; int pageSize = 100; List customerIdList = null; - CountDownLatch countDownLatch = new CountDownLatch(1); do { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - if (!"6c8cfc2c14afeb6d3664b3e283fc9074".equals(customerId)) { - continue; - } executorService.submit(() -> { try { statsTagViewedMonthly(dimIdBean.getMonthId(), customerId); - countDownLatch.countDown(); } catch (Exception e) { log.error("statsTagViewedMonthly exception", e); } }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + @Override + public Boolean tagUsedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedQuarterly(dimIdBean.getQuarterId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedQuarterly exception", e); + } + }); + executorService.submit(() -> { + try { + log.debug("start === statsTagUsedQuarterly "); + statsTagUsedYearly(dimIdBean.getYearId(), customerId); + } catch (Exception e) { + log.error("statsTagUsedYearly exception", e); + } + }); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + return true; + } + + @Override + public Boolean tagViewedQuarterlyStatsjob(Date statsDate) { + //如果不传时间 则统计数据为今天之前的数据和,否则统计的是截止到传入的日期数据的和 + if (statsDate == null) { + //当天的凌晨时间 即为今天之前的数据 + statsDate = DateUtils.integrate(new Date(), DateUtils.DATE_PATTERN); + } else { + statsDate = DateUtils.integrate(DateUtils.addDateDays(statsDate, 1), DateUtils.DATE_PATTERN); + } + DimIdGenerator.DimIdBean dimIdBean = DimIdGenerator.getDimIdBean(statsDate); + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { executorService.submit(() -> { try { - countDownLatch.await(); log.debug("start === statsTagViewedQuarterly "); statsTagViewedQuarterly(dimIdBean.getQuarterId(), customerId); } catch (Exception e) { @@ -300,7 +321,6 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { }); executorService.submit(() -> { try { - countDownLatch.await(); log.debug("start === statsTagViewedYearly "); statsTagViewedYearly(dimIdBean.getYearId(), customerId); } catch (Exception e) { @@ -320,25 +340,27 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); return; } - //转换为 需要插入的Entity - Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN)); - - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); - if (gridDailyEntities == null) { - log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllDepartmentPublishedCount(customerId, DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN)); + + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedDepartmentDailyEntity gridDailyEntities = departmentDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); } - } - boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + boolean b = factArticlePublishedDepartmentDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), departmentDailyEntityMap.values()); + }); } /** @@ -374,33 +396,33 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { * @param agencySummaryMap */ private void statsPublishedGridDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { - //key:所在机关Id - Map result = new HashMap<>(); //获取所有网格 List gridDTOList = dimGridService.getGridListByCustomerId(customerId); if (CollectionUtils.isEmpty(gridDTOList)) { log.warn("publicitySummary getGridListByCustomerId return empty,customerId:{}", customerId); return; } - - //转换为 需要插入的Entity - Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); - if (gridDailyEntity == null) { - log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllGridPublishedCount(customerId, statsDate); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedGridDailyEntity gridDailyEntity = gridDailyEntityMap.get(summaryDTO.getGridId()); + if (gridDailyEntity == null) { + log.error("publicitySummary getAllGridPublishedCount gridId:{} not exist in dimGrid", summaryDTO.getGridId()); + continue; + } + gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); } - gridDailyEntity.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntity.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); } - } - boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + boolean b = factArticlePublishedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), gridDailyEntityMap.values()); + }); + } private void statsPublishedAgencyDaily(Date statsDate, DimIdGenerator.DimIdBean dimIdBean, String customerId, Map agencySummaryMap) { @@ -410,40 +432,43 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } - //转换为 需要插入的Entity - Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); - //获取当天的业务数据 - List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); - Map haveDataAgencyDailyMap = new HashMap<>(); - if (!CollectionUtils.isEmpty(publishedArticleCount)) { - for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { - FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); - if (gridDailyEntities == null) { - log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); - continue; + executorService.submit(()->{ + //转换为 需要插入的Entity + Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); + //获取当天的业务数据 + List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); + Map haveDataAgencyDailyMap = new HashMap<>(); + if (!CollectionUtils.isEmpty(publishedArticleCount)) { + for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { + FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); + if (gridDailyEntities == null) { + log.error("publicitySummary bizData departmentId:{} not exist in dimDepartment", summaryDTO.getGridId()); + continue; + } + gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + //同一个机关下数据累加 + buildAgencySummaryData(agencySummaryMap, summaryDTO); + haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } - gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); - gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); - haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); } - } - //数据向上级机关添加 - if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { - for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); - FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); - FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); - if (dailyEntity == null) { - log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); - continue; + //数据向上级机关添加 + if (!CollectionUtils.isEmpty(haveDataAgencyDailyMap)) { + for (Map.Entry entry : haveDataAgencyDailyMap.entrySet()) { + String agencyId = entry.getKey(); + FactArticlePublishedAgencyDailyEntity summary = entry.getValue(); + FactArticlePublishedAgencyDailyEntity dailyEntity = agencyDailyEntityMap.get(agencyId); + if (dailyEntity == null) { + log.error("publicitySummary bizData agencyId:{} not exist in dimAgency", agencyId); + continue; + } + setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } - setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } - } - boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); + }); + } /** @@ -502,6 +527,9 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { case ProjectConstant.PUBLISHER_TYPE_DEPT: convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); break; + case ProjectConstant.PUBLISHER_TYPE_AGENCY: + convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + break; } } @@ -511,7 +539,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { Map finalTagUsedAgencyDailyMap = new HashMap<>(); finalTagUsedAgencyDailyMap.putAll(tagUsedAgencyDailyMap); for (Map.Entry entry : tagUsedAgencyDailyMap.entrySet()) { - String agencyId = entry.getKey(); + String agencyId = entry.getKey().split(StrConstant.UNDER_LINE)[0]; FactTagUsedAgencyDailyEntity currentEntity = entry.getValue(); DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); if (dimAgencyEntity == null) { @@ -616,7 +644,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { List gridMonthlyList = ConvertUtils.sourceToTarget(deptDailyList, FactTagUsedDepartmentMonthlyEntity.class); factTagUsedDepartmentMonthlyService.deleteAndInsertByMonthId(customerId, monthId, gridMonthlyList); } - List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); + List agencyDailyList = factTagUsedAgencyDailyService.getTagUsedCountByMonth(customerId, monthId); if (!CollectionUtils.isEmpty(agencyDailyList)) { List agencyMonthlyList = ConvertUtils.sourceToTarget(agencyDailyList, FactTagUsedAgencyMonthlyEntity.class); factTagUsedAgencyMonthlyService.deleteAndInsertByMonthId(customerId, monthId, (agencyMonthlyList)); @@ -923,15 +951,15 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } private void convertTagUsedAgencyDailyEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { - String publisherId = articleEntity.getPublisherId(); + String agencyId = articleEntity.getOrgId(); String tagId = tagEntity.getTagId(); - String key = publisherId.concat(StrConstant.UNDER_LINE).concat(tagId); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); FactTagUsedAgencyDailyEntity entity = result.get(key); if (entity == null) { entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); entity.setPid(pid); entity.setCustomerId(articleEntity.getCustomerId()); - entity.setAgencyId(publisherId); + entity.setAgencyId(agencyId); entity.setTagId(tagId); entity.setTagName(tagEntity.getTagName()); entity.setUsedCount(1); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java index 1dfa4bd1f3..da57ca03b9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactTagUsedAgencyDailyService.java @@ -46,5 +46,5 @@ public interface FactTagUsedAgencyDailyService extends BaseService getTagUsedCountByMonth(String customerId, String monthId); + List getTagUsedCountByMonth(String customerId, String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java index 97961d6b0b..7eef72f9d7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactTagUsedAgencyDailyServiceImpl.java @@ -56,7 +56,7 @@ public class FactTagUsedAgencyDailyServiceImpl extends BaseServiceImpl getTagUsedCountByMonth(String customerId, String monthId) { + public List getTagUsedCountByMonth(String customerId, String monthId) { if (StringUtils.isBlank(customerId) || StringUtils.isBlank(monthId)){ throw new RenException(EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getCode(),EpmetErrorCode.INTERNAL_VALIDATE_ERROR.getMsg()); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql index f188d95e6a..cd25dce6a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/data_statistical.sql @@ -3,17 +3,17 @@ /* Navicat Premium Data Transfer - Source Server : localhost + Source Server : 亿联 Source Server Type : MySQL - Source Server Version : 50720 - Source Host : localhost:3306 - Source Schema : pd + Source Server Version : 50728 + Source Host : 192.168.1.130:3306 + Source Schema : epmet_data_statistical Target Server Type : MySQL - Target Server Version : 50720 + Target Server Version : 50728 File Encoding : 65001 - Date: 16/06/2020 18:04:53 + Date: 22/06/2020 16:40:46 */ SET NAMES utf8mb4; @@ -44,10 +44,6 @@ CREATE TABLE `fact_article_published_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_article_published_department_daily -- ---------------------------- @@ -73,10 +69,6 @@ CREATE TABLE `fact_article_published_department_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【部门】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_department_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_article_published_grid_daily -- ---------------------------- @@ -102,10 +94,6 @@ CREATE TABLE `fact_article_published_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章发布数量【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_article_published_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_daily -- ---------------------------- @@ -132,10 +120,6 @@ CREATE TABLE `fact_tag_used_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_monthly -- ---------------------------- @@ -149,6 +133,8 @@ CREATE TABLE `fact_tag_used_agency_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -158,10 +144,6 @@ CREATE TABLE `fact_tag_used_agency_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_quarterly -- ---------------------------- @@ -175,6 +157,7 @@ CREATE TABLE `fact_tag_used_agency_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -184,10 +167,6 @@ CREATE TABLE `fact_tag_used_agency_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_agency_yearly -- ---------------------------- @@ -210,10 +189,6 @@ CREATE TABLE `fact_tag_used_agency_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【机关】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_agency_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_daily -- ---------------------------- @@ -241,10 +216,6 @@ CREATE TABLE `fact_tag_used_department_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_monthly -- ---------------------------- @@ -258,6 +229,8 @@ CREATE TABLE `fact_tag_used_department_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:202006 = 2020年6月、202007 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -267,10 +240,6 @@ CREATE TABLE `fact_tag_used_department_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_quarterly -- ---------------------------- @@ -284,6 +253,7 @@ CREATE TABLE `fact_tag_used_department_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -293,10 +263,6 @@ CREATE TABLE `fact_tag_used_department_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_department_yearly -- ---------------------------- @@ -319,10 +285,6 @@ CREATE TABLE `fact_tag_used_department_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【部门】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_department_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_daily -- ---------------------------- @@ -349,10 +311,6 @@ CREATE TABLE `fact_tag_used_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_monthly -- ---------------------------- @@ -366,6 +324,8 @@ CREATE TABLE `fact_tag_used_grid_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -375,10 +335,6 @@ CREATE TABLE `fact_tag_used_grid_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_quarterly -- ---------------------------- @@ -392,6 +348,7 @@ CREATE TABLE `fact_tag_used_grid_quarterly` ( `TAG_NAME` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `USED_COUNT` int(11) NULL DEFAULT NULL COMMENT '标签使用次数 标签的使用次数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -401,10 +358,6 @@ CREATE TABLE `fact_tag_used_grid_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_used_grid_yearly -- ---------------------------- @@ -427,10 +380,6 @@ CREATE TABLE `fact_tag_used_grid_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '标签【网格】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_used_grid_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_daily -- ---------------------------- @@ -457,10 +406,6 @@ CREATE TABLE `fact_tag_viewed_agency_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_monthly -- ---------------------------- @@ -474,6 +419,8 @@ CREATE TABLE `fact_tag_viewed_agency_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -483,10 +430,6 @@ CREATE TABLE `fact_tag_viewed_agency_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_quarterly -- ---------------------------- @@ -500,6 +443,7 @@ CREATE TABLE `fact_tag_viewed_agency_quarterly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -509,10 +453,6 @@ CREATE TABLE `fact_tag_viewed_agency_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_agency_yearly -- ---------------------------- @@ -535,10 +475,6 @@ CREATE TABLE `fact_tag_viewed_agency_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【机关】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_agency_yearly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_daily -- ---------------------------- @@ -565,10 +501,6 @@ CREATE TABLE `fact_tag_viewed_grid_daily` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】日统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_daily --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_monthly -- ---------------------------- @@ -582,6 +514,8 @@ CREATE TABLE `fact_tag_viewed_grid_monthly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `MONTH_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月', + `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -591,10 +525,6 @@ CREATE TABLE `fact_tag_viewed_grid_monthly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】月统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_monthly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_quarterly -- ---------------------------- @@ -608,6 +538,7 @@ CREATE TABLE `fact_tag_viewed_grid_quarterly` ( `TAG_NAME` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '标签名称 标签名称', `TAG_READ_COUNT` int(11) NULL DEFAULT NULL COMMENT '文章引用标签阅读数 文章引用标签阅读数', `QUARTER_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度', + `YEAR_ID` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '年度ID 年度ID eg:2020 = 2020年、2021 = 2021年', `DEL_FLAG` int(11) NULL DEFAULT 0 COMMENT '删除状态', `REVISION` int(11) NULL DEFAULT NULL COMMENT '乐观锁', `CREATED_BY` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建人', @@ -617,10 +548,6 @@ CREATE TABLE `fact_tag_viewed_grid_quarterly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】季度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_quarterly --- ---------------------------- - -- ---------------------------- -- Table structure for fact_tag_viewed_grid_yearly -- ---------------------------- @@ -643,8 +570,5 @@ CREATE TABLE `fact_tag_viewed_grid_yearly` ( PRIMARY KEY (`ID`) USING BTREE ) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文章引用标签阅读数量【网格】年度统计表' ROW_FORMAT = Dynamic; --- ---------------------------- --- Records of fact_tag_viewed_grid_yearly --- ---------------------------- - SET FOREIGN_KEY_CHECKS = 1; + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml index bd19d31fd0..b99b5e409b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyDailyDao.xml @@ -6,7 +6,7 @@ DELETE FROM fact_tag_used_agency_daily WHERE CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} AND DATE_ID = #{dateId,jdbcType=VARCHAR} - SELECT CUSTOMER_ID, PID, diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml index ccbe4c211b..05d22a1a38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactTagUsedAgencyMonthlyDao.xml @@ -28,6 +28,7 @@ + SELECT + article_total_count AS publishedTotal, + article_published_count AS publishingTotal, + DATE_FORMAT( date_id, '%Y-%m-%d' ) AS dateName + FROM fact_article_published_agency_daily + AND agency_id = #{agencyId} + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml new file mode 100644 index 0000000000..fce52d3311 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml new file mode 100644 index 0000000000..cace8fc645 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..f4806e8e40 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..9c10faf1b1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml new file mode 100644 index 0000000000..3384db1368 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml new file mode 100644 index 0000000000..10653c3bb5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml new file mode 100644 index 0000000000..937da74e63 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml @@ -0,0 +1,20 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml new file mode 100644 index 0000000000..5ff395280d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml @@ -0,0 +1,22 @@ + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml new file mode 100644 index 0000000000..e0b274080d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml @@ -0,0 +1,23 @@ + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml new file mode 100644 index 0000000000..b03b85f2bf --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml new file mode 100644 index 0000000000..870ed21e7d --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml new file mode 100644 index 0000000000..4e08735106 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml new file mode 100644 index 0000000000..03bf9a4f3b --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 74787dff5d..8bd8f152a9 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -62,6 +62,12 @@ epmet-commons-dynamic-datasource 2.0.0 + + com.epmet + epmet-user-client + 2.0.0 + compile + diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index c8c1848738..51bece6d52 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -24,7 +24,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class,url="localhost:8087") public interface EpmetUserOpenFeignClient { /** From 40a0bb4765a466f72b05963ba93d0798ce415dd6 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 22 Jun 2020 18:02:16 +0800 Subject: [PATCH 077/101] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=B0=83?= =?UTF-8?q?=E6=95=B4agency=E7=BB=B4=E5=BA=A6=E7=9A=84=E7=94=9F=E6=88=90?= =?UTF-8?q?=EF=BC=8C=E7=94=9F=E6=88=90=E6=9C=AC=E8=BA=AB=E5=8F=8A=E6=89=80?= =?UTF-8?q?=E6=9C=89=E4=B8=8B=E7=BA=A7(all)=EF=BC=8C=E6=9C=AC=E8=BA=AB(sel?= =?UTF-8?q?f)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/DimAgencyConstant.java | 10 ++++ .../epmet/entity/stats/DimAgencyEntity.java | 5 ++ .../stats/impl/DimAgencyServiceImpl.java | 49 ++++++++++++++----- .../migration/V0.0.2__dim_ag_add_col_type.sql | 1 + 4 files changed, 53 insertions(+), 12 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java new file mode 100644 index 0000000000..b447c1f2da --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/DimAgencyConstant.java @@ -0,0 +1,10 @@ +package com.epmet.constant; + +public interface DimAgencyConstant { + + String TYPE_ALL = "all"; + String TYPE_SELF = "self"; + + String TYPE_SELF_ID_SUFFIX = "-self"; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java index 2ca7c2a168..28b471f0a2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/DimAgencyEntity.java @@ -58,6 +58,11 @@ public class DimAgencyEntity extends BaseEpmetEntity { */ private String pids; + /** + * 机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等 + */ + private String agencyDimType; + /** * 所有上级名称,以-连接 */ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java index 16e627c42c..ef1c918895 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/DimAgencyServiceImpl.java @@ -25,6 +25,7 @@ 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.constant.DimAgencyConstant; import com.epmet.constant.RobotConstant; import com.epmet.constant.StatsSubject; import com.epmet.dao.stats.DimAgencyDao; @@ -44,7 +45,6 @@ import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Map; -import java.util.stream.Collectors; /** * 机关维度 @@ -125,22 +125,47 @@ public class DimAgencyServiceImpl extends BaseServiceImpl agencies) { for (CustomerAgencyEntity agency : agencies) { - DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); - dimAgencyEntity.setAgencyName(agency.getOrganizationName()); - dimAgencyEntity.setAllParentName(agency.getAllParentName()); - dimAgencyEntity.setCustomerId(agency.getCustomerId()); - dimAgencyEntity.setLevel(agency.getLevel()); - dimAgencyEntity.setPid(agency.getPid()); - dimAgencyEntity.setPids(agency.getPids()); - dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); - dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); - dimAgencyEntity.setId(agency.getId()); - baseDao.insert(dimAgencyEntity); + initAgencyAllDim(agency); + initAgencySelfDim(agency); } lastExecRecordDao.updateExecTimeBySubject(new Date(), StatsSubject.DIM_AGENCY); } + public void initAgencyAllDim(CustomerAgencyEntity agency) { + DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); + dimAgencyEntity.setAgencyName(agency.getOrganizationName()); + dimAgencyEntity.setAllParentName(agency.getAllParentName()); + dimAgencyEntity.setCustomerId(agency.getCustomerId()); + dimAgencyEntity.setLevel(agency.getLevel()); + dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_ALL); + dimAgencyEntity.setPid(agency.getPid()); + dimAgencyEntity.setPids(agency.getPids()); + dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setId(agency.getId()); + baseDao.insert(dimAgencyEntity); + } + + /** + * 初始化机关单位本身的维度(不包含本身) + * @param agency + */ + public void initAgencySelfDim(CustomerAgencyEntity agency) { + DimAgencyEntity dimAgencyEntity = new DimAgencyEntity(); + dimAgencyEntity.setAgencyName(agency.getOrganizationName()); + dimAgencyEntity.setAllParentName(agency.getAllParentName()); + dimAgencyEntity.setCustomerId(agency.getCustomerId()); + dimAgencyEntity.setLevel(agency.getLevel()); + dimAgencyEntity.setPid(agency.getId()); + dimAgencyEntity.setAgencyDimType(DimAgencyConstant.TYPE_SELF); + dimAgencyEntity.setPids(agency.getPids().concat(":").concat(agency.getId())); + dimAgencyEntity.setCreatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setUpdatedBy(RobotConstant.DIMENSION_ROBOT); + dimAgencyEntity.setId(agency.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); + baseDao.insert(dimAgencyEntity); + } + /** * @Description 查询所有机关以及它下级机关的信息 * @param diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql new file mode 100644 index 0000000000..9f1554015e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/db/migration/V0.0.2__dim_ag_add_col_type.sql @@ -0,0 +1 @@ +ALTER TABLE dim_agency ADD COLUMN AGENCY_DIM_TYPE VARCHAR(10) NOT NULL COMMENT '机关维度类型。self:机关本身自己,all:机关自己+下级+网格+部门等'; \ No newline at end of file From 393ca7b4b4f62c7ff38a1f83c3fb6b6f030a6171 Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Mon, 22 Jun 2020 18:02:59 +0800 Subject: [PATCH 078/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--?= =?UTF-8?q?=E4=B8=89=E4=B8=AANEI=20=E8=A1=A5=E5=85=85=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 2 - .../FactArticlePublishedAgencyDailyDTO.java | 121 +++++++++++++++++ ...actArticlePublishedDepartmentDailyDTO.java | 121 +++++++++++++++++ .../FactArticlePublishedGridDailyDTO.java | 121 +++++++++++++++++ .../result/FactTagViewedAgencyDailyDTO.java | 126 ++++++++++++++++++ .../result/FactTagViewedAgencyMonthlyDTO.java | 106 +++++++++++++++ .../FactTagViewedAgencyQuarterlyDTO.java | 106 +++++++++++++++ .../result/FactTagViewedAgencyYearlyDTO.java | 106 +++++++++++++++ .../dto/result/FactTagViewedGridDailyDTO.java | 126 ++++++++++++++++++ .../result/FactTagViewedGridMonthlyDTO.java | 106 +++++++++++++++ .../result/FactTagViewedGridQuarterlyDTO.java | 106 +++++++++++++++ .../result/FactTagViewedGridYearlyDTO.java | 106 +++++++++++++++ .../epmet/feign/EpmetUserOpenFeignClient.java | 2 +- 13 files changed, 1252 insertions(+), 3 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index 29fcae0a44..a7c4228a85 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -175,8 +175,6 @@ lb://resi-voice-server - lb://data-report-server - diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java new file mode 100644 index 0000000000..8aa0274eab --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章发布数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactArticlePublishedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java new file mode 100644 index 0000000000..63dcdf8194 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章发布数量【部门】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactArticlePublishedDepartmentDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布文章单位所属机关ID 发布文章单位所属机关ID + */ + private String agencyId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java new file mode 100644 index 0000000000..ef9441018c --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章发布数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactArticlePublishedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 发布单位所属机关ID 发布单位所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 文章累计发文数量 文章数量 + */ + private Integer articleTotalCount; + + /** + * 当前发文数量 当前未下线的文章数量 + */ + private Integer articlePublishedCount; + + /** + * 日期ID 日期ID + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java new file mode 100644 index 0000000000..f9bb58d4ed --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java @@ -0,0 +1,126 @@ +/** + * 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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java new file mode 100644 index 0000000000..9e66642afb --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java new file mode 100644 index 0000000000..b5e845f6f8 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java new file mode 100644 index 0000000000..9f420f6b37 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【机关】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedAgencyYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 上级机关ID 上级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java new file mode 100644 index 0000000000..d34da43745 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java @@ -0,0 +1,126 @@ +/** + * 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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 + */ + private String dateId; + + /** + * 周ID 周ID eg:2020W01 = 2020年第一周 + */ + private String weekId; + + /** + * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java new file mode 100644 index 0000000000..a1c6e3209d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 + */ + private String monthId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java new file mode 100644 index 0000000000..10b049d10f --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】季度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridQuarterlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 + */ + private String quarterId; + + /** + * 删除状态 + */ + 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java new file mode 100644 index 0000000000..2864b508de --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.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.publicity.dto.result; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 文章引用标签阅读数量【网格】年度统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-19 + */ +@Data +public class FactTagViewedGridYearlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID ID + */ + private String id; + + /** + * 客户ID 客户ID + */ + private String customerId; + + /** + * 文章发布所属机关ID 文章发布所属机关ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 标签ID 标签ID + */ + private String tagId; + + /** + * 标签名称 标签名称 + */ + private String tagName; + + /** + * 文章引用标签阅读数 文章引用标签阅读数 + */ + private Integer tagReadCount; + + /** + * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 + */ + private String yearId; + + /** + * 删除状态 + */ + 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-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java index 51bece6d52..c8c1848738 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/feign/EpmetUserOpenFeignClient.java @@ -24,7 +24,7 @@ import java.util.List; * @author yinzuomei@elink-cn.com * @date 2020/6/4 13:09 */ -@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class,url="localhost:8087") +@FeignClient(name = ServiceConstant.EPMET_USER_SERVER, fallback = EpmetUserOpenFeignClientFallback.class) public interface EpmetUserOpenFeignClient { /** From 64908fe9252e37ae66de12a100a85efcf0b6a499 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Mon, 22 Jun 2020 18:11:31 +0800 Subject: [PATCH 079/101] =?UTF-8?q?job=E5=AE=9A=E6=97=B6=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E5=92=8C=E7=BB=9F=E8=AE=A1=E6=9C=8D=E5=8A=A1=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-gateway/pom.xml | 10 ++++++++++ epmet-gateway/src/main/resources/bootstrap.yml | 9 +++++++++ .../java/com/epmet/task/StatsGroupAgencyDailyTask.java | 2 ++ .../com/epmet/task/StatsGroupAgencyMonthlyTask.java | 2 ++ .../java/com/epmet/task/StatsGroupGridDailyTask.java | 2 ++ 5 files changed, 25 insertions(+) diff --git a/epmet-gateway/pom.xml b/epmet-gateway/pom.xml index a7c4228a85..354c47f3ea 100644 --- a/epmet-gateway/pom.xml +++ b/epmet-gateway/pom.xml @@ -175,6 +175,12 @@ lb://resi-voice-server + + lb://data-report-server + + + lb://data-statistical-server + @@ -251,6 +257,10 @@ lb://gov-voice-server lb://resi-voice-server + + lb://data-report-server + + lb://data-statistical-server diff --git a/epmet-gateway/src/main/resources/bootstrap.yml b/epmet-gateway/src/main/resources/bootstrap.yml index f8a8c8f75b..f67bd8fdec 100644 --- a/epmet-gateway/src/main/resources/bootstrap.yml +++ b/epmet-gateway/src/main/resources/bootstrap.yml @@ -268,6 +268,15 @@ spring: filters: - StripPrefix=1 - CpAuth=true + #统计服务 + - id: data-statistical-server + uri: @gateway.routes.data-statistical-server.uri@ + order: 29 + predicates: + - Path=${server.servlet.context-path}/data/stats/** + filters: + - StripPrefix=1 + - CpAuth=true nacos: discovery: server-addr: @nacos.server-addr@ diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java index fb754ac396..99f2d1739a 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyDailyTask.java @@ -5,6 +5,7 @@ import com.epmet.service.StatsGroupService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; /** * @Author zxc @@ -12,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; * * 统计 “网格小组”, dim:【机关-日】 */ +@Component("statsGroupAgencyDailyTask") public class StatsGroupAgencyDailyTask implements ITask { @Autowired diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java index dd4fcc2d2f..bcd59c4047 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupAgencyMonthlyTask.java @@ -5,6 +5,7 @@ import com.epmet.service.StatsGroupService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; /** * @Author zxc @@ -12,6 +13,7 @@ import org.springframework.beans.factory.annotation.Autowired; * * 统计 “网格小组”, dim:【机关-日】 */ +@Component("statsGroupAgencyMonthlyTask") public class StatsGroupAgencyMonthlyTask implements ITask { @Autowired diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java index 2b1271eb81..675c63ea88 100644 --- a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsGroupGridDailyTask.java @@ -5,6 +5,7 @@ import com.epmet.service.StatsGroupService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; /** * @Author zxc @@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; * 统计 “网格小组”, dim:【网格-日】 * */ +@Component("statsGroupGridDailyTask") public class StatsGroupGridDailyTask implements ITask { @Autowired From 1cceb8cb0e6aca65b26b0c4dc6135e628983a872 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Jun 2020 18:11:31 +0800 Subject: [PATCH 080/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4v1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constant/DataReportModuleConstant.java | 22 +++++++++ .../user/result/UserSummaryInfoResultDTO.java | 27 ++++++++++- .../{module/user => }/controller/.gitignore | 0 .../epmet/{module/user => }/dao/.gitignore | 0 .../com/epmet/dao/user/UserAnalysisDao.java | 32 +++++++++++++ .../{module/user => }/service/.gitignore | 0 .../resources/mapper/user/UserAnalysisDao.xml | 46 +++++++++++++++++++ 7 files changed, 125 insertions(+), 2 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataReportModuleConstant.java rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/user => }/controller/.gitignore (100%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/user => }/dao/.gitignore (100%) create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/user => }/service/.gitignore (100%) create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataReportModuleConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataReportModuleConstant.java new file mode 100644 index 0000000000..09a81ccbb4 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataReportModuleConstant.java @@ -0,0 +1,22 @@ +package com.epmet.constant; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 16:35 + */ +public interface DataReportModuleConstant { + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + String REG_FLAG="reg"; + + /** + * reg:注册居民 parti:参与用户,如果值为null,默认为reg + */ + String PARTI_FLAG="parti"; + + String QUERY_USER_AGENCY_FAILED="查询用户所属机关信息失败"; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java index f745321971..f44d5ec054 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * 用户汇总信息 返参DTO @@ -38,17 +39,39 @@ public class UserSummaryInfoResultDTO implements Serializable { * 党员占比 */ private String partymemberProportion; - /** * 热心居民数 */ - private String warmHeartedTotal; + private Integer warmHeartedTotal; /** * 热心居民占比 */ private String warmHeartedProportion; + @JsonIgnore + private BigDecimal partymemberProportionValue; + + @JsonIgnore + private BigDecimal warmHeartedProportionValue; + @JsonIgnore private String id; + + public UserSummaryInfoResultDTO(){ + this.currentDate=""; + this.regTotal=0; + this.partiTotal=0; + this.partymemberTotal=0; + this.partymemberProportion="0%"; + this.warmHeartedTotal=0; + this.warmHeartedProportion="0%"; + this.id=""; + } + + public static void main(String[] args) { + StringBuffer s=new StringBuffer("20190305").insert(4,".").insert(7,"."); + System.out.println(s); + + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/.gitignore diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/dao/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/.gitignore diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java new file mode 100644 index 0000000000..e42caca3b9 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java @@ -0,0 +1,32 @@ +package com.epmet.dao.user; + + +import com.epmet.user.result.UserSummaryInfoResultDTO; +import org.apache.ibatis.annotations.Mapper; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 16:33 + */ +@Mapper +public interface UserAnalysisDao { + /** + * @param myAgencyId + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 查询注册用户汇总信息 + * @Date 2020/6/22 16:52 + **/ + UserSummaryInfoResultDTO selectRegUserSummaryInfo(String myAgencyId); + + /** + * @param myAgencyId + * @return com.epmet.user.result.UserSummaryInfoResultDTO + * @author yinzuomei + * @description 查询注册用户的汇总信息 + * @Date 2020/6/22 16:52 + **/ + UserSummaryInfoResultDTO selectParticipationUserSummaryInfo(String myAgencyId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/.gitignore rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/.gitignore diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml new file mode 100644 index 0000000000..a1bc581a7c --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -0,0 +1,46 @@ + + + + + + + + + + \ No newline at end of file From 00b298ecfb299fb796158a6fc655a7baf12104e3 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Mon, 22 Jun 2020 18:12:19 +0800 Subject: [PATCH 081/101] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=9C=BA=E5=85=B3?= =?UTF-8?q?=E7=BB=B4=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/stats/DimAgencyDao.xml | 3 +++ 1 file changed, 3 insertions(+) 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 ac14010373..5869a269a6 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 @@ -22,6 +22,7 @@ dim_agency WHERE del_flag = '0' + AND AGENCY_DIM_TYPE = 'all' AND customer_id = #{customerId} @@ -119,6 +120,7 @@ WHERE DEL_FLAG = '0' AND CUSTOMER_ID = #{customerId,jdbcType=VARCHAR} + AND AGENCY_DIM_TYPE = 'all' @@ -234,6 +236,7 @@ dim_agency WHERE del_flag = '0' + AND AGENCY_DIM_TYPE = 'all' AND customer_id = #{customerId} From 046627570868fa4c6e45c45616246dd2c06853ee Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Jun 2020 18:13:52 +0800 Subject: [PATCH 082/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4v2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/UserAnalysisController.java} | 8 ++--- .../user/UserAnalysisService.java} | 4 +-- .../user/impl/UserAnalysisServiceImpl.java} | 30 ++++++++++++++----- 3 files changed, 28 insertions(+), 14 deletions(-) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/user/controller/UserController.java => controller/user/UserAnalysisController.java} (95%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/user/service/UserService.java => service/user/UserAnalysisService.java} (95%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/user/service/impl/UserServiceImpl.java => service/user/impl/UserAnalysisServiceImpl.java} (68%) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java similarity index 95% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java index 795d3cd8b9..7ac47ba233 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/controller/UserController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java @@ -1,8 +1,8 @@ -package com.epmet.module.user.controller; +package com.epmet.controller.user; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.module.user.service.UserService; +import com.epmet.service.user.UserAnalysisService; import com.epmet.user.form.UserIncrTrendFormDTO; import com.epmet.user.form.UserSubAgencyFormDTO; import com.epmet.user.form.UserSubGridFormDTO; @@ -25,9 +25,9 @@ import org.springframework.web.bind.annotation.RestController; */ @RestController @RequestMapping("user") -public class UserController { +public class UserAnalysisController { @Autowired - private UserService userService; + private UserAnalysisService userService; /** * @param formDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java similarity index 95% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java index 4d0f812b72..b01bd97dd1 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/UserService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java @@ -1,4 +1,4 @@ -package com.epmet.module.user.service; +package com.epmet.service.user; import com.epmet.user.form.UserIncrTrendFormDTO; import com.epmet.user.form.UserSubAgencyFormDTO; @@ -15,7 +15,7 @@ import com.epmet.user.result.UserSummaryInfoResultDTO; * @author yinzuomei@elink-cn.com * @date 2020/6/22 13:23 */ -public interface UserService { +public interface UserAnalysisService { /** * @param formDTO * @return com.epmet.user.result.UserSummaryInfoResultDTO diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java similarity index 68% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index c155265090..706a5e6d63 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/user/service/impl/UserServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -1,12 +1,14 @@ -package com.epmet.module.user.service.impl; +package com.epmet.service.user.impl; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; +import com.epmet.constant.DataReportModuleConstant; +import com.epmet.dao.user.UserAnalysisDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.module.user.service.UserService; +import com.epmet.service.user.UserAnalysisService; import com.epmet.user.form.UserIncrTrendFormDTO; import com.epmet.user.form.UserSubAgencyFormDTO; import com.epmet.user.form.UserSubGridFormDTO; @@ -28,12 +30,14 @@ import org.springframework.stereotype.Service; * @date 2020/6/22 13:23 */ @Service -public class UserServiceImpl implements UserService { - private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); +public class UserAnalysisServiceImpl implements UserAnalysisService { + private static final Logger logger = LoggerFactory.getLogger(UserAnalysisServiceImpl.class); @Autowired private LoginUserUtil loginUserUtil; @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; + @Autowired + private UserAnalysisDao userAnalysisDao; /** * @return java.lang.String @@ -49,11 +53,11 @@ public class UserServiceImpl implements UserService { loginUserDetailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); Result result=epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); if(!result.success()){ - throw new RenException("查询用户所属组织信息失败"); + throw new RenException(DataReportModuleConstant.QUERY_USER_AGENCY_FAILED); } if(result.success()){ if (null == result.getData() || StringUtils.isBlank(result.getData().getAgencyId())) { - throw new RenException("查询用户所属组织信息失败"); + throw new RenException(DataReportModuleConstant.QUERY_USER_AGENCY_FAILED); } } return result.getData().getAgencyId(); @@ -67,9 +71,19 @@ public class UserServiceImpl implements UserService { **/ @Override public UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO) { + UserSummaryInfoResultDTO userSummaryInfoResultDTO=new UserSummaryInfoResultDTO(); String myAgencyId=this.getMyAgency(); - //TODO - return null; + if(DataReportModuleConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())){ + userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); + }else{ + userSummaryInfoResultDTO=userAnalysisDao.selectParticipationUserSummaryInfo(myAgencyId); + } + if(StringUtils.isNotBlank(userSummaryInfoResultDTO.getCurrentDate())&&userSummaryInfoResultDTO.getCurrentDate().length()==8){ + userSummaryInfoResultDTO.setCurrentDate(String.valueOf(new StringBuffer(userSummaryInfoResultDTO.getCurrentDate()).insert(4,".").insert(7,"."))); + } + userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); + userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); + return userSummaryInfoResultDTO; } /** From 7b546e3185bf0dfd98fba5d3d9e7675ba7ac863f Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Mon, 22 Jun 2020 18:17:59 +0800 Subject: [PATCH 083/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E8=87=AA=E6=B5=8B=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/constant/ProjectConstant.java | 4 ++++ .../result/ProjectSummaryInfoResultDTO.java | 4 ++++ .../dto/result/ProjectSummaryResultDTO.java | 12 +++++++--- .../project/controller/ProjectController.java | 7 +++++- .../service/impl/ProjectServiceImpl.java | 10 ++++---- .../resources/mapper/project/ProjectDao.xml | 23 +++++++++++-------- 6 files changed, 41 insertions(+), 19 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java index 7a50f4afb0..d3c8d8bf1c 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/constant/ProjectConstant.java @@ -13,5 +13,9 @@ public interface ProjectConstant { * 根据Token获取组织信息失败 */ String GET_AGENCYID = "根据Token获取组织信息失败"; + /** + * 参数异常 + */ + String TYPE_EXCEPTION = "必要参数为空或参数格式错误"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java index e371fce1f5..b2b5c7d39b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryInfoResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.project.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * @Author sun @@ -26,6 +28,8 @@ public class ProjectSummaryInfoResultDTO implements Serializable { /** * 类型对应百分比(10% 10.1% 10.01%小数点后两位) */ + @JsonIgnore + private BigDecimal ratioInt; private String ratio; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java index 0223644b78..220780be29 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/project/dto/result/ProjectSummaryResultDTO.java @@ -1,8 +1,10 @@ package com.epmet.project.dto.result; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; +import java.math.BigDecimal; /** * @Author sun @@ -36,15 +38,19 @@ public class ProjectSummaryResultDTO implements Serializable { /** * 处理中占比 */ - private String pendingRatio; + @JsonIgnore + private BigDecimal pendingRatioInt; + private String pendingRatio; /** * 已结案总数 */ - private Integer closedTotal; + private Integer closedTotal; /** * 已结案占比 */ - private String closedRatio; + @JsonIgnore + private BigDecimal closedRatioInt; + private String closedRatio; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java index e0a1e26fb3..5a96496ef6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java @@ -1,10 +1,12 @@ package com.epmet.module.project.controller; import com.epmet.commons.tools.annotation.LoginUser; +import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.module.project.service.ProjectService; +import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.form.ProjectIncrTrendFormDTO; import com.epmet.project.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; @@ -70,7 +72,10 @@ public class ProjectController { @PostMapping("incrtrend") public Result> incrTrend(@LoginUser TokenDto tokenDto, @RequestBody ProjectIncrTrendFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO, ProjectIncrTrendFormDTO.ProjectIncr.class); - return new Result>().ok(projectService.getProjectIncrTrend(tokenDto,formDTO)); + if (!ProjectConstant.DATE.equals(formDTO.getType()) && !ProjectConstant.MONTH.equals(formDTO.getType())) { + throw new RenException(ProjectConstant.TYPE_EXCEPTION); + } + return new Result>().ok(projectService.getProjectIncrTrend(tokenDto, formDTO)); } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java index 502f613d1c..988f587d30 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java @@ -43,8 +43,8 @@ public class ProjectServiceImpl implements ProjectService { //2:根据agencyId查询项目统计数据 ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId); if (null != resultDTO) { - resultDTO.setPendingRatio(resultDTO.getPendingRatio() + "%"); - resultDTO.setClosedRatio(resultDTO.getClosedRatio() + "%"); + resultDTO.setPendingRatio(resultDTO.getPendingRatioInt().stripTrailingZeros().toString() + "%"); + resultDTO.setClosedRatio(resultDTO.getClosedRatioInt().stripTrailingZeros().toString() + "%"); } return resultDTO; } @@ -63,7 +63,7 @@ public class ProjectServiceImpl implements ProjectService { resultList = projectDao.selectSummaryInfo(agencyId); if (null != resultList && resultList.size() > NumConstant.ZERO) { resultList.forEach(sum -> { - sum.setRatio(sum.getRatio() + "%"); + sum.setRatio(sum.getRatioInt().stripTrailingZeros().toString() + "%"); }); } return resultList; @@ -120,7 +120,7 @@ public class ProjectServiceImpl implements ProjectService { String agencyId = getLoginUserDetails(tokenDto); //2:查询机关过去九十天日统计数据(sql降序取前九十条) - if (ProjectConstant.DATE.equals(formDTO.getType())){ + if (ProjectConstant.DATE.equals(formDTO.getType())) { resultList = projectDao.selectIncrTrendDaily(agencyId); } @@ -129,7 +129,7 @@ public class ProjectServiceImpl implements ProjectService { resultList = projectDao.selectIncrTrendMonthly(agencyId); } - return null; + return resultList; } /** diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index ac9ecd9ad6..12cd3897fb 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -10,9 +10,10 @@ project_total AS "projectTotal", DATE_FORMAT(date_id, '%Y.%m.%d') AS "dateName", pending_total AS "pendingTotal", - CAST(pending_ratio AS DECIMAL (9, 2)) AS "pendingRatio", + /*CAST(pending_ratio AS DECIMAL (9, 2)) AS "pendingRatioInt",*/ + pending_ratio AS "pendingRatioInt", closed_total AS "closedTotal", - CAST(closed_ratio AS DECIMAL(9, 2)) AS "closedRatio" + closed_ratio AS "closedRatioInt" FROM fact_agency_project_daily WHERE @@ -27,7 +28,7 @@ SELECT "处理中" AS "name", pending_total AS "value", - CAST(PENDING_RATIO AS DECIMAL (9, 2)) AS "ratio" + pending_ratio AS "ratioInt" FROM fact_agency_project_daily WHERE @@ -42,7 +43,7 @@ SELECT "已结案" AS "name", closed_total AS "value", - CAST(closed_ratio AS DECIMAL(9, 2)) AS "ratio" + closed_ratio AS "ratioInt" FROM fact_agency_project_daily WHERE @@ -159,9 +160,10 @@ SELECT * FROM( ( SELECT - DATE_FORMAT(DATE_ID, "%Y/%m/%d") AS "date", - PENDING_INCR AS "value", - "处理中" AS "type" + DATE_FORMAT(date_id, "%Y/%m/%d") AS "date", + pending_incr AS "value", + "处理中" AS "type", + date_id FROM fact_agency_project_daily WHERE @@ -174,9 +176,10 @@ UNION ALL ( SELECT - DATE_FORMAT(DATE_ID, "%Y/%m/%d") AS "date", - CLOSED_INCR AS "value", - "已结案" AS "type" + DATE_FORMAT(date_id, "%Y/%m/%d") AS "date", + closed_incr AS "value", + "已结案" AS "type", + date_id FROM fact_agency_project_daily WHERE From 75f89ab18520b1160bd1168402749687194120b9 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Jun 2020 18:25:58 +0800 Subject: [PATCH 084/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4v3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...onstant.java => UserAnalysisConstant.java} | 2 +- .../com/epmet/{user => dto/form}/.gitignore | 0 .../form/user}/UserIncrTrendFormDTO.java | 2 +- .../form/user}/UserSubAgencyFormDTO.java | 2 +- .../form/user}/UserSubGridFormDTO.java | 2 +- .../form/user}/UserSummaryInfoFormDTO.java | 2 +- .../main/java/com/epmet/dto/result/.gitignore | 0 .../result/user}/UserIncrTrendResultDTO.java | 2 +- .../result/user}/UserSubAgencyResultDTO.java | 2 +- .../result/user}/UserSubGridResultDTO.java | 2 +- .../user}/UserSummaryInfoResultDTO.java | 2 +- .../user/UserAnalysisController.java | 16 ++++----- .../com/epmet/dao/user/UserAnalysisDao.java | 2 +- .../service/user/UserAnalysisService.java | 17 +++++----- .../user/impl/UserAnalysisServiceImpl.java | 34 +++++++++++-------- .../resources/mapper/user/UserAnalysisDao.xml | 5 +-- 16 files changed, 49 insertions(+), 43 deletions(-) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/{DataReportModuleConstant.java => UserAnalysisConstant.java} (91%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user => dto/form}/.gitignore (100%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/form => dto/form/user}/UserIncrTrendFormDTO.java (95%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/form => dto/form/user}/UserSubAgencyFormDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/form => dto/form/user}/UserSubGridFormDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/form => dto/form/user}/UserSummaryInfoFormDTO.java (94%) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/.gitignore rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/result => dto/result/user}/UserIncrTrendResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/result => dto/result/user}/UserSubAgencyResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/result => dto/result/user}/UserSubGridResultDTO.java (94%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/{user/result => dto/result/user}/UserSummaryInfoResultDTO.java (97%) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataReportModuleConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java similarity index 91% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataReportModuleConstant.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java index 09a81ccbb4..9041875b52 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/DataReportModuleConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java @@ -6,7 +6,7 @@ package com.epmet.constant; * @author yinzuomei@elink-cn.com * @date 2020/6/22 16:35 */ -public interface DataReportModuleConstant { +public interface UserAnalysisConstant { /** * reg:注册居民 parti:参与用户,如果值为null,默认为reg diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/.gitignore similarity index 100% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/.gitignore rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/.gitignore diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java similarity index 95% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java index 3267d88ac7..f4496d0199 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserIncrTrendFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserIncrTrendFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.form; +package com.epmet.dto.form.user; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java index 1116bc33b0..5f7f22b089 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubAgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.form; +package com.epmet.dto.form.user; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java index 6a19060ae5..81e54c8756 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSubGridFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.form; +package com.epmet.dto.form.user; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java index 3a25b4ac24..9b8bed1c07 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/form/UserSummaryInfoFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSummaryInfoFormDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.form; +package com.epmet.dto.form.user; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/.gitignore b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java index 38436e3533..d36d7aba03 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserIncrTrendResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.result; +package com.epmet.dto.result.user; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java index f1552b799c..38969b9199 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubAgencyResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.result; +package com.epmet.dto.result.user; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java similarity index 94% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java index bf0df3cd4e..493f6ebc98 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSubGridResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.result; +package com.epmet.dto.result.user; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java similarity index 97% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java index f44d5ec054..ccbcb009ed 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/user/result/UserSummaryInfoResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSummaryInfoResultDTO.java @@ -1,4 +1,4 @@ -package com.epmet.user.result; +package com.epmet.dto.result.user; import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java index 7ac47ba233..2855f60a7f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java @@ -2,15 +2,15 @@ package com.epmet.controller.user; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.dto.form.user.UserIncrTrendFormDTO; +import com.epmet.dto.form.user.UserSubAgencyFormDTO; +import com.epmet.dto.form.user.UserSubGridFormDTO; +import com.epmet.dto.form.user.UserSummaryInfoFormDTO; +import com.epmet.dto.result.user.UserIncrTrendResultDTO; +import com.epmet.dto.result.user.UserSubAgencyResultDTO; +import com.epmet.dto.result.user.UserSubGridResultDTO; +import com.epmet.dto.result.user.UserSummaryInfoResultDTO; import com.epmet.service.user.UserAnalysisService; -import com.epmet.user.form.UserIncrTrendFormDTO; -import com.epmet.user.form.UserSubAgencyFormDTO; -import com.epmet.user.form.UserSubGridFormDTO; -import com.epmet.user.form.UserSummaryInfoFormDTO; -import com.epmet.user.result.UserIncrTrendResultDTO; -import com.epmet.user.result.UserSubAgencyResultDTO; -import com.epmet.user.result.UserSubGridResultDTO; -import com.epmet.user.result.UserSummaryInfoResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java index e42caca3b9..80ac956bf4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java @@ -1,7 +1,7 @@ package com.epmet.dao.user; -import com.epmet.user.result.UserSummaryInfoResultDTO; +import com.epmet.dto.result.user.UserSummaryInfoResultDTO; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java index b01bd97dd1..7f99be9033 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java @@ -1,13 +1,14 @@ package com.epmet.service.user; -import com.epmet.user.form.UserIncrTrendFormDTO; -import com.epmet.user.form.UserSubAgencyFormDTO; -import com.epmet.user.form.UserSubGridFormDTO; -import com.epmet.user.form.UserSummaryInfoFormDTO; -import com.epmet.user.result.UserIncrTrendResultDTO; -import com.epmet.user.result.UserSubAgencyResultDTO; -import com.epmet.user.result.UserSubGridResultDTO; -import com.epmet.user.result.UserSummaryInfoResultDTO; + +import com.epmet.dto.form.user.UserIncrTrendFormDTO; +import com.epmet.dto.form.user.UserSubAgencyFormDTO; +import com.epmet.dto.form.user.UserSubGridFormDTO; +import com.epmet.dto.form.user.UserSummaryInfoFormDTO; +import com.epmet.dto.result.user.UserIncrTrendResultDTO; +import com.epmet.dto.result.user.UserSubAgencyResultDTO; +import com.epmet.dto.result.user.UserSubGridResultDTO; +import com.epmet.dto.result.user.UserSummaryInfoResultDTO; /** * 组织能力用户相关接口 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index 706a5e6d63..9291f7bd27 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -1,22 +1,23 @@ package com.epmet.service.user.impl; +import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.Result; -import com.epmet.constant.DataReportModuleConstant; +import com.epmet.constant.UserAnalysisConstant; import com.epmet.dao.user.UserAnalysisDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; +import com.epmet.dto.form.user.UserIncrTrendFormDTO; +import com.epmet.dto.form.user.UserSubAgencyFormDTO; +import com.epmet.dto.form.user.UserSubGridFormDTO; +import com.epmet.dto.form.user.UserSummaryInfoFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; +import com.epmet.dto.result.user.UserIncrTrendResultDTO; +import com.epmet.dto.result.user.UserSubAgencyResultDTO; +import com.epmet.dto.result.user.UserSubGridResultDTO; +import com.epmet.dto.result.user.UserSummaryInfoResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.user.UserAnalysisService; -import com.epmet.user.form.UserIncrTrendFormDTO; -import com.epmet.user.form.UserSubAgencyFormDTO; -import com.epmet.user.form.UserSubGridFormDTO; -import com.epmet.user.form.UserSummaryInfoFormDTO; -import com.epmet.user.result.UserIncrTrendResultDTO; -import com.epmet.user.result.UserSubAgencyResultDTO; -import com.epmet.user.result.UserSubGridResultDTO; -import com.epmet.user.result.UserSummaryInfoResultDTO; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -53,11 +54,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { loginUserDetailsFormDTO.setUserId(loginUserUtil.getLoginUserId()); Result result=epmetUserOpenFeignClient.getLoginUserDetails(loginUserDetailsFormDTO); if(!result.success()){ - throw new RenException(DataReportModuleConstant.QUERY_USER_AGENCY_FAILED); + throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED); } if(result.success()){ if (null == result.getData() || StringUtils.isBlank(result.getData().getAgencyId())) { - throw new RenException(DataReportModuleConstant.QUERY_USER_AGENCY_FAILED); + throw new RenException(UserAnalysisConstant.QUERY_USER_AGENCY_FAILED); } } return result.getData().getAgencyId(); @@ -73,7 +74,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { public UserSummaryInfoResultDTO summaryInfo(UserSummaryInfoFormDTO formDTO) { UserSummaryInfoResultDTO userSummaryInfoResultDTO=new UserSummaryInfoResultDTO(); String myAgencyId=this.getMyAgency(); - if(DataReportModuleConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())){ + if(UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())){ userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); }else{ userSummaryInfoResultDTO=userAnalysisDao.selectParticipationUserSummaryInfo(myAgencyId); @@ -81,9 +82,12 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { if(StringUtils.isNotBlank(userSummaryInfoResultDTO.getCurrentDate())&&userSummaryInfoResultDTO.getCurrentDate().length()==8){ userSummaryInfoResultDTO.setCurrentDate(String.valueOf(new StringBuffer(userSummaryInfoResultDTO.getCurrentDate()).insert(4,".").insert(7,"."))); } - userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); - userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); - return userSummaryInfoResultDTO; + if(null!=userSummaryInfoResultDTO){ + userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); + userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); + } + logger.info(String.format("查询用户汇总信息返参%s",JSON.toJSONString(userSummaryInfoResultDTO))); + return userSummaryInfoResultDTO; } /** diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml index a1bc581a7c..246c197fa1 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -3,7 +3,7 @@ - SELECT m.id, m.DATE_ID AS currentDate, @@ -24,7 +24,8 @@ - SELECT m.id, m.DATE_ID AS currentDate, From ea07a7dc7c7917b2db2a212f4c3a85d6e8035dd3 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Jun 2020 18:42:31 +0800 Subject: [PATCH 085/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=E6=9F=A5=E8=AF=A2=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4v4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 20 +++++++++++++++++-- .../user/impl/UserAnalysisServiceImpl.java | 6 +++--- .../resources/mapper/user/UserAnalysisDao.xml | 8 ++++---- 3 files changed, 25 insertions(+), 9 deletions(-) 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 6e2e440f38..482ddd52b3 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 @@ -14,10 +14,12 @@ import org.joda.time.LocalDate; import org.joda.time.format.DateTimeFormat; import org.joda.time.format.DateTimeFormatter; -import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.*; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.List; /** * 日期处理工具类 @@ -362,4 +364,18 @@ public class DateUtils { calendar.add(Calendar.DATE, -1); return calendar.getTime(); } + + /** + * @return java.lang.String + * @param dateStr yyyyMMdd + * @author yinzuomei + * @description 返回yyyy.MM.dd + * @Date 2020/6/22 18:38 + **/ + public static String getDatePointPattern(String dateStr){ + if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==8){ + return String.valueOf(new StringBuffer(dateStr).insert(4,".").insert(7,".")); + } + return dateStr; + } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index 9291f7bd27..4ce17aee57 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -3,6 +3,7 @@ package com.epmet.service.user.impl; import com.alibaba.fastjson.JSON; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.user.LoginUserUtil; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserAnalysisConstant; import com.epmet.dao.user.UserAnalysisDao; @@ -79,10 +80,9 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { }else{ userSummaryInfoResultDTO=userAnalysisDao.selectParticipationUserSummaryInfo(myAgencyId); } - if(StringUtils.isNotBlank(userSummaryInfoResultDTO.getCurrentDate())&&userSummaryInfoResultDTO.getCurrentDate().length()==8){ - userSummaryInfoResultDTO.setCurrentDate(String.valueOf(new StringBuffer(userSummaryInfoResultDTO.getCurrentDate()).insert(4,".").insert(7,"."))); - } if(null!=userSummaryInfoResultDTO){ + userSummaryInfoResultDTO.setCurrentDate(DateUtils.getDatePointPattern(userSummaryInfoResultDTO.getCurrentDate())); + //提取出工具类 userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml index 246c197fa1..982c0526a6 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -10,9 +10,9 @@ m.REG_TOTAL AS regTotal, 0 AS partiTotal, m.PARTYMEMBER_TOTAL AS partymemberTotal, - m.PARTYMEMBER_PROPORTION AS partymemberProportion, + m.PARTYMEMBER_PROPORTION*100 AS partymemberProportion, m.WARM_HEARTED_TOTAL AS warmHeartedTotal, - m.WARM_HEARTED_PROPORTION AS warmHeartedProportion + m.WARM_HEARTED_PROPORTION*100 AS warmHeartedProportion FROM fact_reg_user_agency_daily m WHERE @@ -32,9 +32,9 @@ m.REG_TOTAL AS regTotal, 0 AS partiTotal, m.PARTYMEMBER_TOTAL AS partymemberTotal, - m.PARTYMEMBER_PROPORTION AS partymemberProportion, + m.PARTYMEMBER_PROPORTION*100 AS partymemberProportion, m.WARM_HEARTED_TOTAL AS warmHeartedTotal, - m.WARM_HEARTED_PROPORTION AS warmHeartedProportion + m.WARM_HEARTED_PROPORTION*100 AS warmHeartedProportion FROM fact_participation_user_agency_daily m WHERE From 212ea20a515f704a6c0af55fde5c2ba52a36d147 Mon Sep 17 00:00:00 2001 From: jianjun Date: Mon, 22 Jun 2020 19:06:17 +0800 Subject: [PATCH 086/101] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/StatsPublicityServiceImpl.java | 106 +++++++++++++++--- 1 file changed, 88 insertions(+), 18 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java index baadc98ac0..19d89bbe11 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsPublicityServiceImpl.java @@ -5,6 +5,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.constant.StrConstant; import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.constant.DimAgencyConstant; import com.epmet.constant.ProjectConstant; import com.epmet.dto.voice.ArticleGridPublishedSummaryDTO; import com.epmet.dto.voice.ArticleViewedSummaryDTO; @@ -121,15 +122,15 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { for (String customerId : customerIdList) { Date finalStatsDate = statsDate; - try { - //key:所在机关Id - Map agencySummaryMap = new HashMap<>(); - statsPublishedGridDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); - statsPublishedDepartmentDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); - statsPublishedAgencyDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); - } catch (Exception e) { - log.error("articlePublishedCountDayStats exception", e); - } + try { + //key:所在机关Id + Map agencySummaryMap = new HashMap<>(); + statsPublishedGridDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsPublishedDepartmentDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + statsPublishedAgencyDaily(finalStatsDate, dimIdBean, customerId, agencySummaryMap); + } catch (Exception e) { + log.error("articlePublishedCountDayStats exception", e); + } } } @@ -340,7 +341,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getDepartmentListByCustomerId return empty,customerId:{}", customerId); return; } - executorService.submit(()->{ + executorService.submit(() -> { //转换为 需要插入的Entity Map departmentDailyEntityMap = convertDepartmentDailyEntity(departmentDTOList, dimIdBean); //获取当天的业务数据 @@ -402,7 +403,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getGridListByCustomerId return empty,customerId:{}", customerId); return; } - executorService.submit(()->{ + executorService.submit(() -> { //转换为 需要插入的Entity Map gridDailyEntityMap = convertGridDailyEntity(gridDTOList, dimIdBean); //获取当天的业务数据 @@ -432,12 +433,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { log.warn("publicitySummary getAgencyListByCustomerId return empty,customerId:{}", customerId); return; } - executorService.submit(()->{ + executorService.submit(() -> { //转换为 需要插入的Entity Map agencyDailyEntityMap = convertAgencyDailyEntity(agencyDTOList, dimIdBean); //获取当天的业务数据 List publishedArticleCount = articleService.getAllAgencyPublishedCount(customerId, statsDate); Map haveDataAgencyDailyMap = new HashMap<>(); + Map haveDataAgencyDailySelfMap = new HashMap<>(); if (!CollectionUtils.isEmpty(publishedArticleCount)) { for (ArticleGridPublishedSummaryDTO summaryDTO : publishedArticleCount) { FactArticlePublishedAgencyDailyEntity gridDailyEntities = agencyDailyEntityMap.get(summaryDTO.getPublisherId()); @@ -447,9 +449,17 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } gridDailyEntities.setArticleTotalCount(summaryDTO.getArticleTotalCount()); gridDailyEntities.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); - //同一个机关下数据累加 - buildAgencySummaryData(agencySummaryMap, summaryDTO); haveDataAgencyDailyMap.put(summaryDTO.getAgencyId(), gridDailyEntities); + //同一个机关下数据累加 + //buildAgencySummaryData(agencySummaryMap, summaryDTO); + //构建机关自己的数据 + FactArticlePublishedAgencyDailyEntity selfDaily = ConvertUtils.sourceToTarget(dimIdBean, FactArticlePublishedAgencyDailyEntity.class); + selfDaily.setCustomerId(gridDailyEntities.getCustomerId()); + selfDaily.setPid(gridDailyEntities.getPid()); + selfDaily.setAgencyId(summaryDTO.getAgencyId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX)); + selfDaily.setArticleTotalCount(summaryDTO.getArticleTotalCount()); + selfDaily.setArticlePublishedCount(summaryDTO.getArticlePublishedCount()); + haveDataAgencyDailySelfMap.put(selfDaily.getAgencyId(), selfDaily); } } //数据向上级机关添加 @@ -465,7 +475,10 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { setPublishedData2ParentAgency(agencyDailyEntityMap, summary, dailyEntity); } } - + //将机关本身的数据插入 + if (!CollectionUtils.isEmpty(haveDataAgencyDailySelfMap)) { + agencyDailyEntityMap.putAll(haveDataAgencyDailySelfMap); + } boolean b = factArticlePublishedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), agencyDailyEntityMap.values()); }); @@ -495,6 +508,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { Map tagUsedGridDailyMap = new HashMap<>(); Map tagUsedDeptDailyMap = new HashMap<>(); Map tagUsedAgencyDailyMap = new HashMap<>(); + Map tagUsedAgencyDailySelfMap = new HashMap<>(); //获取当天的业务数据 //1获取文章及机关id,网格Id List publishedArticleList = articleService.getPublishedArticleByPublishTime(customerId, statsDate); @@ -528,7 +542,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { convertTagUsedDepartmentDailyEntity(tagUsedDeptDailyMap, articleEntity, tagEntity, dimIdBean); break; case ProjectConstant.PUBLISHER_TYPE_AGENCY: - convertTagUsedAgencyDailyEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailyMap, articleEntity, tagEntity, dimIdBean); + convertTagUsedAgencyDailySelfEntity(dimAgencyEntity.getPid(), tagUsedAgencyDailySelfMap, articleEntity, tagEntity, dimIdBean); break; } } @@ -581,6 +595,7 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { //转换为 需要插入的Entity key gridId_tagId Map tagViewedGridDailyMap = new HashMap<>(); Map tagViewedAgencyDailyMap = new HashMap<>(); + Map tagViewedAgencyDailySelfMap = new HashMap<>(); //获取当天的业务数据 //1获取今天文章的阅读记录数 Date startTime = DateUtils.integrate(statsDate, DateUtils.DATE_PATTERN); @@ -595,6 +610,14 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { if (CollectionUtils.isEmpty(articleTagsList)) { continue; } + ArticleEntity articleEntity = articleService.selectById(viewedSummaryDTO.getArticleId()); + if (articleEntity == null) { + continue; + } + boolean isAgencyPublished = false; + if (ProjectConstant.PUBLISHER_TYPE_AGENCY.equals(articleEntity.getPublisherType())) { + isAgencyPublished = true; + } String gridId = viewedSummaryDTO.getGridId(); DimGridEntity dimGridEntity = dimGridEntityMap.get(gridId); @@ -603,10 +626,13 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { continue; } DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(dimGridEntity.getAgencyId()); - articleTagsList.forEach(articleTag -> { + for (ArticleTagsEntity articleTag : articleTagsList) { convertTagViewedGridDailyEntity(dimAgencyEntity, tagViewedGridDailyMap, articleTag, viewedSummaryDTO, dimIdBean); convertTagViewedAgencyDailyEntity(dimAgencyEntity, tagViewedAgencyDailyMap, articleTag, viewedSummaryDTO, dimIdBean); - }); + if (isAgencyPublished) { + convertTagViewedAgencyDailySelfEntity(dimAgencyEntity, tagViewedAgencyDailySelfMap, articleTag, viewedSummaryDTO, dimIdBean); + } + } } factTagViewedGridDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), tagViewedGridDailyMap.values()); @@ -619,11 +645,15 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { FactTagViewedAgencyDailyEntity currentEntity = entry.getValue(); DimAgencyEntity dimAgencyEntity = dimAgencyEntityMap.get(currentEntity.getAgencyId()); if (dimAgencyEntity == null) { + log.error("dimAgencyEntityMap bizData agencyId:{} not exist in dimAgency", agencyId); continue; } setTagViewedData2ParentAgency(dimAgencyEntityMap, finalTagUsedAgencyDailyMap, currentEntity, dimIdBean); } + if (!CollectionUtils.isEmpty(tagViewedAgencyDailySelfMap)) { + finalTagUsedAgencyDailyMap.putAll(tagViewedAgencyDailySelfMap); + } factTagViewedAgencyDailyService.deleteAndInsertBatch(customerId, dimIdBean.getDateId(), finalTagUsedAgencyDailyMap.values()); } @@ -969,6 +999,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { } } + private void convertTagUsedAgencyDailySelfEntity(String pid, Map result, ArticleEntity articleEntity, ArticleTagsEntity tagEntity, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = articleEntity.getOrgId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + FactTagUsedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagUsedAgencyDailyEntity.class); + entity.setPid(pid); + entity.setCustomerId(articleEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setUsedCount(1); + result.put(key, entity); + } else { + entity.setUsedCount(entity.getUsedCount() + 1); + } + } + private void convertTagViewedGridDailyEntity(DimAgencyEntity dimAgencyEntity, Map result, ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { String gridId = viewedSummaryDTO.getGridId(); @@ -1010,4 +1059,25 @@ public class StatsPublicityServiceImpl implements StatsPublicityService { entity.setTagReadCount(entity.getTagReadCount() + viewedCount); } } + + private void convertTagViewedAgencyDailySelfEntity(DimAgencyEntity dimAgencyEntity, Map result, + ArticleTagsEntity tagEntity, ArticleViewedSummaryDTO viewedSummaryDTO, DimIdGenerator.DimIdBean dimIdBean) { + String agencyId = dimAgencyEntity.getId().concat(DimAgencyConstant.TYPE_SELF_ID_SUFFIX); + String tagId = tagEntity.getTagId(); + String key = agencyId.concat(StrConstant.UNDER_LINE).concat(tagId); + Integer viewedCount = viewedSummaryDTO.getViewedCount() == null ? 0 : viewedSummaryDTO.getViewedCount(); + FactTagViewedAgencyDailyEntity entity = result.get(key); + if (entity == null) { + entity = ConvertUtils.sourceToTarget(dimIdBean, FactTagViewedAgencyDailyEntity.class); + entity.setPid(dimAgencyEntity.getPid()); + entity.setCustomerId(tagEntity.getCustomerId()); + entity.setAgencyId(agencyId); + entity.setTagId(tagId); + entity.setTagName(tagEntity.getTagName()); + entity.setTagReadCount(viewedCount); + result.put(key, entity); + } else { + entity.setTagReadCount(entity.getTagReadCount() + viewedCount); + } + } } From cb5d8bfbf508f945b29934ca238a23a3a5aec7f9 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 22 Jun 2020 21:35:22 +0800 Subject: [PATCH 087/101] =?UTF-8?q?1.=E5=8C=85=E5=B1=82=E7=BA=A7=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-report/data-report-server/pom.xml | 2 +- .../group}/GroupController.java | 2 +- .../issue}/IssueController.java | 4 ++-- .../project}/ProjectController.java | 0 .../publicity}/PublicityController.java | 5 ++--- .../topic}/TopicController.java | 4 ++-- .../{module/group/dao => dao/group}/GroupDao.java | 2 +- .../{module/issue/dao => dao/issue}/IssueDao.java | 2 +- .../project/dao => dao/project}/ProjectDao.java | 2 +- .../FactArticlePublishedAgencyDailyDao.java | 4 ++-- .../FactArticlePublishedDepartmentDailyDao.java | 4 ++-- .../publicity}/FactArticlePublishedGridDailyDao.java | 4 ++-- .../publicity}/FactTagUsedAgencyMonthlyDao.java | 2 +- .../publicity}/FactTagUsedAgencyQuarterlyDao.java | 2 +- .../publicity}/FactTagUsedAgencyYearlyDao.java | 2 +- .../publicity}/FactTagViewedAgencyDailyDao.java | 4 ++-- .../publicity}/FactTagViewedAgencyMonthlyDao.java | 2 +- .../publicity}/FactTagViewedAgencyQuarterlyDao.java | 2 +- .../publicity}/FactTagViewedAgencyYearlyDao.java | 2 +- .../publicity}/FactTagViewedGridDailyDao.java | 4 ++-- .../publicity}/FactTagViewedGridMonthlyDao.java | 4 ++-- .../publicity}/FactTagViewedGridQuarterlyDao.java | 4 ++-- .../publicity}/FactTagViewedGridYearlyDao.java | 4 ++-- .../{module/topic/dao => dao/topic}/TopicDao.java | 2 +- .../FactArticlePublishedAgencyDailyEntity.java | 2 +- .../FactArticlePublishedDepartmentDailyEntity.java | 2 +- .../FactArticlePublishedGridDailyEntity.java | 2 +- .../publicity}/FactTagViewedAgencyDailyEntity.java | 2 +- .../publicity}/FactTagViewedAgencyMonthlyEntity.java | 2 +- .../FactTagViewedAgencyQuarterlyEntity.java | 2 +- .../publicity}/FactTagViewedAgencyYearlyEntity.java | 2 +- .../publicity}/FactTagViewedGridDailyEntity.java | 2 +- .../publicity}/FactTagViewedGridMonthlyEntity.java | 2 +- .../publicity}/FactTagViewedGridQuarterlyEntity.java | 2 +- .../publicity}/FactTagViewedGridYearlyEntity.java | 2 +- .../com/epmet/module/issue/controller/.gitignore | 0 .../main/java/com/epmet/module/issue/dao/.gitignore | 0 .../java/com/epmet/module/issue/service/.gitignore | 0 .../com/epmet/module/topic/controller/.gitignore | 0 .../main/java/com/epmet/module/topic/dao/.gitignore | 0 .../java/com/epmet/module/topic/service/.gitignore | 0 .../service => service/group}/GroupService.java | 2 +- .../group}/impl/GroupServiceImpl.java | 6 +++--- .../service => service/issue}/IssueService.java | 2 +- .../issue}/impl/IssueServiceImpl.java | 6 +++--- .../service => service/project}/ProjectService.java | 0 .../project}/impl/ProjectServiceImpl.java | 4 ++-- .../publicity}/PublicityService.java | 2 +- .../publicity}/impl/PublicityServiceImpl.java | 12 ++++++------ .../service => service/topic}/TopicService.java | 2 +- .../topic}/impl/TopicServiceImpl.java | 6 +++--- .../src/main/resources/mapper/group/GroupDao.xml | 2 +- .../src/main/resources/mapper/issue/IssueDao.xml | 2 +- .../src/main/resources/mapper/project/ProjectDao.xml | 2 +- .../publicity/FactArticlePublishedAgencyDailyDao.xml | 4 ++-- .../FactArticlePublishedDepartmentDailyDao.xml | 2 +- .../publicity/FactArticlePublishedGridDailyDao.xml | 2 +- .../mapper/publicity/FactTagViewedAgencyDailyDao.xml | 2 +- .../mapper/publicity/FactTagViewedGridDailyDao.xml | 2 +- .../mapper/publicity/FactTagViewedGridMonthlyDao.xml | 2 +- .../publicity/FactTagViewedGridQuarterlyDao.xml | 2 +- .../mapper/publicity/FactTagViewedGridYearlyDao.xml | 2 +- .../src/main/resources/mapper/topic/TopicDao.xml | 2 +- 63 files changed, 79 insertions(+), 80 deletions(-) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/group/controller => controller/group}/GroupController.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/issue/controller => controller/issue}/IssueController.java (96%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/project/controller => controller/project}/ProjectController.java (100%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/controller => controller/publicity}/PublicityController.java (96%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/topic/controller => controller/topic}/TopicController.java (96%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/group/dao => dao/group}/GroupDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/issue/dao => dao/issue}/IssueDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/project/dao => dao/project}/ProjectDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactArticlePublishedAgencyDailyDao.java (92%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactArticlePublishedDepartmentDailyDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactArticlePublishedGridDailyDao.java (90%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagUsedAgencyMonthlyDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagUsedAgencyQuarterlyDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagUsedAgencyYearlyDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedAgencyDailyDao.java (91%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedAgencyMonthlyDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedAgencyQuarterlyDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedAgencyYearlyDao.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedGridDailyDao.java (91%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedGridMonthlyDao.java (91%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedGridQuarterlyDao.java (91%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/dao => dao/publicity}/FactTagViewedGridYearlyDao.java (91%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/topic/dao => dao/topic}/TopicDao.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactArticlePublishedAgencyDailyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactArticlePublishedDepartmentDailyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactArticlePublishedGridDailyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedAgencyDailyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedAgencyMonthlyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedAgencyQuarterlyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedAgencyYearlyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedGridDailyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedGridMonthlyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedGridQuarterlyEntity.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/entity => entity/publicity}/FactTagViewedGridYearlyEntity.java (98%) delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/.gitignore delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/.gitignore delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/.gitignore delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/.gitignore delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/.gitignore delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/.gitignore rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/group/service => service/group}/GroupService.java (96%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/group/service => service/group}/impl/GroupServiceImpl.java (96%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/issue/service => service/issue}/IssueService.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/issue/service => service/issue}/impl/IssueServiceImpl.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/project/service => service/project}/ProjectService.java (100%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/project/service => service/project}/impl/ProjectServiceImpl.java (98%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/service => service/publicity}/PublicityService.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/publicity/service => service/publicity}/impl/PublicityServiceImpl.java (93%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/topic/service => service/topic}/TopicService.java (97%) rename epmet-module/data-report/data-report-server/src/main/java/com/epmet/{module/topic/service => service/topic}/impl/TopicServiceImpl.java (98%) diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index d0933af706..1797d034a4 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -100,7 +100,7 @@ - + epmet_data_statistical_user EpmEt-db-UsEr diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/GroupController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/GroupController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java index 45ce9164ef..88dd3bb376 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/controller/GroupController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/group/GroupController.java @@ -9,7 +9,7 @@ import com.epmet.group.dto.result.GroupIncrTrendResultDTO; import com.epmet.group.dto.result.GroupSubAgencyResultDTO; import com.epmet.group.dto.result.GroupSubGridResultDTO; import com.epmet.group.dto.result.GroupSummaryInfoResultDTO; -import com.epmet.module.group.service.GroupService; +import com.epmet.service.group.GroupService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java index 39b61b637a..c9fad20ce2 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/IssueController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/issue/IssueController.java @@ -1,11 +1,11 @@ -package com.epmet.module.issue.controller; +package com.epmet.controller.issue; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; import com.epmet.issue.dto.result.*; -import com.epmet.module.issue.service.IssueService; +import com.epmet.service.issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/controller/ProjectController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/project/ProjectController.java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java index 3fea38b5f0..2d79a95762 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/controller/PublicityController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java @@ -15,17 +15,17 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.controller; +package com.epmet.controller.publicity; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.module.publicity.service.PublicityService; import com.epmet.publicity.dto.form.TagFormDTO; import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.service.publicity.PublicityService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -48,7 +48,6 @@ public class PublicityController { /** - * @param tokenDTO * @return * @Author jyy * @Description 宣传能力—工作端—当前机关累计发文和当前发文 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java index 44e058cf14..233f31dc27 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/TopicController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/topic/TopicController.java @@ -1,10 +1,10 @@ -package com.epmet.module.topic.controller; +package com.epmet.controller.topic; import com.epmet.commons.tools.annotation.LoginUser; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; -import com.epmet.module.topic.service.TopicService; +import com.epmet.service.topic.TopicService; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; import com.epmet.topic.dto.result.*; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/GroupDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/GroupDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java index c6d6f49295..0f22c81d2b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/dao/GroupDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/group/GroupDao.java @@ -1,4 +1,4 @@ -package com.epmet.module.group.dao; +package com.epmet.dao.group; import com.epmet.group.dto.result.*; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java index bd530dd616..f8f3058673 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/IssueDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/issue/IssueDao.java @@ -1,4 +1,4 @@ -package com.epmet.module.issue.dao; +package com.epmet.dao.issue; import com.epmet.issue.dto.result.IssueDataDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 09bb4293f0..3ae53720f7 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/dao/ProjectDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -1,4 +1,4 @@ -package com.epmet.module.project.dao; +package com.epmet.dao.project; import com.epmet.project.dto.FactAgencyProjectDailyDTO; import com.epmet.project.dto.result.*; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java similarity index 92% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java index 283613c4e5..6f1c09e7db 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedAgencyDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java @@ -15,11 +15,11 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.publicity.FactArticlePublishedAgencyDailyEntity; import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; -import com.epmet.entity.FactArticlePublishedAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java index 15ada3b211..c4c74294b6 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedDepartmentDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.FactArticlePublishedDepartmentDailyEntity; +import com.epmet.entity.publicity.FactArticlePublishedDepartmentDailyEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java similarity index 90% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java index d96cc5747a..7b4277b25e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactArticlePublishedGridDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.FactArticlePublishedGridDailyEntity; +import com.epmet.entity.publicity.FactArticlePublishedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java index 636ac8d8dc..c7e6d8dd9b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java index e849870793..62655117ab 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyQuarterlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java index 9325b0d600..da999eb748 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagUsedAgencyYearlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java similarity index 91% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java index d45797f0a1..f07422bba4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.FactTagViewedAgencyDailyEntity; +import com.epmet.entity.publicity.FactTagViewedAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java index a5945654cf..4b9f72873a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java index f546706569..5ba0a377ed 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyQuarterlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java index de6bd638ca..db124cb121 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedAgencyYearlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import org.apache.ibatis.annotations.Mapper; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java similarity index 91% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java index eeac2a8100..524f2dafe0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridDailyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.FactTagViewedGridDailyEntity; +import com.epmet.entity.publicity.FactTagViewedGridDailyEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java similarity index 91% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java index 3336e1460b..e616dbd156 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridMonthlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.FactTagViewedGridMonthlyEntity; +import com.epmet.entity.publicity.FactTagViewedGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java similarity index 91% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java index e91e66f5ef..a83964bb1e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridQuarterlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.FactTagViewedGridQuarterlyEntity; +import com.epmet.entity.publicity.FactTagViewedGridQuarterlyEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java similarity index 91% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java index 380e7a4301..39abffa211 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/dao/FactTagViewedGridYearlyDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java @@ -15,10 +15,10 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.dao; +package com.epmet.dao.publicity; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.FactTagViewedGridYearlyEntity; +import com.epmet.entity.publicity.FactTagViewedGridYearlyEntity; import org.apache.ibatis.annotations.Mapper; /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 9ea7f8d631..e45798d750 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/TopicDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -1,4 +1,4 @@ -package com.epmet.module.topic.dao; +package com.epmet.dao.topic; import com.epmet.group.dto.result.GroupIncrTrendResultDTO; import com.epmet.topic.dto.result.*; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java index 680ae4d86a..673699742d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedAgencyDailyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java index 45d10f9b8d..2a67346010 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedDepartmentDailyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java index 93f9a4568c..743724c2ab 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactArticlePublishedGridDailyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java index b020f7454f..fb3d59a1ca 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyDailyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java index f0125e67c6..35cac8e93f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyMonthlyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java index de60b9198b..318cfc19f4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyQuarterlyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java index 2cc0d5bfac..5680665c68 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedAgencyYearlyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java index 16b6702ba1..878f9d3428 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridDailyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java index 36898a2ef7..eeae33a44a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridMonthlyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java index ea8fb00ce4..75243cc1cc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridQuarterlyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java index b4adaff236..9842520a5b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/entity/FactTagViewedGridYearlyEntity.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.entity; +package com.epmet.entity.publicity; import com.baomidou.mybatisplus.annotation.TableName; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/controller/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/controller/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/dao/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/.gitignore b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/.gitignore deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/GroupService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/GroupService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java index 7ce1df4cc7..d644029bcf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/GroupService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/GroupService.java @@ -1,4 +1,4 @@ -package com.epmet.module.group.service; +package com.epmet.service.group; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.group.dto.form.GroupIncrTrendFormDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/impl/GroupServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java similarity index 96% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/impl/GroupServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java index f986a591a7..80a5624e3b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/group/service/impl/GroupServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/group/impl/GroupServiceImpl.java @@ -1,15 +1,15 @@ -package com.epmet.module.group.service.impl; +package com.epmet.service.group.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.group.GroupDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.group.constant.GroupConstant; import com.epmet.group.dto.form.GroupIncrTrendFormDTO; import com.epmet.group.dto.result.*; -import com.epmet.module.group.dao.GroupDao; -import com.epmet.module.group.service.GroupService; +import com.epmet.service.group.GroupService; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java index 410930bffe..c0d33b2a3b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/IssueService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/IssueService.java @@ -1,4 +1,4 @@ -package com.epmet.module.issue.service; +package com.epmet.service.issue; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java index 562cfc25fc..64fc2d99e0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/issue/service/impl/IssueServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java @@ -1,14 +1,14 @@ -package com.epmet.module.issue.service.impl; +package com.epmet.service.issue.impl; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.issue.IssueDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.issue.constant.IssueConstant; import com.epmet.issue.dto.form.IssueIncrtrendFormDTO; import com.epmet.issue.dto.result.*; -import com.epmet.module.issue.dao.IssueDao; -import com.epmet.module.issue.service.IssueService; +import com.epmet.service.issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java similarity index 100% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/ProjectService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/ProjectService.java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 988f587d30..35769c0a39 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/project/service/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -1,12 +1,12 @@ -package com.epmet.module.project.service.impl; +package com.epmet.service.project.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.project.ProjectDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.module.project.dao.ProjectDao; import com.epmet.module.project.service.ProjectService; import com.epmet.project.constant.ProjectConstant; import com.epmet.project.dto.FactAgencyProjectDailyDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java index ad9114849b..5d3ee0c762 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/PublicityService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java @@ -15,7 +15,7 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.service; +package com.epmet.service.publicity; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java similarity index 93% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java index 6beebc0604..fecabf3eaf 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/publicity/service/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -15,22 +15,22 @@ * along with this program. If not, see . */ -package com.epmet.module.publicity.service.impl; +package com.epmet.service.publicity.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.publicity.FactArticlePublishedAgencyDailyDao; +import com.epmet.dao.publicity.FactTagViewedAgencyMonthlyDao; +import com.epmet.dao.publicity.FactTagViewedAgencyQuarterlyDao; +import com.epmet.dao.publicity.FactTagViewedAgencyYearlyDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.module.publicity.dao.FactArticlePublishedAgencyDailyDao; -import com.epmet.module.publicity.dao.FactTagViewedAgencyMonthlyDao; -import com.epmet.module.publicity.dao.FactTagViewedAgencyQuarterlyDao; -import com.epmet.module.publicity.dao.FactTagViewedAgencyYearlyDao; -import com.epmet.module.publicity.service.PublicityService; import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.service.publicity.PublicityService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java similarity index 97% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java index 1bf2b6d9c3..584ac1b1dc 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/TopicService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -1,4 +1,4 @@ -package com.epmet.module.topic.service; +package com.epmet.service.topic; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java similarity index 98% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java rename to epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index a66659396f..9b8dace788 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/module/topic/service/impl/TopicServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -1,12 +1,12 @@ -package com.epmet.module.topic.service.impl; +package com.epmet.service.topic.impl; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; +import com.epmet.dao.topic.TopicDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.module.topic.dao.TopicDao; -import com.epmet.module.topic.service.TopicService; +import com.epmet.service.topic.TopicService; import com.epmet.topic.constant.TopicConstant; import com.epmet.topic.dto.form.TopicIncrTrendFormDTO; import com.epmet.topic.dto.result.*; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml index 71de6153f9..e2d08c35a2 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/group/GroupDao.xml @@ -1,7 +1,7 @@ - + SELECT AGENCY_ID, diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml index 12cd3897fb..7d0105ae55 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/project/ProjectDao.xml @@ -1,7 +1,7 @@ - + From 7f46d97cf334f645ec258aac21f1ca422c12e248 Mon Sep 17 00:00:00 2001 From: wxz Date: Mon, 22 Jun 2020 21:36:42 +0800 Subject: [PATCH 088/101] =?UTF-8?q?1.=E9=94=99=E8=AF=AF=E7=9A=84=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- epmet-module/data-report/data-report-server/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-server/pom.xml b/epmet-module/data-report/data-report-server/pom.xml index 1797d034a4..9ae8ec1dc4 100644 --- a/epmet-module/data-report/data-report-server/pom.xml +++ b/epmet-module/data-report/data-report-server/pom.xml @@ -100,15 +100,15 @@ - + epmet_data_statistical_user EpmEt-db-UsEr 0 - 118.190.150.119 - 47379 + 192.168.1.130 + 6379 123456 From 0abc2aaad24463e308fde2b95a555c474717bf84 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Mon, 22 Jun 2020 23:42:47 +0800 Subject: [PATCH 089/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=EF=BC=9A=E4=B8=8B=E7=BA=A7?= =?UTF-8?q?=E6=9C=BA=E5=85=B3=E6=9F=B1=E7=8A=B6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/constant/UserAnalysisConstant.java | 15 +++ .../main/java/com/epmet/dto/DimAgencyDTO.java | 106 ++++++++++++++++++ .../dto/form/user/UserSubAgencyFormDTO.java | 3 + .../dto/form/user/UserSubGridFormDTO.java | 3 + .../dto/result/user/UserSubAgencyResDTO.java | 45 ++++++++ .../result/user/UserSubAgencyResultDTO.java | 5 +- .../user/UserAnalysisController.java | 20 ++-- .../com/epmet/dao/user/UserAnalysisDao.java | 35 ++++++ .../service/user/UserAnalysisService.java | 8 +- .../user/impl/UserAnalysisServiceImpl.java | 103 +++++++++++++++-- .../resources/mapper/user/UserAnalysisDao.xml | 55 +++++++++ 11 files changed, 375 insertions(+), 23 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java index 9041875b52..ffd096b2bd 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java @@ -19,4 +19,19 @@ public interface UserAnalysisConstant { String PARTI_FLAG="parti"; String QUERY_USER_AGENCY_FAILED="查询用户所属机关信息失败"; + + /** + * 普通居民(已注册) + */ + String REGISTERED_RESI= "居民"; + + /** + * 热心居民 + */ + String WARMHEARTED="热心居民"; + + /** + * 党员 + */ + String PARTYMEMBER="党员"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java new file mode 100644 index 0000000000..03bf9ad3c2 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 机关维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 组织IDAGENCY_ID + */ + private String id; + + /** + * 组织名称 + */ + private String agencyName; + + /** + * 客户ID + */ + private String customerId; + + /** + * 上级组织机构ID,根组织为0 + */ + private String pid; + + /** + * 所有上级组织机构ID(以英文:隔开) + */ + private String pids; + + /** + * 所有上级名称,以-连接 + */ + private String allParentName; + + /** + * 机关级别(社区级:community, +乡(镇、街道)级:street, +区县级: district, +市级: city +省级:province) + */ + private String level; + + /** + * 删除标识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-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java index 5f7f22b089..43d089e01a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubAgencyFormDTO.java @@ -19,4 +19,7 @@ public class UserSubAgencyFormDTO implements Serializable { */ @NotBlank(message = "regOrPartiFlag不能为空") private String regOrPartiFlag; + + @NotBlank(message = "查询日期不能为空") + private String dateId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java index 81e54c8756..c9bc20b734 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/user/UserSubGridFormDTO.java @@ -19,4 +19,7 @@ public class UserSubGridFormDTO implements Serializable { */ @NotBlank(message = "regOrPartiFlag不能为空") private String regOrPartiFlag; + + @NotBlank(message = "查询日期不能为空") + private String dateId; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResDTO.java new file mode 100644 index 0000000000..f01c273e2b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResDTO.java @@ -0,0 +1,45 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 21:45 + */ +@Data +public class UserSubAgencyResDTO implements Serializable { + private static final long serialVersionUID = 5807572279154511198L; + /** + * 机关id + */ + private String agencyId; + + /** + * 机关名称 + */ + private String agencyName; + + /** + * 截止到本日参与用户总数 + */ + private Integer regTotal; + + /** + * 截止到本日(参与用户中)居民总数 + */ + private Integer resiTotal; + + /** + * 截止到本日(参与用户中)热心居民总数 + */ + private Integer warmHeartedTotal; + + /** + * 截止到本日(参与用户中)党员总数 + */ + private Integer partymemberTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java index 38969b9199..365435088d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java @@ -29,6 +29,9 @@ public class UserSubAgencyResultDTO implements Serializable { */ private String type; - @JsonIgnore private String agencyId; + + @JsonIgnore + private Integer total; + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java index 2855f60a7f..da00a281d0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/user/UserAnalysisController.java @@ -17,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; +import java.util.List; + /** * 组织能力用户相关接口入口 * @@ -51,10 +53,10 @@ public class UserAnalysisController { * @Date 2020/6/22 13:30 **/ @PostMapping("subagency") - public Result subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { + public Result> subAgency(@RequestBody UserSubAgencyFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - UserSubAgencyResultDTO userSubAgencyResultDTO = userService.subAgency(formDTO); - return new Result().ok(userSubAgencyResultDTO); + List userSubAgencyResultDTO = userService.subAgency(formDTO); + return new Result>().ok(userSubAgencyResultDTO); } /** @@ -65,10 +67,10 @@ public class UserAnalysisController { * @Date 2020/6/22 13:33 **/ @PostMapping("subgrid") - public Result subGrid(@RequestBody UserSubGridFormDTO formDTO) { + public Result> subGrid(@RequestBody UserSubGridFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - UserSubGridResultDTO userSubGridResultDTO = userService.subGrid(formDTO); - return new Result().ok(userSubGridResultDTO); + List userSubGridResultDTO = userService.subGrid(formDTO); + return new Result>().ok(userSubGridResultDTO); } /** @@ -79,10 +81,10 @@ public class UserAnalysisController { * @Date 2020/6/22 13:36 **/ @PostMapping("incrtrend") - public Result incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { + public Result> incrTrend(@RequestBody UserIncrTrendFormDTO formDTO) { ValidatorUtils.validateEntity(formDTO); - UserIncrTrendResultDTO userIncrTrendResultDTO = userService.incrTrend(formDTO); - return new Result().ok(userIncrTrendResultDTO); + List userIncrTrendResultDTO = userService.incrTrend(formDTO); + return new Result>().ok(userIncrTrendResultDTO); } } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java index 80ac956bf4..5e74b18b74 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java @@ -1,8 +1,13 @@ package com.epmet.dao.user; +import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.result.user.UserSubAgencyResDTO; import com.epmet.dto.result.user.UserSummaryInfoResultDTO; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 描述一下 @@ -12,6 +17,15 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface UserAnalysisDao { + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 根据机关id,查询它下一级机关列表 + * @Date 2020/6/22 22:42 + **/ + List selectSubAgencyList(String myAgencyId); + /** * @param myAgencyId * @return com.epmet.user.result.UserSummaryInfoResultDTO @@ -29,4 +43,25 @@ public interface UserAnalysisDao { * @Date 2020/6/22 16:52 **/ UserSummaryInfoResultDTO selectParticipationUserSummaryInfo(String myAgencyId); + + /** + * @return java.util.List + * @param dateId 20200618日期 + * @param agencyId 用户所属机关 + * @author yinzuomei + * @description 参与用户:子级机关用户分析,按日(date_id)查询 + * @Date 2020/6/22 21:51 + **/ + List selectParticipationSubAgencyRes(@Param("dateId") String dateId ,@Param("agencyId")String agencyId); + + /** + * @param dateId + * @param dateId 20200618日期 + * @param agencyId 用户所属机关id + * @return java.util.List + * @author yinzuomei + * @description 注册用户:子级机关用户分析,按日(date_id)查询 + * @Date 2020/6/22 22:38 + **/ + List selectRegSubAgencyRes(@Param("dateId") String dateId ,@Param("agencyId")String agencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java index 7f99be9033..cdb05ec73b 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/UserAnalysisService.java @@ -10,6 +10,8 @@ import com.epmet.dto.result.user.UserSubAgencyResultDTO; import com.epmet.dto.result.user.UserSubGridResultDTO; import com.epmet.dto.result.user.UserSummaryInfoResultDTO; +import java.util.List; + /** * 组织能力用户相关接口 * @@ -33,7 +35,7 @@ public interface UserAnalysisService { * @description 直属机关柱状图查询 * @Date 2020/6/22 13:42 **/ - UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO); + List subAgency(UserSubAgencyFormDTO formDTO); /** * @param formDTO @@ -42,7 +44,7 @@ public interface UserAnalysisService { * @description 直属网格柱状图查询 * @Date 2020/6/22 13:42 **/ - UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO); + List subGrid(UserSubGridFormDTO formDTO); /** * @param formDTO @@ -51,5 +53,5 @@ public interface UserAnalysisService { * @description 按日、按月查询注册用户数(参与用户数)增量折线图 * @Date 2020/6/22 13:42 **/ - UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO); + List incrTrend(UserIncrTrendFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index 4ce17aee57..9db779d348 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -7,16 +7,14 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserAnalysisConstant; import com.epmet.dao.user.UserAnalysisDao; +import com.epmet.dto.DimAgencyDTO; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.user.UserIncrTrendFormDTO; import com.epmet.dto.form.user.UserSubAgencyFormDTO; import com.epmet.dto.form.user.UserSubGridFormDTO; import com.epmet.dto.form.user.UserSummaryInfoFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; -import com.epmet.dto.result.user.UserIncrTrendResultDTO; -import com.epmet.dto.result.user.UserSubAgencyResultDTO; -import com.epmet.dto.result.user.UserSubGridResultDTO; -import com.epmet.dto.result.user.UserSummaryInfoResultDTO; +import com.epmet.dto.result.user.*; import com.epmet.feign.EpmetUserOpenFeignClient; import com.epmet.service.user.UserAnalysisService; import org.apache.commons.lang.StringUtils; @@ -24,6 +22,12 @@ 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.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Collectors; /** * 组织能力用户相关接口 @@ -76,9 +80,11 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { UserSummaryInfoResultDTO userSummaryInfoResultDTO=new UserSummaryInfoResultDTO(); String myAgencyId=this.getMyAgency(); if(UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())){ - userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); - }else{ + //参与用户 userSummaryInfoResultDTO=userAnalysisDao.selectParticipationUserSummaryInfo(myAgencyId); + }else{ + //注册用户 + userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); } if(null!=userSummaryInfoResultDTO){ userSummaryInfoResultDTO.setCurrentDate(DateUtils.getDatePointPattern(userSummaryInfoResultDTO.getCurrentDate())); @@ -98,8 +104,85 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { * @Date 2020/6/22 13:42 **/ @Override - public UserSubAgencyResultDTO subAgency(UserSubAgencyFormDTO formDTO) { - return null; + public List subAgency(UserSubAgencyFormDTO formDTO) { + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + //初始化横坐标(用户所机关的下级机关列表) + List returnList = this.initUserSubAgencyResultDTO(myAgencyId); + if(CollectionUtils.isEmpty(returnList)){ + return new ArrayList<>(); + } + //根据入参,查询注册用户或者参与用户的(机关、按日的查询结果) + List userSubAgencyResDTOList=new ArrayList<>(); + if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())) { + //参与用户 + userSubAgencyResDTOList = userAnalysisDao.selectParticipationSubAgencyRes(formDTO.getDateId(), + myAgencyId); + } else { + //注册用户 + userSubAgencyResDTOList = userAnalysisDao.selectRegSubAgencyRes(formDTO.getDateId(), + myAgencyId); + } + //根据维度表进行对比 + for(UserSubAgencyResDTO userSubAgencyResDTO:userSubAgencyResDTOList){ + for(UserSubAgencyResultDTO returnResultDTO:returnList){ + if(returnResultDTO.getAgencyId().equals(userSubAgencyResDTO.getAgencyId())){ + //居民、热心居民、党员总数,用于排序 + returnResultDTO.setTotal(userSubAgencyResDTO.getPartymemberTotal() + +userSubAgencyResDTO.getWarmHeartedTotal() + +userSubAgencyResDTO.getResiTotal()); + switch(returnResultDTO.getType()){ + case UserAnalysisConstant.REGISTERED_RESI: + returnResultDTO.setValue(userSubAgencyResDTO.getResiTotal()); + break; + case UserAnalysisConstant.WARMHEARTED: + returnResultDTO.setValue(userSubAgencyResDTO.getWarmHeartedTotal()); + break; + case UserAnalysisConstant.PARTYMEMBER: + returnResultDTO.setValue(userSubAgencyResDTO.getPartymemberTotal()); + break; + default: + break; + } + } + } + } + //返回集合按照total降序排序 + List newList = returnList.stream().sorted(Comparator.comparing(UserSubAgencyResultDTO::getTotal)) + .collect(Collectors.toList()); + return newList; + } + + private List initUserSubAgencyResultDTO(String myAgencyId) { + List list=new ArrayList<>(); + List dimAgencyDTOS=userAnalysisDao.selectSubAgencyList(myAgencyId); + for(DimAgencyDTO agencyDTO:dimAgencyDTOS){ + //居民 + UserSubAgencyResultDTO resi=new UserSubAgencyResultDTO(); + resi.setAgencyId(agencyDTO.getId()); + resi.setName(agencyDTO.getAgencyName()); + resi.setValue(0); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setTotal(0); + list.add(resi); + //热心居民 + UserSubAgencyResultDTO warm=new UserSubAgencyResultDTO(); + warm.setAgencyId(agencyDTO.getId()); + warm.setName(agencyDTO.getAgencyName()); + warm.setValue(0); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setTotal(0); + list.add(warm); + //党员 + UserSubAgencyResultDTO party=new UserSubAgencyResultDTO(); + party.setAgencyId(agencyDTO.getId()); + party.setName(agencyDTO.getAgencyName()); + party.setValue(0); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setTotal(0); + list.add(party); + } + return list; } /** @@ -110,7 +193,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { * @Date 2020/6/22 13:42 **/ @Override - public UserSubGridResultDTO subGrid(UserSubGridFormDTO formDTO) { + public List subGrid(UserSubGridFormDTO formDTO) { return null; } @@ -122,7 +205,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { * @Date 2020/6/22 13:42 **/ @Override - public UserIncrTrendResultDTO incrTrend(UserIncrTrendFormDTO formDTO) { + public List incrTrend(UserIncrTrendFormDTO formDTO) { return null; } } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml index 982c0526a6..efd1888940 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -2,6 +2,18 @@ + + + + + + + + \ No newline at end of file From 9482da2cabd082e616d3f1ba4bcd69dd0d6ea9c6 Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Jun 2020 00:46:27 +0800 Subject: [PATCH 090/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=9B=B8=E5=85=B3=EF=BC=9A=E7=9B=B4=E5=B1=9E?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E6=9F=B1=E7=8A=B6=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/dto/DimAgencyDTO.java | 60 --------- .../main/java/com/epmet/dto/DimGridDTO.java | 45 +++++++ .../result/user/UserSubAgencyResultDTO.java | 3 + .../dto/result/user/UserSubGridResDTO.java | 21 +++ .../dto/result/user/UserSubGridResultDTO.java | 8 +- .../com/epmet/dao/user/UserAnalysisDao.java | 31 +++++ .../user/impl/UserAnalysisServiceImpl.java | 127 +++++++++++++++--- .../resources/mapper/user/UserAnalysisDao.xml | 49 ++++++- 8 files changed, 263 insertions(+), 81 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimGridDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResDTO.java diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java index 03bf9ad3c2..243404052e 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimAgencyDTO.java @@ -20,7 +20,6 @@ package com.epmet.dto; import lombok.Data; import java.io.Serializable; -import java.util.Date; /** @@ -44,63 +43,4 @@ public class DimAgencyDTO implements Serializable { */ private String agencyName; - /** - * 客户ID - */ - private String customerId; - - /** - * 上级组织机构ID,根组织为0 - */ - private String pid; - - /** - * 所有上级组织机构ID(以英文:隔开) - */ - private String pids; - - /** - * 所有上级名称,以-连接 - */ - private String allParentName; - - /** - * 机关级别(社区级:community, -乡(镇、街道)级:street, -区县级: district, -市级: city -省级:province) - */ - private String level; - - /** - * 删除标识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-report/data-report-client/src/main/java/com/epmet/dto/DimGridDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimGridDTO.java new file mode 100644 index 0000000000..8487d6d220 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/DimGridDTO.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.dto; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 客户网格维度 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-16 + */ +@Data +public class DimGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * GRID_ID + */ + private String id; + + /** + * 网格名称 + */ + private String gridName; +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java index 365435088d..107b189660 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubAgencyResultDTO.java @@ -29,6 +29,9 @@ public class UserSubAgencyResultDTO implements Serializable { */ private String type; + /** + * 机关id + */ private String agencyId; @JsonIgnore diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResDTO.java new file mode 100644 index 0000000000..e20c123147 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 直属网格注册用户数(参与用户、注册用户通用类) + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/22 23:57 + */ +@Data +public class UserSubGridResDTO implements Serializable { + private static final long serialVersionUID = 2203260762393704885L; + private String gridId; + private Integer regTotal; + private Integer resiTotal; + private Integer warmHeartedTotal; + private Integer partymemberTotal; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java index 493f6ebc98..5aa50aad9b 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserSubGridResultDTO.java @@ -5,6 +5,7 @@ import lombok.Data; import java.io.Serializable; + /** * 直属网格注册用户数 返参DTO * @@ -30,6 +31,11 @@ public class UserSubGridResultDTO implements Serializable { */ private String type; - @JsonIgnore + /** + * 网格id + */ private String gridId; + + @JsonIgnore + private Integer total; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java index 5e74b18b74..2fd8c6b3c8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java @@ -2,7 +2,9 @@ package com.epmet.dao.user; import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.DimGridDTO; import com.epmet.dto.result.user.UserSubAgencyResDTO; +import com.epmet.dto.result.user.UserSubGridResDTO; import com.epmet.dto.result.user.UserSummaryInfoResultDTO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -26,6 +28,15 @@ public interface UserAnalysisDao { **/ List selectSubAgencyList(String myAgencyId); + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description 根据机关id,查询它下面的直属网格列表 + * @Date 2020/6/22 23:51 + **/ + List selectSubGridList(String myAgencyId); + /** * @param myAgencyId * @return com.epmet.user.result.UserSummaryInfoResultDTO @@ -64,4 +75,24 @@ public interface UserAnalysisDao { * @Date 2020/6/22 22:38 **/ List selectRegSubAgencyRes(@Param("dateId") String dateId ,@Param("agencyId")String agencyId); + + /** + * @param dateId 20200618日期 + * @param agencyId 用户所属机关id + * @return java.util.List + * @author yinzuomei + * @description 参与用户:机关下,直属网格用户分析 + * @Date 2020/6/23 0:18 + **/ + List selectParticipationSubGridRes(@Param("dateId") String dateId, @Param("agencyId") String agencyId); + + /** + * @param dateId 20200618日期 + * @param agencyId 用户所属机关id + * @return java.util.List + * @author yinzuomei + * @description 注册用户:机关下,直属网格用户分析 + * @Date 2020/6/23 0:18 + **/ + List selectRegSubGridRes(@Param("dateId")String dateId, @Param("agencyId") String agencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index 9db779d348..dbc4d20f2e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -1,6 +1,7 @@ package com.epmet.service.user.impl; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.RenException; import com.epmet.commons.tools.security.user.LoginUserUtil; import com.epmet.commons.tools.utils.DateUtils; @@ -8,6 +9,7 @@ import com.epmet.commons.tools.utils.Result; import com.epmet.constant.UserAnalysisConstant; import com.epmet.dao.user.UserAnalysisDao; import com.epmet.dto.DimAgencyDTO; +import com.epmet.dto.DimGridDTO; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.form.user.UserIncrTrendFormDTO; import com.epmet.dto.form.user.UserSubAgencyFormDTO; @@ -108,8 +110,9 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { //获取用户所属机关id String myAgencyId = this.getMyAgency(); //初始化横坐标(用户所机关的下级机关列表) - List returnList = this.initUserSubAgencyResultDTO(myAgencyId); - if(CollectionUtils.isEmpty(returnList)){ + List dimList = this.initUserSubAgencyResultDTO(myAgencyId); + if(CollectionUtils.isEmpty(dimList)){ + logger.info(String.format("当前机关(agencyId=%s)下没有下级机关",myAgencyId)); return new ArrayList<>(); } //根据入参,查询注册用户或者参与用户的(机关、按日的查询结果) @@ -124,33 +127,38 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { myAgencyId); } //根据维度表进行对比 - for(UserSubAgencyResDTO userSubAgencyResDTO:userSubAgencyResDTOList){ - for(UserSubAgencyResultDTO returnResultDTO:returnList){ - if(returnResultDTO.getAgencyId().equals(userSubAgencyResDTO.getAgencyId())){ + for(UserSubAgencyResultDTO dimInitResultDto:dimList){ + boolean flag=false; + for(UserSubAgencyResDTO userSubAgencyResDTO:userSubAgencyResDTOList){ + if(dimInitResultDto.getAgencyId().equals(userSubAgencyResDTO.getAgencyId())){ + flag=true; //居民、热心居民、党员总数,用于排序 - returnResultDTO.setTotal(userSubAgencyResDTO.getPartymemberTotal() + dimInitResultDto.setTotal(userSubAgencyResDTO.getPartymemberTotal() +userSubAgencyResDTO.getWarmHeartedTotal() +userSubAgencyResDTO.getResiTotal()); - switch(returnResultDTO.getType()){ + switch(dimInitResultDto.getType()){ case UserAnalysisConstant.REGISTERED_RESI: - returnResultDTO.setValue(userSubAgencyResDTO.getResiTotal()); + dimInitResultDto.setValue(userSubAgencyResDTO.getResiTotal()); break; case UserAnalysisConstant.WARMHEARTED: - returnResultDTO.setValue(userSubAgencyResDTO.getWarmHeartedTotal()); + dimInitResultDto.setValue(userSubAgencyResDTO.getWarmHeartedTotal()); break; case UserAnalysisConstant.PARTYMEMBER: - returnResultDTO.setValue(userSubAgencyResDTO.getPartymemberTotal()); + dimInitResultDto.setValue(userSubAgencyResDTO.getPartymemberTotal()); break; default: break; } } } + if(!flag){ + logger.error(String.format("各机关注册用户数缺少记录:date_id=%s,agencyId=%s",formDTO.getDateId(),dimInitResultDto.getAgencyId())); + } } //返回集合按照total降序排序 - List newList = returnList.stream().sorted(Comparator.comparing(UserSubAgencyResultDTO::getTotal)) + List returnList = dimList.stream().sorted(Comparator.comparing(UserSubAgencyResultDTO::getTotal)) .collect(Collectors.toList()); - return newList; + return returnList; } private List initUserSubAgencyResultDTO(String myAgencyId) { @@ -161,25 +169,25 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { UserSubAgencyResultDTO resi=new UserSubAgencyResultDTO(); resi.setAgencyId(agencyDTO.getId()); resi.setName(agencyDTO.getAgencyName()); - resi.setValue(0); + resi.setValue(NumConstant.ZERO); resi.setType(UserAnalysisConstant.REGISTERED_RESI); - resi.setTotal(0); + resi.setTotal(NumConstant.ZERO); list.add(resi); //热心居民 UserSubAgencyResultDTO warm=new UserSubAgencyResultDTO(); warm.setAgencyId(agencyDTO.getId()); warm.setName(agencyDTO.getAgencyName()); - warm.setValue(0); + warm.setValue(NumConstant.ZERO); warm.setType(UserAnalysisConstant.WARMHEARTED); - warm.setTotal(0); + warm.setTotal(NumConstant.ZERO); list.add(warm); //党员 UserSubAgencyResultDTO party=new UserSubAgencyResultDTO(); party.setAgencyId(agencyDTO.getId()); party.setName(agencyDTO.getAgencyName()); - party.setValue(0); + party.setValue(NumConstant.ZERO); party.setType(UserAnalysisConstant.PARTYMEMBER); - party.setTotal(0); + party.setTotal(NumConstant.ZERO); list.add(party); } return list; @@ -194,7 +202,88 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { **/ @Override public List subGrid(UserSubGridFormDTO formDTO) { - return null; + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + //初始化横坐标(用户所机关的直属网格) + List dimList = this.initUserSubGridResultDTO(myAgencyId); + if(CollectionUtils.isEmpty(dimList)){ + logger.info(String.format("当前机关(agencyId=%s)下没有网格",myAgencyId)); + return new ArrayList<>(); + } + //根据入参,查询注册用户或者参与用户的(机关、按日的查询结果) + List userSubGridResDTOS=new ArrayList<>(); + if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag())) { + //参与用户 + userSubGridResDTOS=userAnalysisDao.selectParticipationSubGridRes(formDTO.getDateId(),myAgencyId); + } else { + //注册用户 + userSubGridResDTOS=userAnalysisDao.selectRegSubGridRes(formDTO.getDateId(),myAgencyId); + } + //根据维度表进行对比 + for(UserSubGridResultDTO dimInitResultDto:dimList){ + boolean flag=false; + for(UserSubGridResDTO userSubGridResDTO:userSubGridResDTOS){ + if(dimInitResultDto.getGridId().equals(userSubGridResDTO.getGridId())){ + flag=true; + //居民、热心居民、党员总数,用于排序 + dimInitResultDto.setTotal(userSubGridResDTO.getPartymemberTotal() + +userSubGridResDTO.getWarmHeartedTotal() + +userSubGridResDTO.getResiTotal()); + switch(dimInitResultDto.getType()){ + case UserAnalysisConstant.REGISTERED_RESI: + dimInitResultDto.setValue(userSubGridResDTO.getResiTotal()); + break; + case UserAnalysisConstant.WARMHEARTED: + dimInitResultDto.setValue(userSubGridResDTO.getWarmHeartedTotal()); + break; + case UserAnalysisConstant.PARTYMEMBER: + dimInitResultDto.setValue(userSubGridResDTO.getPartymemberTotal()); + break; + default: + break; + } + } + } + if(!flag){ + logger.error(String.format("直属网格注册用户数缺少记录:date_id=%s,gridId=%s",formDTO.getDateId(),dimInitResultDto.getGridId())); + } + } + //返回集合按照total降序排序 + List returnList = dimList.stream().sorted(Comparator.comparing(UserSubGridResultDTO::getTotal)) + .collect(Collectors.toList()); + return returnList; + } + + private List initUserSubGridResultDTO(String myAgencyId) { + List list=new ArrayList<>(); + List gridList=userAnalysisDao.selectSubGridList(myAgencyId); + for(DimGridDTO grid:gridList){ + //居民 + UserSubGridResultDTO resi=new UserSubGridResultDTO(); + resi.setGridId(grid.getId()); + resi.setName(grid.getGridName()); + resi.setValue(NumConstant.ZERO); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setTotal(NumConstant.ZERO); + list.add(resi); + //热心居民 + UserSubGridResultDTO warm=new UserSubGridResultDTO(); + warm.setGridId(grid.getId()); + warm.setName(grid.getGridName()); + warm.setValue(NumConstant.ZERO); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setTotal(NumConstant.ZERO); + list.add(warm); + //党员 + UserSubGridResultDTO party=new UserSubGridResultDTO(); + party.setGridId(grid.getId()); + party.setName(grid.getGridName()); + party.setValue(NumConstant.ZERO); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setTotal(NumConstant.ZERO); + list.add(party); + } + return list; } /** diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml index efd1888940..f00dc28baf 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -13,6 +13,20 @@ da.DEL_FLAG = '0' AND da.AGENCY_DIM_TYPE = 'all' AND da.PID =#{myAgencyId} + order by CONVERT ( da.AGENCY_NAME USING gbk ) ASC + + + + - + + + + + + \ No newline at end of file From 18954811ca8d903d08e96cb08a6ccbc5f809417f Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 23 Jun 2020 09:01:51 +0800 Subject: [PATCH 091/101] =?UTF-8?q?data-report=E5=90=AF=E5=8A=A8=E7=B1=BB?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0feign=E6=B3=A8=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/epmet/DataReportApplication.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java index dced5aa566..cee0ed9096 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/DataReportApplication.java @@ -2,8 +2,14 @@ package com.epmet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; +import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.scheduling.annotation.EnableAsync; @SpringBootApplication +@EnableDiscoveryClient +@EnableFeignClients +@EnableAsync public class DataReportApplication { public static void main(String[] args) { SpringApplication.run(DataReportApplication.class, args); From 55c742edc6798d01486f50805abd955c3bafd9b7 Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 23 Jun 2020 11:12:25 +0800 Subject: [PATCH 092/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/StatsGroupServiceImpl.java | 47 ++++++++++--------- 1 file changed, 26 insertions(+), 21 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index 15ad3e0b3a..e4447e07ba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -58,17 +58,19 @@ public class StatsGroupServiceImpl implements StatsGroupService { public void groupGridDaily(Date date) { Integer pageNo = NumConstant.ONE; Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - customerIds.forEach(customerId -> { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); - List gridsInfo = dimGridService.getGridListByCustomerId(customerId); - List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); - }); + List customerIds; + do { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); + if (customerIds.size() != NumConstant.ZERO){ + customerIds.forEach(customerId -> { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + List gridsInfo = dimGridService.getGridListByCustomerId(customerId); + List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); + }); + } + }while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); } /** @@ -79,17 +81,18 @@ public class StatsGroupServiceImpl implements StatsGroupService { public void groupAgencyDaily(Date date) { Integer pageNo = NumConstant.ONE; Integer pageSize = NumConstant.ONE_HUNDRED; - List customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); - if (customerIds.size() == NumConstant.ZERO){ - return; - } - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); - customerIds.forEach(customerId -> { - - List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); - List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); - }); + List customerIds; + do { + customerIds = dimCustomerService.selectCustomerIdPage(pageNo++,pageSize); + if (customerIds.size() != NumConstant.ZERO){ + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + customerIds.forEach(customerId -> { + List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); + }); + } + }while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); } /** @@ -258,6 +261,8 @@ public class StatsGroupServiceImpl implements StatsGroupService { /** * @Description 获取时间维度 dateId--weekId--monthId--quarterId--yearId + * 如果有自定义时间,根据自定义时间获取时间维度 + * 没有自定义时间,默认获取前一天的时间维度 * @param * @author zxc */ From 17e13a2d5713d9f39ef6c1f5e8b1ed7e98e18d3a Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Tue, 23 Jun 2020 11:20:24 +0800 Subject: [PATCH 093/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=E7=9B=AE=E5=BD=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...actArticlePublishedDepartmentDailyDTO.java | 121 ----------------- .../FactArticlePublishedGridDailyDTO.java | 121 ----------------- .../dto/result/FactPublishedAgencyDTO.java} | 36 +++-- ....java => FactPublishedAgencyDailyDTO.java} | 2 +- .../result/FactPublishedDepartmentDTO.java} | 45 +++++-- .../dto/result/FactPublishedGridDTO.java} | 45 +++++-- .../dto/result/FactTagAgencyDTO.java | 2 +- .../result/FactTagViewedAgencyDailyDTO.java | 126 ------------------ .../result/FactTagViewedAgencyMonthlyDTO.java | 106 --------------- .../FactTagViewedAgencyQuarterlyDTO.java | 106 --------------- .../result/FactTagViewedAgencyYearlyDTO.java | 106 --------------- .../dto/result/FactTagViewedGridDailyDTO.java | 126 ------------------ .../result/FactTagViewedGridMonthlyDTO.java | 106 --------------- .../result/FactTagViewedGridQuarterlyDTO.java | 106 --------------- .../result/FactTagViewedGridYearlyDTO.java | 106 --------------- .../publicity/PublicityController.java | 6 +- .../FactArticlePublishedAgencyDailyDao.java | 42 ------ .../FactArticlePublishedGridDailyDao.java | 33 ----- .../FactTagUsedAgencyMonthlyDao.java | 40 ------ .../FactTagUsedAgencyQuarterlyDao.java | 40 ------ .../publicity/FactTagUsedAgencyYearlyDao.java | 40 ------ .../FactTagViewedAgencyMonthlyDao.java | 40 ------ .../FactTagViewedAgencyQuarterlyDao.java | 40 ------ .../FactTagViewedAgencyYearlyDao.java | 40 ------ .../publicity/FactTagViewedGridDailyDao.java | 33 ----- .../FactTagViewedGridMonthlyDao.java | 33 ----- .../FactTagViewedGridQuarterlyDao.java | 33 ----- .../com/epmet/dao/publicity/PublicityDao.java | 85 ++++++++++++ ...FactArticlePublishedAgencyDailyEntity.java | 91 ------------- ...ArticlePublishedDepartmentDailyEntity.java | 91 ------------- .../FactArticlePublishedGridDailyEntity.java | 91 ------------- .../FactTagViewedAgencyDailyEntity.java | 96 ------------- .../FactTagViewedAgencyMonthlyEntity.java | 76 ----------- .../FactTagViewedAgencyQuarterlyEntity.java | 76 ----------- .../FactTagViewedAgencyYearlyEntity.java | 76 ----------- .../FactTagViewedGridDailyEntity.java | 96 ------------- .../FactTagViewedGridMonthlyEntity.java | 76 ----------- .../FactTagViewedGridQuarterlyEntity.java | 76 ----------- .../FactTagViewedGridYearlyEntity.java | 76 ----------- .../service/publicity/PublicityService.java | 4 +- .../publicity/impl/PublicityServiceImpl.java | 37 ++--- .../FactArticlePublishedAgencyDailyDao.xml | 35 ----- ...FactArticlePublishedDepartmentDailyDao.xml | 27 ---- .../FactArticlePublishedGridDailyDao.xml | 27 ---- .../publicity/FactTagUsedAgencyMonthlyDao.xml | 20 --- .../FactTagUsedAgencyQuarterlyDao.xml | 22 --- .../publicity/FactTagUsedAgencyYearlyDao.xml | 23 ---- .../publicity/FactTagViewedAgencyDailyDao.xml | 28 ---- .../FactTagViewedAgencyMonthlyDao.xml | 20 --- .../FactTagViewedAgencyQuarterlyDao.xml | 22 --- .../FactTagViewedAgencyYearlyDao.xml | 23 ---- .../publicity/FactTagViewedGridDailyDao.xml | 28 ---- .../publicity/FactTagViewedGridMonthlyDao.xml | 24 ---- .../FactTagViewedGridQuarterlyDao.xml | 24 ---- .../publicity/FactTagViewedGridYearlyDao.xml | 24 ---- .../mapper/publicity/PublicityDao.xml | 107 +++++++++++++++ 56 files changed, 315 insertions(+), 2866 deletions(-) delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java rename epmet-module/data-report/{data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java => data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java} (61%) rename epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/{FactArticlePublishedAgencyDailyDTO.java => FactPublishedAgencyDailyDTO.java} (97%) rename epmet-module/data-report/{data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java => data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java} (57%) rename epmet-module/data-report/{data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java => data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java} (57%) delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java delete mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml delete mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java deleted file mode 100644 index 63dcdf8194..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedDepartmentDailyDTO.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章发布数量【部门】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactArticlePublishedDepartmentDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布文章单位所属机关ID 发布文章单位所属机关ID - */ - private String agencyId; - - /** - * 部门ID - */ - private String departmentId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java deleted file mode 100644 index ef9441018c..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedGridDailyDTO.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章发布数量【网格】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactArticlePublishedGridDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布单位所属机关ID 发布单位所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - 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-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java similarity index 61% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java index 39abffa211..6d1144a2c8 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridYearlyDao.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java @@ -15,19 +15,39 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridYearlyEntity; -import org.apache.ibatis.annotations.Mapper; /** - * 文章引用标签阅读数量【网格】年度统计表 + * 文章发表数量—下级机关统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 */ -@Mapper -public interface FactTagViewedGridYearlyDao extends BaseDao { - +@Data +public class FactPublishedAgencyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + + /** + * 累计发文总数 + */ + private Integer publishedTotal; + + /** + * 发布中的文章总数 + */ + private Integer publishingTotal; + + /** + * 数据截止日期 + */ + private String dateName; + + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java similarity index 97% rename from epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java index 8aa0274eab..50f07bcb8f 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactArticlePublishedAgencyDailyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java @@ -29,7 +29,7 @@ import lombok.Data; * @since v1.0.0 2020-06-19 */ @Data -public class FactArticlePublishedAgencyDailyDTO implements Serializable { +public class FactPublishedAgencyDailyDTO implements Serializable { private static final long serialVersionUID = 1L; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java similarity index 57% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java index f07422bba4..bc26c9fb50 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyDailyDao.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java @@ -15,19 +15,48 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedAgencyDailyEntity; -import org.apache.ibatis.annotations.Mapper; /** - * 文章引用标签阅读数量【机关】日统计表 + * 文章发表数量—直属部门统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 */ -@Mapper -public interface FactTagViewedAgencyDailyDao extends BaseDao { - +@Data +public class FactPublishedDepartmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关名称 + */ + private String name; + + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 部门Id + */ + private String departmentId; + + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java similarity index 57% rename from epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java rename to epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java index c4c74294b6..ad8a3e6c9e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedDepartmentDailyDao.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java @@ -15,19 +15,48 @@ * along with this program. If not, see . */ -package com.epmet.dao.publicity; +package com.epmet.publicity.dto.result; + +import lombok.Data; + +import java.io.Serializable; -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactArticlePublishedDepartmentDailyEntity; -import org.apache.ibatis.annotations.Mapper; /** - * 文章发布数量【部门】日统计表 + * 文章发表数量—直属部门统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 */ -@Mapper -public interface FactArticlePublishedDepartmentDailyDao extends BaseDao { - +@Data +public class FactPublishedGridDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 机关名称 + */ + private String name; + + /** + * 发文数量 + */ + private Integer value; + + /** + * 固定值:文章数量 + */ + private String type="文章数量"; + + /** + * 机关Id + */ + private String agencyId; + + /** + * 网格Id + */ + private String gridId; + + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java index 766a95393a..1d91a3287a 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagAgencyDTO.java @@ -24,7 +24,7 @@ import java.util.Date; /** - * 文章引用标签阅读数量【机关】日统计表 + * 文章引用标签阅读数量【机关】统计表 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java deleted file mode 100644 index f9bb58d4ed..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyDailyDTO.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java deleted file mode 100644 index 9e66642afb..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyMonthlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyMonthlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java deleted file mode 100644 index b5e845f6f8..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyQuarterlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】季度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyQuarterlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java deleted file mode 100644 index 9f420f6b37..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedAgencyYearlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【机关】年度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedAgencyYearlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java deleted file mode 100644 index d34da43745..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridDailyDTO.java +++ /dev/null @@ -1,126 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridDailyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java deleted file mode 100644 index a1c6e3209d..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridMonthlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridMonthlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java deleted file mode 100644 index 10b049d10f..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridQuarterlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】季度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridQuarterlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java deleted file mode 100644 index 2864b508de..0000000000 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactTagViewedGridYearlyDTO.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * 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.publicity.dto.result; - -import java.io.Serializable; -import java.util.Date; -import lombok.Data; - - -/** - * 文章引用标签阅读数量【网格】年度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Data -public class FactTagViewedGridYearlyDTO implements Serializable { - - private static final long serialVersionUID = 1L; - - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - 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-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java index 2d79a95762..9f64bec3e4 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java @@ -23,7 +23,7 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.publicity.dto.form.TagFormDTO; -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import com.epmet.service.publicity.PublicityService; import org.springframework.beans.factory.annotation.Autowired; @@ -53,8 +53,8 @@ public class PublicityController { * @Description 宣传能力—工作端—当前机关累计发文和当前发文 **/ @PostMapping("summaryinfo") - public Result summaryInfo(@LoginUser TokenDto tokenDto) { - return new Result().ok(publicityService.summaryInfo(tokenDto)); + public Result summaryInfo(@LoginUser TokenDto tokenDto) { + return new Result().ok(publicityService.summaryInfo(tokenDto)); } /** diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java deleted file mode 100644 index 6f1c09e7db..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedAgencyDailyDao.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactArticlePublishedAgencyDailyEntity; -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; - -/** - * 文章发布数量【机关】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactArticlePublishedAgencyDailyDao extends BaseDao { - - /** - * @Description 宣传能力—工作端—当前机关累计发文和当前发文 - * @param agencyId - * @author jyy - */ - FactArticlePublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java deleted file mode 100644 index 7b4277b25e..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactArticlePublishedGridDailyDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactArticlePublishedGridDailyEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 文章发布数量【网格】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactArticlePublishedGridDailyDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java deleted file mode 100644 index c7e6d8dd9b..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyMonthlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -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-06-19 - */ -@Mapper -public interface FactTagUsedAgencyMonthlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java deleted file mode 100644 index 62655117ab..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyQuarterlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -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-06-19 - */ -@Mapper -public interface FactTagUsedAgencyQuarterlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java deleted file mode 100644 index da999eb748..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagUsedAgencyYearlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -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-06-19 - */ -@Mapper -public interface FactTagUsedAgencyYearlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java deleted file mode 100644 index 4b9f72873a..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyMonthlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -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-06-19 - */ -@Mapper -public interface FactTagViewedAgencyMonthlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java deleted file mode 100644 index 5ba0a377ed..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyQuarterlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -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-06-19 - */ -@Mapper -public interface FactTagViewedAgencyQuarterlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java deleted file mode 100644 index db124cb121..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedAgencyYearlyDao.java +++ /dev/null @@ -1,40 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; -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-06-19 - */ -@Mapper -public interface FactTagViewedAgencyYearlyDao { - /** - * @param agencyId monthId - * @Description 根据标签分组,获取当月每个标签数量,按照数量降序,取前pagesize个 - * @author zxc - */ - List getYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java deleted file mode 100644 index 524f2dafe0..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridDailyDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridDailyEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 文章引用标签阅读数量【网格】日统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedGridDailyDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java deleted file mode 100644 index e616dbd156..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridMonthlyDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridMonthlyEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 文章引用标签阅读数量【网格】月统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedGridMonthlyDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java deleted file mode 100644 index a83964bb1e..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/FactTagViewedGridQuarterlyDao.java +++ /dev/null @@ -1,33 +0,0 @@ -/** - * 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.publicity; - -import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.entity.publicity.FactTagViewedGridQuarterlyEntity; -import org.apache.ibatis.annotations.Mapper; - -/** - * 文章引用标签阅读数量【网格】季度统计表 - * - * @author generator generator@elink-cn.com - * @since v1.0.0 2020-06-19 - */ -@Mapper -public interface FactTagViewedGridQuarterlyDao extends BaseDao { - -} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java new file mode 100644 index 0000000000..aa2475e2c5 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java @@ -0,0 +1,85 @@ +/** + * 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.publicity; + +import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; +import com.epmet.publicity.dto.result.FactTagAgencyDTO; +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-06-19 + */ +@Mapper +public interface PublicityDao { + + /** + * @Description 宣传能力—工作端—当前机关累计发文和当前发文 + * @param agencyId 机关id + * @author jyy + */ + FactPublishedAgencyDailyDTO summaryInfo(@Param("agencyId") String agencyId); + + /** + * @Description 当月———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,monthId,pageSize 机关id,月,展示数量 + * @author zxc + */ + List getViewedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当季———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,quarterId,pageSize 机关id,季,展示数量 + * @author zxc + */ + List getViewedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当年———获取机关下,获取每个标签阅读数量,按照数量降序,取前pagesize个 + * @param agencyId,yearId,pageSize 机关id,年,展示数量 + * @author zxc + */ + List getViewedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当月———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,monthId,pageSize 机关id,月,展示数量 + * @author zxc + */ + List getUsedMonthlyCountByTag(@Param("agencyId") String agencyId, @Param("monthId") String monthId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当季———获取机关下,获取每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,quarterId,pageSize 机关id,季,展示数量 + * @author zxc + */ + List getUsedQuarterlyCountByTag(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当年———获取机关下,每个标签发文数量,按照数量降序,取前pagesize个 + * @param agencyId,yearId,pageSize 机关id,年,展示数量 + * @author zxc + */ + List getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java deleted file mode 100644 index 673699742d..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedAgencyDailyEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_article_published_agency_daily") -public class FactArticlePublishedAgencyDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java deleted file mode 100644 index 2a67346010..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedDepartmentDailyEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_article_published_department_daily") -public class FactArticlePublishedDepartmentDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布文章单位所属机关ID 发布文章单位所属机关ID - */ - private String agencyId; - - /** - * 部门ID - */ - private String departmentId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java deleted file mode 100644 index 743724c2ab..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactArticlePublishedGridDailyEntity.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_article_published_grid_daily") -public class FactArticlePublishedGridDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 发布单位所属机关ID 发布单位所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; - - /** - * 当前发文数量 当前未下线的文章数量 - */ - private Integer articlePublishedCount; - - /** - * 日期ID 日期ID - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java deleted file mode 100644 index fb3d59a1ca..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyDailyEntity.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_daily") -public class FactTagViewedAgencyDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java deleted file mode 100644 index 35cac8e93f..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyMonthlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_monthly") -public class FactTagViewedAgencyMonthlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java deleted file mode 100644 index 318cfc19f4..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyQuarterlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_quarterly") -public class FactTagViewedAgencyQuarterlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java deleted file mode 100644 index 5680665c68..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedAgencyYearlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_agency_yearly") -public class FactTagViewedAgencyYearlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java deleted file mode 100644 index 878f9d3428..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridDailyEntity.java +++ /dev/null @@ -1,96 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_daily") -public class FactTagViewedGridDailyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 日期ID 天数ID eg:20200601 = 2020年6月1日、20200602 = 2020年6月2日 - */ - private String dateId; - - /** - * 周ID 周ID eg:2020W01 = 2020年第一周 - */ - private String weekId; - - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java deleted file mode 100644 index eeae33a44a..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridMonthlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_monthly") -public class FactTagViewedGridMonthlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 月份ID 月份ID eg:2020-06 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java deleted file mode 100644 index 75243cc1cc..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridQuarterlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_quarterly") -public class FactTagViewedGridQuarterlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java deleted file mode 100644 index 9842520a5b..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/entity/publicity/FactTagViewedGridYearlyEntity.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * 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.publicity; - -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-06-19 - */ -@Data -@EqualsAndHashCode(callSuper=false) -@TableName("fact_tag_viewed_grid_yearly") -public class FactTagViewedGridYearlyEntity extends BaseEpmetEntity { - - private static final long serialVersionUID = 1L; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 文章发布所属机关ID 文章发布所属机关ID - */ - private String agencyId; - - /** - * 网格ID - */ - private String gridId; - - /** - * 标签ID 标签ID - */ - private String tagId; - - /** - * 标签名称 标签名称 - */ - private String tagName; - - /** - * 文章引用标签阅读数 文章引用标签阅读数 - */ - private Integer tagReadCount; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - -} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java index 5d3ee0c762..e79ed8c1d5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java @@ -18,7 +18,7 @@ package com.epmet.service.publicity; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; +import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import java.util.List; @@ -36,7 +36,7 @@ public interface PublicityService { * @param tokenDto * @author jyy */ - FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); + FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto); /** * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java index fecabf3eaf..e65b569d23 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -19,15 +19,13 @@ package com.epmet.service.publicity.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; -import com.epmet.dao.publicity.FactArticlePublishedAgencyDailyDao; -import com.epmet.dao.publicity.FactTagViewedAgencyMonthlyDao; -import com.epmet.dao.publicity.FactTagViewedAgencyQuarterlyDao; -import com.epmet.dao.publicity.FactTagViewedAgencyYearlyDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; -import com.epmet.publicity.dto.result.FactArticlePublishedAgencyDailyDTO; + +import com.epmet.dao.publicity.PublicityDao; +import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; import com.epmet.publicity.dto.result.FactTagAgencyDTO; import com.epmet.service.publicity.PublicityService; @@ -36,7 +34,6 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - import java.util.Date; import java.util.List; @@ -48,15 +45,8 @@ import java.util.List; */ @Service public class PublicityServiceImpl implements PublicityService { - - @Autowired - private FactArticlePublishedAgencyDailyDao factArticlePublishedAgencyDailyDao;//机关每日发文 - @Autowired - private FactTagViewedAgencyMonthlyDao factTagViewedAgencyMonthlyDao;//机关-每月-阅读 - @Autowired - private FactTagViewedAgencyQuarterlyDao factTagViewedAgencyQuarterlyDao;//机关-每季度-阅读 @Autowired - private FactTagViewedAgencyYearlyDao factTagViewedAgencyYearlyDao;//机关-每年-阅读 + private PublicityDao publicityDao;//机关每日发文 @Autowired private EpmetUserOpenFeignClient epmetUserOpenFeignClient; @@ -66,9 +56,10 @@ public class PublicityServiceImpl implements PublicityService { * @author jyy */ @Override - public FactArticlePublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { + public FactPublishedAgencyDailyDTO summaryInfo(TokenDto tokenDto) { String agencyId = this.getLoginUserDetails(tokenDto); - return factArticlePublishedAgencyDailyDao.summaryInfo(agencyId); + agencyId="b9e295f8c1906a0d1c5e0b313afcda3f"; + return publicityDao.summaryInfo(agencyId); } @@ -87,15 +78,15 @@ public class PublicityServiceImpl implements PublicityService { if (StringUtils.equals("month", type)) {//当月 String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); - return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); - return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 - return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize); } else { return null; @@ -105,7 +96,7 @@ public class PublicityServiceImpl implements PublicityService { } /** - * @param tokenDto,pageSize,type + * @param tokenDto pageSize type * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 * @author jyy */ @@ -119,15 +110,15 @@ public class PublicityServiceImpl implements PublicityService { if (StringUtils.equals("month", type)) {//当月 String monthId = strDate.substring(0, 4) + strDate.substring(5, 7); - return factTagViewedAgencyMonthlyDao.getMonthlyCountByTag(agencyId, monthId, pageSize); + return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); - return factTagViewedAgencyQuarterlyDao.getQuarterlyCountByTag(agencyId, quarterId, pageSize); + return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 - return factTagViewedAgencyYearlyDao.getYearlyCountByTag(agencyId, yearId, pageSize); + return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize); } else { return null; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml deleted file mode 100644 index c7897f6aec..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedAgencyDailyDao.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml deleted file mode 100644 index 9ea91a5f1a..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedDepartmentDailyDao.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml deleted file mode 100644 index a38deee2c2..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactArticlePublishedGridDailyDao.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml deleted file mode 100644 index f4806e8e40..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyMonthlyDao.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml deleted file mode 100644 index 9c10faf1b1..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyQuarterlyDao.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml deleted file mode 100644 index 3384db1368..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagUsedAgencyYearlyDao.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml deleted file mode 100644 index 9800e7e6d8..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyDailyDao.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml deleted file mode 100644 index 937da74e63..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyMonthlyDao.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml deleted file mode 100644 index 5ff395280d..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyQuarterlyDao.xml +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml deleted file mode 100644 index e0b274080d..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedAgencyYearlyDao.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml deleted file mode 100644 index 0c7fa42162..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridDailyDao.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml deleted file mode 100644 index dab09fcbc0..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridMonthlyDao.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml deleted file mode 100644 index e54d037353..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridQuarterlyDao.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml deleted file mode 100644 index 347c54204a..0000000000 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/FactTagViewedGridYearlyDao.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml new file mode 100644 index 0000000000..73ec0850fb --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From aea9c2b6f824b79e0ffe8ed475f6218eed3b264c Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 23 Jun 2020 11:21:01 +0800 Subject: [PATCH 094/101] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/mapper/issue/IssueDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml index b9b83d0f2f..19e81a0cb5 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/issue/IssueDao.xml @@ -33,7 +33,7 @@ INNER JOIN dim_agency da ON fiad.AGENCY_ID = da.ID WHERE fiad.DEL_FLAG = '0' - AND PID = #{agencyId} + AND fiad.PID = #{agencyId} GROUP BY AGENCY_ID @@ -60,7 +60,7 @@ VOTING_INCR, SHIFT_PROJECT_INCR, CLOSED_INCR, - DATE_FORMAT(DATE_ID, '%Y/%m/%d') + DATE_FORMAT(DATE_ID, '%Y/%m/%d') AS DATE_NAME FROM fact_issue_agency_daily fiad WHERE DEL_FLAG = '0' @@ -76,7 +76,7 @@ VOTING_INCR, SHIFT_PROJECT_INCR, CLOSED_INCR, - DATE_FORMAT(STR_TO_DATE(MONTH_ID,'%Y%m'), '%Y/%m') AS MONTH_ID + DATE_FORMAT(STR_TO_DATE(MONTH_ID,'%Y%m'), '%Y/%m') AS DATE_NAME FROM fact_issue_agency_monthly fiam WHERE DEL_FLAG = '0' From 3d806673d4740d3278a482d74ddc7bb7c8bc5a6d Mon Sep 17 00:00:00 2001 From: yinzuomei <576302893@qq.com> Date: Tue, 23 Jun 2020 11:49:11 +0800 Subject: [PATCH 095/101] =?UTF-8?q?=E7=BB=84=E7=BB=87=E8=83=BD=E5=8A=9B-?= =?UTF-8?q?=E6=B3=A8=E5=86=8C=E7=94=A8=E6=88=B7=E5=A2=9E=E9=87=8F=E6=8A=98?= =?UTF-8?q?=E7=BA=BF=E5=9B=BE=E5=88=9D=E5=A7=8B=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../epmet/commons/tools/utils/DateUtils.java | 109 +++++++++++++-- .../epmet/constant/UserAnalysisConstant.java | 3 + .../dto/result/user/UserIncrTrendResDTO.java | 20 +++ .../result/user/UserIncrTrendResultDTO.java | 6 +- .../com/epmet/dao/user/UserAnalysisDao.java | 37 +++++ .../user/impl/UserAnalysisServiceImpl.java | 129 +++++++++++++++++- .../resources/mapper/user/UserAnalysisDao.xml | 70 ++++++++++ 7 files changed, 363 insertions(+), 11 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java 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 482ddd52b3..532420581a 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 @@ -16,10 +16,7 @@ import org.joda.time.format.DateTimeFormatter; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.List; +import java.util.*; /** * 日期处理工具类 @@ -49,7 +46,7 @@ public class DateUtils { public static final String MONTH_NAME_PATTERN = "yyyy年MM月"; public static final String DATE_PATTERN_YYYY = "yyyy"; public static final String DATE_PATTERN_YYYYMM = "yyyyMM"; - + public static final String DATE_PATTERN_YYYY_MM = "yyyy-MM"; public static final String WEEK_TYPE_ENGLISH = "english"; public static final String WEEK_TYPE_CHINESE = "chinese"; @@ -367,15 +364,111 @@ public class DateUtils { /** * @return java.lang.String - * @param dateStr yyyyMMdd + * @param dateStr yyyyMMdd返回yyyy.MM.dd yyyyMM返回yyyy/MM * @author yinzuomei * @description 返回yyyy.MM.dd * @Date 2020/6/22 18:38 **/ - public static String getDatePointPattern(String dateStr){ + public static String getxAxisDatePattern(String dateStr,String character){ if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==8){ - return String.valueOf(new StringBuffer(dateStr).insert(4,".").insert(7,".")); + return String.valueOf(new StringBuffer(dateStr).insert(4,character).insert(7,character)); + }else if(StringUtils.isNotBlank(dateStr)&&dateStr.length()==6){ + return String.valueOf(new StringBuffer(dateStr).insert(4,character)); } return dateStr; } + + /** + * @return java.lang.String + * @param beforDay + * @author yinzuomei + * @description 获取当前日期的前n天 返回yyyyMMdd + * @Date 2020/6/23 1:50 + **/ + public static String getBeforeNDay(int beforDay){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.DATE, - beforDay); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMMDD); + } + + /** + * @return java.lang.String + * @param beforMonth + * @author yinzuomei + * @description 获取当前 月份的前n月 返回yyyyMM + * @Date 2020/6/23 1:50 + **/ + public static String getBeforeNMonth(int beforMonth){ + Calendar c = Calendar.getInstance(); + c.add(Calendar.MONTH, - beforMonth); + Date date = c.getTime(); + return DateUtils.format(date,DateUtils.DATE_PATTERN_YYYYMM); + } + + /** + * @return java.util.List 返回yyyyMMdd + * @param startTime yyyyMMdd + * @param endTime yyyyMMdd + * @author yinzuomei + * @description 获取两个日期之间所有的日期集合,包含开始结束 + * @Date 2020/6/23 1:26 + **/ + public static List getDaysBetween(String startTime, String endTime){ + // 返回的日期集合 + List days = new ArrayList(); + try{ + Date start = DateUtils.parse(startTime,DateUtils.DATE_PATTERN_YYYYMMDD); + Date end = DateUtils.parse(endTime,DateUtils.DATE_PATTERN_YYYYMMDD); + + Calendar tempStart = Calendar.getInstance(); + tempStart.setTime(start); + + Calendar tempEnd = Calendar.getInstance(); + tempEnd.setTime(end); + // 日期加1(包含结束) + tempEnd.add(Calendar.DATE, +1); + while (tempStart.before(tempEnd)) { + days.add(DateUtils.format(tempStart.getTime(),DateUtils.DATE_PATTERN_YYYYMMDD)); + tempStart.add(Calendar.DAY_OF_YEAR, 1); + } + }catch (Exception e){ + e.printStackTrace(); + } + return days; + } + + /** + * @return java.util.List + * @param minDate yyyMM + * @param maxDate yyyyMM + * @author yinzuomei + * @description 计算两个月份中间所有的月份包含起始 + * @Date 2020/6/23 2:10 + **/ + public static List getMonthBetween(String minDate, String maxDate){ + ArrayList result = new ArrayList(); + try{ + SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");//格式化为年月 + + Calendar min = Calendar.getInstance(); + Calendar max = Calendar.getInstance(); + + min.setTime(sdf.parse(minDate)); + min.set(min.get(Calendar.YEAR), min.get(Calendar.MONTH), 1); + + max.setTime(sdf.parse(maxDate)); + max.set(max.get(Calendar.YEAR), max.get(Calendar.MONTH), 2); + + Calendar curr = min; + while (curr.before(max)) { + result.add(sdf.format(curr.getTime())); + curr.add(Calendar.MONTH, 1); + } + min = null;max = null;curr = null; + }catch(Exception e){ + e.printStackTrace(); + } + return result; + } } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java index ffd096b2bd..f42d52fb72 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/constant/UserAnalysisConstant.java @@ -34,4 +34,7 @@ public interface UserAnalysisConstant { * 党员 */ String PARTYMEMBER="党员"; + + String DAY_TYPE="day"; + String MONTH_TYPE="month"; } diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java new file mode 100644 index 0000000000..a7f4e87dc5 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.result.user; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 描述一下 + * + * @author yinzuomei@elink-cn.com + * @date 2020/6/23 9:13 + */ +@Data +public class UserIncrTrendResDTO implements Serializable { + private static final long serialVersionUID = 290620373673325352L; + private Integer regIncr; + private Integer warmIncr; + private Integer partymemberIncr; + private String dateIdOrMonthId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java index d36d7aba03..bfd9b17535 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/user/UserIncrTrendResultDTO.java @@ -1,5 +1,6 @@ package com.epmet.dto.result.user; +import com.fasterxml.jackson.annotation.JsonIgnore; import lombok.Data; import java.io.Serializable; @@ -13,7 +14,7 @@ import java.io.Serializable; @Data public class UserIncrTrendResultDTO implements Serializable { /** - * 日期如果按日查询返回yyyy-MM-dd,如果按月返回yyyy-MM + * 日期如果按日查询返回yyyy/MM/dd,如果按月返回yyyy/MM */ private String date; @@ -27,4 +28,7 @@ public class UserIncrTrendResultDTO implements Serializable { */ private Integer value; + // yyyyMMdd yyyyMM + @JsonIgnore + private String dateOrMonthId; } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java index 2fd8c6b3c8..feba486e41 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/user/UserAnalysisDao.java @@ -3,6 +3,7 @@ package com.epmet.dao.user; import com.epmet.dto.DimAgencyDTO; import com.epmet.dto.DimGridDTO; +import com.epmet.dto.result.user.UserIncrTrendResDTO; import com.epmet.dto.result.user.UserSubAgencyResDTO; import com.epmet.dto.result.user.UserSubGridResDTO; import com.epmet.dto.result.user.UserSummaryInfoResultDTO; @@ -95,4 +96,40 @@ public interface UserAnalysisDao { * @Date 2020/6/23 0:18 **/ List selectRegSubGridRes(@Param("dateId")String dateId, @Param("agencyId") String agencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectRegDayIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectRegMonthIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectParticipationUserDayIncr(@Param("agencyId")String myAgencyId); + + /** + * @return java.util.List + * @param myAgencyId + * @author yinzuomei + * @description + * @Date 2020/6/23 11:24 + **/ + List selectParticipationUserMonthIncr(@Param("agencyId") String myAgencyId); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java index dbc4d20f2e..655b6febae 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/user/impl/UserAnalysisServiceImpl.java @@ -89,7 +89,7 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { userSummaryInfoResultDTO=userAnalysisDao.selectRegUserSummaryInfo(myAgencyId); } if(null!=userSummaryInfoResultDTO){ - userSummaryInfoResultDTO.setCurrentDate(DateUtils.getDatePointPattern(userSummaryInfoResultDTO.getCurrentDate())); + userSummaryInfoResultDTO.setCurrentDate(DateUtils.getxAxisDatePattern(userSummaryInfoResultDTO.getCurrentDate(),".")); //提取出工具类 userSummaryInfoResultDTO.setPartymemberProportion(userSummaryInfoResultDTO.getPartymemberProportionValue().stripTrailingZeros().toPlainString()); userSummaryInfoResultDTO.setWarmHeartedProportion(userSummaryInfoResultDTO.getWarmHeartedProportionValue().stripTrailingZeros().toPlainString()); @@ -295,6 +295,131 @@ public class UserAnalysisServiceImpl implements UserAnalysisService { **/ @Override public List incrTrend(UserIncrTrendFormDTO formDTO) { - return null; + //获取用户所属机关id + String myAgencyId = this.getMyAgency(); + List dimList = this.initUserIncrTrendResultDTO(formDTO.getType()); + if(CollectionUtils.isEmpty(dimList)){ + logger.error("横坐标初始失败"); + return new ArrayList<>(); + } + List list=new ArrayList<>(); + if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //注册用户数、日 + list=userAnalysisDao.selectRegDayIncr(myAgencyId); + } else if (UserAnalysisConstant.REG_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //注册用户数、月 + list=userAnalysisDao.selectRegMonthIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.DAY_TYPE.equals(formDTO.getType())) { + //参与用户数、日 + list=userAnalysisDao.selectParticipationUserDayIncr(myAgencyId); + } else if (UserAnalysisConstant.PARTI_FLAG.equals(formDTO.getRegOrPartiFlag()) && UserAnalysisConstant.MONTH_TYPE.equals(formDTO.getType())) { + //参与用户数、月 + list=userAnalysisDao.selectParticipationUserMonthIncr(myAgencyId); + } else { + logger.error("参数错误"); + return new ArrayList<>(); + } + for(UserIncrTrendResultDTO dim:dimList){ + boolean flag=false; + for(UserIncrTrendResDTO userIncrTrendResDTO:list){ + if(dim.getDateOrMonthId().equals(userIncrTrendResDTO.getDateIdOrMonthId())){ + flag=true; + //居民、热心居民、党员总数,用于排序 + switch(dim.getType()){ + case UserAnalysisConstant.REGISTERED_RESI: + dim.setValue(userIncrTrendResDTO.getRegIncr()); + break; + case UserAnalysisConstant.WARMHEARTED: + dim.setValue(userIncrTrendResDTO.getWarmIncr()); + break; + case UserAnalysisConstant.PARTYMEMBER: + dim.setValue(userIncrTrendResDTO.getPartymemberIncr()); + break; + default: + break; + } + + } + } + if(!flag){ + logger.error(String.format("机关id%s缺少记录dateOrMonthId=%s",myAgencyId,dim.getDateOrMonthId())); + } + } + return dimList; + } + + private List initUserIncrTrendResultDTO(String type) { + List list=new ArrayList<>(); + if(UserAnalysisConstant.DAY_TYPE.equals(type)){ + List dateIdList= DateUtils.getDaysBetween(DateUtils.getBeforeNDay(90), + DateUtils.getBeforeNDay(1)); + for(String dateId:dateIdList){ + String date=DateUtils.getxAxisDatePattern(dateId,"/"); + //居民 + UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); + resi.setDate(date); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setValue(NumConstant.ZERO); + resi.setDateOrMonthId(dateId); + //热心居民 + UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); + warm.setDate(date); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setValue(NumConstant.ZERO); + warm.setDateOrMonthId(dateId); + //党员 + UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); + party.setDate(date); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setValue(NumConstant.ZERO); + party.setDateOrMonthId(dateId); + list.add(resi); + list.add(warm); + list.add(party); + } + }else if(UserAnalysisConstant.MONTH_TYPE.equals(type)){ + List monthList= DateUtils.getMonthBetween(DateUtils.getBeforeNMonth(12), + DateUtils.getBeforeNMonth(1)); + for(String monthId:monthList){ + String date=DateUtils.getxAxisDatePattern(monthId,"/"); + //居民 + UserIncrTrendResultDTO resi=new UserIncrTrendResultDTO(); + resi.setDate(date); + resi.setType(UserAnalysisConstant.REGISTERED_RESI); + resi.setValue(NumConstant.ZERO); + resi.setDateOrMonthId(monthId); + //热心居民 + UserIncrTrendResultDTO warm=new UserIncrTrendResultDTO(); + warm.setDate(date); + warm.setType(UserAnalysisConstant.WARMHEARTED); + warm.setValue(NumConstant.ZERO); + warm.setDateOrMonthId(monthId); + //党员 + UserIncrTrendResultDTO party=new UserIncrTrendResultDTO(); + party.setDate(date); + party.setType(UserAnalysisConstant.PARTYMEMBER); + party.setValue(NumConstant.ZERO); + party.setDateOrMonthId(monthId); + list.add(resi); + list.add(warm); + list.add(party); + } + } + return list; } + + + /*public static void main(String[] args) { +// System.out.println("前一天"+DateUtils.getBeforeNDay(1)); +// System.out.println("前90天"+DateUtils.getBeforeNDay(90)); + List list= DateUtils.getDaysBetween("201912","202005"); + for(String m:list){ + System.out.println(m); + } +// System.out.println(list.size()); + System.out.println("上个月"+DateUtils.getBeforeNMonth(1)); + System.out.println("前8个月"+DateUtils.getBeforeNMonth(8)); + + }*/ + } diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml index f00dc28baf..408cf17e61 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/user/UserAnalysisDao.xml @@ -146,4 +146,74 @@ AND m.DATE_ID = #{dateId} AND m.AGENCY_ID = #{agencyId} + + + + + + + + + + \ No newline at end of file From 2987ddffa5fb1ca1722800fd81516cfd45155266 Mon Sep 17 00:00:00 2001 From: wxz Date: Tue, 23 Jun 2020 12:27:21 +0800 Subject: [PATCH 096/101] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/logback-spring.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml index cde009a097..347c3c808c 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/logback-spring.xml @@ -137,8 +137,8 @@ - - + + @@ -151,7 +151,7 @@ - + From 0eee56cbf79bfb2f2c4942ab7fe8e00f66a4d11a Mon Sep 17 00:00:00 2001 From: zxc <954985706@qq.com> Date: Tue, 23 Jun 2020 14:08:57 +0800 Subject: [PATCH 097/101] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=B0=8F=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/epmet/constant/GroupConstant.java | 4 +++ .../result/GridIdListByCustomerResultDTO.java | 25 ++++++++++++++ .../com/epmet/dao/org/CustomerGridDao.java | 3 +- .../epmet/service/group/GroupDataService.java | 3 +- .../group/impl/GroupDataServiceImpl.java | 4 +-- .../service/impl/StatsGroupServiceImpl.java | 33 +++++++++++++------ .../service/org/CustomerGridService.java | 3 +- .../org/impl/CustomerGridServiceImpl.java | 3 +- .../resources/mapper/org/CustomerGridDao.xml | 5 +-- 9 files changed, 64 insertions(+), 19 deletions(-) create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java index 255b463cdb..f7eccf24b1 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/GroupConstant.java @@ -29,4 +29,8 @@ public interface GroupConstant { String CITY = "city"; String PROVINCE = "province"; + String ERRORGRIDDAILY = "groupGridDaily ==>【网格小组统计出错了... 维度:网格-日】customerId为:"; + + String ERRORAGENCYDAILY = "groupAgencyDaily ==>【网格小组统计出错了... 维度:机关-日】customerId为:"; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java new file mode 100644 index 0000000000..4c2f1033c7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/group/result/GridIdListByCustomerResultDTO.java @@ -0,0 +1,25 @@ +package com.epmet.dto.group.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author zxc + * @CreateTime 2020/6/23 13:54 + */ +@Data +public class GridIdListByCustomerResultDTO implements Serializable { + + private static final long serialVersionUID = -4170349451726088582L; + + /** + * 网格ID + */ + private String GridId; + + /** + * 机关ID + */ + private String agencyId; +} 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 846dde48e8..faccf553a2 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 @@ -20,6 +20,7 @@ package com.epmet.dao.org; 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.entity.org.CustomerGridEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -57,5 +58,5 @@ public interface CustomerGridDao extends BaseDao { * @param dateId * @author zxc */ - List getCustomerGridIdList(@Param("customerId") String customerId, @Param("dateId") String dateId); + List getCustomerGridIdList(@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/service/group/GroupDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java index be00cca1dd..a6d61a756e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/GroupDataService.java @@ -1,7 +1,6 @@ package com.epmet.service.group; import com.epmet.dto.group.result.*; -import com.epmet.entity.stats.DimGridEntity; import com.epmet.util.DimIdGenerator; import org.apache.ibatis.annotations.Param; @@ -18,7 +17,7 @@ public interface GroupDataService { * @param customerId * @author zxc */ - List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List gridsInfo); + List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimIdBean, List gridsInfo); /** * @Description 获取同级机关下网格下的小组数量 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java index 0aa22e72ec..1cdc3acdcf 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/group/impl/GroupDataServiceImpl.java @@ -36,7 +36,7 @@ public class GroupDataServiceImpl implements GroupDataService { * @author zxc */ @Override - public List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List gridsInfo) { + public List groupGridDaily(String customerId, DimIdGenerator.DimIdBean dimTime, List gridsInfo) { List result = new ArrayList<>(); if (gridsInfo.size() == NumConstant.ZERO){ return new ArrayList<>(); @@ -46,7 +46,7 @@ public class GroupDataServiceImpl implements GroupDataService { GroupGridDailyResultDTO dailyResult = new GroupGridDailyResultDTO(); BeanUtils.copyProperties(dimTime,dailyResult); dailyResult.setAgencyId(grid.getAgencyId()); - dailyResult.setGridId(grid.getId()); + dailyResult.setGridId(grid.getGridId()); dailyResult.setCustomerId(customerId); result.add(dailyResult); }); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java index e4447e07ba..f91f0124b4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsGroupServiceImpl.java @@ -1,18 +1,19 @@ package com.epmet.service.impl; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.constant.GroupConstant; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.group.form.AgencyMonthlyFormDTO; import com.epmet.dto.group.result.*; import com.epmet.dto.stats.DimAgencyDTO; import com.epmet.entity.stats.DimAgencyEntity; -import com.epmet.entity.stats.DimGridEntity; import com.epmet.service.StatsGroupService; import com.epmet.service.group.GroupDataService; import com.epmet.service.org.CustomerGridService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -30,6 +31,7 @@ import java.util.stream.Collectors; * @CreateTime 2020/6/16 14:14 */ @Service +@Slf4j public class StatsGroupServiceImpl implements StatsGroupService { @Autowired @@ -63,10 +65,17 @@ public class StatsGroupServiceImpl implements StatsGroupService { customerIds = dimCustomerService.selectCustomerIdPage(pageNo,pageSize); if (customerIds.size() != NumConstant.ZERO){ customerIds.forEach(customerId -> { - DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); - List gridsInfo = dimGridService.getGridListByCustomerId(customerId); - List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); - factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); + try { + DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); + +// List gridsInfo = dimGridService.getGridListByCustomerId(customerId); + List gridsInfo = customerGridService.getCustomerGridIdList(customerId, dimIdBean.getDateId()); + + List resultDTOS = groupDataService.groupGridDaily(customerId,dimIdBean,gridsInfo); + factGroupGridDailyService.statisticsGroupGridDaily(resultDTOS,customerId); + } catch (Exception e) { + log.error(GroupConstant.ERRORGRIDDAILY+customerId,e); + } }); } @@ -87,9 +96,13 @@ public class StatsGroupServiceImpl implements StatsGroupService { if (customerIds.size() != NumConstant.ZERO){ DimIdGenerator.DimIdBean dimIdBean = this.getDimIdBean(date); customerIds.forEach(customerId -> { - List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); - List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); - factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); + try { + List customerAgencyInfos = dimAgencyService.getAgencyInfoByCustomerId(customerId); + List agencyGroupDaily = this.getAgencyGroupDaily(customerAgencyInfos, dimIdBean, customerId); + factGroupAgencyDailyService.insertGroupAgencyDaily(agencyGroupDaily,customerId); + } catch (Exception e) { + log.error(GroupConstant.ERRORAGENCYDAILY+customerId,e); + } }); } }while (customerIds.size() != NumConstant.ZERO && customerIds.size() == pageSize); @@ -139,12 +152,12 @@ public class StatsGroupServiceImpl implements StatsGroupService { String pidByAgencyId = dimAgencyService.getPidByAgencyId(agencyId); agencyResult.setPid(StringUtils.isBlank(pidByAgencyId)?"0":pidByAgencyId); // TODO 1. 机关下有多少网格 - List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); + List customerGridIdList = customerGridService.getCustomerGridIdList(customerId, dateId); AtomicReference gridSize = new AtomicReference<>(0); if (customerGridIdList.size() != NumConstant.ZERO){ customerGridIdList.forEach(gridId -> { allGrid.forEach(allAgencyGrid -> { - if (gridId.equals(allAgencyGrid)){ + if (gridId.getGridId().equals(allAgencyGrid)){ gridSize.updateAndGet(v -> v + NumConstant.ONE); } }); 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 cd82c81628..00b46e8b75 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 @@ -2,6 +2,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.entity.org.CustomerGridEntity; import java.util.Date; @@ -30,5 +31,5 @@ public interface CustomerGridService { * @param dateId * @author zxc */ - List getCustomerGridIdList(String customerId,String dateId); + List getCustomerGridIdList(String customerId, String dateId); } 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 d3e7a51087..fc95a3de29 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 @@ -5,6 +5,7 @@ import com.epmet.constant.DataSourceConstant; 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.entity.org.CustomerGridEntity; import com.epmet.service.org.CustomerGridService; import org.springframework.beans.factory.annotation.Autowired; @@ -42,7 +43,7 @@ public class CustomerGridServiceImpl implements CustomerGridService { * @author zxc */ @Override - public List getCustomerGridIdList(String customerId, String dateId) { + public List getCustomerGridIdList(String customerId, String dateId) { return customerGridDao.getCustomerGridIdList(customerId, dateId); } } 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 0eb2f74b45..6a5253e473 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 @@ -36,9 +36,10 @@ - SELECT - id AS gridId + id AS gridId, + pid AS agencyId FROM customer_grid WHERE From 4c47e291ba07743e3a65227f7f109da4f11481fa Mon Sep 17 00:00:00 2001 From: jiangyuying Date: Tue, 23 Jun 2020 14:56:19 +0800 Subject: [PATCH 098/101] =?UTF-8?q?=E5=AE=A3=E4=BC=A0=E8=83=BD=E5=8A=9B--N?= =?UTF-8?q?EI=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/FactPublishedAgencyDTO.java | 20 ++- .../result/FactPublishedAgencyDailyDTO.java | 86 +-------- .../result/FactPublishedDepartmentDTO.java | 2 +- .../dto/result/FactPublishedGridDTO.java | 2 +- .../publicity/PublicityController.java | 44 ++++- .../com/epmet/dao/publicity/PublicityDao.java | 64 ++++++- .../service/publicity/PublicityService.java | 26 ++- .../publicity/impl/PublicityServiceImpl.java | 105 +++++++++-- .../mapper/publicity/PublicityDao.xml | 165 +++++++++++++++++- 9 files changed, 403 insertions(+), 111 deletions(-) diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java index 6d1144a2c8..9357d45f2d 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDTO.java @@ -33,21 +33,29 @@ public class FactPublishedAgencyDTO implements Serializable { private static final long serialVersionUID = 1L; + /** + * 机关名称 + */ + private String name; + /** + * 发文数量 + */ + private Integer value; /** - * 累计发文总数 + * 固定值:文章数量 */ - private Integer publishedTotal; + private String type="文章数量"; /** - * 发布中的文章总数 + * 机关Id */ - private Integer publishingTotal; + private String agencyId; /** - * 数据截止日期 + * 上级机关Id */ - private String dateName; + private String pid; } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java index 50f07bcb8f..02eb3446a7 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedAgencyDailyDTO.java @@ -17,13 +17,13 @@ package com.epmet.publicity.dto.result; -import java.io.Serializable; -import java.util.Date; import lombok.Data; +import java.io.Serializable; + /** - * 文章发布数量【机关】日统计表 + * 文章发表数量—下级机关统计 * * @author generator generator@elink-cn.com * @since v1.0.0 2020-06-19 @@ -33,89 +33,21 @@ public class FactPublishedAgencyDailyDTO implements Serializable { private static final long serialVersionUID = 1L; - /** - * ID ID - */ - private String id; - - /** - * 客户ID 客户ID - */ - private String customerId; - - /** - * 上级机关ID 上级机关ID - */ - private String pid; - - /** - * 机关ID - */ - private String agencyId; - - /** - * 文章累计发文数量 文章数量 - */ - private Integer articleTotalCount; /** - * 当前发文数量 当前未下线的文章数量 + * 累计发文总数 */ - private Integer articlePublishedCount; + private Integer publishedTotal; /** - * 日期ID 日期ID + * 发布中的文章总数 */ - private String dateId; + private Integer publishingTotal; /** - * 周ID 周ID eg:2020W01 = 2020年第一周 + * 数据截止日期 */ - private String weekId; + private String dateName; - /** - * 月份ID 月份ID eg:202006 = 2020年6月、2020-07 = 2020年7月 - */ - private String monthId; - - /** - * 季度ID 季度ID eg:2020Q1 = 2020年第一季度、2020Q2 = 2020年第二季度、2020Q3 = 2020年第三季度、2020Q4 = 2020年第四季度 - */ - private String quarterId; - - /** - * 年度ID 年度ID eg:2020 = 2020年、2021 = 2021年 - */ - private String yearId; - - /** - * 删除状态 - */ - 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-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java index bc26c9fb50..11aa1e2cea 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedDepartmentDTO.java @@ -34,7 +34,7 @@ public class FactPublishedDepartmentDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * 机关名称 + * 部门名称 */ private String name; diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java index ad8a3e6c9e..909deb2ba4 100644 --- a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/publicity/dto/result/FactPublishedGridDTO.java @@ -34,7 +34,7 @@ public class FactPublishedGridDTO implements Serializable { private static final long serialVersionUID = 1L; /** - * 机关名称 + * 网格名称 */ private String name; diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java index 9f64bec3e4..56d31b9d17 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/controller/publicity/PublicityController.java @@ -23,11 +23,13 @@ import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.publicity.dto.form.TagFormDTO; -import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; -import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.publicity.dto.result.*; import com.epmet.service.publicity.PublicityService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; @@ -91,4 +93,40 @@ public class PublicityController { return new Result>().ok(publicityService.tagused(tokenDto, pageSize, type)); } + /** + * @param tokenDto 登录者token + * @Description 获取下级机关发文数 + * @author jyy + */ + @PostMapping("subagency/publishedarticle") + public Result> subagencyPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.subagencyPublishedarticle(tokenDto, type)); + } + + /** + * @param tokenDto 登录者token + * @Description 获取直属部门发文数 + * @author jyy + */ + @PostMapping("department/publishedarticle") + public Result> departmentPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.departmentPublishedarticle(tokenDto, type)); + } + + /** + * @param tokenDto 登录者token + * @Description 获取指数网格发文数 + * @author jyy + */ + @PostMapping("subgrid/publishedarticle") + public Result> subgridPublishedarticle(@LoginUser TokenDto tokenDto, @RequestBody TagFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, TagFormDTO.GroupJava.class); + String type = formDTO.getType(); + return new Result>().ok(publicityService.subgridPublishedarticle(tokenDto, type)); + } + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java index aa2475e2c5..33801156b9 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/dao/publicity/PublicityDao.java @@ -17,8 +17,7 @@ package com.epmet.dao.publicity; -import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; -import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.publicity.dto.result.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -81,5 +80,66 @@ public interface PublicityDao { * @author zxc */ List getUsedYearlyCountByTag(@Param("agencyId") String agencyId, @Param("yearId") String yearId, @Param("pageSize") Integer pageSize); + + /** + * @Description 当月———下级机发文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubAgencyPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级机发文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubAgencyPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级机发文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubAgencyPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * @Description 当月———下级部门文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubDepartPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级部门文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubDepartPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级部门文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubDepartPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + + /** + * @Description 当月———下级网格文数 + * @param agencyId,monthId 机关id,月 + * @author zxc + */ + List getSubGridPublishedMonth(@Param("agencyId") String agencyId, @Param("monthId") String monthId); + + /** + * @Description 当季———下级网格文数 + * @param agencyId,quarterId 机关id,季度 + * @author zxc + */ + List getSubGridPublishedQuarter(@Param("agencyId") String agencyId, @Param("quarterId") String quarterId); + /** + * @Description 当年———下级网格文数 + * @param agencyId,yearId 机关id,年 + * @author zxc + */ + List getSubGridPublishedYear(@Param("agencyId") String agencyId, @Param("yearId") String yearId); + } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java index e79ed8c1d5..9eccb5b29f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/PublicityService.java @@ -18,9 +18,12 @@ package com.epmet.service.publicity; import com.epmet.commons.tools.security.dto.TokenDto; -import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; -import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.publicity.dto.result.*; +import org.apache.commons.lang3.StringUtils; +import java.util.Date; import java.util.List; /** @@ -52,5 +55,24 @@ public interface PublicityService { */ public List tagused(TokenDto tokenDto, Integer pageSize, String type) ; + /** + * @param tokenDto type + * @Description 获取下级机关发文数 + * @author jyy + */ + public List subagencyPublishedarticle(TokenDto tokenDto, String type) ; + /** + * @param tokenDto type + * @Description 获取直属部门发文数 + * @author jyy + */ + public List departmentPublishedarticle(TokenDto tokenDto, String type); + + /** + * @param tokenDto type + * @Description 获取指数网格发文数 + * @author jyy + */ + public List subgridPublishedarticle(TokenDto tokenDto, String type); } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java index e65b569d23..10f19b3ea0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/publicity/impl/PublicityServiceImpl.java @@ -19,15 +19,11 @@ package com.epmet.service.publicity.impl; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.commons.tools.utils.DateUtils; +import com.epmet.dao.publicity.PublicityDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; import com.epmet.dto.result.LoginUserDetailsResultDTO; import com.epmet.feign.EpmetUserOpenFeignClient; - - -import com.epmet.dao.publicity.PublicityDao; -import com.epmet.publicity.dto.result.FactPublishedAgencyDailyDTO; - -import com.epmet.publicity.dto.result.FactTagAgencyDTO; +import com.epmet.publicity.dto.result.*; import com.epmet.service.publicity.PublicityService; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; @@ -65,7 +61,7 @@ public class PublicityServiceImpl implements PublicityService { /** * @param tokenDto,formDTO - * @Description 宣传能力—工作端—宣传能力-获取阅读最多的分类数据 + * @Description 宣传能力—工作端-获取阅读最多的分类数据 * @author jyy */ @Override @@ -81,23 +77,20 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getViewedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); return publicityDao.getViewedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 - return publicityDao.getViewedYearlyCountByTag(agencyId, yearId, pageSize); } else { return null; } - - } /** * @param tokenDto pageSize type - * @Description 宣传能力—工作端—宣传能力-获取发表最多的分类数据 + * @Description 宣传能力—工作端-获取发表最多的分类数据 * @author jyy */ @Override @@ -113,18 +106,102 @@ public class PublicityServiceImpl implements PublicityService { return publicityDao.getUsedMonthlyCountByTag(agencyId, monthId, pageSize); } else if (StringUtils.equals("quarter", type)) {//当季 - String quarterId = strDate + "Q" + DateUtils.getQuarterIndex(date); + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); return publicityDao.getUsedQuarterlyCountByTag(agencyId, quarterId, pageSize); } else if (StringUtils.equals("year", type)) {//当年 - return publicityDao.getUsedYearlyCountByTag(agencyId, yearId, pageSize); } else { return null; } + } + + /** + * @param tokenDto type + * @Description 获取下级机关发文数 + * @author jyy + */ + @Override + public List subagencyPublishedarticle(TokenDto tokenDto, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "1041fe5e8499dbd8add314291d2f6da4"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubAgencyPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubAgencyPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubAgencyPublishedYear(agencyId, yearId); + + } else { + return null; + } + } + + /** + * @param tokenDto type + * @Description 获取直属部门发文数 + * @author jyy + */ + @Override + public List departmentPublishedarticle(TokenDto tokenDto, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubDepartPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubDepartPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubDepartPublishedYear(agencyId, yearId); + + } else { + return null; + } + } + /** + * @param tokenDto type + * @Description 获取指数网格发文数 + * @author jyy + */ + @Override + public List subgridPublishedarticle(TokenDto tokenDto, String type) { +// String agencyId = this.getLoginUserDetails(tokenDto); + String agencyId = "0d2ffe9fce682b602b9d451226d08fae"; + Date date = new Date(); + String strDate = DateUtils.format(date, DateUtils.DATE_PATTERN_YYYYMMDD); + String yearId = strDate.substring(0, 4); + String monthId = strDate.substring(0, 6); + + if (StringUtils.equals("month", type)) {//当月 + return publicityDao.getSubGridPublishedMonth(agencyId, monthId); + + } else if (StringUtils.equals("quarter", type)) {//当季 + String quarterId = yearId + "Q" + DateUtils.getQuarterIndex(date); + return publicityDao.getSubGridPublishedQuarter(agencyId, quarterId); + + } else if (StringUtils.equals("year", type)) {//当年 + return publicityDao.getSubGridPublishedYear(agencyId, yearId); + } else { + return null; + } } /** diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml index 73ec0850fb..ccd4fb657e 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/publicity/PublicityDao.xml @@ -8,7 +8,7 @@ SELECT article_total_count AS publishedTotal, article_published_count AS publishingTotal, - DATE_FORMAT( date_id, '%Y-%m-%d' ) AS dateName + DATE_FORMAT( date_id, '%Y.%m.%d' ) AS dateName FROM fact_article_published_agency_daily where agency_id = #{agencyId} @@ -74,8 +74,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -90,8 +89,7 @@ - SELECT tag_name AS name, agency_id AS agencyId, @@ -104,4 +102,161 @@ ORDER BY value DESC LIMIT #{pageSize} + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 2c0ee7397c4167ac65a2c70fb546ee109982d36b Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Tue, 23 Jun 2020 15:09:07 +0800 Subject: [PATCH 099/101] =?UTF-8?q?=E6=95=B0=E6=8D=AE-=E9=A1=B9=E7=9B=AE-?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E8=B0=83=E6=95=B4=E3=80=81=E5=AE=9A=E6=97=B6?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../project/impl/ProjectServiceImpl.java | 19 +- .../project/form/MonthProjectListFormDTO.java | 14 +- .../feign/DataStatisticalOpenFeignClient.java | 14 ++ ...ataStatisticalOpenFeignClientFallBack.java | 18 ++ .../controller/StatsProjectController.java | 23 ++- .../epmet/service/StatsProjectService.java | 10 +- .../service/impl/StatsProjectServiceImpl.java | 183 +++++++++--------- .../stats/FactAgencyProjectDailyDao.xml | 6 +- .../mapper/stats/FactGridProjectDailyDao.xml | 6 +- .../epmet/service/StatsProjectService.java | 23 +++ .../service/impl/StatsProjectServiceImpl.java | 34 ++++ .../epmet/task/StatsProjectAgencyTask.java | 32 +++ .../com/epmet/task/StatsProjectGridTask.java | 35 ++++ 13 files changed, 298 insertions(+), 119 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java index 35769c0a39..1d8871803d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/project/impl/ProjectServiceImpl.java @@ -16,6 +16,9 @@ import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; @@ -43,8 +46,14 @@ public class ProjectServiceImpl implements ProjectService { //2:根据agencyId查询项目统计数据 ProjectSummaryResultDTO resultDTO = projectDao.selectProjectSummary(agencyId); if (null != resultDTO) { - resultDTO.setPendingRatio(resultDTO.getPendingRatioInt().stripTrailingZeros().toString() + "%"); - resultDTO.setClosedRatio(resultDTO.getClosedRatioInt().stripTrailingZeros().toString() + "%"); + //将结果转成百分比 + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMaximumFractionDigits(2); + //四舍五入保留小数点后四位 + BigDecimal pendingRatio = resultDTO.getPendingRatioInt().setScale(4, RoundingMode.HALF_UP); + //将小数转成百分比 + resultDTO.setPendingRatio(percent.format(pendingRatio.doubleValue())); + resultDTO.setClosedRatio(percent.format(resultDTO.getClosedRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); } return resultDTO; } @@ -62,8 +71,12 @@ public class ProjectServiceImpl implements ProjectService { //2:根据agencyId查询各状态统计数据 resultList = projectDao.selectSummaryInfo(agencyId); if (null != resultList && resultList.size() > NumConstant.ZERO) { + //将结果转成百分比 + NumberFormat percent = NumberFormat.getPercentInstance(); + percent.setMaximumFractionDigits(2); resultList.forEach(sum -> { - sum.setRatio(sum.getRatioInt().stripTrailingZeros().toString() + "%"); + //先四舍五入保留四位小数再把小数转成百分比 + sum.setRatio(percent.format(sum.getRatioInt().setScale(4, RoundingMode.HALF_UP).doubleValue())); }); } return resultList; diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java index 73045ccb3c..b0ff888330 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/form/MonthProjectListFormDTO.java @@ -18,6 +18,10 @@ public class MonthProjectListFormDTO implements Serializable { * 客户Id */ private String customerId; + /** + * 月维度Id + */ + private String monthId; /** * 机关Id @@ -29,14 +33,4 @@ public class MonthProjectListFormDTO implements Serializable { */ private String gridId; - /** - * 起始时间 - */ - private Date startTime; - - /** - * 结束时间 - */ - private Date endTime; - } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java index 01c9953043..3b914706b7 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java @@ -104,4 +104,18 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/statsgroup/groupagencymonthly") Result groupAgencyMonthly(); + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/agencyprojectstats") + Result agencyProjectStats(); + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @PostMapping("/data/stats/statsproject/gridprojectstats") + Result gridProjectStats(); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 1ccec983eb..4cd8be3729 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -109,4 +109,22 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result groupAgencyMonthly() { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly"); } + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @Override + public Result agencyProjectStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyProjectStats"); + } + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @Override + public Result gridProjectStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "gridProjectStats"); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java index 7d6c958d66..0b1bd0eb47 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsProjectController.java @@ -1,10 +1,11 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; -import com.epmet.service.StatsDemoService; import com.epmet.service.StatsProjectService; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; /** * 数据统计-项目 @@ -19,11 +20,21 @@ public class StatsProjectController { /** * @Author sun - * @Description 数据-项目-机关、网格日(月)统计 + * @Description 数据-项目-机关日(月)统计 **/ - @PostMapping("projectstats") - public Result agencyGridProjectStats() { - statsProjectService.agencyGridProjectStats(); + @PostMapping("agencyprojectstats") + public Result agencyProjectStats() { + statsProjectService.agencyProjectStats(); + return new Result(); + } + + /** + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + @PostMapping("gridprojectstats") + public Result gridProjectStats() { + statsProjectService.gridProjectStats(); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java index 996d4c6e7d..739e69a780 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -8,7 +8,13 @@ public interface StatsProjectService { /** * @Author sun - * @Description 数据-项目-机关、网格日(月)统计 + * @Description 数据-项目-机关日(月)统计 **/ - void agencyGridProjectStats(); + void agencyProjectStats(); + + /** + * @Author sun + * @Description 数据-项目-网格日(月)统计 + **/ + void gridProjectStats(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java index 3525e45f97..1e5cac4aac 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -14,8 +14,9 @@ import com.epmet.service.project.ProjectProcessService; import com.epmet.service.project.ProjectService; import com.epmet.service.stats.*; import com.epmet.util.DimIdGenerator; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; @@ -34,6 +35,7 @@ import java.util.concurrent.atomic.AtomicInteger; @Service public class StatsProjectServiceImpl implements StatsProjectService { + protected static final Logger log = LoggerFactory.getLogger(StatsProjectServiceImpl.class); @Autowired private DimCustomerService dimCustomerService; @Autowired @@ -57,10 +59,10 @@ public class StatsProjectServiceImpl implements StatsProjectService { /** * @Author sun - * @Description 数据-项目-机关、网格日(月)统计 + * @Description 数据-项目-机关日(月)统计 **/ @Override - public void agencyGridProjectStats() { + public void agencyProjectStats() { int pageNo = 1; int pageSize = 100; List customerIdList = null; @@ -68,8 +70,13 @@ public class StatsProjectServiceImpl implements StatsProjectService { customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); if (!CollectionUtils.isEmpty(customerIdList)) { for (String customerId : customerIdList) { - //遍历统计每一个客户数据 - customerStats(customerId); + try { + //遍历统计每一个客户数据 + customerAgencyStats(customerId); + } catch (Exception e) { + log.error("项目-机关-数据统计程序错误,对应客户Id:"+customerId, e); + log.error("Error creating model JSON", e); + } } } } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); @@ -77,11 +84,10 @@ public class StatsProjectServiceImpl implements StatsProjectService { /** * @Author sun - * @Description 一个客户一个线程, 分别统计机关/网格日/月数据 + * @Description 分别统计机关日/月数据 **/ - @Async - public void customerStats(String customerId) { - Date date = new Date(); + public void customerAgencyStats(String customerId) { + Date date = yesterDay(); //1:查询各维度表Id,方便使用 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); @@ -90,39 +96,25 @@ public class StatsProjectServiceImpl implements StatsProjectService { dimAgencyDTO.setCustomerId(customerId); List dimAgencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); - //3:根据客户Id查询网格维度表数据 - List dimGridList = dimGridService.getGridListByCustomerId(customerId); - - //4:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) + //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) ProjectEntity projectEntity = new ProjectEntity(); projectEntity.setCustomerId(customerId); projectEntity.setCreatedTime(date); projectEntity.setStatus(ProjectConstant.CLOSED); List projectList = projectService.getProjectList(projectEntity); - //5:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) + //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) List processList = projectProcessService.getProcessList(projectEntity); - //6:机关层级日月统计 + //5:机关层级日月统计 if (null != dimAgencyList && dimAgencyList.size() > NumConstant.ZERO) { - //6.1:执行机关日数据统计 + //5.1:执行机关日数据统计 agencyDateProjectStats(customerId, dimId, dimAgencyList, projectList, processList); - //6.2:执行机关月数据统计 - if (Calendar.getInstance().get(Calendar.DATE) == 1) { + //5.2:执行机关月数据统计 + //if (Calendar.getInstance().get(Calendar.DATE) == 1) { agencyMonthProjectStats(customerId, dimId, dimAgencyList); - } - } - - //7:网格层级日月统计 - if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { - //7.1:执行网格日数据统计 - gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); - - //7.2:执行网格月数据统计 - if (Calendar.getInstance().get(Calendar.DATE) == 1) { - gridMonthProjectStats(customerId, dimId, dimGridList); - } + //} } } @@ -138,7 +130,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { List projectDateEntityList = new ArrayList<>(); //计算百分比使用,保留小数点后两位 NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(2); + numberFormat.setMaximumFractionDigits(6); //1:遍历机关维度数据,统计每个机关各项指标数 for (DimAgencyDTO agency : dimAgencyList) { @@ -232,12 +224,12 @@ public class StatsProjectServiceImpl implements StatsProjectService { agencyDailyEntity.setResolvedTotal(resolvedTotal.intValue()); agencyDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); if (projectTotal.intValue() > NumConstant.ZERO) { - agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100))); - agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100))); + agencyDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) agencyDailyEntity.getPendingTotal() / (float) projectTotal.intValue()))); + agencyDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue()))); } if (closedTotal.intValue() > NumConstant.ZERO) { - agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); - agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + agencyDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue()))); + agencyDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); } agencyDailyEntity.setProjectIncr(projectIncr.intValue()); agencyDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); @@ -276,8 +268,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { //1:获取昨天日期所在月份的起始日期和结束日期 MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); formDTO.setCustomerId(customerId); - formDTO.setStartTime(getMonthBegin(date)); - formDTO.setEndTime(getMonthEnd(date)); + formDTO.setMonthId(dimId.getMonthId()); //2:遍历机关维度数据,分别统计每个组织月数据 for (DimAgencyDTO agency : dimAgencyList) { @@ -342,6 +333,65 @@ public class StatsProjectServiceImpl implements StatsProjectService { } + /** + * @Author sun + * @Description 数据-项目-机关日(月)统计 + **/ + @Override + public void gridProjectStats() { + int pageNo = 1; + int pageSize = 100; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + try { + //遍历统计每一个客户数据 + customerGridStats(customerId); + } catch (Exception e) { + log.error("项目-网格-数据统计程序错误,对应客户Id:"+customerId, e); + log.error("Error creating model JSON", e); + } + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + } + + /** + * @Author sun + * @Description 分别统计网格日/月数据 + **/ + public void customerGridStats(String customerId) { + Date date = yesterDay(); + //1:查询各维度表Id,方便使用 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + + //2:根据客户Id查询网格维度表数据 + List dimGridList = dimGridService.getGridListByCustomerId(customerId); + + //3:根据客户Id查询项目业务表已结案数据(查询传入日期及之前的数据) + ProjectEntity projectEntity = new ProjectEntity(); + projectEntity.setCustomerId(customerId); + projectEntity.setCreatedTime(date); + projectEntity.setStatus(ProjectConstant.CLOSED); + List projectList = projectService.getProjectList(projectEntity); + + //4:查询项目处理进展表中有效数据(创建日期截取yyyy-mm-dd格式字段值)(查询传入日期及之前的数据) + List processList = projectProcessService.getProcessList(projectEntity); + + //5:网格层级日月统计 + if (null != dimGridList && dimGridList.size() > NumConstant.ZERO) { + //5.1:执行网格日数据统计 + gridDateProjectStats(customerId, dimId, dimGridList, projectList, processList); + + //5.2:执行网格月数据统计 + //if (Calendar.getInstance().get(Calendar.DATE) == 1) { + gridMonthProjectStats(customerId, dimId, dimGridList); + //} + } + + } /** * @param customerId * @return @@ -354,7 +404,7 @@ public class StatsProjectServiceImpl implements StatsProjectService { List gridDateEntityList = new ArrayList<>(); //计算百分比使用,保留小数点后两位 NumberFormat numberFormat = NumberFormat.getInstance(); - numberFormat.setMaximumFractionDigits(2); + numberFormat.setMaximumFractionDigits(6); //1:根据客户Id查询议题库已转项目的网格项目关系数据 List gridProjectList = issueService.getGridProjectList(customerId); @@ -448,12 +498,12 @@ public class StatsProjectServiceImpl implements StatsProjectService { gridDailyEntity.setResolvedTotal(resolvedTotal.intValue()); gridDailyEntity.setUnresolvedTotal(unResolvedTotal.intValue()); if (projectTotal.intValue() > NumConstant.ZERO) { - gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue() * 100))); - gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue() * 100))); + gridDailyEntity.setPendingRatio(new BigDecimal(numberFormat.format((float) gridDailyEntity.getPendingTotal() / (float) projectTotal.intValue()))); + gridDailyEntity.setClosedRatio(new BigDecimal(numberFormat.format((float) closedTotal.intValue() / (float) projectTotal.intValue()))); } if (closedTotal.intValue() > NumConstant.ZERO) { - gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); - gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue() * 100))); + gridDailyEntity.setResolvedRatio(new BigDecimal(numberFormat.format((float) resolvedTotal.intValue() / (float) closedTotal.intValue()))); + gridDailyEntity.setUnresolvedRatio(new BigDecimal(numberFormat.format((float) unResolvedTotal.intValue() / (float) closedTotal.intValue()))); } gridDailyEntity.setProjectIncr(projectIncr.intValue()); gridDailyEntity.setPendingIncr(projectIncr.intValue() - closedIncr.intValue()); @@ -489,15 +539,14 @@ public class StatsProjectServiceImpl implements StatsProjectService { //批量月数据新增对象 List monthlyEntityList = new ArrayList<>(); - //1:获取昨天日期所在月份的起始日期和结束日期 + //1:查询客户网格月份内日统计数据 MonthProjectListFormDTO formDTO = new MonthProjectListFormDTO(); formDTO.setCustomerId(customerId); - formDTO.setStartTime(getMonthBegin(yesterDay())); - formDTO.setEndTime(getMonthEnd(yesterDay())); + formDTO.setMonthId(dimId.getMonthId()); //2:遍历网格维度数据,分别统计每个网格月数据 for (DimGridEntity grid : dimGridList) { - //2.1:查询上一月网格日统计数据,按时间倒序 + //2.1:查询当前月网格日统计数据,按时间倒序 formDTO.setGridId(grid.getId()); List projectDailyList = factGridProjectDailyService.getMonthProjectList(formDTO); @@ -575,46 +624,4 @@ public class StatsProjectServiceImpl implements StatsProjectService { return date; } - /** - * @Author sun - * @Description 获取指定日期所在月份开始的时间 - **/ - public Date getMonthBegin(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - //设置为1号,当前日期既为本月第一天 - c.set(Calendar.DAY_OF_MONTH, 1); - //将小时至0 - c.set(Calendar.HOUR_OF_DAY, 0); - //将分钟至0 - c.set(Calendar.MINUTE, 0); - //将秒至0 - c.set(Calendar.SECOND, 0); - //将毫秒至0 - c.set(Calendar.MILLISECOND, 0); - //获取本月第一天的时间 - return c.getTime(); - } - - /** - * @Author sun - * @Description 获取指定日期所在月份结束的时间 - **/ - public Date getMonthEnd(Date date) { - Calendar c = Calendar.getInstance(); - c.setTime(date); - //设置为当月最后一天 - c.set(Calendar.DAY_OF_MONTH, c.getActualMaximum(Calendar.DAY_OF_MONTH)); - //将小时至23 - c.set(Calendar.HOUR_OF_DAY, 23); - //将分钟至59 - c.set(Calendar.MINUTE, 59); - //将秒至59 - c.set(Calendar.SECOND, 59); - //将毫秒至999 - c.set(Calendar.MILLISECOND, 999); - //获取本月最后一天的时间 - return c.getTime(); - } - } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml index c9adcc2f29..eb6fc087bb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactAgencyProjectDailyDao.xml @@ -12,11 +12,7 @@ del_flag = '0' AND customer_id = #{customerId} AND agency_id = #{agencyId} - AND ( - DATE_FORMAT(created_time, "%Y-%m-%d") - BETWEEN DATE_FORMAT(#{startTime}, "%Y-%m-%d") - AND DATE_FORMAT(#{endTime}, "%Y-%m-%d") - ) + AND month_id = #{monthId} ORDER BY created_time DESC,project_total DESC diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml index 4dc999bba0..3f386bf7ba 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactGridProjectDailyDao.xml @@ -12,11 +12,7 @@ del_flag = '0' AND customer_id = #{customerId} AND grid_id = #{gridId} - AND ( - DATE_FORMAT(created_time, "%Y-%m-%d") - BETWEEN DATE_FORMAT(#{startTime}, "%Y-%m-%d") - AND DATE_FORMAT(#{endTime}, "%Y-%m-%d") - ) + AND month_id = #{monthId} ORDER BY created_time DESC,project_total DESC diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java new file mode 100644 index 0000000000..473f8c798b --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsProjectService.java @@ -0,0 +1,23 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @Description 数据统计-项目-机关、网格日月统计任务接口 + * @Author sun + */ +public interface StatsProjectService { + + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + Result agencyProjectStats(); + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + Result gridProjectStats(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java new file mode 100644 index 0000000000..0245c79754 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsProjectServiceImpl.java @@ -0,0 +1,34 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * @Description 数据统计-项目-机关、网格日月统计任务接口 + * @Author sun + */ +public class StatsProjectServiceImpl implements StatsProjectService { + + @Autowired + private DataStatisticalOpenFeignClient statsPublicityFeignClient; + + /** + * @Description 数据统计-项目-机关日月统计 + * @Author sun + */ + @Override + public Result agencyProjectStats() { + return statsPublicityFeignClient.agencyProjectStats(); + } + + /** + * @Description 数据统计-项目-网格日月统计 + * @Author sun + */ + @Override + public Result gridProjectStats() { + return statsPublicityFeignClient.gridProjectStats(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java new file mode 100644 index 0000000000..fcb09dae46 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectAgencyTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Description 数据统计-项目-机关日月统计任务 + * @Author sun + */ +@Component("statsProjectAgencyTask") +public class StatsProjectAgencyTask implements ITask { + + @Autowired + private StatsProjectService statsProjectService; + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + log.debug("StatsProjectAgencyTask定时任务正在执行,参数为:{}", params); + Result result = statsProjectService.agencyProjectStats(); + if (result.success()){ + log.debug("StatsProjectAgencyTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsProjectAgencyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java new file mode 100644 index 0000000000..293aa82380 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsProjectGridTask.java @@ -0,0 +1,35 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsProjectService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +/** + * @Author zxc + * @CreateTime 2020/6/22 14:09 + * + * 统计 “网格小组”, dim:【网格-日】 + * + */ +@Component("statsProjectGridTask") +public class StatsProjectGridTask implements ITask { + + @Autowired + private StatsProjectService statsProjectService; + + private Logger log = LoggerFactory.getLogger(getClass()); + + @Override + public void run(String params) { + log.debug("StatsProjectGridTask定时任务正在执行,参数为:{}", params); + Result result = statsProjectService.gridProjectStats(); + if (result.success()){ + log.debug("StatsProjectGridTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsProjectGridTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} From ef6a5a034456be6a68064dedc53d11d6a587eb66 Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 23 Jun 2020 15:09:28 +0800 Subject: [PATCH 100/101] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/issue/impl/IssueServiceImpl.java | 5 +- .../feign/DataStatisticalOpenFeignClient.java | 10 +++ ...ataStatisticalOpenFeignClientFallBack.java | 5 ++ .../dao/stats/FactIssueAgencyDailyDao.java | 10 +++ .../dao/stats/FactIssueAgencyMonthlyDao.java | 9 +++ .../dao/stats/FactIssueGridDailyDao.java | 10 +++ .../dao/stats/FactIssueGridMonthlyDao.java | 10 +++ .../service/impl/StatsIssueServiceImpl.java | 65 ++++++++++--------- .../stats/FactIssueAgencyDailyService.java | 19 ++++++ .../stats/FactIssueAgencyMonthlyService.java | 19 ++++++ .../stats/FactIssueGridDailyService.java | 19 ++++++ .../stats/FactIssueGridMonthlyService.java | 19 ++++++ .../impl/FactIssueAgencyDailyServiceImpl.java | 12 ++++ .../FactIssueAgencyMonthlyServiceImpl.java | 12 ++++ .../impl/FactIssueGridDailyServiceImpl.java | 12 ++++ .../impl/FactIssueGridMonthlyServiceImpl.java | 12 ++++ .../mapper/stats/FactIssueAgencyDailyDao.xml | 3 + .../stats/FactIssueAgencyMonthlyDao.xml | 3 + .../mapper/stats/FactIssueGridDailyDao.xml | 3 + .../mapper/stats/FactIssueGridMonthlyDao.xml | 8 +++ .../com/epmet/service/StatsIssueService.java | 19 ++++++ .../service/impl/StatsIssueServiceImpl.java | 23 +++++++ .../java/com/epmet/task/StatsIssueTask.java | 32 +++++++++ 23 files changed, 306 insertions(+), 33 deletions(-) create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java create mode 100644 epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java index 64fc2d99e0..51ba02884d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java @@ -1,5 +1,6 @@ package com.epmet.service.issue.impl; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.security.dto.TokenDto; import com.epmet.dao.issue.IssueDao; import com.epmet.dto.form.LoginUserDetailsFormDTO; @@ -13,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.math.BigDecimal; +import java.math.RoundingMode; import java.util.ArrayList; import java.util.List; @@ -167,6 +169,7 @@ public class IssueServiceImpl implements IssueService { } private String toRatio(BigDecimal data) { - return data.stripTrailingZeros().toString().concat("%"); + BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); + return data.multiply(hundred).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toString().concat("%"); } } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java index 01c9953043..e6594bef5e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/DataStatisticalOpenFeignClient.java @@ -104,4 +104,14 @@ public interface DataStatisticalOpenFeignClient { @PostMapping("/data/stats/statsgroup/groupagencymonthly") Result groupAgencyMonthly(); + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/23 14:34 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + @PostMapping("/data/stats/statsissue/issuestats") + Result agencyGridIssueStats(); + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java index 1ccec983eb..45d3768093 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/feign/impl/DataStatisticalOpenFeignClientFallBack.java @@ -109,4 +109,9 @@ public class DataStatisticalOpenFeignClientFallBack implements DataStatisticalOp public Result groupAgencyMonthly() { return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "groupAgencyMonthly"); } + + @Override + public Result agencyGridIssueStats() { + return ModuleUtils.feignConError(ServiceConstant.DATA_STATISTICAL, "agencyGridIssueStats"); + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java index be302f14a7..c6ee47eb10 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactIssueAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 议题数量(按日) @@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueAgencyDailyDao extends BaseDao { + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(@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/FactIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java index acaf6e5d1b..6f9933bf1a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyMonthlyDao.java @@ -42,5 +42,14 @@ public interface FactIssueAgencyMonthlyDao extends BaseDao */ List selectAgencyMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java index 7249383370..595131257d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridDailyDao.java @@ -20,6 +20,7 @@ package com.epmet.dao.stats; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.entity.stats.FactIssueGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; /** * 网格议题数量(按日) @@ -29,5 +30,14 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactIssueGridDailyDao extends BaseDao { + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param dateId + * @return void + */ + void deleteByCustomerId(@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/FactIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java index 2e9c335661..502363d1b0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueGridMonthlyDao.java @@ -42,4 +42,14 @@ public interface FactIssueGridMonthlyDao extends BaseDao */ List selectGridMonthlyInc(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * 删除 + * @author zhaoqifeng + * @date 2020/6/23 14:02 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(@Param("customerId") String customerId, @Param("monthId") String monthId); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java index 6da113060e..fd6ffe7b88 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -96,6 +96,10 @@ public class StatsIssueServiceImpl implements StatsIssueService { String dateString = DateUtils.format(date); DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueAgencyDailyService.deleteByCustomerId(customerId, dimId.getDateId()); //获取当前客户下所有机关 List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //获取机关下议题各种状态的数目统计 @@ -110,8 +114,6 @@ public class StatsIssueServiceImpl implements StatsIssueService { List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); //已结案项目增量 List projectAgencyClosedIncList = projectService.getAgencyClosedProjectInc(customerId, dateString); - //获取日期相关维度 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); List list = new ArrayList<>(); for (DimAgencyDTO agency : agencyList) { @@ -149,7 +151,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { list.add(entity); } //批量插入 - factIssueAgencyDailyService.insertBatch(list); + factIssueAgencyDailyService.saveList(list); } @Override @@ -157,6 +159,10 @@ public class StatsIssueServiceImpl implements StatsIssueService { String dateString = DateUtils.format(date); DimAgencyDTO dimAgencyDTO = new DimAgencyDTO(); dimAgencyDTO.setCustomerId(customerId); + //获取日期相关维度 + DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueAgencyMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId()); //获取当前客户下所有机关 List agencyList = dimAgencyService.getDimAgencyList(dimAgencyDTO); //获取机关下议题各种状态的数目统计 @@ -165,11 +171,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { List issueAgencyClosedTotalList = issueService.getAgencyClosedIssueTotal(customerId, dateString); //已结案项目统计 List projectAgencyClosedTotalList = projectService.getAgencyClosedProjectTotal(customerId, dateString); - //获取日期相关维度 - DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); //统计机关下议题各个指标月度增量 List issueAgencyMonthlyIncList = factIssueAgencyMonthlyService.getAgencyMonthlyInc(customerId, dimId.getMonthId()); - List list = new ArrayList<>(); for (DimAgencyDTO agency : agencyList) { FactIssueAgencyDailyEntity daily = initIssueAgencyDaily(dimId); @@ -215,7 +218,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { list.add(monthly); } //批量插入 - factIssueAgencyMonthlyService.insertBatch(list); + factIssueAgencyMonthlyService.saveList(list); } @Override @@ -225,6 +228,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { dimAgencyDTO.setCustomerId(customerId); //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueGridDailyService.deleteByCustomerId(customerId, dimId.getDateId()); //获取客户下所有网格数据 List gridList = dimGridService.getGridListByCustomerId(customerId); //获取网格下议题各种状态的数目统计 @@ -241,6 +246,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { List closedProjectTotalList = projectService.getGridClosedProjectTotal(customerId, dateString); //已结案项目增量 List closedProjectIncList = projectService.getGridClosedProjectTotal(customerId, dateString); + Map resolveMap= new HashMap<>(); Map unResolveMap = new HashMap<>(); Map resolveIncMap = new HashMap<>(); @@ -313,7 +319,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { saveClosedProject(resolveMap, unResolveMap, resolveIncMap, unResolveIncMap, grid, entity); list.add(entity); } - factIssueGridDailyService.insertBatch(list); + factIssueGridDailyService.saveList(list); } @Override @@ -323,6 +329,8 @@ public class StatsIssueServiceImpl implements StatsIssueService { dimAgencyDTO.setCustomerId(customerId); //获取日期相关维度 DimIdGenerator.DimIdBean dimId = DimIdGenerator.getDimIdBean(date); + //清空数据 + factIssueGridMonthlyService.deleteByCustomerId(customerId, dimId.getMonthId()); //获取客户下所有网格数据 List gridList = dimGridService.getGridListByCustomerId(customerId); //获取网格下议题各种状态的数目统计 @@ -383,12 +391,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { monthly.setClosedCaseResolvedTotal(resolve); monthly.setClosedCaseUnresolvedTotal(unResolve); if(total > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolve); BigDecimal unresolved = new BigDecimal(unResolve); BigDecimal closed = new BigDecimal(total); - monthly.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - monthly.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + monthly.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + monthly.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } //各指标增量统计 @@ -413,7 +420,7 @@ public class StatsIssueServiceImpl implements StatsIssueService { monthly.setGridId(grid.getId()); list.add(monthly); } - factIssueGridMonthlyService.insertBatch(list); + factIssueGridMonthlyService.saveList(list); } /** @@ -443,12 +450,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseResolvedIncr(resolveInc); entity.setClosedCaseUnresolvedIncr(unResolveInc); if(total != NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolve); BigDecimal unresolved = new BigDecimal(unResolve); BigDecimal closed = new BigDecimal(total); - entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -513,12 +519,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedResolvedTotal(resolvedCount); entity.setClosedUnresolvedTotal(unresolvedCount); if(entity.getClosedTotal() > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolvedCount); BigDecimal unresolved = new BigDecimal(unresolvedCount); BigDecimal closed = new BigDecimal(entity.getClosedTotal()); - entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -597,14 +602,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedTotal(closedCount); entity.setIssueTotal(issueTotal); if (NumConstant.ZERO != issueTotal) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal voting = new BigDecimal(votingCount); BigDecimal shift = new BigDecimal(shiftCount); BigDecimal closed = new BigDecimal(closedCount); BigDecimal total = new BigDecimal(issueTotal); - entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -676,12 +680,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedCaseUnresolvedTotal(unresolvedCount); entity.setClosedCaseTotal(total); if (total > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolvedCount); BigDecimal unresolved = new BigDecimal(unresolvedCount); BigDecimal closed = new BigDecimal(total); - entity.setClosedCaseResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedCaseUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedCaseResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedCaseUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -763,14 +766,13 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedTotal(closedCount); entity.setIssueTotal(issueTotal); if (NumConstant.ZERO != issueTotal) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal voting = new BigDecimal(votingCount); BigDecimal shift = new BigDecimal(shiftCount); BigDecimal closed = new BigDecimal(closedCount); BigDecimal total = new BigDecimal(issueTotal); - entity.setVotingPercent(voting.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setShiftProjectPercent(shift.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedPercent(closed.multiply(hundred).divide(total, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setVotingPercent(voting.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setShiftProjectPercent(shift.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedPercent(closed.divide(total, NumConstant.SIX, RoundingMode.HALF_UP)); } } @@ -806,12 +808,11 @@ public class StatsIssueServiceImpl implements StatsIssueService { entity.setClosedResolvedTotal(resolvedCount); entity.setClosedUnresolvedTotal(unresolvedCount); if (entity.getClosedTotal() > NumConstant.ZERO) { - BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); BigDecimal resolved = new BigDecimal(resolvedCount); BigDecimal unresolved = new BigDecimal(unresolvedCount); BigDecimal closed = new BigDecimal(entity.getClosedTotal()); - entity.setClosedResolvedPercent(resolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); - entity.setClosedUnresolvedPercent(unresolved.multiply(hundred).divide(closed, NumConstant.TWO, RoundingMode.HALF_UP)); + entity.setClosedResolvedPercent(resolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); + entity.setClosedUnresolvedPercent(unresolved.divide(closed, NumConstant.SIX, RoundingMode.HALF_UP)); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java index 40f9c9e472..9334a5637c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyDailyService.java @@ -92,4 +92,23 @@ public interface FactIssueAgencyDailyService extends BaseService list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java index ebd176bb4e..b388e8ee58 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueAgencyMonthlyService.java @@ -102,4 +102,23 @@ public interface FactIssueAgencyMonthlyService extends BaseService */ List getAgencyMonthlyInc(String customerId, String monthId); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(String customerId, String monthId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java index 58beae9049..786f71ac90 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridDailyService.java @@ -92,4 +92,23 @@ public interface FactIssueGridDailyService extends BaseService list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java index 302c320653..a40b8c7236 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/FactIssueGridMonthlyService.java @@ -102,4 +102,23 @@ public interface FactIssueGridMonthlyService extends BaseService */ List getGridMonthlyInc(String customerId, String monthId); + + /** + * 根据客户ID删除 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param customerId + * @param monthId + * @return void + */ + void deleteByCustomerId(String customerId, String monthId); + + /** + * 批量保存 + * @author zhaoqifeng + * @date 2020/6/23 14:07 + * @param list + * @return void + */ + void saveList(List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java index b43614cc43..e6007e90d2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyDailyServiceImpl.java @@ -97,4 +97,16 @@ public class FactIssueAgencyDailyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java index 47db53b737..7215ecb179 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java @@ -103,4 +103,16 @@ public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java index feebc25a82..063e2ef8c5 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java @@ -97,4 +97,16 @@ public class FactIssueGridDailyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java index 1c084b836a..d3b0468011 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -102,4 +102,16 @@ public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl list) { + insertBatch(list); + } + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml index 59d538fe2f..20262ed8d4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml @@ -45,6 +45,9 @@ + + DELETE FROM fact_issue_agency_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/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml index f6bdd808cb..430abbd36c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -43,6 +43,9 @@ + + DELETE FROM fact_issue_agency_monthly WHERE CUSTOMER_ID = #{customerId} AND MONTH_ID = #{monthId} + SELECT diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java new file mode 100644 index 0000000000..23590743e6 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/StatsIssueService.java @@ -0,0 +1,19 @@ +package com.epmet.service; + +import com.epmet.commons.tools.utils.Result; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:38 + */ +public interface StatsIssueService { + /** + * 议题统计 + * @author zhaoqifeng + * @date 2020/6/23 14:39 + * @param + * @return com.epmet.commons.tools.utils.Result + */ + Result agencyGridIssueStats(); +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java new file mode 100644 index 0000000000..a8803c5f5e --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/service/impl/StatsIssueServiceImpl.java @@ -0,0 +1,23 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import feign.DataStatisticalOpenFeignClient; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:40 + */ +@Service +public class StatsIssueServiceImpl implements StatsIssueService { + @Autowired + private DataStatisticalOpenFeignClient dataStatisticalOpenFeignClient; + + @Override + public Result agencyGridIssueStats() { + return dataStatisticalOpenFeignClient.agencyGridIssueStats(); + } +} diff --git a/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java new file mode 100644 index 0000000000..20448d11d2 --- /dev/null +++ b/epmet-module/epmet-job/epmet-job-server/src/main/java/com/epmet/task/StatsIssueTask.java @@ -0,0 +1,32 @@ +package com.epmet.task; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsIssueService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.logging.Log; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; +import org.springframework.stereotype.Service; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/23 14:36 + */ +@Slf4j +@Component("statsIssueTask") +public class StatsIssueTask implements ITask { + @Autowired + private StatsIssueService statsIssueService; + + @Override + public void run(String params) { + log.debug("StatsGroupGridDailyTask定时任务正在执行,参数为:{}", params); + Result result = statsIssueService.agencyGridIssueStats(); + if (result.success()){ + log.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行成功"); + }else { + log.debug("StatsGroupGridDailyTask定时任务正在执行定时任务执行失败:" + result.getMsg()); + } + } +} From d0ede0b82d727637594b4db0da6591f28910faec Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Tue, 23 Jun 2020 15:34:38 +0800 Subject: [PATCH 101/101] =?UTF-8?q?=E8=AE=AE=E9=A2=98=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/service/issue/impl/IssueServiceImpl.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java index 51ba02884d..4271cbe29e 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/service/issue/impl/IssueServiceImpl.java @@ -15,6 +15,7 @@ import org.springframework.stereotype.Service; import java.math.BigDecimal; import java.math.RoundingMode; +import java.text.DecimalFormat; import java.util.ArrayList; import java.util.List; @@ -170,6 +171,6 @@ public class IssueServiceImpl implements IssueService { private String toRatio(BigDecimal data) { BigDecimal hundred = new BigDecimal(NumConstant.ONE_HUNDRED); - return data.multiply(hundred).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toString().concat("%"); + return data.multiply(hundred).setScale(NumConstant.TWO, BigDecimal.ROUND_HALF_UP).stripTrailingZeros().toPlainString().concat("%"); } }