From 43b999fcc8e575eeb6a004937d792f35477fe423 Mon Sep 17 00:00:00 2001 From: "han\\hanst" Date: Wed, 15 Apr 2026 17:36:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8A=B6=E6=80=81=E6=98=AF=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E4=B8=AD=E7=BC=96=E8=BE=91=E4=B9=9F=E4=BC=9A=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=89=93=E6=A0=B7=E5=8D=95=E5=8F=B7=E8=A7=A6=E5=8F=91=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Impl/ProofingInformationServiceImpl.java | 39 +++++++++++++++++-- 1 file changed, 36 insertions(+), 3 deletions(-) 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) {