From 79837ea72054fb14290e8c356ea09c9aa8d5f8ee Mon Sep 17 00:00:00 2001 From: zhangc <zc@123> Date: 星期日, 22 十二月 2024 10:14:14 +0800 Subject: [PATCH] 优化订单同步逻辑及时间格式处理 --- src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java | 93 +++++++++++++++++++++++++++++++++------------- 1 files changed, 66 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 0a2aceb..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(); @@ -79,6 +99,21 @@ agvBasDevp.setLocSts("O"); agvBasDevp.setCacheShelves(cacheShelves); agvBasDevp.setFloor(floor); + agvBasDevp.setModiTime(now); + agvBasDevp.setAppeTime(now); + return agvBasDevp; + } + + 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; @@ -218,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); } @@ -265,8 +300,12 @@ } @Override - public List<String> selectCacheShelvesStationCodeByLocType(short locType) { - return this.baseMapper.selectCacheShelvesStationCodeByLocType(locType); + 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){ -- Gitblit v1.9.1