From 58a518f8bc23ed382f4da2a86b09024b063a620c Mon Sep 17 00:00:00 2001
From: 黎星凯 <13949086503@163.com>
Date: 星期一, 13 五月 2024 15:40:47 +0800
Subject: [PATCH] 20240511修改: 分发单优化, 分类,物品,分发单明细,采购单明细数据导入

---
 consum-base/src/main/java/com/consum/base/controller/LWhWarningConfigController.java |   88 ++++++++++++++++++++++++--------------------
 1 files changed, 48 insertions(+), 40 deletions(-)

diff --git a/consum-base/src/main/java/com/consum/base/controller/LWhWarningConfigController.java b/consum-base/src/main/java/com/consum/base/controller/LWhWarningConfigController.java
index e1610e4..91b671b 100644
--- a/consum-base/src/main/java/com/consum/base/controller/LWhWarningConfigController.java
+++ b/consum-base/src/main/java/com/consum/base/controller/LWhWarningConfigController.java
@@ -1,39 +1,5 @@
 package com.consum.base.controller;
 
-import cn.afterturn.easypoi.excel.ExcelImportUtil;
-import cn.afterturn.easypoi.excel.entity.ImportParams;
-import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
-import cn.hutool.core.convert.Convert;
-import com.consum.base.BaseController;
-import com.consum.base.config.WhWarningImportVerifyHandler;
-import com.consum.base.core.utils.CommonUtil;
-import com.consum.base.pojo.WarnConfImEntity;
-import com.consum.base.pojo.WhWarningConfigParam;
-import com.consum.base.pojo.query.WhWarningConfigQry;
-import com.consum.base.service.BaseWarehouseServiceImpl;
-import com.consum.base.service.LWhWarningConfigServiceImpl;
-import com.consum.model.po.BaseWarehouse;
-import com.consum.model.po.FinSysTenantUser;
-import com.consum.model.po.WhWarningConfig;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.walker.db.page.GenericPager;
-import com.walker.file.FileInfo;
-import com.walker.infrastructure.utils.NumberGenerator;
-import com.walker.web.ResponseCode;
-import com.walker.web.ResponseValue;
-import io.swagger.annotations.Api;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.core.io.ClassPathResource;
-import org.springframework.core.io.InputStreamResource;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.util.CollectionUtils;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.multipart.MultipartFile;
-
-import javax.annotation.Resource;
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
@@ -43,6 +9,48 @@
 import java.util.List;
 import java.util.Map;
 import java.util.stream.Collectors;
+
+import javax.annotation.Resource;
+
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.core.io.ClassPathResource;
+import org.springframework.core.io.InputStreamResource;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.util.CollectionUtils;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
+
+import com.consum.base.BaseController;
+import com.consum.base.core.utils.CommonUtil;
+import com.consum.base.core.utils.IdUtil;
+import com.consum.base.handler.WhWarningImportVerifyHandler;
+import com.consum.base.pojo.WarnConfImEntity;
+import com.consum.base.pojo.WhWarningConfigParam;
+import com.consum.base.pojo.query.WhWarningConfigQry;
+import com.consum.base.service.BaseWarehouseService;
+import com.consum.base.service.LWhWarningConfigService;
+import com.consum.model.po.BaseWarehouse;
+import com.consum.model.po.FinSysTenantUser;
+import com.consum.model.po.WhWarningConfig;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.walker.db.page.GenericPager;
+import com.walker.file.FileInfo;
+import com.walker.infrastructure.utils.NumberGenerator;
+import com.walker.web.ResponseCode;
+import com.walker.web.ResponseValue;
+
+import cn.afterturn.easypoi.excel.ExcelImportUtil;
+import cn.afterturn.easypoi.excel.entity.ImportParams;
+import cn.afterturn.easypoi.excel.entity.result.ExcelImportResult;
+import cn.hutool.core.convert.Convert;
+import io.swagger.annotations.Api;
 
 /**
  * @ClassName LWhWarningConfigController
@@ -57,9 +65,9 @@
 public class LWhWarningConfigController extends BaseController {
 
     @Resource
-    private LWhWarningConfigServiceImpl lWhWarningConfigService;
+    private LWhWarningConfigService lWhWarningConfigService;
     @Resource
-    private BaseWarehouseServiceImpl baseWarehouseService;
+    private BaseWarehouseService baseWarehouseService;
     private ObjectMapper mapper = new ObjectMapper();
 
     /**
@@ -123,7 +131,7 @@
                 return ResponseValue.error("搴撳瓨涓婇檺涓嶈兘灏忎簬涓嬮檺锛�");
             }
             WhWarningConfig whWarningConfig = new WhWarningConfig();
-            whWarningConfig.setId(NumberGenerator.getLongSequenceNumber());
+            whWarningConfig.setId(IdUtil.generateId());
             whWarningConfig.setWarehouseType(0);
             whWarningConfig.setBaseWarehouseId(baseWarehouseId);
             whWarningConfig.setBaseGoodsTemplateId(baseGoodsTemplateId);
@@ -222,7 +230,7 @@
      * @return 鑾峰彇椤圭洰瀵煎叆鐨勬ā鏉�
      * @throws IOException
      */
-    @PostMapping("getWarnConfImportTemplate")
+    @GetMapping("getWarnConfImportTemplate")
     public ResponseEntity<InputStreamResource> getProjectImportTemplate() throws IOException {
         // 浠庡綋鍓嶉」鐩祫婧愮洰褰曡幏鍙栨枃浠�
         org.springframework.core.io.Resource resource = new ClassPathResource("import/warningConfImp.xls");
@@ -299,7 +307,7 @@
                 for (WarnConfImEntity warnConfImEntity : houseModelList) {
                     // 鏂板
                     WhWarningConfig whWarningConfig = new WhWarningConfig();
-                    whWarningConfig.setId(NumberGenerator.getLongSequenceNumber());
+                    whWarningConfig.setId(IdUtil.generateId());
                     whWarningConfig.setWarehouseType(0);
                     whWarningConfig.setBaseWarehouseId(warnConfImEntity.getBaseWarehouseId());
                     whWarningConfig.setBaseGoodsTemplateId(warnConfImEntity.getGoodsTemplateId());
@@ -332,7 +340,7 @@
                         limitEditByModeInfo(whWarningConfig);
                     } else {
                         // 鏂板
-                        whWarningConfig.setId(NumberGenerator.getLongSequenceNumber());
+                        whWarningConfig.setId(IdUtil.generateId());
                         whWarningConfig.setBaseGoodsTemplateId(warnConfImEntity.getGoodsTemplateId());
                         if (whWarningConfig.getBaseGoodsModelsId() == null) {
                             whWarningConfig.setGoodsType(1);

--
Gitblit v1.9.1