From 5d9865a1b1d48cb3192ecce036f706ef582c1424 Mon Sep 17 00:00:00 2001
From: lxw <810412026@qq.com>
Date: 星期五, 19 八月 2022 09:47:17 +0800
Subject: [PATCH] 去掉所有的报错正常运行

---
 src/main/java/com/whyc/service/MaterialApprovingService.java |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/src/main/java/com/whyc/service/ComponentApprovingService.java b/src/main/java/com/whyc/service/MaterialApprovingService.java
similarity index 82%
rename from src/main/java/com/whyc/service/ComponentApprovingService.java
rename to src/main/java/com/whyc/service/MaterialApprovingService.java
index 081a83a..e77cd1f 100644
--- a/src/main/java/com/whyc/service/ComponentApprovingService.java
+++ b/src/main/java/com/whyc/service/MaterialApprovingService.java
@@ -4,8 +4,8 @@
 import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import com.whyc.dto.Response;
-import com.whyc.mapper.ComponentApprovingMapper;
-import com.whyc.pojo.ComponentApproving;
+import com.whyc.mapper.MaterialApprovingMapper;
+import com.whyc.pojo.MaterialApproving;
 import com.whyc.pojo.DocUser;
 import com.whyc.util.ActionUtil;
 import com.whyc.util.CommonUtil;
@@ -13,14 +13,12 @@
 import com.whyc.util.Zip4jUtil;
 import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
 import org.apache.poi.ss.usermodel.*;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import java.io.File;
 import java.io.IOException;
-import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
@@ -28,10 +26,10 @@
 import java.util.List;
 
 @Service
-public class ComponentApprovingService {
+public class MaterialApprovingService {
 
     @Resource
-    private ComponentApprovingMapper mapper;
+    private MaterialApprovingMapper mapper;
 
     /**
      *
@@ -41,7 +39,7 @@
      * @throws InvalidFormatException
      */
     public Response zipParse(MultipartFile file) throws IOException, InvalidFormatException {
-        List<ComponentApproving> list = new LinkedList<>();
+        List<MaterialApproving> list = new LinkedList<>();
         Response response = new Response();
         //妫�鏌ユ槸鍚︿负zip
         boolean isZip = Zip4jUtil.checkZipFileParam(file);
@@ -53,7 +51,7 @@
         DocUser user = ActionUtil.getUser();
         String dateFormat = new SimpleDateFormat("YYYY-MM").format(new Date());
         long timeStamp = System.currentTimeMillis();
-        String filePath = rootFile + File.separator + "component_approving" + File.separator + user.getName() + File.separator + dateFormat+ File.separator + timeStamp;
+        String filePath = rootFile + File.separator + "Material_approving" + File.separator + user.getName() + File.separator + dateFormat+ File.separator + timeStamp;
         File parentFile = new File(filePath);
         String originalFilename = file.getOriginalFilename();
         File zipFile = new File(filePath+File.separator+ originalFilename);
@@ -95,7 +93,7 @@
                     if(cellTemp.getStringCellValue().equals("")){
                         break;
                     }
-                    ComponentApproving approving = new ComponentApproving();
+                    MaterialApproving approving = new MaterialApproving();
                     approving.setCreateDate(new Date());
 
                     for (int m = 2; m < lastCellNum; m++) {
@@ -133,8 +131,8 @@
                 }
             }
         }
-        for (ComponentApproving componentApproving : list) {
-            if(componentApproving.getSubName()==null ||componentApproving.getSubName().equals("")){
+        for (MaterialApproving MaterialApproving : list) {
+            if(MaterialApproving.getSubName()==null ||MaterialApproving.getSubName().equals("")){
                 return response.set(1,false,"鎷掔粷瑙f瀽,excel鏂囦欢涓褰曞寘鍚悕绉颁负绌虹殑璁板綍");
             }
         }
@@ -142,31 +140,31 @@
         return response.setIII(1,true,list,nextTitle,"瑙f瀽瀹屾垚");
     }
 
-    public void insert(List<ComponentApproving> cApprovingList) {
+    public void insert(List<MaterialApproving> cApprovingList) {
         mapper.insertBatchSomeColumn(cApprovingList);
     }
 
-    public List<ComponentApproving> getListByStatus(int status) {
-        QueryWrapper<ComponentApproving> query = Wrappers.query();
+    public List<MaterialApproving> getListByStatus(int status) {
+        QueryWrapper<MaterialApproving> query = Wrappers.query();
         query.eq("status",status);
         return mapper.selectList(query);
     }
 
     public void endStatus(Integer mainId) {
-        UpdateWrapper<ComponentApproving> update = Wrappers.update();
+        UpdateWrapper<MaterialApproving> update = Wrappers.update();
         update.set("status",2).eq("main_id",mainId);
         mapper.update(null,update);
     }
 
-    public List<ComponentApproving> getListByMainId(Integer mainId) {
-        QueryWrapper<ComponentApproving> query = Wrappers.query();
+    public List<MaterialApproving> getListByMainId(Integer mainId) {
+        QueryWrapper<MaterialApproving> query = Wrappers.query();
         query.eq("main_id",mainId);
         return mapper.selectList(query);
     }
 
-    public ComponentApproving getListByComponentId(Integer componentId) {
-        QueryWrapper<ComponentApproving> query = Wrappers.query();
-        query.eq("component_id",componentId).last(" limit 1");
+    public MaterialApproving getListByMaterialId(Integer MaterialId) {
+        QueryWrapper<MaterialApproving> query = Wrappers.query();
+        query.eq("Material_id",MaterialId).last(" limit 1");
         return mapper.selectOne(query);
     }
 }

--
Gitblit v1.9.1