#
zjj
2024-03-15 dbae31a7a7cd59048ada9b51fe8faff545324c59
src/main/java/com/zy/asrs/controller/OpenController.java
@@ -8,6 +8,7 @@
import com.core.common.Cools;
import com.core.common.R;
import com.core.exception.CoolException;
import com.zy.asrs.domain.vo.CrnStateTableVo;
import com.zy.asrs.entity.*;
import com.zy.asrs.entity.param.TaskOverParam;
import com.zy.asrs.entity.param.WMSAndAGVInterfaceParam;
@@ -15,6 +16,10 @@
import com.zy.asrs.service.*;
import com.zy.common.utils.HttpHandler;
import com.zy.common.web.BaseController;
import com.zy.core.CrnThread;
import com.zy.core.cache.SlaveConnection;
import com.zy.core.enums.SlaveType;
import com.zy.core.model.protocol.CrnProtocol;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -156,9 +161,10 @@
            return R.error("托盘编码为空!");
        } else if (Cools.isEmpty(param.getWharfSource())){
            return R.error("源码头为空!");
        } else if (Cools.isEmpty(param.getFreeWharfs()) || param.getFreeWharfs().size()==0){
            return R.error("空闲的入库码头(AGV)为空!");
        }
//        else if (Cools.isEmpty(param.getFreeWharfs()) || param.getFreeWharfs().size()==0){
//            return R.error("空闲的入库码头(AGV)为空!");
//        }
        R r = openService.AgvToWCSToWms(param);
        apiLogService.save("AGV请求入库码头接口"
                ,request.getRemoteAddr()+request.getRequestURI()
@@ -366,32 +372,37 @@
            return R.error();
        }
    }
    @PostMapping("/getCrnStatus")
    public R getCrnStatus(HttpServletRequest request) {
        List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>());
        if (Cools.isEmpty(basCrnps)){
            return R.error("数据库异常,堆垛机列表为空");
        }
    public R getCrnStatus(HttpServletRequest request){
        List<Integer> crnStatusDtos = new ArrayList<>();
        for (BasCrnp basCrnp : basCrnps){
            CrnStatusDto crnStatusDto = new CrnStatusDto();
            crnStatusDto.setCrnNo(basCrnp.getCrnNo());
        List<BasCrnp> crnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>().orderBy("crn_no"));
        for (BasCrnp basCrnp : crnps) {
            // 表格行
            CrnStateTableVo vo = new CrnStateTableVo();
            vo.setCrnNo(basCrnp.getCrnNo());   //  堆垛机号
            // 获取堆垛机信息
            CrnThread crnThread = (CrnThread) SlaveConnection.get(SlaveType.Crn, basCrnp.getCrnNo());
            if (crnThread == null) {
                continue;
            }
            CrnProtocol crnProtocol = crnThread.getCrnProtocol();
            if (crnProtocol == null) {
                continue;
            }
            if (basCrnp.getOutEnable().equals("N")){
                continue;
            }
            if (basCrnp.getCrnErr() != 0){
            if (crnProtocol.getAlarm() != 0){
                continue;
            }
            if (basCrnp.getCrnSts() != 3){
            if (crnProtocol.getMode() != 3){
                continue;
            }
            crnStatusDtos.add(basCrnp.getCrnNo());
        }
        return R.ok(crnStatusDtos);
    }