自动化立体仓库 - WMS系统
zhangc
2024-12-31 83b8b7cecfe8266a44bfce696d857b3be7149e3f
src/main/java/com/zy/asrs/task/AutoReplenishmentScheduler.java
@@ -8,12 +8,12 @@
import com.zy.asrs.entity.Order;
import com.zy.asrs.service.*;
import com.zy.asrs.task.handler.AutoReplenishmentHandler;
import com.zy.common.entity.Parameter;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import java.util.Date;
import java.util.List;
import java.util.Set;
@@ -35,11 +35,15 @@
    private LocDetlService locDetlService;
    /*
    定时便利库存,生成自动补货单据
    定时遍历库存,生成自动补货单据
     */
    @Scheduled(cron = "0 */1 * * * ? ")
//    @Scheduled(cron = "0 */1 * * * ? ")
    public void createOrder(){
        System.out.println(new Date());
        if(!"Y".equals(Parameter.get().getAutoReplenishment())){
            return;
        }
        //检测是否有未完成的补货单据
        DocType docType = docTypeService.selectOne(new EntityWrapper<DocType>().eq("doc_name", "自动补货单"));
        int count = orderService.selectCount(new EntityWrapper<Order>()
@@ -63,7 +67,7 @@
                if(anfmeSum > mat.getStoreMin()){
                    continue;
                }
                //查询当前物料四项库是否存在,并且托盘不含有非料箱物料
                //查询当前物料四项库是否存在,并且货架不含有非货架物料
                if(Cools.isEmpty(locDetlService.selectOne(new EntityWrapper<LocDetl>().eq("matnr", mat.getMatnr())))){
                    continue;
                }
@@ -90,7 +94,7 @@
    /*
    定时处理自动补货单据
     */
    @Scheduled(cron = "0/10 * * * * ? ")
    //@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>()