diff --git a/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java b/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java index ff6e9245..d7003f8f 100644 --- a/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java +++ b/src/main/java/com/xujie/sys/modules/pms/service/Impl/ProofingInformationServiceImpl.java @@ -111,7 +111,19 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic boolean deleteSuccessful = true; // 根据Id拿到旧数据 ProofingInformationData proofingInformationData = proofingInformationMapper.selecProofingOne(data.getProofingId()); - if (Objects.equals(data.getType(), 1)) { + boolean proofingNoChanged = false; + if (proofingInformationData != null) { + proofingNoChanged = !Objects.equals( + normalizeText(proofingInformationData.getProofingNo()), + normalizeText(data.getProofingNo()) + ); + } + String editStatus = normalizeText(data.getProofingStatus()); + if (editStatus.isEmpty() && proofingInformationData != null) { + editStatus = normalizeText(proofingInformationData.getProofingStatus()); + } + boolean editingInProgress = Objects.equals(editStatus, "进行中"); + if (editingInProgress && (Objects.equals(data.getType(), 1) || proofingNoChanged)) { copyErfExpApplyAttachmentsToProofDocument(data); } @@ -513,6 +525,23 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic if (src == null) { continue; } + QueryWrapper existsQw = new QueryWrapper<>(); + existsQw.eq("order_ref1", site) + .eq("order_ref2", String.valueOf(proofingId)) + .eq("order_ref3", docDefIdStr) + .eq("order_ref4", String.valueOf(projectId)) + .eq("order_ref5", String.valueOf(projectPartId)) + .eq("order_reftype", PROOF_OSS_REFTYPE) + .eq("new_file_name", src.getNewFileName()) + .eq("file_name", src.getFileName()); + if (src.getUrl() == null || src.getUrl().trim().isEmpty()) { + existsQw.isNull("url"); + } else { + existsQw.eq("url", src.getUrl()); + } + if (sysOssService.count(existsQw) > 0) { + continue; + } SysOssEntity n = new SysOssEntity(); n.setUrl(src.getUrl()); n.setNewFileName(src.getNewFileName()); @@ -520,8 +549,8 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic n.setFileType(src.getFileType()); n.setFileSuffix(src.getFileSuffix()); n.setFileTypeCode(src.getFileTypeCode()); - n.setCreatedBy(updateBy); - n.setCreateDate(now); + n.setCreatedBy(src.getCreatedBy()); + n.setCreateDate(src.getCreateDate()); n.setOrderRef1(site); n.setOrderRef2(String.valueOf(proofingId)); n.setOrderRef3(docDefIdStr); @@ -544,6 +573,10 @@ public class ProofingInformationServiceImpl implements ProofingInformationServic } } + private String normalizeText(String text) { + return text == null ? "" : text.trim(); + } + @Override @Transactional(rollbackFor = Exception.class) public void copyDocumentFileToDoc(ProofDocumentData data) {