diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.java new file mode 100644 index 0000000000..b780a3e50c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyDailyDTO.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.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题数量 + */ + private Integer issueTotal; + + /** + * 已转议题当日增量 + */ + private Integer issueIncr; + + /** + * 删除标识 + */ + 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/topic/FactTopicIssueAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyMonthlyDTO.java new file mode 100644 index 0000000000..6b3b99d300 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueAgencyMonthlyDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-机关月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + + /** + * 删除标识 + */ + 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/topic/FactTopicIssueGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridDailyDTO.java new file mode 100644 index 0000000000..e006c7c688 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridDailyDTO.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.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 新增转议题数 + */ + private Integer issueIncr; + + /** + * 转议题总数 + */ + private Integer issueTotal; + + /** + * 删除标识 + */ + 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/topic/FactTopicIssueGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridMonthlyDTO.java new file mode 100644 index 0000000000..e2e373f485 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicIssueGridMonthlyDTO.java @@ -0,0 +1,111 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 转议题话题-网格月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicIssueGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + + /** + * 删除标识 + */ + 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/topic/FactTopicStatusAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyDailyDTO.java new file mode 100644 index 0000000000..82215ebd12 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyDailyDTO.java @@ -0,0 +1,137 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.topic; + +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-20 + */ +@Data +public class FactTopicStatusAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 关联dim_topic_status表 +讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 指定状态的话题数量 + */ + private Integer topicCount; + + /** + * 话题状态百分比 指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的状态话题的增加数 + */ + private Integer topicIncrement; + + /** + * 删除标识 + */ + 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/topic/FactTopicStatusAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyMonthlyDTO.java new file mode 100644 index 0000000000..a89cdf966c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusAgencyMonthlyDTO.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.topic; + +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-20 + */ +@Data +public class FactTopicStatusAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份 关联月度dm表 + */ + private String monthId; + + /** + * 季度ID 关联季度dm表 + */ + private String quarterId; + + /** + * 年ID 关联年度dm表 + */ + private String yearId; + + /** + * 话题状态 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 月末一天 +指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的话题状态增加数 + */ + private Integer topicIncr; + + /** + * 删除标识 + */ + 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/topic/FactTopicStatusGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusGridDailyDTO.java new file mode 100644 index 0000000000..72fa98eb49 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicStatusGridDailyDTO.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +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-20 + */ +@Data +public class FactTopicStatusGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 指定状态话题数/话题总数 +总数在topic_total_grid_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 + */ + private Integer topicIncrement; + + /** + * 删除标识 + */ + 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/topic/FactTopicTotalAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalAgencyDailyDTO.java new file mode 100644 index 0000000000..fd06f45244 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalAgencyDailyDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicTotalAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数 + */ + private Integer issueTotalCount; + + /** + * 删除标识 + */ + 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/topic/FactTopicTotalGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalGridDailyDTO.java new file mode 100644 index 0000000000..343feb0c92 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/FactTopicTotalGridDailyDTO.java @@ -0,0 +1,131 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +@Data +public class FactTopicTotalGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总量 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数量 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数量 + */ + private Integer issueTotalCount; + + /** + * 删除标识 + */ + 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/topic/result/GridTopicData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GridTopicData.java new file mode 100644 index 0000000000..bbbc9d327f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GridTopicData.java @@ -0,0 +1,38 @@ +package com.epmet.dto.stats.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GridTopicData + * @Auth wangc + * @Date 2020-06-22 17:31 + */ +@Data +public class GridTopicData implements Serializable { + private static final long serialVersionUID = -7427128491727512781L; + + private String gridId; + + private Integer topicIncr = 0; + + private Integer discussingIncr = 0; + + private Integer hiddenIncr = 0; + + private Integer closedIncr = 0; + + private Integer total = 0; + + private Integer discussingTotal = 0; + + private Integer hiddenTotal = 0; + + private Integer closedTotal = 0; + + private Integer issueIncr = 0; + + private Integer issueTotal = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java new file mode 100644 index 0000000000..9da8d5a4ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/GroupTopicData.java @@ -0,0 +1,38 @@ +package com.epmet.dto.stats.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description + * @ClassName GroupTopicData + * @Auth wangc + * @Date 2020-06-22 15:29 + */ +@Data +public class GroupTopicData implements Serializable { + private static final long serialVersionUID = -7968684838832002029L; + + private String groupId; + + private Integer topicIncr = 0; + + private Integer discussingIncr = 0; + + private Integer hiddenIncr = 0; + + private Integer closedIncr = 0; + + private Integer total = 0; + + private Integer discussingTotal = 0; + + private Integer hiddenTotal = 0; + + private Integer closedTotal = 0; + + private Integer issueIncr = 0; + + private Integer issueTotal = 0; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java new file mode 100644 index 0000000000..a5fa7f5279 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/topic/result/TopicStatisticalData.java @@ -0,0 +1,43 @@ +package com.epmet.dto.stats.topic.result; + +import com.epmet.dto.stats.topic.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 话题统计数据对象 + * @ClassName TopicStatisticalDataResultDTO + * @Auth wangc + * @Date 2020-06-22 13:16 + */ +@Data +public class TopicStatisticalData implements Serializable { + private static final long serialVersionUID = 3690257892396607149L; + + private List issueAgencyDailyList ; + + private List issueAgencyMonthlyList ; + + private List issueGridDailyList ; + + private List issueGridMonthlyList ; + + private List topicAgencyDailyList ; + + private List topicAgencyMonthlyList ; + + private List topicGridDailyList; + + private List totalAgencyDailyList; + + private List totalGridDailyList; + + private String dateId; + + private String monthId; + + private String customerId; + +} 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 index 63d34f3139..a0d86d6164 100644 --- 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 @@ -59,6 +59,7 @@ public class FactParticipationUserGridDailyDTO implements Serializable { */ private String dateId; + /** * */ diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java new file mode 100644 index 0000000000..e50824d0cb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/user/result/UserStatisticalData.java @@ -0,0 +1,41 @@ +package com.epmet.dto.stats.user.result; + + +import com.epmet.dto.stats.user.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 用户统计数据对象 + * @ClassName UserStatisticalData + * @Auth wangc + * @Date 2020-06-19 15:02 + */ +@Data +public class UserStatisticalData implements Serializable { + private static final long serialVersionUID = 7423427555123585566L; + + private List partiAgencyDailyList; + + private List partiGridDailyList; + + private List partiAgencyMonthlyList; + + private List partiGridMonthlyList; + + private List regAgencyDailyList; + + private List regGridDailyList; + + private List regAgencyMonthlyList; + + private List regGridMonthlyList; + + private String customerId; + + private String dateId; + + private String monthId; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java new file mode 100644 index 0000000000..33557cd396 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiGroupTopicResultDTO.java @@ -0,0 +1,27 @@ +package com.epmet.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Description 组-话题对象 + * @ClassName ResiGroupTopicResultDTO + * @Auth wangc + * @Date 2020-06-20 17:23 + */ +@Data +public class ResiGroupTopicResultDTO implements Serializable { + private static final long serialVersionUID = -6243796311184636458L; + + private String gridId; + + private String groupId; + + private String groupName; + + private String customerId; + + private List topics; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java new file mode 100644 index 0000000000..cd114f3ceb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicOperationResultDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 话题操作记录DTO + * @ClassName ResiTopicOperationResultDTO + * @Auth wangc + * @Date 2020-06-22 10:58 + */ +@Data +public class ResiTopicOperationResultDTO implements Serializable { + private static final long serialVersionUID = -7811429974017636134L; + + /** + * 话题Id + * */ + private String topicId; + + /** + * 操作状态 + * */ + private String status; + + /** + * 操作时间 yyyy-MM-dd + * */ + private String createdTime; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java new file mode 100644 index 0000000000..e5bfffdc2d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/topic/result/ResiTopicResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.topic.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 话题对象 + * @ClassName ResiTopicResultDTO + * @Auth wangc + * @Date 2020-06-20 17:22 + */ +@Data +public class ResiTopicResultDTO implements Serializable { + private static final long serialVersionUID = 6818736495648532514L; + + private String topicId; + + private String status; + + private boolean shiftIssue; + + private String incrFlag; +} diff --git a/epmet-module/data-statistical/data-statistical-server/pom.xml b/epmet-module/data-statistical/data-statistical-server/pom.xml index 8bd8f152a9..af7cc94e2b 100644 --- a/epmet-module/data-statistical/data-statistical-server/pom.xml +++ b/epmet-module/data-statistical/data-statistical-server/pom.xml @@ -159,7 +159,7 @@ 6379 123456 - true + false 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 2d0cd77530..b901c3463e 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 @@ -9,10 +9,7 @@ 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; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; import java.util.List; @@ -223,8 +220,8 @@ public class DimController { * @date 2020.06.18 10:34 **/ @GetMapping("allagency") - public List allAgency() { - return dimAgencyService.getAllAgency(); + public List allAgency(@PathVariable String customerId) { + return dimAgencyService.getAllAgency(customerId); } /** @@ -235,8 +232,8 @@ public class DimController { * @date 2020.06.18 10:34 **/ @GetMapping("topagency") - public List topAgency() { - return dimAgencyService.getTopAgency(); + public List topAgency(@PathVariable String customerId) { + return dimAgencyService.getTopAgency(customerId); } /** 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..e67b29c4b8 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,7 +1,6 @@ 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.*; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java new file mode 100644 index 0000000000..b2eb12c054 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsTopicController.java @@ -0,0 +1,31 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsTopicService; +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.Date; + +/** + * @Description + * @ClassName StatsTopicController + * @Auth wangc + * @Date 2020-06-23 15:19 + */ +@RestController +@RequestMapping("statstopic") +public class StatsTopicController { + + @Autowired + private StatsTopicService statsTopicService; + + @PostMapping("execute") + public Result execute(@RequestParam(value = "date",required = false) Date date){ + statsTopicService.partition(date); + return new Result(); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java new file mode 100644 index 0000000000..dd4a29fb9d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/StatsUserController.java @@ -0,0 +1,31 @@ +package com.epmet.controller; + +import com.epmet.commons.tools.utils.Result; +import com.epmet.service.StatsUserService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import java.util.Date; + +/** + * @Description 用户统计 + * @ClassName StatsUserController + * @Auth wangc + * @Date 2020-06-23 15:18 + */ +@RestController +@RequestMapping("statsuser") +public class StatsUserController { + + @Autowired + private StatsUserService statsUserService; + + @RequestMapping("execute") + public Result execute(@RequestParam(value = "date",required = false) Date date){ + statsUserService.partition(date); + 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 3c70225c26..7ed92bc461 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 @@ -55,7 +55,7 @@ public interface DimAgencyDao extends BaseDao { * @author wangc * @date 2020.06.18 09:26 **/ - List selectAllAgency(); + List selectAllAgency(@Param("customerId") String customerId); /** * @param pid @@ -73,7 +73,7 @@ public interface DimAgencyDao extends BaseDao { * @author wangc * @date 2020.06.18 09:26 **/ - List selectTopAgency(); + List selectTopAgency(@Param("customerId")String customerId); /** * desc:根据客户id 获取机关列表 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java new file mode 100644 index 0000000000..5089e9b642 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyDailyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueAgencyDailyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java new file mode 100644 index 0000000000..08ad42c187 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueAgencyMonthlyDao.java @@ -0,0 +1,40 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueAgencyMonthlyDao extends BaseDao { + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@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/topic/FactTopicIssueGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridDailyDao.java new file mode 100644 index 0000000000..bfb369626f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueGridDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/topic/FactTopicIssueGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridMonthlyDao.java new file mode 100644 index 0000000000..8f819b001b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicIssueGridMonthlyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity; +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-20 + */ +@Mapper +public interface FactTopicIssueGridMonthlyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@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/topic/FactTopicStatusAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyDailyDao.java new file mode 100644 index 0000000000..218b21cd52 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyDailyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicStatusAgencyDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java new file mode 100644 index 0000000000..742d92bd65 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusAgencyMonthlyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity; +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-20 + */ +@Mapper +public interface FactTopicStatusAgencyMonthlyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@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/topic/FactTopicStatusGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusGridDailyDao.java new file mode 100644 index 0000000000..666a54f995 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicStatusGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicStatusGridDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/topic/FactTopicTotalAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalAgencyDailyDao.java new file mode 100644 index 0000000000..445aa9a30f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalAgencyDailyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicTotalAgencyDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/topic/FactTopicTotalGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java new file mode 100644 index 0000000000..7276945b90 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/topic/FactTopicTotalGridDailyDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.stats.topic; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; +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-20 + */ +@Mapper +public interface FactTopicTotalGridDailyDao extends BaseDao { + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/user/FactParticipationUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyDailyDao.java index 463dbca50d..4a5b254b8f 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyDailyDTO; import com.epmet.entity.stats.user.FactParticipationUserAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 机关下(按日)参与用户数分析 @@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactParticipationUserAgencyDailyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserAgencyMonthlyDao.java index d303685b38..d52897c4b9 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserAgencyMonthlyDTO; import com.epmet.entity.stats.user.FactParticipationUserAgencyMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 机关下(按月)参与用户数分析 @@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactParticipationUserAgencyMonthlyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@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/user/FactParticipationUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridDailyDao.java index 18593b3807..d39a6088e1 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserGridDailyDTO; import com.epmet.entity.stats.user.FactParticipationUserGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网格下(按日)参与用户数分析 @@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactParticipationUserGridDailyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/user/FactParticipationUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactParticipationUserGridMonthlyDao.java index 81fd930f20..b67adec9dc 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactParticipationUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactParticipationUserGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网格下(月)参与用户数分析 @@ -29,5 +33,8 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactParticipationUserGridMonthlyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@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/user/FactRegUserAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyDailyDao.java index d4fb9b5fe5..e22a094565 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserAgencyDailyDTO; import com.epmet.entity.stats.user.FactRegUserAgencyDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 机关(按日)注册用户数分析 @@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactRegUserAgencyDailyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/user/FactRegUserAgencyMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserAgencyMonthlyDao.java index 4ed08b1f00..e59f48e8c5 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserAgencyMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserAgencyMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 机关(按月)注册用户数分析 @@ -29,5 +33,8 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactRegUserAgencyMonthlyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@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/user/FactRegUserGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridDailyDao.java index 944732d786..f06c4c1179 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserGridDailyDTO; import com.epmet.entity.stats.user.FactRegUserGridDailyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网格(按日)注册用户数分析 @@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactRegUserGridDailyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@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/dao/stats/user/FactRegUserGridMonthlyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/user/FactRegUserGridMonthlyDao.java index df808eb3be..940609d9bc 100644 --- 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 @@ -18,8 +18,12 @@ package com.epmet.dao.stats.user; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.stats.user.FactRegUserGridMonthlyDTO; import com.epmet.entity.stats.user.FactRegUserGridMonthlyEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 网格(月)注册用户数分析 @@ -29,5 +33,9 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface FactRegUserGridMonthlyDao extends BaseDao { - + + void insertBatch(@Param("list") List list); + + void deleteByParams(@Param("monthId")String monthId,@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/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java new file mode 100644 index 0000000000..9244b799b1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -0,0 +1,59 @@ +package com.epmet.dao.topic; + +/** + * 话题Dao ResiGroup + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ + +import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; +import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.Date; +import java.util.List; + +@Mapper +public interface TopicDao { + + /** + * @Description 将组按照网格Id排序 + * @param targetDate + * @param customerId + * @return List + * @author wangc + * @date 2020.06.22 11:05 + **/ + List selectGroupOrderByGrid(@Param("targetDate")Date targetDate, @Param("customerId")String customerId); + + /** + * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 + * @param targetDate + * @return List + * @author wangc + * @date 2020.06.22 11:07 + **/ + List selectTopicOperationRecord(@Param("targetDate")Date targetDate); + + + /** + * @Description 将组按照网格Id排序 + * @param + * @param customerId + * @return List + * @author wangc + * @date 2020.06.22 11:05 + **/ + List selectGroupOrderByGridBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate, @Param("customerId")String customerId); + + /** + * @Description 查询话题的操作记录,如果返回结果中没有对应Id的话题说明当日话题没有操作记录 + * @param + * @return List + * @author wangc + * @date 2020.06.22 11:07 + **/ + List selectTopicOperationRecordBetweenTimeRange(@Param("startDate")Date startDate, @Param("endDate")Date endDate); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.java new file mode 100644 index 0000000000..b8118c7dd1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyDailyEntity.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.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_agency_daily") +public class FactTopicIssueAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题数量 + */ + private Integer issueTotal; + + /** + * 已转议题当日增量 + */ + private Integer issueIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java new file mode 100644 index 0000000000..5f782d0779 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueAgencyMonthlyEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_agency_monthly") +public class FactTopicIssueAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 父级ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.java new file mode 100644 index 0000000000..90ecdb3b42 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridDailyEntity.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.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_grid_daily") +public class FactTopicIssueGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 新增转议题数 + */ + private Integer issueIncr; + + /** + * 转议题总数 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java new file mode 100644 index 0000000000..ff1a767364 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicIssueGridMonthlyEntity.java @@ -0,0 +1,81 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_issue_grid_monthly") +public class FactTopicIssueGridMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 已转议题增量 + */ + private Integer issueIncr; + + /** + * 已转议题总量 + */ + private Integer issueTotal; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.java new file mode 100644 index 0000000000..a70533c5b8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyDailyEntity.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.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_status_agency_daily") +public class FactTopicStatusAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 关联dim_topic_status表 +讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 指定状态的话题数量 + */ + private Integer topicCount; + + /** + * 话题状态百分比 指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的状态话题的增加数 + */ + private Integer topicIncrement; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java new file mode 100644 index 0000000000..41b867b6af --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusAgencyMonthlyEntity.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_status_agency_monthly") +public class FactTopicStatusAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机构ID 关联机关dm表 + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计月份 关联月度dm表 + */ + private String monthId; + + /** + * 季度ID 关联季度dm表 + */ + private String quarterId; + + /** + * 年ID 关联年度dm表 + */ + private String yearId; + + /** + * 话题状态 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 月末一天 +指定状态话题数/话题总数 +总数在topic_total_agency_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 单位时间内的话题状态增加数 + */ + private Integer topicIncr; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.java new file mode 100644 index 0000000000..9761626845 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicStatusGridDailyEntity.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_status_grid_daily") +public class FactTopicStatusGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID 关联网格dm表 + */ + private String gridId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题状态ID 讨论中 discussing +已屏蔽 hidden +已关闭 closed +已转项目 shift_project + */ + private String topicStatusId; + + /** + * 话题数量 + */ + private Integer topicCount; + + /** + * 话题状态占比 指定状态话题数/话题总数 +总数在topic_total_grid_daily中 + */ + private BigDecimal topicProportion; + + /** + * 话题增量 + */ + private Integer topicIncrement; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.java new file mode 100644 index 0000000000..9ee374426f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalAgencyDailyEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_total_agency_daily") +public class FactTopicTotalAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 父级机关ID + */ + private String pid; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总数 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数 + */ + private Integer issueTotalCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.java new file mode 100644 index 0000000000..f9976295ea --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/topic/FactTopicTotalGridDailyEntity.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats.topic; + +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-20 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_topic_total_grid_daily") +public class FactTopicTotalGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 机关ID + */ + private String agencyId; + + /** + * 客户Id + * */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 统计日期 关联日期dm表 + */ + private String dateId; + + /** + * 周ID + */ + private String weekId; + + /** + * 月ID + */ + private String monthId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 年ID + */ + private String yearId; + + /** + * 话题总量 + */ + private Integer topicTotal; + + /** + * 话题增量 + */ + private Integer topicIncr; + + /** + * 屏蔽话题数量 + */ + private Integer hiddenTotalCount; + + /** + * 已转议题数量 + */ + private Integer issueTotalCount; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java new file mode 100644 index 0000000000..847a7d9923 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsTopicService.java @@ -0,0 +1,8 @@ +package com.epmet.service; + +import java.util.Date; + +public interface StatsTopicService { + + void partition(Date date); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java new file mode 100644 index 0000000000..7e98b2178f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/StatsUserService.java @@ -0,0 +1,8 @@ +package com.epmet.service; + +import java.util.Date; + +public interface StatsUserService { + + void partition(Date date); +} 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..03828f3352 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 @@ -201,7 +201,7 @@ public class StatsGroupServiceImpl implements StatsGroupService { */ public List getAllGrid(String agencyId){ List result = new ArrayList<>(); - List allAgency = dimAgencyService.getAllAgency(); + List allAgency = dimAgencyService.getAllAgency(null); Map> subGridOfAgency = new HashMap<>(); allAgency.forEach(agency -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java new file mode 100644 index 0000000000..958de6ee31 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsTopicServiceImpl.java @@ -0,0 +1,88 @@ +package com.epmet.service.impl; + +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.service.StatsTopicService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.service.stats.DimTopicStatusService; +import com.epmet.service.stats.topic.TopicStatisticalService; +import com.epmet.service.topic.TopicService; +import com.epmet.util.DimIdGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.*; + +/** + * @Description + * @ClassName StatsTopicServiceImpl + * @Auth wangc + * @Date 2020-06-23 15:22 + */ +@Service +public class StatsTopicServiceImpl implements StatsTopicService { + + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private DimAgencyService dimAgencyService; + + @Autowired + private DimTopicStatusService dimTopicStatusService; + + @Autowired + private TopicService topicService; + + @Autowired + private TopicStatisticalService topicStatisticalService; + + @Override + public void partition(Date date) { + + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + generate(customerId,date); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + + } + + void generate(String customerId,Date date){ + //1.初始化时间参数 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + //2.初始化时间维度 + DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); + + //3.初始化话题状态维度 + Map topicStatusParams = new HashMap<>(); + topicStatusParams.put(FieldConstant.DEL_FLAG_HUMP, NumConstant.ZERO_STR); + List topicStatusDimension = dimTopicStatusService.list(topicStatusParams); + + //4.初始化机关维度 + List agencies = dimAgencyService.getAllAgency(customerId); + + //5.计算统计数据 + TopicStatisticalData data = + topicService.compute(agencies,date,timeDimension,customerId,topicStatusDimension); + + //6.生成唯一性统计数据 + topicStatisticalService.insertUniquely(data); + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java new file mode 100644 index 0000000000..721165693b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/impl/StatsUserServiceImpl.java @@ -0,0 +1,84 @@ +package com.epmet.service.impl; + + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.service.StatsUserService; +import com.epmet.service.stats.DimAgencyService; +import com.epmet.service.stats.DimCustomerService; +import com.epmet.service.stats.user.UserStatisticalService; +import com.epmet.service.user.UserService; +import com.epmet.util.DimIdGenerator; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.Calendar; +import java.util.Date; +import java.util.List; + + +/** + * @Description 生成用户统计信息 + * @ClassName StatsUserServiceImpl + * @Auth wangc + * @Date 2020-06-23 15:21 + */ +@Service +public class StatsUserServiceImpl implements StatsUserService { + + @Autowired + private DimCustomerService dimCustomerService; + + @Autowired + private DimAgencyService dimAgencyService; + + @Autowired + private UserService userService; + + @Autowired + private UserStatisticalService userStatisticalService; + + @Override + public void partition(Date date) { + int pageNo = NumConstant.ONE; + int pageSize = NumConstant.ONE_HUNDRED; + List customerIdList = null; + do { + customerIdList = dimCustomerService.selectCustomerIdPage(pageNo++, pageSize); + if (!CollectionUtils.isEmpty(customerIdList)) { + for (String customerId : customerIdList) { + //遍历统计每一个客户数据 + generate(customerId,date); + } + } + } while (!CollectionUtils.isEmpty(customerIdList) && customerIdList.size() == pageSize); + + } + + void generate(String customerId,Date date){ + //1.初始化时间参数 + Calendar calendar = Calendar.getInstance(); + calendar.setTime(new Date()); + //获取今日的零点 + calendar.set(Calendar.HOUR_OF_DAY, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + + //2.初始化时间维度 + DimIdGenerator.DimIdBean timeDimension = DimIdGenerator.getDimIdBean(null == date ? calendar.getTime() : date); + + //3.初始化机关维度 + List agencies = dimAgencyService.getAllAgency(customerId); + List topAgencies = dimAgencyService.getTopAgency(customerId); + + //4.计算机关统计数据、生成唯一性统计数据 + UserStatisticalData agencyData = userService.traverseAgencyUser(agencies,date,timeDimension); + userStatisticalService.insertUniquely(agencyData); + + //5.计算网格统计数据、生成唯一性统计数据 + UserStatisticalData gridData = userService.traverseGridUser(agencies,date,timeDimension); + userStatisticalService.insertUniquely(gridData); + } +} 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 95c305943d..8d4e8d938d 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 @@ -118,7 +118,7 @@ public interface DimAgencyService extends BaseService { * @author wangc * @date 2020.06.18 09:45 **/ - List getAllAgency(); + List getAllAgency(String customerId); /** * @Description 查询顶级机关以及它下级机关的信息 @@ -127,7 +127,7 @@ public interface DimAgencyService extends BaseService { * @author wangc * @date 2020.06.18 09:45 **/ - List getTopAgency(); + List getTopAgency(String customerId); /** * 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 ef1c918895..fe45c20ddc 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 @@ -174,8 +174,8 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getAllAgency() { - return baseDao.selectAllAgency(); + public List getAllAgency(String customerId) { + return baseDao.selectAllAgency(customerId); } @@ -187,8 +187,8 @@ public class DimAgencyServiceImpl extends BaseServiceImpl getTopAgency() { - return baseDao.selectTopAgency(); + public List getTopAgency(String customerId) { + return baseDao.selectTopAgency(customerId); } @Override 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 index 987c30dcb7..07c82cb9ce 100644 --- 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 @@ -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.commons.tools.utils.ConvertUtils; import com.epmet.commons.tools.constant.FieldConstant; @@ -64,10 +65,12 @@ public class DimTopicStatusServiceImpl extends BaseServiceImpl getWrapper(Map params){ String id = (String)params.get(FieldConstant.ID_HUMP); + String delFlag = (String)params.get(FieldConstant.DEL_FLAG_HUMP); + if(StringUtils.isBlank(delFlag)) delFlag = NumConstant.ZERO_STR; QueryWrapper wrapper = new QueryWrapper<>(); wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); - + wrapper.eq(FieldConstant.DEL_FLAG,delFlag); return wrapper; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.java new file mode 100644 index 0000000000..c1246dfb38 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyDailyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueAgencyDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicIssueAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyMonthlyService.java new file mode 100644 index 0000000000..0d4a48ea5a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueAgencyMonthlyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-机关月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueAgencyMonthlyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicIssueGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridDailyService.java new file mode 100644 index 0000000000..12e23274a8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridDailyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueGridDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicIssueGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridMonthlyService.java new file mode 100644 index 0000000000..3101304a62 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicIssueGridMonthlyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 转议题话题-网格月统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicIssueGridMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicIssueGridMonthlyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicIssueGridMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicIssueGridMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicIssueGridMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicStatusAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyDailyService.java new file mode 100644 index 0000000000..b653a4fee7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyDailyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 状态话题-机关日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicStatusAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicStatusAgencyDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicStatusAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicStatusAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicStatusAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicStatusAgencyMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyMonthlyService.java new file mode 100644 index 0000000000..55c0b5adf3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusAgencyMonthlyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 状态话题-机关月统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicStatusAgencyMonthlyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicStatusAgencyMonthlyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicStatusAgencyMonthlyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicStatusAgencyMonthlyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicStatusAgencyMonthlyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicStatusGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusGridDailyService.java new file mode 100644 index 0000000000..8a76bb9707 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicStatusGridDailyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 状态话题-网格日统计数据表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicStatusGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicStatusGridDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicStatusGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicStatusGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicStatusGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicTotalAgencyDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalAgencyDailyService.java new file mode 100644 index 0000000000..4a5800f3fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalAgencyDailyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 话题总数-机关日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicTotalAgencyDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicTotalAgencyDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicTotalAgencyDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicTotalAgencyDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicTotalAgencyDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/FactTopicTotalGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalGridDailyService.java new file mode 100644 index 0000000000..c4fc1cd71e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/FactTopicTotalGridDailyService.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.topic; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; + + +import java.util.List; +import java.util.Map; + +/** + * 话题总数-网格日统计表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-20 + */ +public interface FactTopicTotalGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-06-20 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-06-20 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return FactTopicTotalGridDailyDTO + * @author generator + * @date 2020-06-20 + */ + FactTopicTotalGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void save(FactTopicTotalGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-06-20 + */ + void update(FactTopicTotalGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-06-20 + */ + 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/topic/TopicStatisticalService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/TopicStatisticalService.java new file mode 100644 index 0000000000..6482b543b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/TopicStatisticalService.java @@ -0,0 +1,8 @@ +package com.epmet.service.stats.topic; + +import com.epmet.dto.stats.topic.result.TopicStatisticalData; + +public interface TopicStatisticalService { + + void insertUniquely(TopicStatisticalData data); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..614e95486e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyDailyServiceImpl.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.topic.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.topic.FactTopicIssueAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyDailyEntity; +import com.epmet.service.stats.topic.FactTopicIssueAgencyDailyService; +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-20 + */ +@Service +public class FactTopicIssueAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicIssueAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueAgencyDailyDTO.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 FactTopicIssueAgencyDailyDTO get(String id) { + FactTopicIssueAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueAgencyDailyDTO dto) { + FactTopicIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueAgencyDailyDTO dto) { + FactTopicIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyDailyEntity.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/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..5e7e0c6d2a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueAgencyMonthlyServiceImpl.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.topic.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.topic.FactTopicIssueAgencyMonthlyDao; +import com.epmet.dto.stats.topic.FactTopicIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueAgencyMonthlyEntity; +import com.epmet.service.stats.topic.FactTopicIssueAgencyMonthlyService; +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-20 + */ +@Service +public class FactTopicIssueAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTopicIssueAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueAgencyMonthlyDTO.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 FactTopicIssueAgencyMonthlyDTO get(String id) { + FactTopicIssueAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueAgencyMonthlyDTO dto) { + FactTopicIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueAgencyMonthlyDTO dto) { + FactTopicIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueAgencyMonthlyEntity.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/topic/impl/FactTopicIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridDailyServiceImpl.java new file mode 100644 index 0000000000..5d9e805fb8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridDailyServiceImpl.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.topic.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.topic.FactTopicIssueGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridDailyEntity; +import com.epmet.service.stats.topic.FactTopicIssueGridDailyService; +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-20 + */ +@Service +public class FactTopicIssueGridDailyServiceImpl extends BaseServiceImpl implements FactTopicIssueGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueGridDailyDTO.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 FactTopicIssueGridDailyDTO get(String id) { + FactTopicIssueGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueGridDailyDTO dto) { + FactTopicIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueGridDailyDTO dto) { + FactTopicIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridDailyEntity.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/topic/impl/FactTopicIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..9f3004f690 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicIssueGridMonthlyServiceImpl.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.topic.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.topic.FactTopicIssueGridMonthlyDao; +import com.epmet.dto.stats.topic.FactTopicIssueGridMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicIssueGridMonthlyEntity; +import com.epmet.service.stats.topic.FactTopicIssueGridMonthlyService; +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-20 + */ +@Service +public class FactTopicIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactTopicIssueGridMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicIssueGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicIssueGridMonthlyDTO.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 FactTopicIssueGridMonthlyDTO get(String id) { + FactTopicIssueGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicIssueGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicIssueGridMonthlyDTO dto) { + FactTopicIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicIssueGridMonthlyDTO dto) { + FactTopicIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicIssueGridMonthlyEntity.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/topic/impl/FactTopicStatusAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..d6644f4c26 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyDailyServiceImpl.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.topic.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.topic.FactTopicStatusAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyDailyEntity; +import com.epmet.service.stats.topic.FactTopicStatusAgencyDailyService; +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-20 + */ +@Service +public class FactTopicStatusAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicStatusAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicStatusAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicStatusAgencyDailyDTO.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 FactTopicStatusAgencyDailyDTO get(String id) { + FactTopicStatusAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicStatusAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicStatusAgencyDailyDTO dto) { + FactTopicStatusAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicStatusAgencyDailyDTO dto) { + FactTopicStatusAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyDailyEntity.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/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..86c88ed82b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusAgencyMonthlyServiceImpl.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.topic.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.topic.FactTopicStatusAgencyMonthlyDao; +import com.epmet.dto.stats.topic.FactTopicStatusAgencyMonthlyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusAgencyMonthlyEntity; +import com.epmet.service.stats.topic.FactTopicStatusAgencyMonthlyService; +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-20 + */ +@Service +public class FactTopicStatusAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactTopicStatusAgencyMonthlyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicStatusAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicStatusAgencyMonthlyDTO.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 FactTopicStatusAgencyMonthlyDTO get(String id) { + FactTopicStatusAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicStatusAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicStatusAgencyMonthlyDTO dto) { + FactTopicStatusAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicStatusAgencyMonthlyDTO dto) { + FactTopicStatusAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusAgencyMonthlyEntity.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/topic/impl/FactTopicStatusGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusGridDailyServiceImpl.java new file mode 100644 index 0000000000..af4e77a184 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicStatusGridDailyServiceImpl.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.topic.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.topic.FactTopicStatusGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicStatusGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicStatusGridDailyEntity; +import com.epmet.service.stats.topic.FactTopicStatusGridDailyService; +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-20 + */ +@Service +public class FactTopicStatusGridDailyServiceImpl extends BaseServiceImpl implements FactTopicStatusGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicStatusGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicStatusGridDailyDTO.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 FactTopicStatusGridDailyDTO get(String id) { + FactTopicStatusGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicStatusGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicStatusGridDailyDTO dto) { + FactTopicStatusGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicStatusGridDailyDTO dto) { + FactTopicStatusGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicStatusGridDailyEntity.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/topic/impl/FactTopicTotalAgencyDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalAgencyDailyServiceImpl.java new file mode 100644 index 0000000000..351a6f2e29 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalAgencyDailyServiceImpl.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.topic.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.topic.FactTopicTotalAgencyDailyDao; +import com.epmet.dto.stats.topic.FactTopicTotalAgencyDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalAgencyDailyEntity; +import com.epmet.service.stats.topic.FactTopicTotalAgencyDailyService; +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-20 + */ +@Service +public class FactTopicTotalAgencyDailyServiceImpl extends BaseServiceImpl implements FactTopicTotalAgencyDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicTotalAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicTotalAgencyDailyDTO.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 FactTopicTotalAgencyDailyDTO get(String id) { + FactTopicTotalAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicTotalAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicTotalAgencyDailyDTO dto) { + FactTopicTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicTotalAgencyDailyDTO dto) { + FactTopicTotalAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalAgencyDailyEntity.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/topic/impl/FactTopicTotalGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalGridDailyServiceImpl.java new file mode 100644 index 0000000000..53316ce9bb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/FactTopicTotalGridDailyServiceImpl.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.topic.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.topic.FactTopicTotalGridDailyDao; +import com.epmet.dto.stats.topic.FactTopicTotalGridDailyDTO; +import com.epmet.entity.stats.topic.FactTopicTotalGridDailyEntity; +import com.epmet.service.stats.topic.FactTopicTotalGridDailyService; +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-20 + */ +@Service +public class FactTopicTotalGridDailyServiceImpl extends BaseServiceImpl implements FactTopicTotalGridDailyService { + + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactTopicTotalGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactTopicTotalGridDailyDTO.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 FactTopicTotalGridDailyDTO get(String id) { + FactTopicTotalGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactTopicTotalGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactTopicTotalGridDailyDTO dto) { + FactTopicTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactTopicTotalGridDailyDTO dto) { + FactTopicTotalGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactTopicTotalGridDailyEntity.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/topic/impl/TopicStatisticalServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java new file mode 100644 index 0000000000..e70e4f7afe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/topic/impl/TopicStatisticalServiceImpl.java @@ -0,0 +1,124 @@ +package com.epmet.service.stats.topic.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.stats.topic.*; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.service.stats.topic.TopicStatisticalService; +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 org.springframework.transaction.annotation.Transactional; + +/** + * @Description + * @ClassName TopicStatisticalServiceImpl + * @Auth wangc + * @Date 2020-06-23 14:29 + */ +@Service +public class TopicStatisticalServiceImpl implements TopicStatisticalService { + + private static final Logger logger = LoggerFactory.getLogger(TopicStatisticalServiceImpl.class); + + @Autowired + private FactTopicIssueAgencyDailyDao topicIssueAgencyDailyDao; + + @Autowired + private FactTopicIssueAgencyMonthlyDao topicIssueAgencyMonthlyDao; + + @Autowired + private FactTopicIssueGridDailyDao topicIssueGridDailyDao; + + @Autowired + private FactTopicIssueGridMonthlyDao topicIssueGridMonthlyDao; + + @Autowired + private FactTopicStatusAgencyDailyDao topicStatusAgencyDailyDao; + + @Autowired + private FactTopicStatusAgencyMonthlyDao topicStatusAgencyMonthlyDao; + + @Autowired + private FactTopicStatusGridDailyDao topicStatusGridDailyDao; + + @Autowired + private FactTopicTotalAgencyDailyDao topicTotalAgencyDailyDao; + + @Autowired + private FactTopicTotalGridDailyDao topicTotalGridDailyDao; + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUniquely(TopicStatisticalData data) { + if(null == data) return; + + if(StringUtils.isBlank(data.getDateId()) || StringUtils.isBlank(data.getMonthId())){ + logger.warn("缺失重要参数:dateId或monthId"); + return ; + } + + if(null != data.getIssueAgencyDailyList() && data.getIssueAgencyDailyList().size() > NumConstant.ZERO){ + + topicIssueAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicIssueAgencyDailyDao.insertBatch(data.getIssueAgencyDailyList()); + } + + if(null != data.getIssueAgencyMonthlyList() && data.getIssueAgencyMonthlyList().size() > NumConstant.ZERO){ + + topicIssueAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + topicIssueAgencyMonthlyDao.insertBatch(data.getIssueAgencyMonthlyList()); + + } + + if(null != data.getIssueGridDailyList() && data.getIssueGridDailyList().size() > NumConstant.ZERO){ + + topicIssueGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicIssueGridDailyDao.insertBatch(data.getIssueGridDailyList()); + + } + + if(null != data.getIssueGridMonthlyList() && data.getIssueGridMonthlyList().size() > NumConstant.ZERO){ + + topicIssueGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + topicIssueGridMonthlyDao.insertBatch(data.getIssueGridMonthlyList()); + + } + + if(null != data.getTopicAgencyDailyList() && data.getTopicAgencyDailyList().size() > NumConstant.ZERO){ + + topicStatusAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicStatusAgencyDailyDao.insertBatch(data.getTopicAgencyDailyList()); + + } + + if(null != data.getTopicAgencyMonthlyList() && data.getTopicAgencyMonthlyList().size() > NumConstant.ZERO){ + + topicStatusAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + topicStatusAgencyMonthlyDao.insertBatch(data.getTopicAgencyMonthlyList()); + + } + + if(null != data.getTopicGridDailyList() && data.getTopicGridDailyList().size() > NumConstant.ZERO){ + + topicStatusGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicStatusGridDailyDao.insertBatch(data.getTopicGridDailyList()); + + } + + if(null != data.getTotalAgencyDailyList() && data.getTotalAgencyDailyList().size() > NumConstant.ZERO){ + + topicTotalAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicTotalAgencyDailyDao.insertBatch(data.getTotalAgencyDailyList()); + + } + + if(null != data.getTotalGridDailyList() && data.getTotalGridDailyList().size() > NumConstant.ZERO){ + + topicTotalGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + topicTotalGridDailyDao.insertBatch(data.getTotalGridDailyList()); + + } + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java new file mode 100644 index 0000000000..92adebf81b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/UserStatisticalService.java @@ -0,0 +1,8 @@ +package com.epmet.service.stats.user; + +import com.epmet.dto.stats.user.result.UserStatisticalData; + +public interface UserStatisticalService { + + void insertUniquely(UserStatisticalData data); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java new file mode 100644 index 0000000000..f42f74645c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/user/impl/UserStatisticalServiceImpl.java @@ -0,0 +1,117 @@ +package com.epmet.service.stats.user.impl; + + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dao.stats.user.*; +import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.service.stats.user.UserStatisticalService; +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 org.springframework.transaction.annotation.Transactional; + +/** + * @Description + * @ClassName UserStatisticalServiceImpl + * @Auth wangc + * @Date 2020-06-23 14:27 + */ +@Service +public class UserStatisticalServiceImpl implements UserStatisticalService { + + private static final Logger logger = LoggerFactory.getLogger(UserStatisticalServiceImpl.class); + + @Autowired + private FactParticipationUserAgencyDailyDao participationUserAgencyDailyDao; + + @Autowired + private FactParticipationUserAgencyMonthlyDao participationUserAgencyMonthlyDao; + + @Autowired + private FactParticipationUserGridDailyDao participationUserGridDailyDao; + + @Autowired + private FactParticipationUserGridMonthlyDao participationUserGridMonthlyDao; + + @Autowired + private FactRegUserAgencyDailyDao regUserAgencyDailyDao; + + @Autowired + private FactRegUserAgencyMonthlyDao regUserAgencyMonthlyDao; + + @Autowired + private FactRegUserGridDailyDao regUserGridDailyDao; + + @Autowired + private FactRegUserGridMonthlyDao regUserGridMonthlyDao; + + + @Override + @Transactional(rollbackFor = Exception.class) + public void insertUniquely(UserStatisticalData data) { + if (null == data) return ; + + if(StringUtils.isBlank(data.getDateId()) || StringUtils.isBlank(data.getMonthId())){ + logger.warn("缺失重要参数:dateId或monthId"); + return ; + } + + if(null != data.getPartiAgencyDailyList() && data.getPartiAgencyDailyList().size() > NumConstant.ZERO){ + + participationUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + participationUserAgencyDailyDao.insertBatch(data.getPartiAgencyDailyList()); + } + + if(null != data.getPartiAgencyMonthlyList() && data.getPartiAgencyMonthlyList().size() > NumConstant.ZERO){ + + participationUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + participationUserAgencyMonthlyDao.insertBatch(data.getPartiAgencyMonthlyList()); + + } + + if(null != data.getPartiGridMonthlyList() && data.getPartiGridMonthlyList().size() > NumConstant.ZERO){ + + participationUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + participationUserGridMonthlyDao.insertBatch(data.getPartiGridMonthlyList()); + + } + + if(null != data.getPartiGridDailyList() && data.getPartiGridDailyList().size() > NumConstant.ZERO){ + + participationUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + participationUserGridDailyDao.insertBatch(data.getPartiGridDailyList()); + + } + + if(null != data.getRegAgencyDailyList() && data.getRegAgencyDailyList().size() > NumConstant.ZERO){ + + regUserAgencyDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + regUserAgencyDailyDao.insertBatch(data.getRegAgencyDailyList()); + + } + + if(null != data.getRegAgencyMonthlyList() && data.getRegAgencyMonthlyList().size() > NumConstant.ZERO){ + + regUserAgencyMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + regUserAgencyMonthlyDao.insertBatch(data.getRegAgencyMonthlyList()); + + } + + if(null != data.getRegGridDailyList() && data.getRegGridDailyList().size() > NumConstant.ZERO){ + + regUserGridDailyDao.deleteByParams(data.getDateId(),data.getCustomerId()); + regUserGridDailyDao.insertBatch(data.getRegGridDailyList()); + + } + + if(null != data.getRegGridMonthlyList() && data.getRegGridMonthlyList().size() > NumConstant.ZERO){ + + regUserGridMonthlyDao.deleteByParams(data.getMonthId(),data.getCustomerId()); + regUserGridMonthlyDao.insertBatch(data.getRegGridMonthlyList()); + + } + + } +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java new file mode 100644 index 0000000000..a83bc3a5c0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -0,0 +1,28 @@ +package com.epmet.service.topic; + +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.util.DimIdGenerator; + +import java.util.Date; +import java.util.List; + +/** + * @Author wangc + * @CreateTime 2020/6/19 13:22 + */ +public interface TopicService { + + /** + * @Description 计算并生成统计数据 整合维度 : 机关 网格 组 话题 + * @param agencies + * @param targetDate + * @param timeDimension + * @return + * @author wangc + * @date 2020.06.22 11:12 + **/ + TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java new file mode 100644 index 0000000000..5d20be9489 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -0,0 +1,920 @@ +package com.epmet.service.topic.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.topic.TopicDao; +import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.DimTopicStatusDTO; +import com.epmet.dto.stats.topic.*; +import com.epmet.dto.stats.topic.result.GridTopicData; +import com.epmet.dto.stats.topic.result.GroupTopicData; +import com.epmet.dto.stats.topic.result.TopicStatisticalData; +import com.epmet.dto.topic.result.ResiGroupTopicResultDTO; +import com.epmet.dto.topic.result.ResiTopicOperationResultDTO; +import com.epmet.dto.topic.result.ResiTopicResultDTO; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.impl.UserServiceImpl; +import com.epmet.util.DimIdGenerator; +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.math.BigDecimal; +import java.text.NumberFormat; +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description + * @ClassName TopicServiceImpl + * @Auth wangc + * @Date 2020-06-20 17:00 + */ +@DataSource(DataSourceConstant.RESI_GROUP) +@Service +public class TopicServiceImpl implements TopicService { + + private static final Logger logger = LoggerFactory.getLogger(UserServiceImpl.class); + + @Autowired + private TopicDao topicDao; + + /** + * @Description 计算并生成统计数据 整合维度 : 机关 网格 组 话题 + * @param agencies + * @param targetDate + * @param timeDimension + * @return + * @author wangc + * @date 2020.06.22 11:12 + **/ + @Override + public TopicStatisticalData compute(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension, String customerId, List statusDimension) { + if(null == agencies || agencies.size() == NumConstant.ZERO){ + logger.warn("没有相应的机关集合"); + return null; + } + + //Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + Map> subGridOfAgency = new HashMap<>(); + agencies.forEach(agency -> { + initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); + }); + + List topics = topicDao.selectGroupOrderByGrid(targetDate,customerId); + topics.forEach(groupTopic -> { + if(null != groupTopic.getTopics() && groupTopic.getTopics().size() == NumConstant.ONE && StringUtils.isBlank(groupTopic.getTopics().get(NumConstant.ZERO).getTopicId())){ + groupTopic.setTopics(new ArrayList<>()); + } + }); + Map> gridGroupMap = + topics.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); + + return calculateAndSummarizeTopicStatisticalData(subGridOfAgency,agencies,gridGroupMap,targetDate,statusDimension,timeDimension,customerId); + + } + + /** + * @Description 初始化机关-所有下级网格Map + * @param pid - 固定一个机关Id + * @param agency - AgencySubTreeDto + * @param subGridOfAgency - Map> + * @return + * @author wangc + * @date 2020.06.18 15:54 + **/ + 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 计算并整合出每一个组内话题的数据 + * @param subGridOfAgency + * @param gridGroupMap + * @param targetDate + * @return + * @author wangc + * @date 2020.06.22 13:13 + **/ + TopicStatisticalData calculateAndSummarizeTopicStatisticalData(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Date targetDate,List statusDimension ,DimIdGenerator.DimIdBean timeDimension ,String customerId){ + if(null == subGridOfAgency || subGridOfAgency.size() <= NumConstant.ZERO){ + return null; + } + if(null == gridGroupMap || gridGroupMap.size() <= NumConstant.ZERO){ + return null; + } + //定义数据包 - 返回对象 + TopicStatisticalData dataPacket = new TopicStatisticalData(); + + dataPacket.setDateId(timeDimension.getDateId()); + dataPacket.setMonthId(timeDimension.getMonthId()); + dataPacket.setCustomerId(customerId); + + //参数:subGridOfAgency 所有机关的下级网格信息 + + //参数:gridGroupMap 所有网格的组以及组内话题 + + //[所有]话题当日的操作记录 + List operations = + topicDao.selectTopicOperationRecord(targetDate); + //key:话题Id value:这个话题在当日的操作记录 + //操作类型有: ①discussing(发布) ②hidden(屏蔽) ③hidden_cancelled(取消屏蔽) ④closed(关闭) ⑤shift_issue(转议题) + //注意不要把【发布】和【取消屏蔽】混淆!!! + Map> topicOperationMap = + operations.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId)); + + analyzeTopic(subGridOfAgency,agencies,gridGroupMap,topicOperationMap,targetDate,dataPacket,statusDimension,timeDimension); + return dataPacket; + } + + /** + * @Description 生成话题统计数据 + * @param + * @return + * @author wangc + * @date 2020.06.22 13:45 + **/ + void analyzeTopic(Map> subGridOfAgency, List agencies, Map> gridGroupMap, Map> topicOperationMap, Date targetDate, TopicStatisticalData dataPacket, List statusDimension, DimIdGenerator.DimIdBean timeDimension){ + Boolean isMonthEnd = false; + 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); + + isMonthEnd = true; + } + + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + Map statusMap = new HashMap<>(); + statusDimension.forEach(status -> statusMap.put(status.getId(),status)); + Map agencyMap = new HashMap<>(); + agencies.forEach(agency -> {agencyMap.put(agency.getAgencyId(),agency);}); + + + List groupList = new LinkedList<>(); + for(Map.Entry> entry : gridGroupMap.entrySet()){ + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO) + groupList.addAll(entry.getValue()); + } + + //key -> groupId + Map groupTopicData = traverseGroupTopic(groupList,topicOperationMap); + Map gridDistinct = new HashMap<>(); + agencies.forEach(agency -> { + if(null != agency.getGridIds() && agency.getGridIds().size() > NumConstant.ZERO){ + agency.getGridIds().forEach(grid -> { + gridDistinct.put(grid,false); + }); + } + }); + + for(Map.Entry> entry : subGridOfAgency.entrySet()){ + + FactTopicIssueAgencyDailyDTO issueAgencyD = new FactTopicIssueAgencyDailyDTO(); + FactTopicTotalAgencyDailyDTO totalAgencyD = new FactTopicTotalAgencyDailyDTO(); + FactTopicStatusAgencyDailyDTO topicAgencyD_discussing = new FactTopicStatusAgencyDailyDTO(); + FactTopicStatusAgencyDailyDTO topicAgencyD_hidden = new FactTopicStatusAgencyDailyDTO(); + FactTopicStatusAgencyDailyDTO topicAgencyD_closed = new FactTopicStatusAgencyDailyDTO(); + + initAgencyDailyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed); + + + + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ + entry.getValue().forEach(gridId -> { + + FactTopicIssueGridDailyDTO issueGridD = new FactTopicIssueGridDailyDTO(); + FactTopicStatusGridDailyDTO topicGridD_discussing = new FactTopicStatusGridDailyDTO(); + FactTopicStatusGridDailyDTO topicGridD_hidden = new FactTopicStatusGridDailyDTO(); + FactTopicStatusGridDailyDTO topicGridD_closed = new FactTopicStatusGridDailyDTO(); + FactTopicTotalGridDailyDTO totalGirdD = new FactTopicTotalGridDailyDTO(); + + + + initGridDailyDTO(entry.getKey(),gridId,agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueGridD,totalGirdD,topicGridD_discussing,topicGridD_hidden,topicGridD_closed); + + + + + List groups = gridGroupMap.get(gridId); + if(null != groups && groups.size() > NumConstant.ZERO) { + groups.forEach(group -> { + if (null != group && StringUtils.isNotBlank(group.getGroupId())) { + + + issueAgencyD.setIssueIncr(issueAgencyD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr()); + issueAgencyD.setIssueTotal(issueAgencyD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal()); + + issueGridD.setIssueIncr(issueGridD.getIssueIncr() + groupTopicData.get(group.getGroupId()).getIssueIncr()); + issueGridD.setIssueTotal(issueGridD.getIssueTotal() + groupTopicData.get(group.getGroupId()).getIssueTotal()); + + totalAgencyD.setIssueTotalCount(issueAgencyD.getIssueTotal()); + totalAgencyD.setHiddenTotalCount(totalAgencyD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal()); + totalAgencyD.setTopicIncr(totalAgencyD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr()); + totalAgencyD.setTopicTotal(totalAgencyD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal()); + + + totalGirdD.setIssueTotalCount(issueGridD.getIssueTotal()); + totalGirdD.setHiddenTotalCount(totalGirdD.getHiddenTotalCount() + groupTopicData.get(group.getGroupId()).getHiddenTotal()); + totalGirdD.setTopicIncr(totalGirdD.getTopicIncr() + groupTopicData.get(group.getGroupId()).getTopicIncr()); + totalGirdD.setTopicTotal(totalGirdD.getTopicTotal() + groupTopicData.get(group.getGroupId()).getTotal()); + + + GroupTopicData data = groupTopicData.get(group.getGroupId()); + if (null != data) { + + + topicAgencyD_discussing.setTopicCount(topicAgencyD_discussing.getTopicCount() + data.getDiscussingTotal()); + topicAgencyD_discussing.setTopicIncrement(topicAgencyD_discussing.getTopicIncrement() + data.getDiscussingIncr()); + + topicAgencyD_hidden.setTopicCount(topicAgencyD_hidden.getTopicCount() + data.getHiddenTotal()); + topicAgencyD_hidden.setTopicIncrement(topicAgencyD_hidden.getTopicIncrement() + data.getHiddenIncr()); + + topicAgencyD_closed.setTopicCount(topicAgencyD_closed.getTopicCount() + data.getClosedTotal()); + topicAgencyD_closed.setTopicIncrement(topicAgencyD_closed.getTopicIncrement() + data.getClosedIncr()); + + + topicGridD_discussing.setTopicCount(topicGridD_discussing.getTopicCount() + data.getDiscussingTotal()); + topicGridD_discussing.setTopicIncrement(topicGridD_discussing.getTopicIncrement() + data.getDiscussingIncr()); + + topicGridD_hidden.setTopicCount(topicGridD_hidden.getTopicCount() + data.getHiddenTotal()); + topicGridD_hidden.setTopicIncrement(topicGridD_hidden.getTopicIncrement() + data.getHiddenIncr()); + + topicGridD_closed.setTopicCount(topicGridD_closed.getTopicCount() + data.getClosedTotal()); + topicGridD_closed.setTopicIncrement(topicGridD_closed.getTopicIncrement() + data.getClosedIncr()); + + + } + + } + + + }); + } + //网格-百分比 + setGridTopicProportion(numberFormat, topicGridD_discussing, topicGridD_hidden, topicGridD_closed, totalGirdD); + + if(!gridDistinct.get(gridId)) { + setGridDailyDataPacket(dataPacket, issueGridD, totalGirdD, topicGridD_discussing, topicGridD_hidden, topicGridD_closed); + } + gridDistinct.put(gridId,true); + }); + //机关-百分比 + setAgencyTopicProportion(numberFormat,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed,totalAgencyD); + + setAgencyDailyDataPacket(dataPacket,issueAgencyD,totalAgencyD,topicAgencyD_discussing,topicAgencyD_hidden,topicAgencyD_closed); + + } + + } + + + + if(isMonthEnd){ + + gridDistinct.forEach((k,v) -> { + gridDistinct.put(k,false); + }); + + List topicsBetweenTimeRange = topicDao.selectGroupOrderByGridBetweenTimeRange(calendar.getTime(),targetDate,null); + Map> GridGroupMapBetweenTimeRange = + topicsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiGroupTopicResultDTO::getGridId)); + List groupListBetweenTimeRange = new LinkedList<>(); + + for(Map.Entry> entryBetweenTimeRange : GridGroupMapBetweenTimeRange.entrySet()){ + if(null != entryBetweenTimeRange.getValue() && entryBetweenTimeRange.getValue().size() > NumConstant.ZERO) + groupListBetweenTimeRange.addAll(entryBetweenTimeRange.getValue()); + } + List operationsBetweenTimeRange = + topicDao.selectTopicOperationRecordBetweenTimeRange(calendar.getTime(),targetDate); + + Map> topicOperationMapBetweenTimeRange = + operationsBetweenTimeRange.stream().collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getTopicId)); + Map groupTopicDataBetweenTimeRange = traverseGroupTopic(groupListBetweenTimeRange,topicOperationMapBetweenTimeRange); + + for(Map.Entry> entry : subGridOfAgency.entrySet()){ + + FactTopicIssueAgencyMonthlyDTO issueAgencyM = new FactTopicIssueAgencyMonthlyDTO(); + FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing = new FactTopicStatusAgencyMonthlyDTO(); + FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden = new FactTopicStatusAgencyMonthlyDTO(); + FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed = new FactTopicStatusAgencyMonthlyDTO(); + + + initAgencyMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getPid(),agencyMap.get(entry.getKey()).getCustomerId(),timeDimension,statusMap,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + + + + if(null != entry.getValue() && entry.getValue().size() > NumConstant.ZERO){ + entry.getValue().forEach(gridId -> { + + FactTopicIssueGridMonthlyDTO issueGridM = new FactTopicIssueGridMonthlyDTO(); + initGridMonthlyDTO(entry.getKey(),agencyMap.get(entry.getKey()).getCustomerId(),gridId,timeDimension,issueGridM); + + + List groups = gridGroupMap.get(gridId); + groups.forEach(group -> { + if(null != group && StringUtils.isNotBlank(group.getGroupId())){ + + + issueAgencyM.setIssueIncr(issueAgencyM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr()); + issueAgencyM.setIssueTotal(issueAgencyM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal()); + + issueGridM.setIssueIncr(issueGridM.getIssueIncr() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueIncr()); + issueGridM.setIssueTotal(issueGridM.getIssueTotal() + groupTopicDataBetweenTimeRange.get(group.getGroupId()).getIssueTotal()); + + + GroupTopicData data = groupTopicData.get(group.getGroupId()); + if(null != data){ + + + topicAgencyM_discussing.setTopicCount(topicAgencyM_discussing.getTopicCount() + data.getDiscussingTotal()); + topicAgencyM_discussing.setTopicIncr(topicAgencyM_discussing.getTopicIncr() + data.getDiscussingIncr()); + + topicAgencyM_hidden.setTopicCount(topicAgencyM_hidden.getTopicCount() + data.getHiddenTotal()); + topicAgencyM_hidden.setTopicIncr(topicAgencyM_hidden.getTopicIncr() + data.getHiddenIncr()); + + topicAgencyM_closed.setTopicCount(topicAgencyM_closed.getTopicCount() + data.getClosedTotal()); + topicAgencyM_closed.setTopicIncr(topicAgencyM_closed.getTopicIncr() + data.getClosedIncr()); + + } + + } + + + }); + + if(!gridDistinct.get(gridId)) { + setGridMonthlyDataPacket(dataPacket, issueGridM); + } + gridDistinct.put(gridId,true); + }); + //机关-百分比 + setAgencyTopicMonthlyProportion(numberFormat,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + + setAgencyMonthlyDataPacket(dataPacket,issueAgencyM,topicAgencyM_discussing,topicAgencyM_hidden,topicAgencyM_closed); + + } + + } + + + + } + } + + + /** + * @Description 生成每个组的话题统计数据 + * @param + * @return Map key:groupId + * @author wangc + * @date 2020.06.22 16:03 + **/ + Map traverseGroupTopic(List groups, Map> topicOperationMap){ + if(null == groups || groups.size() < NumConstant.ONE) + return null; + + Map groupTopicStatistical = new HashMap<>(); + + groups.forEach(group -> { + + if (null != group) { + + GroupTopicData groupTopicData = new GroupTopicData(); + groupTopicData.setGroupId(group.getGroupId()); + + groupTopicData.setTotal(group.getTopics().size()); + + if (null == group.getTopics() || group.getTopics().size() == NumConstant.ZERO) { + groupTopicData.setTopicIncr(NumConstant.ZERO); + groupTopicData.setHiddenTotal(NumConstant.ZERO); + groupTopicData.setHiddenIncr(NumConstant.ZERO); + groupTopicData.setIssueIncr(NumConstant.ZERO); + groupTopicData.setClosedTotal(NumConstant.ZERO); + groupTopicData.setClosedIncr(NumConstant.ZERO); + groupTopicData.setDiscussingTotal(NumConstant.ZERO); + groupTopicData.setDiscussingIncr(NumConstant.ZERO); + groupTopicData.setIssueTotal(NumConstant.ZERO); + }else{ + + for (ResiTopicResultDTO topic : group.getTopics()) { + + if (StringUtils.equals(NumConstant.ONE_STR, topic.getIncrFlag())) { + groupTopicData.setTopicIncr(groupTopicData.getTopicIncr() + NumConstant.ONE); + } + List operations = topicOperationMap.get(topic.getTopicId()); + boolean operFlag = true; + if(null == operations || operations.size() < NumConstant.ZERO){ + operFlag = false; + } + Map> hiddenGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null; + + Map> hiddenCancelledGroupByDate = operFlag ? operations.stream().filter(oper -> StringUtils.equals("hidden_cancelled",oper.getStatus())).collect(Collectors.groupingBy(ResiTopicOperationResultDTO::getCreatedTime)) : null; + + + //对于话题,每个话题的操作记录中,【关闭】与【转议题】只会出现一次,而【屏蔽】与【取消屏蔽】会出现多次 + switch (topic.getStatus()) { + case "hidden": + groupTopicData.setHiddenTotal(groupTopicData.getHiddenTotal() + NumConstant.ONE); + if (operFlag) { + //如果在同一天内被多次屏蔽,只计算一次 + hiddenGroupByDate.forEach((k, v) -> { + if (null != v && v.size() > NumConstant.ZERO) { + groupTopicData.setHiddenIncr(groupTopicData.getHiddenIncr() + NumConstant.ONE); + } + }); + + for (ResiTopicOperationResultDTO operation : operations) { + if (StringUtils.equals(operation.getStatus(), "shift_issue")) + groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + } + } + break; + case "closed": + + groupTopicData.setClosedTotal(groupTopicData.getClosedTotal() + NumConstant.ONE); + if (operFlag) { + for (ResiTopicOperationResultDTO operation : operations) { + if (StringUtils.equals(operation.getStatus(), "closed")) + groupTopicData.setClosedIncr(groupTopicData.getClosedIncr() + NumConstant.ONE); + if (StringUtils.equals(operation.getStatus(), "shift_issue")) + groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + } + } + break; + case "discussing": + + groupTopicData.setDiscussingTotal(groupTopicData.getDiscussingTotal() + NumConstant.ONE); + + Set dateRelease = new HashSet<>(); + if(operFlag) { + if (null != hiddenGroupByDate && hiddenGroupByDate.size() > NumConstant.ZERO){ + hiddenGroupByDate.forEach((k, v) -> { + if (null != v && v.size() > NumConstant.ZERO) { + if (null != hiddenCancelledGroupByDate.get(k) && hiddenCancelledGroupByDate.get(k).size() > NumConstant.ZERO) { + if (hiddenCancelledGroupByDate.get(k).size() == v.size()) { + groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE); + dateRelease.add(k); + return; //相当于continue,循环下一个日期 + } else { + //话题操作日志与话题状态不符 + + } + } + } + }); + } + + + if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "discussing") && !dateRelease.contains(operation.getCreatedTime())).findAny().isPresent()) { + groupTopicData.setDiscussingIncr(groupTopicData.getDiscussingIncr() + NumConstant.ONE); + } + + if (operations.stream().filter(operation -> StringUtils.equals(operation.getStatus(), "shift_issue")).findAny().isPresent()) { + groupTopicData.setIssueIncr(groupTopicData.getIssueIncr() + NumConstant.ONE); + } + } + break; + } + + if (topic.isShiftIssue()) { + groupTopicData.setIssueTotal(groupTopicData.getIssueTotal() + NumConstant.ONE); + } + } + } + + groupTopicStatistical.put(group.getGroupId(), groupTopicData); + } + + }); + + return groupTopicStatistical; + } + + void initAgencyDailyDTO(String agencyId, String pid, String customerId,DimIdGenerator.DimIdBean timeDimension, Map statusMap, FactTopicIssueAgencyDailyDTO issueAgencyD, FactTopicTotalAgencyDailyDTO totalAgencyD, FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed){ + + + issueAgencyD.setAgencyId(agencyId); + issueAgencyD.setPid(pid); + issueAgencyD.setCustomerId(customerId); + issueAgencyD.setDateId(timeDimension.getDateId()); + issueAgencyD.setWeekId(timeDimension.getWeekId()); + issueAgencyD.setMonthId(timeDimension.getMonthId()); + issueAgencyD.setQuarterId(timeDimension.getQuarterId()); + issueAgencyD.setYearId(timeDimension.getYearId()); + issueAgencyD.setIssueIncr(NumConstant.ZERO); + issueAgencyD.setIssueTotal(NumConstant.ZERO); + issueAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + totalAgencyD.setAgencyId(agencyId); + totalAgencyD.setPid(pid); + totalAgencyD.setCustomerId(customerId); + totalAgencyD.setDateId(timeDimension.getDateId()); + totalAgencyD.setWeekId(timeDimension.getWeekId()); + totalAgencyD.setMonthId(timeDimension.getMonthId()); + totalAgencyD.setQuarterId(timeDimension.getQuarterId()); + totalAgencyD.setYearId(timeDimension.getYearId()); + totalAgencyD.setIssueTotalCount(NumConstant.ZERO); + totalAgencyD.setHiddenTotalCount(NumConstant.ZERO); + totalAgencyD.setTopicIncr(NumConstant.ZERO); + totalAgencyD.setTopicTotal(NumConstant.ZERO); + totalAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyD_discussing.setAgencyId(agencyId); + topicAgencyD_discussing.setPid(pid); + topicAgencyD_discussing.setCustomerId(customerId); + topicAgencyD_discussing.setDateId(timeDimension.getDateId()); + topicAgencyD_discussing.setWeekId(timeDimension.getWeekId()); + topicAgencyD_discussing.setMonthId(timeDimension.getMonthId()); + topicAgencyD_discussing.setQuarterId(timeDimension.getQuarterId()); + topicAgencyD_discussing.setYearId(timeDimension.getYearId()); + topicAgencyD_discussing.setTopicStatusId(statusMap.get("discussing").getId()); + topicAgencyD_discussing.setTopicIncrement(NumConstant.ZERO); + topicAgencyD_discussing.setTopicCount(NumConstant.ZERO); + topicAgencyD_discussing.setTopicProportion(BigDecimal.ZERO); + topicAgencyD_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyD_hidden.setAgencyId(agencyId); + topicAgencyD_hidden.setPid(pid); + topicAgencyD_hidden.setCustomerId(customerId); + topicAgencyD_hidden.setDateId(timeDimension.getDateId()); + topicAgencyD_hidden.setWeekId(timeDimension.getWeekId()); + topicAgencyD_hidden.setMonthId(timeDimension.getMonthId()); + topicAgencyD_hidden.setQuarterId(timeDimension.getQuarterId()); + topicAgencyD_hidden.setYearId(timeDimension.getYearId()); + topicAgencyD_hidden.setTopicStatusId(statusMap.get("hidden").getId()); + topicAgencyD_hidden.setTopicIncrement(NumConstant.ZERO); + topicAgencyD_hidden.setTopicCount(NumConstant.ZERO); + topicAgencyD_hidden.setTopicProportion(BigDecimal.ZERO); + topicAgencyD_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyD_closed.setAgencyId(agencyId); + topicAgencyD_closed.setPid(pid); + topicAgencyD_closed.setCustomerId(customerId); + topicAgencyD_closed.setDateId(timeDimension.getDateId()); + topicAgencyD_closed.setWeekId(timeDimension.getWeekId()); + topicAgencyD_closed.setMonthId(timeDimension.getMonthId()); + topicAgencyD_closed.setQuarterId(timeDimension.getQuarterId()); + topicAgencyD_closed.setYearId(timeDimension.getYearId()); + topicAgencyD_closed.setTopicStatusId(statusMap.get("closed").getId()); + topicAgencyD_closed.setTopicIncrement(NumConstant.ZERO); + topicAgencyD_closed.setTopicCount(NumConstant.ZERO); + topicAgencyD_closed.setTopicProportion(BigDecimal.ZERO); + topicAgencyD_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + + } + + void initGridDailyDTO(String agencyId, String gridId, String customerId ,DimIdGenerator.DimIdBean timeDimension,Map statusMap, FactTopicIssueGridDailyDTO issueGridD, FactTopicTotalGridDailyDTO totalGridD, FactTopicStatusGridDailyDTO topicGridD_discussing,FactTopicStatusGridDailyDTO topicGridD_hidden,FactTopicStatusGridDailyDTO topicGridD_closed){ + + issueGridD.setAgencyId(agencyId); + issueGridD.setGridId(gridId); + issueGridD.setCustomerId(customerId); + issueGridD.setDateId(timeDimension.getDateId()); + issueGridD.setWeekId(timeDimension.getWeekId()); + issueGridD.setMonthId(timeDimension.getMonthId()); + issueGridD.setQuarterId(timeDimension.getQuarterId()); + issueGridD.setYearId(timeDimension.getYearId()); + issueGridD.setIssueIncr(NumConstant.ZERO); + issueGridD.setIssueTotal(NumConstant.ZERO); + issueGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + totalGridD.setAgencyId(agencyId); + totalGridD.setGridId(gridId); + totalGridD.setCustomerId(customerId); + totalGridD.setDateId(timeDimension.getDateId()); + totalGridD.setWeekId(timeDimension.getWeekId()); + totalGridD.setMonthId(timeDimension.getMonthId()); + totalGridD.setQuarterId(timeDimension.getQuarterId()); + totalGridD.setYearId(timeDimension.getYearId()); + totalGridD.setHiddenTotalCount(NumConstant.ZERO); + totalGridD.setIssueTotalCount(NumConstant.ZERO); + totalGridD.setTopicIncr(NumConstant.ZERO); + totalGridD.setTopicTotal(NumConstant.ZERO); + totalGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicGridD_discussing.setAgencyId(agencyId); + topicGridD_discussing.setGridId(gridId); + topicGridD_discussing.setCustomerId(customerId); + topicGridD_discussing.setDateId(timeDimension.getDateId()); + topicGridD_discussing.setWeekId(timeDimension.getWeekId()); + topicGridD_discussing.setMonthId(timeDimension.getMonthId()); + topicGridD_discussing.setQuarterId(timeDimension.getQuarterId()); + topicGridD_discussing.setYearId(timeDimension.getYearId()); + topicGridD_discussing.setTopicStatusId(statusMap.get("discussing").getId()); + topicGridD_discussing.setTopicCount(NumConstant.ZERO); + topicGridD_discussing.setTopicIncrement(NumConstant.ZERO); + topicGridD_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicGridD_hidden.setAgencyId(agencyId); + topicGridD_hidden.setGridId(gridId); + topicGridD_hidden.setCustomerId(customerId); + topicGridD_hidden.setDateId(timeDimension.getDateId()); + topicGridD_hidden.setWeekId(timeDimension.getWeekId()); + topicGridD_hidden.setMonthId(timeDimension.getMonthId()); + topicGridD_hidden.setQuarterId(timeDimension.getQuarterId()); + topicGridD_hidden.setYearId(timeDimension.getYearId()); + topicGridD_hidden.setTopicStatusId(statusMap.get("hidden").getId()); + topicGridD_hidden.setTopicCount(NumConstant.ZERO); + topicGridD_hidden.setTopicIncrement(NumConstant.ZERO); + topicGridD_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicGridD_closed.setAgencyId(agencyId); + topicGridD_closed.setGridId(gridId); + topicGridD_closed.setCustomerId(customerId); + topicGridD_closed.setDateId(timeDimension.getDateId()); + topicGridD_closed.setWeekId(timeDimension.getWeekId()); + topicGridD_closed.setMonthId(timeDimension.getMonthId()); + topicGridD_closed.setQuarterId(timeDimension.getQuarterId()); + topicGridD_closed.setYearId(timeDimension.getYearId()); + topicGridD_closed.setTopicStatusId(statusMap.get("closed").getId()); + topicGridD_closed.setTopicCount(NumConstant.ZERO); + topicGridD_closed.setTopicIncrement(NumConstant.ZERO); + topicGridD_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + } + + void setGridTopicProportion(NumberFormat numberFormat,FactTopicStatusGridDailyDTO topicGridD_discussing, FactTopicStatusGridDailyDTO topicGridD_hidden, FactTopicStatusGridDailyDTO topicGridD_closed,FactTopicTotalGridDailyDTO totalGirdD){ + topicGridD_discussing.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicGridD_discussing.getTopicCount() / (float) totalGirdD.getTopicTotal() + ))); + + topicGridD_hidden.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicGridD_hidden.getTopicCount() / (float) totalGirdD.getTopicTotal() + ))); + + + topicGridD_closed.setTopicProportion(totalGirdD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicGridD_closed.getTopicCount() / (float) totalGirdD.getTopicTotal() + ))); + + + } + + void setAgencyTopicProportion(NumberFormat numberFormat,FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed,FactTopicTotalAgencyDailyDTO totalAgencyD){ + topicAgencyD_discussing.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyD_discussing.getTopicCount() / (float) totalAgencyD.getTopicTotal() + ))); + + topicAgencyD_hidden.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyD_hidden.getTopicCount() / (float) totalAgencyD.getTopicTotal() + ))); + + topicAgencyD_closed.setTopicProportion(totalAgencyD.getTopicTotal() == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyD_closed.getTopicCount() / (float) totalAgencyD.getTopicTotal() + ))); + } + + void setAgencyDailyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueAgencyDailyDTO issueAgencyD, FactTopicTotalAgencyDailyDTO totalAgencyD, FactTopicStatusAgencyDailyDTO topicAgencyD_discussing, FactTopicStatusAgencyDailyDTO topicAgencyD_hidden, FactTopicStatusAgencyDailyDTO topicAgencyD_closed){ + if(null == dataPacket.getIssueAgencyDailyList()){ + List issueAgencyDailyList = new LinkedList<>(); + issueAgencyDailyList.add(issueAgencyD); + dataPacket.setIssueAgencyDailyList(issueAgencyDailyList); + }else{ + dataPacket.getIssueAgencyDailyList().add(issueAgencyD); + } + + if(null == dataPacket.getTotalAgencyDailyList()){ + List totalAgencyDailyList = new LinkedList<>(); + totalAgencyDailyList.add(totalAgencyD); + dataPacket.setTotalAgencyDailyList(totalAgencyDailyList); + }else{ + dataPacket.getTotalAgencyDailyList().add(totalAgencyD); + } + + if(null == dataPacket.getTopicAgencyDailyList()){ + List topicAgencyDailyList = new LinkedList<>(); + topicAgencyDailyList.add(topicAgencyD_discussing); + topicAgencyDailyList.add(topicAgencyD_hidden); + topicAgencyDailyList.add(topicAgencyD_closed); + dataPacket.setTopicAgencyDailyList(topicAgencyDailyList); + }else{ + dataPacket.getTopicAgencyDailyList().add(topicAgencyD_discussing); + dataPacket.getTopicAgencyDailyList().add(topicAgencyD_hidden); + dataPacket.getTopicAgencyDailyList().add(topicAgencyD_closed); + } + } + + void setGridDailyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueGridDailyDTO issueGridD, FactTopicTotalGridDailyDTO totalGridD, FactTopicStatusGridDailyDTO topicGridD_discussing,FactTopicStatusGridDailyDTO topicGridD_hidden,FactTopicStatusGridDailyDTO topicGridD_closed){ + if(null == dataPacket.getIssueGridDailyList()){ + List issueGridDailyList = new LinkedList<>(); + issueGridDailyList.add(issueGridD); + dataPacket.setIssueGridDailyList(issueGridDailyList); + }else{ + dataPacket.getIssueGridDailyList().add(issueGridD); + } + + if(null == dataPacket.getTotalGridDailyList()){ + List totalGridDailyList = new LinkedList<>(); + totalGridDailyList.add(totalGridD); + dataPacket.setTotalGridDailyList(totalGridDailyList); + }else{ + dataPacket.getTotalGridDailyList().add(totalGridD); + } + + if(null == dataPacket.getTopicGridDailyList()){ + List topicGridDailyList = new LinkedList<>(); + topicGridDailyList.add(topicGridD_discussing); + topicGridDailyList.add(topicGridD_hidden); + topicGridDailyList.add(topicGridD_closed); + dataPacket.setTopicGridDailyList(topicGridDailyList); + }else{ + dataPacket.getTopicGridDailyList().add(topicGridD_discussing); + dataPacket.getTopicGridDailyList().add(topicGridD_hidden); + dataPacket.getTopicGridDailyList().add(topicGridD_closed); + } + } + + void initAgencyMonthlyDTO(String agencyId, String pid, String customerId,DimIdGenerator.DimIdBean timeDimension, Map statusMap,FactTopicIssueAgencyMonthlyDTO issueAgencyM ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden ,FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){ + issueAgencyM.setAgencyId(agencyId); + issueAgencyM.setPid(pid); + issueAgencyM.setCustomerId(customerId); + issueAgencyM.setMonthId(timeDimension.getMonthId()); + issueAgencyM.setQuarterId(timeDimension.getQuarterId()); + issueAgencyM.setYearId(timeDimension.getYearId()); + issueAgencyM.setIssueIncr(NumConstant.ZERO); + issueAgencyM.setIssueTotal(NumConstant.ZERO); + issueAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + topicAgencyM_discussing.setAgencyId(agencyId); + topicAgencyM_discussing.setPid(pid); + topicAgencyM_discussing.setCustomerId(customerId); + topicAgencyM_discussing.setMonthId(timeDimension.getMonthId()); + topicAgencyM_discussing.setQuarterId(timeDimension.getQuarterId()); + topicAgencyM_discussing.setYearId(timeDimension.getYearId()); + topicAgencyM_discussing.setTopicStatusId(statusMap.get("discussing").getId()); + topicAgencyM_discussing.setTopicIncr(NumConstant.ZERO); + topicAgencyM_discussing.setTopicCount(NumConstant.ZERO); + topicAgencyM_discussing.setTopicProportion(BigDecimal.ZERO); + topicAgencyM_discussing.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyM_hidden.setAgencyId(agencyId); + topicAgencyM_hidden.setPid(pid); + topicAgencyM_hidden.setCustomerId(customerId); + topicAgencyM_hidden.setMonthId(timeDimension.getMonthId()); + topicAgencyM_hidden.setQuarterId(timeDimension.getQuarterId()); + topicAgencyM_hidden.setYearId(timeDimension.getYearId()); + topicAgencyM_hidden.setTopicStatusId(statusMap.get("hidden").getId()); + topicAgencyM_hidden.setTopicIncr(NumConstant.ZERO); + topicAgencyM_hidden.setTopicCount(NumConstant.ZERO); + topicAgencyM_hidden.setTopicProportion(BigDecimal.ZERO); + topicAgencyM_hidden.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + topicAgencyM_closed.setAgencyId(agencyId); + topicAgencyM_closed.setPid(pid); + topicAgencyM_closed.setCustomerId(customerId); + topicAgencyM_closed.setMonthId(timeDimension.getMonthId()); + topicAgencyM_closed.setQuarterId(timeDimension.getQuarterId()); + topicAgencyM_closed.setYearId(timeDimension.getYearId()); + topicAgencyM_closed.setTopicStatusId(statusMap.get("closed").getId()); + topicAgencyM_closed.setTopicIncr(NumConstant.ZERO); + topicAgencyM_closed.setTopicCount(NumConstant.ZERO); + topicAgencyM_closed.setTopicProportion(BigDecimal.ZERO); + topicAgencyM_closed.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + } + + void initGridMonthlyDTO(String agencyId, String gridId,String customerId,DimIdGenerator.DimIdBean timeDimension,FactTopicIssueGridMonthlyDTO issueGridM){ + issueGridM.setAgencyId(agencyId); + issueGridM.setGridId(gridId); + issueGridM.setCustomerId(customerId); + issueGridM.setMonthId(timeDimension.getMonthId()); + issueGridM.setQuarterId(timeDimension.getQuarterId()); + issueGridM.setYearId(timeDimension.getYearId()); + issueGridM.setIssueIncr(NumConstant.ZERO); + issueGridM.setIssueTotal(NumConstant.ZERO); + issueGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + } + + void setAgencyTopicMonthlyProportion(NumberFormat numberFormat,FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing, FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden, FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){ + + Integer total = topicAgencyM_discussing.getTopicCount() + topicAgencyM_hidden.getTopicCount() + topicAgencyM_closed.getTopicCount(); + + topicAgencyM_discussing.setTopicProportion(total == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyM_discussing.getTopicCount() / (float) total + ))); + + topicAgencyM_hidden.setTopicProportion(total == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyM_hidden.getTopicCount() / (float) total + ))); + + topicAgencyM_closed.setTopicProportion(total == NumConstant.ZERO + ? BigDecimal.ZERO + : new BigDecimal( + numberFormat.format( + (float)topicAgencyM_closed.getTopicCount() / (float) total + ))); + } + + void setAgencyMonthlyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueAgencyMonthlyDTO issueAgencyM, FactTopicStatusAgencyMonthlyDTO topicAgencyM_discussing, FactTopicStatusAgencyMonthlyDTO topicAgencyM_hidden, FactTopicStatusAgencyMonthlyDTO topicAgencyM_closed){ + if(null == dataPacket.getIssueAgencyMonthlyList()){ + List issueAgencyMonthlyList = new LinkedList<>(); + issueAgencyMonthlyList.add(issueAgencyM); + dataPacket.setIssueAgencyMonthlyList(issueAgencyMonthlyList); + }else{ + dataPacket.getIssueAgencyMonthlyList().add(issueAgencyM); + } + + + if(null == dataPacket.getTopicAgencyMonthlyList()){ + List topicAgencyMonthlyList = new LinkedList<>(); + topicAgencyMonthlyList.add(topicAgencyM_discussing); + topicAgencyMonthlyList.add(topicAgencyM_hidden); + topicAgencyMonthlyList.add(topicAgencyM_closed); + dataPacket.setTopicAgencyMonthlyList(topicAgencyMonthlyList); + }else{ + dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_discussing); + dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_hidden); + dataPacket.getTopicAgencyMonthlyList().add(topicAgencyM_closed); + } + } + + void setGridMonthlyDataPacket(TopicStatisticalData dataPacket,FactTopicIssueGridMonthlyDTO issueGridM ){ + if(null == dataPacket.getIssueGridMonthlyList()){ + List issueGridMonthlyList = new LinkedList<>(); + issueGridMonthlyList.add(issueGridM); + dataPacket.setIssueGridMonthlyList(issueGridMonthlyList); + }else{ + dataPacket.getIssueGridMonthlyList().add(issueGridM); + } + + } + +} 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 3f20d2a9e7..cd4c70287b 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 @@ -1,6 +1,8 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; +import com.epmet.dto.stats.user.result.UserStatisticalData; +import com.epmet.util.DimIdGenerator; import java.util.Date; import java.util.List; @@ -10,12 +12,12 @@ public interface UserService { /** * @Description 遍历所有机关(它的下级机关)统计注册用户和参与用户的数据,使用level控制 - * @param topAgencies - List + * @param agencies - List * @return * @author wangc * @date 2020.06.18 10:03 **/ - void traverseAgencyUser(List topAgencies, Date targetDate); + UserStatisticalData traverseAgencyUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension); /** * @Description 遍历所有机关的直属网格统计注册用户参与用户的数据 @@ -24,5 +26,5 @@ public interface UserService { * @author wangc * @date 2020.06.18 10:03 **/ - void traverseGridUser(List agencies, Date targetDate); + UserStatisticalData traverseGridUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension); } 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 cef6dbe508..6e50eebd95 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -5,8 +5,11 @@ 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.stats.user.*; +import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import com.epmet.service.user.UserService; +import com.epmet.util.DimIdGenerator; import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; @@ -14,12 +17,14 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.math.BigDecimal; +import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; /** - * @Description 直连epmet-user + * @Description 15直连epmet-user * @ClassName UserServiceImpl * @Auth wangc * @Date 2020-06-18 09:55 @@ -41,13 +46,18 @@ public class UserServiceImpl implements UserService { * @date 2020.06.18 10:03 **/ @Override - public void traverseAgencyUser(List agencies, Date targetDate) { + public UserStatisticalData traverseAgencyUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) { if(null == agencies || agencies.size() == NumConstant.ZERO){ logger.warn("没有相应的机关集合"); - return ; + return null; } + + UserStatisticalData dataPacket = new UserStatisticalData(); + dataPacket.setDateId(timeDimension.getDateId()); + dataPacket.setMonthId(timeDimension.getMonthId()); //自上向下检索 - //Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); + + Map> agencyMap = agencies.stream().collect(Collectors.groupingBy(AgencySubTreeDto::getAgencyId)); Map> subGridOfAgency = new HashMap<>(); agencies.forEach(agency -> { initAgencyGridMap(agency.getAgencyId(),agency,subGridOfAgency); @@ -56,10 +66,18 @@ public class UserServiceImpl implements UserService { //对每一个机关进行数据统计 if(subGridOfAgency.size() > NumConstant.ZERO){ subGridOfAgency.forEach((k,v) -> { - queryUserData(v,targetDate); + queryUserData(ModuleConstant.DIM_SUB_AGENCY, + k, + (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? NumConstant.ZERO_STR : agencyMap.get(k).get(NumConstant.ZERO).getPid(), + (null == agencyMap.get(k) || agencyMap.get(k).isEmpty()) ? null : agencyMap.get(k).get(NumConstant.ZERO).getCustomerId(), + v, + targetDate, + dataPacket, + timeDimension); }); } + return dataPacket; } /** @@ -70,25 +88,40 @@ public class UserServiceImpl implements UserService { * @date 2020.06.18 10:03 **/ @Override - public void traverseGridUser(List agencies, Date targetDate) { + public UserStatisticalData traverseGridUser(List agencies, Date targetDate, DimIdGenerator.DimIdBean timeDimension) { if(null == agencies || agencies.size() == NumConstant.ZERO){ logger.warn("没有相应的机关集合"); - return ; + return null; } + + UserStatisticalData dataPacket = new UserStatisticalData(); + dataPacket.setMonthId(timeDimension.getMonthId()); + dataPacket.setDateId(timeDimension.getDateId()); + //自上向下检索 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); + queryUserData(ModuleConstant.DIM_BELONGING_GRID, + k, + v.get(NumConstant.ZERO).getPid(), + v.get(NumConstant.ZERO).getCustomerId(), + new HashSet<>(v.get(NumConstant.ZERO).getGridIds()), + targetDate, + dataPacket, + timeDimension); } }); } + + return dataPacket; } /** * @Description 初始化机关-所有下级网格Map + * @param pid - 固定一个机关Id * @param agency - AgencySubTreeDto * @param subGridOfAgency - Map> * @return @@ -128,48 +161,30 @@ public class UserServiceImpl implements UserService { /** * @Description 执行查询用户数据统计的逻辑 + * @param relation - agency(下级机关加网格) | grid(直属网格) + * @param agencyId + * @param pid + * @param customerId * @param gridIds - 机关下所有网格集合/机关下直属网格集合 * @param targetDate + * @param dataPacket - 数据包 + * @param timeDimension DimIdGenerator.DimIdBean * @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); + void queryUserData(String relation, String agencyId, String pid, String customerId, Set gridIds, Date targetDate, UserStatisticalData dataPacket, DimIdGenerator.DimIdBean timeDimension){ + + if(StringUtils.isBlank(pid)) + pid = NumConstant.ZERO_STR; + dataPacket.setCustomerId(customerId); + //计算百分比使用,保留小数点后两位 + NumberFormat numberFormat = NumberFormat.getInstance(); + numberFormat.setMaximumFractionDigits(NumConstant.SIX); + + Boolean isMonthEnd = false; Calendar calendar =Calendar.getInstance(); calendar.setTime(new Date()); calendar.add(Calendar.DATE, NumConstant.ONE_NEG); @@ -185,27 +200,362 @@ public class UserServiceImpl implements UserService { 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); + isMonthEnd = true; + } + + if(StringUtils.equals(ModuleConstant.DIM_SUB_AGENCY,relation)){ + + + //默认查询注册用户 + + //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); + + + + //agency + FactRegUserAgencyDailyDTO regAgencyD = new FactRegUserAgencyDailyDTO(); + regAgencyD.setCustomerId(customerId); + regAgencyD.setAgencyId(agencyId); + regAgencyD.setDateId(timeDimension.getDateId()); + regAgencyD.setWeekId(timeDimension.getWeekId()); + regAgencyD.setYearId(timeDimension.getYearId()); + regAgencyD.setResiTotal(regData.getTotal()); + regAgencyD.setRegTotal(regData.getTotal()); + regAgencyD.setWarmHeartedTotal(warmRegData.getTotal()); + regAgencyD.setPartymemberTotal(partyRegData.getTotal()); + regAgencyD.setRegIncr(regData.getIncr()); + regAgencyD.setWarmIncr(warmRegData.getIncr()); + regAgencyD.setPartymemberIncr(partiData.getIncr()); + regAgencyD.setResiProportion(new BigDecimal(NumConstant.ONE)); + regAgencyD.setPartymemberProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyRegData.getTotal()/(float)regData.getTotal() ))); + regAgencyD.setWarmHeartedProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmRegData.getTotal()/(float)regData.getTotal() ))); + regAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getRegAgencyDailyList()){ + dataPacket.getRegAgencyDailyList().add(regAgencyD); + }else{ + List list = new ArrayList<>(); + list.add(regAgencyD); + dataPacket.setRegAgencyDailyList(list); + } + + + FactParticipationUserAgencyDailyDTO partiAgencyD = new FactParticipationUserAgencyDailyDTO(); + partiAgencyD.setCustomerId(customerId); + partiAgencyD.setAgencyId(agencyId); + partiAgencyD.setDateId(timeDimension.getDateId()); + partiAgencyD.setWeekId(timeDimension.getWeekId()); + partiAgencyD.setYearId(timeDimension.getYearId()); + partiAgencyD.setResiTotal(partiData.getTotal()); + partiAgencyD.setRegTotal(partiData.getTotal()); + partiAgencyD.setWarmHeartedTotal(warmPartiData.getTotal()); + partiAgencyD.setPartymemberTotal(partyPartiData.getTotal()); + partiAgencyD.setRegIncr(partiData.getIncr()); + partiAgencyD.setWarmIncr(warmPartiData.getIncr()); + partiAgencyD.setPartymemberIncr(partyPartiData.getIncr()); + partiAgencyD.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiAgencyD.setPartymemberProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyPartiData.getTotal()/(float)partiData.getIncr() ))); + partiAgencyD.setWarmHeartedProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmPartiData.getTotal()/(float)partiData.getIncr() ))); + partiAgencyD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getPartiAgencyDailyList()){ + dataPacket.getPartiAgencyDailyList().add(partiAgencyD); + }else{ + List list = new ArrayList<>(); + list.add(partiAgencyD); + dataPacket.setPartiAgencyDailyList(list); + } + + + //月末处理 + if(isMonthEnd){ + + + //本月注册用户增长数 + 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); + + + FactRegUserAgencyMonthlyDTO regAgencyM = new FactRegUserAgencyMonthlyDTO(); + regAgencyM.setCustomerId(customerId); + regAgencyM.setAgencyId(agencyId); + regAgencyM.setMonthId(timeDimension.getMonthId()); + regAgencyM.setQuarterId(timeDimension.getQuarterId()); + regAgencyM.setYearId(timeDimension.getYearId()); + regAgencyM.setRegTotal(regData.getTotal()); + regAgencyM.setResiTotal(regData.getTotal()); + regAgencyM.setWarmHeartedTotal(warmRegData.getTotal()); + regAgencyM.setPartymemberTotal(partyRegData.getTotal()); + regAgencyM.setRegIncr(regIncrMonthly); + regAgencyM.setWarmIncr(incrWarmOfRegMonthly); + regAgencyM.setPartymemberIncr(incrPartyOfRegMonthly); + regAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); + regAgencyM.setPartymemberProportion(regAgencyD.getPartymemberProportion()); + regAgencyM.setWarmHeartedProportion(regAgencyD.getWarmHeartedProportion()); + regAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + FactParticipationUserAgencyMonthlyDTO partiAgencyM = new FactParticipationUserAgencyMonthlyDTO(); + partiAgencyM.setCustomerId(customerId); + partiAgencyM.setAgencyId(agencyId); + partiAgencyM.setMonthId(timeDimension.getMonthId()); + partiAgencyM.setQuarterId(timeDimension.getQuarterId()); + partiAgencyM.setYearId(timeDimension.getYearId()); + partiAgencyM.setRegTotal(partiData.getTotal()); + partiAgencyM.setResiTotal(partiData.getTotal()); + partiAgencyM.setWarmHeartedTotal(warmPartiData.getTotal()); + partiAgencyM.setPartymemberTotal(partyPartiData.getTotal()); + partiAgencyM.setRegIncr(partiIncrMonthly); + partiAgencyM.setWarmIncr(incrWarmOfPartiMonthly); + partiAgencyM.setPartymemberIncr(incrPartyOfPartiMonthly); + partiAgencyM.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiAgencyM.setPartymemberProportion(partiAgencyD.getPartymemberProportion()); + partiAgencyM.setWarmHeartedProportion(partiAgencyD.getWarmHeartedProportion()); + partiAgencyM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + + + } + + + }else{ + //直属网格数据 + + + Set singleGridIdSet = new HashSet<>(); + final boolean monthEndFlag = isMonthEnd; + //grid + gridIds.forEach(gridId -> { + + singleGridIdSet.add(gridId); + // START QUERY + + //1.计算机关下注册用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO regData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate); + //2.查询注册用户的Id列表 + List incrRegUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate); + List totalRegUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO warmRegData = + userDao.selectWarmTotalAndIncr(totalRegUsers,incrRegUsers,singleGridIdSet,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(注册用户) + CommonTotalAndIncCountResultDTO partyRegData = + userDao.selectPartyTotalAndIncr(totalRegUsers,incrRegUsers,targetDate); + + + //参与用户 + //1.计算机关下参与用户一个时间单位内的累计与增长 + CommonTotalAndIncCountResultDTO partiData = + userDao.selectResiTotalAndIncrByLevel(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate); + //2.查询参与用户的Id列表 + List incrPartiUsers = + userDao.selectIncrUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate); + List totalPartiUsers = + userDao.selectTotalUserIds(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,targetDate); + //3.查询机关下一个时间单位内热心居民的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO warmPartiData = + userDao.selectWarmTotalAndIncr(totalPartiUsers,incrPartiUsers,singleGridIdSet,targetDate); + //4.查询机关下一个时间单位内党员的累计与增量(参与用户) + CommonTotalAndIncCountResultDTO partyPartiData = + userDao.selectPartyTotalAndIncr(totalPartiUsers,incrPartiUsers,targetDate); + + + // END QUERY + + + //注册用户网格级别 + FactRegUserGridDailyDTO regGridD = new FactRegUserGridDailyDTO(); + + regGridD.setCustomerId(customerId); + regGridD.setGridId(gridId); + regGridD.setCustomerId(customerId); + regGridD.setAgencyId(agencyId);//网格直属得机关 + regGridD.setDateId(timeDimension.getDateId()); + regGridD.setWeekId(timeDimension.getWeekId()); + regGridD.setYearId(timeDimension.getYearId()); + regGridD.setResiTotal(regData.getTotal()); + regGridD.setRegTotal(regData.getTotal()); + regGridD.setWarmHeartedTotal(warmRegData.getTotal()); + regGridD.setPartymemberTotal(partyRegData.getTotal()); + regGridD.setRegIncr(regData.getIncr()); + regGridD.setWarmIncr(warmRegData.getIncr()); + regGridD.setPartymemberIncr(partyRegData.getIncr()); + regGridD.setResiProportion(new BigDecimal(NumConstant.ONE)); + regGridD.setPartymemberProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyRegData.getTotal()/(float)regData.getTotal() ))); + regGridD.setWarmHeartedProportion(null == regData.getTotal() || regData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmRegData.getTotal()/(float)regData.getTotal() ))); + regGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getRegGridDailyList()){ + dataPacket.getRegGridDailyList().add(regGridD); + }else{ + List list = new ArrayList<>(); + list.add(regGridD); + dataPacket.setRegGridDailyList(list); + } + + + //参与用户网格级别 + FactParticipationUserGridDailyDTO partiGridD = new FactParticipationUserGridDailyDTO(); + + partiGridD.setCustomerId(customerId); + partiGridD.setGridId(gridId); + partiGridD.setAgencyId(agencyId); + partiGridD.setDateId(timeDimension.getDateId()); + partiGridD.setWeekId(timeDimension.getWeekId()); + partiGridD.setYearId(timeDimension.getYearId()); + partiGridD.setResiTotal(partiData.getTotal()); + partiGridD.setRegTotal(partiData.getTotal()); + partiGridD.setWarmHeartedTotal(warmPartiData.getTotal()); + partiGridD.setPartymemberTotal(partyPartiData.getTotal()); + partiGridD.setRegIncr(partiData.getIncr()); + partiGridD.setWarmIncr(warmPartiData.getIncr()); + partiGridD.setPartymemberIncr(partyPartiData.getIncr()); + partiGridD.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiGridD.setPartymemberProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)partyPartiData.getTotal()/(float)partiData.getTotal() ))); + partiGridD.setWarmHeartedProportion(null == partiData.getTotal() || partiData.getTotal() == NumConstant.ZERO ? BigDecimal.ZERO : new BigDecimal(numberFormat.format((float)warmPartiData.getTotal()/(float)partiData.getTotal() ))); + partiGridD.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + + if(null != dataPacket.getPartiGridDailyList()){ + dataPacket.getPartiGridDailyList().add(partiGridD); + }else{ + List list = new ArrayList<>(); + list.add(partiGridD); + dataPacket.setPartiGridDailyList(list); + } + + + + if(monthEndFlag){ + //本月注册用户增长数 + Integer regIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增注册用户Id集合 + List incrRegIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_REG,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增党员数(注册用户) + Integer incrPartyOfRegMonthly = userDao.selectPartyIncrWithinTimeRange(incrRegIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(注册用户) + Integer incrWarmOfRegMonthly = userDao.selectWarmIncrWithinTimeRange(incrRegIdsMonthly,singleGridIdSet,calendar.getTime(),targetDateCheck); + + + //本月参与用户增长数 + Integer partiIncrMonthly = userDao.selectResiIncrWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增参与用户Id集合 + List incrPartiIdsMonthly = userDao.selectIncrUserIdsWithinTimeRange(ModuleConstant.REG_OR_PARTI_FLAG_PARTI,singleGridIdSet,calendar.getTime(),targetDateCheck); + //本月新增党员数(参与用户) + Integer incrPartyOfPartiMonthly = userDao.selectPartyIncrWithinTimeRange(incrPartiIdsMonthly,calendar.getTime(),targetDateCheck); + //本月新增热心居民数(参与用户) + Integer incrWarmOfPartiMonthly = userDao.selectWarmIncrWithinTimeRange(incrPartiIdsMonthly,singleGridIdSet,calendar.getTime(),targetDateCheck); + + FactRegUserGridMonthlyDTO regGridM = new FactRegUserGridMonthlyDTO(); + regGridM.setCustomerId(customerId); + regGridM.setAgencyId(agencyId); + regGridM.setGridId(gridId); + regGridM.setMonthId(timeDimension.getMonthId()); + regGridM.setQuarterId(timeDimension.getQuarterId()); + regGridM.setYearId(timeDimension.getYearId()); + regGridM.setRegTotal(regData.getTotal()); + regGridM.setResiTotal(regData.getTotal()); + regGridM.setWarmHeartedTotal(warmRegData.getTotal()); + regGridM.setPartymemberTotal(partyRegData.getTotal()); + regGridM.setRegIncr(regIncrMonthly); + regGridM.setWarmIncr(incrWarmOfRegMonthly); + regGridM.setPartymemberIncr(incrPartyOfRegMonthly); + regGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + regGridM.setPartymemberProportion(regGridD.getPartymemberProportion()); + regGridM.setWarmHeartedProportion(regGridD.getWarmHeartedProportion()); + regGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null != dataPacket.getRegGridMonthlyList()){ + dataPacket.getRegGridMonthlyList().add(regGridM); + }else{ + List list = new ArrayList<>(); + list.add(regGridM); + dataPacket.setRegGridMonthlyList(list); + } + + FactParticipationUserGridMonthlyDTO partiGridM = new FactParticipationUserGridMonthlyDTO(); + partiGridM.setCustomerId(customerId); + partiGridM.setAgencyId(agencyId); + partiGridM.setMonthId(timeDimension.getMonthId()); + partiGridM.setQuarterId(timeDimension.getQuarterId()); + partiGridM.setYearId(timeDimension.getYearId()); + partiGridM.setRegTotal(partiData.getTotal()); + partiGridM.setResiTotal(partiData.getTotal()); + partiGridM.setWarmHeartedTotal(warmPartiData.getTotal()); + partiGridM.setPartymemberTotal(partyPartiData.getTotal()); + partiGridM.setRegIncr(partiIncrMonthly); + partiGridM.setWarmIncr(incrWarmOfPartiMonthly); + partiGridM.setPartymemberIncr(incrPartyOfPartiMonthly); + partiGridM.setResiProportion(new BigDecimal(NumConstant.ONE)); + partiGridM.setPartymemberProportion(partiGridD.getPartymemberProportion()); + partiGridM.setWarmHeartedProportion(partiGridD.getWarmHeartedProportion()); + partiGridM.setCreatedBy(ModuleConstant.CREATED_BY_STATISTICAL_ROBOT); + if(null != dataPacket.getPartiGridMonthlyList()){ + dataPacket.getPartiGridMonthlyList().add(partiGridM); + }else{ + List list = new ArrayList<>(); + list.add(partiGridM); + dataPacket.setPartiGridMonthlyList(list); + } + + } + + + singleGridIdSet.clear(); + + }); } - } + + + + } + public static void main(String[] args) { @@ -213,7 +563,7 @@ public class UserServiceImpl implements UserService { 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.DAY_OF_MONTH, 1); calendar.set(Calendar.HOUR_OF_DAY, 0); calendar.set(Calendar.MINUTE, 0); calendar.set(Calendar.SECOND, 0); @@ -227,4 +577,12 @@ public class UserServiceImpl implements UserService { System.out.println(format.format(calendar.getTime())); System.out.println(format2.format(calendar.getTime())); } + + /** + * @Description 先查出所有的用户单位时间内新增的注册居民、党员、热心居民(跟随网格),然后查出单位时间内,每一个网格下的参与用户Id集合和注册用户Id集合 + * @param + * @return + * @author wangc + * @date 2020.06.23 00:32 + **/ } 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 index 1ef0b26a51..8a196f82f4 100644 --- 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 @@ -16,4 +16,19 @@ public interface ModuleConstant { * 机关级别-社区 * */ String AGENCY_LEVEL_COMMUNITY = "community"; + + /** + * 维度: 下级机关 + * */ + String DIM_SUB_AGENCY = "agency"; + + /** + * 维度: 直属网格 + * */ + String DIM_BELONGING_GRID = "grid"; + + /** + * 统计机器人 + * */ + String CREATED_BY_STATISTICAL_ROBOT = "statisticalRobot"; } 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 5869a269a6..fba7d93e3b 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 @@ -61,6 +61,11 @@ AND grid.DEL_FLAG = '0' WHERE agency.DEL_FLAG = '0' + AND + agency.AGENCY_DIM_TYPE = 'all' + + AND agency.CUSTOMER_ID = #{customerId} + ORDER BY agency.CUSTOMER_ID, agency.PID @@ -81,7 +86,10 @@ AND grid.DEL_FLAG = '0' WHERE agency.DEL_FLAG = '0' - AND agency.PID = #{pid} + AND + agency.PID = #{pid} + AND + agency.AGENCY_DIM_TYPE = 'all' ORDER BY agency.CUSTOMER_ID, agency.ID, @@ -105,10 +113,16 @@ agency.DEL_FLAG = '0' AND agency.PID = '0' + AND + agency.AGENCY_DIM_TYPE = 'all' + + AND agency.CUSTOMER_ID = #{customerId} + ORDER BY agency.CUSTOMER_ID, agency.PID + - - - - - - - diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml new file mode 100644 index 0000000000..796804c0c9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyDailyDao.xml @@ -0,0 +1,84 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_daily + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_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/topic/FactTopicIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml new file mode 100644 index 0000000000..1d85661ddd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueAgencyMonthlyDao.xml @@ -0,0 +1,78 @@ + + + + + + + INSERT INTO fact_topic_issue_agency_monthly + ( + ID, + + PID, + + AGENCY_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.pid}, + + #{item.agencyId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_agency_monthly + WHERE + MONTH_ID = #{monthId} + + 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/topic/FactTopicIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml new file mode 100644 index 0000000000..d509a646bf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridDailyDao.xml @@ -0,0 +1,87 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_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/topic/FactTopicIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml new file mode 100644 index 0000000000..e9232f4a24 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicIssueGridMonthlyDao.xml @@ -0,0 +1,77 @@ + + + + + + + INSERT INTO fact_topic_issue_grid_monthly + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + ISSUE_TOTAL, + + ISSUE_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.issueTotal}, + + #{item.issueIncr}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_issue_grid_monthly + WHERE + MONTH_ID = #{monthId} + + 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/topic/FactTopicStatusAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml new file mode 100644 index 0000000000..f8f4a16a84 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyDailyDao.xml @@ -0,0 +1,95 @@ + + + + + + + INSERT INTO fact_topic_status_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_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/topic/FactTopicStatusAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml new file mode 100644 index 0000000000..dc61db8665 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusAgencyMonthlyDao.xml @@ -0,0 +1,86 @@ + + + + + + + INSERT INTO fact_topic_status_agency_monthly + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCR, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_agency_monthly + WHERE + MONTH_ID = #{monthId} + + 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/topic/FactTopicStatusGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml new file mode 100644 index 0000000000..b60c3bffaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicStatusGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_status_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_STATUS_ID, + + TOPIC_COUNT, + + TOPIC_PROPORTION, + + TOPIC_INCREMENT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicStatusId}, + + #{item.topicCount}, + + #{item.topicProportion}, + + #{item.topicIncrement}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_status_grid_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/topic/FactTopicTotalAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml new file mode 100644 index 0000000000..d12e0d8c11 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalAgencyDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_agency_daily + ( + ID, + + AGENCY_ID, + + PID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.pid}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_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/topic/FactTopicTotalGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml new file mode 100644 index 0000000000..537a46cebb --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/topic/FactTopicTotalGridDailyDao.xml @@ -0,0 +1,93 @@ + + + + + + + INSERT INTO fact_topic_total_grid_daily + ( + ID, + + AGENCY_ID, + + GRID_ID, + + CUSTOMER_ID, + + DATE_ID, + + WEEK_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + TOPIC_TOTAL, + + TOPIC_INCR, + + HIDDEN_TOTAL_COUNT, + + ISSUE_TOTAL_COUNT, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.agencyId}, + + #{item.gridId}, + + #{item.customerId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.topicTotal}, + + #{item.topicIncr}, + + #{item.hiddenTotalCount}, + + #{item.issueTotalCount}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_topic_total_grid_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/user/FactParticipationUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml new file mode 100644 index 0000000000..b41b6f89dd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_participation_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_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/user/FactParticipationUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..7215527ed6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_participation_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + 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/user/FactParticipationUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml new file mode 100644 index 0000000000..575cea1844 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridDailyDao.xml @@ -0,0 +1,111 @@ + + + + + + + INSERT INTO fact_participation_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_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/user/FactParticipationUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml new file mode 100644 index 0000000000..cfe17cd854 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactParticipationUserGridMonthlyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_participation_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_participation_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + 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/user/FactRegUserAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml new file mode 100644 index 0000000000..185a97da77 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyDailyDao.xml @@ -0,0 +1,106 @@ + + + + + + + INSERT INTO fact_reg_user_agency_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_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/user/FactRegUserAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml new file mode 100644 index 0000000000..aa8548ff1c --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserAgencyMonthlyDao.xml @@ -0,0 +1,105 @@ + + + + + + + INSERT INTO fact_reg_user_agency_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_agency_monthly + WHERE + MONTH_ID = #{monthId} + + 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/user/FactRegUserGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml new file mode 100644 index 0000000000..f8d85b7ab9 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridDailyDao.xml @@ -0,0 +1,109 @@ + + + + + + + INSERT INTO fact_reg_user_grid_daily + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + DATE_ID, + + WEEK_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.dateId}, + + #{item.weekId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_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/user/FactRegUserGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml new file mode 100644 index 0000000000..f5f66265fe --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/user/FactRegUserGridMonthlyDao.xml @@ -0,0 +1,110 @@ + + + + + + + INSERT INTO fact_reg_user_grid_monthly + ( + ID, + + CUSTOMER_ID, + + AGENCY_ID, + + GRID_ID, + + MONTH_ID, + + QUARTER_ID, + + YEAR_ID, + + REG_TOTAL, + + RESI_TOTAL, + + WARM_HEARTED_TOTAL, + + PARTYMEMBER_TOTAL, + + REG_INCR, + + WARM_INCR, + + PARTYMEMBER_INCR, + + WARM_HEARTED_PROPORTION, + + RESI_PROPORTION, + + PARTYMEMBER_PROPORTION, + + CREATED_BY, + + CREATED_TIME, + + UPDATED_BY, + + UPDATED_TIME + + + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + + #{item.customerId}, + + #{item.agencyId}, + + #{item.gridId}, + + #{item.monthId}, + + #{item.quarterId}, + + #{item.yearId}, + + #{item.regTotal}, + + #{item.resiTotal}, + + #{item.warmHeartedTotal}, + + #{item.partymemberTotal}, + + #{item.regIncr}, + + #{item.warmIncr}, + + #{item.partymemberIncr}, + + #{item.warmHeartedProportion}, + + #{item.resiProportion}, + + #{item.partymemberProportion}, + + #{item.createdBy}, + + now(), + + #{item.createdBy}, + + now() + ) + + + + + DELETE FROM fact_reg_user_grid_monthly + WHERE + MONTH_ID = #{monthId} + + AND CUSTOMER_ID = #{customerId} + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml new file mode 100644 index 0000000000..10bf5cd05b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 91dc279ec1..1b6f925c97 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -30,7 +30,7 @@ - + AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -42,7 +42,16 @@ REGISTER_RELATION WHERE DEL_FLAG = '0' - AND REGISTER = '1' + + + + AND PARTICIPATION = '1' + + + + AND REGISTER = '1' + + GRID_ID = #{gridId} @@ -80,7 +89,7 @@ - + AND CREATED_TIME =]]> #{targetDate} AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -112,7 +121,7 @@ - + AND CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -138,7 +147,7 @@ urole.USER_ID = #{incrUserId} - + AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -158,7 +167,7 @@ urole.USER_ID = #{userId} - + AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -189,7 +198,7 @@ - + AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) @@ -211,7 +220,7 @@ urole.USER_ID = #{userId} - + AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY ) @@ -310,14 +319,7 @@ urole.GRID_ID = #{gridId} - - - AND urole.CREATED_TIME =]]> #{targetDate} AND urole.CREATED_TIME DATE_SUB( #{targetDate}, INTERVAL - 1 DAY) - - - AND urole.CREATED_TIME CURDATE( ) AND urole.CREATED_TIME =]]> DATE_SUB( CURDATE( ), INTERVAL 1 DAY ) - - + AND urole.CREATED_TIME =]]> #{startDate} AND urole.CREATED_TIME DATE_SUB( #{endDate}, INTERVAL - 1 DAY) AND erole.ROLE_NAME = '热心居民'