From 469d41fe09ceec3dc5259d01a4060aac1448e09f Mon Sep 17 00:00:00 2001
From: zwl <1051256694@qq.com>
Date: 星期三, 03 九月 2025 09:59:34 +0800
Subject: [PATCH] 完善订单组托可用数据显示功能
---
zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java | 98 ++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 80 insertions(+), 18 deletions(-)
diff --git a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java
index ea9196f..d0bb41e 100644
--- a/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java
+++ b/zy-asrs-wms/src/main/java/com/zy/asrs/wms/controller/TagController.java
@@ -5,8 +5,10 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zy.asrs.common.domain.CodeRes;
+import com.zy.asrs.common.domain.entity.LocInPrintMatExcel;
import com.zy.asrs.common.domain.entity.MatExcel;
import com.zy.asrs.common.domain.entity.MatPrint;
+import com.zy.asrs.common.domain.entity.OutLocOrderExcel;
import com.zy.asrs.common.utils.*;
import com.zy.asrs.common.wms.entity.LocInPrintMat;
import com.zy.asrs.common.wms.entity.Mat;
@@ -221,23 +223,28 @@
if (Cools.isEmpty(mat)){
return R.error("鍝佸彿:"+locInPrintMat.getMatnr()+"涓嶅瓨鍦紝璇峰厛鏂板鍟嗗搧妗f锛侊紒锛�").add("鍝佸彿:"+locInPrintMat.getMatnr()+"涓嶅瓨鍦紝璇峰厛鏂板鍟嗗搧妗f锛侊紒锛�");
}
- // 鎵撳嵃鏁版嵁娉ㄥ叆
- MatPrint print = new MatPrint();
- print.setMatnr(mat.getMatnr());
- print.setBarcode(mat.getBarcode());
- print.setMaktx(mat.getMaktx());
- print.setSpecs(mat.getSpecs());
- print.setUnit(mat.getUnit());
- print.setMemo(mat.getMemo());
+ int count=1;
+ if(!Cools.isEmpty(locInPrintMat.getAnfme())){
+ count=locInPrintMat.getAnfme().intValue();
+ }
+ for(int i=1;i<=count;i++){
+ // 鎵撳嵃鏁版嵁娉ㄥ叆
+ MatPrint print = new MatPrint();
+ print.setMatnr(mat.getMatnr());
+ print.setBarcode(mat.getBarcode());
+ print.setMaktx(mat.getMaktx());
+ print.setSpecs(mat.getSpecs());
+ print.setUnit(mat.getUnit());
+ print.setMemo(mat.getMemo());
- print.setMaterial(mat.getMaterial());
- print.setDecrees(mat.getDecrees());
- print.setImgNum(mat.getImgNum());
- print.setWeight(String.valueOf(mat.getWeight()));
- print.setModel(mat.getModel());
- print.setLength(String.valueOf(mat.getLength()));
- print.setWidth(mat.getWidth());
- print.setHeight(mat.getHeight());
+ print.setMaterial(mat.getMaterial());
+ print.setDecrees(locInPrintMat.getDecrees());
+ print.setImgNum(mat.getImgNum());
+ print.setWeight(String.valueOf(mat.getWeight()));
+ print.setModel(mat.getModel());
+ print.setLength(String.valueOf(mat.getLength()));
+ print.setWidth(mat.getWidth());
+ print.setHeight(mat.getHeight());
// // 鎵撳嵃鏁版嵁娉ㄥ叆
// MatPrint print = new MatPrint();
// print.setMatnr(locInPrintMat.getMatnr());
@@ -247,8 +254,10 @@
// print.setLocNo(locInPrintMat.getLocNo());
// print.setOwnerId(locInPrintMat.getOwnerId());
// print.setOwner(locInPrintMat.getOwner$());
- print.setId(locInPrintMat.getId());
- res.add(print);
+ print.setId(locInPrintMat.getId());
+ res.add(print);
+ }
+
locInPrintMat.setUpdateTime(new Date());
locInPrintMat.setUpdateBy(getUserId());
locInPrintMat.setStatus(2);
@@ -296,4 +305,57 @@
return R.ok("鎴愬姛鍚屾"+listener.getTotal()+"鏉″晢鍝佹暟鎹�");
}
+
+ /**
+ * excel瀵煎叆妯℃澘涓嬭浇
+ */
+ @RequestMapping(value = "/out/loc/box/excel/import/mould")
+ public void outLocBoxExcelImportMould(HttpServletResponse response) throws IOException {
+ List<LocInPrintMatExcel> excels = new ArrayList<>();
+ response.setContentType("application/vnd.ms-excel");
+ response.setCharacterEncoding("utf-8");
+ String fileName = URLEncoder.encode("瀵煎叆寰呮墦鍗扮墿鏂欐ā鏉�", "UTF-8");
+ response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+ EasyExcel.write(response.getOutputStream(), LocInPrintMatExcel.class)
+ .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
+ .sheet("寰呮墦鍗扮墿鏂欐ā鏉�")
+ .doWrite(excels);
+ }
+
+ // excel瀵煎叆
+ @PostMapping(value = "/out/loc/box/excel/import/auth")
+ @ManagerAuth(memo = "瀵煎叆寰呮墦鍗扮墿鏂欐ā鏉�")
+ @Transactional
+ public R outLocBoxExcelImport(MultipartFile file) throws IOException {
+ LocInPrintMatExcelListener listener = new LocInPrintMatExcelListener(getUserId(), getHostId());
+ EasyExcel.read(file.getInputStream(), LocInPrintMatExcel.class, listener).sheet().doRead();
+ return R.ok("鎴愬姛瀵煎叆"+listener.getTotal()[0]+"绉嶅緟鎵撳嵃鐗╂枡淇℃伅锛屽叡鐢熸垚"+listener.getTotal()[1]+"鏉″緟鎵撳嵃鏉$爜锛�");
+ }
+
+ /**
+ * excel瀵煎叆妯℃澘涓嬭浇
+ */
+ @RequestMapping(value = "/out/loc/box/excel/import/out/mould")
+ public void outLocBoxExcelImportOutMould(HttpServletResponse response) throws IOException {
+ List<OutLocOrderExcel> excels = new ArrayList<>();
+ response.setContentType("application/vnd.ms-excel");
+ response.setCharacterEncoding("utf-8");
+ String fileName = URLEncoder.encode("瀵煎叆璁㈠崟淇℃伅鍑哄簱妯℃澘", "UTF-8");
+ response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
+ EasyExcel.write(response.getOutputStream(), OutLocOrderExcel.class)
+ .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy())
+ .sheet("鍑哄簱妯℃澘")
+ .doWrite(excels);
+ }
+
+ // excel瀵煎叆
+ @PostMapping(value = "/out/loc/box/excel/import/out/auth")
+ @ManagerAuth(memo = "瀵煎叆璁㈠崟淇℃伅鍑哄簱")
+ @Transactional
+ public R outLocBoxExcelImportOut(MultipartFile file) throws IOException {
+ OutLocOrderExcelListener listener = new OutLocOrderExcelListener(getUserId(), getHostId());
+ EasyExcel.read(file.getInputStream(), OutLocOrderExcel.class, listener).sheet().doRead();
+ return R.ok("鎴愬姛瀵煎叆"+listener.getTotal()[0]+"鏉¤鍗曟槑缁嗭紒");
+ }
+
}
--
Gitblit v1.9.1