From 5701eb6693c654d53f1bba460eb3a417d495b344 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期三, 11 六月 2025 17:31:53 +0800
Subject: [PATCH] bug修复;下发任务给rcs携带货架码
---
src/main/java/com/zy/asrs/controller/OrderController.java | 93 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 82 insertions(+), 11 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/OrderController.java b/src/main/java/com/zy/asrs/controller/OrderController.java
index 496b16c..c96b978 100644
--- a/src/main/java/com/zy/asrs/controller/OrderController.java
+++ b/src/main/java/com/zy/asrs/controller/OrderController.java
@@ -1,6 +1,7 @@
package com.zy.asrs.controller;
import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.enums.SqlLike;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
@@ -220,15 +221,20 @@
@RequestMapping(value = "/order/detls/pakin/page/auth/v2")
@ManagerAuth
public R orderDetlsV2(@RequestParam(defaultValue = "1") Integer curr,
- @RequestParam(defaultValue = "100") Integer limit,
- @RequestParam(required = false) String orderByField,
- @RequestParam(required = false) String orderByType,
- @RequestParam Map<String, Object> param) {
+ @RequestParam(defaultValue = "100") Integer limit,
+ @RequestParam(required = false) String orderByField,
+ @RequestParam(required = false) String orderByType,
+ @RequestParam Map<String, Object> param) {
EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>();
excludeTrash(param);
Object o = param.get("orderType");
if (o != null) {
- wrapper.in("source", o);
+ String[] split = o.toString().split(",");
+ if (split[0].equals("39")) {
+ wrapper.andNew().like("matnr", "401", SqlLike.RIGHT).or().like("matnr", "402", SqlLike.RIGHT).andNew().in("source", split);
+ } else {
+ wrapper.in("source", split);
+ }
param.remove("orderType");
}
convert(param, wrapper);
@@ -239,9 +245,9 @@
// docIds.add(pakin.getDocId());
// }
// }
-
return R.ok(orderDetlService.selectPage(new Page<>(curr, limit), wrapper));
}
+
@RequestMapping(value = "/order/detls/pakin")
@ManagerAuth
@@ -297,10 +303,11 @@
List<DocType> pakins = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakin", 1));
List<Long> docIds = new ArrayList<>();
for (DocType pakin : pakins) {
- if (pakin.getDocId() == 36||pakin.getDocId() == 39) {
+ if (pakin.getDocId() == 36 || pakin.getDocId() == 39 || pakin.getDocId() == 19) {
docIds.add(pakin.getDocId());
}
}
+ wrapper.like("matnr", "50", SqlLike.RIGHT);
wrapper.in("source", docIds);
return R.ok(orderDetlService.selectPage(new Page<>(curr, limit), wrapper));
}
@@ -346,10 +353,46 @@
docIds.add(pakin.getDocId());
}
}
+ wrapper.notLike("matnr", "401", SqlLike.RIGHT).notLike("matnr", "402", SqlLike.RIGHT);
wrapper.in("source", docIds);
Page<OrderDetl> page = orderDetlService.selectPage(new Page<>(curr, limit), wrapper);
for (OrderDetl record : page.getRecords()) {
Double sumAnfme = agvLocDetlService.getSumAnfmeDb(record.getMatnr(), record.getThreeCode(), 1);
+ record.setStock(sumAnfme == null ? 0 : sumAnfme);
+ }
+ return R.ok(page);
+ }
+
+
+ @RequestMapping(value = "/order/bcpDb/detls/pakin/page/auth/v2")
+ @ManagerAuth
+ public R bcpDbOrderDetlsV2(@RequestParam(defaultValue = "1") Integer curr,
+ @RequestParam(defaultValue = "100") Integer limit,
+ @RequestParam(required = false) String orderByField,
+ @RequestParam(required = false) String orderByType,
+ @RequestParam Map<String, Object> param) {
+ EntityWrapper<OrderDetl> wrapper = new EntityWrapper<>();
+ excludeTrash(param);
+ Object o = param.get("orderType");
+ if (o != null) {
+ String[] split = o.toString().split(",");
+ wrapper.in("source", split);
+ param.remove("orderType");
+ }
+ convert(param, wrapper);
+// return R.ok(orderDetlService.getPakoutPage(toPage(curr, limit, param, OrderDetl.class)));
+// List<DocType> pakins = docTypeService.selectList(new EntityWrapper<DocType>().eq("pakout", 1));
+// List<Long> docIds = new ArrayList<>();
+// for (DocType pakin : pakins) {
+// if (pakin.getDocId() == 33) {
+// docIds.add(pakin.getDocId());
+// }
+// }
+ wrapper.like("order_no", "DC", SqlLike.RIGHT);
+ // wrapper.in("source", docIds);
+ Page<OrderDetl> page = orderDetlService.selectPage(new Page<>(curr, limit), wrapper);
+ for (OrderDetl record : page.getRecords()) {
+ Double sumAnfme = agvLocDetlService.getSumAnfmeDb2(record.getMatnr(), record.getThreeCode(), 1);
record.setStock(sumAnfme == null ? 0 : sumAnfme);
}
return R.ok(page);
@@ -398,6 +441,14 @@
return R.error("鍗曟嵁缂栧彿宸插瓨鍦�");
}
Date now = new Date();
+ if (param.getDocType() == 33) {
+ for (OrderDetl orderDetl : param.getOrderDetlList()) {
+ if (orderDetl.getMatnr().startsWith("401") || orderDetl.getMatnr().startsWith("402")) {
+ param.setOrderNo("DC" + param.getOrderNo());
+ break;
+ }
+ }
+ }
order = new Order(
String.valueOf(snowflakeIdWorker.nextId()), // 缂栧彿[闈炵┖]
param.getOrderNo(), // 璁㈠崟缂栧彿
@@ -515,9 +566,15 @@
}
}
if (param.getDocType().intValue() == 32) {
+ String ono = "DB";
+ for (OrderDetl orderDetl : param.getOrderDetlList()) {
+ if (orderDetl.getMatnr().startsWith("401") || orderDetl.getMatnr().startsWith("402")) {
+ ono = "DC";
+ }
+ }
order = new Order(
String.valueOf(snowflakeIdWorker.nextId()), // 缂栧彿[闈炵┖]
- "DB" + param.getOrderNo(), // 璁㈠崟缂栧彿
+ ono + param.getOrderNo(), // 璁㈠崟缂栧彿
DateUtils.convert(now), // 鍗曟嵁鏃ユ湡
33L, // 鍗曟嵁绫诲瀷
null, // 椤圭洰缂栧彿
@@ -905,13 +962,17 @@
}
@RequestMapping(value = "/order/update/auth")
- @ManagerAuth
+ @ManagerAuth(memo = "淇敼璁㈠崟鐘舵��")
public R update(Order order) {
if (Cools.isEmpty(order) || null == order.getId()) {
return R.error("鍙傛暟缂哄け");
}
order.setUpdateBy(getUserId());
order.setUpdateTime(new Date());
+ Long settle = order.getSettle();
+ if (settle != null && settle == 6) {
+ order.setMemo(Cools.isEmpty(order.getMemo()) ? "鎵嬪姩瀹岀粨" : order.getMemo() + "鎵嬪姩瀹岀粨");
+ }
if (!orderService.updateById(order)) {
throw new CoolException("淇敼璁㈠崟澶辫触");
}
@@ -1141,7 +1202,12 @@
}
// 鐢熸垚璋冩嫧鍗�
if (docType.getDocId().intValue() == 32) {
- String dbUuid = "DB" + odNo;
+ String dbUuid;
+ if (!Cools.isEmpty(matnr) && (matnr.startsWith("401") || matnr.startsWith("402"))) {
+ dbUuid = "DC" + odNo;
+ } else {
+ dbUuid = "DB" + odNo;
+ }
Order order2 = orderService.selectByNo(dbUuid);
if (null == order2) {
order2 = new Order(
@@ -1408,7 +1474,12 @@
odNo += "_O";
}
if (docName.contains("璋冩嫧鍗�")) {
- odNo = "DB" + odNo;
+ if (!Cools.isEmpty(matnr) && (matnr.startsWith("401") || matnr.startsWith("402"))) {
+ odNo = "DC" + odNo;
+ } else {
+ odNo = "DB" + odNo;
+ }
+ //odNo = "DB" + odNo;
} else if (docName.contains("鍔犲伐鍗�")) {
odNo = "JG" + odNo;
} else {
--
Gitblit v1.9.1