自动化立体仓库 - WMS系统
#
LSH
2023-02-13 8c890f686ae2060c4c2e6afebce6c69c493c2e04
src/main/java/com/zy/asrs/task/handler/MoveLocHandler.java
@@ -12,6 +12,7 @@
import com.zy.asrs.task.core.ReturnT;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
@@ -35,13 +36,18 @@
    @Autowired
    private WorkService workService;
    @Value("${channel.equipmentRow}")
    private Integer equipmentRow;  //测试库位所在排号
    @Value("${channel.quietRow}")
    private Integer quietRow;  //静置库位所在排号
    @Transactional
    public ReturnT<String> start() {
        try {
            List<LocMast> locMasts = locMastService.selectList(new EntityWrapper<LocMast>()
                    .eq("loc_sts", "F")
                    .eq("pack_status", 3)
                    .eq("row1", 2)
                    .eq("row1", equipmentRow)
                    .eq("loc_type1", (short) 1)
                    .eq("fire_status",0)
            );
@@ -55,20 +61,20 @@
                    if (!Cools.isEmpty(testMast)){
                        if (testMast.getStatus()==4){
                            //移库开始,查询目标库位
                            LocMast targetLocNo = locMastService.queryFreeLocMast(1,(short)2);
                            LocMast targetLocNo = locMastService.queryFreeLocMast(quietRow,(short)2);
                            if (Cools.isEmpty(targetLocNo)){
                                targetLocNo=locMastService.queryFreeLocMast(2,(short)2);
                                targetLocNo=locMastService.queryFreeLocMast(equipmentRow,(short)2);
                            }
                            if (targetLocNo != null){
                                workService.locMove(locMast.getLocNo(),targetLocNo.getLocNo(),(long)Integer.parseInt(testMast.getUserId()));
                            }else {
                                log.error("没有空库位");
                                log.error("测试完成自动移库--->没有空库位!");
                            }
                        }else if (testMast.getStatus()!=4) {
                            log.error("测试状态异常,库位号为:" + testMast.getLocNo());
                        }
                    }else {
                        log.error("测试库位:"+locMast.getLocNo()+"所属测试档为空");
                        log.error("测试库位:"+locMast.getLocNo()+"所属测试档为空或者不状态为4");
                    }
                }
            }