[修改] 报告文件批量上传
This commit is contained in:
+36
-1
@@ -1,12 +1,16 @@
|
||||
package com.adc.da.wkflow.business_activiti.service;
|
||||
|
||||
import com.adc.da.login.util.UserUtils;
|
||||
import com.adc.da.report.dao.mysql.PowerApplyActDao;
|
||||
import com.adc.da.report.dao.mysql.ReportFileDao;
|
||||
import com.adc.da.report.dao.mysql.ReportLabelDao;
|
||||
import com.adc.da.report.dao.mysql.TtReportManageActDao;
|
||||
import com.adc.da.report.eo.PowerApplyAct;
|
||||
import com.adc.da.report.eo.ReportFile;
|
||||
import com.adc.da.report.eo.ReportLabelEntity;
|
||||
import com.adc.da.report.eo.TtReportManageAct;
|
||||
import com.adc.da.report.service.IPowerApplyActService;
|
||||
import com.adc.da.report.service.IReportFileService;
|
||||
import com.adc.da.report.service.IReportLabelService;
|
||||
import com.adc.da.report.service.ITtReportManageActService;
|
||||
import com.adc.da.util.exception.AdcDaBaseException;
|
||||
@@ -19,7 +23,10 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
@Service
|
||||
public class ActivitDefineService {
|
||||
@@ -42,7 +49,11 @@ public class ActivitDefineService {
|
||||
private ReportLabelDao reportLabelDao;
|
||||
@Autowired
|
||||
private IReportLabelService iReportLabelService;
|
||||
@Autowired
|
||||
private IReportFileService iReportFileService;
|
||||
|
||||
@Autowired
|
||||
private ReportFileDao reportFileDao;
|
||||
//保存data数据
|
||||
public String saveOrUpdateDate(String prcType, String dataJson,String taskId,String prcId,String reportId) {
|
||||
if (StringUtils.isBlank(reportId)){
|
||||
@@ -115,6 +126,18 @@ public class ActivitDefineService {
|
||||
}
|
||||
iReportLabelService.saveBatch(labelList);
|
||||
}
|
||||
// 文件
|
||||
reportFileDao.delByReportId(new ReportFile(reportId,1));
|
||||
List<ReportFile> reportFiles = new ArrayList<>();
|
||||
for (ReportFile reportFile : ttReportManageAct.getFileList()) {
|
||||
reportFile.setId(UUID.randomUUID().toString().replace("-",""));
|
||||
reportFile.setReportId(ttReportManageAct.getDataId());
|
||||
// reportFile.setFileId(s);
|
||||
reportFile.setState(1);
|
||||
reportFile.setUserId(UserUtils.getUserId());
|
||||
reportFiles.add(reportFile);
|
||||
}
|
||||
iReportFileService.saveBatch(reportFiles);
|
||||
}else if ("5".equals(prcType)){
|
||||
// 编辑
|
||||
TtReportManageAct ttReportManageAct = JSONObject.parseObject(dataJson, TtReportManageAct.class);
|
||||
@@ -138,6 +161,18 @@ public class ActivitDefineService {
|
||||
}
|
||||
iReportLabelService.saveBatch(labelList);
|
||||
}
|
||||
// 文件
|
||||
reportFileDao.delByReportId(new ReportFile(reportId,1));
|
||||
List<ReportFile> reportFiles = new ArrayList<>();
|
||||
for (ReportFile reportFile : ttReportManageAct.getFileList()) {
|
||||
reportFile.setId(UUID.randomUUID().toString().replace("-",""));
|
||||
reportFile.setReportId(ttReportManageAct.getDataId());
|
||||
// reportFile.setFileId(s);
|
||||
reportFile.setState(1);
|
||||
reportFile.setUserId(UserUtils.getUserId());
|
||||
reportFiles.add(reportFile);
|
||||
}
|
||||
iReportFileService.saveBatch(reportFiles);
|
||||
}else {
|
||||
throw new AdcDaBaseException("没有流程类型"+prcType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user