Browse Source

Merge branch 'dev_project_branch' into dev_temp

# Conflicts:
#	epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
dev
sunyuchao 5 years ago
parent
commit
a73eccfbe3
  1. 32
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java
  2. 2
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java
  3. 26
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java
  4. 21
      epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java
  5. 136
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessAttachmentDTO.java
  6. 104
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessScanTaskDTO.java
  7. 42
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/FileDTO.java
  8. 21
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessListV2FormDTO.java
  9. 9
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java
  10. 10
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java
  11. 10
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReturnFromDTO.java
  12. 8
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java
  13. 72
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java
  14. 61
      epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PublicAndInternalFileResultDTO.java
  15. 6
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java
  16. 94
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessAttachmentController.java
  17. 94
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessScanTaskController.java
  18. 59
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java
  19. 45
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessAttachmentDao.java
  20. 9
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessDao.java
  21. 33
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessScanTaskDao.java
  22. 106
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessAttachmentEntity.java
  23. 79
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessScanTaskEntity.java
  24. 95
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessAttachmentExcel.java
  25. 75
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessScanTaskExcel.java
  26. 47
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessAttachmentRedis.java
  27. 47
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessScanTaskRedis.java
  28. 95
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessAttachmentService.java
  29. 95
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessScanTaskService.java
  30. 8
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java
  31. 35
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java
  32. 34
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java
  33. 104
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessAttachmentServiceImpl.java
  34. 104
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessScanTaskServiceImpl.java
  35. 164
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java
  36. 446
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java
  37. 81
      epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java
  38. 41
      epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.5__create_project_attachment.sql
  39. 22
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessAttachmentDao.xml
  40. 16
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml
  41. 8
      epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessScanTaskDao.xml

32
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/controller/OssController.java

@ -272,4 +272,36 @@ public class OssController {
return ossService.extUpload(filse,fileName);
}
/**
* @param file
* @Description 外挂-文件上传
* @Author sun
**/
@PostMapping("uploadvariedfile")
public Result<UploadImgResultDTO> uploadVariedFile(@RequestParam("file") MultipartFile file) {
String fileName = file.getOriginalFilename();
String format = "-" + fileName.substring(fileName.lastIndexOf(".") + NumConstant.ONE) + "-";
//1.校验上传文件类型
if (!ModuleConstant.PROJECT_FILE_CONTENT.contains(format)) {
log.error(String.format("上传文件类型格式错误,暂不支持此类文件上传,文件名->%s", fileName));
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getCode(), EpmetErrorCode.OPER_UPLOAD_FILE_TYPE_ERROR.getMsg());
}
long size = file.getSize();
//2.校验文件体积大小
long maxSize = 0;
if (ModuleConstant.PROJECT_FILE_IMAGE.contains(format)) {//单个图片10M
maxSize = 10 * 1024 * 1024;
} else if (ModuleConstant.PROJECT_FILE_DOC.contains(format)) {//单个文件5M
maxSize = 5 * 1024 * 1024;
} else if (ModuleConstant.PROJECT_FILE_VIDEO.contains(format)) {//单个视频10M
maxSize = 10 * 1024 * 1024;
}
if (size > maxSize) {
throw new RenException(EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getCode(), EpmetErrorCode.OPER_UPLOAD_FILE_OVER_SIZE.getMsg());
}
return ossService.uploadVariedFile(file);
}
}

2
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/OssService.java

@ -31,4 +31,6 @@ public interface OssService extends BaseService<OssEntity> {
Result<UploadImgResultDTO> uploadImg(MultipartFile file);
Result<UploadImgResultDTO> extUpload(MultipartFile file, String fileName);
Result<UploadImgResultDTO> uploadVariedFile(MultipartFile file);
}

26
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/service/impl/OssServiceImpl.java

@ -104,4 +104,30 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement
dto.setUrl(url);
return new Result<UploadImgResultDTO>().ok(dto);
}
@Override
public Result<UploadImgResultDTO> uploadVariedFile(MultipartFile file) {
if (file.isEmpty()) {
return new Result<UploadImgResultDTO>().error(ModuleErrorCode.UPLOAD_FILE_EMPTY);
}
//上传文件
String extension = FilenameUtils.getExtension(file.getOriginalFilename());
String url = null;
try {
url = OssFactory.build().uploadSuffix(file.getBytes(), extension);
} catch (IOException e) {
e.printStackTrace();
logger.error("文件上传异常");
throw new RenException("文件上传异常");
}
//保存文件信息
OssEntity ossEntity = new OssEntity();
ossEntity.setUrl(url);
baseDao.insert(ossEntity);
//文件信息
UploadImgResultDTO dto = new UploadImgResultDTO();
dto.setUrl(url);
return new Result<UploadImgResultDTO>().ok(dto);
}
}

21
epmet-module/epmet-oss/epmet-oss-server/src/main/java/com/epmet/utils/ModuleConstant.java

@ -26,4 +26,25 @@ public interface ModuleConstant extends Constant {
* jpg文件类型
*/
String FILE_CONTENT_TYPE_JPG = "image/jpg";
/**
* 项目附件-允许上传的文件类型
*/
String PROJECT_FILE_CONTENT = "-jpg-png-jpeg-bmp-gif-pdf-ppt-pptx-doc-docx-xls-xlsx-mp4-avi-mov-rmvb-rm-wmv-";
/**
* 项目附件-允许的图片类型
*/
String PROJECT_FILE_IMAGE = "-jpg-png-jpeg-bmp-gif-";
/**
* 项目附件-允许的文件类型
*/
String PROJECT_FILE_DOC = "-pdf-ppt-pptx-doc-docx-xls-xlsx-";
/**
* 项目附件-允许的音频类型
*/
String PROJECT_FILE_VOICE = "-mp3-wma-m4a-";
/**
* 项目附件-允许的视频类型
*/
String PROJECT_FILE_VIDEO = "-mp4-avi-mov-rmvb-rm-wmv-";
}

136
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessAttachmentDTO.java

@ -0,0 +1,136 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Data
public class ProjectProcessAttachmentDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
* 项目进展表ID
*/
private String processId;
/**
* 文件所属内容(内部备注: public 公开答复:internal)
*/
private String filePlace;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
/**
* 排序(需求确定按上传顺序排序)
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 是否强制发布(0: 1:)
*/
private Integer isRelease;
/**
* 删除标识0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建人
*/
private String createdBy;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

104
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/ProjectProcessScanTaskDTO.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dto;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Data
public class ProjectProcessScanTaskDTO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 唯一标识
*/
private String id;
/**
* 客户ID
*/
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
* 项目进展表project_processID
*/
private String processId;
/**
* 项目附件表主键对应dataId
*/
private String projectProcessAttachmentId;
/**
* 阿里云审核任务Id
*/
private String taskId;
/**
* 审核状态auditing: 审核中
auto_passed: 自动通过
review结果不确定需要人工审核
block: 结果违规
*/
private String status;
/**
* 附件类型视频 - video 语音 - voice 文件 - doc
*/
private String attachmentType;
/**
* 删除标识0.未删除 1.已删除
*/
private String delFlag;
/**
* 乐观锁
*/
private Integer revision;
/**
* 创建时间
*/
private Date createdTime;
/**
* 更新人
*/
private String updatedBy;
/**
* 更新时间
*/
private Date updatedTime;
}

42
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/FileDTO.java

@ -0,0 +1,42 @@
package com.epmet.dto.form;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.io.Serializable;
/**
* @author zhaoqifeng
* @dscription
* @date 2020/12/21 15:37
*/
@NoArgsConstructor
@Data
public class FileDTO implements Serializable {
private static final long serialVersionUID = -5307959406648243353L;
/**
* 文件名
*/
private String name;
/**
* url地址
*/
private String url;
/**
* 文件类型(图片 - image 视频 - video 语音 - voice 文档 - doc)
*/
private String type;
/**
* 后缀名
*/
private String format;
/**
* 文件大小 kb
*/
private Integer size;
/**
* 语音或视频文件时长单位秒
*/
private Integer duration;
}

21
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProcessListV2FormDTO.java

@ -0,0 +1,21 @@
package com.epmet.dto.form;
import lombok.Data;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/12/21 下午3:24
*/
@Data
public class ProcessListV2FormDTO implements Serializable {
private static final long serialVersionUID = -7922290706507984148L;
public interface ProcessListV2Form{}
@NotBlank(message = "项目ID不能为空",groups = {ProcessListV2Form.class})
private String projectId;
}

9
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectClosedFromDTO.java

@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
@ -46,4 +47,12 @@ public class ProjectClosedFromDTO implements Serializable {
* 部门名
*/
private String departmentName;
/**
* 公开答复对应文件集合
*/
private List<FileDTO> publicFile;
/**
* 内部备注对应文件集合
*/
private List<FileDTO> internalFile;
}

10
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ProjectResponseFormDTO.java

@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
@ -45,4 +46,13 @@ public class ProjectResponseFormDTO implements Serializable {
* 部门名
*/
private String departmentName;
/**
* 公开答复对应文件集合
*/
private List<FileDTO> publicFile;
/**
* 内部备注对应文件集合
*/
private List<FileDTO> internalFile;
}

