From 0c552ce6bbf6bd4e2bf0853ae30b7ad9abb1304b Mon Sep 17 00:00:00 2001
From: Junjie <xjj@123>
Date: 星期二, 29 四月 2025 11:38:31 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/controller/OpenController.java | 86 ++++++++++++++++++------------------------
1 files changed, 37 insertions(+), 49 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/OpenController.java b/src/main/java/com/zy/asrs/controller/OpenController.java
index 3bd0a08..24add0e 100644
--- a/src/main/java/com/zy/asrs/controller/OpenController.java
+++ b/src/main/java/com/zy/asrs/controller/OpenController.java
@@ -92,64 +92,52 @@
@PostMapping("/taskCreate")
@Transactional
public R taskCreate(@RequestHeader String appkey,
- @RequestBody List<TaskCreateParam> param1,
+ @RequestBody TaskCreateParam param,
HttpServletRequest request) {
- auth(appkey, param1, request);
+ auth(appkey, param, request);
try{
- List<TaskCreateParam> paramList = new ArrayList<>();
- List<String> locNoList = new ArrayList<>();
- for (TaskCreateParam param : param1) {
- if (Cools.isEmpty(param)) {
- return R.parse(BaseRes.PARAM);
- }
- if (Cools.isEmpty(param.getTaskNo())) {
- return R.error("浠诲姟鍙穂taskNo]涓嶈兘涓虹┖");
- }
- if (Cools.isEmpty(param.getIoType())) {
- return R.error("浠诲姟绫诲瀷[ioType]涓嶈兘涓虹┖");
- }
- if (Cools.isEmpty(param.getBarcode())) {
- return R.error("鏉$爜[barcode]涓嶈兘涓虹┖");
- }
- String locNo=null;
- if (param.getIoType() == 1) {
- locNo = param.getTargetPoint();
- } else {
- locNo = param.getStartPoint();
- }
- try {
- LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
- .eq("loc_no", locNo).ne("loc_sts", "X"));
- if (Cools.isEmpty(locMast)) {
- log.error("搴撲綅鍙蜂笉瀛樺湪" + locNo);
- return R.error("搴撲綅鍙蜂笉瀛樺湪" + locNo).add("搴撲綅鍙蜂笉瀛樺湪" + locNo);
- }
- } catch (Exception e) {
- log.error("搴撲綅鍙锋娴嬬▼搴忓紓甯�==銆嬪紓甯镐俊鎭�" + e);
- return R.error("搴撲綅鍙锋娴嬬▼搴忓紓甯�").add("搴撲綅鍙锋娴嬬▼搴忓紓甯�==銆嬪紓甯镐俊鎭�" + e);
- }
+ if (Cools.isEmpty(param)) {
+ return R.parse(BaseRes.PARAM);
+ }
+ if (Cools.isEmpty(param.getTaskNo())) {
+ return R.error("浠诲姟鍙穂taskNo]涓嶈兘涓虹┖");
+ }
+ if (Cools.isEmpty(param.getIoType())) {
+ return R.error("浠诲姟绫诲瀷[ioType]涓嶈兘涓虹┖");
+ }
+ if (Cools.isEmpty(param.getBarcode())) {
+ return R.error("鏉$爜[barcode]涓嶈兘涓虹┖");
+ }
+ String locNo=null;
+ if (param.getIoType() == 1) {
+ locNo = param.getTargetPoint();
+ } else {
+ locNo = param.getStartPoint();
+ }
+ try {
LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
- .eq("loc_sts", "F")
- .eq("loc_no", locNo)
- .eq("barcode", param.getBarcode()));
- if(Cools.isEmpty(locMast)){
- return R.error("璇ュ簱浣嶄笉婊¤冻鍑哄簱鏉′欢"+param.getTargetPoint());
+ .eq("loc_no", locNo).ne("loc_sts", "X"));
+ if (Cools.isEmpty(locMast)) {
+ log.error("搴撲綅鍙蜂笉瀛樺湪" + locNo);
+ return R.error("搴撲綅鍙蜂笉瀛樺湪" + locNo).add("搴撲綅鍙蜂笉瀛樺湪" + locNo);
}
- if (!locNoList.contains(locMast.getLocNo())){
- locNoList.add(locMast.getLocNo());
- paramList.add(param);
- }else {
- return R.error("璇ュ簱浣嶄笉鑳藉悓鏃朵笅鍙戜袱绗斾换鍔�" + locMast.getLocNo());
- }
+ } catch (Exception e) {
+ log.error("搴撲綅鍙锋娴嬬▼搴忓紓甯�==銆嬪紓甯镐俊鎭�" + e);
+ return R.error("搴撲綅鍙锋娴嬬▼搴忓紓甯�").add("搴撲綅鍙锋娴嬬▼搴忓紓甯�==銆嬪紓甯镐俊鎭�" + e);
}
- for (TaskCreateParam param : paramList){
- openService.taskCreate(param);
+ LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
+ .eq("loc_sts", "F")
+ .eq("loc_no", locNo)
+ .eq("barcode", param.getBarcode()));
+ if(Cools.isEmpty(locMast)){
+ return R.error("璇ュ簱浣嶄笉婊¤冻鍑哄簱鏉′欢"+param.getTargetPoint());
}
+
+ return openService.taskCreate(param);
}catch (Exception e){
- log.error("浠诲姟涓嬪彂寮傚父"+e);
+ log.error("浠诲姟涓嬪彂寮傚父" + e);
return R.error();
}
- return R.ok();
}
//鍒涘缓鍏ュ簱浠诲姟
--
Gitblit v1.9.1