|
@@ -13,6 +13,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.collect.Lists;
|
|
|
import com.google.common.collect.Maps;
|
|
|
+import com.jeeplus.common.TokenProvider;
|
|
|
import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
|
import com.jeeplus.finance.common.flowable.dto.CommitParamDTO;
|
|
|
import com.jeeplus.finance.invoice.util.SignaturePostUtil;
|
|
@@ -31,21 +32,21 @@ import com.jeeplus.finance.workClientInfo.domain.CwWorkClientBase;
|
|
|
import com.jeeplus.finance.workClientInfo.service.dto.CwWorkClientBaseDTO;
|
|
|
import com.jeeplus.finance.workClientInfo.service.mapstruct.CwWorkClientBaseWrapper;
|
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
|
-import com.jeeplus.pubmodules.oss.domain.WorkAttachment;
|
|
|
-import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
|
|
|
-import com.jeeplus.pubmodules.oss.service.OSSClientService;
|
|
|
-import com.jeeplus.pubmodules.oss.service.OssService;
|
|
|
-import com.jeeplus.pubmodules.oss.service.dto.WorkAttachmentDto;
|
|
|
-import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
|
|
|
+//import com.jeeplus.pubmodules.oss.mapper.OssServiceMapper;
|
|
|
+//import com.jeeplus.pubmodules.oss.service.OSSClientService;
|
|
|
+//import com.jeeplus.pubmodules.oss.service.OssService;
|
|
|
+//import com.jeeplus.pubmodules.serialNumTpl.service.SerialnumTplService;
|
|
|
import com.jeeplus.sys.domain.User;
|
|
|
import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
|
+import com.jeeplus.sys.feign.IDictApi;
|
|
|
+import com.jeeplus.sys.feign.IUserApi;
|
|
|
import com.jeeplus.sys.feign.IWorkAttachmentApi;
|
|
|
-import com.jeeplus.sys.service.UserService;
|
|
|
-import com.jeeplus.sys.mapper.UserMapper;
|
|
|
+//import com.jeeplus.sys.service.UserService;
|
|
|
+//import com.jeeplus.sys.mapper.UserMapper;
|
|
|
import com.jeeplus.sys.service.dto.UserDTO;
|
|
|
-import com.jeeplus.sys.utils.DictUtils;
|
|
|
-import com.jeeplus.sys.utils.Global;
|
|
|
-import com.jeeplus.sys.utils.UserUtils;
|
|
|
+//import com.jeeplus.sys.utils.DictUtils;
|
|
|
+//import com.jeeplus.sys.utils.Global;
|
|
|
+//import com.jeeplus.sys.utils.UserUtils;
|
|
|
import freemarker.template.Configuration;
|
|
|
import freemarker.template.Template;
|
|
|
import org.apache.commons.collections4.CollectionUtils;
|
|
@@ -99,25 +100,25 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
@Resource
|
|
|
private ProjectReportWorkAttachmentMapper attachmentMapper;
|
|
|
|
|
|
- @Resource
|
|
|
- private SerialnumTplService serialnumTplService;
|
|
|
-
|
|
|
- @Resource
|
|
|
- private OssService ossService;
|
|
|
+// @Resource
|
|
|
+// private SerialnumTplService serialnumTplService;
|
|
|
|
|
|
- @Resource
|
|
|
- private OssServiceMapper ossServiceMapper;
|
|
|
+// @Resource
|
|
|
+// private OssService ossService;
|
|
|
+//
|
|
|
+// @Resource
|
|
|
+// private OssServiceMapper ossServiceMapper;
|
|
|
|
|
|
@Resource
|
|
|
private CwProjectReportCancelMapper cancelMapper;
|
|
|
|
|
|
- @Autowired
|
|
|
- private UserService userService;
|
|
|
- @Autowired
|
|
|
- private OSSClientService ossClientService;
|
|
|
+// @Autowired
|
|
|
+// private UserService userService;
|
|
|
+// @Autowired
|
|
|
+// private OSSClientService ossClientService;
|
|
|
|
|
|
- @Resource
|
|
|
- private UserMapper userMapper;
|
|
|
+// @Resource
|
|
|
+// private UserMapper userMapper;
|
|
|
|
|
|
@Resource
|
|
|
private CwProjectReportSignatureMapper cwProjectReportSignatureMapper;
|
|
@@ -175,7 +176,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String update(CwProjectReportData reportData) throws Exception{
|
|
|
//获取当前登录人信息
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
|
|
|
CwProjectReport report = new CwProjectReport();
|
|
|
BeanUtils.copyProperties(reportData, report);
|
|
@@ -190,16 +191,27 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
infoData.setOpinionType(report.getOpinionType());
|
|
|
infoData.setSealType(report.getSealType());
|
|
|
infoData.setServedUnitId(report.getServedUnitId());
|
|
|
- infoData.setUpdateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
+ infoData.setUpdateById(userDTO.getId());
|
|
|
+// infoData.setUpdateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
infoData.setUpdateTime(new Date());
|
|
|
infoMapper.updateCwProjectInfoDataById(infoData);
|
|
|
|
|
|
//对上传的文件数据进行持久化操作
|
|
|
List<ProjectReportWorkAttachmentDTO> cwFileInfoList = report.getCwFileInfoList();
|
|
|
- List<WorkAttachmentDto> cwFileInfoList2 = report.getCwFileInfoList2();
|
|
|
+ List<WorkAttachmentInfo> cwFileInfoList2 = report.getCwFileInfoList2();
|
|
|
if (CollectionUtils.isNotEmpty(cwFileInfoList2)) {
|
|
|
// updateFiles2(cwFileInfoList2, userDTO, report.getId());
|
|
|
- ossService.saveOrUpdateFileList(cwFileInfoList2,report.getId(),"cwWorkContract");
|
|
|
+// ossService.saveOrUpdateFileList(cwFileInfoList2,report.getId(),"cwWorkContract");
|
|
|
+
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ String fileList = JSON.toJSONString((cwFileInfoList2));
|
|
|
+ String attachmentId = report.getId();
|
|
|
+ String attachmentFlag = "cwWorkContract";
|
|
|
+ map.put("fileList",fileList);
|
|
|
+ map.put("attachmentId",attachmentId);
|
|
|
+ map.put("attachmentFlag",attachmentFlag);
|
|
|
+ map.put("currentToken",TokenProvider.getCurrentToken ( ));
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).saveOrUpdateFileList(map);
|
|
|
|
|
|
} else if (CollectionUtils.isNotEmpty(cwFileInfoList)) {
|
|
|
updateFiles(cwFileInfoList, userDTO, report.getId());
|
|
@@ -211,8 +223,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
fileId.forEach(fidId->{
|
|
|
attachmentMapper.deleteById(fidId);
|
|
|
});
|
|
|
-
|
|
|
- ossServiceMapper.deleteById(id);
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(id);
|
|
|
+// ossServiceMapper.deleteById(id);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -245,17 +257,19 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public String add(CwProjectReportData reportData) throws Exception{
|
|
|
//获取当前登录人信息
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
if(StringUtils.isBlank(reportData.getId())){
|
|
|
//单据编号生成
|
|
|
- String documentNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportDTO.BIZ_CODE);
|
|
|
+ String documentNo = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportDTO.BIZ_CODE,TokenProvider.getCurrentToken());
|
|
|
+// String documentNo = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportDTO.BIZ_CODE);
|
|
|
reportData.setDocumentNo(documentNo);
|
|
|
}
|
|
|
CwProjectReport report = new CwProjectReport();
|
|
|
BeanUtils.copyProperties(reportData, report);
|
|
|
if (ObjectUtil.isNotEmpty(report)) {
|
|
|
if (StringUtils.isBlank(report.getCreateById())) {
|
|
|
- report.setCreateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
+ report.setCreateById(userDTO.getId());
|
|
|
+// report.setCreateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
|
report.setId(id);
|
|
|
}
|
|
@@ -263,9 +277,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
//对新增行数据进行持久化操作
|
|
|
CwProjectInfoData infoData = new CwProjectInfoData();
|
|
|
// List<CwProjectInfoData> infoList = new ArrayList<>();
|
|
|
- infoData.setCreateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
+ infoData.setCreateById(userDTO.getId());
|
|
|
+// infoData.setCreateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
infoData.setCreateTime(new Date());
|
|
|
- infoData.setUpdateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
+ infoData.setUpdateById(userDTO.getId());
|
|
|
+// infoData.setUpdateById(UserUtils.getCurrentUserDTO().getId());
|
|
|
infoData.setUpdateTime(new Date());
|
|
|
infoData.setReportId(report.getId());
|
|
|
String id = UUID.randomUUID().toString().replace("-", "");
|
|
@@ -317,20 +333,23 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
infoMapper.insert(infoData);
|
|
|
|
|
|
//对上传的附件进行持久化操作
|
|
|
- List<WorkAttachmentDto> fileInfoList2 = new ArrayList<>();
|
|
|
+ List<WorkAttachmentInfo> fileInfoList2 = new ArrayList<>();
|
|
|
if ( null !=report.getCwFileInfoList2()){
|
|
|
fileInfoList2 = report.getCwFileInfoList2();
|
|
|
}
|
|
|
- ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, report.getId()));
|
|
|
+// ossServiceMapper.delete(new QueryWrapper<WorkAttachmentInfo>().lambda().eq(WorkAttachmentInfo::getAttachmentId, report.getId()));
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByAttachmentId(report.getId());
|
|
|
|
|
|
AtomicInteger j2 = new AtomicInteger(1);
|
|
|
if (fileInfoList2 != null){
|
|
|
fileInfoList2.forEach(item -> {
|
|
|
- WorkAttachment i = new WorkAttachment();
|
|
|
+ WorkAttachmentInfo i = new WorkAttachmentInfo();
|
|
|
//包含了url、size、name
|
|
|
i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
i.setCreateTime(new Date());
|
|
|
i.setUpdateTime(new Date());
|
|
|
+ i.setCreateById(userDTO.getId());
|
|
|
+ i.setUpdateById(userDTO.getId());
|
|
|
i.setDelFlag(0);
|
|
|
i.setUrl(item.getUrl());
|
|
|
//文件类型处理
|
|
@@ -343,7 +362,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
i.setAttachmentFlag("cw_project_report");
|
|
|
i.setFileSize(item.getSize());
|
|
|
i.setSort(j2.get());
|
|
|
- ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
+
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ String workAttachment = JSON.toJSONString((i));
|
|
|
+ String userDTOInfo = JSON.toJSONString((userDTO));
|
|
|
+ map.put("workAttachment",workAttachment);
|
|
|
+ map.put("userDTO",userDTOInfo);
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
|
+
|
|
|
+// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -352,11 +379,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
if ( null !=report.getCwFileInfoList()){
|
|
|
fileInfoList = report.getCwFileInfoList();
|
|
|
}
|
|
|
-// ossServiceMapper.delete(new QueryWrapper<WorkAttachment>().lambda().eq(WorkAttachment::getAttachmentId, report.getId()));
|
|
|
+// ossServiceMapper.delete(new QueryWrapper<WorkAttachmentInfo>().lambda().eq(WorkAttachmentInfo::getAttachmentId, report.getId()));
|
|
|
AtomicInteger j = new AtomicInteger(1);
|
|
|
if (fileInfoList != null){
|
|
|
fileInfoList.forEach(item -> {
|
|
|
- WorkAttachment i = new WorkAttachment();
|
|
|
+ WorkAttachmentInfo i = new WorkAttachmentInfo();
|
|
|
//包含了url、size、name
|
|
|
i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
i.setCreateTime(new Date());
|
|
@@ -373,7 +400,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
i.setAttachmentFlag("cw_project_report_file");
|
|
|
i.setFileSize(item.getSize());
|
|
|
i.setSort(j.get());
|
|
|
- ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
+
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ String workAttachment = JSON.toJSONString((i));
|
|
|
+ String userDTOInfo = JSON.toJSONString((userDTO));
|
|
|
+ map.put("workAttachment",workAttachment);
|
|
|
+ map.put("userDTO",userDTOInfo);
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
|
+
|
|
|
+// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
j.getAndIncrement();
|
|
|
CwProjectReportFile cwProjectReportFile = CwProjectReportFileWrapper.INSTANCE.toEntity(item);
|
|
|
cwProjectReportFile.setReportFileId(i.getId());
|
|
@@ -502,7 +537,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
String isBmzr = "0";
|
|
|
StringBuilder officeIds = new StringBuilder();
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
+// UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
List<String> manageOfficeIdList= Lists.newArrayList();
|
|
|
|
|
|
|
|
@@ -597,11 +633,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
|
|
|
//将附件信息查出
|
|
|
// 查询附件信息
|
|
|
- List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(id);
|
|
|
- List<WorkAttachmentDto> reportFileList = Lists.newArrayList();
|
|
|
+ List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(id);
|
|
|
+ List<WorkAttachmentInfo> reportFileList = Lists.newArrayList();
|
|
|
if(CollectionUtils.isNotEmpty(dtos) && CollectionUtils.isNotEmpty(fileInfo2)){
|
|
|
for (ProjectReportWorkAttachmentDTO dto : dtos) {
|
|
|
- for (WorkAttachmentDto workAttachmentDto : fileInfo2) {
|
|
|
+ for (WorkAttachmentInfo workAttachmentDto : fileInfo2) {
|
|
|
if(dto.getId().equals(workAttachmentDto.getId())){
|
|
|
reportFileList.add(workAttachmentDto);
|
|
|
}
|
|
@@ -610,8 +646,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
- for (WorkAttachmentDto i : reportFileList) {
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ for (WorkAttachmentInfo i : reportFileList) {
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
reportData.setCwFileInfoList2(reportFileList);
|
|
@@ -750,10 +786,10 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
reportData.setSignatureFileList(signatureList);
|
|
|
}
|
|
|
// 查询附件信息
|
|
|
- List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(reportData.getId());
|
|
|
+ List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(reportData.getId());
|
|
|
if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
- for (WorkAttachmentDto i : fileInfo2) {
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ for (WorkAttachmentInfo i : fileInfo2) {
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
reportData.setCwFileInfoList2(fileInfo2);
|
|
@@ -935,10 +971,10 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
//将附件信息查出
|
|
|
// 查询附件信息
|
|
|
- List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(id);
|
|
|
+ List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(id);
|
|
|
if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
- for (WorkAttachmentDto i : fileInfo2) {
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ for (WorkAttachmentInfo i : fileInfo2) {
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
reportData.setCwFileInfoList2(fileInfo2);
|
|
@@ -1084,10 +1120,10 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
reportData.setSignatureFileList(signatureList);
|
|
|
}
|
|
|
// 查询附件信息
|
|
|
- List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(reportData.getId());
|
|
|
+ List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(reportData.getId());
|
|
|
if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
- for (WorkAttachmentDto i : fileInfo2) {
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ for (WorkAttachmentInfo i : fileInfo2) {
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
reportData.setCwFileInfoList2(fileInfo2);
|
|
@@ -1362,7 +1398,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
// }
|
|
|
// }
|
|
|
//报告类型
|
|
|
- String reportType = DictUtils.getDictLabel(reportData.getReportType(), "cw_report_title_type", "");
|
|
|
+ String reportType = SpringUtil.getBean ( IDictApi.class ).getDictLabel(reportData.getReportType(), "cw_report_title_type", "");
|
|
|
+// String reportType = DictUtils.getDictLabel(reportData.getReportType(), "cw_report_title_type", "");
|
|
|
if(StringUtils.isNotBlank(reportType)){
|
|
|
data.put("type",reportType);
|
|
|
}else{
|
|
@@ -1850,7 +1887,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
//删除被服务单位信息
|
|
|
infoMapper.deleteById(infoData.getId());
|
|
|
//查询保存的附件信息
|
|
|
- List<WorkAttachment> infoList = reportMapper.findFileList(ids);
|
|
|
+ List<WorkAttachmentInfo> infoList = reportMapper.findFileList(ids);
|
|
|
//删除附件信息
|
|
|
infoList.forEach(in->{
|
|
|
//删除新建行文件表id
|
|
@@ -1858,7 +1895,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
fileId.forEach(fid->{
|
|
|
attachmentMapper.deleteById(fid);
|
|
|
});
|
|
|
- ossServiceMapper.deleteById(in.getId());
|
|
|
+// ossServiceMapper.deleteById(in.getId());
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(in.getId());
|
|
|
});
|
|
|
|
|
|
/*idList.forEach(info->{
|
|
@@ -1918,7 +1956,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
public Map<String,Object> createSignatureContractId(CwProjectReportData projectReportData){
|
|
|
Map<String,Object> map = new HashMap<String,Object>();
|
|
|
//查询报告文件信息(电子章)
|
|
|
- //List<WorkAttachment> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
|
|
|
+ //List<WorkAttachmentInfo> fileList = attachmentMapper.selectWorkAttachmentByReportId(projectReportData.getId());
|
|
|
List<WorkAttachmentInfo> fileList = SpringUtil.getBean ( IWorkAttachmentApi.class ).selectWorkAttachmentByAttachmentId(projectReportData.getId());
|
|
|
if(fileList.size()>0){
|
|
|
|
|
@@ -1956,7 +1994,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
cons = aliDownloadUrl;
|
|
|
}
|
|
|
String ossKey = file.split(cons+"/")[1];
|
|
|
- ossClientService.downByStreamSaveLocal(ossKey,fileName,path+fileName);
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).downByStreamSaveLocal(ossKey,fileName,path+fileName);
|
|
|
+// ossClientService.downByStreamSaveLocal(ossKey,fileName,path+fileName);
|
|
|
//将下载下来的文件转换为file文件
|
|
|
File srcFile = new File(path+fileName);
|
|
|
deleteFile = path+fileName;
|
|
@@ -2084,10 +2123,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
|
|
|
//根据角色信息录入签署方信息
|
|
|
//负责人
|
|
|
- List<UserDTO> userInfoByRoleNameList = userService.getUserInfoByEnName("qzglr");
|
|
|
+ List<UserDTO> userInfoByRoleNameList = SpringUtil.getBean(IUserApi.class).getUserInfoByEnName("qzglr");
|
|
|
+// List<UserDTO> userInfoByRoleNameList = userService.getUserInfoByEnName("qzglr");
|
|
|
if(userInfoByRoleNameList.size()>0){
|
|
|
|
|
|
- UserDTO user = UserUtils.get(userInfoByRoleNameList.get(0).getId());
|
|
|
+ UserDTO user = SpringUtil.getBean ( IUserApi.class ).getById(userInfoByRoleNameList.get(0).getId());
|
|
|
|
|
|
if(null != user){
|
|
|
//获取成员印章id信息
|
|
@@ -2139,7 +2179,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
if(StringUtils.isNotBlank(projectReportData.getSignatureType()) && "2".equals(projectReportData.getSignatureType())){
|
|
|
//判定签字注师1参数是否为空
|
|
|
if(StringUtils.isNotBlank(projectReportData.getSignatureAnnotator1())){
|
|
|
- UserDTO signatureAnnotator1 = UserUtils.get(projectReportData.getSignatureAnnotator1());
|
|
|
+ UserDTO signatureAnnotator1 = SpringUtil.getBean ( IUserApi.class ).getById(projectReportData.getSignatureAnnotator1());
|
|
|
if(null != signatureAnnotator1){
|
|
|
|
|
|
//创建个人职业章参数(签字注师1)
|
|
@@ -2191,7 +2231,7 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
|
|
|
//判定签字注师1参数是否为空
|
|
|
if(StringUtils.isNotBlank(projectReportData.getSignatureAnnotator1())){
|
|
|
- UserDTO signatureAnnotator2 = UserUtils.get(projectReportData.getSignatureAnnotator2());
|
|
|
+ UserDTO signatureAnnotator2 = SpringUtil.getBean ( IUserApi.class ).getById(projectReportData.getSignatureAnnotator2());
|
|
|
if(null != signatureAnnotator2){
|
|
|
|
|
|
//创建个人职业章参数(签字注师1)
|
|
@@ -2337,11 +2377,12 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
names = names + "," +dto.getUrl();
|
|
|
}
|
|
|
//查询保存的附件信息
|
|
|
- List<WorkAttachment> infoList = reportMapper.findFileList(id);
|
|
|
+ List<WorkAttachmentInfo> infoList = reportMapper.findFileList(id);
|
|
|
if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
|
|
|
- for (WorkAttachment i : infoList) {
|
|
|
+ for (WorkAttachmentInfo i : infoList) {
|
|
|
if (!names.contains(i.getUrl())) {
|
|
|
- ossServiceMapper.deleteById(i.getId());
|
|
|
+// ossServiceMapper.deleteById(i.getId());
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
|
|
|
List<String> fileId = attachmentMapper.getFileId(i.getId());
|
|
|
fileId.forEach(fid->{
|
|
|
attachmentMapper.deleteById(fid);
|
|
@@ -2355,12 +2396,12 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
//判断是否存在
|
|
|
Integer isExit = reportMapper.findIsExit(id, dto.getName());
|
|
|
if (isExit == 0) {
|
|
|
- WorkAttachment i = new WorkAttachment();
|
|
|
+ WorkAttachmentInfo i = new WorkAttachmentInfo();
|
|
|
//包含了url、size、name
|
|
|
i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
-// i.getCreateBy().setId(userDTO.getId());
|
|
|
+ i.setCreateById(userDTO.getId());
|
|
|
i.setCreateTime(new Date());
|
|
|
-// i.getUpdateBy().setId(userDTO.getId());
|
|
|
+ i.setUpdateById(userDTO.getId());
|
|
|
i.setUpdateTime(new Date());
|
|
|
i.setDelFlag(0);
|
|
|
i.setUrl(dto.getUrl());
|
|
@@ -2374,7 +2415,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
i.setAttachmentFlag("cwWorkContract");
|
|
|
i.setFileSize(dto.getSize());
|
|
|
i.setSort(j);
|
|
|
- ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
+// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
+
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ String workAttachment = JSON.toJSONString((i));
|
|
|
+ String userDTOInfo = JSON.toJSONString((userDTO));
|
|
|
+ map.put("workAttachment",workAttachment);
|
|
|
+ map.put("userDTO",userDTOInfo);
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
|
+
|
|
|
CwProjectReportFile reportFile = new CwProjectReportFile();
|
|
|
BeanUtils.copyProperties(dto, reportFile);
|
|
|
reportFile.setReportFileId(i.getId());
|
|
@@ -2403,11 +2452,12 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
names = names + "," +dto.getUrl();
|
|
|
}
|
|
|
//查询保存的附件信息
|
|
|
- List<WorkAttachment> infoList = reportMapper.findFileList(id);
|
|
|
+ List<WorkAttachmentInfo> infoList = reportMapper.findFileList(id);
|
|
|
if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
|
|
|
- for (WorkAttachment i : infoList) {
|
|
|
+ for (WorkAttachmentInfo i : infoList) {
|
|
|
if (!names.contains(i.getUrl())) {
|
|
|
- ossServiceMapper.deleteById(i.getId());
|
|
|
+// ossServiceMapper.deleteById(i.getId());
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
|
|
|
List<String> fileId = attachmentMapper.getFileId(i.getId());
|
|
|
fileId.forEach(fid->{
|
|
|
attachmentMapper.deleteById(fid);
|
|
@@ -2419,11 +2469,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
reportMapper.deleteAttachement(id,"cwReportSignature");
|
|
|
//保存信息
|
|
|
for (ProjectReportWorkAttachmentDTO dto : list) {
|
|
|
- WorkAttachment i = new WorkAttachment();
|
|
|
+ WorkAttachmentInfo i = new WorkAttachmentInfo();
|
|
|
//包含了url、size、name
|
|
|
i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
if(infoList.size()>0){
|
|
|
- userDTO = UserUtils.get(infoList.get(0).getCreateById());
|
|
|
+ userDTO = SpringUtil.getBean ( IUserApi.class ).getById(infoList.get(0).getCreateById());
|
|
|
i.setCreateTime(infoList.get(0).getCreateTime());
|
|
|
i.setUpdateTime(infoList.get(0).getUpdateTime());
|
|
|
}else{
|
|
@@ -2444,7 +2494,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
i.setAttachmentFlag("cwReportSignature");
|
|
|
i.setFileSize(dto.getSize());
|
|
|
i.setSort(j);
|
|
|
- ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
+// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
+
|
|
|
+ Map<String,String> map = new HashMap<>();
|
|
|
+ String workAttachment = JSON.toJSONString((i));
|
|
|
+ String userDTOInfo = JSON.toJSONString((userDTO));
|
|
|
+ map.put("workAttachment",workAttachment);
|
|
|
+ map.put("userDTO",userDTOInfo);
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
|
+
|
|
|
CwProjectReportFile reportFile = new CwProjectReportFile();
|
|
|
BeanUtils.copyProperties(dto, reportFile);
|
|
|
reportFile.setReportFileId(i.getId());
|
|
@@ -2615,14 +2673,15 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
|
|
|
public void saveReportArchive (String reportId) throws Exception {
|
|
|
- UserDTO userDTO = UserUtils.getCurrentUserDTO();
|
|
|
+ UserDTO userDTO = SpringUtil.getBean ( IUserApi.class ).getByToken(TokenProvider.getCurrentToken ( ));
|
|
|
CwProjectReport cwProjectReport = cwProjectReportService.getCwProjectReportById(reportId);
|
|
|
CwProjectReportArchive cwProjectReportArchive = new CwProjectReportArchive();
|
|
|
cwProjectReportArchive.setStatus("0");
|
|
|
cwProjectReportArchive.setReportId(reportId);
|
|
|
cwProjectReportArchive.setCreateById(cwProjectReport.getCreateById());
|
|
|
cwProjectReportArchive.setProjectId(cwProjectReport.getProjectId());
|
|
|
- String fileNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportArchiveDTO.BIZ_CODE);
|
|
|
+ String fileNumber = SpringUtil.getBean ( IWorkAttachmentApi.class ).genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportArchiveDTO.BIZ_CODE,TokenProvider.getCurrentToken());
|
|
|
+// String fileNumber = serialnumTplService.genSerialNum(userDTO.getCompanyDTO().getId(), CwProjectReportArchiveDTO.BIZ_CODE);
|
|
|
cwProjectReportArchive.setFileNumber(fileNumber);
|
|
|
cwProjectReportArchiveMapper.insert(cwProjectReportArchive);
|
|
|
}
|
|
@@ -2646,7 +2705,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
// 删除已盖章的附件
|
|
|
// 1. 查询到当前报告的附件
|
|
|
- List<WorkAttachment> workAttachments = ossServiceMapper.selectList(new LambdaQueryWrapper<WorkAttachment>().eq(WorkAttachment::getAttachmentId, reportId));
|
|
|
+// List<WorkAttachmentInfo> workAttachments = ossServiceMapper.selectList(new LambdaQueryWrapper<WorkAttachmentInfo>().eq(WorkAttachmentInfo::getAttachmentId, reportId));
|
|
|
+ List<WorkAttachmentInfo> workAttachments = SpringUtil.getBean(IWorkAttachmentApi.class).selectListByAttachmentId(reportId);
|
|
|
// 2. 查询哪些附件是已盖章的
|
|
|
List<String> delIds = new ArrayList<>();
|
|
|
workAttachments.stream().forEach(item -> {
|
|
@@ -2661,7 +2721,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
});
|
|
|
// 4. 删除已盖章的附件(附件表 work_attachment)
|
|
|
if (CollectionUtil.isNotEmpty(delIds)) {
|
|
|
- ossServiceMapper.deleteBatchIds(delIds); // 逻辑删除
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteByIds(JSON.toJSONString(delIds));
|
|
|
+// ossServiceMapper.deleteBatchIds(delIds); // 逻辑删除
|
|
|
}
|
|
|
// 5. 根据报告id删除报告归档信息 // 逻辑删除
|
|
|
cwProjectReportArchiveMapper.delete(new LambdaQueryWrapper<CwProjectReportArchive>().eq(CwProjectReportArchive::getReportId, reportId));
|
|
@@ -2749,11 +2810,11 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
|
|
|
//将附件信息查出
|
|
|
// 查询附件信息
|
|
|
- List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(id);
|
|
|
- List<WorkAttachmentDto> reportFileList = Lists.newArrayList();
|
|
|
+ List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(id);
|
|
|
+ List<WorkAttachmentInfo> reportFileList = Lists.newArrayList();
|
|
|
if(CollectionUtils.isNotEmpty(dtos) && CollectionUtils.isNotEmpty(fileInfo2)){
|
|
|
for (ProjectReportWorkAttachmentDTO dto : dtos) {
|
|
|
- for (WorkAttachmentDto workAttachmentDto : fileInfo2) {
|
|
|
+ for (WorkAttachmentInfo workAttachmentDto : fileInfo2) {
|
|
|
if(dto.getId().equals(workAttachmentDto.getId())){
|
|
|
reportFileList.add(workAttachmentDto);
|
|
|
}
|
|
@@ -2762,8 +2823,8 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
}
|
|
|
|
|
|
if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
- for (WorkAttachmentDto i : reportFileList) {
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ for (WorkAttachmentInfo i : reportFileList) {
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
reportData.setCwFileInfoList2(reportFileList);
|
|
@@ -2902,10 +2963,10 @@ public class CwProjectReportService extends ServiceImpl<CwProjectReportMapper, C
|
|
|
reportData.setSignatureFileList(signatureList);
|
|
|
}
|
|
|
// 查询附件信息
|
|
|
- List<WorkAttachmentDto> fileInfo2 = reportMapper.findDtos(reportData.getId());
|
|
|
+ List<WorkAttachmentInfo> fileInfo2 = reportMapper.findDtos(reportData.getId());
|
|
|
if (CollectionUtils.isNotEmpty(dtos)) {
|
|
|
- for (WorkAttachmentDto i : fileInfo2) {
|
|
|
- i.setCreateBy(UserUtils.get(i.getBy()));
|
|
|
+ for (WorkAttachmentInfo i : fileInfo2) {
|
|
|
+ i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
|
}
|
|
|
}
|
|
|
reportData.setCwFileInfoList2(fileInfo2);
|