10
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/ReturnFromDTO.java

@ -5,6 +5,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaoqifeng
@ -46,4 +47,13 @@ public class ReturnFromDTO implements Serializable {
* 部门名
*/
private String departmentName;
/**
* 公开答复对应文件集合
*/
private List<FileDTO> publicFile;
/**
* 内部备注对应文件集合
*/
private List<FileDTO> internalFile;
}

8
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/form/TransferFormDTO.java

@ -32,5 +32,13 @@ public class TransferFormDTO implements Serializable {
@Valid
private List<TickStaffFormDTO> staffList;
/**
* 公开答复对应文件集合
*/
private List<FileDTO> publicFile;
/**
* 内部备注对应文件集合
*/
private List<FileDTO> internalFile;
}

72
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/ProcessListV2ResultDTO.java

@ -0,0 +1,72 @@
package com.epmet.dto.result;
import lombok.Data;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
/**
* @Author zxc
* @DateTime 2020/12/21 下午3:31
*/
@Data
public class ProcessListV2ResultDTO implements Serializable {
/**
* 项目ID
*/
private String projectId;
/**
* 进展Id
*/
private String processId;
/**
* 处理进展名称
*/
private String processName;
/**
* 处理进展时间
*/
private Long processTime;
/**
* 处理部门
*/
private String departmentName;
/**
* 公开答复
*/
private String publicReply;
/**
* 内部备注
*/
private String internalRemark;
/**
*
*/
private List<PublicAndInternalFileResultDTO> publicFile;
/**
*
*/
private List<PublicAndInternalFileResultDTO> internalFile;
public ProcessListV2ResultDTO() {
this.projectId = "";
this.processId = "";
this.processName = "";
this.processTime = 0L;
this.departmentName = "";
this.publicReply = "";
this.internalRemark = "";
this.publicFile = new ArrayList<>();
this.internalFile = new ArrayList<>();
}
}

61
epmet-module/gov-project/gov-project-client/src/main/java/com/epmet/dto/result/PublicAndInternalFileResultDTO.java

@ -0,0 +1,61 @@
package com.epmet.dto.result;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import java.io.Serializable;
/**
* @Author zxc
* @DateTime 2020/12/21 下午3:44
*/
@Data
public class PublicAndInternalFileResultDTO implements Serializable {
private static final long serialVersionUID = -4258868880494403603L;
/**
* 文件名
*/
private String name;
/**
* url地址
*/
private String url;
/**
* 文件类型(图片 - image 视频 - video 语音 - voice 文档 - doc)
*/
private String type;
/**
* 后缀名
*/
private String format;
/**
* 文件大小 kb
*/
private Integer size;
/**
* 语音或视频文件时长单位秒
*/
private Long duration;
@JsonIgnore
private String processId;
@JsonIgnore
private String filePlace;
public PublicAndInternalFileResultDTO() {
this.name = "";
this.url = "";
this.type = "";
this.format = "";
this.size = 0;
this.duration = 0L;
}
}

6
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/constant/ProjectConstant.java

@ -152,4 +152,10 @@ public interface ProjectConstant {
* 非精准计算
*/
String IMPRECISE_CALCULATION = "imprecise";
String PUBLIC = "public";
String INTERNAL = "internal";
String NOT_EXIST_PROJECT = "未查询带此项目信息......";
}

94
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessAttachmentController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.ProjectProcessAttachmentDTO;
import com.epmet.excel.ProjectProcessAttachmentExcel;
import com.epmet.service.ProjectProcessAttachmentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@RestController
@RequestMapping("projectprocessattachment")
public class ProjectProcessAttachmentController {
@Autowired
private ProjectProcessAttachmentService projectProcessAttachmentService;
@GetMapping("page")
public Result<PageData<ProjectProcessAttachmentDTO>> page(@RequestParam Map<String, Object> params){
PageData<ProjectProcessAttachmentDTO> page = projectProcessAttachmentService.page(params);
return new Result<PageData<ProjectProcessAttachmentDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ProjectProcessAttachmentDTO> get(@PathVariable("id") String id){
ProjectProcessAttachmentDTO data = projectProcessAttachmentService.get(id);
return new Result<ProjectProcessAttachmentDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ProjectProcessAttachmentDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
projectProcessAttachmentService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ProjectProcessAttachmentDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
projectProcessAttachmentService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
projectProcessAttachmentService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ProjectProcessAttachmentDTO> list = projectProcessAttachmentService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProjectProcessAttachmentExcel.class);
}
}

94
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectProcessScanTaskController.java

@ -0,0 +1,94 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.controller;
import com.epmet.commons.tools.page.PageData;
import com.epmet.commons.tools.utils.ExcelUtils;
import com.epmet.commons.tools.utils.Result;
import com.epmet.commons.tools.validator.AssertUtils;
import com.epmet.commons.tools.validator.ValidatorUtils;
import com.epmet.commons.tools.validator.group.AddGroup;
import com.epmet.commons.tools.validator.group.UpdateGroup;
import com.epmet.commons.tools.validator.group.DefaultGroup;
import com.epmet.dto.ProjectProcessScanTaskDTO;
import com.epmet.excel.ProjectProcessScanTaskExcel;
import com.epmet.service.ProjectProcessScanTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@RestController
@RequestMapping("projectprocessscantask")
public class ProjectProcessScanTaskController {
@Autowired
private ProjectProcessScanTaskService projectProcessScanTaskService;
@GetMapping("page")
public Result<PageData<ProjectProcessScanTaskDTO>> page(@RequestParam Map<String, Object> params){
PageData<ProjectProcessScanTaskDTO> page = projectProcessScanTaskService.page(params);
return new Result<PageData<ProjectProcessScanTaskDTO>>().ok(page);
}
@GetMapping("{id}")
public Result<ProjectProcessScanTaskDTO> get(@PathVariable("id") String id){
ProjectProcessScanTaskDTO data = projectProcessScanTaskService.get(id);
return new Result<ProjectProcessScanTaskDTO>().ok(data);
}
@PostMapping
public Result save(@RequestBody ProjectProcessScanTaskDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class);
projectProcessScanTaskService.save(dto);
return new Result();
}
@PutMapping
public Result update(@RequestBody ProjectProcessScanTaskDTO dto){
//效验数据
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class);
projectProcessScanTaskService.update(dto);
return new Result();
}
@DeleteMapping
public Result delete(@RequestBody String[] ids){
//效验数据
AssertUtils.isArrayEmpty(ids, "id");
projectProcessScanTaskService.delete(ids);
return new Result();
}
@GetMapping("export")
public void export(@RequestParam Map<String, Object> params, HttpServletResponse response) throws Exception {
List<ProjectProcessScanTaskDTO> list = projectProcessScanTaskService.list(params);
ExcelUtils.exportExcelToTarget(response, null, list, ProjectProcessScanTaskExcel.class);
}
}

59
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/controller/ProjectTraceController.java

@ -121,6 +121,13 @@ public class ProjectTraceController {
return new Result();
}
@PostMapping("closeproject-v2")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_CLOSE)
public Result closedV2(@LoginUser TokenDto tokenDto, @RequestBody ProjectClosedFromDTO fromDTO) {
projectTraceService.closedV2(tokenDto, fromDTO);
return new Result();
}
/**
* 可退回节点列表
*
@ -260,5 +267,57 @@ public class ProjectTraceController {
projectTraceService.response(tokenDTO, formDTO);
return new Result();
}
/**
* @Description 项目处理进展列表V2
* @Param formDTO
* @author zxc
* @date 2020/12/21 下午3:55
*/
@PostMapping("processlist-v2")
public Result<List<ProcessListV2ResultDTO>> processListV2(@RequestBody ProcessListV2FormDTO formDTO){
ValidatorUtils.validateEntity(formDTO, ProcessListV2FormDTO.ProcessListV2Form.class);
return new Result<List<ProcessListV2ResultDTO>>().ok(projectTraceService.processListV2(formDTO));
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 项目跟踪-转其他部门2.0接口
**/
@PostMapping("transfer-v2")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER)
public Result transferV2(@LoginUser TokenDto tokenDTO, @RequestBody TransferFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
projectProcessService.transferV2(formDTO);
return new Result();
}
/**
* @param tokenDto fromDTO
* @Description 项目退回V2.0接口
* @author sun
*/
@PostMapping("return-v2")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_RETURN)
public Result projectReturnV2(@LoginUser TokenDto tokenDto, @RequestBody ReturnFromDTO fromDTO) {
projectTraceService.projectReturnV2(tokenDto, fromDTO);
return new Result();
}
/**
* @param tokenDTO fromDTO
* @Description 处理响应V2.0接口
* @author sun
*/
@PostMapping("response-v2")
@RequirePermission(requirePermission = RequirePermissionEnum.WORK_PROJECT_TRACE_TRANSFER)
public Result responseV2(@LoginUser TokenDto tokenDTO, @RequestBody ProjectResponseFormDTO formDTO) {
ValidatorUtils.validateEntity(formDTO);
projectTraceService.responseV2(tokenDTO, formDTO);
return new Result();
}
}

45
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessAttachmentDao.java

