From 293dbe25c55922b852f01bb5798b7732494b665f Mon Sep 17 00:00:00 2001 From: zhaoqifeng Date: Wed, 24 Feb 2021 15:40:57 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BA=8B=E4=BB=B6=E5=88=86=E6=9E=90?= =?UTF-8?q?=E3=80=91=E7=B1=BB=E5=9E=8B=E5=88=86=E6=9E=90=20=E3=80=90?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6/=E9=A1=B9=E7=9B=AE=E5=88=86=E6=9E=90?= =?UTF-8?q?=E3=80=91=E6=8C=89=E7=B1=BB=E5=88=AB=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ScreenProjectCategoryGridDailyDTO.java | 142 +++++++++++++++++ .../dto/ScreenProjectCategoryOrgDailyDTO.java | 147 +++++++++++++++++ .../form/screen/CategoryAnalysisFormDTO.java | 21 +++ .../screen/CategoryAnalysisResultDTO.java | 26 +++ .../screen/ScreenProjectController.java | 24 ++- .../ScreenProjectCategoryOrgDailyDao.java | 42 +++++ .../screen/ScreenProjectService.java | 14 ++ .../screen/impl/ScreenProjectServiceImpl.java | 22 +++ .../ScreenProjectCategoryOrgDailyDao.xml | 16 ++ .../ScreenProjectCategoryGridDailyDTO.java | 144 +++++++++++++++++ .../ScreenProjectCategoryOrgDailyDTO.java | 149 ++++++++++++++++++ .../ScreenProjectDataCollController.java | 40 ++++- .../ScreenProjectCategoryGridDailyDao.java | 42 +++++ .../ScreenProjectCategoryOrgDailyDao.java | 42 +++++ .../ScreenProjectCategoryGridDailyEntity.java | 114 ++++++++++++++ .../ScreenProjectCategoryOrgDailyEntity.java | 119 ++++++++++++++ ...ScreenProjectCategoryGridDailyService.java | 106 +++++++++++++ .../ScreenProjectCategoryOrgDailyService.java | 106 +++++++++++++ ...enProjectCategoryGridDailyServiceImpl.java | 134 ++++++++++++++++ ...eenProjectCategoryOrgDailyServiceImpl.java | 135 ++++++++++++++++ .../ScreenProjectCategoryGridDailyDao.xml | 37 +++++ .../ScreenProjectCategoryOrgDailyDao.xml | 37 +++++ 22 files changed, 1653 insertions(+), 6 deletions(-) create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java create mode 100644 epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java create mode 100644 epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java create mode 100644 epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml create mode 100644 epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java new file mode 100644 index 0000000000..b9cd6657b6 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryGridDailyDTO.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 2021-02-23 + */ +@Data +public class ScreenProjectCategoryGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java new file mode 100644 index 0000000000..1507a1f88a --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/ScreenProjectCategoryOrgDailyDTO.java @@ -0,0 +1,147 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto; + +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 2021-02-23 + */ +@Data +public class ScreenProjectCategoryOrgDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java new file mode 100644 index 0000000000..b39dadb41b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/form/screen/CategoryAnalysisFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.dto.form.screen; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/2/23 15:26 + */ +@Data +public class CategoryAnalysisFormDTO implements Serializable { + private static final long serialVersionUID = -3088762710988337423L; + + public interface CategoryAnalysis{} + + @NotBlank(message = "组织ID不能为空",groups = {CategoryAnalysis.class}) + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java new file mode 100644 index 0000000000..da023e6c0b --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/dto/result/screen/CategoryAnalysisResultDTO.java @@ -0,0 +1,26 @@ +package com.epmet.dto.result.screen; + +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.io.Serializable; + +/** + * @author zhaoqifeng + * @dscription + * @date 2021/2/23 15:28 + */ +@NoArgsConstructor +@Data +public class CategoryAnalysisResultDTO implements Serializable { + + private static final long serialVersionUID = 4500337306142206855L; + /** + * 类别名称 + */ + private String categoryName; + /** + * 项目总数 + */ + private Integer projectTotal; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 483e3edcc1..8d00c29f2f 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -3,13 +3,14 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; + +import java.util.List; /** * 项目 @@ -36,4 +37,19 @@ public class ScreenProjectController { return new Result().ok(screenProjectService.projectDetail(projectDetailFormDTO)); } + /** + * 【事件分析】类型分析 + * @author zhaoqifeng + * @date 2021/2/23 15:37 + * @param customerId + * @param formDTO + * @return com.epmet.commons.tools.utils.Result> + */ + @PostMapping("category-analysis") + public Result> categoryAnalysis(@RequestHeader("CustomerId") String customerId, + @RequestBody CategoryAnalysisFormDTO formDTO) { + ValidatorUtils.validateEntity(formDTO, CategoryAnalysisFormDTO.CategoryAnalysis.class); + return new Result>().ok(screenProjectService.categoryAnalysis(customerId, formDTO)); + } + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java new file mode 100644 index 0000000000..3d00e19932 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectCategoryOrgDailyDao { + /** + * 类型分析 + * @author zhaoqifeng + * @date 2021/2/23 16:47 + * @param agencyId + * @return java.util.List + */ + List selectCategoryAnalysis(@Param("agencyId") String agencyId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java index aea908ff15..aa39e9345a 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -1,8 +1,12 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import java.util.List; + /** * 项目 * @@ -19,4 +23,14 @@ public interface ScreenProjectService { */ ProjectDetailResultDTO projectDetail(ProjectDetailFormDTO projectDetailFormDTO); + /** + * 【事件分析】类型分析 + * @author zhaoqifeng + * @date 2021/2/23 15:37 + * @param customerId + * @param formDTO + * @return java.util.List + */ + List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO); + } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index 2cf288cae9..63111dd7f0 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -1,15 +1,20 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; +import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.Date; import java.util.List; /** @@ -26,6 +31,8 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventDataDao screenEventDataDao; @Autowired private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; /** * @Description 3、项目详情 @@ -44,4 +51,19 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { projectDetailResultDTO.setImgList(imgList); return projectDetailResultDTO; } + + /** + * 【事件分析】类型分析 + * + * @param customerId + * @param formDTO + * @return java.util.List + * @author zhaoqifeng + * @date 2021/2/23 15:37 + */ + @Override + public List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO) { + String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); + return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId); + } } \ No newline at end of file diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml new file mode 100644 index 0000000000..06f7919bd1 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -0,0 +1,16 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java new file mode 100644 index 0000000000..50afc350ef --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryGridDailyDTO.java @@ -0,0 +1,144 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +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 2021-02-23 + */ +@Data +public class ScreenProjectCategoryGridDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + private String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java new file mode 100644 index 0000000000..49c85be67e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectCategoryOrgDailyDTO.java @@ -0,0 +1,149 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for 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.screen; + +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 2021-02-23 + */ +@Data +public class ScreenProjectCategoryOrgDailyDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + private String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + + /** + * 删除标识 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java index 2efc866c87..ce5b55a305 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/ScreenProjectDataCollController.java @@ -33,6 +33,10 @@ public class ScreenProjectDataCollController { private ScreenProjectQuantityGridMonthlyService projectQuantityGridMonthlyService; @Autowired private ScreenProjectQuantityOrgMonthlyService projectQuantityOrgMonthlyService; + @Autowired + private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; + @Autowired + private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; /** * @author wangc @@ -86,7 +90,39 @@ public class ScreenProjectDataCollController { return new Result(); } - //todo 【事件/项目分析】按类别统计-网格 - //todo 【事件/项目分析】按类别统计-组织 + /** + *【事件/项目分析】按类别统计-网格 + * + * @author zhaoqifeng + * @date 2021/2/24 10:11 + * @param customerId + * @param param + * @return com.epmet.commons.tools.utils.Result + */ + @RequestMapping("category-grid-daily") + public Result categoryGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectCategoryGridDailyService.collect(customerId, param); + return new Result(); + } + + /** + * 【事件/项目分析】按类别统计-组织 + * @author zhaoqifeng + * @date 2021/2/24 10:13 + * @param customerId + * @param param + * @return com.epmet.commons.tools.utils.Result + */ + @RequestMapping("category-org-daily") + public Result categoryOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { + if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { + throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); + } + projectCategoryOrgDailyService.collect(customerId, param); + return new Result(); + } //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java new file mode 100644 index 0000000000..5b96c10067 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectCategoryGridDailyDao extends BaseDao { + /** + * 按客户日期删除数据 + * @author zhaoqifeng + * @date 2021/2/24 10:27 + * @param customerId + * @param dateId + * @return int + */ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java new file mode 100644 index 0000000000..c87d8bec0f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.java @@ -0,0 +1,42 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectCategoryOrgDailyDao extends BaseDao { + /** + * 按客户日期删除数据 + * @author zhaoqifeng + * @date 2021/2/24 10:27 + * @param customerId + * @param dateId + * @return int + */ + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java new file mode 100644 index 0000000000..ef91f696c2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryGridDailyEntity.java @@ -0,0 +1,114 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_category_grid_daily") +public class ScreenProjectCategoryGridDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 网格id + */ + private String gridId; + + /** + * 网格所属的组织id + */ + private String pid; + + /** + * 网格所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + private String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java new file mode 100644 index 0000000000..1ac6c76145 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectCategoryOrgDailyEntity.java @@ -0,0 +1,119 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_category_org_daily") +public class ScreenProjectCategoryOrgDailyEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 日期yyyyMMdd + */ + private String dateId; + + /** + * 组织id + */ + private String orgId; + + /** + * 社区级:community,乡(镇、街道)级:street,区县级: district,市级: city省级:province + */ + private String orgType; + + /** + * 当前orgId所属的上级id + */ + private String pid; + + /** + * orgId所有的父级id,以英文:或者英文,隔开 + */ + private String pids; + + /** + * e世通中的项目类别编码 + */ + private String epmetCategoryCode; + + private String epmetCategoryName; + + /** + * 该分类下所有项目总数 + */ + private Integer projectTotal; + + /** + * 该分类下,正在处理中的项目总数 + */ + private Integer pendingTotal; + + /** + * 该分类下已结案的项目总数 + */ + private Integer closedTotal; + + /** + * 该分类下已结案无需解决的项目总数 + */ + private Integer unResolvedTotal; + + /** + * 该分类下已结案已解决的项目总数 + */ + private Integer resolvedTotal; + + /** + * 该分类下项目结案率 + */ + private BigDecimal closedRatio; + + /** + * 该分类下已结案项目解决率 + */ + private BigDecimal resolvedRatio; + + /** + * 该分类下已结案项目未解决率 + */ + private BigDecimal unResolvedRatio; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java new file mode 100644 index 0000000000..5306e7f73b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryGridDailyService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectCategoryGridDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectCategoryGridDailyDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectCategoryGridDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectCategoryGridDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectCategoryGridDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + /** + * 【事件/项目分析】按类别统计-网格 + * @author zhaoqifeng + * @date 2021/2/24 10:16 + * @param customerId + * @param param + * @return void + */ + void collect(String customerId, ScreenCollFormDTO param); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java new file mode 100644 index 0000000000..005232d59a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectCategoryOrgDailyService.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; + +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectCategoryOrgDailyService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectCategoryOrgDailyDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectCategoryOrgDailyDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectCategoryOrgDailyDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectCategoryOrgDailyDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + /** + * 【事件/项目分析】按类别统计-组织 + * @author zhaoqifeng + * @date 2021/2/24 10:17 + * @param customerId + * @param param + * @return void + */ + void collect(String customerId, ScreenCollFormDTO param); +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java new file mode 100644 index 0000000000..70ce72a036 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryGridDailyServiceImpl.java @@ -0,0 +1,134 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryGridDailyDao; +import com.epmet.dto.screen.ScreenProjectCategoryGridDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryGridDailyEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryGridDailyService; +import com.google.common.collect.Lists; +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 org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按网格_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl implements ScreenProjectCategoryGridDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectCategoryGridDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectCategoryGridDailyDTO.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 ScreenProjectCategoryGridDailyDTO get(String id) { + ScreenProjectCategoryGridDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectCategoryGridDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectCategoryGridDailyDTO dto) { + ScreenProjectCategoryGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryGridDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectCategoryGridDailyDTO dto) { + ScreenProjectCategoryGridDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryGridDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 【事件/项目分析】按类别统计-网格 + * + * @param customerId + * @param param + * @return void + * @author zhaoqifeng + * @date 2021/2/24 10:16 + */ + @Override + public void collect(String customerId, ScreenCollFormDTO param) { + if(param.getIsFirst()){ + int deleteNum; + do { + deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(param.getDataList())) { + param.getDataList().forEach(item -> { + item.setCustomerId(customerId); + item.setDateId(param.getDateId()); + }); + insertBatch(ConvertUtils.sourceToTarget(param.getDataList(), ScreenProjectCategoryGridDailyEntity.class)); + } + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java new file mode 100644 index 0000000000..290b30cf74 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectCategoryOrgDailyServiceImpl.java @@ -0,0 +1,135 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; +import com.epmet.dto.screen.ScreenProjectCategoryOrgDailyDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectCategoryOrgDailyEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectCategoryOrgDailyService; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 项目(事件)分类按组织_按天统计 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +@DataSource(DataSourceConstant.EVALUATION_INDEX) +public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl implements ScreenProjectCategoryOrgDailyService { + + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectCategoryOrgDailyDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectCategoryOrgDailyDTO.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 ScreenProjectCategoryOrgDailyDTO get(String id) { + ScreenProjectCategoryOrgDailyEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectCategoryOrgDailyDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectCategoryOrgDailyDTO dto) { + ScreenProjectCategoryOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryOrgDailyEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectCategoryOrgDailyDTO dto) { + ScreenProjectCategoryOrgDailyEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectCategoryOrgDailyEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + /** + * 【事件/项目分析】按类别统计-组织 + * + * @param customerId + * @param param + * @return void + * @author zhaoqifeng + * @date 2021/2/24 10:17 + */ + @Override + public void collect(String customerId, ScreenCollFormDTO param) { + if(param.getIsFirst()){ + int deleteNum; + do { + deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + } while (deleteNum > NumConstant.ZERO); + } + if (!CollectionUtils.isEmpty(param.getDataList())) { + param.getDataList().forEach(item -> { + item.setCustomerId(customerId); + item.setDateId(param.getDateId()); + }); + Lists.partition(param.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { + insertBatch(ConvertUtils.sourceToTarget(list, ScreenProjectCategoryOrgDailyEntity.class)); + }); + } + } + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml new file mode 100644 index 0000000000..bc84c6b2df --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryGridDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_category_grid_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml new file mode 100644 index 0000000000..5d8cd9a73a --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectCategoryOrgDailyDao.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_category_org_daily + where customer_id = #{customerId} + and date_id = #{dateId} + limit 1000 + + + \ No newline at end of file