| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | 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("数据库异常,堆垛机列表为空"); |
| | | } |
| | | 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); |
| | | } |
| | | |