From 1d16e35336acc4e119846dd4a47b29b9db2a1b6f Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期五, 19 一月 2024 08:30:44 +0800
Subject: [PATCH] # PDA入库更新
---
src/main/java/com/zy/asrs/controller/MobileController.java | 59 +++++++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 43 insertions(+), 16 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/MobileController.java b/src/main/java/com/zy/asrs/controller/MobileController.java
index 14228b3..c5b51c1 100644
--- a/src/main/java/com/zy/asrs/controller/MobileController.java
+++ b/src/main/java/com/zy/asrs/controller/MobileController.java
@@ -1,5 +1,7 @@
package com.zy.asrs.controller;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.core.annotations.ManagerAuth;
@@ -55,6 +57,8 @@
private PackService packService;
@Autowired
private ManLocDetlMapper manLocDetlMapper;
+ @Autowired
+ private PlaService plaService;
// 鍟嗗搧涓婃灦
@@ -423,20 +427,22 @@
//@ManagerAuth(memo="pla鍏ュ簱")
public R plaPackIn(@RequestBody JSONObject json){
String locNo = json.get("locNo").toString();
- String batch = json.get("batch").toString();
- String packageNo = json.get("packageNo").toString();
- if(Cools.isEmpty(locNo) || Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){
- return R.error("鏈夊弬鏁颁负绌猴紝鏃犳硶鍏ュ簱");
+ JSONArray jsonArray = JSONArray.parseArray(json.getJSONArray("pla").toJSONString());
+ for (Object o : jsonArray){
+ JSONObject jsonObject = (JSONObject)o;
+ String batch = jsonObject.get("batch").toString();
+ String packageNo = jsonObject.get("packageNo").toString();
+ if(Cools.isEmpty(locNo) || Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){
+ return R.error("鏈夊弬鏁颁负绌猴紝鏃犳硶鍏ュ簱");
+ }
+ //娴嬭瘯
+ if(true){
+ User user = new User();
+ user.setUsername("test");
+ mobileService.plaPakin(locNo,batch,packageNo,user);
+ }
}
- //娴嬭瘯
- if(true){
- User user = new User();
- user.setUsername("test");
- mobileService.plaPakin(locNo,batch,packageNo,user);
- return R.ok();
- }
- mobileService.plaPakin(locNo,batch,packageNo,getUser());
- return R.ok();
+ return R.ok("鍏ュ簱鎴愬姛");
}
@RequestMapping("/plaDetl/packout1/v1")
@@ -477,10 +483,31 @@
return R.ok();
}
+
+ @RequestMapping("/plaDetl/check/v1")
+// @ManagerAuth(memo="pla鍑哄簱")
+ public R plaDetlCheck(@RequestBody JSONObject json){
+ String batch = json.get("batch").toString();
+ String packageNo = json.get("packageNo").toString();
+
+ if(Cools.isEmpty(batch) || Cools.isEmpty(packageNo)){
+ return R.error("鏈夊弬鏁颁负绌猴紝鏃犳硶鍏ュ簱");
+ }
+
+ Pla pla = plaService.selectByBatchAndPackageNo(batch, packageNo);
+ if ((Cools.isEmpty(pla))){
+ return R.error("璇ュ寘鐗╂枡鏈綍鍏ワ紝鏃犳硶鏌ヨ鍒扮浉鍏充俊鎭�");
+ }
+ return R.ok(pla);
+ }
+
public static void main(String[] args) {
- String aa = "aabb";
- String[] ccs = aa.split("cc");
- System.out.println(ccs[0]);
+ String aa = "[{\"batch\":\"2023090304\",\"packageNo\":\"8\"},{\"batch\":\"2023090304\",\"packageNo\":\"8\"}]";
+ JSONArray jsonArray = JSON.parseArray(aa);
+ Object o = jsonArray.get(0);
+ System.out.println(o.toString());
+ JSONObject jsonObject = (JSONObject)o;
+ System.out.println(jsonObject);
}
}
--
Gitblit v1.9.1