From cf9a5039e6db9d1d5963e3fe1a37d00169ec2ef7 Mon Sep 17 00:00:00 2001
From: whyclxw <810412026@qq.com>
Date: 星期三, 25 六月 2025 11:18:22 +0800
Subject: [PATCH] 验收报告修改

---
 src/main/java/com/whyc/service/DefectiveProductsHistoryService.java |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/src/main/java/com/whyc/service/DefectiveProductsHistoryService.java b/src/main/java/com/whyc/service/DefectiveProductsHistoryService.java
index 9f17da9..9b0d6ac 100644
--- a/src/main/java/com/whyc/service/DefectiveProductsHistoryService.java
+++ b/src/main/java/com/whyc/service/DefectiveProductsHistoryService.java
@@ -10,6 +10,7 @@
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
+import javax.xml.crypto.Data;
 import java.io.File;
 import java.io.IOException;
 import java.util.Date;
@@ -25,24 +26,31 @@
     public void addHis(DefectiveProducts defective) {
         DefectiveProductsHistory his=new DefectiveProductsHistory();
         his.setDeftId(defective.getId());
-        his.setRecordTime(defective.getStartTime());
-        his.setBadProduct(defective.getBadProduct());
+        his.setRecordTime(defective.getRecordTime());
         his.setConfirmStatus(defective.getConfirmStatus());
         his.setNote(defective.getNote());
         his.setReceiverIds(defective.getReceiverIds());
         his.setReceiverNames(defective.getReceiverNames());
+        his.setDelProduct(0);
+        his.setDelId(defective.getSenderId());
+        his.setDelName(defective.getSenderName());
+        his.setRestProduct(defective.getRestProduct());
         mapper.insert(his);
     }
     //璁板綍澶勭悊璁板綍
     public void updateDefective( DefectiveProducts defective,DefectiveProductsHistory defectiveHis, List<MultipartFile> multipartFileList) {
-        defectiveHis.setRecordTime(new Date());
+        Date date=new Date();
+        defectiveHis.setRecordTime(date);
+        String recordTime=ActionUtil.sdfwithFTP.format(date);
         String delName = ActionUtil.getUser().getName();
         Integer delId =ActionUtil.getUser().getId().intValue();
         defectiveHis.setDelId(delId);
-        String time = ActionUtil.sdfwithday.format(defective.getStartTime());
+        defectiveHis.setDelName(delName);
+        String record = ActionUtil.sdfwithFTP.format(defective.getRecordTime());
         String rootFile = CommonUtil.getRootFile();
         if(multipartFileList!=null && multipartFileList.size()!=0){
-            String defectiveDirSuffix = "defective" + File.separator + defective.getSenderName() + File.separator + time + File.separator+delName+File.separator;
+            String defectiveDirSuffix = "defective" + File.separator + defective.getSenderName() + File.separator+ record + File.separator
+                    +delName+File.separator+recordTime+File.separator;
             String feedbackDir = rootFile + defectiveDirSuffix;
             File fileDir = new File(feedbackDir);
             if (!fileDir.exists()) {
@@ -62,7 +70,7 @@
                     e.printStackTrace();
                 }
             }
-            defective.setFileUrl("doc_file" + File.separator + defectiveDirSuffix);
+            defectiveHis.setDelUrl(defectiveDirSuffix);
         }
         mapper.insert(defectiveHis);
     }

--
Gitblit v1.9.1