src/main/java/com/zy/asrs/service/LocDetlService.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/task/AutoReplenishmentScheduler.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/zy/asrs/task/handler/AutoReplenishmentHandler.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/application.yml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/zy/asrs/service/LocDetlService.java
@@ -75,4 +75,6 @@ LocDetl selectByContainerCode(String containerCode); List<LocDetl> selectByLocWithoutContainer(String locNo); } src/main/java/com/zy/asrs/service/impl/LocDetlServiceImpl.java
@@ -244,6 +244,12 @@ } @Override public List<LocDetl> selectByLocWithoutContainer(String locNo) { return this.selectList(new EntityWrapper<LocDetl>().eq("loc_no", locNo) .andNew().eq("supp_code", "").or().isNull("supp_code")); } @Override public int updateStockFreeze(String matnr, String locNo, Integer stockFreeze) { return this.baseMapper.updateStockFreeze(matnr, locNo, stockFreeze); } src/main/java/com/zy/asrs/task/AutoReplenishmentScheduler.java
@@ -13,7 +13,9 @@ import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.Date; import java.util.List; import java.util.Set; @Slf4j @Component @@ -35,8 +37,9 @@ /* 定时便利库存,生成自动补货单据 */ @Scheduled(cron = "0/5 * * * * ? ") @Scheduled(cron = "0 */1 * * * ? ") public void createOrder(){ System.out.println(new Date()); //检测是否有未完成的补货单据 DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", "自动补货单")); int count = orderService.selectCount(new EntityWrapper<Order>() @@ -56,12 +59,27 @@ if(Cools.isEmpty(anfmeSum)){ anfmeSum = 0.0; } //查询当前物料四项库是否存在 //当前物料不需要补货 if(anfmeSum > mat.getStoreMin()){ continue; } //查询当前物料四项库是否存在,并且托盘不含有非料箱物料 if(Cools.isEmpty(locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("matnr", mat.getMatnr())))){ continue; } if(anfmeSum < mat.getStoreMin()){ Set<String> locNosSearch = locDetlService.selectLocNos(mat.getMatnr()); //是否含有可补货出库的库位 boolean flag = false; for (String locNo : locNosSearch){ log.info("需要拣料的货位:" + locNo +",需要补货的物料:" + mat.getMatnr()); if(Cools.isEmpty(locDetlService.selectByLocWithoutContainer(locNo))){ flag = true; continue; } } if(flag){ autoReplenishmentHandler.create(mat,mat.getStoreMax() - anfmeSum); break; } @@ -72,7 +90,7 @@ /* 定时处理自动补货单据 */ @Scheduled(cron = "0/5 * * * * ? ") @Scheduled(cron = "0/10 * * * * ? ") public void excuteOrder(){ DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", "自动补货单")); List<Order> orderList = orderService.selectList(new EntityWrapper<Order>() src/main/java/com/zy/asrs/task/handler/AutoReplenishmentHandler.java
@@ -165,11 +165,19 @@ if(locMast.getLocType1() == 3){ return false; }else { return true; //且检测该库位是否含没有料箱码的物料,如有有则不允许出库 // LocDetl locDetl = locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("loc_no", locNo) // .andNew().eq("supp_code", "").or().isNull("supp_code")); if(Cools.isEmpty(locDetlService.selectByLocWithoutContainer(locNo))){ return true; }else { return false; } } }).collect(Collectors.toSet()); //重新排序 并且检测该库位是否含没有料箱码的物料,如有有则不允许出库 //重新排序 Set<String> resort = resort(locNosSearch); for(String locNo : resort){ src/main/resources/application.yml
@@ -73,16 +73,16 @@ password: Wlzh44338 agv: # url: localhost:8080 # taskCreatePath: /agv/task/create # containerMoveInPath: /agv/container/moveIn # containerMoveOutPath: /agv/container/moveOut # containerArrivedPath: /agv/containerArrived url: 10.10.10.182:9046 taskCreatePath: /task/create containerMoveInPath: /expand/api/moveIn/container containerMoveOutPath: /expand/api/moveOut/container containerArrivedPath: /conveyor/containerArrived url: localhost:8080 taskCreatePath: /agv/task/create containerMoveInPath: /agv/container/moveIn containerMoveOutPath: /agv/container/moveOut containerArrivedPath: /agv/containerArrived # url: 10.10.10.182:9046 # taskCreatePath: /task/create # containerMoveInPath: /expand/api/moveIn/container # containerMoveOutPath: /expand/api/moveOut/container # containerArrivedPath: /conveyor/containerArrived u8: url: http://192.168.1.55:8010