|
@@ -19,6 +19,7 @@ import org.apache.commons.lang.time.DateUtils;
|
|
|
import org.jetbrains.annotations.NotNull;
|
|
|
import org.springblade.archive.dto.SaveApplyDTO;
|
|
|
import org.springblade.archive.feign.ArchiveAutoClient;
|
|
|
+import org.springblade.archive.feign.ArchiveExpertConclusionClient;
|
|
|
import org.springblade.business.dto.*;
|
|
|
import org.springblade.business.entity.*;
|
|
|
import org.springblade.business.service.*;
|
|
@@ -64,6 +65,7 @@ import org.springframework.web.bind.annotation.*;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.FileNotFoundException;
|
|
|
import java.io.IOException;
|
|
|
+import java.io.InputStream;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.Duration;
|
|
|
import java.util.*;
|
|
@@ -93,6 +95,7 @@ public class TaskController extends BladeController {
|
|
|
private final ArchiveFileTaskClient archiveFileTaskClient;
|
|
|
private final IUserClient userClient;
|
|
|
private final ArchiveAutoClient archiveClient;
|
|
|
+ private final ArchiveExpertConclusionClient conclusionClient;
|
|
|
|
|
|
/**
|
|
|
* 记录短信验证码超时时间
|
|
@@ -631,7 +634,7 @@ public class TaskController extends BladeController {
|
|
|
for (TaskArchiveDTO taskArchiveDTO : taskArchiveOuterLayerDTO.getTaskArchiveDtoList()) {
|
|
|
if (StringUtils.isNotEmpty(taskArchiveDTO.getTaskId())) {
|
|
|
//通过checkArchiveTaskUserByCurrent检查,说明当前登陆用户是该条任务的审批人,修改审批任务状态
|
|
|
- Task task = jdbcTemplate.queryForObject("select id,contract_id,project_id,process_instance_id,form_data_id,type,archive_ids from u_task where id = " + taskArchiveDTO.getTaskId(), new BeanPropertyRowMapper<>(Task.class));
|
|
|
+ Task task = jdbcTemplate.queryForObject("select id,contract_id,project_id,process_instance_id,form_data_id,type,archive_ids,attachment_pdf_url from u_task where id = " + taskArchiveDTO.getTaskId(), new BeanPropertyRowMapper<>(Task.class));
|
|
|
if (task != null) {
|
|
|
//判断任务类型是否是验收任务,档案验收任务单独处理修改状态直接返回
|
|
|
if (task.getType() == 2) {
|
|
@@ -696,12 +699,17 @@ public class TaskController extends BladeController {
|
|
|
//修改档案类型
|
|
|
String archiveIds = task.getArchiveIds();
|
|
|
if (StringUtils.isNotBlank(archiveIds)) {
|
|
|
- List<Long> longs = Func.toLongList(archiveIds);
|
|
|
- R<Boolean> booleanR = archiveClient.batchUpdateIsApply(1, longs);
|
|
|
+ List<Long> ids = Func.toLongList(archiveIds);
|
|
|
+ R<Boolean> booleanR = archiveClient.batchUpdateIsApply(ids);
|
|
|
if (booleanR.getData() == null || !booleanR.isSuccess()) {
|
|
|
throw new ServiceException("修改档案类型失败");
|
|
|
}
|
|
|
}
|
|
|
+ //创建报表基本信息,报表中会自动创建评分基础信息
|
|
|
+ R r = conclusionClient.saveBaseTableInfo(Long.parseLong(task.getProjectId()), task.getAttachmentPdfUrl());
|
|
|
+ if (r == null || !"保存成功".equals(r.getData())){
|
|
|
+ throw new ServiceException("保存报表基本信息失败");
|
|
|
+ }
|
|
|
}
|
|
|
return R.data(true);
|
|
|
}
|
|
@@ -781,22 +789,29 @@ public class TaskController extends BladeController {
|
|
|
@PostMapping("/getArchiveFileTaskPdfs")
|
|
|
@ApiOperationSupport(order = 8)
|
|
|
@ApiOperation(value = "批量审批-获取档案审批任务对应业务数据的pdf信息", notes = "传入任务id,封装成taskIds,字符串逗号分割拼接")
|
|
|
- public R<List<ArchiveFileTaskPDFVO>> getArchiveFileTaskPdfs(@RequestParam String taskIds) {
|
|
|
- if (StringUtils.isNotEmpty(taskIds)) {
|
|
|
- List<Task> taskList = jdbcTemplate.query("select form_data_id from u_task where approval_type = 4 and id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
- Set<String> formDataIds = taskList.stream().map(Task::getFormDataId).collect(Collectors.toSet());
|
|
|
- if (formDataIds.size() > 0) {
|
|
|
- List<ArchiveFile> archiveFiles = jdbcTemplate.query("select id,file_name,pdf_file_url,e_visa_file from u_archive_file where id in(" + StringUtils.join(formDataIds, ",") + ")", new BeanPropertyRowMapper<>(ArchiveFile.class));
|
|
|
- List<ArchiveFileTaskPDFVO> collect = archiveFiles.stream()
|
|
|
- .map(obj -> {
|
|
|
- ArchiveFileTaskPDFVO vo = new ArchiveFileTaskPDFVO();
|
|
|
- vo.setId(obj.getId());
|
|
|
- vo.setPdfUrl(ObjectUtil.isNotEmpty(obj.getEVisaFile()) ? obj.getEVisaFile() : obj.getPdfFileUrl());
|
|
|
- vo.setFileName(obj.getFileName());
|
|
|
- return vo;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- return R.data(collect);
|
|
|
+ public R<List<ArchiveFileTaskPDFVO>> getArchiveFileTaskPdfs(@RequestParam String taskIds,@RequestParam Integer type) {
|
|
|
+ //普通任务
|
|
|
+ if (type == 1) {
|
|
|
+ if (StringUtils.isNotEmpty(taskIds)) {
|
|
|
+ List<Task> taskList = jdbcTemplate.query("select form_data_id from u_task where approval_type = 4 and id in(" + taskIds + ")", new BeanPropertyRowMapper<>(Task.class));
|
|
|
+ Set<String> formDataIds = taskList.stream().map(Task::getFormDataId).collect(Collectors.toSet());
|
|
|
+ if (formDataIds.size() > 0) {
|
|
|
+ List<ArchiveFile> archiveFiles = jdbcTemplate.query("select id,file_name,pdf_file_url,e_visa_file from u_archive_file where id in(" + StringUtils.join(formDataIds, ",") + ")", new BeanPropertyRowMapper<>(ArchiveFile.class));
|
|
|
+ List<ArchiveFileTaskPDFVO> collect = archiveFiles.stream()
|
|
|
+ .map(obj -> {
|
|
|
+ ArchiveFileTaskPDFVO vo = new ArchiveFileTaskPDFVO();
|
|
|
+ vo.setId(obj.getId());
|
|
|
+ vo.setPdfUrl(ObjectUtil.isNotEmpty(obj.getEVisaFile()) ? obj.getEVisaFile() : obj.getPdfFileUrl());
|
|
|
+ vo.setFileName(obj.getFileName());
|
|
|
+ return vo;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ return R.data(collect);
|
|
|
+ }
|
|
|
}
|
|
|
+ }else if (type == 2){
|
|
|
+ //验收任务
|
|
|
+ List<ArchiveFileTaskPDFVO> vos = jdbcTemplate.query("select id,task_name as fileName,attachment_pdf_url as pdfUrl from u_task where approval_type = 4 and id in(" + taskIds + ")", new BeanPropertyRowMapper<>(ArchiveFileTaskPDFVO.class));
|
|
|
+ return R.data(vos);
|
|
|
}
|
|
|
return R.data(null);
|
|
|
}
|