From 1dca57c0f15c3cdfbebf14ad1e9e04d8c84e775c Mon Sep 17 00:00:00 2001
From: skyouc <958836976@qq.com>
Date: 星期六, 07 三月 2026 09:51:47 +0800
Subject: [PATCH] no message
---
src/main/webapp/static/js/orderPakout/order.js | 196 +++++++++++----------
src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java | 88 +++++----
src/main/java/com/zy/asrs/utils/Utils.java | 3
src/main/java/com/zy/common/model/TaskDto.java | 4
src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java | 16 +
src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java | 29 ++-
src/main/java/com/zy/common/service/CommonService.java | 163 ++++++++++-------
7 files changed, 281 insertions(+), 218 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
index 2983a0e..f2664f7 100644
--- a/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/MobileServiceImpl.java
@@ -1423,7 +1423,7 @@
generateCacheOutTask(station, locCache, userId);
/**鐢熸垚绔嬪簱鍑哄簱浠诲姟*/
- generateCRNOutTask(station, locCache, userId);
+ // generateCRNOutTask(station, locCache, userId);
return R.ok();
}
@@ -1513,7 +1513,7 @@
Task task = new Task();
task.setWrkNo(workNo)
.setIoTime(new Date())
- .setWrkSts(1L) // 宸ヤ綔鐘舵�侊細11.鐢熸垚鍑哄簱ID
+ .setWrkSts(201L) // 宸ヤ綔鐘舵�侊細11.鐢熸垚鍏ュ簱搴揑D
.setIoType(1) // 鍏ュ嚭搴撶姸鎬侊細 11.搴撴牸绉昏浇
.setTaskType("agv")
.setIoPri(10D)
@@ -1820,12 +1820,14 @@
throw new CoolException("瀹瑰櫒缂栫爜鏈淮鎶わ紝璇风淮鎶ゅ悗鍐嶆搷浣滐紒锛�");
}
- Integer whsType = 1;
+ Integer whsType = 2;
+ Short lcoType = 1;
//鐢ㄤ簬鍒ゆ柇鏂欑鎵樼洏锛屾枡绠憋紝绗兼
- if (container.getType().equals(ContainerType.CONTAINER_TYPE_SALVER.type)) {
- whsType = 3;
- } else if (container.getType().equals(ContainerType.CONTAINER_TYPE_CAGE.type)) {
+ if (!container.getType().equals(ContainerType.CONTAINER_TYPE_BOX.type)) {
whsType = 2;
+ if (container.getType().equals(ContainerType.CONTAINER_TYPE_SALVER.type)) {
+ lcoType = 2;
+ }
}
WrkMast barcode = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("barcode", param.getBarcode()));
@@ -1858,7 +1860,7 @@
throw new CoolException("鏁版嵁閿欒,缁勬嫋妗e凡涓嶅瓨鍦�!!");
}
- WrkMast wrkMast = generateCrnInTask(waitPakins, whsType, station, param.getLocType1(), userId);
+ WrkMast wrkMast = generateCrnInTask(waitPakins, whsType, station, lcoType, userId);
response.put("taskNo", wrkMast.getWrkNo());
response.put("locNo", wrkMast.getLocNo());
diff --git a/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java
index 29f7980..135f19c 100644
--- a/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/OrderServiceImpl.java
@@ -19,6 +19,8 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
@Slf4j
@Service("orderService")
@@ -114,47 +116,57 @@
@Override
public boolean saveHandlerOrder(Boolean pakin, WrkMast wrkMast, List<WrkDetl> wrkDetls) {
try {
- List<DetlDto> detlDtos = new ArrayList<>();
- wrkDetls.forEach(wrkDetl -> {
- detlDtos.add(new DetlDto(wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getBrand(),wrkDetl.getStandby1(),wrkDetl.getStandby2(),wrkDetl.getStandby3(),
- wrkDetl.getBoxType1(),wrkDetl.getBoxType2(),wrkDetl.getBoxType3(), wrkDetl.getAnfme(), wrkDetl.getThreeCode()));
- });
- String orderNo = "HAND" + snowflakeIdWorker.nextId();
- if (pakin) {
- // 鐢熸垚鍏ュ簱鍗曟嵁
- OpenOrderPakinParam openParam = new OpenOrderPakinParam();
- openParam.setOrderNo(orderNo);
- openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime()));
- openParam.setOrderType("鎵嬪姩鍏ュ簱鍗�");
- openParam.setOrderDetails(detlDtos);
- openService.pakinOrderCreate(openParam);
- } else {
- // 鐢熸垚鍑哄簱鍗曟嵁
- OpenOrderPakoutParam openParam = new OpenOrderPakoutParam();
- openParam.setOrderNo(orderNo);
- openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime()));
- openParam.setOrderType("鎵嬪姩鍑哄簱鍗�");
- openParam.setOrderDetails(detlDtos);
- openService.pakoutOrderCreate(openParam);
- }
- Order order = this.selectByNo(orderNo);
- if (null == order) {
- throw new CoolException("鐢熸垚鍗曟嵁澶辫触");
- }
- if (!this.updateSettle(order.getId(), 4L, null)) {
- throw new CoolException("淇敼鍗曟嵁鐘舵�佸け璐�");
- }
- for (DetlDto detlDto : detlDtos) {
- // 淇敼璁㈠崟鏄庣粏鏁伴噺
- if (!orderDetlService.increase(order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3(),detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme())) {
- throw new CoolException("淇敼鍗曟嵁鏄庣粏鏁伴噺澶辫触");
+// String orderNo = "HAND" + snowflakeIdWorker.nextId();
+// if (pakin) {
+// // 鐢熸垚鍏ュ簱鍗曟嵁
+// OpenOrderPakinParam openParam = new OpenOrderPakinParam();
+// openParam.setOrderNo(orderNo);
+// openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime()));
+// openParam.setOrderType("鎵嬪姩鍏ュ簱鍗�");
+// openParam.setOrderDetails(detlDtos);
+// openService.pakinOrderCreate(openParam);
+// } else {
+// // 鐢熸垚鍑哄簱鍗曟嵁
+// OpenOrderPakoutParam openParam = new OpenOrderPakoutParam();
+// openParam.setOrderNo(orderNo);
+// openParam.setOrderTime(DateUtils.convert(wrkMast.getModiTime()));
+// openParam.setOrderType("鎵嬪姩鍑哄簱鍗�");
+// openParam.setOrderDetails(detlDtos);
+// openService.pakoutOrderCreate(openParam);
+// }
+
+
+ Map<String, List<WrkDetl>> listMap = wrkDetls.stream().collect(Collectors.groupingBy(WrkDetl::getOrderNo));
+
+ listMap.keySet().forEach(orderNo -> {
+ Order order = this.selectByNo(orderNo);
+ if (null == order) {
+ throw new CoolException("鐢熸垚鍗曟嵁澶辫触");
}
- // 淇敼璁㈠崟浣滀笟鏁伴噺
- if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3(),detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme())) {
- throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
+ if (!this.updateSettle(order.getId(), 4L, null)) {
+ throw new CoolException("淇敼鍗曟嵁鐘舵�佸け璐�");
}
- }
+
+ List<DetlDto> detlDtos = new ArrayList<>();
+ listMap.get(orderNo).forEach(wrkDetl -> {
+ detlDtos.add(new DetlDto(wrkDetl.getMatnr(), wrkDetl.getBatch(),wrkDetl.getBrand(),wrkDetl.getStandby1(),wrkDetl.getStandby2(),wrkDetl.getStandby3(),
+ wrkDetl.getBoxType1(),wrkDetl.getBoxType2(),wrkDetl.getBoxType3(), wrkDetl.getAnfme(), wrkDetl.getThreeCode()));
+ });
+
+ for (DetlDto detlDto : detlDtos) {
+ // 淇敼璁㈠崟鏄庣粏鏁伴噺
+ if (!orderDetlService.increase(order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3(),detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme())) {
+ throw new CoolException("淇敼鍗曟嵁鏄庣粏鏁伴噺澶辫触");
+ }
+ // 淇敼璁㈠崟浣滀笟鏁伴噺
+ if (!orderDetlService.increaseWorkQty(order.getId(), detlDto.getMatnr(), detlDto.getBatch(),detlDto.getBrand(),detlDto.getStandby1(),detlDto.getStandby2(),detlDto.getStandby3(),detlDto.getBoxType1(),detlDto.getBoxType2(),detlDto.getBoxType3(), detlDto.getAnfme())) {
+ throw new CoolException("淇敼鍗曟嵁浣滀笟鏁伴噺澶辫触");
+ }
+ }
+ });
+
+
} catch (Exception e) {
log.error("saveHandlerOrder===>>", e);
return false;
diff --git a/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java b/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
index dcf0978..be6a809 100644
--- a/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
+++ b/src/main/java/com/zy/asrs/task/handler/OrderSyncHandler.java
@@ -21,6 +21,7 @@
import com.zy.asrs.service.*;
import com.zy.asrs.service.impl.TaskDetlLogServiceImpl;
import com.zy.asrs.service.impl.TaskDetlServiceImpl;
+import com.zy.asrs.service.impl.WrkDetlLogServiceImpl;
import com.zy.asrs.task.AbstractHandler;
import com.zy.asrs.task.core.ReturnT;
import com.zy.asrs.utils.OrderInAndOutUtil;
@@ -73,6 +74,8 @@
CheckOrderDetlService checkOrderDetlService;
@Autowired
private TaskDetlLogService taskDetlLogService;
+ @Autowired
+ private WrkDetlLogServiceImpl wrkDetlLogService;
@Transactional
@@ -276,7 +279,7 @@
orderDetls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
ReportOrderParams itemParam = new ReportOrderParams();
@@ -386,17 +389,26 @@
orderDetls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
- TaskDetlLog detlLog = taskDetlLogService.selectOne(new EntityWrapper<TaskDetlLog>()
+ //TODO 姝e父瀹岀粨闇�瑕佹墦寮�
+// TaskDetlLog detlLog = taskDetlLogService.selectOne(new EntityWrapper<TaskDetlLog>()
+// .eq("matnr", detl.getMatnr())
+// .eq("supp_code", detl.getStandby1())
+// .eq("order_no", detl.getOrderNo()));
+// if (Objects.isNull(detlLog)) {
+// throw new CoolException("鏁版嵁閿欒 锛岃妫�鏌GV浠诲姟妗f槸鍚﹀凡瀹屾垚锛侊紒");
+// }
+ WrkDetlLog detlLog = wrkDetlLogService.selectOne(new EntityWrapper<WrkDetlLog>()
.eq("matnr", detl.getMatnr())
.eq("supp_code", detl.getStandby1())
.eq("order_no", detl.getOrderNo()));
if (Objects.isNull(detlLog)) {
- throw new CoolException("鏁版嵁閿欒 锛岃妫�鏌GV浠诲姟妗f槸鍚﹀凡瀹屾垚锛侊紒");
+ throw new CoolException("鐗╂枡缂栫爜锛�" + detl.getMatnr() + "鏁版嵁閿欒 锛岃妫�鏌ュ爢鍨涙満浠诲姟妗f槸鍚﹀凡瀹屾垚锛侊紒");
}
//鐩爣搴撳尯
- orderParam.setTarget_location(detlLog.getAreaType());
+ orderParam.setTarget_location("2");
+// orderParam.setTarget_location(detlLog.getAreaType());
OrderItemsParam itemParam = new OrderItemsParam();
// BS Code
itemParam
@@ -409,7 +421,7 @@
// // 涓婃姤鏃讹紝榛樿鏉ユ簮浣嶇疆鏄痭ull
.setLocation_no(detlLog.getZpallet())
// 涓婃姤鏃讹紝榛樿涓婃姤鏁伴噺鏄鍗曟暟閲�
- .setPick_qty(detl.getQty().intValue());
+ .setPick_qty(Objects.isNull(detl.getQty()) ? 0 : detl.getQty().intValue());
reportOrderParams.add(itemParam);
});
@@ -479,9 +491,8 @@
orderDetls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
-
TaskDetlLog detlLog = taskDetlLogService.selectOne(new EntityWrapper<TaskDetlLog>()
.eq("matnr", detl.getMatnr())
.eq("supp_code", detl.getStandby1())
@@ -596,7 +607,7 @@
detls.forEach(detl -> {
Mat material = matService.selectByMatnr(detl.getMatnr());
if (Objects.isNull(material)) {
- throw new CoolException("鐗╂枡涓嶅瓨鍦�");
+ throw new CoolException(material.getMatnr() + "鐗╂枡涓嶅瓨鍦�");
}
OrderItemsParam itemParam = new OrderItemsParam();
itemParam.setLocation_no(detl.getZpallet())
diff --git a/src/main/java/com/zy/asrs/utils/Utils.java b/src/main/java/com/zy/asrs/utils/Utils.java
index 1927845..1b0fe35 100644
--- a/src/main/java/com/zy/asrs/utils/Utils.java
+++ b/src/main/java/com/zy/asrs/utils/Utils.java
@@ -303,7 +303,8 @@
case 2://缁忓吀鍗曚几搴撲綅锛�2鎺掕揣鏋讹級
return LocNecessaryParametersDoubleExtension2(rowLastno, curRow, crnNumber); //宸插畬鍠�
case 3://缁忓吀鍗曞弻浼稿簱浣� 宸﹀崟鍙冲弻(灏忓崟澶у弻)
- return LocNecessaryParametersDoubleExtension3(rowLastno, curRow, crnNumber); //鏈畬鍠�
+ return LocNecessaryParametersDoubleExtension(rowLastno, curRow, crnNumber); //宸插畬鍠�
+// return LocNecessaryParametersDoubleExtension3(rowLastno, curRow, crnNumber); //鏈畬鍠�
case 4://缁忓吀鍗曞弻浼稿簱浣� 宸﹀弻鍙冲崟(灏忓弻澶у崟)
return LocNecessaryParametersDoubleExtension4(rowLastno, curRow, crnNumber); //鏈畬鍠�
case 5://鍙屽伐浣嶅崟浼稿簱浣�(4鎺掕揣鏋�)
diff --git a/src/main/java/com/zy/common/model/TaskDto.java b/src/main/java/com/zy/common/model/TaskDto.java
index 1da9a02..b85c000 100644
--- a/src/main/java/com/zy/common/model/TaskDto.java
+++ b/src/main/java/com/zy/common/model/TaskDto.java
@@ -118,8 +118,8 @@
continue;
}
}
- if (dto.getAnfme() > locDetl.getAnfme()) {
- throw new CoolException("鏈嶅姟鍣ㄥ唴閮ㄩ敊璇�");
+ if (dto.getAnfme() > locDetl.getAnfme() && dto.getStandby1().equals(locDetl.getStandby1()) ) {
+ throw new CoolException("璁㈠崟鏁伴噺涓嶈兘澶т簬搴撳瓨鏁伴噺锛侊紒");
}
if (dto.getAnfme().equals(locDetl.getAnfme())) {
sameNumber++;
diff --git a/src/main/java/com/zy/common/service/CommonService.java b/src/main/java/com/zy/common/service/CommonService.java
index 45d8fbf..9970cfb 100644
--- a/src/main/java/com/zy/common/service/CommonService.java
+++ b/src/main/java/com/zy/common/service/CommonService.java
@@ -127,12 +127,13 @@
// /**
// * 搴撳瀷 1: 鏍囧噯鍫嗗灈鏈哄簱 2: 骞冲簱 3: 绌挎鏉� 4: 鍥涘悜杞� 5: AGV 0: 鏈煡
// */
- if (rowLastnoType.getType() == 3) {
- return getDoubleLocNoRun(whsType, staDescId, sourceStaNo, findLocNoAttributeVo,
- 4, locTypeDto, 0);
- } else {
- return getLocNoRun(whsType, staDescId, sourceStaNo, findLocNoAttributeVo, 0, locTypeDto, 0);
- }
+// if (rowLastnoType.getType() == 3) {
+// return getDoubleLocNoRun(whsType, staDescId, sourceStaNo, findLocNoAttributeVo,
+// 4, locTypeDto, 0);
+// } else {
+//
+// }
+ return getLocNoRun(whsType, staDescId, sourceStaNo, findLocNoAttributeVo, 0, locTypeDto, 0);
} catch (Exception e) {
log.error("绔欑偣={} 鏈煡璇㈠埌瀵瑰簲鐨勮鍒�", sourceStaNo);
}
@@ -152,7 +153,7 @@
* @return locNo 妫�绱㈠埌鐨勫簱浣嶅彿
*/
@Transactional
- public StartupDto getLocNoRun(Integer staDescId, Integer whsType, Integer sourceStaNo,
+ public StartupDto getLocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo,
FindLocNoAttributeVo findLocNoAttributeVo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
staDescId = 1;
// 鍒濆鍖栧弬鏁�
@@ -165,28 +166,60 @@
throw new CoolException("鏁版嵁寮傚父锛岃鑱旂郴绠$悊鍛�===>搴撲綅瑙勫垯鏈煡");
}
- // 鍧囪 鍒嗗竷鍫嗗灈鏈�
int minCount = Integer.MAX_VALUE;
- for (int i = rowLastno.getsCrnNo(); i <= rowLastno.geteCrnNo(); i++) {
- int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", i));
- if (count < minCount) {
- minCount = count;
- crnNo = i;
+ if (whsType == 2) {
+ if (locTypeDto.getLocType1() == 2) {
+ // 鍧囪 鍒嗗竷鍫嗗灈鏈�
+ for (int i = 4; i <= 5; i++) {
+ int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", i));
+ if (count < minCount) {
+ minCount = count;
+ crnNo = i;
+ }
+ }
+ } else {
+ for (int i = 4; i <= 6; i++) {
+ int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", i));
+ if (count < minCount) {
+ minCount = count;
+ crnNo = 6;
+ }
+ }
+
+ if (crnNo == 6) {
+ return getDoubleLocNoRun(3, 1, sourceStaNo, findLocNoAttributeVo, null, locTypeDto, times);
+ }
+ }
+ } else {
+ // 鍧囪 鍒嗗竷鍫嗗灈鏈�
+ for (int i = rowLastno.getsCrnNo(); i <= rowLastno.geteCrnNo(); i++) {
+ int count = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", i));
+ if (count < minCount) {
+ minCount = count;
+ crnNo = i;
+ }
}
}
+
StartupDto startupDto = new StartupDto();
locMast = locMastService.selectOne(new EntityWrapper<LocMast>()
.ge("row1", rowLastno.getsRow())
.le("row1", rowLastno.geteRow())
.eq("crn_no", crnNo)
-// .eq("move_status", 0)
+ .eq("loc_type1", locTypeDto.getLocType1())
.eq("loc_sts", "O")
.orderAsc(Arrays.asList("lev1", "row1", "bay1")));
// int crnCountO = wrkMastService.selectCount(new
// EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100));
-
// 鐢熸垚宸ヤ綔鍙�
- int workNo = getWorkNo(0);
+ int workNo;
+ if (whsType == 2) {
+ // 鐢熸垚宸ヤ綔鍙�
+ workNo = getWorkNo(3);
+ } else {
+ // 鐢熸垚宸ヤ綔鍙�
+ workNo = getWorkNo(0);
+ }
// 杩斿洖dto
startupDto.setWorkNo(workNo);
startupDto.setCrnNo(locMast.getCrnNo());
@@ -210,9 +243,9 @@
*/
public StartupDto getDoubleLocNoRun(Integer whsType, Integer staDescId, Integer sourceStaNo, FindLocNoAttributeVo findLocNoAttributeVo, Integer moveCrnNo, LocTypeDto locTypeDto, int times) {
// 鍒濆鍖栧弬鏁�
- int crnNo = 0; //鍫嗗灈鏈哄彿
- int nearRow = 0; //鏈�娴呭簱浣嶆帓
- int curRow = 0; //鏈�娣卞簱浣嶆帓
+ int crnNo = 6; //鍫嗗灈鏈哄彿
+ int nearRow = 11; //鏈�娴呭簱浣嶆帓
+ int curRow = 14; //鏈�娣卞簱浣嶆帓
int rowCount = 0; //杞杞
LocMast locMast = null; // 鐩爣搴撲綅
@@ -242,28 +275,28 @@
}
}
- //姝ょ▼搴忕敤浜庝紭鍖栧爢鍨涙満寮傚父鏃剁殑杩愯鏃堕棿
- for (int i = times; i < crnNumber * 2; i++) {
- int[] locNecessaryParameters = Utils.LocNecessaryParameters(rowLastno, curRow, crnNumber);
- curRow = locNecessaryParameters[1];
- crnNo = locNecessaryParameters[2];
- if (basCrnpService.checkSiteError(crnNo, true)) {
- rowCount = locNecessaryParameters[0];
- nearRow = locNecessaryParameters[3];
- List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
- .eq("row1", nearRow).eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()));
- int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100));
- if (locMasts.size() - crnCountO <= 2) {
- log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times);
- nearRow = 0;
- times++;
- continue;
- }
- break;
- } else {
- times++;
- }
- }
+// //姝ょ▼搴忕敤浜庝紭鍖栧爢鍨涙満寮傚父鏃剁殑杩愯鏃堕棿
+// for (int i = times; i < crnNumber * 2; i++) {
+// int[] locNecessaryParameters = Utils.LocNecessaryParameters(rowLastno, curRow, crnNumber);
+// curRow = locNecessaryParameters[1];
+// crnNo = locNecessaryParameters[2];
+// if (basCrnpService.checkSiteError(crnNo, true)) {
+// rowCount = locNecessaryParameters[0];
+// nearRow = locNecessaryParameters[3];
+// List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
+// .eq("row1", nearRow).eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()));
+// int crnCountO = wrkMastService.selectCount(new EntityWrapper<WrkMast>().eq("crn_no", crnNo).le("io_type", 100));
+// if (locMasts.size() - crnCountO <= 2) {
+// log.error(crnNo + "鍙峰爢鍨涙満娌℃湁绌哄簱浣嶏紒锛侊紒 灏哄瑙勬牸锛� {}锛� 杞娆℃暟锛歿}", JSON.toJSONString(locTypeDto), times);
+// nearRow = 0;
+// times++;
+// continue;
+// }
+// break;
+// } else {
+// times++;
+// }
+// }
if (nearRow == 0) {
throw new CoolException("鏃犲彲鐢ㄥ爢鍨涙満");
}
@@ -290,7 +323,7 @@
if (signRule1) {
if (nearRow != curRow) {
List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
- .eq("row1", nearRow).eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()));
+ .eq("row1", nearRow).eq("loc_sts", "O").eq("crn_no", crnNo));
for (LocMast locMast1 : locMasts) {
//鑾峰彇宸烽亾
// List<String> groupOutsideLocCrn = Utils.getGroupOutLocCrn(curRow,nearRow,locMast1.getLocNo(), curRow>nearRow);
@@ -407,27 +440,27 @@
if (Cools.isEmpty(locMast) && crnNo != 0) {
List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
.eq("row1", nearRow)
- .eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue())
+ .eq("loc_sts", "O").eq("crn_no", crnNo)
.orderBy("lev1", true).orderBy("bay1", true));
- for (LocMast locMast1 : locMasts) {
- if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
- continue;
- }
- if (Utils.BooleanWhsTypeStaIoType(rowLastno)) {
- String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
- LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
- .eq("loc_no", shallowLoc).eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()));
- if (!Cools.isEmpty(locMast2)) {
- locMast = locMast2;
- break;
- }
- } else {
- if (!Cools.isEmpty(locMast1)) {
- locMast = locMast1;
- break;
- }
- }
- }
+// for (LocMast locMast1 : locMasts) {
+// if (!VersionUtils.locMoveCheckLocTypeComplete(locMast1, locTypeDto)) {
+// continue;
+// }
+// if (Utils.BooleanWhsTypeStaIoType(rowLastno)) {
+// String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
+// LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
+// .eq("loc_no", shallowLoc).eq("loc_sts", "O").eq("crn_no", crnNo));
+// if (!Cools.isEmpty(locMast2)) {
+// locMast = locMast2;
+// break;
+// }
+// } else {
+// if (!Cools.isEmpty(locMast1)) {
+// locMast = locMast1;
+// break;
+// }
+// }
+// }
if (Cools.isEmpty(locMast) && Utils.BooleanWhsTypeStaIoType(rowLastno)) {
for (LocMast locMast1 : locMasts) {
@@ -437,19 +470,19 @@
if (Utils.BooleanWhsTypeStaIoType(rowLastno)) {
String shallowLoc = Utils.getDeepLoc(slaveProperties, locMast1.getLocNo());
LocMast locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
- .eq("loc_no", shallowLoc).eq("loc_sts", "O").eq("whs_type", rowLastnoType.getType().longValue()));
+ .eq("loc_no", shallowLoc).eq("loc_sts", "O").eq("crn_no", crnNo));
if (!Cools.isEmpty(locMast2)) {
locMast = locMast2;
break;
} else {
locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
- .eq("loc_no", shallowLoc).eq("loc_sts", "F").eq("whs_type", rowLastnoType.getType().longValue()));
+ .eq("loc_no", shallowLoc).eq("loc_sts", "F").eq("crn_no", crnNo));
if (!Cools.isEmpty(locMast2)) {
locMast = locMast1;
break;
} else {
locMast2 = locMastService.selectOne(new EntityWrapper<LocMast>()
- .eq("loc_no", shallowLoc).eq("loc_sts", "D").eq("whs_type", rowLastnoType.getType().longValue()));
+ .eq("loc_no", shallowLoc).eq("loc_sts", "D").eq("crn_no", crnNo));
if (!Cools.isEmpty(locMast2)) {
locMast = locMast1;
break;
diff --git a/src/main/webapp/static/js/orderPakout/order.js b/src/main/webapp/static/js/orderPakout/order.js
index b78d895..7df8460 100644
--- a/src/main/webapp/static/js/orderPakout/order.js
+++ b/src/main/webapp/static/js/orderPakout/order.js
@@ -14,19 +14,19 @@
// 娓叉煋鎼滅储妯℃澘
$.ajax({
- url: baseUrl+"/docType/list/auth",
+ url: baseUrl + "/docType/list/auth",
headers: {'token': localStorage.getItem('token')},
data: {
limit: 9999
},
method: 'POST',
success: function (res) {
- if (res.code === 200){
+ if (res.code === 200) {
let template = Handlebars.compile($('#docTypeTpl').html());
$('#docType-query').html(template(res.data));
layui.form.render('select');
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
} else {
layer.msg(res.msg, {icon: 2})
}
@@ -36,23 +36,23 @@
// 娓叉煋琛ㄦ牸
var insTb = table.render({
elem: '#order',
- url: baseUrl+'/order/pakout/order/head/page/auth',
+ url: baseUrl + '/order/pakout/order/head/page/auth',
headers: {token: localStorage.getItem('token')},
page: true,
cellMinWidth: 100,
cols: [[
- { type: 'numbers' },
- { field: 'orderNo', title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl' , minWidth: 180},
- { field: 'defNumber', align: 'center', title: '娴佹按鍙�', minWidth: 160, width: 160 },
- { field: 'number', align: 'center', title: '娲惧伐鍗曞彿', minWidth: 160, width: 160 },
- { field: 'cstmrName', align: 'center', title: '鍏徃ID', minWidth: 160, width: 160 },
- { field: 'itemName', align: 'center', title: '绠卞彿', minWidth: 160, width: 160 },
- { field: 'docType$', align: 'center', title: '绫诲瀷', minWidth: 130},
- { field: 'orderTime', align: 'center', title: '娲惧伐鏃堕棿', minWidth: 160, width: 160 },
- { field: 'createTime$', title: '鍒涘缓鏃堕棿', minWidth: 160, width: 160 },
- { field: 'settle$', align: 'center', title: '鐘舵��', templet: '#settleTpl', minWidth: 100, width: 100 },
- { align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160 },
- { align: 'center', title: '鎿嶄綔', toolbar: '#operate', width: 180 }
+ {type: 'numbers'},
+ {field: 'orderNo', title: '鍗曟嵁缂栧彿', templet: '#orderNoTpl', minWidth: 180},
+ {field: 'defNumber', align: 'center', title: '娴佹按鍙�', minWidth: 160, width: 160},
+ {field: 'number', align: 'center', title: '娲惧伐鍗曞彿', minWidth: 160, width: 160},
+ {field: 'cstmrName', align: 'center', title: '鍏徃ID', minWidth: 160, width: 160},
+ {field: 'itemName', align: 'center', title: '绠卞彿', minWidth: 160, width: 160},
+ {field: 'docType$', align: 'center', title: '绫诲瀷', minWidth: 130},
+ {field: 'orderTime', align: 'center', title: '娲惧伐鏃堕棿', minWidth: 160, width: 160},
+ {field: 'createTime$', title: '鍒涘缓鏃堕棿', minWidth: 160, width: 160},
+ {field: 'settle$', align: 'center', title: '鐘舵��', templet: '#settleTpl', minWidth: 100, width: 100},
+ {align: 'center', title: '鏄庣粏', toolbar: '#tbLook', minWidth: 160, width: 160},
+ {align: 'center', title: '鎿嶄綔', toolbar: '#operate', width: 180}
]],
request: {
pageName: 'curr',
@@ -72,7 +72,7 @@
done: function (res, curr, count) {
limit();
if (res.code === 403) {
- top.location.href = baseUrl+"/";
+ top.location.href = baseUrl + "/";
}
insTbCount = count;
}
@@ -111,7 +111,7 @@
success: function (layero, dIndex) {
table.render({
elem: '#itemTable',
- headers: { token: localStorage.getItem('token') },
+ headers: {token: localStorage.getItem('token')},
url: baseUrl + '/order/pakout/orderDetl/list/auth',
where: {
order_id: data.id
@@ -119,22 +119,18 @@
page: true,
height: '450px;',
cellMinWidth: 100,
- cols: [
- // [
- // { type: 'numbers' },
- // { field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160 },
- // { field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160 },
- // { field: 'standby1', title: '渚涘簲鍟嗙紪鐮�', width: 160 },
- // { field: 'threeCode', title: 'BS Code', width: 160 },
- // { field: 'tag$', title: '鐗╂枡绉嶇被' },
- // { field: 'anfme', title: '鏁伴噺' },
- // { field: 'workQty', title: '浣滀笟鏁伴噺' },
- // { field: 'qty', title: '瀹屾垚鏁伴噺', style: 'font-weight: bold' },
- // { field: 'specs', title: '瑙勬牸' }
- // ]
- getCol()
-
- ],
+ cols: [[
+ {field: 'matnr', title: '鍟嗗搧缂栫爜', width: 160},
+ {field: 'maktx', title: '鍟嗗搧鍚嶇О', width: 160},
+ {field: 'tag$', align: 'center', title: '闆朵欢绫诲瀷'},
+ {field: 'standby1', title: '渚涘簲鍟嗙紪鐮�', width: 120},
+ {field: 'anfme', title: '鏁伴噺'},
+ {field: 'workQty', title: '浣滀笟鏁伴噺'},
+ {field: 'qty', title: '瀹屾垚鏁伴噺', style: 'font-weight: bold'},
+ {field: 'weight', align: 'center',title: '閲嶉噺', hide: false },
+ {field: 'volume', align: 'center',title: '灏哄', hide: false},
+ {field: 'specs', title: '瑙勬牸'}
+ ]],
request: {
pageName: 'curr',
pageSize: 'limit'
@@ -161,7 +157,7 @@
});
function getCol() {
- var cols = [];
+ var cols = [{field: 'locNo$', align: 'center', title: '搴撲綅鍙�'},];
cols.push.apply(cols, cacheCols);
return cols;
}
@@ -180,7 +176,7 @@
$.ajax({
url: baseUrl + "/basAreas/list/auth",
headers: {'token': localStorage.getItem('token')},
- data: { limit: 9999 },
+ data: {limit: 9999},
method: 'POST',
success: function (res) {
if (res.code === 200) {
@@ -214,18 +210,18 @@
}
let nList = admin.util.deepClone(xxDataList);
for (let xi = 0; xi < nList.length; xi++) {
- if (nList[xi].anfme <= 0){
+ if (nList[xi].anfme <= 0) {
layer.msg('鏄庣粏淇敼鏁伴噺涓嶅悎娉�', {icon: 2});
return false;
}
- if (nList[xi].anfme < nList[xi].workQty){
+ if (nList[xi].anfme < nList[xi].workQty) {
layer.msg('鏁伴噺涓嶈兘灏忎簬宸蹭綔涓氭暟閲�', {icon: 2});
return false;
}
}
layer.load(2);
$.ajax({
- url: baseUrl+"/order/pakout/order/form/" + (isExpAdd?"add":"modify") + "/auth",
+ url: baseUrl + "/order/pakout/order/form/" + (isExpAdd ? "add" : "modify") + "/auth",
headers: {'token': localStorage.getItem('token')},
data: JSON.stringify({
orderId: Number(data.field.id),
@@ -234,17 +230,17 @@
itemName: data.field.itemName ? Number(data.field.itemName) : null,
orderDetlPakoutList: nList
}),
- contentType:'application/json;charset=UTF-8',
+ contentType: 'application/json;charset=UTF-8',
method: 'POST',
success: function (res) {
layer.closeAll('loading');
- if (res.code === 200){
+ if (res.code === 200) {
layer.close(dIndex);
$(".layui-laypage-btn")[0].click();
layer.msg(res.msg, {icon: 1});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
layer.msg(res.msg, {icon: 2});
}
}
@@ -262,19 +258,19 @@
cellMinWidth: 100,
cols: [
getCol()
- // [
- // {type: 'numbers', title: '#'},
- // {field: 'matnr', title: '闆朵欢浠g爜', width: 160},
- // {field: 'maktx', title: '闆朵欢鍚嶇О', width: 200},
- // // {field: 'batch', title: '鎵瑰彿', edit: true},
- // {field: 'standby1', title: '渚涘簲鍟嗕唬鐮�', edit: true},
- // {field: 'specs', title: '瑙勬牸'},
- // {field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
- // {field: 'workQty', title: '浣滀笟鏁伴噺', minWidth: 100, width: 100},
- // // {field: 'unit', title: '鍗曚綅', width: 80},
- // {field: 'memo', title: '澶囨敞' , edit: true},
- // {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
- // ]
+ // [
+ // {type: 'numbers', title: '#'},
+ // {field: 'matnr', title: '闆朵欢浠g爜', width: 160},
+ // {field: 'maktx', title: '闆朵欢鍚嶇О', width: 200},
+ // // {field: 'batch', title: '鎵瑰彿', edit: true},
+ // {field: 'standby1', title: '渚涘簲鍟嗕唬鐮�', edit: true},
+ // {field: 'specs', title: '瑙勬牸'},
+ // {field: 'anfme', title: '鏁伴噺(淇敼)', style: 'color: blue;font-weight: bold', edit: true, minWidth: 110, width: 110},
+ // {field: 'workQty', title: '浣滀笟鏁伴噺', minWidth: 100, width: 100},
+ // // {field: 'unit', title: '鍗曚綅', width: 80},
+ // {field: 'memo', title: '澶囨敞' , edit: true},
+ // {align: 'center', title: '鎿嶄綔', toolbar: '#formSSXMTableBar', minWidth: 80, width: 80, fixed: 'right'}
+ // ]
],
done: function (res) {
$(layero).find('.layui-table-view').css('margin', '0');
@@ -283,17 +279,17 @@
};
if (!isExpAdd) {
$.ajax({
- url: baseUrl+"/order/pakout/order/detl/all/auth?orderId=" + expTpe.id,
+ url: baseUrl + "/order/pakout/order/detl/all/auth?orderId=" + expTpe.id,
headers: {'token': localStorage.getItem('token')},
method: 'GET',
async: false,
success: function (res) {
- if (res.code === 200){
+ if (res.code === 200) {
xxDataList = res.data;
tbOptions.data = xxDataList;
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
layer.msg(res.msg, {icon: 2})
}
}
@@ -307,7 +303,7 @@
if (layEvent === 'edit') {
showEditModel2(data);
} else if (layEvent === 'del') {
- if(data.workQty > 0){
+ if (data.workQty > 0) {
layer.msg("宸插瓨鍦ㄤ綔涓氭暟閲忥紝涓嶈兘鍒犻櫎", {icon: 2});
return;
}
@@ -330,7 +326,7 @@
table.on('edit(formSSXMTable)', function (obj) {
let index = obj.tr.attr("data-index");
let data = xxDataList[index];
- if (obj.field === 'anfme'){
+ if (obj.field === 'anfme') {
let vle = Number(obj.value);
if (isNaN(vle)) {
layer.msg("璇疯緭鍏ユ暟瀛�", {icon: 2});
@@ -342,7 +338,7 @@
// insTbSSXM.reload({data: xxDataList});
return false;
}
- if(obj.value < data.workQty){
+ if (obj.value < data.workQty) {
layer.msg("杈撳叆鏁伴噺涓嶈兘灏忎簬浣滀笟涓暟閲�", {icon: 2});
// data[obj.field] = 0;
// insTbSSXM.reload({data: xxDataList});
@@ -372,21 +368,21 @@
// 琛ㄥ崟鎻愪氦浜嬩欢
form.on('submit(matEditSubmit)', function (data) {
let selectList = matXmSelect.getValue();
- for (let i = 0; i<selectList.length; i++) {
+ for (let i = 0; i < selectList.length; i++) {
let item = selectList[i];
// 鏌ヨ鐗╂枡璇︽儏
$.ajax({
- url: baseUrl+"/mat/covert/"+item.value+"/auth",
+ url: baseUrl + "/mat/covert/" + item.value + "/auth",
headers: {'token': localStorage.getItem('token')},
method: 'GET',
async: false,
success: function (res) {
- if (res.code === 200){
+ if (res.code === 200) {
xxDataList.push(res.data);
insTbSSXM.reload({data: xxDataList, page: {curr: 1}});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
layer.msg(res.msg, {icon: 2})
}
}
@@ -402,19 +398,19 @@
width: '340px',
},
autoRow: true,
- toolbar: { show: true },
+ toolbar: {show: true},
filterable: true,
remoteSearch: true,
- remoteMethod: function(val, cb, show){
+ remoteMethod: function (val, cb, show) {
$.ajax({
- url: baseUrl+"/mat/all/get/kv",
+ url: baseUrl + "/mat/all/get/kv",
headers: {'token': localStorage.getItem('token')},
data: {
condition: val
},
method: 'POST',
success: function (res) {
- if (res.code === 200){
+ if (res.code === 200) {
cb(res.data)
} else {
cb([]);
@@ -444,7 +440,7 @@
layer.close(i);
layer.load(2);
$.ajax({
- url: baseUrl+"/order/pakout/order/delete/auth",
+ url: baseUrl + "/order/pakout/order/delete/auth",
headers: {'token': localStorage.getItem('token')},
data: {
orderId: orderId
@@ -452,16 +448,16 @@
method: 'POST',
success: function (res) {
layer.closeAll('loading');
- if (res.code === 200){
+ if (res.code === 200) {
if (insTbCount === 0) {
insTb.reload({page: {curr: 1}});
} else {
$(".layui-laypage-btn")[0].click();
}
layer.msg(res.msg, {icon: 1});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
layer.msg(res.msg, {icon: 2});
}
}
@@ -480,7 +476,7 @@
console.log(orderId);
console.log(settle);
$.ajax({
- url: baseUrl+"/order/pakout/order/update/auth",
+ url: baseUrl + "/order/pakout/order/update/auth",
headers: {'token': localStorage.getItem('token')},
data: {
id: orderId,
@@ -490,16 +486,16 @@
method: 'POST',
success: function (res) {
layer.closeAll('loading');
- if (res.code === 200){
+ if (res.code === 200) {
if (insTbCount === 0) {
insTb.reload({page: {curr: 1}});
} else {
$(".layui-laypage-btn")[0].click();
}
layer.msg(res.msg, {icon: 1});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
layer.msg(res.msg, {icon: 2});
}
}
@@ -511,7 +507,7 @@
function showWrkTrace(orderId) {
let loadIndex = layer.msg('璇锋眰涓�...', {icon: 16, shade: 0.01, time: false});
$.ajax({
- url: baseUrl+"/order/pakout/order/wrk/trace/auth",
+ url: baseUrl + "/order/pakout/order/wrk/trace/auth",
headers: {'token': localStorage.getItem('token')},
data: {
orderId: orderId
@@ -519,7 +515,7 @@
method: 'POST',
success: function (res) {
layer.close(loadIndex);
- if (res.code === 200){
+ if (res.code === 200) {
laytpl(wrkTraceDialog.innerHTML).render(res.data, function (html) {
admin.open({
type: 1,
@@ -540,19 +536,27 @@
},
color: ['#10B4E8', '#E0E0E0', '#FF0000'],
tooltip: {trigger: 'item'},
- series: [{name: '鏁伴噺', type: 'pie', radius: ['75%', '80%'], label: {normal: {show: false}}}]
+ series: [{
+ name: '鏁伴噺',
+ type: 'pie',
+ radius: ['75%', '80%'],
+ label: {normal: {show: false}}
+ }]
};
traceCharts.setOption(traceOptions);
// 璧嬪��
traceCharts.setOption({
title: {
- subtext: res.data.totalQty+"/"+res.data.wrkQty+"/"+res.data.endQty
+ subtext: res.data.totalQty + "/" + res.data.wrkQty + "/" + res.data.endQty
},
series: [
{
data: [
{name: '宸蹭綔涓�', value: res.data.wrkQty},
- {name: '鏈綔涓�', value: res.data.totalQty-res.data.wrkQty-res.data.lackQty},
+ {
+ name: '鏈綔涓�',
+ value: res.data.totalQty - res.data.wrkQty - res.data.lackQty
+ },
{name: '搴撳瓨涓嶈冻', value: res.data.lackQty},
]
}
@@ -561,9 +565,9 @@
}
});
});
- } else if (res.code === 403){
- top.location.href = baseUrl+"/";
- }else {
+ } else if (res.code === 403) {
+ top.location.href = baseUrl + "/";
+ } else {
layer.msg(res.msg, {icon: 2});
}
}
@@ -572,7 +576,7 @@
layDate.render({
elem: '.layui-laydate-range'
- ,type: 'datetime'
- ,range: true
+ , type: 'datetime'
+ , range: true
});
});
--
Gitblit v1.9.1