From 3d7a3f51d1f01c62a03ddbe5cab6e395e30e607b Mon Sep 17 00:00:00 2001
From: dubin <bindu_bean@163.com>
Date: 星期二, 25 十一月 2025 16:46:55 +0800
Subject: [PATCH] #1
---
src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java | 110 ++++++++++++++++++++++++++++++++++--------------------
1 files changed, 69 insertions(+), 41 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java b/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java
index 2eeae2d..6998cf0 100644
--- a/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java
+++ b/src/main/java/com/zy/asrs/controller/BarcodeMatnrController.java
@@ -18,6 +18,7 @@
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;
@@ -28,6 +29,7 @@
import java.util.List;
import java.util.Map;
+@Slf4j
@RequestMapping
@RestController
public class BarcodeMatnrController extends BaseController {
@@ -39,30 +41,32 @@
private MatService matService;
@Autowired
private WaitPakinService waitPakinService;
+
/*
- * 鐗╂枡鎵樼洏缁戝畾鍒嗛〉鏌ヨ
- * */
+ * 鐗╂枡鎵樼洏缁戝畾鍒嗛〉鏌ヨ
+ * */
@RequestMapping(value = "/barcodeMatnr/list/auth")
@ManagerAuth
- public R list(@RequestParam(defaultValue = "1")Integer curr,
- @RequestParam(defaultValue = "10")Integer limit,
- @RequestParam(required = false)String orderByField,
- @RequestParam(required = false)String orderByType,
- @RequestParam Map<String, Object> param){
+ public R list(@RequestParam(defaultValue = "1") Integer curr,
+ @RequestParam(defaultValue = "10") Integer limit,
+ @RequestParam(required = false) String orderByField,
+ @RequestParam(required = false) String orderByType,
+ @RequestParam Map<String, Object> param) {
excludeTrash(param);
EntityWrapper<MatBarcode> wrapper = new EntityWrapper<>();
convert(param, wrapper);
- if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
- else {
+ if (!Cools.isEmpty(orderByField)) {
+ wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));
+ } else {
wrapper.orderBy("modi_time", false);
}
return R.ok(matBarcodeService.selectPage(new Page<>(curr, limit), wrapper));
}
- private void convert(Map<String, Object> map, EntityWrapper wrapper){
- for (Map.Entry<String, Object> entry : map.entrySet()){
+ private void convert(Map<String, Object> map, EntityWrapper wrapper) {
+ for (Map.Entry<String, Object> entry : map.entrySet()) {
String val = String.valueOf(entry.getValue());
- if (val.contains(RANGE_TIME_LINK)){
+ if (val.contains(RANGE_TIME_LINK)) {
String[] dates = val.split(RANGE_TIME_LINK);
wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
@@ -73,8 +77,8 @@
}
/*
- * 鐗╂枡鎵樼洏瑙g粦
- * */
+ * 鐗╂枡鎵樼洏瑙g粦
+ * */
@RequestMapping("/barcodeMatnr/matnrLostBarcode")
@ManagerAuth(memo = "鐗╂枡鎵樼洏瑙g粦")
public R matnrLostBarcode(@RequestBody List<MatBarcode> list) {
@@ -83,16 +87,18 @@
}
/*
- * 鎵归噺缁勬墭
- * */
+ * 鎵归噺缁勬墭
+ * */
@RequestMapping("/barcodeMatnr/matnrAndBarcode")
@ManagerAuth(memo = "鐗╂枡鎵樼洏鎵归噺缁勬墭")
public R matnrAndBarcode(@RequestBody List<MatBarcode> list) {
- if (Cools.isEmpty(list)){
+ if (Cools.isEmpty(list)) {
return R.error(BaseRes.PARAM);
}
for (MatBarcode matBarcode : list) {
- if (!matBarcode.getZpallet().equals(list.get(0).getZpallet())){
+ if (!matBarcode.getZpallet().equals(list.get(0).getZpallet())) {
+ log.info(matBarcode.getZpallet());
+ log.info(list.get(0).getZpallet());
throw new CoolException("璇烽�夋嫨鐩稿悓鎵樼洏鐮佺殑鏁版嵁");
}
}
@@ -102,12 +108,12 @@
}
/*鐗╂枡鎵樼洏缁戝畾
- *
- * */
+ *
+ * */
@RequestMapping(value = "/barcodeMatnr/add/auth")
@ManagerAuth
public R add(WaitPakin waitPakin) {
- if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())){
+ if (Cools.isEmpty(waitPakin.getBarcode()) || Cools.isEmpty(waitPakin.getModiUser())) {
return R.error(BaseRes.PARAM);
}
matBarcodeService.addBarcodeMatnr(waitPakin);
@@ -115,24 +121,24 @@
}
/*缁勬墭
- *
- * */
- @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){
+ if (matBarcode == null) {
throw new CoolException("璇ョ墿鏂欐湭涓庢墭鐩樼粦瀹�");
- }else {
- if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())){
- throw new CoolException("璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛屼笉鑳戒笌褰撳墠鎵樼洏"+waitPakin.getBarcode()+"缁戝畾锛屼笌璇ョ墿鏂欑粦瀹氱殑鎵樼洏鏄�"+matBarcode.getZpallet());
+ } else {
+ if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())) {
+ throw new CoolException("璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛屼笉鑳戒笌褰撳墠鎵樼洏" + waitPakin.getBarcode() + "缁戝畾锛屼笌璇ョ墿鏂欑粦瀹氱殑鎵樼洏鏄�" + matBarcode.getZpallet());
}
}
- if (mat.getColor().equals("鎶ュ簾")){
+ if (mat.getColor().equals("鎶ュ簾")) {
throw new CoolException("璇ョ墿鏂欏凡鎶ュ簾锛岃鍕跨粦瀹�");
}
- if (Cools.isEmpty(waitPakin.getBarcode())||Cools.isEmpty(waitPakin.getModiUser())||Cools.isEmpty(waitPakin.getAnfme())){
+ if (Cools.isEmpty(waitPakin.getBarcode()) || Cools.isEmpty(waitPakin.getModiUser()) || Cools.isEmpty(waitPakin.getAnfme())) {
return R.error(BaseRes.PARAM);
}
mobileService.combToWms(waitPakin);
@@ -140,26 +146,26 @@
}
/*骞舵澘
- *
- * */
- @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){
+ if (matBarcode == null) {
throw new CoolException("璇ョ墿鏂欐湭涓庢墭鐩樼粦瀹�");
- }else {
- if (!matBarcode.getZpallet().equals(waitPakin.getBarcode())){
- throw new CoolException("璇ョ墿鏂欎笌鍏朵粬鎵樼洏缁戝畾锛屼笉鑳戒笌褰撳墠鎵樼洏"+waitPakin.getBarcode()+"缁戝畾锛屼笌璇ョ墿鏂欑粦瀹氱殑鎵樼洏鏄�"+matBarcode.getZpallet());
+ } 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();
+ 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());
@@ -170,4 +176,26 @@
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