diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java new file mode 100644 index 0000000000..be3585067d --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDetailFormDTO.java @@ -0,0 +1,19 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 16:12 + */ +@Data +public class ScreenProjectDetailFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + @NotBlank(message = "projectId不能为空") + private String projectId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java new file mode 100644 index 0000000000..69da09b886 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/form/ScreenProjectDistributionFormDTO.java @@ -0,0 +1,21 @@ +package com.epmet.evaluationindex.screen.dto.form; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 15:22 + */ +@Data +public class ScreenProjectDistributionFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + private String areaCode; + + private String level; + + private String agencyId; +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java new file mode 100644 index 0000000000..7ec31acd09 --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDetailResultDTO.java @@ -0,0 +1,124 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 16:15 + */ +@Data +public class ScreenProjectDetailResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 项目id + */ + private String projectId; + /** + * 议题内容,其实就是项目内容 + */ + private String projectContent; + /** + * 上报时间,对应的是立项时间;格式:yyyy-MM-dd HH:mm + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8") + private String reportTime; + /** + * 所属类别名称 + */ + private String categoryName; + /** + * 上报人名 + */ + private String reportUserName; + /** + * 上报人电话 + */ + private String mobile; + /** + * 上报位置 + */ + private String reportAddress; + /** + * 图片列表 + */ + private List imgList; + /** + * 处理进展列表(返回的是按时间升序的集合) + */ + private List processList; + + @Data + public static class processDTO{ + @JsonIgnore + private String processId; + /** + * 处理部门名称 + */ + private String handleDeptName; + /** + * 公开处理意见 + */ + private String suggestion; + /** + * 处理时间:yyyy-MM-dd HH:mm:ss + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + private Date reponseTime; + /** + * 关闭:close; 回应 response,结案closed_case,退回return,部门流转transfer,创建项目created + */ + private String operation; + /** + * 被吹哨部门;如果是多个以逗号隔开返给前端。 + */ + private String whistleDeptName; + + private List attachments; + + @Data + public static class AttachmentDTO{ + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件名 + */ + private String fileName; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 附件大小 字节为单位 + */ + private String attachmentSize; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) + */ + private String attachmentFormat; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + /** + * url地址 + */ + private String attachmentUrl; + @JsonInclude(JsonInclude.Include.NON_NULL) + /** + * 语音或视频时长,秒 + */ + private String duration; + } + } +} diff --git a/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java new file mode 100644 index 0000000000..839870a4ab --- /dev/null +++ b/epmet-module/data-report/data-report-client/src/main/java/com/epmet/evaluationindex/screen/dto/result/ScreenProjectDistributionResultDTO.java @@ -0,0 +1,32 @@ +package com.epmet.evaluationindex.screen.dto.result; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 15:26 + */ +@Data +public class ScreenProjectDistributionResultDTO implements Serializable { + private static final long serialVersionUID = 1L; + /** + * 主键id + */ + private String id; + /** + * 项目标题 + */ + private String projectTitle; + /** + * 项目等级 1:红色事件;2:黄色事件;3:绿色事件 + */ + private String level; + /** + * 经纬度 + */ + private String longitude; + private String latitude; +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java index 8d00c29f2f..6462fa61ec 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/controller/screen/ScreenProjectController.java @@ -3,10 +3,14 @@ package com.epmet.datareport.controller.screen; import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.validator.ValidatorUtils; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import oracle.jdbc.proxy.annotation.Post; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @@ -37,6 +41,25 @@ public class ScreenProjectController { return new Result().ok(screenProjectService.projectDetail(projectDetailFormDTO)); } + /** + * @Description 中央区事件分析-项目分布 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/24 16:10 + */ + @PostMapping("projectdistribution") + public Result projectDistribution(@RequestBody ScreenProjectDistributionFormDTO formDTO){ + if (StringUtils.isBlank(formDTO.getAreaCode()) && StringUtils.isBlank(formDTO.getAgencyId())){ + formDTO.setAreaCode("370124"); + } + return screenProjectService.projectDistribution(formDTO); + } + + @PostMapping("projectdetail") + public Result projectDetail(@RequestBody ScreenProjectDetailFormDTO formDTO){ + return screenProjectService.projectDistributionDetail(formDTO); + } /** * 【事件分析】类型分析 * @author zhaoqifeng diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java new file mode 100644 index 0000000000..6ac5ef48ea --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -0,0 +1,24 @@ +package com.epmet.datareport.dao.evaluationindex.screen; + +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface ScreenProjectDataDao { + + List projectDistribution(@Param("agencyId") String agencyId, @Param("ids") List ids, @Param("level") String level); + + List selectIdsByAreaCode(@Param("areaCode") String areaCode); + + List projectDistributionDetail(@Param("projectId") String projectId); + + List selectProjectImgs(@Param("projectId") String projectId); + + List selectProjectProcess(@Param("projectId") String projectId); + + List selectProjectProcessAttachments(@Param("processId") String processId); +} diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java index aa39e9345a..b4b0fe8725 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/ScreenProjectService.java @@ -1,5 +1,8 @@ package com.epmet.datareport.service.evaluationindex.screen; +import com.epmet.commons.tools.utils.Result; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; @@ -33,4 +36,7 @@ public interface ScreenProjectService { */ List categoryAnalysis(String customerId, CategoryAnalysisFormDTO formDTO); + Result projectDistribution(ScreenProjectDistributionFormDTO formDTO); + + Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO); } diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java index 63111dd7f0..780df28bd5 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/ScreenProjectServiceImpl.java @@ -1,16 +1,23 @@ package com.epmet.datareport.service.evaluationindex.screen.impl; import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.tools.utils.Result; import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.DataSourceConstant; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenEventImgDataDao; import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectCategoryOrgDailyDao; +import com.epmet.datareport.dao.evaluationindex.screen.ScreenProjectDataDao; import com.epmet.datareport.service.evaluationindex.screen.ScreenProjectService; import com.epmet.dto.form.screen.CategoryAnalysisFormDTO; import com.epmet.dto.result.screen.CategoryAnalysisResultDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDetailFormDTO; +import com.epmet.evaluationindex.screen.dto.form.ScreenProjectDistributionFormDTO; import com.epmet.evaluationindex.screen.dto.form.ProjectDetailFormDTO; import com.epmet.evaluationindex.screen.dto.result.ProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDetailResultDTO; +import com.epmet.evaluationindex.screen.dto.result.ScreenProjectDistributionResultDTO; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -31,6 +38,9 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { private ScreenEventDataDao screenEventDataDao; @Autowired private ScreenEventImgDataDao screenEventImgDataDao; + @Autowired + private ScreenProjectDataDao screenProjectDataDao; + @Autowired private ScreenProjectCategoryOrgDailyDao screenProjectCategoryOrgDailyDao; @@ -52,6 +62,43 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { return projectDetailResultDTO; } + /** + * @Description 中央区事件分析-项目分布 + * @param formDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/24 15:25 + */ + @Override + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public Result projectDistribution(ScreenProjectDistributionFormDTO formDTO) { + List areaIds = null; + if (StringUtils.isNotBlank(formDTO.getAreaCode())){ + areaIds = screenProjectDataDao.selectIdsByAreaCode(formDTO.getAreaCode()); + } + List resultDTOS = screenProjectDataDao.projectDistribution(formDTO.getAgencyId(),areaIds,formDTO.getLevel()); + return new Result().ok(resultDTOS); + } + + @Override + public Result projectDistributionDetail(ScreenProjectDetailFormDTO formDTO) { + List resultDTOS = screenProjectDataDao.projectDistributionDetail(formDTO.getProjectId()); + resultDTOS.forEach(item -> { + //项目图片 + List imgList = screenProjectDataDao.selectProjectImgs(formDTO.getProjectId()); + item.setImgList(imgList); + //项目处理流程 + List processDTOS = screenProjectDataDao.selectProjectProcess(formDTO.getProjectId()); + //流程附件 + processDTOS.forEach(processDTO -> { + List attachmentDTOS = screenProjectDataDao.selectProjectProcessAttachments(processDTO.getProcessId()); + processDTO.setAttachments(attachmentDTOS); + }); + item.setProcessList(processDTOS); + }); + return new Result().ok(resultDTOS); + } + /** * 【事件分析】类型分析 * @@ -66,4 +113,4 @@ public class ScreenProjectServiceImpl implements ScreenProjectService { String dateId = DateUtils.format(new Date(), DateUtils.DATE_PATTERN_YYYYMMDD); return screenProjectCategoryOrgDailyDao.selectCategoryAnalysis(formDTO.getAgencyId(), dateId); } -} \ No newline at end of file +} diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml new file mode 100644 index 0000000000..ddf23a8bb0 --- /dev/null +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenProjectDataDao.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..b638f53197 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectDataDTO.java @@ -0,0 +1,172 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +import java.math.BigDecimal; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 事件名称 + */ + private String projectTitle; + + /** + * 事件时间 + */ + private Date projectCreateTime; + + /** + * 上报人 + */ + private String linkName; + + /** + * 电话 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String projectContent; + + /** + * 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + */ + private Integer projectLevel; + + /** + * 事件地址 + */ + private String projectAddress; + + /** + * 所有分类名,用 - 连接 + */ + private String allCategoryName; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 事件状态key pending:处理中 已结案:closed_case ;已关闭:closed + */ + private String projectStatusCode; + + /** + * 结案日期 + */ + private String closeCaseTime; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} 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 new file mode 100644 index 0000000000..b175d7a41d --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectImgDataDTO.java @@ -0,0 +1,91 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectImgDataDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * ID 主键 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 图片图片地址 + */ + private String projectImgUrl; + + /** + * 排序 + */ + private Integer sort; + + /** + * 删除标识 0未删除;1已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java new file mode 100644 index 0000000000..7655456484 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessAttachmentDTO.java @@ -0,0 +1,136 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectProcessAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 附件id + */ + private String attachmentId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表ID + */ + private String processId; + + /** + * 文件所属位置(内部备注: internal 公开答复:public) + */ + private String filePlace; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) + */ + private String attachmentFormat; + + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * url地址 + */ + private String attachmentUrl; + + /** + * 排序(需求确定,按上传顺序排序) + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} 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 new file mode 100644 index 0000000000..efb46d4387 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/ScreenProjectProcessDTO.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.screen; + +import java.io.Serializable; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import org.springframework.format.annotation.DateTimeFormat; + + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +public class ScreenProjectProcessDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 唯一标识 + */ + private String id; + + /** + * 客户ID + */ + private String customerId; + + /** + * 处理进展id + */ + private String processId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 被流转的部门名称 + */ + private String transferDeptName; + + /** + * 被流转的部门名称 + */ + private String transferDeptIds; + + /** + * 处理者名称 + */ + private String handlerName; + + /** + * 处理者类型 未知unknown,机关agency,部门department,网格grid + */ + private String handlerType; + + /** + * 处理者ID + */ + private String handlerId; + + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 回应 response,结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 处理时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8") + private Date processTime; + + /** + * 删除标识:0.未删除 1.已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + + /** + * 数据截止日期 + */ + private String DataEndTime; + +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java new file mode 100644 index 0000000000..2365ec57f0 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectDataInfoFormDTO.java @@ -0,0 +1,112 @@ +package com.epmet.dto.screen.form; + +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/23 17:30 + */ +@Data +public class ScreenProjectDataInfoFormDTO implements Serializable { + private static final long serialVersionUID = 1L; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 事件名称 + */ + private String projectTitle; + + /** + * 事件时间 + */ + private String projectCreateTime; + + /** + * 上报人 + */ + private String linkName; + + /** + * 电话 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String projectContent; + + /** + * 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + */ + private Integer projectLevel; + + /** + * 事件地址 + */ + private String projectAddress; + + /** + * 所有分类名,用 - 连接 + */ + private String allCategoryName; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 事件状态key pending:处理中 已结案:closed_case ;已关闭:closed + */ + private String projectStatusCode; + + /** + * 结案日期 + */ + private String closeCaseTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + + /** + * 议题图片地址 + */ + private String[] projectImgUrl; +} diff --git a/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java new file mode 100644 index 0000000000..e8a72eadbd --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-client/src/main/java/com/epmet/dto/screen/form/ScreenProjectProcessFormDTO.java @@ -0,0 +1,20 @@ +package com.epmet.dto.screen.form; + +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @description: + * @author: liushaowen + * @date: 2021/2/24 14:06 + */ +@Data +public class ScreenProjectProcessFormDTO extends ScreenProjectProcessDTO implements Serializable{ + private static final long serialVersionUID = 1L; + + private List attachments; +} 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 ce5b55a305..cfb2a30536 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 @@ -3,6 +3,8 @@ package com.epmet.controller; import com.epmet.commons.tools.exception.ValidateException; import com.epmet.commons.tools.utils.Result; 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; @@ -37,6 +39,10 @@ public class ScreenProjectDataCollController { private ScreenProjectCategoryGridDailyService projectCategoryGridDailyService; @Autowired private ScreenProjectCategoryOrgDailyService projectCategoryOrgDailyService; + @Autowired + private ScreenProjectDataService projectDataService; + @Autowired + private ScreenProjectProcessService projectProcessService; /** * @author wangc @@ -125,4 +131,35 @@ public class ScreenProjectDataCollController { return new Result(); } //上述两个接口可以有采集接口方便灌假数。后面项目分类统计两个方案A:从项目信息中分析计算到大屏表; B:下面三个子客户(榆山街道、孔村街道、锦水街道)单独上报;子客户根据area_code计算 + + /** + * @Description 项目信息上报 + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/23 17:25 + */ + @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不能为空且dataId不能为空"); + } + projectDataService.collect(customerId,param); + return new Result(); + } + + /** + * @Description 项目处理进展上报 + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2021/2/23 17:25 + */ + @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); + return new Result(); + } + } 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 new file mode 100644 index 0000000000..b1cea20772 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectDataDao.java @@ -0,0 +1,39 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.screen.form.ScreenProjectDataInfoFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectDataEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectDataDao extends BaseDao { + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId,@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 new file mode 100644 index 0000000000..2c4039af04 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectImgDataDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectImgDataDao extends BaseDao { + +} 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 new file mode 100644 index 0000000000..d4650815f5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessAttachmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectProcessAttachmentDao extends BaseDao { + +} 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 new file mode 100644 index 0000000000..4ad6a11e69 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/screen/ScreenProjectProcessDao.java @@ -0,0 +1,35 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dao.evaluationindex.screen; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Mapper +public interface ScreenProjectProcessDao extends BaseDao { + + int deleteByDateIdAndCustomerId(@Param("customerId") String customerId, @Param("dateId") String dateId); +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java new file mode 100644 index 0000000000..f58769cfe1 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectDataEntity.java @@ -0,0 +1,142 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.math.BigDecimal; +import java.util.Date; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_data") +public class ScreenProjectDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户Id + */ + private String customerId; + + /** + * 组织类别 agency:组织;部门:department;网格:grid + */ + private String orgType; + + /** + * 组织Id 可以为网格,机关id + */ + private String orgId; + + /** + * 上级组织Id + */ + private String parentId; + + /** + * 组织名称 + */ + private String orgName; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 事件名称 + */ + private String projectTitle; + + /** + * 事件时间 + */ + private String projectCreateTime; + + /** + * 上报人 + */ + private String linkName; + + /** + * 电话 + */ + private String linkMobile; + + /** + * 事件描述 + */ + private String projectContent; + + /** + * 事件级别 红色1级:已超期;黄色2级:即将超期;绿色3级:未超期 + */ + private Integer projectLevel; + + /** + * 事件地址 + */ + private String projectAddress; + + /** + * 所有分类名,用 - 连接 + */ + private String allCategoryName; + + /** + * 事件所在经度 + */ + private BigDecimal longitude; + + /** + * 事件所在维度 + */ + private BigDecimal latitude; + + /** + * 事件状态key + */ + private String projectStatusCode; + + /** + * 结案日期 + */ + private String closeCaseTime; + + /** + * 数据更新至: yyyy|yyyMM|yyyyMMdd + */ + private String dataEndTime; + + /** + * 所有上级ID,用英文逗号分开 + */ + private String allParentIds; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java new file mode 100644 index 0000000000..dba5258e51 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectImgDataEntity.java @@ -0,0 +1,61 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_img_data") +public class ScreenProjectImgDataEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 原始事件Id + */ + private String projectId; + + /** + * 图片图片地址 + */ + private String projectImgUrl; + + /** + * 排序 + */ + private Integer sort; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java new file mode 100644 index 0000000000..41e9313679 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessAttachmentEntity.java @@ -0,0 +1,106 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_process_attachment") +public class ScreenProjectProcessAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 附件id + */ + private String attachmentId; + + /** + * 客户ID + */ + private String customerId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 项目进展表ID + */ + private String processId; + + /** + * 文件所属位置(内部备注: internal 公开答复:public) + */ + private String filePlace; + + /** + * 文件名 + */ + private String fileName; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件大小,单位b + */ + private Integer attachmentSize; + + /** + * 文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV) + */ + private String attachmentFormat; + + /** + * 文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * url地址 + */ + private String attachmentUrl; + + /** + * 排序(需求确定,按上传顺序排序) + */ + private Integer sort; + + /** + * 语音或视频时长,秒 + */ + private Integer duration; + +} diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java new file mode 100644 index 0000000000..e8b3fbb134 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/entity/evaluationindex/screen/ScreenProjectProcessEntity.java @@ -0,0 +1,110 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.entity.evaluationindex.screen; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("screen_project_process") +public class ScreenProjectProcessEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户ID + */ + private String customerId; + + /** + * 处理进展id + */ + private String processId; + + /** + * 项目ID + */ + private String projectId; + + /** + * 被流转的部门名称 + */ + private String transferDeptName; + + /** + * 被流转的部门名称 + */ + private String transferDeptIds; + + /** + * 处理者名称 + */ + private String handlerName; + + /** + * 处理者类型 未知unknown,机关agency,部门department,网格grid + */ + private String handlerType; + + /** + * 处理者ID + */ + private String handlerId; + + /** + * 所属机关(11:22:33) + */ + private String orgIdPath; + + /** + * 回应 response,结案close,退回return,部门流转transfer,创建项目created + */ + private String operation; + + /** + * 公开答复 + */ + private String publicReply; + + /** + * 内部备注 + */ + private String internalRemark; + + /** + * 处理时间 + */ + private Date processTime; + + /** + * 数据截止日期 + */ + private String DataEndTime; +} 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 new file mode 100644 index 0000000000..82d296a1a3 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectDataService.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +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.ScreenProjectDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectDataDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + void collect(String customerId, ScreenCollFormDTO param); +} 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 new file mode 100644 index 0000000000..eba2c666d8 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectImgDataService.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectImgDataDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectImgDataEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectImgDataService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectImgDataDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectImgDataDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectImgDataDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectImgDataDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + +} 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 new file mode 100644 index 0000000000..de086e33a2 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessAttachmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessAttachmentEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectProcessAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectProcessAttachmentDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectProcessAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectProcessAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectProcessAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); +} 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 new file mode 100644 index 0000000000..f4b050fe13 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/ScreenProjectProcessService.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; +import com.epmet.dto.screencoll.ScreenCollFormDTO; +import com.epmet.entity.evaluationindex.screen.ScreenProjectProcessEntity; + +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +public interface ScreenProjectProcessService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2021-02-23 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2021-02-23 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return ScreenProjectProcessDTO + * @author generator + * @date 2021-02-23 + */ + ScreenProjectProcessDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void save(ScreenProjectProcessDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2021-02-23 + */ + void update(ScreenProjectProcessDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2021-02-23 + */ + void delete(String[] ids); + + void collect(String customerId, ScreenCollFormDTO param); +} 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 new file mode 100644 index 0000000000..b826fd1f6e --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectDataServiceImpl.java @@ -0,0 +1,222 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.dynamic.datasource.annotation.DataSource; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.NumConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.constant.DataSourceConstant; +import com.epmet.dao.evaluationindex.screen.*; +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 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 javax.annotation.Resource; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Date; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectDataServiceImpl extends BaseServiceImpl implements ScreenProjectDataService { + + @Resource + private ScreenProjectImgDataDao screenProjectImgDataDao; + @Resource + private ScreenCustomerAgencyDao agencyDao; + @Resource + private ScreenCustomerDeptDao deptDao; + @Resource + private ScreenCustomerGridDao gridDao; + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectDataDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectDataDTO get(String id) { + ScreenProjectDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectDataDTO dto) { + ScreenProjectDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectDataDTO dto) { + ScreenProjectDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectDataEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public void collect(String customerId, ScreenCollFormDTO param) { + if (param.getIsFirst()) { + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + } + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + Date today = new Date(); + param.getDataList().forEach(item -> { + String projectStatusCode = item.getProjectStatusCode(); + + //todo 动态获取超时时间 + //如果结案 结案时间立项时间; + if ("closed_case".equals(projectStatusCode)) { + try { + Date createTime = sdf.parse(item.getProjectCreateTime()); + Date closeCaseTime = sdf.parse(item.getCloseCaseTime()); + + if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) { + //如果结案时间-立项时间小于等于4天 未超期 level3 + item.setProjectLevel(3); + } else if (closeCaseTime.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) { + //如果结案时间-立项时间大于4天小于5天 即将超期 level2 + item.setProjectLevel(2); + } else { + //大于5天 已超期 level1 + item.setProjectLevel(1); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } else if ("pending".equals(projectStatusCode)) { + //如果处理中 当前时间-立项时间; + try { + Date createTime = sdf.parse(item.getProjectCreateTime()); + + if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 4) { + //如果当前时间-立项时间小于等于4天 未超期 level3 + item.setProjectLevel(3); + } else if (today.getTime() - createTime.getTime() <= 1000 * 60 * 60 * 24 * 5) { + //如果当前时间-立项时间大于4天小于5天 即将超期 level2 + item.setProjectLevel(2); + } else { + //大于5天 已超期 level1 + item.setProjectLevel(1); + } + } catch (ParseException e) { + e.printStackTrace(); + } + } + //先删除该projectId对应的旧数据 + QueryWrapper deleteWrapper = new QueryWrapper<>(); + deleteWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + baseDao.delete(deleteWrapper); + QueryWrapper screenProjectImgDataEntityQueryWrapper = new QueryWrapper<>(); + screenProjectImgDataEntityQueryWrapper.eq(StringUtils.isNotBlank(item.getProjectId()), "project_id", item.getProjectId()) + .eq(StringUtils.isNotBlank(customerId), "customer_id", customerId); + screenProjectImgDataDao.delete(screenProjectImgDataEntityQueryWrapper); + + //如果orgType未知,获取一下 +// if ("unknown".equals(item.getOrgType())){ +// ScreenCustomerAgencyEntity screenCustomerAgencyEntity = agencyDao.selectById(item.getOrgId()); +// if (screenCustomerAgencyEntity != null){ +// item.setOrgType("agency"); +// }else { +// ScreenCustomerDeptEntity screenCustomerDeptEntity = deptDao.selectById(item.getOrgId()); +// if (screenCustomerDeptEntity!=null){ +// item.setOrgType("department"); +// }else { +// ScreenCustomerGridEntity screenCustomerGridEntity = gridDao.selectById(item.getOrgId()); +// if (screenCustomerGridEntity != null){ +// item.setOrgType("grid"); +// } +// } +// } +// } + + //插入项目表 + ScreenProjectDataEntity screenProjectDataEntity = ConvertUtils.sourceToTarget(item, ScreenProjectDataEntity.class); + screenProjectDataEntity.setCustomerId(customerId); + screenProjectDataEntity.setDataEndTime(param.getDateId()); + baseDao.insert(screenProjectDataEntity); + //插入图片表 + String[] projectImgUrl = item.getProjectImgUrl(); + if (ArrayUtils.isNotEmpty(projectImgUrl)) { + for (int i = 0; i < projectImgUrl.length; i++) { + ScreenProjectImgDataEntity screenProjectImgDataEntity = new ScreenProjectImgDataEntity(); + screenProjectImgDataEntity.setCustomerId(customerId); + screenProjectImgDataEntity.setProjectId(item.getProjectId()); + screenProjectImgDataEntity.setProjectImgUrl(projectImgUrl[i]); + screenProjectImgDataEntity.setSort(i); + screenProjectImgDataDao.insert(screenProjectImgDataEntity); + } + } + }); + } + +} 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 new file mode 100644 index 0000000000..3b149b2d37 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectImgDataServiceImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.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.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据图片 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectImgDataServiceImpl extends BaseServiceImpl implements ScreenProjectImgDataService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectImgDataDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectImgDataDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectImgDataDTO get(String id) { + ScreenProjectImgDataEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectImgDataDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectImgDataDTO dto) { + ScreenProjectImgDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectImgDataEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectImgDataDTO dto) { + ScreenProjectImgDataEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectImgDataEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} 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 new file mode 100644 index 0000000000..7219b2ae21 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessAttachmentServiceImpl.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.service.evaluationindex.screen.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.dao.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.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据处理节点附件表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectProcessAttachmentServiceImpl extends BaseServiceImpl implements ScreenProjectProcessAttachmentService { + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectProcessAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectProcessAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectProcessAttachmentDTO get(String id) { + ScreenProjectProcessAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectProcessAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectProcessAttachmentDTO dto) { + ScreenProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectProcessAttachmentDTO dto) { + ScreenProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} 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 new file mode 100644 index 0000000000..1d18eb0b7f --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/screen/impl/ScreenProjectProcessServiceImpl.java @@ -0,0 +1,156 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

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

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

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.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.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.dao.evaluationindex.screen.ScreenProjectProcessDao; +import com.epmet.dto.screen.ScreenProjectProcessAttachmentDTO; +import com.epmet.dto.screen.ScreenProjectProcessDTO; +import com.epmet.dto.screen.form.ScreenProjectProcessFormDTO; +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.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 中央区-项目数据项目处理进展表 + * + * @author qu qu@elink-cn.com + * @since v1.0.0 2021-02-23 + */ +@Service +public class ScreenProjectProcessServiceImpl extends BaseServiceImpl implements ScreenProjectProcessService { + + @Resource + private ScreenProjectProcessAttachmentDao screenProjectProcessAttachmentDao; + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, ScreenProjectProcessDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, ScreenProjectProcessDTO.class); + } + + private QueryWrapper getWrapper(Map params) { + String id = (String) params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public ScreenProjectProcessDTO get(String id) { + ScreenProjectProcessEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, ScreenProjectProcessDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(ScreenProjectProcessDTO dto) { + ScreenProjectProcessEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(ScreenProjectProcessDTO dto) { + ScreenProjectProcessEntity entity = ConvertUtils.sourceToTarget(dto, ScreenProjectProcessEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + @DataSource(value = DataSourceConstant.EVALUATION_INDEX, datasourceNameFromArg = true) + public void collect(String customerId, ScreenCollFormDTO param) { + if (param.getIsFirst()) { + int affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, param.getDateId()); + while (affectedRows > 0) { + affectedRows = baseDao.deleteByDateIdAndCustomerId(customerId, 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(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(item.getProcessId()), "process_id", item.getProcessId()); + screenProjectProcessAttachmentDao.delete(screenProjectProcessAttachmentEntityQueryWrapper); + //插入 + ScreenProjectProcessEntity screenProjectProcessEntity = ConvertUtils.sourceToTarget(item, ScreenProjectProcessEntity.class); + screenProjectProcessEntity.setCustomerId(customerId); + screenProjectProcessEntity.setDataEndTime(param.getDateId()); + baseDao.insert(screenProjectProcessEntity); + + List attachments = item.getAttachments(); + if (!CollectionUtils.isEmpty(attachments)){ + for (int i = 0; i < attachments.size(); i++) { + ScreenProjectProcessAttachmentEntity attachmentEntity = ConvertUtils.sourceToTarget(attachments.get(i), ScreenProjectProcessAttachmentEntity.class); + attachmentEntity.setCustomerId(customerId); + attachmentEntity.setProcessId(item.getProcessId()); + attachmentEntity.setProjectId(item.getProjectId()); + if (attachmentEntity.getSort() == null) { + attachmentEntity.setSort(i); + } + screenProjectProcessAttachmentDao.insert(attachmentEntity); + } + } + }); + + } + +} 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 new file mode 100644 index 0000000000..82e0587dc5 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectDataDao.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + delete from screen_project_data + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + + 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 new file mode 100644 index 0000000000..3604a5df25 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectImgDataDao.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..8560281d3b --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessAttachmentDao.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..06023e11b6 --- /dev/null +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/screen/ScreenProjectProcessDao.xml @@ -0,0 +1,13 @@ + + + + + + + delete from screen_project_process + where customer_id = #{customerId} + and DATA_END_TIME = #{dateId} + limit 1000 + + +