diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java new file mode 100644 index 0000000000..1955847edd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/issue/IssueProjectCategoryDictDTO.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.issue; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 议题项目分类字典 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-08 + */ +@Data +public class IssueProjectCategoryDictDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id, 产品默认default + */ + private String customerId; + + /** + * 上级分类ID 顶级此列存储0 + */ + private String pid; + + /** + * 所有上级分类ID,用逗号分开 + */ + private String pids; + + /** + * 分类编码,分类编码+customer_id唯一 + */ + private String categoryCode; + + /** + * 分类名称 + */ + private String categoryName; + + /** + * 分类类别1,2,3,4.... + */ + private String categoryType; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java new file mode 100644 index 0000000000..3ca8dc43fc --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectCategoryDTO.java @@ -0,0 +1,97 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目所属分类表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-25 + */ +@Data +public class ProjectCategoryDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 主键 + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 来源网格id + */ + private String gridId; + + /** + * 项目id + */ + private String projectId; + + /** + * 分类id + */ + private String categoryId; + + /** + * 分类对应的所有上级,英文逗号隔开 + */ + private String categoryPids; + + /** + * 删除标识 0未删除、1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java new file mode 100644 index 0000000000..6de5285b6b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/ProjectStaffDTO.java @@ -0,0 +1,122 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.project; + +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + + +/** + * 项目人员关联表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-05-11 + */ +@Data +public class ProjectStaffDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目处理进展ID + */ + private String processId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 机关ID + */ + private String orgId; + + /** + * 部门ID + */ + private String departmentId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 人员ID + */ + private String staffId; + + /** + * 部门名 + */ + private String departmentName; + + /** + * 是否处理:未处理unhandled,已处理handle + */ + private String isHandle; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java new file mode 100644 index 0000000000..a8b2b0f0e5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/project/result/ProjectExceedParamsResultDTO.java @@ -0,0 +1,24 @@ +package com.epmet.dto.project.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Description 客户项目超期相关参数 + * @ClassName ProjectExceedParamsResultDTO + * @Auth wangc + * @Date 2021-03-05 17:02 + */ +@Data +public class ProjectExceedParamsResultDTO implements Serializable { + private static final long serialVersionUID = 7621539816482416776L; + + private Integer defaultExceedLimit; + + private Integer defaultAbout2ExceedLimit; + + private Integer exceedLimit; + + private Integer about2ExceedLimit; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java index b638f53197..423a94ebce 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -169,4 +169,6 @@ public class ScreenProjectDataDTO implements Serializable { */ private String allParentIds; + private String topicId; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java index b175d7a41d..42824beb62 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java @@ -88,4 +88,6 @@ public class ScreenProjectImgDataDTO implements Serializable { */ private Date updatedTime; + private String topicId; + } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java index efb46d4387..e2479d607a 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java @@ -19,7 +19,9 @@ package com.epmet.dto.screen; import java.io.Serializable; import java.util.Date; +import java.util.List; +import com.epmet.dto.project.ProjectStaffDTO; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import org.springframework.format.annotation.DateTimeFormat; @@ -141,6 +143,8 @@ public class ScreenProjectProcessDTO implements Serializable { /** * 数据截止日期 */ - private String DataEndTime; + private String dataEndTime; + + private List points; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java index fa3e97d11d..16ab5fee7d 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/ScreenCollFormDTO.java @@ -1,8 +1,12 @@ package com.epmet.dto.screencoll; import com.alibaba.fastjson.JSON; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.Valid; +import javax.validation.constraints.*; import java.io.Serializable; import java.util.List; @@ -14,21 +18,47 @@ import java.util.List; */ @Data public class ScreenCollFormDTO implements Serializable { - private static final long serialVersionUID = 4605543711669000348L; + + /** + * 添加用户操作的用户可见异常分组 + * 该分组用于校验需要返回给前端错误信息提示的列,需要继承CustomerClientShowGroup + * 返回错误码为8999,提示信息为DTO中具体的列的校验注解message的内容 + */ + public interface IsFirstShowGroup extends CustomerClientShowGroup { + } + + public interface DateIdShowGroup extends CustomerClientShowGroup { + } + + public interface MonthIdShowGroup extends CustomerClientShowGroup { + } + + public interface CustomerIdShowGroup extends CustomerClientShowGroup { + } + + public interface DataListShowGroup extends CustomerClientShowGroup { + + } + /** * 当为true时后台将先删除当前维度的数据,后新增 */ + @NotNull(message = "isFirst不能为空", groups = IsFirstShowGroup.class) private Boolean isFirst; /** * 日期Id, 数据更新至:yyyyMMdd */ + @NotBlank(message = "dateId不能为空;", groups = DateIdShowGroup.class) + @Length(min = 8, max = 8, message = "dateId不能为空,格式应为yyyyMMdd;", groups = {DateIdShowGroup.class}) private String dateId; /** * yyyyMM */ + @NotBlank(message = "monthId不能为空,格式yyyyMM;", groups = MonthIdShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {MonthIdShowGroup.class}) private String monthId; /** @@ -39,6 +69,8 @@ public class ScreenCollFormDTO implements Serializable { /** * 数据集合 */ + @Valid + @NotEmpty(message = "dataList不能为空", groups = DataListShowGroup.class) private List dataList; @Override @@ -49,5 +81,6 @@ public class ScreenCollFormDTO implements Serializable { /** * 当前客户id */ + @NotBlank(message = "customerId不能为空;", groups = CustomerIdShowGroup.class) private String customerId; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java index d81ae5cf9e..0d52614cfd 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnCommunityProjectProfileFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,23 +17,30 @@ import java.io.Serializable; public class AnCommunityProjectProfileFormDTO implements Serializable { private static final long serialVersionUID = 1466172677051250092L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 数据更新至: yyyy|yyyyMM|yyyyMMdd,项目根据实际情况赋值 */ + @NotBlank(message = "dataEndTime不能为空;", groups = DefaultShowGroup.class) private String dataEndTime; /** * 社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; /** * 等级 */ + @NotBlank(message = "level不能为空;", groups = DefaultShowGroup.class) private String level; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java index adcb9f63b2..ff3727625b 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsGovernMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; import java.math.BigDecimal; @@ -12,51 +15,63 @@ import java.math.BigDecimal; * @since v1.0.0 2020-10-09 */ @Data -public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { +public class AnGrassRootsGovernMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -6947401956711903753L; + public interface DefaultShowGroup extends CustomerClientShowGroup { + } + /** * 网格,街道或社区id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 网格,街道名称或者社区名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空,网格:grid;组织:agency;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 参与项目数 */ + @NotNull(message = "partiProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer partiProjectTotal; /** * 办结项目数 */ + @NotNull(message = "closedProjectTotal不能为空;", groups = DefaultShowGroup.class) private Integer closedProjectTotal; /** * 项目响应度 存储的是%前面的数 */ + @NotNull(message = "projectResponseRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectResponseRatio; /** * 项目满意率,存储的是%前面的数 */ + @NotNull(message = "projectSatisRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal projectSatisRatio; /** * 办结率 for 社区 */ + @NotNull(message = "closedProjectRatio不能为空;", groups = DefaultShowGroup.class) private BigDecimal closedProjectRatio; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java index 70242f1ad3..5ca82e599e 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsOrgMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,39 +16,49 @@ import java.io.Serializable; @Data public class AnGrassRootsOrgMonthlyFormDTO implements Serializable { private static final long serialVersionUID = -7389300512268641307L; + + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid; 组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 党群数 */ + @NotNull(message = "groupTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; /** * 项目数 */ + @NotNull(message = "projectTotal不能为空;", groups = DefaultShowGroup.class) private Integer projectTotal; } diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java index b889e54661..c558760bf4 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmRankFormDTO.java @@ -1,7 +1,11 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import org.hibernate.validator.constraints.Length; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -13,60 +17,73 @@ import java.io.Serializable; @Data public class AnGrassRootsPmRankFormDTO implements Serializable { private static final long serialVersionUID = 3642729389245262928L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} /** - * 月份Id + * 月份Id */ + @NotBlank(message = "monthId不能为空;", groups = DefaultShowGroup.class) + @Length(min = 6, max = 6, message = "monthId不能为空,格式应为yyyyMM;", groups = {DefaultShowGroup.class}) private String monthId; /** * 用户id */ + @NotBlank(message = "userId不能为空;", groups = DefaultShowGroup.class) private String userId; /** * 姓名 */ + @NotBlank(message = "userName不能为空;", groups = DefaultShowGroup.class) private String userName; /** * 所属支部id */ + @NotBlank(message = "branchId不能为空;", groups = DefaultShowGroup.class) private String branchId; /** * 所属支部名称 */ + @NotBlank(message = "branchName不能为空;", groups = DefaultShowGroup.class) private String branchName; /** * 所属社区id */ + @NotBlank(message = "communityId不能为空;", groups = DefaultShowGroup.class) private String communityId; /** * 所属社区名称 */ + @NotBlank(message = "communityName不能为空;", groups = DefaultShowGroup.class) private String communityName; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;",groups =DefaultShowGroup.class ) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;",groups =DefaultShowGroup.class ) private Integer topicTotal; /** * 参与人次 */ + @NotNull(message = "partiUserTotal不能为空;",groups =DefaultShowGroup.class ) private Integer partiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;",groups =DefaultShowGroup.class ) private Integer issueTotal; /** diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java index 4adb2ee168..1f1bcb4315 100644 --- a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screencoll/form/AnGrassRootsPmTotalMonthlyFormDTO.java @@ -1,7 +1,10 @@ package com.epmet.dto.screencoll.form; +import com.epmet.commons.tools.validator.group.CustomerClientShowGroup; import lombok.Data; +import javax.validation.constraints.NotBlank; +import javax.validation.constraints.NotNull; import java.io.Serializable; /** @@ -14,44 +17,54 @@ import java.io.Serializable; public class AnGrassRootsPmTotalMonthlyFormDTO implements Serializable { private static final long serialVersionUID = 8675347783888892404L; + public interface DefaultShowGroup extends CustomerClientShowGroup {} + /** * 网格id或者组织(街道或社区)id */ + @NotBlank(message = "orgId不能为空;", groups = DefaultShowGroup.class) private String orgId; /** * 组织名称OR网格名称 */ + @NotBlank(message = "orgName不能为空;", groups = DefaultShowGroup.class) private String orgName; /** * 网格:grid;组织:agency */ + @NotBlank(message = "orgType不能为空;", groups = DefaultShowGroup.class) private String orgType; /** * org_id的上一级id */ + @NotBlank(message = "pid不能为空;", groups = DefaultShowGroup.class) private String pid; /** * 群成员数 */ + @NotNull(message = "groupMemberTotal不能为空;", groups = DefaultShowGroup.class) private Integer groupMemberTotal; /** * 话题数 */ + @NotNull(message = "topicTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicTotal; /** * 话题参与人次 */ + @NotNull(message = "topicPartiUserTotal不能为空;", groups = DefaultShowGroup.class) private Integer topicPartiUserTotal; /** * 议题数 */ + @NotNull(message = "issueTotal不能为空;", groups = DefaultShowGroup.class) private Integer issueTotal; } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java index 0766df597b..5b862b66ec 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/AnScreenCollController.java @@ -1,11 +1,10 @@ package com.epmet.controller; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -23,79 +22,116 @@ public class AnScreenCollController { private AnScreenCollService screenCollService; /** - * @Description 安宁大屏数据采集 - 基层党员-各类总数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-各类总数 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329494 * @author wangc * @date 2020.10.09 17:20 */ @PostMapping("pmtotal") - public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.pmTotal(formDTO,customerId); + public Result pmTotal(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmTotalMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmTotal(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329483 * @author wangc * @date 2020.10.09 17:19 */ @PostMapping("pmrank") - public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if (StringUtils.isBlank(formDTO.getMonthId())){ - throw new ValidateException("月份Id不能为空"); - } - screenCollService.pmRank(formDTO,customerId); + public Result pmRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsPmRankFormDTO.DefaultShowGroup.class); + }); + screenCollService.pmRank(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329498 * @author wangc * @date 2020.10.09 17:22 */ @PostMapping("grassrootsorg") - public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsOrg(formDTO,customerId); + public Result grassrootsOrg(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsOrgMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsOrg(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 基层治理-各类数 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 基层治理-各类数 按月 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329499 * @author wangc * @date 2020.10.09 17:23 */ @PostMapping("grassrootsgovern") - public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.grassrootsGovern(formDTO,customerId); + public Result grassrootsGovern(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.MonthIdShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnGrassRootsGovernMonthlyFormDTO.DefaultShowGroup.class); + }); + screenCollService.grassrootsGovern(formDTO); return new Result(); } /** - * @Description 安宁大屏数据采集 - 中央区-项目概要 - * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @param formDTO * @return void + * @Description 安宁大屏数据采集 - 中央区-项目概要 + * @NEI https://nei.netease.com/interface/detail/?pid=57069&id=329502 * @author wangc * @date 2020.10.09 16:41 */ @PostMapping("projectfile") - public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ - if(StringUtils.isBlank(customerId)) throw new ValidateException("客户Id不能为空"); - screenCollService.communityProjectProfile(formDTO,customerId); + public Result projectFile(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, + ScreenCollFormDTO.IsFirstShowGroup.class, + ScreenCollFormDTO.CustomerIdShowGroup.class, + ScreenCollFormDTO.DataListShowGroup.class); + formDTO.getDataList().forEach(data -> { + ValidatorUtils.validateEntity(data, AnCommunityProjectProfileFormDTO.DefaultShowGroup.class); + }); + screenCollService.communityProjectProfile(formDTO); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java index 829a345264..4bb409b6eb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/DemoController.java @@ -806,15 +806,22 @@ public class DemoController { return new Result(); } - @Autowired + /*@Autowired private ScreenGrassrootsGovernDataAbsorptionService ndddYhjfService; @PostMapping("diff") public Result diff(@RequestBody ScreenCentralZoneDataFormDTO param){ ndddYhjfService.difficultyDataHub(param); return new Result(); - } + }*/ + @Autowired + private ScreenProjectSettleService screenProjectSettleService; + @PostMapping("project-test") + public Result project(@RequestBody ScreenCentralZoneDataFormDTO param){ + screenProjectSettleService.extractScreenData(param); + return new Result(); + } public static void main(String[] args) { List monthIds = DateUtils.getMonthBetween("202001","202012"); for(String monthId:monthIds){ diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java index b64d7855a0..34269ee507 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/KcScreenCollController.java @@ -1,6 +1,7 @@ package com.epmet.controller; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.KcScreenCollService; @@ -35,7 +36,9 @@ public class KcScreenCollController { @PostMapping("homepage/platformsummary") public Result platFormSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertPlatFormSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertPlatFormSummary(formDTO); return new Result(); } @@ -54,7 +57,9 @@ public class KcScreenCollController { @PostMapping("issue/summary") public Result issueSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertIssueSummary(formDTO); return new Result(); } @@ -73,7 +78,9 @@ public class KcScreenCollController { @PostMapping("issue/trend") public Result issueTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertIssueTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertIssueTrend(formDTO); return new Result(); } @@ -92,7 +99,9 @@ public class KcScreenCollController { @PostMapping("user/summary") public Result userSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertUserSummary(formDTO); return new Result(); } @@ -111,7 +120,9 @@ public class KcScreenCollController { @PostMapping("volunteer/heartrank") public Result volunteerHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerHeartRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertVolunteerHeartRank(formDTO); return new Result(); } @@ -130,7 +141,9 @@ public class KcScreenCollController { @PostMapping("user/userheartrank") public Result userHeartRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertUserHeartRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertUserHeartRank(formDTO); return new Result(); } @@ -149,7 +162,9 @@ public class KcScreenCollController { @PostMapping("act/summary") public Result actSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertActSummary(formDTO); return new Result(); } @@ -168,7 +183,9 @@ public class KcScreenCollController { @PostMapping("act/trend") public Result actTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertActTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertActTrend(formDTO); return new Result(); } @@ -187,7 +204,9 @@ public class KcScreenCollController { @PostMapping("act/volunteersummary") public Result volunteerSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertVolunteerSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertVolunteerSummary(formDTO); return new Result(); } @@ -206,7 +225,9 @@ public class KcScreenCollController { @PostMapping("project/summary") public Result projectSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertProjectSummary(formDTO); return new Result(); } @@ -225,7 +246,9 @@ public class KcScreenCollController { @PostMapping("project/categorysummary") public Result categorySummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertCategorySummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertCategorySummary(formDTO); return new Result(); } @@ -244,7 +267,9 @@ public class KcScreenCollController { @PostMapping("project/satisanalysis") public Result projectSatisanalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertProjectSatisanalysis(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertProjectSatisanalysis(formDTO); return new Result(); } @@ -263,7 +288,9 @@ public class KcScreenCollController { @PostMapping("news/summary") public Result newsSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsSummary(formDTO); return new Result(); } @@ -282,7 +309,9 @@ public class KcScreenCollController { @PostMapping("news/trend") public Result newsTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertNewsTrend(formDTO); return new Result(); } @@ -301,7 +330,9 @@ public class KcScreenCollController { @PostMapping("news/hotrank") public Result newsHotRank(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsHotRank(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsHotRank(formDTO); return new Result(); } @@ -320,7 +351,9 @@ public class KcScreenCollController { @PostMapping("news/categoryanalysis") public Result newsCategoryAnalysis(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertNewsCategoryAnalysis(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertNewsCategoryAnalysis(formDTO); return new Result(); } @@ -339,7 +372,9 @@ public class KcScreenCollController { @PostMapping("group/summary") public Result groupSummary(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupSummary(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertGroupSummary(formDTO); return new Result(); } @@ -358,7 +393,9 @@ public class KcScreenCollController { @PostMapping("group/detail") public Result groupDetail(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupDetail(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); + kcScreenCollService.insertGroupDetail(formDTO); return new Result(); } @@ -377,7 +414,9 @@ public class KcScreenCollController { @PostMapping("group/topictrend") public Result groupTopicTrend(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO) { - kcScreenCollService.insertGroupTopicTrend(formDTO, customerId); + formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class); + kcScreenCollService.insertGroupTopicTrend(formDTO); return new Result(); } } 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 43b6171c05..0af70355e9 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 @@ -1,16 +1,14 @@ package com.epmet.controller; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.screen.*; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.service.evaluationindex.screen.*; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; import org.springframework.web.bind.annotation.RequestMapping; @@ -50,10 +48,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("quantity-grid-monthly") public Result quantityGridMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { - throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); - } - projectQuantityGridMonthlyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectQuantityGridMonthlyService.collect(param); return new Result(); } @@ -63,10 +60,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("quantity-org-monthly") public Result quantityOrgMonthly(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getMonthId())) { - throw new ValidateException("参数错误:dataList不能为空且monthId不能为空"); - } - projectQuantityOrgMonthlyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectQuantityOrgMonthlyService.collect(param); return new Result(); } @@ -76,10 +72,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("project-grid-daily") public Result projectGridDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { - throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); - } - projectGridDailyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectGridDailyService.collect(param); return new Result(); } @@ -89,10 +84,9 @@ public class ScreenProjectDataCollController { **/ @RequestMapping("project-org-daily") public Result projectOrgDaily(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO param) { - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { - throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); - } - projectOrgDailyService.collect(customerId, param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectOrgDailyService.collect(param); return new Result(); } @@ -107,10 +101,9 @@ public class ScreenProjectDataCollController { */ @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); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectCategoryGridDailyService.collect(param); return new Result(); } @@ -124,10 +117,9 @@ public class ScreenProjectDataCollController { */ @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); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectCategoryOrgDailyService.collect(param); return new Result(); } //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 @@ -140,10 +132,9 @@ public class ScreenProjectDataCollController { */ @RequestMapping("uploadprojectinfo") public Result uploadProjectInfo(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenCollFormDTO param){ - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { - throw new ValidateException("参数错误:dataList不能为空且dateId不能为空"); - } - projectDataService.collect(customerId,param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectDataService.collect(param); return new Result(); } @@ -155,10 +146,9 @@ public class ScreenProjectDataCollController { */ @RequestMapping("uploadprojectprocess") public Result uploadProjectProcess(@RequestHeader("CustomerId") String customerId,@RequestBody ScreenCollFormDTO param){ - if (null == param || CollectionUtils.isEmpty(param.getDataList()) || StringUtils.isBlank(param.getDateId())) { - throw new ValidateException("参数错误:dataList不能为空且dataId不能为空"); - } - projectProcessService.collect(customerId,param); + param.setCustomerId(customerId); + ValidatorUtils.validateEntity(param, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + projectProcessService.collect(param); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java index ca112ac6a9..33e7c281aa 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/OfsController.java @@ -1,6 +1,7 @@ package com.epmet.controller.plugins; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.plugins.BidFormDTO; import com.epmet.dto.plugins.ContractFormDTO; import com.epmet.dto.plugins.OneListFormDTO; @@ -32,6 +33,7 @@ public class OfsController { @PostMapping("onelist-daily") public Result collOneList(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); ofsService.collOneList(formDTO); return new Result(); } @@ -46,6 +48,7 @@ public class OfsController { @PostMapping("contract-daily") public Result collContract(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); ofsService.collContract(formDTO); return new Result(); } @@ -60,6 +63,7 @@ public class OfsController { @PostMapping("bid-daily") public Result collBid(@RequestHeader("CustomerId") String customerId, @RequestBody ScreenCollFormDTO formDTO){ formDTO.setCustomerId(customerId); + ValidatorUtils.validateEntity(formDTO, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class); ofsService.collBid(formDTO); return new Result(); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java index 5331ca5cfa..8bbce3e324 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/controller/plugins/WorkRecordColController.java @@ -1,8 +1,7 @@ package com.epmet.controller.plugins; -import com.alibaba.fastjson.JSON; -import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.dto.plugins.ScreenCustomerWorkRecordDictDTO; import com.epmet.dto.plugins.ScreenWorkRecordCommonFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; @@ -10,9 +9,7 @@ import com.epmet.service.plugins.ScreenCustomerWorkRecordDictService; import com.epmet.service.plugins.ScreenWorkRecordOrgDailyService; import com.epmet.service.plugins.ScreenWorkRecordOrgMonthlyService; import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.util.CollectionUtils; import org.springframework.web.bind.annotation.*; /** @@ -44,13 +41,9 @@ public class WorkRecordColController { */ @PostMapping("resource-dict") public Result resourceDict(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ - if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || - StringUtils.isBlank(data.getDateId())) { - log.error("com.epmet.controller.plugins.WorkRecordColController.resourceDict,param:{}", JSON.toJSONString(data)); - throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); - } - // log.info("【工作日志】客户资源字典信息上传"+JSON.toJSONString(data,true)); - dictService.collect(customerId,data); + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + dictService.collect(data); return new Result(); } @@ -64,13 +57,9 @@ public class WorkRecordColController { */ @PostMapping("org-monthly") public Result collectOrg(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ - if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || - StringUtils.isBlank(data.getMonthId())) { - log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrg,param:{}", JSON.toJSONString(data)); - throw new ValidateException("客户Id、上传数据列表、月份Id不可为空"); - } - // log.info("【工作日志】组织按月统计"+JSON.toJSONString(data,true)); - screenWorkRecordOrgMonthlyService.collect(customerId,data); + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.MonthIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + screenWorkRecordOrgMonthlyService.collect(data); return new Result(); } @@ -84,13 +73,9 @@ public class WorkRecordColController { */ @PostMapping("org-daily") public Result collectOrgDaily(@RequestHeader("CustomerId")String customerId, @RequestBody ScreenCollFormDTO data){ - if(StringUtils.isBlank(customerId) || CollectionUtils.isEmpty(data.getDataList()) || - StringUtils.isBlank(data.getDateId())) { - log.error("com.epmet.controller.plugins.WorkRecordColController.collectOrgDaily,param:{}", JSON.toJSONString(data)); - throw new ValidateException("客户Id、上传数据列表、日期Id不可为空"); - } - // log.info("【工作日志】组织按日统计 累计值"+JSON.toJSONString(data,true)); - screenWorkRecordOrgDailyService.collectOrgDaily(customerId,data); + data.setCustomerId(customerId); + ValidatorUtils.validateEntity(data, ScreenCollFormDTO.CustomerIdShowGroup.class, ScreenCollFormDTO.DateIdShowGroup.class, ScreenCollFormDTO.DataListShowGroup.class); + screenWorkRecordOrgDailyService.collectOrgDaily(data); return new Result(); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java index 12b747d206..086c2e4b61 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectMainDailyDao.java @@ -24,6 +24,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.pingyin.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -273,4 +274,19 @@ public interface FactOriginProjectMainDailyDao extends BaseDao selectClosedIncr(@Param("customerId")String customerId, @Param("monthId")String monthId); + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + List initNewScreenProjectData(@Param("customerId")String customerId,@Param("dateId") String dateId,@Param("dataEndTime")String dataEndTime); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java index 70a1fee036..5f3bf2ae42 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.java @@ -19,6 +19,7 @@ package com.epmet.dao.evaluationindex.extract; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; +import com.epmet.dto.form.CostDayFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectOrgPeriodDailyEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -83,4 +84,13 @@ public interface FactOriginProjectOrgPeriodDailyDao extends BaseDao */ List selectDeptHandle(@Param("customerId") String customerId, @Param("monthId") String monthId); + + /** + * @Description + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.05 15:12 + */ + List selectProjectNodeStartStopTime(@Param("list")List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java index b1cea20772..1cdb4a1e8d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -18,7 +18,8 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; -import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -36,4 +37,13 @@ public interface ScreenProjectDataDao extends BaseDao { int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId); + int deleteByProjectTimeAndCustomerId(@Param("customerId") String customerId,@Param("dateId") String dateId); + + int checkIfExisted(@Param("customerId") String customerId); + + List selectPending(ScreenProjectDataDTO param); + + void insertBatch(@Param("list") List list); + + void updateBatch(@Param("list") List list,@Param("dateId") String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java index 2c4039af04..4904f32724 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 中央区-项目数据图片 @@ -30,4 +34,7 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ScreenProjectImgDataDao extends BaseDao { + void deleteByProjectIds(@Param("list") List list); + + void insertBatch(@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java index d4650815f5..4a84a02c90 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java @@ -18,8 +18,12 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 中央区-项目数据处理节点附件表 @@ -30,4 +34,8 @@ import org.apache.ibatis.annotations.Mapper; @Mapper public interface ScreenProjectProcessAttachmentDao extends BaseDao { + void deleteByProcessId(@Param("list") List list); + + void insertBatch(@Param("list")List list); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java index 4ad6a11e69..f9638e9c4f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java @@ -18,10 +18,13 @@ package com.epmet.dao.evaluationindex.screen; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; +import java.util.List; + /** * 中央区-项目数据项目处理进展表 * @@ -32,4 +35,10 @@ import org.apache.ibatis.annotations.Param; public interface ScreenProjectProcessDao extends BaseDao { int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + int deleteByProcessTimeAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); + + int countByCustomerId(@Param("customerId") String customerId); + + void insertBatch(@Param("list") List list); } 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 190353059f..875efb82e1 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 @@ -5,15 +5,13 @@ import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.issue.IssueAgencyDTO; -import com.epmet.dto.issue.IssueDTO; -import com.epmet.dto.issue.IssueGridDTO; -import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Set; @Mapper public interface StatsIssueDao extends BaseDao { @@ -181,4 +179,6 @@ public interface StatsIssueDao extends BaseDao { * @date 2020/9/27 1:22 下午 */ List selectIssueVoteStatis(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List selectCategory(@Param("customerId") String customerId, @Param("ids") Set set); } 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 3d4526a0fe..9d64b829da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectDao.java @@ -20,7 +20,10 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; import com.epmet.entity.project.ProjectEntity; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -103,5 +106,31 @@ public interface ProjectDao extends BaseDao { */ String selectParameterValueByKey(@Param("customerId") String customerId); + /** + * @Description 查找客户项目超期参数 + * + * @param customerId + * @return java.util.List + * @author wangc + * @date 2021.03.05 17:52 + */ + List selectProjectExceedParams(@Param("customerId") String customerId); + /** + * @Description 批量查询项目信息 + * @param ids + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:32 + */ + List batchSelectProjectInfo(@Param("ids")List ids); + + /** + * @Description 查询项目的分类信息 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 23:44 + */ + List selectProjectCategory(@Param("list")List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java index 37e130e678..f9647a4fe0 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/project/ProjectProcessDao.java @@ -18,12 +18,14 @@ package com.epmet.dao.project; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; -import com.epmet.dto.project.ProjectOrgRelationDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import org.apache.ibatis.annotations.Mapper; @@ -153,4 +155,28 @@ public interface ProjectProcessDao extends BaseDao { * @date 2020.09.28 14:45 */ List selectLatestOperation(@Param("list") List list,@Param("customerId") String customerId); + + /** + * @Description 查找指定日期结案的项目 + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.09 10:49 + */ + List selectClosedProjectOnAppointedDay(@Param("customerId") String customerId, @Param("dateId") String dateId); + + List selectClosedProjectByProjectIds(@Param("list")List list); + /** + * @Description 统计新增项目节点以及被流转到的指向部门 + * @param customerId + * @param dateId + * @param dataEndTime + * @return java.util.List + * @author wangc + * @date 2021.03.09 16:25 + */ + List selectProjectProcessAndDirection(@Param("customerId") String customerId, @Param("dateId") String dateId, @Param("dataEndTime")String dataEndTime ); + + List selectProcessAttachment(@Param("list")List list); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java index 1d9a6125bc..16a76f30ee 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/topic/TopicDao.java @@ -8,6 +8,8 @@ package com.epmet.dao.topic; */ import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.topic.ResiTopicDTO; import com.epmet.dto.extract.result.TopicInfoResultDTO; @@ -117,4 +119,23 @@ public interface TopicDao { * @date 2020.09.28 16:28 */ List selectTopicContent(@Param("list") List list); + + /** + * @Description 根据话题Id查询大屏项目的相关信息 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:13 + */ + List selectScreenProjectData(@Param("list") List list); + + /** + * @Description 初始化指定项目的图片 + * @param customerId + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.09 14:19 + */ + List initNewScreenProjectImgData(@Param("customerId")String customerId,@Param("list") List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java index b9162c30a2..411452caeb 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/user/UserDao.java @@ -2,6 +2,7 @@ package com.epmet.dao.user; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import org.apache.ibatis.annotations.Mapper; @@ -131,4 +132,14 @@ public interface UserDao { * @date 2020.09.25 13:54 **/ List selectRegisteredUserByCustomerId(@Param("customerId") String customerId); + + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List selectScreenProjectData(@Param("list") List list); } + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java index 239ad2d8b1..22201f81ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/IssueService.java @@ -11,6 +11,8 @@ import com.epmet.dto.issue.IssueProjectDTO; import com.epmet.entity.issue.IssueEntity; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author zhaoqifeng @@ -172,4 +174,13 @@ public interface IssueService { * @date 2020/9/27 11:20 上午 */ List selectIssueVoteStatis(String customerId, String monthId); + + /** + * @Description 查找项目的分类名称 以-相连 + * @param param + * @return java.util.Map + * @author wangc + * @date 2021.03.09 00:23 + */ + Map getIntegratedProjectCategory(Map> param,String customerId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java index e134358618..4ad4e58488 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/Issue/impl/IssueServiceImpl.java @@ -1,22 +1,24 @@ package com.epmet.service.Issue.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.constant.NumConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.issue.StatsIssueDao; import com.epmet.dto.extract.result.IssueInfoResultDTO; import com.epmet.dto.extract.result.IssueProcessInfoResultDTO; import com.epmet.dto.extract.result.IssueVoteStatisticalResultDTO; import com.epmet.dto.extract.result.SatisfactionInfoResultDTO; -import com.epmet.dto.issue.IssueAgencyDTO; -import com.epmet.dto.issue.IssueDTO; -import com.epmet.dto.issue.IssueGridDTO; -import com.epmet.dto.issue.IssueProjectDTO; +import com.epmet.dto.issue.*; import com.epmet.entity.issue.IssueEntity; import com.epmet.service.Issue.IssueService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; /** * @author zhaoqifeng @@ -143,4 +145,19 @@ public class IssueServiceImpl implements IssueService { public List selectIssueVoteStatis(String customerId, String dateId) { return statsIssueDao.selectIssueVoteStatis(customerId, dateId); } + + @Override + public Map getIntegratedProjectCategory(Map> param,String customerId) { + Map map = new HashMap<>(); + param.forEach((projectId,categoryIds) -> { + List categories = statsIssueDao.selectCategory(customerId, categoryIds); + if(!CollectionUtils.isEmpty(categories)){ + StringBuilder str = new StringBuilder(); + categories.forEach(category -> {str.append(category.getCategoryName()).append("-");}); + map.put(projectId,str.substring(NumConstant.ZERO,str.length() - NumConstant.TWO)); + } + }); + + return map; + } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java index 2a3c3ab304..c337c085da 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectLogDailyService.java @@ -21,6 +21,7 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.commons.tools.page.PageData; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import java.math.BigDecimal; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java index 3cb5f6e0e7..ea44540cd9 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/FactOriginProjectMainDailyService.java @@ -25,6 +25,7 @@ import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.pingyin.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; @@ -319,4 +320,24 @@ public interface FactOriginProjectMainDailyService extends BaseService selectClosedIncr(String customerId, String monthId); + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param rows + * @param dateId + * @param exceedLimit 超期上线 + * @param about2exceedLimit 即将超期参数 + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + List initNewScreenProjectData(String customerId,Integer rows ,String dateId,Integer exceedLimit,Integer about2exceedLimit); + + void computerIfExceed(List list,Integer exceedLimit,Integer about2exceedLimit); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java index 7b3f127cd2..641b7efa03 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectLogDailyServiceImpl.java @@ -30,6 +30,7 @@ import com.epmet.dao.evaluationindex.extract.FactOriginProjectLogDailyDao; import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectLogDailyDTO; import com.epmet.dto.extract.result.*; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectLogDailyEntity; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectLogDailyService; import org.apache.commons.lang3.StringUtils; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java index c5aaa76daa..1a51ba5690 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/todata/impl/FactOriginProjectMainDailyServiceImpl.java @@ -25,27 +25,32 @@ 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.commons.tools.utils.DateUtils; +import com.epmet.commons.tools.utils.Result; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.extract.FactOriginProjectMainDailyDao; +import com.epmet.dao.evaluationindex.extract.FactOriginProjectOrgPeriodDailyDao; import com.epmet.dto.extract.FactOriginProjectMainDailyDTO; import com.epmet.dto.extract.result.GridProjectClosedTotalResultDTO; import com.epmet.dto.extract.result.OrgStatisticsResultDTO; import com.epmet.dto.extract.result.TransferRightRatioResultDTO; import com.epmet.dto.indexcollect.result.CpcIndexCommonDTO; import com.epmet.dto.pingyin.result.*; +import com.epmet.dto.result.CostDayResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.entity.evaluationindex.extract.FactOriginProjectMainDailyEntity; import com.epmet.entity.evaluationindex.screen.ScreenDifficultyDataEntity; +import com.epmet.feign.EpmetCommonServiceOpenFeignClient; import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; 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.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * 项目主表_日统计 @@ -57,6 +62,10 @@ import java.util.Map; @DataSource(DataSourceConstant.STATS) public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl implements FactOriginProjectMainDailyService { + @Autowired + private EpmetCommonServiceOpenFeignClient epmetCommonServiceOpenFeignClient; + @Autowired + private FactOriginProjectOrgPeriodDailyDao periodDao; @Override public PageData page(Map params) { IPage page = baseDao.selectPage( @@ -358,4 +367,59 @@ public class FactOriginProjectMainDailyServiceImpl extends BaseServiceImpl(); } + + /** + * @Description 初始化screen_project_data数据 + * 如果是dateId不为空,则查询前一天的数据 + * 否则全查(适用于首次初始化的场景) + * + * 这是只查询指定天新增的项目,对于需要更新状态的项目,对历史数据(流转中的项目)进行遍历查询 + * @param customerId + * @param rows + * @param dateId + * @param exceedLimit 超期上线 + * @param about2exceedLimit 即将超期参数 + * @return java.util.List + * @author wangc + * @date 2021.03.04 22:56 + */ + @Override + public List initNewScreenProjectData(String customerId,Integer rows , String dateId,Integer exceedLimit,Integer about2exceedLimit) { + boolean ifBeforeYesterday = true; + if(Integer.parseInt(DateUtils.getBeforeNDay(NumConstant.ONE)) > Integer.parseInt(dateId)){ + ifBeforeYesterday = false; + } + List projects = baseDao.initNewScreenProjectData(customerId, rows <= NumConstant.ZERO ? "" : dateId, dateId); + //如果不是昨天立项 + if(!CollectionUtils.isEmpty(projects) && !ifBeforeYesterday) + computerIfExceed(projects,exceedLimit,about2exceedLimit); + + return projects; + } + + @Override + public void computerIfExceed(List list,Integer exceedLimit,Integer about2exceedLimit){ + if(CollectionUtils.isEmpty(list)) return; + Result> costDays = epmetCommonServiceOpenFeignClient.costWorkDays(periodDao.selectProjectNodeStartStopTime(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList()))); + if(null != costDays && !CollectionUtils.isEmpty(costDays.getData())){ + //key : projectId + Map> projectPeriodMap + = costDays.getData().stream().collect(Collectors.groupingBy(CostDayResultDTO :: getId)); + list = list.stream().map(o -> { + List days = projectPeriodMap.get(o.getProjectId()); + if(!CollectionUtils.isEmpty(days)){ + Integer max = days.stream().max(Comparator.comparing(CostDayResultDTO::getDetentionDays)).get().getDetentionDays(); + //事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + if(max > exceedLimit) + o.setProjectLevel(NumConstant.ONE); + else if(max >= about2exceedLimit) + o.setProjectLevel(NumConstant.TWO); + } + return o; + }).collect(Collectors.toList()); + } + } + + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java new file mode 100644 index 0000000000..fe147887b0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/ScreenProjectSettleService.java @@ -0,0 +1,27 @@ +package com.epmet.service.evaluationindex.extract.toscreen; + +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; + +/** + * @Description + * 给【screen_project_data】 + * 【screen_project_process_attachment】 + * 【screen_project_img_data】 + * 【screen_project_process】这四个表定时整理数据 + * @author wangc + * @date 2021.03.04 13:38 +*/ + +public interface ScreenProjectSettleService { + + + /** + * @Description 抽取项目数据到screen_project_* + * @param param + * @return void + * @author wangc + * @date 2021.03.04 23:09 + */ + void extractScreenData(ScreenCentralZoneDataFormDTO param); + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java index 8eda9e93c6..74e3021a00 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenExtractServiceImpl.java @@ -66,6 +66,8 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { private ScreenProjectGridDailyService screenProjectGridDailyService; @Autowired private ScreenProjectOrgDailyService screenProjectOrgDailyService; + @Autowired + private ScreenProjectSettleService screenProjectSettleService; /** * @param extractOriginFormDTO @@ -195,6 +197,13 @@ public class ScreenExtractServiceImpl implements ScreenExtractService { }catch (Exception e){ log.error("项目(事件)分析按组织_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); } + //项目分类打标签未上线,暂时屏蔽 + /*try{ + //大屏项目数据抽取_按天抽取 + screenProjectSettleService.extractScreenData(param); + }catch (Exception e){ + log.error("大屏项目数据抽取_按天抽取_按天统计失败,customerId为:"+customerId+"dateId为:"+dateId, e); + }*/ log.info("===== extractDaily method end ======"); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java new file mode 100644 index 0000000000..590f8c3df6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/ScreenProjectSettleServiceImpl.java @@ -0,0 +1,164 @@ +package com.epmet.service.evaluationindex.extract.toscreen.impl; + +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import com.epmet.dto.screen.form.ScreenCentralZoneDataFormDTO; +import com.epmet.entity.project.ProjectEntity; +import com.epmet.service.Issue.IssueService; +import com.epmet.service.evaluationindex.extract.todata.FactOriginProjectMainDailyService; +import com.epmet.service.evaluationindex.extract.toscreen.ScreenProjectSettleService; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService; +import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; +import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; +import com.epmet.service.project.ProjectProcessService; +import com.epmet.service.project.ProjectService; +import com.epmet.service.topic.TopicService; +import com.epmet.service.user.UserService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; + +import java.util.*; +import java.util.stream.Collectors; + +/** + * @Description + * @ClassName ScreenProjectSettleServiceImpl + * @Auth wangc + * @Date 2021-03-04 23:10 + */ +@Service +@Slf4j +public class ScreenProjectSettleServiceImpl implements ScreenProjectSettleService { + + + @Autowired + private ScreenProjectDataService targetDbService; + @Autowired + private FactOriginProjectMainDailyService originMainService; + @Autowired + private ProjectService projectService; + @Autowired + private ProjectProcessService processService; + @Autowired + private TopicService topicService; + @Autowired + private UserService userService; + @Autowired + private IssueService issueService; + @Autowired + private ScreenProjectProcessService targetProcessService; + @Autowired + private ScreenProjectImgDataService targetImgService; + @Autowired + private ScreenProjectProcessAttachmentService targetAttachmentService; + + /** + * @Description 抽取项目数据到screen_project_* + * @param param + * @return void + * @author wangc + * @date 2021.03.04 23:09 + */ + @Override + public void extractScreenData(ScreenCentralZoneDataFormDTO param) { + int rows = targetDbService.checkIfExisted(param.getCustomerId()); + List exceedParams = projectService.getProjectExceedParams(param.getCustomerId()); + Integer exceedLimit = NumConstant.FIVE; + Integer about2ExceedLimit = NumConstant.FIVE; + + + if(!CollectionUtils.isEmpty(exceedParams)){ + for(ProjectExceedParamsResultDTO ex :exceedParams){ + if(null != ex.getDefaultExceedLimit()){ + exceedLimit = null == ex.getExceedLimit() ? ex.getDefaultExceedLimit() : ex.getExceedLimit(); + } + if(null != ex.getDefaultAbout2ExceedLimit()){ + about2ExceedLimit = null == ex.getAbout2ExceedLimit() ? ex.getDefaultAbout2ExceedLimit() : ex.getDefaultAbout2ExceedLimit(); + } + } + } + //因为即将超期提醒时间(天)就是即将超期期限,在表中存储的是超期前多少天 + //所以这里要换算成滞留日 + about2ExceedLimit = exceedLimit >= about2ExceedLimit ? exceedLimit - about2ExceedLimit : exceedLimit; + List metaData = + originMainService.initNewScreenProjectData(param.getCustomerId(), rows , param.getDateId(),exceedLimit,about2ExceedLimit); + + if(!CollectionUtils.isEmpty(metaData)) { + List info = projectService.getProjectInfo(metaData.stream().map(ScreenProjectDataDTO::getProjectId).collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(info)){ + metaData = metaData.stream().flatMap(meta -> info.stream().filter(nature -> StringUtils.equals(meta.getProjectId(), + nature.getId())).map(projectInfo -> { + meta.setProjectCreateTime(projectInfo.getCreatedTime()); + meta.setProjectTitle(projectInfo.getTitle()); + return meta; + })).collect(Collectors.toList()); + } + topicService.fillScreenProjectData(metaData); + //metaData = Optional.ofNullable(topicService.getScreenProjectData(metaData)).orElse(metaData); + userService.fillScreenProjectData(metaData); + //metaData = Optional.ofNullable(userService.getScreenProjectData(metaData)).orElse(metaData); + } + + ScreenProjectDataDTO orientCase = new ScreenProjectDataDTO(); + orientCase.setCustomerId(param.getCustomerId()); + //待更新的数据 需要检测更新的字段为:①projectStatusCode ②closeCaseTime ③allCategoryName ④projectLevel + List orientData = + targetDbService.getPending(orientCase,param.getDateId()); + + // 给metaData和orientData赋上分类信息 + List projectIds = + Optional.ofNullable(metaData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())).orElse(new ArrayList<>()); + if(!CollectionUtils.isEmpty(orientData)) + projectIds.addAll(orientData.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); + Map> categoryMap = projectService.getProjectCategory(projectIds); + if(!CollectionUtils.isEmpty(categoryMap)){ + Map integratedProjectCategoryMap = issueService.getIntegratedProjectCategory(categoryMap, param.getCustomerId()); + if(!CollectionUtils.isEmpty(integratedProjectCategoryMap)){ + metaData.forEach(meta -> { + meta.setAllCategoryName(integratedProjectCategoryMap.get(meta.getProjectId())); + }); + orientData.forEach(orient -> { + orient.setAllCategoryName(integratedProjectCategoryMap.get(orient.getProjectId())); + }); + } + } + + //重新计算orientData的级别 有现成的方法 fact_origin_project_org_period_daily + originMainService.computerIfExceed(orientData, exceedLimit,about2ExceedLimit); + processService.updateProjectCloseTime(metaData); + //更新结案时间和结案状态 + processService.updateProjectStatus(orientData,param.getDateId(),param.getCustomerId()); + + targetDbService.insertOrUpdateBatch(param.getCustomerId(),param.getDateId(),metaData,orientData); + + if(!CollectionUtils.isEmpty(metaData)){ + List imgs = topicService.buildNewScreenProjectImgData(metaData); + if(!CollectionUtils.isEmpty(imgs)){ + + targetImgService.insertBatch(imgs); + } + } + + // + List processes = processService.buildNewScreenProjectProcessData(param.getCustomerId(), param.getDateId(),!targetProcessService.checkIfHistoricalDataExists(param.getCustomerId())); + if(!CollectionUtils.isEmpty(processes)){ + targetProcessService.insertBatch(processes,param.getCustomerId(),param.getDateId()); + List attachments = processService.buildProcessAttachmentData(processes.stream().map(ScreenProjectProcessDTO::getProcessId).distinct().collect(Collectors.toList())); + if(!CollectionUtils.isEmpty(attachments)){ + + targetAttachmentService.insertBatch(attachments); + } + } + + + } + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java index 15a9d72a35..a347d5286d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/AnScreenCollService.java @@ -17,7 +17,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 16:41 */ - void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId); + void communityProjectProfile(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-党员排行榜单 @@ -27,7 +27,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:19 */ - void pmRank(ScreenCollFormDTO formDTO,String customerId); + void pmRank(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层党员-各类总数 @@ -37,7 +37,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:20 */ - void pmTotal(ScreenCollFormDTO formDTO,String customerId); + void pmTotal(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层组织(党群数|议题数|项目数)-按月 @@ -46,7 +46,7 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:22 */ - void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId); + void grassrootsOrg(ScreenCollFormDTO formDTO); /** * @Description 安宁大屏数据采集 - 基层治理-各类数 @@ -55,5 +55,5 @@ public interface AnScreenCollService { * @author wangc * @date 2020.10.09 17:23 */ - void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId); + void grassrootsGovern(ScreenCollFormDTO formDTO); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java index 492a951156..5eaca5388c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/KcScreenCollService.java @@ -17,12 +17,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId); + void insertPlatFormSummary(ScreenCollFormDTO formDTO); /** * 2、议题分析-各类总数 @@ -30,12 +29,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId); + void insertIssueSummary(ScreenCollFormDTO formDTO); /** * 3、议题分析-参与趋势 @@ -43,12 +41,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId); + void insertIssueTrend(ScreenCollFormDTO formDTO); /** * 4、用户分析-各类总数 @@ -56,12 +53,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertUserSummary(ScreenCollFormDTO formDTO, String customerId); + void insertUserSummary(ScreenCollFormDTO formDTO); /** * 5、公益互助-志愿者公益时长排名 @@ -69,12 +65,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId); + void insertVolunteerHeartRank(ScreenCollFormDTO formDTO); /** * 6、用户分析-用户趋势 @@ -82,12 +77,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId); + void insertUserHeartRank(ScreenCollFormDTO formDTO); /** * 7、公益互助-活动各类总数 @@ -95,12 +89,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertActSummary(ScreenCollFormDTO formDTO, String customerId); + void insertActSummary(ScreenCollFormDTO formDTO); /** * 8、公益互助-活动次数趋势 @@ -108,12 +101,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertActTrend(ScreenCollFormDTO formDTO, String customerId); + void insertActTrend(ScreenCollFormDTO formDTO); /** * 9、公益互助-志愿者画像 @@ -121,12 +113,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId); + void insertVolunteerSummary(ScreenCollFormDTO formDTO); /** * 10、项目分析-各类总数 @@ -134,12 +125,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId); + void insertProjectSummary(ScreenCollFormDTO formDTO); /** * 11、项目分析-按分类统计 @@ -147,12 +137,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId); + void insertCategorySummary(ScreenCollFormDTO formDTO); /** * 12、项目分析-满意度分析 @@ -160,12 +149,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId); + void insertProjectSatisanalysis(ScreenCollFormDTO formDTO); /** * 13、党建声音-新闻各类总数汇总 @@ -173,12 +161,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId); + void insertNewsSummary(ScreenCollFormDTO formDTO); /** * 14、党建声音-新闻阅读参与趋势 @@ -186,12 +173,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId); + void insertNewsTrend(ScreenCollFormDTO formDTO); /** * 15、党建声音-热度新闻排行 @@ -199,12 +185,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId); + void insertNewsHotRank(ScreenCollFormDTO formDTO); /** * 16、党建声音-新闻按类别统计 @@ -212,12 +197,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId); + void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO); /** * 17、邻里党群-各类总数汇总 @@ -225,12 +209,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId); + void insertGroupSummary(ScreenCollFormDTO formDTO); /** * 18、邻里党群-小组详情 @@ -238,12 +221,11 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId); + void insertGroupDetail(ScreenCollFormDTO formDTO); /** * 19、邻里党群-话题参与趋势 @@ -251,10 +233,9 @@ public interface KcScreenCollService { * 所以如果项目上是分批上传,第一次为isFirst=true,后面isFirst应为false * * @param formDTO - * @param customerId * @return void * @Author zhangyong * @Date 15:57 2020-09-09 **/ - void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId); + void insertGroupTopicTrend(ScreenCollFormDTO formDTO); } 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 index 5306e7f73b..da711d85e3 100644 --- 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 @@ -98,9 +98,8 @@ public interface ScreenProjectCategoryGridDailyService extends BaseService param); + void collect(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 index 005232d59a..ce71722794 100644 --- 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 @@ -98,9 +98,8 @@ public interface ScreenProjectCategoryOrgDailyService extends BaseService param); + void collect(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/ScreenProjectDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java index 82d296a1a3..b6f2c25c15 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java @@ -95,5 +95,33 @@ public interface ScreenProjectDataService extends BaseService param); + void collect(ScreenCollFormDTO param); + + + /** + * @Description 查询是否存在客户的数据 + * @param customerId + * @return int + * @author wangc + * @date 2021.03.04 23:35 + */ + int checkIfExisted(String customerId); + + /** + * @Description 获取客户下已经入库而且未结案的数据集 + * @param + * @return + * @author wangc + * @date 2021.03.08 09:32 + */ + List getPending(ScreenProjectDataDTO param,String dateId); + + /** + * @Description collect或更新 + * @param + * @return void + * @author wangc + * @date 2021.03.09 17:36 + */ + void insertOrUpdateBatch(String customerId,String dateId,List meta,List orient); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java index 2b710cefb3..7702f0cfd1 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectGridDailyService.java @@ -96,13 +96,12 @@ public interface ScreenProjectGridDailyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取【网格-日】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java index eba2c666d8..fb170d618d 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java @@ -93,4 +93,6 @@ public interface ScreenProjectImgDataService extends BaseService list); + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java index 587a6eef72..ee1f4bf1e7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectOrgDailyService.java @@ -96,13 +96,12 @@ public interface ScreenProjectOrgDailyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取【机关-日】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java index de086e33a2..44289bdfc7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java @@ -92,4 +92,6 @@ public interface ScreenProjectProcessAttachmentService extends BaseService list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java index f4b050fe13..62be8b8746 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java @@ -95,5 +95,9 @@ public interface ScreenProjectProcessService extends BaseService param); + void collect(ScreenCollFormDTO param); + + boolean checkIfHistoricalDataExists(String customerId); + + void insertBatch(List list,String customerId,String dateId); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java index 6d5e5b909d..da29112ad7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityGridMonthlyService.java @@ -95,13 +95,12 @@ public interface ScreenProjectQuantityGridMonthlyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取 【网格-月】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java index 88c451bcfc..6088a6dba4 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectQuantityOrgMonthlyService.java @@ -96,13 +96,12 @@ public interface ScreenProjectQuantityOrgMonthlyService extends BaseService data); + void collect(ScreenCollFormDTO data); /** * @Description 数据抽取【组织-月】 diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java index e5229f146b..30adab1c63 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/AnScreenCollServiceImpl.java @@ -4,11 +4,7 @@ import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; -import com.epmet.dao.evaluationindex.screen.ScreenAnCommunityProjectProfileDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsGovernMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsOrgMonthlyDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmRankDao; -import com.epmet.dao.evaluationindex.screen.ScreenAnGrassRootsPmTotalMonthlyDao; +import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.dto.screencoll.form.*; import com.epmet.service.evaluationindex.screen.AnScreenCollService; @@ -17,10 +13,6 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import org.springframework.util.CollectionUtils; - - -import java.util.List; /** @@ -56,17 +48,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void communityProjectProfile(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void communityProjectProfile(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = communityProjectProfileDao.deleteBatch(customerId); + int affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); while(affectRows >= NumConstant.ONE){ - affectRows = communityProjectProfileDao.deleteBatch(customerId); + affectRows = communityProjectProfileDao.deleteBatch(formDTO.getCustomerId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - communityProjectProfileDao.insertBatch(list,customerId); + communityProjectProfileDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -81,17 +73,17 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmRank(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmRank(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmRankDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmRankDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { - pmRankDao.insertBatch(list,customerId); + pmRankDao.insertBatch(list,formDTO.getCustomerId()); }); } @@ -105,21 +97,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void pmTotal(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void pmTotal(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = pmTotalMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = pmTotalMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { pmTotalMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -136,21 +128,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsOrg(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsOrg(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = orgMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = orgMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { orgMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); @@ -167,21 +159,21 @@ public class AnScreenCollServiceImpl implements AnScreenCollService { */ @Override @Transactional(rollbackFor = Exception.class) - public void grassrootsGovern(ScreenCollFormDTO formDTO,String customerId) { - List dataList = formDTO.getDataList(); - if(CollectionUtils.isEmpty(dataList)) return ; + public void grassrootsGovern(ScreenCollFormDTO formDTO) { + /*List dataList = formDTO.getDataList(); + if(CollectionUtils.isEmpty(dataList)) return ;*/ if(formDTO.getIsFirst()){ - int affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + int affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); while(affectRows >= NumConstant.ONE){ - affectRows = governMonthlyDao.deleteBatch(customerId,formDTO.getMonthId()); + affectRows = governMonthlyDao.deleteBatch(formDTO.getCustomerId(),formDTO.getMonthId()); } } String quarterId = DateUtils.getQuarterId(formDTO.getMonthId()); String yearId = DateUtils.getYearId(formDTO.getMonthId()); Lists.partition(formDTO.getDataList(),NumConstant.ONE_HUNDRED).forEach(list -> { governMonthlyDao.insertBatch(list, - customerId, + formDTO.getCustomerId(), formDTO.getMonthId(), quarterId, yearId); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java index 2e4abd79df..dc3bed6bd7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/KcScreenCollServiceImpl.java @@ -82,285 +82,285 @@ public class KcScreenCollServiceImpl implements KcScreenCollService { @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertPlatFormSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertPlatFormSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcPlatformSummaryDailyDao.deletePlatFormSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcPlatformSummaryDailyDao.deletePlatFormSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcPlatformSummaryDailyDao.batchInsertPlatFormSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcPlatformSummaryDailyDao.batchInsertPlatFormSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIssueSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertIssueSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcIssueSummaryGridDailyDao.deleteIssueSummaryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcIssueSummaryGridDailyDao.deleteIssueSummaryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcIssueSummaryGridDailyDao.batchInsertIssueSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcIssueSummaryGridDailyDao.batchInsertIssueSummaryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertIssueTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertIssueTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcIssueTrendGridMonthlyDao.deleteIssueTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcIssueTrendGridMonthlyDao.deleteIssueTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcIssueTrendGridMonthlyDao.batchInsertIssueTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcIssueTrendGridMonthlyDao.batchInsertIssueTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertUserSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcUserSummaryDailyDao.deleteUserSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcUserSummaryDailyDao.deleteUserSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcUserSummaryDailyDao.batchInsertUserSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcUserSummaryDailyDao.batchInsertUserSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertVolunteerHeartRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertVolunteerHeartRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcVolunteerHeatRankGridDailyDao.deleteVolunteerHeatRankGrid(customerId); + deleteNum = screenKcVolunteerHeatRankGridDailyDao.deleteVolunteerHeatRankGrid(formDTO.getCustomerId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcVolunteerHeatRankGridDailyDao.batchInsertVolunteerHeatRankGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcVolunteerHeatRankGridDailyDao.batchInsertVolunteerHeatRankGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertUserHeartRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertUserHeartRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcUserTrendGridMonthlyDao.deleteUserTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcUserTrendGridMonthlyDao.deleteUserTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcUserTrendGridMonthlyDao.batchInsertUserTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcUserTrendGridMonthlyDao.batchInsertUserTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertActSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertActSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcActSummaryDailyDao.deleteActSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcActSummaryDailyDao.deleteActSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcActSummaryDailyDao.batchInsertActSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcActSummaryDailyDao.batchInsertActSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertActTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertActTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcActTrendMonthlyDao.deleteActTrend(customerId, formDTO.getMonthId()); + deleteNum = screenKcActTrendMonthlyDao.deleteActTrend(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcActTrendMonthlyDao.batchInsertActTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcActTrendMonthlyDao.batchInsertActTrend(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertVolunteerSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertVolunteerSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcVolunteerSummaryDailyDao.deleteVolunteerSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcVolunteerSummaryDailyDao.deleteVolunteerSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcVolunteerSummaryDailyDao.batchInsertVolunteerSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcVolunteerSummaryDailyDao.batchInsertVolunteerSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertProjectSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertProjectSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectSummaryGridDailyDao.deleteProjectSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcProjectSummaryGridDailyDao.deleteProjectSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectSummaryGridDailyDao.batchInsertProjectSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcProjectSummaryGridDailyDao.batchInsertProjectSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertCategorySummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertCategorySummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectCategoryGridDailyDao.deleteCategoryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcProjectCategoryGridDailyDao.deleteCategoryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectCategoryGridDailyDao.batchInsertCategoryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcProjectCategoryGridDailyDao.batchInsertCategoryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertProjectSatisanalysis(ScreenCollFormDTO formDTO, String customerId) { + public void insertProjectSatisanalysis(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcProjectSatisGridMonthlyDao.deleteProjectSatisGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcProjectSatisGridMonthlyDao.deleteProjectSatisGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcProjectSatisGridMonthlyDao.batchInsertProjectSatisGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcProjectSatisGridMonthlyDao.batchInsertProjectSatisGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsSummaryDailyDao.deleteNewsSummary(customerId, formDTO.getDateId()); + deleteNum = screenKcNewsSummaryDailyDao.deleteNewsSummary(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsSummaryDailyDao.batchInsertNewsSummary(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsSummaryDailyDao.batchInsertNewsSummary(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsTrendMonthlyDao.deleteNewsTrend(customerId, formDTO.getMonthId()); + deleteNum = screenKcNewsTrendMonthlyDao.deleteNewsTrend(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsTrendMonthlyDao.batchInsertNewsTrend(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcNewsTrendMonthlyDao.batchInsertNewsTrend(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsHotRank(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsHotRank(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsRankDao.deleteNewsRank(customerId); + deleteNum = screenKcNewsRankDao.deleteNewsRank(formDTO.getCustomerId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsRankDao.batchInsertNewsRank(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsRankDao.batchInsertNewsRank(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO, String customerId) { + public void insertNewsCategoryAnalysis(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcNewsCategoryAnalysisDao.deleteNewsCategoryAnalysis(customerId, formDTO.getDateId()); + deleteNum = screenKcNewsCategoryAnalysisDao.deleteNewsCategoryAnalysis(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcNewsCategoryAnalysisDao.batchInsertNewsCategoryAnalysis(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcNewsCategoryAnalysisDao.batchInsertNewsCategoryAnalysis(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupSummary(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupSummary(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcGroupSummaryGridDailyDao.deleteGroupSummaryGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcGroupSummaryGridDailyDao.deleteGroupSummaryGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcGroupSummaryGridDailyDao.batchInsertGroupSummaryGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcGroupSummaryGridDailyDao.batchInsertGroupSummaryGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupDetail(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupDetail(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcGroupDetailGridDailyDao.deleteGroupDetailGrid(customerId, formDTO.getDateId()); + deleteNum = screenKcGroupDetailGridDailyDao.deleteGroupDetailGrid(formDTO.getCustomerId(), formDTO.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcGroupDetailGridDailyDao.batchInsertGroupDetailGrid(formDTO.getDataList(), customerId, formDTO.getDateId()); + screenKcGroupDetailGridDailyDao.batchInsertGroupDetailGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getDateId()); } } @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) @Override @Transactional(rollbackFor = Exception.class) - public void insertGroupTopicTrend(ScreenCollFormDTO formDTO, String customerId) { + public void insertGroupTopicTrend(ScreenCollFormDTO formDTO) { if (formDTO.getIsFirst()) { int deleteNum; do { - deleteNum = screenKcTopicTrendGridMonthlyDao.deleteTopicTrendGrid(customerId, formDTO.getMonthId()); + deleteNum = screenKcTopicTrendGridMonthlyDao.deleteTopicTrendGrid(formDTO.getCustomerId(), formDTO.getMonthId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(formDTO.getDataList())) { - screenKcTopicTrendGridMonthlyDao.batchInsertTopicTrendGrid(formDTO.getDataList(), customerId, formDTO.getMonthId()); + screenKcTopicTrendGridMonthlyDao.batchInsertTopicTrendGrid(formDTO.getDataList(), formDTO.getCustomerId(), formDTO.getMonthId()); } } 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 index 70ce72a036..acc891ac1a 100644 --- 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 @@ -21,19 +21,17 @@ 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.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; @@ -108,23 +106,22 @@ public class ScreenProjectCategoryGridDailyServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if(param.getIsFirst()){ int deleteNum; do { - deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + deleteNum = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(),param.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(param.getDataList())) { param.getDataList().forEach(item -> { - item.setCustomerId(customerId); + item.setCustomerId(param.getCustomerId()); item.setDateId(param.getDateId()); }); insertBatch(ConvertUtils.sourceToTarget(param.getDataList(), ScreenProjectCategoryGridDailyEntity.class)); 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 index 290b30cf74..5660fad150 100644 --- 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 @@ -107,23 +107,22 @@ public class ScreenProjectCategoryOrgDailyServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if(param.getIsFirst()){ int deleteNum; do { - deleteNum = baseDao.deleteByDateIdAndCustomerId(customerId,param.getDateId()); + deleteNum = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(),param.getDateId()); } while (deleteNum > NumConstant.ZERO); } if (!CollectionUtils.isEmpty(param.getDataList())) { param.getDataList().forEach(item -> { - item.setCustomerId(customerId); + item.setCustomerId(param.getCustomerId()); item.setDateId(param.getDateId()); }); Lists.partition(param.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java index cd6117ce6c..501bfa2c43 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -21,23 +21,24 @@ 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.commons.tools.constant.FieldConstant; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.evaluationindex.screen.*; import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; import com.epmet.dto.screencoll.ScreenCollFormDTO; -import com.epmet.entity.evaluationindex.screen.*; -import com.epmet.service.evaluationindex.screen.*; -import com.google.common.collect.Lists; +import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import com.epmet.service.evaluationindex.screen.ScreenProjectDataService; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.ArrayUtils; 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 javax.annotation.Resource; import java.text.ParseException; @@ -54,6 +55,7 @@ import java.util.Map; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectDataServiceImpl extends BaseServiceImpl implements ScreenProjectDataService { @Resource @@ -120,11 +122,11 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if (param.getIsFirst()) { - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); while (affectedRows > 0) { - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); } } SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); @@ -177,11 +179,11 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl deleteWrapper = new QueryWrapper<>(); deleteWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()); baseDao.delete(deleteWrapper); QueryWrapper screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>(); screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()); screenProjectImgDataDao.delete(screenProjectImgDataEntityQueryWrapper); //如果orgType未知,获取一下 @@ -204,7 +206,7 @@ public class ScreenProjectDataServiceImpl extends BaseServiceImpl getPending(ScreenProjectDataDTO param,String dateId) { + param.setDataEndTime(dateId); + return baseDao.selectPending(param); + } + + /** + * @Description collect或更新 + * @param + * @return void + * @author wangc + * @date 2021.03.09 17:36 + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX) + public void insertOrUpdateBatch(String customerId, String dateId, List meta, List orient) { + //内部数据抽取的逻辑是,不管dateId指定的哪一天,只要在抽取时,目标数据库中没有相应数据 + //就抽取指定日期及其之前的所有数据,因此在删除时只需对指定日期删除即可,上述情况是因为 + //库中无数据,范围性删除无意义,只是针对在数据库有历史数据的情况下,保证对同一天进行反 + //复采集时数不会重复 + if(!CollectionUtils.isEmpty(meta)){ + int affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId,dateId); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByProjectTimeAndCustomerId(customerId, dateId); + } + List> partition = ListUtils.partition(meta, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(part)); + } + + + if(!CollectionUtils.isEmpty(orient)){ + List> partition = ListUtils.partition(orient, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.updateBatch(part,dateId)); + } + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java index 527c41624e..64cb66e04c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectGridDailyServiceImpl.java @@ -122,7 +122,6 @@ public class ScreenProjectGridDailyServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getDateId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java index 3b149b2d37..cb1217f055 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java @@ -19,14 +19,18 @@ 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.ScreenProjectImgDataDao; import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; import com.epmet.service.evaluationindex.screen.ScreenProjectImgDataService; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 中央区-项目数据图片 @@ -42,6 +47,7 @@ import java.util.Map; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl implements ScreenProjectImgDataService { @Override @@ -96,4 +102,11 @@ public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl list) { + baseDao.deleteByProjectIds(list.stream().map(ScreenProjectImgDataDTO::getProjectId).distinct().collect(Collectors.toList())); + List> partition = ListUtils.partition(list, NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(list)); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java index b5c71b558b..98fc2f38f7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectOrgDailyServiceImpl.java @@ -125,7 +125,6 @@ public class ScreenProjectOrgDailyServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId,data.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(data.getCustomerId(),data.getDateId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getDateId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java index 7219b2ae21..e750394f9b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java @@ -19,14 +19,18 @@ 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.ScreenProjectProcessAttachmentDao; import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; import com.epmet.service.evaluationindex.screen.ScreenProjectProcessAttachmentService; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -34,6 +38,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 中央区-项目数据处理节点附件表 @@ -42,6 +47,7 @@ import java.util.Map; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl implements ScreenProjectProcessAttachmentService { @Override public PageData page(Map params) { @@ -95,4 +101,11 @@ public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl list) { + baseDao.deleteByProcessId(list.stream().map(ScreenProjectProcessAttachmentDTO::getProcessId).distinct().collect(Collectors.toList())); + List> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED); + partition.forEach(part -> baseDao.insertBatch(part)); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java index 1d18eb0b7f..863b119c07 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java @@ -21,6 +21,7 @@ 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; @@ -34,6 +35,7 @@ import com.epmet.dto.screencoll.ScreenCollFormDTO; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; import com.epmet.service.evaluationindex.screen.ScreenProjectProcessService; +import org.apache.commons.collections4.ListUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -51,6 +53,7 @@ import java.util.Map; * @since v1.0.0 2021-02-23 */ @Service +@DataSource(value = DataSourceConstant.EVALUATION_INDEX) public class ScreenProjectProcessServiceImpl extends BaseServiceImpl implements ScreenProjectProcessService { @Resource @@ -110,29 +113,29 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl param) { + public void collect(ScreenCollFormDTO param) { if (param.getIsFirst()) { - int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + int affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); while (affectedRows > 0) { - affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + affectedRows = baseDao.deleteByDateIdAndCustomerId(param.getCustomerId(), param.getDateId()); } } param.getDataList().forEach(item -> { //先删除旧数据 QueryWrapper screenProjectProcessEntityQueryWrapper = new QueryWrapper<>(); screenProjectProcessEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId) + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()) .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); baseDao.delete(screenProjectProcessEntityQueryWrapper); QueryWrapper screenProjectProcessAttachmentEntityQueryWrapper = new QueryWrapper<>(); screenProjectProcessAttachmentEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) - .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId) + .eq(StringUtils.isNotBlank(param.getCustomerId()), "customer_id", param.getCustomerId()) .eq(StringUtils.isNotBlank(item.getProcessId()), "process_id", item.getProcessId()); screenProjectProcessAttachmentDao.delete(screenProjectProcessAttachmentEntityQueryWrapper); //插入 ScreenProjectProcessEntity screenProjectProcessEntity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class); - screenProjectProcessEntity.setCustomerId(customerId); + screenProjectProcessEntity.setCustomerId(param.getCustomerId()); screenProjectProcessEntity.setDataEndTime(param.getDateId()); baseDao.insert(screenProjectProcessEntity); @@ -140,7 +143,7 @@ public class ScreenProjectProcessServiceImpl extends BaseServiceImpl NumConstant.ZERO; + } + + @Override + public void insertBatch(List list,String customerId,String dateId) { + int affectedRows = baseDao.deleteByProcessTimeAndCustomerId(customerId, dateId); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByProcessTimeAndCustomerId(customerId, dateId); + } + + List> partition = ListUtils.partition(list,NumConstant.ONE_HUNDRED); + partition.forEach(part -> { + baseDao.insertBatch(part); + }); + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java index 0457c180d0..ea99b5148a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityGridMonthlyServiceImpl.java @@ -123,7 +123,6 @@ public class ScreenProjectQuantityGridMonthlyServiceImpl extends BaseServiceImpl /** * @Description 数据采集 - * @param customerId * @param data * @return void * @author wangc @@ -132,15 +131,15 @@ public class ScreenProjectQuantityGridMonthlyServiceImpl extends BaseServiceImpl @Transactional(rollbackFor = Exception.class) @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public void collect(String customerId, ScreenCollFormDTO data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getMonthId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java index 730719d035..91917d22b7 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectQuantityOrgMonthlyServiceImpl.java @@ -123,7 +123,6 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< /** * @Description 数据采集 - * @param customerId * @param data * @return void * @author wangc @@ -132,15 +131,15 @@ public class ScreenProjectQuantityOrgMonthlyServiceImpl extends BaseServiceImpl< @Transactional(rollbackFor = Exception.class) @DataSource(value = DataSourceConstant.EVALUATION_INDEX,datasourceNameFromArg = true) @Override - public void collect(String customerId, ScreenCollFormDTO data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + int affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteByMonthIdAndCustomerId(customerId,data.getMonthId()); + affectedRows = baseDao.deleteByMonthIdAndCustomerId(data.getCustomerId(),data.getMonthId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,"APP_USER",data.getMonthId()); + baseDao.insertBatch(list,data.getCustomerId(),"APP_USER",data.getMonthId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java index 6f5ac2573e..98d18d8339 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenCustomerWorkRecordDictService.java @@ -96,11 +96,10 @@ public interface ScreenCustomerWorkRecordDictService extends BaseService data); + void collect(ScreenCollFormDTO data); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java index 6edbb9ba92..c14291c641 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgDailyService.java @@ -30,5 +30,5 @@ import com.epmet.entity.plugins.ScreenWorkRecordOrgDailyEntity; */ public interface ScreenWorkRecordOrgDailyService extends BaseService { - void collectOrgDaily(String customerId, ScreenCollFormDTO data); + void collectOrgDaily(ScreenCollFormDTO data); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java index 0e16b4b1fe..7804957e4e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/ScreenWorkRecordOrgMonthlyService.java @@ -32,11 +32,10 @@ public interface ScreenWorkRecordOrgMonthlyService extends BaseService data); + void collect(ScreenCollFormDTO data); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java index 05b1172eb7..7a6291717a 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenCustomerWorkRecordDictServiceImpl.java @@ -107,15 +107,15 @@ public class ScreenCustomerWorkRecordDictServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteBatch(customerId); + int affectedRows = baseDao.deleteBatch(data.getCustomerId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteBatch(customerId); + affectedRows = baseDao.deleteBatch(data.getCustomerId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),data.getDateId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java index c517555fbc..8f4d4f7c84 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgDailyServiceImpl.java @@ -41,15 +41,15 @@ public class ScreenWorkRecordOrgDailyServiceImpl extends BaseServiceImpl data) { + public void collectOrgDaily(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteBatch(customerId,data.getDateId()); + int affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getDateId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteBatch(customerId,data.getDateId()); + affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getDateId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,data.getDateId()); + baseDao.insertBatch(list,data.getCustomerId(),data.getDateId()); }); } } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java index a27cb040aa..7ecd3c4eb6 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/plugins/impl/ScreenWorkRecordOrgMonthlyServiceImpl.java @@ -42,7 +42,6 @@ public class ScreenWorkRecordOrgMonthlyServiceImpl extends BaseServiceImpl data) { + public void collect(ScreenCollFormDTO data) { if(data.getIsFirst()){ - int affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + int affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getMonthId()); while(affectedRows > 0){ - affectedRows = baseDao.deleteBatch(customerId,data.getMonthId()); + affectedRows = baseDao.deleteBatch(data.getCustomerId(),data.getMonthId()); } } Lists.partition(data.getDataList(), NumConstant.ONE_HUNDRED).forEach(list -> { - baseDao.insertBatch(list,customerId,data.getMonthId()); + baseDao.insertBatch(list,data.getCustomerId(),data.getMonthId()); }); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java index 5a27fdca62..84386e9ec3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectProcessService.java @@ -22,6 +22,9 @@ import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; @@ -124,4 +127,43 @@ public interface ProjectProcessService extends BaseService * @date 2020.09.28 14:44 */ Map getLatestOperation(List list, String customerId); + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @param dateId + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + void updateProjectStatus(List list, String dateId,String customerId); + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + void updateProjectCloseTime(List list); + + /** + * @Description 构建大屏项目进展数据 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.09 14:49 + */ + List buildNewScreenProjectProcessData(String customerId,String dateId,boolean ifRanged); + + /** + * @Description 构建节点附件数据 + * @param processIds + * @return java.util.List + * @author wangc + * @date 2021.03.09 16:56 + */ + List buildProcessAttachmentData(List processIds); } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/ProjectService.java index 2dc0e88aa6..6f283b852a 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 @@ -21,10 +21,13 @@ import com.epmet.commons.mybatis.service.BaseService; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; import com.epmet.dto.project.ProjectGridDTO; -import com.epmet.dto.project.ProjectInfoDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; +import org.apache.ibatis.annotations.Param; import java.util.List; +import java.util.Map; +import java.util.Set; /** * 项目表 @@ -109,4 +112,33 @@ public interface ProjectService extends BaseService { * @date 2020.11.06 14:14 */ Integer getOvertimeProjectByParameter(String customerId); + + /** + * @Description 查找客户项目超期参数 + * + * @param customerId + * @return java.util.List + * @author wangc + * @date 2021.03.05 17:52 + */ + List getProjectExceedParams(@Param("customerId") String customerId); + + /** + * @Description 获取项目相关信息 + * @param projectIds + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:28 + */ + List getProjectInfo(List projectIds); + + /** + * @Description 获取项目的所有标签名称 用-连接 + * @param projectIds + * @return java.util.Map> + * @author wangc + * @date 2021.03.08 23:46 + */ + Map> getProjectCategory(List projectIds); + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java index d45bad78ed..d16db0530e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/project/impl/ProjectProcessServiceImpl.java @@ -20,16 +20,18 @@ package com.epmet.service.project.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; import com.epmet.commons.tools.constant.NumConstant; -import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectProcessDao; -import com.epmet.dto.form.CommonStaffIdFormDTO; +import com.epmet.dto.ProjectProcessDTO; import com.epmet.dto.project.FinishOrgDTO; import com.epmet.dto.project.ProcessInfoDTO; -import com.epmet.dto.project.ProjectOrgRelationDTO; +import com.epmet.dto.project.ProjectStaffDTO; import com.epmet.dto.project.result.ProjectLatestOperationResultDTO; import com.epmet.dto.project.result.ProjectOrgPeriodResultDTO; -import com.epmet.dto.project.result.ProjectOrgRelationWhenResponseResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.entity.project.ProjectProcessEntity; import com.epmet.service.project.ProjectProcessService; @@ -39,7 +41,6 @@ import org.springframework.stereotype.Service; import org.springframework.util.CollectionUtils; import java.util.*; -import java.util.stream.Collector; import java.util.stream.Collectors; /** @@ -91,7 +92,7 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl @@ -125,4 +126,93 @@ public class ProjectProcessServiceImpl extends BaseServiceImplo,(a,n)-> a)); } } + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @param dateId + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + @Override + public void updateProjectStatus(List list,String dateId,String customerId) { + if(CollectionUtils.isEmpty(list)) return; + List closedInfo = baseDao.selectClosedProjectOnAppointedDay(customerId, dateId); + if(CollectionUtils.isEmpty(closedInfo)) return; + + list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( + merge -> { + target.setProjectStatusCode("closed_case"); + target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + return target; + } + )).collect(Collectors.toList()); + } + + /** + * @Description 查询指定日期关闭的项目 然后将状态由【pending】改为【closed_case】,并加上结案时间 + * @param list + * @return void + * @author wangc + * @date 2021.03.09 09:54 + */ + @Override + public void updateProjectCloseTime(List list) { + if(CollectionUtils.isEmpty(list)) return; + List closedInfo = baseDao.selectClosedProjectByProjectIds(list.stream().map(ScreenProjectDataDTO::getProjectId).distinct().collect(Collectors.toList())); + if(CollectionUtils.isEmpty(closedInfo)) return; + + list = list.stream().flatMap(target -> closedInfo.stream().filter(closedCase -> StringUtils.equals(closedCase.getProjectId(),target.getProjectId())).map( + merge -> { + //target.setProjectStatusCode("closed_case"); + target.setCloseCaseTime(DateUtils.format(merge.getCreatedTime(),DateUtils.DATE_TIME_PATTERN)); + return target; + } + )).collect(Collectors.toList()); + } + + /** + * @Description 构建大屏项目进展数据 + * + * @param customerId + * @param dateId + * @return java.util.List + * @author wangc + * @date 2021.03.09 14:49 + */ + @Override + public List buildNewScreenProjectProcessData(String customerId, String dateId, boolean ifRanged) { + List processes = baseDao.selectProjectProcessAndDirection(customerId, ifRanged ? null : dateId, dateId); + if(CollectionUtils.isEmpty(processes)) return null; + return processes.stream().map(target -> { + List points = target.getPoints(); + if(!CollectionUtils.isEmpty(points)){ + List orgIds = points.stream().map(ProjectStaffDTO::getOrgId).distinct().collect(Collectors.toList()); + List names = points.stream().map(ProjectStaffDTO::getDepartmentName).distinct().collect(Collectors.toList()); + StringBuilder builder1 = new StringBuilder(); + orgIds.forEach(orgId -> builder1.append(orgId).append(",")); + StringBuilder builder2 = new StringBuilder(); + names.forEach(name -> builder2.append(name).append(",")); + target.setTransferDeptIds(builder1.substring(NumConstant.ZERO,builder1.length() - NumConstant.TWO)); + target.setTransferDeptName(builder2.substring(NumConstant.ZERO,builder2.length() - NumConstant.TWO)); + } + return target; + }).collect(Collectors.toList()); + + } + + + + /** + * @Description 构建节点附件数据 + * @param processIds + * @return java.util.List + * @author wangc + * @date 2021.03.09 16:56 + */ + @Override + public List buildProcessAttachmentData(List processIds) { + return baseDao.selectProcessAttachment(processIds); + } } \ 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 5ba8ea04d6..294d0e4f31 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 @@ -24,13 +24,20 @@ import com.epmet.constant.DataSourceConstant; import com.epmet.dao.project.ProjectDao; import com.epmet.dto.ProjectDTO; import com.epmet.dto.project.ProjectAgencyDTO; +import com.epmet.dto.project.ProjectCategoryDTO; import com.epmet.dto.project.ProjectGridDTO; +import com.epmet.dto.project.result.ProjectExceedParamsResultDTO; import com.epmet.entity.project.ProjectEntity; import com.epmet.service.project.ProjectService; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; /** * 项目表 @@ -97,4 +104,52 @@ public class ProjectServiceImpl extends BaseServiceImpl + * @author wangc + * @date 2021.03.05 17:52 + */ + @Override + public List getProjectExceedParams(String customerId) { + return baseDao.selectProjectExceedParams(customerId); + } + + /** + * @Description 获取项目相关信息 + * @param projectIds + * @return java.util.List + * @author wangc + * @date 2021.03.08 10:28 + */ + @Override + public List getProjectInfo(List projectIds) { + return baseDao.batchSelectProjectInfo(projectIds); + } + + /** + * @Description 获取项目的所有标签名称 用-连接 + * @param projectIds + * @return java.util.Map> + * @author wangc + * @date 2021.03.08 10:28 + */ + @Override + public Map> getProjectCategory(List projectIds) { + if(CollectionUtils.isEmpty(projectIds)) return null; + List categories = baseDao.selectProjectCategory(projectIds); + if(CollectionUtils.isEmpty(categories)) return null; + Map> map = new HashMap<>(); + Map> projectMap = categories.stream().collect(Collectors.groupingBy(ProjectCategoryDTO::getProjectId)); + projectMap.forEach((k,v) -> { + Set categoryIds = v.stream().map(ProjectCategoryDTO::getCategoryId).collect(Collectors.toSet()); + map.put(k,categoryIds); + }); + return map; + } + + + } \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java index 8acaa3c3ac..5dc7b17392 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/TopicService.java @@ -2,6 +2,8 @@ package com.epmet.service.topic; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.result.TopicStatisticalData; @@ -83,4 +85,23 @@ public interface TopicService { * @date 2020.09.28 16:28 */ Map getTopicContent(List list); + + /** + * @Description 获取大屏项目相关信息 + * + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List fillScreenProjectData(List list); + + /** + * @Description 构建新增的大屏项目图片数据 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.09 13:59 + */ + List buildNewScreenProjectImgData(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java index 61c926507d..83e3b9da38 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/topic/impl/TopicServiceImpl.java @@ -2,11 +2,14 @@ package com.epmet.service.topic.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.utils.ConvertUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.dao.topic.TopicDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.result.TopicInfoResultDTO; import com.epmet.dto.group.result.TopicContentResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; import com.epmet.dto.screen.form.ProjectSourceMapFormDTO; import com.epmet.dto.stats.DimTopicStatusDTO; import com.epmet.dto.stats.topic.*; @@ -144,7 +147,7 @@ public class TopicServiceImpl implements TopicService { List imgs = topicDao.selectTopicImgs(list); if(CollectionUtils.isEmpty(imgs)) return Collections.EMPTY_MAP; //key -> topicId | value -> projectId - Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); //key -> topicId Map> result = imgs.stream().collect(Collectors.groupingBy(ScreenDifficultyImgDataEntity :: getEventId)); @@ -175,7 +178,7 @@ public class TopicServiceImpl implements TopicService { if(CollectionUtils.isEmpty(contents)) return Collections.EMPTY_MAP; Map topicContentMap = contents.stream().collect(Collectors.toMap(TopicContentResultDTO :: getTopicId,TopicContentResultDTO::getContent)); //key -> topicId | value -> projectId - Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId)); + Map projectTopicMap = list.stream().collect(Collectors.toMap(ProjectSourceMapFormDTO :: getSourceId,ProjectSourceMapFormDTO :: getProjectId,(o,n)->n)); Map result = new HashMap<>(); projectTopicMap.forEach((topic,project) -> { result.put(project,topicContentMap.get(topic)); @@ -183,6 +186,52 @@ public class TopicServiceImpl implements TopicService { return result; } + /** + * @Description 获取大屏项目相关信息 + * + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + @Override + public List fillScreenProjectData(List list) { + List collection = topicDao.selectScreenProjectData(list); + if(!CollectionUtils.isEmpty(collection)){ + list = list.stream().flatMap(target -> collection.stream().filter( + res -> StringUtils.equals(target.getTopicId(),res.getTopicId()) + ).map(merge -> { + target.setLatitude(merge.getLatitude()); + target.setLongitude(merge.getLongitude()); + target.setProjectContent(merge.getProjectContent()); + target.setProjectAddress(merge.getProjectAddress()); + return target; + })).collect(Collectors.toList()); + } + return collection; + } + + /** + * @Description 构建新增的大屏项目图片数据 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.09 13:59 + */ + @Override + public List buildNewScreenProjectImgData(List list) { + List imgs = topicDao.initNewScreenProjectImgData(list.get(NumConstant.ZERO).getCustomerId(), list); + if(CollectionUtils.isEmpty(imgs)) return null; + return imgs.stream().flatMap(img -> list.stream().filter(project -> StringUtils.equals(img.getTopicId(),project.getTopicId())).map( + match -> { + ScreenProjectImgDataDTO matchedImg + = ConvertUtils.sourceToTarget(img,ScreenProjectImgDataDTO.class); + matchedImg.setProjectId(match.getProjectId()); + return matchedImg; + } + )).collect(Collectors.toList()); + } + /** * @Description 初始化机关-所有下级网格Map * @param pid - 固定一个机关Id diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java index 767af842b0..36229bfbb2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/UserService.java @@ -2,10 +2,10 @@ package com.epmet.service.user; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.entity.evaluationindex.screen.ScreenPartyUserRankDataEntity; import com.epmet.util.DimIdGenerator; -import org.apache.ibatis.annotations.Param; import java.util.Date; import java.util.List; @@ -75,4 +75,13 @@ public interface UserService { * @date 2020.09.25 13:54 **/ List getRegisteredUserList(String customerId); + + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + List fillScreenProjectData(List list); } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java index bc0a9e83d2..db739b79ab 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/user/impl/UserServiceImpl.java @@ -8,6 +8,7 @@ import com.epmet.dao.user.UserDao; import com.epmet.dto.AgencySubTreeDto; import com.epmet.dto.extract.form.GridHeartedFormDTO; import com.epmet.dto.extract.result.UserPartyResultDTO; +import com.epmet.dto.screen.ScreenProjectDataDTO; import com.epmet.dto.stats.user.*; import com.epmet.dto.stats.user.result.UserStatisticalData; import com.epmet.dto.user.result.CommonTotalAndIncCountResultDTO; @@ -728,4 +729,24 @@ public class UserServiceImpl implements UserService { return userList; } + /** + * @Description 获取大屏项目相关信息 联系人 + * @param list + * @return java.util.List + * @author wangc + * @date 2021.03.08 17:16 + */ + @Override + public List fillScreenProjectData(List list) { + List collection = userDao.selectScreenProjectData(list); + if(!CollectionUtils.isEmpty(collection)){ + list = list.stream().flatMap(target -> collection.stream().filter(res -> StringUtils.equals(target.getLinkName(),res.getTopicId())) + .map(merge -> { + target.setLinkName(merge.getLinkName()); + target.setLinkMobile(merge.getLinkMobile()); + return target;})).collect(Collectors.toList()); + } + return collection; + } + } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml index 3d21f70ce7..89ba03036c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectMainDailyDao.xml @@ -534,4 +534,39 @@ AND PROJECT_STATUS = 'closed' GROUP BY GRID_ID + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml index d607aac0d0..0790001c64 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/extract/FactOriginProjectOrgPeriodDailyDao.xml @@ -140,4 +140,24 @@ GROUP BY fp.ORG_ID + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml index 82e0587dc5..51c75a1c17 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -40,4 +40,136 @@ limit 1000 + + delete from screen_project_data + where customer_id = #{customerId} + and DATE_FORMAT(PROJECT_CREATE_TIME,'%Y%m%d') = #{dateId} + limit 1000 + + + + + + + + INSERT INTO screen_project_data + ( + id, + customer_id, + org_type, + org_id, + parent_id, + org_name, + project_id, + project_title, + project_create_time, + link_name, + link_mobile, + project_content, + project_level, + project_address, + all_category_name, + longitude, + latitude, + close_case_time, + data_end_time, + all_parent_ids, + project_status_code, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.orgType}, + #{item.orgId}, + #{item.parentId}, + #{item.orgName}, + #{item.projectId}, + #{item.projectTitle}, + #{item.projectCreateTime}, + #{item.linkName}, + #{item.linkMobile}, + #{item.projectContent}, + #{item.projectLevel}, + #{item.projectAddress}, + #{item.allCategoryName}, + #{item.longitude}, + #{item.latitude}, + #{item.closeCaseTime}, + #{item.dataEndTime}, + #{item.allParentIds}, + #{item.projectStatusCode}, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + + + update screen_project_data + + + + + when PROJECT_ID=#{i.projectId} then #{i.projectStatusCode} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.closeCaseTime} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.allCategoryName} + + + + + + + when PROJECT_ID=#{i.projectId} then #{i.projectLevel} + + + + + + #{dateId} + + + now() + + + + where + + PROJECT_ID=#{i.projectId} + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml index 3604a5df25..a9caf4992e 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml @@ -18,4 +18,44 @@ + + delete from screen_project_img_data + + + PROJECT_ID = #{projectId} + + + + + + + INSERT INTO screen_project_img_data + ( + id, + customer_id, + project_id, + project_img_url, + sort, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.projectId}, + #{item.projectImgUrl}, + #{item.sort}, + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml index 8560281d3b..953f2bee72 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml @@ -26,5 +26,63 @@ + + delete from screen_project_process_attachment + + + PROCESS_ID = #{processId} + + + + + + INSERT INTO screen_project_process_attachment + ( + id, + attachment_id, + customer_id, + project_id, + process_id, + file_place, + file_name, + attachment_name, + attachment_size, + attachment_format, + attachment_type, + attachment_url, + sort, + duration, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.attachmentId}, + #{item.customerId}, + #{item.projectId}, + #{item.processId}, + #{item.filePlace}, + #{item.fileName}, + #{item.attachmentName}, + #{item.attachmentSize}, + #{item.attachmentFormat}, + #{item.attachmentType}, + #{item.attachmentUrl}, + #{item.sort}, + #{item.duration}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml index 06023e11b6..fc19f60add 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml @@ -10,4 +10,67 @@ limit 1000 + + delete from screen_project_process + where customer_id = #{customerId} + and DATE_FORMAT(PROCESS_TIME,'%Y%m%d') = #{dateId} + limit 1000 + + + + + + INSERT INTO screen_project_process + ( + id, + customer_id, + process_id, + project_id, + transfer_dept_ids, + transfer_dept_name, + handler_name, + handler_id, + handler_type, + org_id_path, + operation, + public_reply, + internal_remark, + process_time, + data_end_time, + del_flag, + revision, + created_by, + created_time, + updated_by, + updated_time + ) values + + ( + (SELECT REPLACE(UUID(), '-', '') AS id), + #{item.customerId}, + #{item.processId}, + #{item.projectId}, + #{item.transferDeptName}, + #{item.transferDeptIds}, + #{item.handlerName}, + #{item.handlerId}, + #{item.handlerType}, + #{item.orgIdPath}, + #{item.operation}, + #{item.publicReply}, + #{item.internalRemark}, + #{item.processTime}, + #{item.dataEndTime}, + '0', + 0, + 'CRAWLER_ROBOT', + now(), + 'CRAWLER_ROBOT', + now() + ) + + 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 bd307d1d78..b4619ff0a2 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 @@ -287,4 +287,38 @@ AND DATE_FORMAT(ivd.CREATED_TIME,'%Y%m%d') = #{dateId} + + \ 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 08c8d78d5b..2a8699d341 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 @@ -105,5 +105,34 @@ and CUSTOMER_ID = #{customerId} and PARAMETER_KEY ='detention_days' + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml index 9e2bd9fe1d..e9079abc3b 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/project/ProjectProcessDao.xml @@ -311,4 +311,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml index ab24c331f7..f272c6f692 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/topic/TopicDao.xml @@ -242,4 +242,34 @@ ID = #{item.sourceId} + + + + \ No newline at end of file diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml index 810a972262..969a848ae3 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/user/UserDao.xml @@ -514,4 +514,20 @@ AND register.CUSTOMER_ID = #{customerId} AND register.FIRST_REGISTER = '1' + + + + diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java index 622a68e6cd..c5c96901ea 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/dao/IssueVoteDetailDao.java @@ -20,6 +20,7 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; import com.epmet.dto.IssueVoteDetailDTO; import com.epmet.dto.form.VoteFormDTO; +import com.epmet.dto.form.VoteRedisFormDTO; import com.epmet.dto.result.IssueAttitudeCountResultDTO; import com.epmet.dto.result.MyPartIssuesResultDTO; import com.epmet.entity.IssueVoteDetailEntity; @@ -95,4 +96,21 @@ public interface IssueVoteDetailDao extends BaseDao { * @Date 2020/11/18 14:35 **/ IssueVoteDetailDTO selectUserIssueDet(@Param("userId") String userId, @Param("issueId") String issueId); + + /** + * @Description 统计出一个议题的所有支持数和反对数 + * @param issueId + * @return com.epmet.dto.form.VoteRedisFormDTO + * @author wangc + * @date 2021.03.03 18:09 + */ + VoteRedisFormDTO selectInfo4Cache(@Param("issueId") String issueId); + /** + * @Description 批量统计出议题的所有支持数和反对数 + * @param issueIds + * @return java.util.Set + * @author wangc + * @date 2021.03.18 14:58 + */ + List selectBatchVoteCount(@Param("issueIds")Set issueIds); } \ No newline at end of file diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java index 268ddfbf88..a4a1439936 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/redis/IssueVoteDetailRedis.java @@ -22,6 +22,7 @@ import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.redis.RedisUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.constant.IssueConstant; +import com.epmet.dao.IssueVoteDetailDao; import com.epmet.dto.IssueDTO; import com.epmet.dto.form.CommonGridIdFormDTO; import com.epmet.dto.form.VoteRedisFormDTO; @@ -29,14 +30,20 @@ import com.epmet.feign.ResiGroupFeignClient; import com.epmet.service.IssueService; import com.epmet.service.IssueVoteDetailService; import com.epmet.utils.ModuleConstants; +import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.RedisCallback; +import org.springframework.data.redis.core.RedisTemplate; import org.springframework.stereotype.Component; import java.lang.reflect.Field; +import java.util.List; import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; import static com.epmet.commons.tools.redis.RedisUtils.NOT_EXPIRE; @@ -59,13 +66,37 @@ public class IssueVoteDetailRedis { @Autowired private IssueService issueService; + @Autowired + private RedisTemplate redisTemplate; + @Autowired private IssueVoteDetailService issueVoteDetailService; + @Autowired + private IssueVoteDetailDao issueVoteDetailDao; + public void delete(Object[] ids) { } + public void deleteBatch(List issueIds){ + if(CollectionUtils.isEmpty(issueIds)) return ; + Set keys = issueIds.stream().map(id -> { + return IssueConstant.REDIS_KEY + id; + }).collect(Collectors.toSet()); + + redisTemplate.executePipelined((RedisCallback) connection ->{ + keys.forEach( ser -> {connection.del(redisTemplate.getKeySerializer().serialize(ser));}); + return null; + }); + } + + + public void delete(String issueId){ + redisUtils.delete(IssueConstant.REDIS_KEY +issueId); + } + + public void set(VoteRedisFormDTO vote){ @@ -185,10 +216,8 @@ public class IssueVoteDetailRedis { } //如果缓存中没有,去表决详情中计算出实时数据,并放入缓存中 //无需查询issue_vote_statistical中的数据,因为不是实时数据,可能不准确,有定时任务会自动同步 - VoteRedisFormDTO voteCache = new VoteRedisFormDTO(); - voteCache.setIssueId(issueId); - voteCache.setSupportAmount(issueVoteDetailService.getVotingCount(issueId,IssueConstant.SUPPORT)); - voteCache.setOppositionAmount(issueVoteDetailService.getVotingCount(issueId,IssueConstant.OPPOSE)); + VoteRedisFormDTO voteCache = issueVoteDetailDao.selectInfo4Cache(issueId); + if(StringUtils.isBlank(voteCache.getIssueId())) voteCache.setIssueId(issueId); IssueDTO issue = issueService.get(issueId); if(null != issue){ CommonGridIdFormDTO gridId = new CommonGridIdFormDTO(); diff --git a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java index fc8a5138de..003b0acd9e 100644 --- a/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java +++ b/epmet-module/gov-issue/gov-issue-server/src/main/java/com/epmet/service/impl/IssueVoteStatisticalServiceImpl.java @@ -63,7 +63,6 @@ import java.time.LocalDateTime; import java.time.ZoneOffset; import java.util.*; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * 议题表决统计表 @@ -256,6 +255,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl ids = issues.stream().map(IssueDTO::getId).collect(Collectors.toSet()); - List gridIds = issues.stream().map(IssueDTO::getGridId).collect(Collectors.toList()); + List gridIds = issues.stream().map(IssueDTO::getGridId).distinct().collect(Collectors.toList()); CommonGridIdListFormDTO gridIdList = new CommonGridIdListFormDTO(); gridIdList.setGridIds(gridIds); Result votableCountResult = resiGroupFeignClient.votableCounts(gridIdList); - Map votableCountMap = null; + Map votableCountMap1 = null; if(votableCountResult.success() && null != votableCountResult.getData() && null != votableCountResult.getData().getVotableCountMap()){ - votableCountMap = votableCountResult.getData().getVotableCountMap(); + votableCountMap1 = votableCountResult.getData().getVotableCountMap(); } + final Map votableCountMap = votableCountMap1; List statisticalList = baseDao.selectListByIds(ids); @@ -287,9 +288,8 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl existedIds = new HashSet<>(); - existedIds.addAll(ids); - existedIds.retainAll(statisiticalIds); + Set existedIds = new HashSet<>(statisiticalIds); + //更新 //对ids进行更新 - 从缓存中拿取 List listToUpdate = new ArrayList<>(); @@ -302,12 +302,42 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl NumConstant.ZERO) { + Map issueGridMap = issues.stream().collect(Collectors.toMap(IssueDTO::getId,IssueDTO::getGridId,(o, n) -> o)); //新增 - List toInsert = new ArrayList<>(); + List toInsert = new LinkedList<>(); + List voteList = issueVoteDetailDao.selectBatchVoteCount(notExistedIds); + List votedIssueIds = new ArrayList<>(); + if(!CollectionUtils.isEmpty(voteList) && StringUtils.isNotBlank(voteList.get(NumConstant.ZERO).getIssueId())) { + toInsert = voteList.stream().map(o -> { + IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); + dto.setIssueId(o.getIssueId()); + dto.setOppositionCount(o.getOppositionAmount()); + dto.setSupportCount(o.getSupportAmount()); + dto.setVotableCount(Optional.ofNullable(votableCountMap.get(issueGridMap.get(o.getIssueId()))).orElse(NumConstant.ZERO)); + dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);dto.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM); + return dto; + }).collect(Collectors.toList()); + votedIssueIds = voteList.stream().map(VoteRedisFormDTO::getIssueId).collect(Collectors.toList()); + } - List summaryList = issueVoteDetailDao.getVotingSummaryList(ids); + notExistedIds.removeAll(votedIssueIds); + if(!notExistedIds.isEmpty()){ + List collect = notExistedIds.stream().map(issueId -> { + IssueVoteStatisticalDTO dto = new IssueVoteStatisticalDTO(); + dto.setIssueId(issueId); + dto.setSupportCount(NumConstant.ZERO); + dto.setOppositionCount(NumConstant.ZERO); + dto.setVotableCount(Optional.ofNullable(votableCountMap.get(issueGridMap.get(issueId))).orElse(NumConstant.ZERO)); + dto.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM);dto.setUpdatedBy(ModuleConstants.CREATED_BY_SYSTEM); + return dto; + }).collect(Collectors.toList()); + if(!CollectionUtils.isEmpty(collect)) toInsert.addAll(collect);} + + /* + List summaryList = issueVoteDetailDao.getVotingSummaryList(notExistedIds); Map> summaryMap = summaryList.stream().collect(Collectors.groupingBy(IssueAttitudeCountResultDTO::getIssueId)); + for (Map.Entry> entry : summaryMap.entrySet()) { IssueVoteStatisticalDTO obj = new IssueVoteStatisticalDTO(); obj.setCreatedBy(ModuleConstants.CREATED_BY_SYSTEM); @@ -322,19 +352,15 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl setToInsert = toInsert.stream().map(IssueVoteStatisticalDTO::getIssueId).collect(Collectors.toSet()); +*/ + /* Set setToInsert = toInsert.stream().map(IssueVoteStatisticalDTO::getIssueId).collect(Collectors.toSet()); Set issuesNeverVotedIds = new HashSet(); issuesNeverVotedIds.addAll(ids); @@ -372,30 +398,27 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl redundantIds = new HashSet(); - redundantIds.addAll(statisiticalIds); - redundantIds.removeAll(ids); + //Set redundantIds = new HashSet(); + //redundantIds.addAll(statisiticalIds); + //redundantIds.removeAll(ids); //将redundantIds的议题统计信息删除 //因为statisiticalIds是通过ids查询出,因此不会出现这种情况 } else { //数据吻合,全部更新 List listToUpdate = new ArrayList<>(); - Map> gridIssueMap = - issues.stream().collect(Collectors.groupingBy(IssueDTO::getGridId)); - setVotableCountsAndUpdateCache(listToUpdate,issues,votableCountMap); // listToUpdate批量更新 @@ -518,8 +541,7 @@ public class IssueVoteStatisticalServiceImpl extends BaseServiceImpl + issue_id = #{issueId} + GROUP BY issue_id, attitude @@ -119,4 +122,37 @@ AND ivd.ISSUE_ID =#{issueId} AND ivd.CREATED_BY =#{userId} + + + + \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java index a19881ce9a..160e1a4afc 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/dao/RegisterRelationDao.java @@ -47,4 +47,12 @@ public interface RegisterRelationDao extends BaseDao { RegisterRelationEntity selectRegisteredGridIdByUserIdAndCustomerId(@Param("userId") String userId, @Param("customerId")String customerId); + + /** + * @Description 根据userId查询注册网格ID + * @Param userId + * @author zxc + * @date 2021/3/16 下午3:05 + */ + String selectRegisterGridIdByUserId(@Param("userId")String userId); } \ No newline at end of file diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java index e40e9ea607..96814c5fce 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/RegisterRelationService.java @@ -112,4 +112,6 @@ public interface RegisterRelationService extends BaseService { **/ List queryUserBaseInfo(List userIdList); + /** + * @Description 查询用户信息 + * @Param userIdList + * @author zxc + * @date 2021/3/16 下午2:52 + */ + List queryUserBaseInfoPlus(List userIdList); + /** * @return void * @param diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index f8a78f8c14..ca7b3db589 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -339,4 +339,9 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl oneUserIds = new ArrayList<>(); oneUserIds.add(userId); - List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfo(oneUserIds); + List userBaseInfoResultDTOS = userBaseInfoService.queryUserBaseInfoPlus(oneUserIds); + log.info("user【"+userId+"】基本信息:"+userBaseInfoResultDTOS.toString()); if (!CollectionUtils.isEmpty(userIds)) { AtomicReference status = new AtomicReference<>(true); userIds.forEach(u -> { - if(u.equals(userId)){ + if(u.getUserId().equals(userId)){ status.set(false); } }); @@ -232,6 +233,7 @@ public class UserBadgeServiceImpl implements UserBadgeService { badges.add(dto); }); } + log.info("即将插入的徽章信息:"+badges); resiUserBadgeDao.insertResiUserBadge(badges); } } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java index f76628b60d..852ca55843 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserBaseInfoServiceImpl.java @@ -40,6 +40,7 @@ import com.epmet.feign.GovOrgOpenFeignClient; import com.epmet.redis.UserBaseInfoRedis; import com.epmet.resi.partymember.dto.partymember.PartymemberInfoDTO; import com.epmet.resi.partymember.feign.ResiPartyMemberOpenFeignClient; +import com.epmet.service.RegisterRelationService; import com.epmet.service.UserBaseInfoService; import com.epmet.util.ModuleConstant; import org.apache.commons.lang3.StringUtils; @@ -77,6 +78,8 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl page(Map params) { @@ -181,6 +184,27 @@ public class UserBaseInfoServiceImpl extends BaseServiceImpl queryUserBaseInfoPlus(List userIdList) { + if (CollectionUtils.isEmpty(userIdList)){ + return new ArrayList<>(); + } + List result = new ArrayList<>(); + userIdList.forEach(id -> { + UserBaseInfoResultDTO baseInfo = userBaseInfoRedis.getUserInfo(id); + if (null != baseInfo && StringUtils.isEmpty(baseInfo.getRegisteredGridId())){ + String gridId = registerRelationService.selectRegisterGridIdByUserId(id); + if (StringUtils.isNotEmpty(gridId)){ + baseInfo.setRegisteredGridId(gridId); + }else { + throw new RenException("查询用户【"+id+"】所属网格失败"); + } + } + result.add(baseInfo); + }); + return result; + } + /** * @return void * @author yinzuomei diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java index 9c973e7b78..e5e7678835 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserResiInfoServiceImpl.java @@ -271,10 +271,10 @@ public class UserResiInfoServiceImpl extends BaseServiceImpl + + + \ No newline at end of file