#
vincentlu
94 分钟以前 7f1610d98fa352f17fc8a53597c4bb2a86f277ca
zy-acs-manager/src/main/java/com/zy/acs/manager/core/integrate/conveyor/ConveyorController.java
@@ -6,6 +6,7 @@
import com.zy.acs.manager.core.integrate.dto.ConveyorQueryParam;
import com.zy.acs.manager.core.integrate.dto.ConveyorQueryResult;
import com.zy.acs.manager.manager.entity.Sta;
import com.zy.acs.manager.manager.entity.Task;
import com.zy.acs.manager.manager.enums.StatusType;
import com.zy.acs.manager.manager.service.StaService;
import com.zy.acs.manager.system.controller.BaseController;
@@ -38,16 +39,34 @@
                    .orderByAsc(Sta::getStaNo)
            );
            for (Sta sta : list) {
                resultList.add(new ConveyorQueryResult(sta.getStaNo(), Boolean.TRUE));
                Long staId = sta.getId();
                boolean conveyable = !staService.hasWorkingAgv(staId);
                String taskNo = null;
                if (conveyable) {
                    Task task = staService.checkoutTask(staId);
                    if (null != task) {
                        taskNo = task.getSeqNum();
                    }
                }
                resultList.add(new ConveyorQueryResult(sta.getStaNo(), conveyable, taskNo));
            }
        } else {
            for (String staNo : staNos) {
                Sta sta = staService.selectByStaNo(staNo);
                if (null == sta) {
                if (null == sta || !sta.getStatus().equals(StatusType.ENABLE.val)) {
                    resultList.add(new ConveyorQueryResult(staNo, Boolean.FALSE));
                    continue;
                }
                resultList.add(new ConveyorQueryResult(staNo, Boolean.TRUE));
                Long staId = sta.getId();
                boolean conveyable = !staService.hasWorkingAgv(staId);
                String taskNo = null;
                if (conveyable) {
                    Task task = staService.checkoutTask(staId);
                    if (null != task) {
                        taskNo = task.getSeqNum();
                    }
                }
                resultList.add(new ConveyorQueryResult(staNo, conveyable, taskNo));
            }
        }