From ab14726215678ac69adfeafbd845ebc5b0776ea2 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期二, 14 一月 2025 14:56:41 +0800
Subject: [PATCH] 优化订单同步逻辑及库位查找
---
src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java | 108 ++++++++++++++++++++++++++++++++++++++++-------------
1 files changed, 81 insertions(+), 27 deletions(-)
diff --git a/src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java b/src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java
index 38cc451..2242247 100644
--- a/src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java
+++ b/src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java
@@ -37,38 +37,58 @@
public void initBasDevp(){
- //鍒濆鍖�1妤肩紦瀛樿揣鏋剁珯鐐� 2鎺�5鍒�3灞�
- this.insertBatch(getCacheBasDevpList(1,2,1,5,1,3,1));
- //鍒濆鍖�3妤肩紦瀛樿揣鏋剁珯鐐� 3鎺�5鍒�3灞�
- this.insertBatch(getCacheBasDevpList(5,9,1,5,1,3,3));
- //鍒濆鍖�3妤艰緭閫佺嚎宸ヤ綔绔欑偣 4涓珯鐐�
- this.insertBatch(getLineBasDevpList());
+// //鍒濆鍖�1妤肩紦瀛樿揣鏋剁珯鐐� 2鎺�5鍒�3灞�
+// this.insertBatch(getCacheBasDevpList(1,2,1,5,1,3,1));
+// //鍒濆鍖�3妤肩紦瀛樿揣鏋剁珯鐐� 3鎺�5鍒�3灞�
+// this.insertBatch(getCacheBasDevpList(5,9,1,5,1,3,3));
+// //鍒濆鍖�3妤艰緭閫佺嚎宸ヤ綔绔欑偣 4涓珯鐐�
+// this.insertBatch(getLineBasDevpList());
+ //寰呭寘瑁呮垚鍝佸瓨鍌ㄥ尯鍏ュ簱鎺ラ┏浣�
+ this.insertBatch(getConnectionBasDevpList("DI",12,2,true,(short)1));
+ //寰呭寘瑁呮垚鍝佸瓨鍌ㄥ尯鍑哄簱鎺ラ┏浣�
+ this.insertBatch(getConnectionBasDevpList("DO",8,2,false,(short)1));
+ //鍘熸潗鏂欏叆搴撴帴椹充綅
+ this.insertBatch(getConnectionBasDevpList("YI",14,2,true,(short)2));
+ //鍘熸潗鏂欏嚭搴撴帴椹充綅
+ this.insertBatch(getConnectionBasDevpList("YO",18,2,false,(short)2));
+ //绠卞3鍏ュ簱鎺ラ┏浣�
+ this.insertBatch(getConnectionBasDevpList("XI",5,2,true,(short)3));
+ //绠卞3鍑哄簱鎺ラ┏浣�
+ this.insertBatch(getConnectionBasDevpList("XO",12,2,false,(short)3));
}
- private List<AgvBasDevp> getLineBasDevpList(){
+// private List<AgvBasDevp> getLineBasDevpList(){
+// List<AgvBasDevp> agvBasDevpList = new ArrayList<>();
+// Date now = new Date();
+// for(int row=1; row<=4; row++){
+// agvBasDevpList.add(getAgvBasDevp(row,1,1,3,"N",now));
+// }
+// return agvBasDevpList;
+// }
+
+ private List<AgvBasDevp> getConnectionBasDevpList(String type, int num, int floor, boolean inEnable, Short locType){
List<AgvBasDevp> agvBasDevpList = new ArrayList<>();
Date now = new Date();
- for(int row=1; row<=4; row++){
- agvBasDevpList.add(getAgvBasDevp(row,1,1,3,"N",now));
+ for(int index=1; index<=num; index++){
+ agvBasDevpList.add(getAgvBasDevp(type,index,floor,inEnable,locType,now));
}
return agvBasDevpList;
}
- //鏍规嵁鎺掑垪灞傝幏鍙朅GV缂撳瓨璐ф灦绔欑偣鍒楄〃
- private List<AgvBasDevp> getCacheBasDevpList(int rowIndex, int rowMax, int bayIndex, int bayMax, int levIndex, int levMax, int floor){
- List<AgvBasDevp> agvBasDevpList = new ArrayList<>();
- Date now = new Date();
- for(int row=rowIndex; row<=rowMax; row++){
- for(int bay=bayIndex; bay<=bayMax; bay++){
- for(int lev=levIndex; lev<=levMax; lev++){
- agvBasDevpList.add(getAgvBasDevp(row,bay,lev,floor,"Y",now));
- }
- }
- }
-
- return agvBasDevpList;
- }
+// //鏍规嵁鎺掑垪灞傝幏鍙朅GV缂撳瓨璐ф灦绔欑偣鍒楄〃
+// private List<AgvBasDevp> getCacheBasDevpList(int rowIndex, int rowMax, int bayIndex, int bayMax, int levIndex, int levMax, int floor){
+// List<AgvBasDevp> agvBasDevpList = new ArrayList<>();
+// Date now = new Date();
+// for(int row=rowIndex; row<=rowMax; row++){
+// for(int bay=bayIndex; bay<=bayMax; bay++){
+// for(int lev=levIndex; lev<=levMax; lev++){
+// agvBasDevpList.add(getAgvBasDevp(row,bay,lev,floor,"Y",now));
+// }
+// }
+// }
+// return agvBasDevpList;
+// }
private AgvBasDevp getAgvBasDevp(int row, int bay, int lev, int floor, String cacheShelves, Date now){
AgvBasDevp agvBasDevp = new AgvBasDevp();
@@ -84,11 +104,27 @@
return agvBasDevp;
}
- public void updateLocStsAndBarcodeByDevNo(String devNo, String locSts, String barcode){
+ private AgvBasDevp getAgvBasDevp(String type, int index, int floor, boolean inEnable, Short locType, Date now){
+ AgvBasDevp agvBasDevp = new AgvBasDevp();
+ String no = index >= 10 ? index + "" : "0" + index;
+ String devNo = type + "_" + no + "F" + floor;
+ agvBasDevp.setDevNo(devNo);
+ agvBasDevp.setLocSts("O");
+ agvBasDevp.setInEnable(inEnable ? "Y" : "N");
+ agvBasDevp.setOutEnable(inEnable ? "N" : "Y");
+ agvBasDevp.setFloor(floor);
+ agvBasDevp.setLocType1(locType);
+ agvBasDevp.setModiTime(now);
+ agvBasDevp.setAppeTime(now);
+ return agvBasDevp;
+ }
+
+ public void updateLocStsAndBarcodeByDevNo(String devNo, String locSts, String barcode, Short containerType){
AgvBasDevp agvBasDevp = this.selectById(devNo);
agvBasDevp.setLocSts(locSts);
agvBasDevp.setBarcode(barcode);
+ agvBasDevp.setLocType2(containerType);
this.updateById(agvBasDevp);
}
@@ -167,7 +203,11 @@
}
if(agvWrkMast.getIoType() == 53){
AgvLocDetl agvLocDetl = agvLocDetlService.selectByMatnrAndBatchAndCsocodeAndisoCode(agvWrkMast.getLocNo(), agvWrkDetl.getMatnr(), agvWrkDetl.getBatch(), agvWrkDetl.getThreeCode(), agvWrkDetl.getDeadTime());
- agvWrkDetl.setVolume(agvLocDetl.getAnfme());
+ if(Cools.isEmpty(agvLocDetl)){
+ agvWrkDetl.setVolume(0.0);
+ }else {
+ agvWrkDetl.setVolume(agvLocDetl.getAnfme());
+ }
}
}
@@ -213,12 +253,12 @@
}
private void setFlagForAgvBasDevpDto(AgvWrkMast agvWrkMast, AgvBasDevpDto agvBasDevpDto){
- //褰撳伐浣滄。绫诲瀷涓�101.鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず瀹瑰櫒绂诲満鎸夐挳
+ //褰撳伐浣滄。绫诲瀷涓�101.鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず璐ф灦绂诲満鎸夐挳
if(agvWrkMast.getIoType() == 101 && "F".equals(agvBasDevpDto.getLocSts())){
agvBasDevpDto.setContainerMoveOutFlag(true);
}
- //褰撳伐浣滄。绫诲瀷涓�101.鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず瀹瑰櫒绂诲満鎸夐挳
+ //褰撳伐浣滄。绫诲瀷涓�101.鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず璐ф灦绂诲満鎸夐挳
if(agvWrkMast.getIoType() == 110 && "D".equals(agvBasDevpDto.getLocSts())){
agvBasDevpDto.setContainerMoveOutFlag(true);
}
@@ -259,6 +299,15 @@
return this.baseMapper.selectCacheShelvesStationCodeByFloor(floor);
}
+ @Override
+ public List<String> selectCacheShelvesStationCodeByLocType(short locType, int floor) {
+ return this.baseMapper.selectCacheShelvesStationCodeByLocType(locType,floor);
+ }
+ @Override
+ public List<String> selectCacheShelvesStationCodeByLocType2(short locType, int floor) {
+ return this.baseMapper.selectCacheShelvesStationCodeByLocType2(locType,floor);
+ }
+
public List<Map<String,Object>> selectDevNoAndNumBystationCode(String stationCode){
return this.baseMapper.selectDevNoAndNumBystationCode(stationCode);
}
@@ -268,4 +317,9 @@
return this.baseMapper.selectAllStationCode();
}
+ @Override
+ public AgvBasDevp selectByDevNo(String devNo) {
+ return this.selectOne(new EntityWrapper<AgvBasDevp>().eq("dev_no",devNo));
+ }
+
}
--
Gitblit v1.9.1