1
zhangc
2025-04-12 4ec87f4d9d873487adda85686a1bfd7fa620f857
src/main/java/com/zy/asrs/task/WrkMastScheduler.java
@@ -11,7 +11,9 @@
import com.zy.asrs.service.WrkMastService;
import com.zy.asrs.utils.NotifyUtils;
import com.zy.common.utils.HttpHandler;
import com.zy.core.enums.LocStsType;
import com.zy.core.enums.SlaveType;
import com.zy.core.enums.WrkIoType;
import com.zy.core.enums.WrkStsType;
import com.zy.system.entity.Config;
import com.zy.system.service.ConfigService;
@@ -77,7 +79,7 @@
            }
            //上报
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(wrkMast));
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(wrkMast));
        }
    }
@@ -120,7 +122,7 @@
            }
            //上报
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(wrkMast));
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(wrkMast));
        }
    }
@@ -183,14 +185,21 @@
            }
            //上报
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(wrkMast));
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_COMPLETE, JSON.toJSONString(wrkMast));
        }
    }
    @Scheduled(cron = "0/1 * * * * ? ")
    @Transactional
    public void executeMove(){
        List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("wrk_sts", WrkStsType.COMPLETE_MOVE.sts));
        List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>()
                .in("wrk_sts"
                        , WrkStsType.COMPLETE_MOVE.sts
                        , WrkStsType.COMPLETE_MOVE_TRANSPORT_LIFT.sts
                        , WrkStsType.COMPLETE_MOVE_TRANSPORT_LIFT_OUT.sts
                        , WrkStsType.MOVE_IN_NO_LIFT_14.sts
                        , WrkStsType.MOVE_OUT_NO_LIFT_13.sts
                ));
        if (wrkMasts.isEmpty()) {
            return;
        }
@@ -226,7 +235,7 @@
            }
            //上报
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), NotifyMsgType.TASK_CHARGE_COMPLETE, JSON.toJSONString(wrkMast));
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_CHARGE_COMPLETE, JSON.toJSONString(wrkMast));
        }
    }
@@ -248,8 +257,34 @@
                log.info("删除工作主档[workNo={}]失败", wrkMast.getWrkNo());
            }
            if (wrkMast.getIoType() == WrkIoType.IN.id) {
                LocMast locMast = locMastService.queryByLoc(wrkMast.getLocNo());
                locMast.setLocSts(String.valueOf(LocStsType.O));
                locMast.setModiTime(new Date());
                locMastService.updateById(locMast);
            } else if (wrkMast.getIoType() == WrkIoType.OUT.id) {
                LocMast locMast = locMastService.queryByLoc(wrkMast.getSourceLocNo());
                locMast.setLocSts(String.valueOf(LocStsType.O));
                locMast.setModiTime(new Date());
                locMastService.updateById(locMast);
            } else if (wrkMast.getIoType() == WrkIoType.LOC_MOVE.id) {
                LocMast sourceLocMast = locMastService.queryByLoc(wrkMast.getSourceLocNo());
                LocMast locMast = locMastService.queryByLoc(wrkMast.getLocNo());
                if (sourceLocMast.getLocSts().equals(String.valueOf(LocStsType.R))) {
                    sourceLocMast.setLocSts(String.valueOf(LocStsType.F));
                    sourceLocMast.setModiTime(new Date());
                    locMastService.updateById(sourceLocMast);
                }
                if (locMast.getLocSts().equals(String.valueOf(LocStsType.S))) {
                    locMast.setLocSts(String.valueOf(LocStsType.O));
                    locMast.setModiTime(new Date());
                    locMastService.updateById(locMast);
                }
            }
            //上报
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), NotifyMsgType.TASK_CANCEL, JSON.toJSONString(wrkMast));
            notifyUtils.notify("task", 1, String.valueOf(wrkMast.getWrkNo()), wrkMast.getWmsWrkNo(), NotifyMsgType.TASK_CANCEL, JSON.toJSONString(wrkMast));
        }
    }