自动化立体仓库 - WMS系统
zyx
2023-12-01 39a150df074efd7304385d65a579d8c99a816d01
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>()