|
@@ -14,12 +14,17 @@ import com.jeeplus.core.query.QueryWrapperGenerator;
|
|
import com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper;
|
|
import com.jeeplus.finance.contractRegistration.mapper.ContractInfoMapper;
|
|
import com.jeeplus.finance.invoice.util.SignaturePostUtil;
|
|
import com.jeeplus.finance.invoice.util.SignaturePostUtil;
|
|
import com.jeeplus.finance.projectReport.domain.*;
|
|
import com.jeeplus.finance.projectReport.domain.*;
|
|
|
|
+import com.jeeplus.finance.projectReport.mapper.CwProjectReportMapper;
|
|
|
|
+import com.jeeplus.finance.projectReport.service.dto.ProjectReportWorkAttachmentDTO;
|
|
import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.CwReimbursementInfo;
|
|
import com.jeeplus.finance.reimbursementApproval.approvalInfo.domain.CwReimbursementInfo;
|
|
import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.QueryListDto;
|
|
import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.QueryListDto;
|
|
import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.RetureListDto;
|
|
import com.jeeplus.finance.reimbursementApproval.approvalInfo.service.dto.RetureListDto;
|
|
|
|
+import com.jeeplus.finance.signatureDaily.domain.CwSignatureDailyFile;
|
|
import com.jeeplus.finance.signatureDaily.domain.SignatureDailyOfficeWork;
|
|
import com.jeeplus.finance.signatureDaily.domain.SignatureDailyOfficeWork;
|
|
|
|
+import com.jeeplus.finance.signatureDaily.mapper.SignatureDailyFileMapper;
|
|
import com.jeeplus.finance.signatureDaily.mapper.SignatureDailyOfficeWorkMapper;
|
|
import com.jeeplus.finance.signatureDaily.mapper.SignatureDailyOfficeWorkMapper;
|
|
import com.jeeplus.finance.signatureDaily.service.dto.SignatureDailyOfficeWorkDTO;
|
|
import com.jeeplus.finance.signatureDaily.service.dto.SignatureDailyOfficeWorkDTO;
|
|
|
|
+import com.jeeplus.finance.signatureDaily.service.dto.SignatureDailyWorkAttachmentDTO;
|
|
import com.jeeplus.finance.utils.Global;
|
|
import com.jeeplus.finance.utils.Global;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
import com.jeeplus.flowable.feign.IFlowableApi;
|
|
import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
import com.jeeplus.sys.domain.WorkAttachmentInfo;
|
|
@@ -59,6 +64,12 @@ public class SignatureDaulyOfficeWorkService {
|
|
@Resource
|
|
@Resource
|
|
private IFlowableApi flowTaskService;
|
|
private IFlowableApi flowTaskService;
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private SignatureDailyFileMapper signatureDailyFileMapper;
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ private CwProjectReportMapper reportMapper;
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 列表查询
|
|
* 列表查询
|
|
@@ -175,6 +186,39 @@ public class SignatureDaulyOfficeWorkService {
|
|
i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
i.setCreateBy(SpringUtil.getBean ( IUserApi.class ).getById(i.getBy()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ //查询已签章附件
|
|
|
|
+ List<SignatureDailyWorkAttachmentDTO> signatureList = new ArrayList<>();
|
|
|
|
+ if (null !=dailyOfficeWorkDTO){
|
|
|
|
+ List<SignatureDailyWorkAttachmentDTO> dtos = signatureDailyFileMapper.selectByInfoId(dailyOfficeWorkDTO.getId());
|
|
|
|
+ if (null != dtos){
|
|
|
|
+
|
|
|
|
+ Iterator<SignatureDailyWorkAttachmentDTO> it = dtos.iterator();
|
|
|
|
+ while(it.hasNext()){
|
|
|
|
+ SignatureDailyWorkAttachmentDTO d = it.next();
|
|
|
|
+ //根据id查出cw_project_report_file文件表的其他信息
|
|
|
|
+ //未签章附件
|
|
|
|
+ CwSignatureDailyFile file = signatureDailyFileMapper.selectInfoByFileId(d.getId());
|
|
|
|
+ if (null != file) {
|
|
|
|
+ d.setFileType(file.getFileType());
|
|
|
|
+ d.setSealType(file.getSealType());
|
|
|
|
+ d.setSealedFile(file.getSealedFile());
|
|
|
|
+ d.setSealUser(file.getSealUser());
|
|
|
|
+ d.setSealDate(file.getSealDate());
|
|
|
|
+ d.setRemarks(file.getRemarks());
|
|
|
|
+ UserDTO userDTO = new UserDTO();
|
|
|
|
+ //根据创建人id查出创建人名称
|
|
|
|
+ UserDTO byId = SpringUtil.getBean(IUserApi.class).getById(file.getCreateById());
|
|
|
|
+ userDTO.setId(file.getCreateById());
|
|
|
|
+ userDTO.setName(byId.getName());
|
|
|
|
+ d.setCreateBy(userDTO);
|
|
|
|
+ d.setCreateTime(file.getCreateTime());
|
|
|
|
+ signatureList.add(d);
|
|
|
|
+ it.remove();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ dto.setSignatureFiles(signatureList);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
dto.setFiles(fileList);
|
|
dto.setFiles(fileList);
|
|
}
|
|
}
|
|
return dto;
|
|
return dto;
|
|
@@ -200,13 +244,21 @@ public class SignatureDaulyOfficeWorkService {
|
|
signatureDailyOfficeWork.setUpdateById(userDTO.getId());
|
|
signatureDailyOfficeWork.setUpdateById(userDTO.getId());
|
|
signatureDailyOfficeWork.setUpdateTime(new Date());
|
|
signatureDailyOfficeWork.setUpdateTime(new Date());
|
|
signatureDailyOfficeWorkMapper.updateById(signatureDailyOfficeWork);
|
|
signatureDailyOfficeWorkMapper.updateById(signatureDailyOfficeWork);
|
|
|
|
+ // 修改附件信息列表
|
|
|
|
+ if ("5".equals(dto.getStatus())){
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
|
|
+ updateFiles2(dto.getFiles(), userDTO, dto.getId(),"signatureDaily");
|
|
|
|
+ }
|
|
|
|
+ }else {
|
|
|
|
+ if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
|
|
+ updateFiles(dto.getFiles(), userDTO, dto.getId(),"signatureDaily");
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //生成签章信息
|
|
if (StringUtils.isNotBlank(dto.getStatus())&&dto.getStatus().equals("2")){
|
|
if (StringUtils.isNotBlank(dto.getStatus())&&dto.getStatus().equals("2")){
|
|
this.getManualSignatureUrl(dto.getId());
|
|
this.getManualSignatureUrl(dto.getId());
|
|
}
|
|
}
|
|
- // 修改附件信息列表
|
|
|
|
- if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
|
|
- updateFiles(dto.getFiles(), userDTO, dto.getId(),"signatureDaily");
|
|
|
|
- }
|
|
|
|
return signatureDailyOfficeWork;
|
|
return signatureDailyOfficeWork;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -453,17 +505,19 @@ public class SignatureDaulyOfficeWorkService {
|
|
signatureDailyOfficeWork.setUpdateTime(new Date());
|
|
signatureDailyOfficeWork.setUpdateTime(new Date());
|
|
signatureDailyOfficeWork.setDelFlag(0);
|
|
signatureDailyOfficeWork.setDelFlag(0);
|
|
signatureDailyOfficeWorkMapper.insert(signatureDailyOfficeWork);
|
|
signatureDailyOfficeWorkMapper.insert(signatureDailyOfficeWork);
|
|
- //生成签章信息
|
|
|
|
- if ("2".equals(dto.getStatus())){
|
|
|
|
- this.getManualSignatureUrl(id);
|
|
|
|
- }
|
|
|
|
// 保存附件列表信息
|
|
// 保存附件列表信息
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
if (CollectionUtils.isNotEmpty(dto.getFiles())) {
|
|
saveFiles(dto.getFiles(), userDTO, id);
|
|
saveFiles(dto.getFiles(), userDTO, id);
|
|
}
|
|
}
|
|
|
|
+ //生成签章信息
|
|
|
|
+ if ("2".equals(dto.getStatus())){
|
|
|
|
+ this.getManualSignatureUrl(id);
|
|
|
|
+ }
|
|
return signatureDailyOfficeWork;
|
|
return signatureDailyOfficeWork;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 保存附件信息
|
|
* 保存附件信息
|
|
* @param list 待保存的附件列表
|
|
* @param list 待保存的附件列表
|
|
@@ -528,6 +582,68 @@ public class SignatureDaulyOfficeWorkService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ reportMapper.deleteAttachement(id,"signatureDaily");
|
|
|
|
+ //保存信息
|
|
|
|
+ for (WorkAttachmentInfo dto : list) {
|
|
|
|
+ //判断是否存在
|
|
|
|
+ Integer isExit = mapper.findIsExit(id, dto.getName());
|
|
|
|
+ if (isExit == 0) {
|
|
|
|
+ WorkAttachmentInfo i = new WorkAttachmentInfo();
|
|
|
|
+ //包含了url、size、name
|
|
|
|
+ i.setId(UUID.randomUUID().toString().replace("-", ""));
|
|
|
|
+// i.getCreateBy().setId(userDTO.getId());
|
|
|
|
+ i.setCreateTime(new Date());
|
|
|
|
+// i.getUpdateBy().setId(userDTO.getId());
|
|
|
|
+ i.setUpdateTime(new Date());
|
|
|
|
+ i.setDelFlag(0);
|
|
|
|
+ i.setUrl(dto.getUrl());
|
|
|
|
+ //文件类型处理
|
|
|
|
+ List<String> strings = Arrays.asList(dto.getName().split("\\."));
|
|
|
|
+ if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(strings)) {
|
|
|
|
+ i.setType(strings.get(1));
|
|
|
|
+ }
|
|
|
|
+ i.setAttachmentId(id);
|
|
|
|
+ i.setAttachmentName(dto.getName());
|
|
|
|
+ i.setAttachmentFlag(attachmentFlag);
|
|
|
|
+ i.setFileSize(dto.getSize());
|
|
|
|
+ i.setSort(j);
|
|
|
|
+ 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++;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * 修改附件信息
|
|
|
|
+ * @param list 待修改的附件列表
|
|
|
|
+ * @param userDTO 当前登录用户
|
|
|
|
+ * @param id 关联id
|
|
|
|
+ */
|
|
|
|
+ @Transactional(rollbackFor = Exception.class)
|
|
|
|
+ public void updateFiles2(List<WorkAttachmentInfo> list, UserDTO userDTO, String id, String attachmentFlag) {
|
|
|
|
+ int j = 1;
|
|
|
|
+ String names = new String();
|
|
|
|
+ //表中存在,但是传过来不存在,说明已删除,表中数据也要删除
|
|
|
|
+ for (WorkAttachmentInfo dto : list) {
|
|
|
|
+ names = names + "," +dto.getUrl();
|
|
|
|
+ }
|
|
|
|
+ //查询保存的附件信息
|
|
|
|
+ List<WorkAttachmentInfo> infoList = mapper.findListByIdAndAttachmentFlag(id,attachmentFlag);
|
|
|
|
+ if (org.flowable.editor.language.json.converter.util.CollectionUtils.isNotEmpty(infoList)) {
|
|
|
|
+ for (WorkAttachmentInfo i : infoList) {
|
|
|
|
+ if (!names.contains(i.getUrl())) {
|
|
|
|
+// ossServiceMapper.deleteById(i.getId());
|
|
|
|
+ SpringUtil.getBean ( IWorkAttachmentApi.class ).deleteById(i.getId());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ reportMapper.deleteAttachement(id,"signatureDaily");
|
|
//保存信息
|
|
//保存信息
|
|
for (WorkAttachmentInfo dto : list) {
|
|
for (WorkAttachmentInfo dto : list) {
|
|
//判断是否存在
|
|
//判断是否存在
|
|
@@ -559,6 +675,14 @@ public class SignatureDaulyOfficeWorkService {
|
|
map.put("userDTO",userDTOInfo);
|
|
map.put("userDTO",userDTOInfo);
|
|
SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
SpringUtil.getBean ( IWorkAttachmentApi.class ).insertWorkAttachment(map);
|
|
// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
// ossServiceMapper.insertWorkAttachment(i, userDTO);
|
|
|
|
+ CwSignatureDailyFile cwSignatureDailyFile = new CwSignatureDailyFile();
|
|
|
|
+ BeanUtils.copyProperties(dto, cwSignatureDailyFile);
|
|
|
|
+ cwSignatureDailyFile.setReportFileId(i.getId());
|
|
|
|
+ cwSignatureDailyFile.setCreateById(userDTO.getId());
|
|
|
|
+ cwSignatureDailyFile.setCreateTime(new Date());
|
|
|
|
+ cwSignatureDailyFile.setUpdateById(userDTO.getId());
|
|
|
|
+ cwSignatureDailyFile.setUpdateTime(new Date());
|
|
|
|
+ signatureDailyFileMapper.insert(cwSignatureDailyFile);
|
|
j++;
|
|
j++;
|
|
}
|
|
}
|
|
}
|
|
}
|