@ -0,0 +1,45 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.result.PublicAndInternalFileResultDTO;
import com.epmet.entity.ProjectProcessAttachmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Mapper
public interface ProjectProcessAttachmentDao extends BaseDao<ProjectProcessAttachmentEntity> {
/**
* @Description 根据项目ID查询附件
* @Param projectId
* @author zxc
* @date 2020/12/21 下午4:33
*/
List<PublicAndInternalFileResultDTO> selectAttachByProjectId(@Param("projectId")String projectId);
}

9
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessDao.java

@ -20,6 +20,7 @@ package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.dto.form.ProcessProjectIdFormDTO;
import com.epmet.dto.form.ProjectIdFormDTO;
import com.epmet.dto.result.ProcessListV2ResultDTO;
import com.epmet.dto.result.ProcesslistResultDTO;
import com.epmet.dto.result.ProjectOrgRelationWhenResponseResultDTO;
import com.epmet.dto.result.ProjectProcessListResultDTO;
@ -77,4 +78,12 @@ public interface ProjectProcessDao extends BaseDao<ProjectProcessEntity> {
* @date 2020.09.17 17:56
**/
List<ProjectOrgRelationWhenResponseResultDTO> selectResponseTrace(@Param("projects") List<String> projects);
/**
* @Description 查询项目进展
* @Param projectId
* @author zxc
* @date 2020/12/21 下午4:18
*/
List<ProcessListV2ResultDTO> selectProcessList(@Param("projectId")String projectId);
}

33
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/dao/ProjectProcessScanTaskDao.java

@ -0,0 +1,33 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.dao;
import com.epmet.commons.mybatis.dao.BaseDao;
import com.epmet.entity.ProjectProcessScanTaskEntity;
import org.apache.ibatis.annotations.Mapper;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Mapper
public interface ProjectProcessScanTaskDao extends BaseDao<ProjectProcessScanTaskEntity> {
}

106
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessAttachmentEntity.java

@ -0,0 +1,106 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("project_process_attachment")
public class ProjectProcessAttachmentEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
* 项目进展表ID
*/
private String processId;
/**
* 文件所属内容(内部备注: public 公开答复:internal)
*/
private String filePlace;
/**
* 文件名
*/
private String fileName;
/**
* 附件名uuid随机生成
*/
private String attachmentName;
/**
* 文件大小
*/
private Integer attachmentSize;
/**
* 文件格式JPGPNGJPEGBMPGIFPDFPPTPPTXDOCDOCXXLSXLSXMP3WMAM4AMP4AVIMOVRMVBRMWMV
*/
private String attachmentFormat;
/**
* 文件类型图片 - image 视频 - video 语音 - voice 文档 - doc
*/
private String attachmentType;
/**
* url地址
*/
private String attachmentUrl;
/**
* 排序(需求确定按上传顺序排序)
*/
private Integer sort;
/**
* 语音或视频时长
*/
private Integer duration;
/**
* 是否强制发布(0: 1:)
*/
private Integer isRelease;
}

79
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/entity/ProjectProcessScanTaskEntity.java

@ -0,0 +1,79 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.epmet.commons.mybatis.entity.BaseEpmetEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Data
@EqualsAndHashCode(callSuper=false)
@TableName("project_process_scan_task")
public class ProjectProcessScanTaskEntity extends BaseEpmetEntity {
private static final long serialVersionUID = 1L;
/**
* 客户ID
*/
private String customerId;
/**
* 项目ID
*/
private String projectId;
/**
* 项目进展表project_processID
*/
private String processId;
/**
* 项目附件表主键对应dataId
*/
private String projectProcessAttachmentId;
/**
* 阿里云审核任务Id
*/
private String taskId;
/**
* 审核状态auditing: 审核中
auto_passed: 自动通过
review结果不确定需要人工审核
block: 结果违规
*/
private String status;
/**
* 附件类型视频 - video 语音 - voice 文件 - doc
*/
private String attachmentType;
}

95
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessAttachmentExcel.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Data
public class ProjectProcessAttachmentExcel {
@Excel(name = "唯一标识")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "项目ID")
private String projectId;
@Excel(name = "项目进展表ID")
private String processId;
@Excel(name = "文件所属内容(内部备注: public 公开答复:internal)")
private String filePlace;
@Excel(name = "文件名")
private String fileName;
@Excel(name = "附件名(uuid随机生成)")
private String attachmentName;
@Excel(name = "文件大小")
private Integer attachmentSize;
@Excel(name = "文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV)")
private String attachmentFormat;
@Excel(name = "文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))")
private String attachmentType;
@Excel(name = "url地址")
private String attachmentUrl;
@Excel(name = "排序(需求确定,按上传顺序排序)")
private Integer sort;
@Excel(name = "语音或视频时长,秒")
private Integer duration;
@Excel(name = "是否强制发布(0:否 1:是)")
private Integer isRelease;
@Excel(name = "删除标识:0.未删除 1.已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建人")
private String createdBy;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

75
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/excel/ProjectProcessScanTaskExcel.java

@ -0,0 +1,75 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.excel;
import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import java.util.Date;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Data
public class ProjectProcessScanTaskExcel {
@Excel(name = "唯一标识")
private String id;
@Excel(name = "客户ID")
private String customerId;
@Excel(name = "项目ID")
private String projectId;
@Excel(name = "项目进展表(project_process)ID")
private String processId;
@Excel(name = "项目附件表主键,对应dataId")
private String projectProcessAttachmentId;
@Excel(name = "阿里云审核任务Id")
private String taskId;
@Excel(name = "审核状态【auditing: 审核中; auto_passed: 自动通过;"+
"review:结果不确定,需要人工审核;block: 结果违规;】")
private String status;
@Excel(name = "附件类型(视频 - video、 语音 - voice 文件 - doc)")
private String attachmentType;
@Excel(name = "删除标识:0.未删除 1.已删除")
private String delFlag;
@Excel(name = "乐观锁")
private Integer revision;
@Excel(name = "创建时间")
private Date createdTime;
@Excel(name = "更新人")
private String updatedBy;
@Excel(name = "更新时间")
private Date updatedTime;
}

47
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessAttachmentRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Component
public class ProjectProcessAttachmentRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

47
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/redis/ProjectProcessScanTaskRedis.java

@ -0,0 +1,47 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.redis;
import com.epmet.commons.tools.redis.RedisUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Component
public class ProjectProcessScanTaskRedis {
@Autowired
private RedisUtils redisUtils;
public void delete(Object[] ids) {
}
public void set(){
}
public String get(String id){
return null;
}
}

95
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessAttachmentService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ProjectProcessAttachmentDTO;
import com.epmet.entity.ProjectProcessAttachmentEntity;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
public interface ProjectProcessAttachmentService extends BaseService<ProjectProcessAttachmentEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ProjectProcessAttachmentDTO>
* @author generator
* @date 2020-12-21
*/
PageData<ProjectProcessAttachmentDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ProjectProcessAttachmentDTO>
* @author generator
* @date 2020-12-21
*/
List<ProjectProcessAttachmentDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ProjectProcessAttachmentDTO
* @author generator
* @date 2020-12-21
*/
ProjectProcessAttachmentDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-21
*/
void save(ProjectProcessAttachmentDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-21
*/
void update(ProjectProcessAttachmentDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-21
*/
void delete(String[] ids);
}

95
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessScanTaskService.java

@ -0,0 +1,95 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service;
import com.epmet.commons.mybatis.service.BaseService;
import com.epmet.commons.tools.page.PageData;
import com.epmet.dto.ProjectProcessScanTaskDTO;
import com.epmet.entity.ProjectProcessScanTaskEntity;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
public interface ProjectProcessScanTaskService extends BaseService<ProjectProcessScanTaskEntity> {
/**
* 默认分页
*
* @param params
* @return PageData<ProjectProcessScanTaskDTO>
* @author generator
* @date 2020-12-21
*/
PageData<ProjectProcessScanTaskDTO> page(Map<String, Object> params);
/**
* 默认查询
*
* @param params
* @return java.util.List<ProjectProcessScanTaskDTO>
* @author generator
* @date 2020-12-21
*/
List<ProjectProcessScanTaskDTO> list(Map<String, Object> params);
/**
* 单条查询
*
* @param id
* @return ProjectProcessScanTaskDTO
* @author generator
* @date 2020-12-21
*/
ProjectProcessScanTaskDTO get(String id);
/**
* 默认保存
*
* @param dto
* @return void
* @author generator
* @date 2020-12-21
*/
void save(ProjectProcessScanTaskDTO dto);
/**
* 默认更新
*
* @param dto
* @return void
* @author generator
* @date 2020-12-21
*/
void update(ProjectProcessScanTaskDTO dto);
/**
* 批量删除
*
* @param ids
* @return void
* @author generator
* @date 2020-12-21
*/
void delete(String[] ids);
}

8
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectProcessService.java

@ -151,4 +151,12 @@ public interface ProjectProcessService extends BaseService<ProjectProcessEntity>
**/
List<ProjectOrgRelationWhenResponseResultDTO > selectResponseTrace(List<String> projects);
/**
* @param formDTO
* @return
* @Author sun
* @Description 项目跟踪-转其他部门2.0接口
**/
void transferV2(TransferFormDTO formDTO);
}

