diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java new file mode 100644 index 0000000000..338b35e1a1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/constant/IssueConstant.java @@ -0,0 +1,29 @@ +package com.epmet.constant; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 17:23 + */ +public interface IssueConstant { + /** + *表决中 + */ + String VOTING = "voting"; + /** + *已转项目 + */ + String SHIFT_PROJECT = "shift_project"; + /** + *已关闭 + */ + String CLOSED = "closed"; + /** + *已解决 + */ + String RESLOVED = "resloved"; + /** + *未解决 + */ + String UNRESLOVED = "unresloved"; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java new file mode 100644 index 0000000000..065f10279f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueAgencyDTO.java @@ -0,0 +1,35 @@ +package com.epmet.dto.issue; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/17 14:06 + */ +@Data +public class IssueAgencyDTO implements Serializable { + private static final long serialVersionUID = 8258586413692513595L; + /** + * 组织ID + */ + private String agencyId; + /** + * 上级ID + */ + private String pId; + /** + * 所有上级ID + */ + private String pIds; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java new file mode 100644 index 0000000000..add4fd14ff --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectAgencyDTO.java @@ -0,0 +1,31 @@ +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2020/6/18 16:48 + */ +@Data +public class ProjectAgencyDTO implements Serializable { + private static final long serialVersionUID = 4581232825130630169L; + /** + * 组织ID + */ + private String agencyId; + /** + * 所有上级ID + */ + private String pIds; + /** + * 状态 + */ + private String status; + /** + * 数量 + */ + private Integer count; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java new file mode 100644 index 0000000000..b32a9d9b87 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyDailyDTO.java @@ -0,0 +1,237 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueAgencyDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java new file mode 100644 index 0000000000..ea2b5cd11f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueAgencyMonthlyDTO.java @@ -0,0 +1,227 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueAgencyMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java new file mode 100644 index 0000000000..c63ab13574 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridDailyDTO.java @@ -0,0 +1,237 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java new file mode 100644 index 0000000000..d79586998b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/stats/FactIssueGridMonthlyDTO.java @@ -0,0 +1,227 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.stats; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +public class FactIssueGridMonthlyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 是否删除 + */ + private String delFlag; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java index 6b44fc5c5e..1b64aa85e8 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/issue/StatsIssueDao.java @@ -1,14 +1,55 @@ package com.epmet.dao.issue; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.issue.IssueAgencyDTO; import com.epmet.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @Mapper public interface StatsIssueDao extends BaseDao { - List listAllEntities(); + + /** + * 获取当前日期组织下议题统计结果 + * + * @param customerId + * @return java.util.List + * @author zhaoqifeng + * @date 2020/6/17 14:13 + */ + List selectAgencyIssueTotal(@Param("customerId") String customerId); + + /** + * 获取当前日期组织下议题增量 + * @author zhaoqifeng + * @date 2020/6/18 9:55 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyIssueInc(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已关闭议题统计 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedIssueTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已关闭议题增量 + * @author zhaoqifeng + * @date 2020/6/18 14:41 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedIssueInc(@Param("customerId") String customerId, @Param("date") String date); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java index 5ffba5ec49..472e3d50f3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -18,6 +18,7 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -39,4 +40,24 @@ public interface ProjectDao extends BaseDao { * @Description 根据客户Id查询客户项目业务表有效数据 **/ List selectProjectList(@Param("customerId") String customerId); + + /** + * 已结案项目统计 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedProjectTotal(@Param("customerId") String customerId, @Param("date") String date); + + /** + * 已结案项目增量 + * @author zhaoqifeng + * @date 2020/6/18 17:01 + * @param customerId + * @param date + * @return java.util.List + */ + List selectAgencyClosedProjectInc(@Param("customerId") String customerId, @Param("date") String date); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java new file mode 100644 index 0000000000..be302f14a7 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/stats/FactIssueAgencyDailyDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_agency_daily") +public class FactIssueAgencyDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java new file mode 100644 index 0000000000..a06e51b59d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueAgencyMonthlyEntity.java @@ -0,0 +1,197 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_agency_monthly") +public class FactIssueAgencyMonthlyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 上级组织ID + */ + private String pid; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 当月议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当月已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当月表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当月已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当月已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当月已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当月已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当月已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当月已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java new file mode 100644 index 0000000000..50d7d2ddaf --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridDailyEntity.java @@ -0,0 +1,207 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.stats; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("fact_issue_grid_daily") +public class FactIssueGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 组织ID + */ + private String agencyId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 年度ID + */ + private String yearId; + + /** + * 季度ID + */ + private String quarterId; + + /** + * 月度ID + */ + private String monthId; + + /** + * 周ID + */ + private String weekId; + + /** + * 日期ID + */ + private String dateId; + + /** + * 当日议题增量 + */ + private Integer issueIncr; + + /** + * 议题总数 + */ + private Integer issueTotal; + + /** + * 当日已转项目的议题数增量 + */ + private Integer shiftProjectIncr; + + /** + * 已转项目的议题总数 + */ + private Integer shiftProjectTotal; + + /** + * 已转项目所占百分比 + */ + private BigDecimal shiftProjectPercent; + + /** + * 当日表决中议题数增量 + */ + private Integer votingIncr; + + /** + * 表决中议题总数 + */ + private Integer votingTotal; + + /** + * 表决中议题所占百分比 + */ + private BigDecimal votingPercent; + + /** + * 当日已关闭议题数增量 + */ + private Integer closedIncr; + + /** + * 当日已关闭议题中已解决数量 + */ + private Integer closedResolvedIncr; + + /** + * 当日已关闭议题中无需解决数量 + */ + private Integer closedUnresolvedIncr; + + /** + * 已关闭议题总数 + */ + private Integer closedTotal; + + /** + * 已关闭议题中已解决总数 + */ + private Integer closedResolvedTotal; + + /** + * 已关闭议题中未解决总数 + */ + private Integer closedUnresolvedTotal; + + /** + * 已关闭议题所占百分比 + */ + private BigDecimal closedPercent; + + /** + * 已关闭议题中已解决百分比 + */ + private BigDecimal closedResolvedPercent; + + /** + * 已关闭议题中未解决百分比 + */ + private BigDecimal closedUnresolvedPercent; + + /** + * 当日已结案议题数 + */ + private Integer closedCaseIncr; + + /** + * 当日已结案议题中已解决数 + */ + private Integer closedCaseResolvedIncr; + + /** + * 当日已结案议题中未解决数 + */ + private Integer closedCaseUnresolvedIncr; + + /** + * 已结案议题总数 + */ + private Integer closedCaseTotal; + + /** + * 已结案议题中已解决总数 + */ + private Integer closedCaseResolvedTotal; + + /** + * 已结案议题中未解决总数 + */ + private Integer closedCaseUnresolvedTotal; + + /** + * 已结案议题中已解决百分比 + */ + private BigDecimal closedCaseResolvedPercent; + + /** + * 已结案议题中未解决百分比 + */ + private BigDecimal closedCaseUnresolvedPercent; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java new file mode 100644 index 0000000000..713d48f3f8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/stats/FactIssueGridMonthlyEntity.java @@ -0,0 +1,197 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactIssueAgencyDailyDao; +import com.epmet.dto.stats.FactIssueAgencyDailyDTO; +import com.epmet.entity.stats.FactIssueAgencyDailyEntity; +import com.epmet.service.stats.FactIssueAgencyDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class FactIssueAgencyDailyServiceImpl extends BaseServiceImpl implements FactIssueAgencyDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueAgencyDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactIssueAgencyDailyDTO get(String id) { + FactIssueAgencyDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueAgencyDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueAgencyDailyDTO dto) { + FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueAgencyDailyDTO dto) { + FactIssueAgencyDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java new file mode 100644 index 0000000000..a4d64c92c4 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueAgencyMonthlyServiceImpl.java @@ -0,0 +1,101 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactIssueAgencyMonthlyDao; +import com.epmet.dto.stats.FactIssueAgencyMonthlyDTO; +import com.epmet.entity.stats.FactIssueAgencyMonthlyEntity; +import com.epmet.service.stats.FactIssueAgencyMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 组织机关议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class FactIssueAgencyMonthlyServiceImpl extends BaseServiceImpl implements FactIssueAgencyMonthlyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueAgencyMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueAgencyMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactIssueAgencyMonthlyDTO get(String id) { + FactIssueAgencyMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueAgencyMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueAgencyMonthlyDTO dto) { + FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueAgencyMonthlyDTO dto) { + FactIssueAgencyMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueAgencyMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java new file mode 100644 index 0000000000..feebc25a82 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridDailyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactIssueGridDailyDao; +import com.epmet.dto.stats.FactIssueGridDailyDTO; +import com.epmet.entity.stats.FactIssueGridDailyEntity; +import com.epmet.service.stats.FactIssueGridDailyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格议题数量(按日) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class FactIssueGridDailyServiceImpl extends BaseServiceImpl implements FactIssueGridDailyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueGridDailyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactIssueGridDailyDTO get(String id) { + FactIssueGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueGridDailyDTO dto) { + FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueGridDailyDTO dto) { + FactIssueGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java new file mode 100644 index 0000000000..33b00ffd2e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/stats/impl/FactIssueGridMonthlyServiceImpl.java @@ -0,0 +1,100 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.stats.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.stats.FactIssueGridMonthlyDao; +import com.epmet.dto.stats.FactIssueGridMonthlyDTO; +import com.epmet.entity.stats.FactIssueGridMonthlyEntity; +import com.epmet.service.stats.FactIssueGridMonthlyService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 网格议题数量(按月) + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-06-17 + */ +@Service +public class FactIssueGridMonthlyServiceImpl extends BaseServiceImpl implements FactIssueGridMonthlyService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, FactIssueGridMonthlyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, FactIssueGridMonthlyDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public FactIssueGridMonthlyDTO get(String id) { + FactIssueGridMonthlyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, FactIssueGridMonthlyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(FactIssueGridMonthlyDTO dto) { + FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(FactIssueGridMonthlyDTO dto) { + FactIssueGridMonthlyEntity entity = ConvertUtils.sourceToTarget(dto, FactIssueGridMonthlyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml index 6a0a0c8e2f..2174226182 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/issue/StatsIssueDao.xml @@ -2,7 +2,70 @@ - + SELECT ORG_ID AS "agencyId", + ORG_ID_PATH AS "pIds", + ISSUE_STATUS AS "status", + COUNT(ID) AS "count" + FROM + issue + WHERE + DEL_FLAG = '0' + AND CUSTOMER_ID = #{customerId} + GROUP BY + ORG_ID, ISSUE_STATUS + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml index ed2e125d99..721f5a38ea 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectDao.xml @@ -16,5 +16,38 @@ ORDER BY created_time DESC + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml new file mode 100644 index 0000000000..59d538fe2f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyDailyDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml new file mode 100644 index 0000000000..24e3e22dad --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueAgencyMonthlyDao.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml new file mode 100644 index 0000000000..c2b1aaf819 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridDailyDao.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml new file mode 100644 index 0000000000..69538d9534 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/stats/FactIssueGridMonthlyDao.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file