自动化立体仓库 - WMS系统
pang.jiabao
7 天以前 71fd2c86e0206f614c068be05f67356deaca9b09
src/main/java/com/zy/asrs/task/AutoLocMoveScheduler.java
@@ -8,8 +8,10 @@
import com.zy.asrs.service.WrkMastService;
import com.zy.common.model.enums.WorkNoType;
import com.zy.common.service.CommonService;
import com.zy.system.timer.LoadingConfigTimer;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
@@ -29,15 +31,21 @@
    @Resource
    private LocMastService locMastService;
    @Resource
    private LoadingConfigTimer loadingConfigTimer;
    // 立体库跑库程序,生产勿用 ,一个巷道放一个托盘
//    @Scheduled(cron = "0/5 * * * * ? ")
    @Scheduled(cron = "0/5 * * * * ? ")
    public synchronized void autoMoveLoc() {
        for(int i = 1; i <= 3; i++ ){
        if(!loadingConfigTimer.getAutoMoveLocTest().equals("Y") ){
            return;
        }
        for(int i = 1; i <= 2; i++ ){
            // 源库位
            LocMast sourceLocMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_sts", "D").eq("crn_no", i));
            if(sourceLocMast != null) {
                // 获取一个移动的目标库位
                LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("crn_no", i).eq("loc_type3", "0")
                LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("crn_no", i).isNull("loc_type3")
                        .eq("loc_sts","O").orderBy("lev1").orderBy("bay1").orderBy("row1"));
                if (locMast != null) {