35
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectService.java

@ -146,6 +146,15 @@ public interface ProjectService extends BaseService<ProjectEntity> {
*/
void closed(ProjectClosedFromDTO fromDTO);
/**
* 项目结案
* @author zhaoqifeng
* @date 2020/5/13 9:54
* @param fromDTO 参数
* @return void
*/
void closedV2(ProjectClosedFromDTO fromDTO);
/**
* 项目退回
* @author zhaoqifeng
@ -233,4 +242,30 @@ public interface ProjectService extends BaseService<ProjectEntity> {
* @date 2020.11.13 09:12
*/
List<ProjectOfCreateTopicUserResultDTO> listProjectsByCreateTopicUserId(String userId, String customerId, Integer pageNo, Integer pageSize);
/**
* 项目处理节点附件保存
* @author zhaoqifeng
* @date 2020/12/22 9:17
* @param publicFile
* @param internalFile
* @param customerId
* @param projectId
* @param processId
* @return void
*/
void saveFile(List<FileDTO> publicFile, List<FileDTO> internalFile, String customerId, String projectId, String processId);
/**
* @param fromDTO
* @Description 项目退回V2.0接口
*/
void projectReturnV2(ReturnFromDTO fromDTO);
/**
* @param formDTO
* @Description 处理响应V2.0接口
* @author sun
*/
void responseV2(ProjectResponseFormDTO formDTO);
}

34
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/ProjectTraceService.java

@ -1,7 +1,6 @@
package com.epmet.service;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -68,6 +67,17 @@ public interface ProjectTraceService {
*/
void closed(TokenDto tokenDto, ProjectClosedFromDTO fromDTO);
/**
* 项目结案
*
* @param tokenDto token
* @param fromDTO 入参
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2020/5/11 16:27
*/
void closedV2(TokenDto tokenDto, ProjectClosedFromDTO fromDTO);
/**
* 可退回节点列表
*
@ -117,4 +127,26 @@ public interface ProjectTraceService {
* @return void
*/
void response(TokenDto tokenDto, ProjectResponseFormDTO formDTO);
/**
* @Description 项目处理进展列表V2
* @Param formDTO
* @author zxc
* @date 2020/12/21 下午3:55
*/
List<ProcessListV2ResultDTO> processListV2(ProcessListV2FormDTO formDTO);
/**
* @param tokenDto fromDTO
* @Description 项目退回V2.0接口
* @author sun
*/
void projectReturnV2(TokenDto tokenDto, ReturnFromDTO fromDTO);
/**
* @param formDTO
* @Description 处理响应V2.0接口
* @author sun
*/
void responseV2(TokenDto tokenDto, ProjectResponseFormDTO formDTO);
}

