From edb03c5169709da2e6d39a999328ce9bf92affff Mon Sep 17 00:00:00 2001 From: dubin <bindu_bean@163.com> Date: 星期一, 13 十月 2025 15:28:37 +0800 Subject: [PATCH] 联调 --- src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 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..8670366 100644 --- a/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java +++ b/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java @@ -7,11 +7,14 @@ 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.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; @@ -20,6 +23,7 @@ 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; @@ -30,6 +34,8 @@ private MatBarcodeService matBarcodeService; @Autowired private MobileService mobileService; + @Autowired + private MatService matService; /* * 鐗╂枡鎵樼洏缁戝畾鍒嗛〉鏌ヨ * */ @@ -92,6 +98,15 @@ @RequestMapping(value = "/barcodeMatnr/add1/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 (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){ return R.error(BaseRes.PARAM); } @@ -108,8 +123,24 @@ if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){ 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()); + combMats.add(combMat); combParam.setBarcode(waitPakin.getBarcode()); + combParam.setCombMats(combMats); mobileService.adjustNew(combParam, Boolean.TRUE, getUserId()); return R.ok("骞舵澘鎴愬姛"); } -- Gitblit v1.9.1