From 975823f4d07c91a67162f553be9ff4ac25f3d47d Mon Sep 17 00:00:00 2001
From: czkh <czkh@163.com>
Date: 星期四, 06 十一月 2025 13:41:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/czkhasrs' into czkhasrs
---
src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java | 89 +++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 86 insertions(+), 3 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java b/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java
index c9855a2..97217ac 100644
--- a/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java
+++ b/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java
@@ -7,22 +7,29 @@
import com.core.common.Cools;
import com.core.common.DateUtils;
import com.core.common.R;
+import com.core.exception.CoolException;
+import com.zy.asrs.entity.Mat;
import com.zy.asrs.entity.MatBarcode;
import com.zy.asrs.entity.WaitPakin;
import com.zy.asrs.entity.param.CombParam;
import com.zy.asrs.entity.param.MobileAdjustParam;
import com.zy.asrs.service.MatBarcodeService;
+import com.zy.asrs.service.MatService;
import com.zy.asrs.service.MobileService;
+import com.zy.asrs.service.WaitPakinService;
import com.zy.common.web.BaseController;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+@Slf4j
@RequestMapping
@RestController
public class BarcodeMatnrController extends BaseController {
@@ -30,6 +37,10 @@
private MatBarcodeService matBarcodeService;
@Autowired
private MobileService mobileService;
+ @Autowired
+ private MatService matService;
+ @Autowired
+ private WaitPakinService waitPakinService;
/*
* 鐗╂枡鎵樼洏缁戝畾鍒嗛〉鏌ヨ
* */
@@ -73,6 +84,27 @@
return R.ok();
}
+ /*
+ * 鎵归噺缁勬墭
+ * */
+ @RequestMapping("/barcodeMatnr/matnrAndBarcode")
+ @ManagerAuth(memo = "鐗╂枡鎵樼洏鎵归噺缁勬墭")
+ public R matnrAndBarcode(@RequestBody List<MatBarcode> list) {
+ if (Cools.isEmpty(list)){
+ return R.error(BaseRes.PARAM);
+ }
+ for (MatBarcode matBarcode : list) {
+ if (!matBarcode.getZpallet().equals(list.get(0).getZpallet())){
+ log.info(matBarcode.getZpallet());
+ log.info(list.get(0).getZpallet());
+ throw new CoolException("璇烽�夋嫨鐩稿悓鎵樼洏鐮佺殑鏁版嵁");
+ }
+ }
+ waitPakinService.comb(list);
+ return R.ok("缁勬墭鎴愬姛");
+
+ }
+
/*鐗╂枡鎵樼洏缁戝畾
*
* */
@@ -89,9 +121,21 @@
/*缁勬墭
*
* */
- @RequestMapping(value = "/barcodeMatnr/add1/auth")
+ @RequestMapping(value = "/barcodeMatnr/comb/auth")
@ManagerAuth
public R comb(WaitPakin waitPakin) {
+ Mat mat = matService.selectById(waitPakin.getModiUser());
+ MatBarcode matBarcode = matBarcodeService.selectbyMatnr(mat.getMatnr());
+ if (matBarcode == null){
+ throw new CoolException("璇ョ墿鏂欐湭涓庢墭鐩樼粦瀹�");
+ }else {
+ if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())){
+ throw new CoolException("璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛屼笉鑳戒笌褰撳墠鎵樼洏"+waitPakin.getBarcode()+"缁戝畾锛屼笌璇ョ墿鏂欑粦瀹氱殑鎵樼洏鏄�"+matBarcode.getZpallet());
+ }
+ }
+ if (mat.getColor().equals("鎶ュ簾")){
+ throw new CoolException("璇ョ墿鏂欏凡鎶ュ簾锛岃鍕跨粦瀹�");
+ }
if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){
return R.error(BaseRes.PARAM);
}
@@ -102,15 +146,54 @@
/*骞舵澘
*
* */
- @RequestMapping(value = "/barcodeMatnr/add2/auth")
+// @RequestMapping(value = "/barcodeMatnr/clamp/auth")
@ManagerAuth
public R clamp(WaitPakin waitPakin) {
- if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){
+ if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())){
return R.error(BaseRes.PARAM);
}
+ Mat mat = matService.selectById(waitPakin.getModiUser());
+ MatBarcode matBarcode = matBarcodeService.selectbyMatnr(mat.getMatnr());
+ if (matBarcode == null){
+ throw new CoolException("璇ョ墿鏂欐湭涓庢墭鐩樼粦瀹�");
+ }else {
+ if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())){
+ throw new CoolException("璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛屼笉鑳戒笌褰撳墠鎵樼洏"+waitPakin.getBarcode()+"缁戝畾锛屼笌璇ョ墿鏂欑粦瀹氱殑鎵樼洏鏄�"+matBarcode.getZpallet());
+ }
+ }
MobileAdjustParam combParam=new MobileAdjustParam();
+ ArrayList<CombParam.CombMat> combMats=new ArrayList<>();
+ CombParam.CombMat combMat=new CombParam.CombMat();
+ combMat.setMatnr(mat.getMatnr());
+ combMat.setMaktx(mat.getMaktx());
+// combMat.setAnfme(waitPakin.getAnfme());
+ combMat.setAnfme(1.0);
+ combMats.add(combMat);
combParam.setBarcode(waitPakin.getBarcode());
+ combParam.setCombMats(combMats);
mobileService.adjustNew(combParam, Boolean.TRUE, getUserId());
return R.ok("骞舵澘鎴愬姛");
}
+
+ /*鎵归噺骞舵澘*/
+ @RequestMapping(value = "/barcodeMatnr/clamp/auth")
+ @ManagerAuth
+ public R clamp2(@RequestBody List<MatBarcode> list){
+ if (Cools.isEmpty(list)){
+ return R.error(BaseRes.PARAM);
+ }
+ for (MatBarcode matBarcode : list) {
+ MobileAdjustParam combParam=new MobileAdjustParam();
+ ArrayList<CombParam.CombMat> combMats=new ArrayList<>();
+ CombParam.CombMat combMat=new CombParam.CombMat();
+ combMat.setMatnr(matBarcode.getMatnr());
+ combMat.setMaktx(matBarcode.getMaktx());
+ combMat.setAnfme(1.0);
+ combMats.add(combMat);
+ combParam.setBarcode(matBarcode.getZpallet());
+ combParam.setCombMats(combMats);
+ mobileService.adjustNew(combParam, Boolean.TRUE, getUserId());
+ }
+ return R.ok("骞舵澘鎴愬姛");
+ }
}
--
Gitblit v1.9.1