104
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessAttachmentServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.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.ProjectProcessAttachmentDao;
import com.epmet.dto.ProjectProcessAttachmentDTO;
import com.epmet.entity.ProjectProcessAttachmentEntity;
import com.epmet.redis.ProjectProcessAttachmentRedis;
import com.epmet.service.ProjectProcessAttachmentService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Service
public class ProjectProcessAttachmentServiceImpl extends BaseServiceImpl<ProjectProcessAttachmentDao, ProjectProcessAttachmentEntity> implements ProjectProcessAttachmentService {
@Autowired
private ProjectProcessAttachmentRedis projectProcessAttachmentRedis;
@Override
public PageData<ProjectProcessAttachmentDTO> page(Map<String, Object> params) {
IPage<ProjectProcessAttachmentEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ProjectProcessAttachmentDTO.class);
}
@Override
public List<ProjectProcessAttachmentDTO> list(Map<String, Object> params) {
List<ProjectProcessAttachmentEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ProjectProcessAttachmentDTO.class);
}
private QueryWrapper<ProjectProcessAttachmentEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ProjectProcessAttachmentEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ProjectProcessAttachmentDTO get(String id) {
ProjectProcessAttachmentEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ProjectProcessAttachmentDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ProjectProcessAttachmentDTO dto) {
ProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessAttachmentEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ProjectProcessAttachmentDTO dto) {
ProjectProcessAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessAttachmentEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

104
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessScanTaskServiceImpl.java

@ -0,0 +1,104 @@
/**
* Copyright 2018 人人开源 https://www.renren.io
* <p>
* 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.
* <p>
* 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.
* <p>
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.epmet.service.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.ProjectProcessScanTaskDao;
import com.epmet.dto.ProjectProcessScanTaskDTO;
import com.epmet.entity.ProjectProcessScanTaskEntity;
import com.epmet.redis.ProjectProcessScanTaskRedis;
import com.epmet.service.ProjectProcessScanTaskService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
/**
* 项目节点附件安全校验任务表
*
* @author generator generator@elink-cn.com
* @since v1.0.0 2020-12-21
*/
@Service
public class ProjectProcessScanTaskServiceImpl extends BaseServiceImpl<ProjectProcessScanTaskDao, ProjectProcessScanTaskEntity> implements ProjectProcessScanTaskService {
@Autowired
private ProjectProcessScanTaskRedis projectProcessScanTaskRedis;
@Override
public PageData<ProjectProcessScanTaskDTO> page(Map<String, Object> params) {
IPage<ProjectProcessScanTaskEntity> page = baseDao.selectPage(
getPage(params, FieldConstant.CREATED_TIME, false),
getWrapper(params)
);
return getPageData(page, ProjectProcessScanTaskDTO.class);
}
@Override
public List<ProjectProcessScanTaskDTO> list(Map<String, Object> params) {
List<ProjectProcessScanTaskEntity> entityList = baseDao.selectList(getWrapper(params));
return ConvertUtils.sourceToTarget(entityList, ProjectProcessScanTaskDTO.class);
}
private QueryWrapper<ProjectProcessScanTaskEntity> getWrapper(Map<String, Object> params){
String id = (String)params.get(FieldConstant.ID_HUMP);
QueryWrapper<ProjectProcessScanTaskEntity> wrapper = new QueryWrapper<>();
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id);
return wrapper;
}
@Override
public ProjectProcessScanTaskDTO get(String id) {
ProjectProcessScanTaskEntity entity = baseDao.selectById(id);
return ConvertUtils.sourceToTarget(entity, ProjectProcessScanTaskDTO.class);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void save(ProjectProcessScanTaskDTO dto) {
ProjectProcessScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessScanTaskEntity.class);
insert(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void update(ProjectProcessScanTaskDTO dto) {
ProjectProcessScanTaskEntity entity = ConvertUtils.sourceToTarget(dto, ProjectProcessScanTaskEntity.class);
updateById(entity);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void delete(String[] ids) {
// 逻辑删除(@TableLogic 注解)
baseDao.deleteBatchIds(Arrays.asList(ids));
}
}

164
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectProcessServiceImpl.java

@ -523,4 +523,168 @@ public class ProjectProcessServiceImpl extends BaseServiceImpl<ProjectProcessDao
return baseDao.selectResponseTrace(projects);
}
/**
* @param formDTO
* @return
* @Author sun
* @Description 项目跟踪-转其他部门2.0接口
**/
@Override
@Transactional(rollbackFor = Exception.class)
public void transferV2(TransferFormDTO formDTO) {
//公开回复内容审核
if (StringUtils.isNotBlank(formDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(formDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//1:更新项目人员关联表数据状态为已处理
ProjectStaffEntity staffEntity = projectStaffDao.selectById(formDTO.getProjectStaffId());
if (null == staffEntity) {
throw new RenException(ProjectConstant.SELECT_PROJECTSTAFF_EXCEPTION);
}
if (!ProjectConstant.UNHANDLED.equals(staffEntity.getIsHandle())) {
throw new RenException(ProjectConstant.UNHANDLED_EXCEPTION);
}
staffEntity.setIsHandle(ProjectConstant.HANDLE);
if (projectStaffDao.updateById(staffEntity) < NumConstant.ONE) {
throw new RenException(ProjectConstant.UPDATE_PROJECTSTAFF_EXCEPTION);
}
//2:项目处理进展列表新增数据
ProjectProcessEntity processEntity = ConvertUtils.sourceToTarget(formDTO, ProjectProcessEntity.class);
processEntity.setCustomerId(staffEntity.getCustomerId());
processEntity.setDepartmentName(staffEntity.getDepartmentName());
processEntity.setStaffId(staffEntity.getStaffId());
processEntity.setOperation(ProjectConstant.OPERATION_TRANSFER);
processEntity.setOperationName(ProjectConstant.OPERATION_TRANSFER_NAME);
processEntity.setAgencyId(staffEntity.getOrgId());
processEntity.setDepartmentId(staffEntity.getDepartmentId());
processEntity.setGridId(staffEntity.getGridId());
processEntity.setOrgIdPath(staffEntity.getOrgIdPath());
projectProcessDao.insert(processEntity);
//2-1.项目附件表新增数据
if (formDTO.getPublicFile().size() > NumConstant.ZERO || formDTO.getInternalFile().size() > NumConstant.ZERO) {
projectService.saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), staffEntity.getCustomerId(), formDTO.getProjectId(), processEntity.getId());
}
//3:项目人员关联表新增部门流转数据
List<TickStaffFormDTO> staffList = formDTO.getStaffList();
if (null == staffList || staffList.size() < NumConstant.ONE) {
throw new RenException(ProjectConstant.DATE_EXCEPTION);
}
//3.1:调用gov-org服务,获取所有勾选人员对应的组织信息、部门信息、网格信息用于对处理部门和ORG_ID_PATH字段的赋值
List<String> agencyIdList = staffList.stream().map(TickStaffFormDTO::getAgencyId).collect(Collectors.toList());
agencyIdList = new ArrayList<String>(new LinkedHashSet<>(agencyIdList));agencyIdList.removeAll(Collections.singleton(""));
List<String> deptIdList = staffList.stream().map(TickStaffFormDTO::getDepartmentId).collect(Collectors.toList());
deptIdList = new ArrayList<String>(new LinkedHashSet<>(deptIdList));deptIdList.removeAll(Collections.singleton(""));
List<String> gridIdList = staffList.stream().map(TickStaffFormDTO::getGridId).collect(Collectors.toList());
gridIdList = new ArrayList<String>(new LinkedHashSet<>(gridIdList));gridIdList.removeAll(Collections.singleton(""));
AgencyDeptGridFormDTO agencyDeptGridFormDTO = new AgencyDeptGridFormDTO();
agencyDeptGridFormDTO.setAgencyIdList(agencyIdList);
agencyDeptGridFormDTO.setDeptIdList(deptIdList);
agencyDeptGridFormDTO.setGridIdList(gridIdList);
Result<AgencyDeptGridResultDTO> resultDTO = govOrgFeignClient.getAgencyDeptGridList(agencyDeptGridFormDTO);
if (!resultDTO.success() || null == resultDTO.getData()) {
throw new RenException(ProjectConstant.SELECT_GOV_ORG_EXCEPTION);
}
AgencyDeptGridResultDTO agencyDeptGrid = resultDTO.getData();
//3.2:批量新增项目人员关联表数据
List<ProjectStaffEntity> entityList = new ArrayList<>();
staffList.forEach(ts->{
ProjectStaffEntity entity = ConvertUtils.sourceToTarget(ts, ProjectStaffEntity.class);
entity.setOrgId(ts.getAgencyId());
entity.setProjectId(formDTO.getProjectId());
entity.setProcessId(processEntity.getId());
entity.setIsHandle(ProjectConstant.UNHANDLED);
agencyDeptGrid.getAgencyList().forEach(agency->{
if (ts.getAgencyId().equals(agency.getId())) {
entity.setCustomerId(agency.getCustomerId());
entity.setOrgIdPath(("".equals(agency.getPids()) ? "" : agency.getPids() + ":") + agency.getId());
entity.setDepartmentName(agency.getOrganizationName());
}
});
if (StringUtils.isNotBlank(ts.getDepartmentId())) {
agencyDeptGrid.getDeptList().forEach(dept -> {
if (ts.getDepartmentId().equals(dept.getId())) {
entity.setDepartmentName(entity.getDepartmentName() + "-" + dept.getDepartmentName());
}
});
}
if (StringUtils.isNotBlank(ts.getGridId())) {
agencyDeptGrid.getGridList().forEach(grid -> {
if (ts.getGridId().equals(grid.getId())) {
entity.setDepartmentName(entity.getDepartmentName() + "-" + grid.getGridName());
}
});
}
entityList.add(entity);
});
projectStaffService.insertBatch(entityList);
//3.3 项目机关历时关系 project_org_relation 更新原来的
ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(staffEntity.getId());
if(null == orientRelation){
log.error("com.epmet.service.impl.ProjectProcessServiceImpl.transfer,找不到项目节点机关历时记录,参数:{}",JSON.toJSONString(formDTO));
}
Date current = new Date();
WorkMinuteFormDTO timeParam = new WorkMinuteFormDTO();
timeParam.setIfPrecise(ProjectConstant.IMPRECISE_CALCULATION);
timeParam.setIfCustom(ProjectConstant.CALCULATION_TYPE_DEFAULT);
TimestampIntervalFormDTO interval = new TimestampIntervalFormDTO(orientRelation.getProjectStaffId(),orientRelation.getInformedDate(),current);
List<TimestampIntervalFormDTO> intervalList = new LinkedList<>();intervalList.add(interval);
timeParam.setTimeList(intervalList);
Result<Map<String,Integer>> timeResult = epmetCommonServiceOpenFeignClient.workMinutes(timeParam);
if(timeResult.success() && !CollectionUtils.isEmpty(timeResult.getData()) && null != timeResult.getData().get(staffEntity.getId())){
ProjectOrgRelationEntity relationDto = new ProjectOrgRelationEntity();
relationDto.setProjectStaffId(orientRelation.getProjectStaffId());
relationDto.setHandledDate(current);
relationDto.setTotalPeriod(timeResult.getData().get(staffEntity.getId()));
relationDto.setOperation(ProjectConstant.OPERATION_TRANSFER);
if(null == orientRelation.getFirstDealtDate()){
relationDto.setFirstDealtDate(current);
relationDto.setFirstReplyPeriod(relationDto.getTotalPeriod());
}
relationDao.maintainTimePropertyConsistency(relationDto);
}else{
log.error("com.epmet.service.impl.ProjectProcessServiceImpl.transfer,计算节点耗时失败,参数:{}", JSON.toJSONString(timeParam));
throw new RenException("计算节点耗时失败");
}
//3.4 项目机关历时关系 project_org_relation 插入新增的
List<ProjectOrgRelationEntity> relationList = new LinkedList<>();
entityList.forEach(staff -> {
ProjectOrgRelationEntity relation = new ProjectOrgRelationEntity();
relation.setProjectStaffId(staff.getId());
relation.setInformedDate(current);
relation.setSourceOperation(ProjectConstant.OPERATION_TRANSFER);
relationList.add(relation);
});
relationDao.insertBatch(relationList);
//4:调用epmet-message服务,给项目流转过程中的工作人员发送消息
if (!transferMessage(formDTO).success()) {
throw new RenException(ProjectConstant.SAVE_MSG_EXCEPTION);
}
//5:调用epmet-message服务,给项目流转过程中的工作人员发送订阅的微信消息
if (!transferWxmpMessage(formDTO).success()) {
logger.error("项目流转,推送微信订阅消息失败");
//throw new RenException(ProjectConstant.SAVE_WXMP_MSG_EXCEPTION);
}
}
}

446
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectServiceImpl.java

@ -106,6 +106,8 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
private ProjectCategoryService projectCategoryService;
@Autowired
private ProjectTagsService projectTagsService;
@Autowired
private ProjectProcessAttachmentService projectProcessAttachmentService;
private final static String ONE_DAY = "<1";
@ -412,22 +414,158 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
projectProcessEntity.setCostWorkdays(getDetentionDays(projectDto));
projectProcessService.insert(projectProcessEntity);
//对项目节点耗时记录进行更新,更新全部未处理节点以及结案人的节点耗时
//List<ProjectOrgRelationEntity> periodsToUpdate = relationDao.selectAllUnhandledProcess(fromDTO.getProjectId());
//if(CollectionUtils.isEmpty(periodsToUpdate)){
// log.error("com.epmet.service.impl.ProjectServiceImpl.closed,至少存在一条处理时间为空的项目节点耗时记录,但是没有找到,参数:{}",JSON.toJSONString(fromDTO));
// throw new RenException("至少存在一条处理时间为空的项目节点耗时记录,但是没有找到");
//}
ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(operatorProjectReference.getId());
if(null == orientRelation){
log.error("com.epmet.service.impl.ProjectServiceImpl.closed,找不到结案工作人员的节点耗时相关记录,参数:{}",JSON.toJSONString(fromDTO));
throw new RenException("找不到结案工作人员的节点耗时相关记录");
}
Integer delta_t = calculateDelta_T(ProjectConstant.IMPRECISE_CALCULATION,
ProjectConstant.CALCULATION_TYPE_DEFAULT, operatorProjectReference.getId(),orientRelation.getInformedDate(),current);
ProjectOrgRelationEntity carrier = new ProjectOrgRelationEntity();
carrier.setProjectStaffId(operatorProjectReference.getId());
carrier.setOperation(ProjectConstant.OPERATION_CLOSE);
carrier.setTotalPeriod(delta_t);
carrier.setHandledDate(current);
if(null == orientRelation.getFirstDealtDate()){
carrier.setFirstReplyPeriod(delta_t);
carrier.setFirstDealtDate(current);
}
relationDao.maintainTimePropertyConsistency(carrier);
//通知
List<UserMessageFormDTO> msgList = new ArrayList<>();
//2020.10.26 添加项目结案发送微信订阅消息操作 sun
List<WxSubscribeMessageFormDTO> wxmpMsgList = new ArrayList<>();
//通知项目相关人员
List<ProjectRelatedPersonnelDTO> personnelList = projectRelatedPersonnelService.getPersonnelListByProjectId(fromDTO.getProjectId());
personnelList.forEach(p -> {
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(projectEntity.getCustomerId());
messageFormDTO.setApp(p.getApp());
messageFormDTO.setGridId(p.getGridId());
messageFormDTO.setUserId(p.getUserId());
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
msg.setClientType(p.getApp());
msg.setUserId(p.getUserId());
msg.setBehaviorType("项目消息");
msg.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
msg.setMessageTime(new Date());
msg.setGridId(p.getGridId());
wxmpMsgList.add(msg);
});
//通知项目关联的部门人员
List<String> staffList = projectStaffService.getStaffsByProjectId(fromDTO.getProjectId());
staffList.add(projectEntity.getCreatedBy());
staffList.stream().distinct().forEach(s -> {
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(projectEntity.getCustomerId());
messageFormDTO.setApp(ProjectConstant.GOV);
messageFormDTO.setGridId("*");
messageFormDTO.setUserId(s);
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
messageFormDTO.setReadFlag(Constant.UNREAD);
msgList.add(messageFormDTO);
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
msg.setClientType(AppClientConstant.APP_GOV);
msg.setUserId(s);
msg.setBehaviorType("项目消息");
msg.setMessageContent(String.format(UserMessageConstant.PROJECT_CLOSED_MSG, projectEntity.getTitle(), fromDTO.getPublicReply()));
msg.setMessageTime(new Date());
msg.setGridId("*");
wxmpMsgList.add(msg);
});
messageFeignClient.saveUserMessageList(msgList);
//2020.10.26 发送微信订阅消息 sun
logger.info("项目结案,开始推送微信订阅消息");
Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList);
if (!result.success()) {
logger.error("项目结案成功,发送微信订阅消息失败" + JSON.toJSONString(result));
}
}
/**
* 项目结案
*
* @param fromDTO 参数
* @return void
* @author zhaoqifeng
* @date 2020/5/13 9:54
*/
@Override
public void closedV2(ProjectClosedFromDTO fromDTO) {
//公开回复内容审核
if (StringUtils.isNotBlank(fromDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(fromDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//更新项目表状态
ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId());
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) {
throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode());
}
Date current = new Date();
projectEntity.setStatus(ProjectConstant.CLOSED);
projectEntity.setClosedStatus(fromDTO.getClosedStatus());
baseDao.updateById(projectEntity);
//更新项目关联表
ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity();
projectStaffEntity.setId(fromDTO.getProjectStaffId());
projectStaffEntity.setIsHandle(ProjectConstant.HANDLE);
projectStaffService.updateById(projectStaffEntity);
//List<TimestampIntervalFormDTO> intervalList = new LinkedList<>();
//periodsToUpdate.forEach(local -> {
// TimestampIntervalFormDTO obj = new TimestampIntervalFormDTO();
// obj.setId(local.getProjectStaffId());
// obj.setLeft(local.getInformedDate());
// obj.setRight(current);
// intervalList.add(obj);
//});
//查询结案人员的信息
ProjectStaffEntity operatorProjectReference = projectStaffService.selectById(fromDTO.getProjectStaffId());
if(null == operatorProjectReference){
log.error("com.epmet.service.impl.ProjectServiceImpl.closed,找不到结案工作人员的相关记录,参数:{}",JSON.toJSONString(fromDTO));
throw new RenException("找不到结案工作人员的相关记录");
}
//结案记录加入项目进展表
ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity();
projectProcessEntity.setProjectId(fromDTO.getProjectId());
projectProcessEntity.setCustomerId(operatorProjectReference.getCustomerId());
projectProcessEntity.setDepartmentName(fromDTO.getDepartmentName());
projectProcessEntity.setAgencyId(operatorProjectReference.getOrgId());
projectProcessEntity.setGridId(operatorProjectReference.getGridId());
projectProcessEntity.setDepartmentId(operatorProjectReference.getDepartmentId());
projectProcessEntity.setOrgIdPath(operatorProjectReference.getOrgIdPath());
projectProcessEntity.setEndTime(new Date());
projectProcessEntity.setOperation(ProjectConstant.OPERATION_CLOSE);
projectProcessEntity.setOperationName(ProjectConstant.OPERATION_CLOSE_NAME);
projectProcessEntity.setPublicReply(fromDTO.getPublicReply());
projectProcessEntity.setInternalRemark(fromDTO.getInternalRemark());
projectProcessEntity.setStaffId(fromDTO.getUserId());
ProjectDTO projectDto = ConvertUtils.sourceToTarget(projectEntity, ProjectDTO.class);
projectDto.setUpdatedTime(projectDto.getCreatedTime());
projectProcessEntity.setCostWorkdays(getDetentionDays(projectDto));
projectProcessService.insert(projectProcessEntity);
//保存附件
saveFile(fromDTO.getPublicFile(), fromDTO.getInternalFile(), operatorProjectReference.getCustomerId(), fromDTO.getProjectId(),
projectProcessEntity.getId());
ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(operatorProjectReference.getId());
if(null == orientRelation){
@ -1455,4 +1593,284 @@ public class ProjectServiceImpl extends BaseServiceImpl<ProjectDao, ProjectEntit
});
return projects;
}
/**
* 项目处理节点附件保存
* @author zhaoqifeng
* @date 2020/12/22 9:18
* @param publicFile
* @param internalFile
* @param customerId
* @param projectId
* @param processId
* @return void
*/
@Override
public void saveFile(List<FileDTO> publicFile, List<FileDTO> internalFile, String customerId, String projectId, String processId) {
if (CollectionUtils.isNotEmpty(internalFile)) {
int i = 0;
List<ProjectProcessAttachmentEntity> list = new ArrayList<>();
for (FileDTO item : internalFile) {
ProjectProcessAttachmentEntity entity = new ProjectProcessAttachmentEntity();
entity.setCustomerId(customerId);
entity.setProjectId(projectId);
entity.setProcessId(processId);
entity.setFilePlace("internal");
entity.setFileName(item.getName());
entity.setAttachmentName("");
entity.setAttachmentSize(item.getSize());
entity.setAttachmentFormat(item.getFormat());
entity.setAttachmentType(item.getType());
entity.setAttachmentUrl(item.getUrl());
entity.setSort(i);
entity.setDuration(item.getDuration());
entity.setIsRelease(NumConstant.ONE);
list.add(entity);
i++;
}
projectProcessAttachmentService.insertBatch(list);
}
if (CollectionUtils.isNotEmpty(publicFile)) {
//TODO 内容安全检查
int i = 0;
List<ProjectProcessAttachmentEntity> list = new ArrayList<>();
for (FileDTO item : publicFile) {
ProjectProcessAttachmentEntity entity = new ProjectProcessAttachmentEntity();
entity.setCustomerId(customerId);
entity.setProjectId(projectId);
entity.setProcessId(processId);
entity.setFilePlace("public");
entity.setFileName(item.getName());
entity.setAttachmentName("");
entity.setAttachmentSize(item.getSize());
entity.setAttachmentFormat(item.getFormat());
entity.setAttachmentType(item.getType());
entity.setAttachmentUrl(item.getUrl());
entity.setSort(i);
entity.setDuration(item.getDuration());
entity.setIsRelease(NumConstant.ZERO);
list.add(entity);
i++;
}
projectProcessAttachmentService.insertBatch(list);
}
}
/**
* @param fromDTO
* @Description 项目退回V2.0接口
*/
@Override
@Transactional(rollbackFor = Exception.class)
public void projectReturnV2(ReturnFromDTO fromDTO) {
//公开回复内容审核
if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(fromDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(fromDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
ProjectEntity projectEntity = baseDao.selectById(fromDTO.getProjectId());
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) {
throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode());
}
Date current = new Date();
//更新项目关联表
ProjectStaffEntity projectStaffEntity = new ProjectStaffEntity();
projectStaffEntity.setId(fromDTO.getProjectStaffId());
projectStaffEntity.setIsHandle(ProjectConstant.HANDLE);
projectStaffService.updateById(projectStaffEntity);
//查找对应的project_staff的信息,为了取出机关的信息,给即将要生成的“退回”节点赋值
ProjectStaffEntity sourceProjectStaff = projectStaffService.selectById(fromDTO.getProjectStaffId());
if(null == sourceProjectStaff){
log.error("com.epmet.service.impl.ProjectServiceImpl.projectReturn,找不到发起退回的项目相关人员的记录,参数:{}",JSON.toJSONString(fromDTO));
throw new RenException("找不到发起退回的项目相关人员的记录");
}
//结案记录加入项目进展表
ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity();
projectProcessEntity.setProjectId(fromDTO.getProjectId());
projectProcessEntity.setCustomerId(sourceProjectStaff.getCustomerId());
projectProcessEntity.setDepartmentName(fromDTO.getDepartmentName());
projectProcessEntity.setOrgIdPath(sourceProjectStaff.getOrgIdPath());
projectProcessEntity.setGridId(sourceProjectStaff.getGridId());
projectProcessEntity.setDepartmentId(sourceProjectStaff.getDepartmentId());
projectProcessEntity.setAgencyId(sourceProjectStaff.getOrgId());
projectProcessEntity.setOperation(ProjectConstant.OPERATION_RETURN);
projectProcessEntity.setOperationName(ProjectConstant.OPERATION_RETURN_NAME);
projectProcessEntity.setPublicReply(fromDTO.getPublicReply());
projectProcessEntity.setInternalRemark(fromDTO.getInternalRemark());
projectProcessEntity.setStaffId(fromDTO.getUserId());
projectProcessService.insert(projectProcessEntity);
//项目附件表新增数据 sun 2020.12.22
if (fromDTO.getPublicFile().size() > NumConstant.ZERO || fromDTO.getInternalFile().size() > NumConstant.ZERO) {
saveFile(fromDTO.getPublicFile(), fromDTO.getInternalFile(), sourceProjectStaff.getCustomerId(), fromDTO.getProjectId(), projectProcessEntity.getId());
}//end
//将人员关系添加到项目关联表
ProjectStaffDTO projectStaffDTO = projectStaffService.getProjectStaffInfo(fromDTO.getProjectProcessId());
ProjectStaffEntity projectStaff = ConvertUtils.sourceToTarget(projectStaffDTO, ProjectStaffEntity.class);
projectStaff.setId(null);
//防止将被退回的项目相关人员节点的创建时间赋值给新增的相关人员节点的创建时间,否则数据统计将出现误差
projectStaff.setCreatedTime(current);
projectStaff.setUpdatedTime(current);
projectStaff.setProcessId(projectProcessEntity.getId());
projectStaff.setIsHandle(ProjectConstant.UNHANDLED);
projectStaffService.insert(projectStaff);
//更新退回发起人的节点耗时记录
ProjectOrgRelationEntity orientRelation = relationDao.selectByProjectStaffId(fromDTO.getProjectStaffId());
if(null == orientRelation){
log.error("com.epmet.service.impl.ProjectServiceImpl.projectReturn,找不到发起退回的项目相关人员的节点耗时记录,参数:{}",JSON.toJSONString(fromDTO));
throw new RenException("找不到发起退回的项目相关人员的节点耗时记录");
}
ProjectOrgRelationEntity relationDto = new ProjectOrgRelationEntity();
relationDto.setProjectStaffId(orientRelation.getProjectStaffId());
relationDto.setHandledDate(current);
Integer costTime = calculateDelta_T(ProjectConstant.IMPRECISE_CALCULATION,
ProjectConstant.CALCULATION_TYPE_DEFAULT,
orientRelation.getProjectStaffId(),
orientRelation.getInformedDate(),
current);
relationDto.setTotalPeriod(costTime);
relationDto.setOperation(ProjectConstant.OPERATION_RETURN);
if(null == orientRelation.getFirstDealtDate()){
relationDto.setFirstDealtDate(current);
relationDto.setFirstReplyPeriod(costTime);
}
relationDao.maintainTimePropertyConsistency(relationDto);
//初始化被退回人的节点耗时记录
ProjectOrgRelationEntity newRelation = new ProjectOrgRelationEntity();
newRelation.setProjectStaffId(projectStaff.getId());
newRelation.setSourceOperation(ProjectConstant.OPERATION_RETURN);
newRelation.setInformedDate(current);
relationDao.insert(newRelation);
//通知
List<UserMessageFormDTO> msgList = new ArrayList<>();
UserMessageFormDTO messageFormDTO = new UserMessageFormDTO();
messageFormDTO.setCustomerId(projectEntity.getCustomerId());
messageFormDTO.setApp(ProjectConstant.GOV);
messageFormDTO.setGridId("*");
messageFormDTO.setUserId(projectStaffDTO.getStaffId());
messageFormDTO.setTitle(UserMessageConstant.PROJECT_TITLE);
messageFormDTO.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle()));
messageFormDTO.setReadFlag(Constant.UNREAD);
msgList.add(messageFormDTO);
messageFeignClient.saveUserMessageList(msgList);
//2020.10.26 添加项目退回给勾选人推送微信订阅消息 sun
List<WxSubscribeMessageFormDTO> wxmpMsgList = new ArrayList<>();
WxSubscribeMessageFormDTO msg = new WxSubscribeMessageFormDTO();
msg.setCustomerId(projectEntity.getCustomerId());
msg.setClientType(AppClientConstant.APP_GOV);
msg.setUserId(projectStaffDTO.getStaffId());
msg.setBehaviorType("项目消息");
msg.setMessageContent(String.format(UserMessageConstant.PROJECT_RESOLVED_MSG, projectEntity.getTitle()));
msg.setMessageTime(new Date());
msg.setGridId("*");
wxmpMsgList.add(msg);
//发送微信订阅消息 sun
logger.info("项目退回,开始推送微信订阅消息");
Result result = epmetMessageOpenFeignClient.sendWxSubscribeMessage(wxmpMsgList);
if (!result.success()) {
logger.error("项目退回成功,发送微信订阅消息失败" + JSON.toJSONString(result));
}
}
/**
* @param formDTO
* @Description 处理响应V2.0接口
* @author sun
*/
@Override
public void responseV2(ProjectResponseFormDTO formDTO) {
//公开回复内容审核
if (com.alibaba.nacos.client.utils.StringUtils.isNotBlank(formDTO.getPublicReply())) {
TextScanParamDTO textScanParamDTO = new TextScanParamDTO();
TextTaskDTO taskDTO = new TextTaskDTO();
taskDTO.setDataId(UUID.randomUUID().toString().replace("-", ""));
taskDTO.setContent(formDTO.getPublicReply());
textScanParamDTO.getTasks().add(taskDTO);
Result<SyncScanResult> textSyncScanResult = ScanContentUtils.textSyncScan(scanApiUrl.concat(textSyncScanMethod), textScanParamDTO);
if (!textSyncScanResult.success()) {
throw new RenException(EpmetErrorCode.SERVER_ERROR.getCode());
} else {
if (!textSyncScanResult.getData().isAllPass()) {
throw new RenException(EpmetErrorCode.TEXT_SCAN_FAILED.getCode());
}
}
}
//获取项目相关信息
ProjectEntity projectEntity = baseDao.selectById(formDTO.getProjectId());
if (ProjectConstant.CLOSED.equals(projectEntity.getStatus())) {
throw new RenException(EpmetErrorCode.PROJECT_IS_CLOSED.getCode());
}
ProjectStaffDTO projectStaff = projectStaffService.getLatestIdByProjectIdAndStaffId(formDTO.getProjectId(),formDTO.getUserId());
if(null == projectStaff){
log.error("com.epmet.service.impl.ProjectServiceImpl.response,project_staff表中没有与之对应的数据,传参:{}", JSON.toJSONString(formDTO));
throw new RenException("未找到项目相关人员记录");
}
if(StringUtils.isBlank(formDTO.getProjectStaffId())){
formDTO.setProjectStaffId(projectStaff.getId());
}
//处理响应记录加入项目进展表
ProjectProcessEntity projectProcessEntity = new ProjectProcessEntity();
projectProcessEntity.setProjectId(formDTO.getProjectId());
projectProcessEntity.setCustomerId(projectStaff.getCustomerId());
projectProcessEntity.setDepartmentName(formDTO.getDepartmentName());
projectProcessEntity.setOrgIdPath(projectStaff.getOrgIdPath());
projectProcessEntity.setGridId(projectStaff.getGridId());
projectProcessEntity.setDepartmentId(projectStaff.getDepartmentId());
projectProcessEntity.setAgencyId(projectStaff.getOrgId());
projectProcessEntity.setOperation(ProjectConstant.OPERATION_RESPONSES);
projectProcessEntity.setOperationName(ProjectConstant.OPERATION_RESPONSES_NAME);
projectProcessEntity.setPublicReply(formDTO.getPublicReply());
projectProcessEntity.setInternalRemark(formDTO.getInternalRemark());
projectProcessEntity.setStaffId(formDTO.getUserId());
projectProcessService.insert(projectProcessEntity);
//项目附件表新增数据 sun 2020.12.22
if (formDTO.getPublicFile().size() > NumConstant.ZERO || formDTO.getInternalFile().size() > NumConstant.ZERO) {
saveFile(formDTO.getPublicFile(), formDTO.getInternalFile(), projectStaff.getCustomerId(), formDTO.getProjectId(), projectProcessEntity.getId());
}//end
//项目节点历时
ProjectOrgRelationEntity relationEntity = relationDao.selectByProjectStaffId(formDTO.getProjectStaffId());
if(null != relationEntity){
ProjectOrgRelationEntity relationDto = new ProjectOrgRelationEntity();
relationDto.setProjectStaffId(relationEntity.getProjectStaffId());
if(null == relationEntity.getFirstDealtDate()){
Date current = new Date();
relationDto.setFirstDealtDate(current);
relationDto.setFirstReplyPeriod(calculateDelta_T(ProjectConstant.IMPRECISE_CALCULATION,
ProjectConstant.CALCULATION_TYPE_DEFAULT,projectStaff.getId(),
relationEntity.getInformedDate(),current));
relationDto.setOperation(ProjectConstant.OPERATION_RESPONSES);
relationDao.maintainTimePropertyConsistency(relationDto);
}
}else{
log.error("com.epmet.service.impl.ProjectServiceImpl#response,没有找到相关的节点耗时记录,参数:{}",JSON.toJSONString(formDTO));
throw new RenException("没有找到相关的节点耗时记录");
}
}
}

