From 828b592b5f8e31204f93bcc2ea0c5866bdc0dcf0 Mon Sep 17 00:00:00 2001 From: Junjie <540245094@qq.com> Date: 星期三, 06 十二月 2023 20:18:44 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/tzskasrs-1' into tzskasrs-1 --- src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java | 133 ++++++++++++++++++++++++++++++++++++++----- 1 files changed, 116 insertions(+), 17 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 636dc93..310b62a 100644 --- a/src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java +++ b/src/main/java/com/zy/asrs/service/impl/AgvBasDevpServiceImpl.java @@ -1,16 +1,12 @@ package com.zy.asrs.service.impl; import com.baomidou.mybatisplus.mapper.EntityWrapper; +import com.baomidou.mybatisplus.mapper.Wrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.core.common.Cools; -import com.zy.asrs.entity.AgvBasDevp; -import com.zy.asrs.entity.AgvWaitPakin; -import com.zy.asrs.entity.AgvWrkMast; +import com.zy.asrs.entity.*; import com.zy.asrs.mapper.AgvBasDevpMapper; -import com.zy.asrs.service.AgvBasDevpService; -import com.zy.asrs.service.AgvWaitPakinService; -import com.zy.asrs.service.AgvWrkDetlService; -import com.zy.asrs.service.AgvWrkMastService; +import com.zy.asrs.service.*; import com.zy.common.model.AgvBasDevpDto; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -32,6 +28,8 @@ AgvWrkDetlService agvWrkDetlService; @Autowired AgvWaitPakinService agvWaitPakinService; + @Autowired + AgvLocDetlService agvLocDetlService; public void clearBasDevp(){ agvBasDevpMapper.deleteAll(); @@ -42,7 +40,7 @@ //鍒濆鍖�1妤肩紦瀛樿揣鏋剁珯鐐� 2鎺�5鍒�3灞� this.insertBatch(getCacheBasDevpList(1,2,1,5,1,3,1)); //鍒濆鍖�3妤肩紦瀛樿揣鏋剁珯鐐� 3鎺�5鍒�3灞� - this.insertBatch(getCacheBasDevpList(5,7,1,5,1,3,3)); + this.insertBatch(getCacheBasDevpList(5,9,1,5,1,3,3)); //鍒濆鍖�3妤艰緭閫佺嚎宸ヤ綔绔欑偣 4涓珯鐐� this.insertBatch(getLineBasDevpList()); @@ -98,9 +96,18 @@ List<Map<String, Object>> body = new ArrayList<>(); for(int i=3; i>=1; i--){ - List<AgvBasDevp> agvBasDevpList = this.selectList(new EntityWrapper<AgvBasDevp>() + Wrapper<AgvBasDevp> wrapper = new EntityWrapper<AgvBasDevp>() .eq("station_code", stationCode) - .like("dev_no","0"+ i +"@")); + .like("dev_no", "0" + i + "@"); + + List<String> list = this.selectCacheShelvesStationCodeByFloor(3); + if(list.contains(stationCode)){ + if(Cools.eq(stationCode,"CS-305") || Cools.eq(stationCode,"CS-306") || Cools.eq(stationCode,"CS-307")){ + wrapper.orderBy("dev_no",false); + } + } + + List<AgvBasDevp> agvBasDevpList = this.selectList(wrapper); Map<String, Object> map = new HashMap<>(); @@ -108,19 +115,55 @@ AgvBasDevpDto agvBasDevpDto = new AgvBasDevpDto(); BeanUtils.copyProperties(agvBasDevp, agvBasDevpDto); - if (Cools.isEmpty(agvBasDevpDto.getBarcode())) { + //濡傛灉宸ヤ綔浣嶇姸鎬佷负0.绌哄簱浣�,鍒欑洿鎺ヨ繑鍥� + if("O".equals(agvBasDevpDto.getLocSts())){ return agvBasDevpDto; } - AgvWaitPakin agvWaitPakin = agvWaitPakinService.selectOne(new EntityWrapper<AgvWaitPakin>() - .eq("zpallet", agvBasDevpDto.getBarcode())); + List<AgvWrkMast> agvWrkMasts = agvWrkMastService.selectList(new EntityWrapper<AgvWrkMast>() + .eq("loc_no", agvBasDevpDto.getDevNo()) + .or().eq("source_loc_no",agvBasDevpDto.getDevNo())); - agvBasDevpDto.setAgvWaitPakin(agvWaitPakin); - - AgvWrkMast agvWrkMast = agvWrkMastService.selectOne(new EntityWrapper<AgvWrkMast>() - .eq("barcode", agvBasDevpDto.getBarcode())); + AgvWrkMast agvWrkMast = null; + for (AgvWrkMast wrkMast : agvWrkMasts){ + if(Cools.isEmpty(agvWrkMast)){ + agvWrkMast = wrkMast; + }else { + if(agvWrkMast.getWrkSts() < wrkMast.getWrkSts()){ + agvWrkMast = wrkMast; + } + } + } agvBasDevpDto.setAgvWrkMast(agvWrkMast); + + if("F".equals(agvBasDevpDto.getLocSts()) || "R".equals(agvBasDevpDto.getLocSts())){ + AgvWaitPakin agvWaitPakin = agvWaitPakinService.selectOne(new EntityWrapper<AgvWaitPakin>() + .eq("supp_code", agvBasDevpDto.getBarcode())); + + agvBasDevpDto.setAgvWaitPakin(agvWaitPakin); + + if(Cools.isEmpty(agvWaitPakin)){ + AgvWrkDetl agvWrkDetl = agvWrkDetlService.selectOne(new EntityWrapper<AgvWrkDetl>(). + eq("wrk_no",agvWrkMast.getWrkNo())); + //agv绔欑偣鍙鍖栫鐞嗕腑鐨勭粨浣欐暟閲忔樉绀� + agvWrkDetl.setVolume(0.0); + if(agvWrkMast.getIoType() == 103){ + AgvLocDetl agvLocDetl = agvLocDetlService.selectByLocNo(agvWrkMast.getSourceLocNo()); + agvWrkDetl.setVolume(agvLocDetl.getAnfme() - agvWrkDetl.getAnfme()); + } + if(agvWrkMast.getIoType() == 53){ + AgvLocDetl agvLocDetl = agvLocDetlService.selectByLocNo(agvWrkMast.getLocNo()); + agvWrkDetl.setVolume(agvLocDetl.getAnfme()); + //agvWrkDetl.setAnfme(agvLocDetl.getAnfme() - agvWrkDetl.getAnfme()); + } + agvBasDevpDto.setAgvWrkDetl(agvWrkDetl); + } + } + + if(!Cools.isEmpty(agvWrkMast)){ + setFlagForAgvBasDevpDto(agvWrkMast,agvBasDevpDto); + } return agvBasDevpDto; @@ -136,4 +179,60 @@ return result; } + private void setFlagForAgvBasDevpDto(AgvWrkMast agvWrkMast, AgvBasDevpDto agvBasDevpDto){ + //褰撳伐浣滄。绫诲瀷涓�101.鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず瀹瑰櫒绂诲満鎸夐挳 + if(agvWrkMast.getIoType() == 101 && "F".equals(agvBasDevpDto.getLocSts())){ + agvBasDevpDto.setContainerMoveOutFlag(true); + } + + //褰撳伐浣滄。绫诲瀷涓�101.鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず瀹瑰櫒绂诲満鎸夐挳 + if(agvWrkMast.getIoType() == 110 && "D".equals(agvBasDevpDto.getLocSts())){ + agvBasDevpDto.setContainerMoveOutFlag(true); + } + + //褰撳伐浣滄。绫诲瀷涓�103.鎷f枡鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず鎷f枡/鐩樼偣鍏ュ簱鎸夐挳 + if(agvWrkMast.getIoType() == 103 && "F".equals(agvBasDevpDto.getLocSts())){ + agvBasDevpDto.setPickInFlag(true); + } + //褰撳伐浣滄。绫诲瀷涓�107.鐩樼偣鍑哄簱 骞朵笖 宸ヤ綔浣嶇姸鎬佷负F.鍦ㄥ簱鏃讹紝鏄剧ず鎷f枡/鐩樼偣鍏ュ簱鎸夐挳 + if(agvWrkMast.getIoType() == 107 && "F".equals(agvBasDevpDto.getLocSts())){ + agvBasDevpDto.setPickInFlag(true); + } + } + + public List<String> getAvailableEmptyInSite() { + return this.baseMapper.getAvailableEmptyInSite(); + } + + public AgvBasDevp getByDevNo(String devNo) { + return this.selectOne(new EntityWrapper<AgvBasDevp>().eq("dev_no",devNo)); + } + + @Override + public AgvBasDevp selectEmptyDevpByStation(String stationCode) { + return this.selectOne(new EntityWrapper<AgvBasDevp>() + .eq("station_code", stationCode) + .eq("loc_sts", "O")); + } + + @Override + public List<AgvBasDevp> getBasDevpByNoCacheShelves() { + return this.selectList(new EntityWrapper<AgvBasDevp>().eq("cache_shelves","N")); + } + + @Override + public List<String> selectCacheShelvesStationCodeByFloor(int floor) { + //Object o = this.selectList(new EntityWrapper<AgvBasDevp>().setSqlSelect("station_code").eq("floor",floor).eq("cache_shelves","Y").groupBy("station_code")); + return this.baseMapper.selectCacheShelvesStationCodeByFloor(floor); + } + + public List<Map<String,Object>> selectDevNoAndNumBystationCode(String stationCode){ + return this.baseMapper.selectDevNoAndNumBystationCode(stationCode); + } + + @Override + public List<String> selectAllStationCode() { + return this.baseMapper.selectAllStationCode(); + } + } -- Gitblit v1.9.1