81
epmet-module/gov-project/gov-project-server/src/main/java/com/epmet/service/impl/ProjectTraceServiceImpl.java

@ -4,6 +4,8 @@ import com.epmet.commons.tools.exception.RenException;
import com.epmet.commons.tools.security.dto.TokenDto;
import com.epmet.commons.tools.utils.Result;
import com.epmet.constant.ProjectConstant;
import com.epmet.dao.ProjectProcessAttachmentDao;
import com.epmet.dao.ProjectProcessDao;
import com.epmet.dto.ProjectStaffDTO;
import com.epmet.dto.form.*;
import com.epmet.dto.result.*;
@ -13,10 +15,15 @@ import com.epmet.service.ProjectProcessService;
import com.epmet.service.ProjectService;
import com.epmet.service.ProjectStaffService;
import com.epmet.service.ProjectTraceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @author zhaoqifeng
@ -24,6 +31,7 @@ import java.util.List;
* @date 2020/5/11 16:35
*/
@Service
@Slf4j
public class ProjectTraceServiceImpl implements ProjectTraceService {
@Autowired
private ProjectService projectService;
@ -33,6 +41,10 @@ public class ProjectTraceServiceImpl implements ProjectTraceService {
private ProjectStaffService projectStaffService;
@Autowired
private GovOrgFeignClient govOrgFeignClient;
@Autowired
private ProjectProcessDao projectProcessDao;
@Autowired
private ProjectProcessAttachmentDao attachmentDao;
@Override
public List<PendProjectListResultDTO> getPendProjectList(TokenDto tokenDto, ProjectListFromDTO fromDTO) {
@ -64,6 +76,21 @@ public class ProjectTraceServiceImpl implements ProjectTraceService {
projectService.closed(fromDTO);
}
/**
* 项目结案
*
* @param tokenDto token
* @param fromDTO 入参
* @return com.epmet.commons.tools.utils.Result
* @author zhaoqifeng
* @date 2020/5/11 16:27
*/
@Override
public void closedV2(TokenDto tokenDto, ProjectClosedFromDTO fromDTO) {
fromDTO.setUserId(tokenDto.getUserId());
projectService.closedV2(fromDTO);
}
@Override
public List<ReturnListResultDTO> getReturnableList(ReturnListFromDTO fromDTO) {
return projectProcessService.getReturnableList(fromDTO);
@ -101,4 +128,58 @@ public class ProjectTraceServiceImpl implements ProjectTraceService {
formDTO.setUserId(tokenDto.getUserId());
projectService.response(formDTO);
}
/**
* @Description 项目处理进展列表V2
* @Param formDTO
* @author zxc
* @date 2020/12/21 下午3:55
*/
@Override
public List<ProcessListV2ResultDTO> processListV2(ProcessListV2FormDTO formDTO) {
// 查询项目进展列表
List<ProcessListV2ResultDTO> processList = projectProcessDao.selectProcessList(formDTO.getProjectId());
if (CollectionUtils.isEmpty(processList)){
log.warn(ProjectConstant.NOT_EXIST_PROJECT);
return new ArrayList<>();
}
// 查询进展附件列表
List<PublicAndInternalFileResultDTO> files = attachmentDao.selectAttachByProjectId(formDTO.getProjectId());
if (!CollectionUtils.isEmpty(files)){
// 内部附件和公开附件分组
Map<String, List<PublicAndInternalFileResultDTO>> groupByPlace = files.stream().collect(Collectors.groupingBy(PublicAndInternalFileResultDTO::getFilePlace));
List<PublicAndInternalFileResultDTO> publicFiles = groupByPlace.get(ProjectConstant.PUBLIC);
if (!CollectionUtils.isEmpty(publicFiles)){
processList.forEach(p -> publicFiles.stream().filter(f -> p.getProcessId().equals(f.getProcessId())).forEach(f -> p.getPublicFile().add(f)));
}
List<PublicAndInternalFileResultDTO> internalFiles = groupByPlace.get(ProjectConstant.INTERNAL);
if (!CollectionUtils.isEmpty(internalFiles)){
processList.forEach(p -> internalFiles.stream().filter(f -> p.getProcessId().equals(f.getProcessId())).forEach(f -> p.getInternalFile().add(f)));
}
}
return processList;
}
/**
* @param tokenDto fromDTO
* @Description 项目退回V2.0接口
* @author sun
*/
@Override
public void projectReturnV2(TokenDto tokenDto, ReturnFromDTO fromDTO) {
fromDTO.setUserId(tokenDto.getUserId());
projectService.projectReturnV2(fromDTO);
}
/**
* @param formDTO
* @Description 处理响应V2.0接口
* @author sun
*/
@Override
public void responseV2(TokenDto tokenDto, ProjectResponseFormDTO formDTO) {
formDTO.setUserId(tokenDto.getUserId());
projectService.responseV2(formDTO);
}
}

41
epmet-module/gov-project/gov-project-server/src/main/resources/db/migration/V0.0.5__create_project_attachment.sql

@ -0,0 +1,41 @@
CREATE TABLE `project_process_attachment` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`PROJECT_ID` varchar(64) NOT NULL COMMENT '项目ID',
`PROCESS_ID` varchar(64) NOT NULL COMMENT '项目进展表ID',
`FILE_PLACE` varchar(64) NOT NULL COMMENT '文件所属位置(内部备注: internal 公开答复:public)',
`FILE_NAME` varchar(255) DEFAULT NULL COMMENT '文件名',
`ATTACHMENT_NAME` varchar(255) DEFAULT NULL COMMENT '附件名(uuid随机生成)',
`ATTACHMENT_SIZE` int(11) DEFAULT NULL COMMENT '文件大小',
`ATTACHMENT_FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、JPEG、BMP、GIF、PDF、PPT、PPTX、DOC、DOCX、XLS、XLSX、MP3、WMA、M4A、MP4、AVI、MOV、RMVB、RM、WMV)',
`ATTACHMENT_TYPE` varchar(64) DEFAULT NULL COMMENT '文件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))',
`ATTACHMENT_URL` varchar(255) NOT NULL COMMENT 'url地址',
`SORT` int(11) NOT NULL COMMENT '排序(需求确定,按上传顺序排序)',
`DURATION` int(11) unsigned zerofill DEFAULT '00000000000' COMMENT '语音或视频时长,秒',
`IS_RELEASE` int(1) NOT NULL DEFAULT '0' COMMENT '是否强制发布(0:否 1:是)',
`DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目节点附件表';
CREATE TABLE `project_process_scan_task` (
`ID` varchar(64) NOT NULL COMMENT '唯一标识',
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID',
`PROJECT_ID` varchar(64) NOT NULL COMMENT '项目ID',
`PROCESS_ID` varchar(64) NOT NULL COMMENT '项目进展表(project_process)ID',
`PROJECT_PROCESS_ATTACHMENT_ID` varchar(64) NOT NULL COMMENT '项目附件表主键,对应dataId',
`TASK_ID` varchar(64) NOT NULL COMMENT '阿里云审核任务Id',
`STATUS` varchar(32) NOT NULL COMMENT '审核状态【auditing: 审核中;\r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;】',
`ATTACHMENT_TYPE` varchar(64) NOT NULL COMMENT '附件类型(视频 - video、 语音 - voice 文件 - doc)',
`DEL_FLAG` char(1) NOT NULL COMMENT '删除标识:0.未删除 1.已删除',
`REVISION` int(11) NOT NULL COMMENT '乐观锁',
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间',
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人',
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间',
PRIMARY KEY (`ID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目节点附件安全校验任务表';

22
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessAttachmentDao.xml

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ProjectProcessAttachmentDao">
<!-- 根据项目ID查询附件 -->
<select id="selectAttachByProjectId" resultType="com.epmet.dto.result.PublicAndInternalFileResultDTO">
SELECT
ATTACHMENT_NAME AS name,
ATTACHMENT_URL AS url,
ATTACHMENT_TYPE AS type,
ATTACHMENT_FORMAT AS format,
ATTACHMENT_SIZE AS size,
DURATION,
PROCESS_ID,
FILE_PLACE
FROM project_process_attachment
WHERE DEL_FLAG = '0'
AND PROJECT_ID = #{projectId}
order by sort
</select>
</mapper>

16
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessDao.xml

@ -84,4 +84,20 @@
)
ORDER BY process.PROJECT_ID , process.STAFF_ID , process.CREATED_TIME ASC
</select>
<!-- 查询项目进展 -->
<select id="selectProcessList" resultType="com.epmet.dto.result.ProcessListV2ResultDTO">
SELECT
PROJECT_ID,
ID AS processId,
OPERATION_NAME AS processName,
UNIX_TIMESTAMP(created_time) AS processTime,
DEPARTMENT_NAME,
PUBLIC_REPLY,
INTERNAL_REMARK
FROM project_process
WHERE DEL_FLAG = '0'
AND PROJECT_ID = #{projectId}
order by created_time desc
</select>
</mapper>

8
epmet-module/gov-project/gov-project-server/src/main/resources/mapper/ProjectProcessScanTaskDao.xml

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.epmet.dao.ProjectProcessScanTaskDao">
</mapper>
Loading…
Cancel
Save