| | |
| | | |
| | | @Autowired |
| | | private StaDescService staDescService; |
| | | @Autowired |
| | | private BasCrnpService basCrnpService; |
| | | |
| | | @Value("${wms.url}") |
| | | private String wmsUrl; |
| | |
| | | } |
| | | |
| | | Map<String,Integer> map = new HashMap<>(); |
| | | map.put("J-1101",102);map.put("J-1102",101); |
| | | map.put("J-1103",106);map.put("J-1104",105); |
| | | map.put("J-1105",110);map.put("J-1106",109); |
| | | map.put("J-1107",114);map.put("J-1108",113); |
| | | map.put("J-1109",118);map.put("J-1110",117); |
| | | map.put("J-1111",122);map.put("J-1112",121); |
| | | map.put("J-1102",102);map.put("J-1101",101); |
| | | map.put("J-1103",105);map.put("J-1104",106); |
| | | map.put("J-1105",109);map.put("J-1106",110); |
| | | map.put("J-1107",113);map.put("J-1108",114); |
| | | map.put("J-1109",117);map.put("J-1110",118); |
| | | map.put("J-1111",121);map.put("J-1112",122); |
| | | map.put("H-1102",300);map.put("H-1101",305); |
| | | StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("stn_desc", param.getWharfCode())); |
| | | |
| | | if (Cools.isEmpty(staDesc)){ |
| | | return R.error("程序报错,未查询到站点"); |
| | | map.put("G-1102",400);map.put("G-1101",405); |
| | | // StaDesc staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | // .eq("stn_desc", param.getWharfCode())); |
| | | // |
| | | // if (Cools.isEmpty(staDesc)){ |
| | | // return R.error("程序报错,未查询到站点"); |
| | | // } |
| | | if (Cools.isEmpty(map.get(param.getWharfCode()))){ |
| | | return R.error("未查询到站点"); |
| | | } |
| | | //BasDevp basDevp = basDevpService.selectById(map.get(param.getWharfCode())); |
| | | BasDevp basDevp = basDevpService.selectById(staDesc.getStnNo()); |
| | | if (basDevp.getAutoing().equals("Y")){ |
| | | BasDevp basDevp = basDevpService.selectById(map.get(param.getWharfCode())); |
| | | // BasDevp basDevp = basDevpService.selectById(staDesc.getStnNo()); |
| | | if (basDevp.getAutoing().equals("Y") && (basDevp.getInEnable().equals("Y") || basDevp.getOutEnable().equals("Y"))){ |
| | | apiLogService.save("AGV请求入库码头接口" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | | ,appkey |
| | |
| | | ,R.ok().toString() |
| | | ,true |
| | | ); |
| | | return R.ok(); |
| | | return R.ok("可入"); |
| | | }else { |
| | | apiLogService.save("AGV请求入库码头接口" |
| | | ,request.getRemoteAddr()+request.getRequestURI() |
| | |
| | | if (Cools.isEmpty(param.getEmptyContainer())){ |
| | | return R.error("是否空托盘信号为空!"); |
| | | } |
| | | if (Cools.isEmpty(param.getTargetWharf())){ |
| | | return R.error("目标码头区域为空!");//G开头=7车间,H开头=8层,J开头=9车间 |
| | | if (!param.getTaskType().equals("YK")){ |
| | | if (Cools.isEmpty(param.getTargetWharf())){ |
| | | return R.error("目标码头区域为空!");//G开头=7车间,H开头=8层,J开头=9车间 |
| | | } |
| | | } |
| | | |
| | | StaDesc staDesc = new StaDesc(); |
| | | if (param.getTaskType().equals("CK") && param.getTargetWharf().contains("J")){ |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", param.getTaskTunnel()).eq("type_no",2).lt("crn_stn", 200)); |
| | | .eq("crn_no",param.getTaskTunnel()) |
| | | .eq("type_no",2) |
| | | .lt("stn_no",200)); |
| | | }else if (param.getTaskType().equals("CK") && param.getTargetWharf().contains("H")){ |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no",param.getTaskTunnel()) |
| | | .eq("type_no",2) |
| | | .lt("stn_no",400) |
| | | .gt("stn_no",200)); |
| | | }else { |
| | | staDesc = staDescService.selectOne(new EntityWrapper<StaDesc>() |
| | | .eq("crn_no", param.getTaskTunnel()).eq("type_no",2).ge("crn_stn", 200)); |
| | | .eq("crn_no",param.getTaskTunnel()) |
| | | .eq("type_no",2) |
| | | .lt("stn_no",500) |
| | | .ge("stn_no",400)); |
| | | } |
| | | param.setTargetLocationCode(staDesc.getStnNo().toString()); |
| | | |
| | |
| | | ,r.toString() |
| | | ,true |
| | | ); |
| | | return r; |
| | | |
| | | |
| | | } |
| | | |
| | | return null; |
| | | return R.ok(); |
| | | } |
| | | |
| | | //任务取消接口 |
| | |
| | | } |
| | | } |
| | | |
| | | @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()); |
| | | if (basCrnp.getOutEnable().equals("N")){ |
| | | continue; |
| | | } |
| | | if (basCrnp.getCrnErr() != 0){ |
| | | continue; |
| | | } |
| | | if (basCrnp.getCrnSts() != 3){ |
| | | continue; |
| | | } |
| | | |
| | | crnStatusDtos.add(basCrnp.getCrnNo()); |
| | | |
| | | |
| | | } |
| | | |
| | | return R.ok(crnStatusDtos); |
| | | } |
| | | |
| | | // @PostMapping("/getCrnStatus") |
| | | // public R getCrnStatus(HttpServletRequest request) { |
| | | // List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>()); |
| | | // if (Cools.isEmpty(basCrnps)){ |
| | | // return R.error("数据库异常,堆垛机列表为空"); |
| | | // } |
| | | // List<CrnStatusDto> crnStatusDtos = new ArrayList<>(); |
| | | // for (BasCrnp basCrnp : basCrnps){ |
| | | // CrnStatusDto crnStatusDto = new CrnStatusDto(); |
| | | // crnStatusDto.setCrnNo(basCrnp.getCrnNo()); |
| | | // if (basCrnp.getOutEnable().equals("N")){ |
| | | // crnStatusDto.setCrnStatus(500); |
| | | // crnStatusDto.setCrnErrMsg("堆垛机出库被禁用"); |
| | | // crnStatusDtos.add(crnStatusDto); |
| | | // continue; |
| | | // } |
| | | // if (basCrnp.getCrnErr() != 0){ |
| | | // crnStatusDto.setCrnStatus(500); |
| | | // crnStatusDto.setCrnErrMsg("堆垛机处于报警状态"); |
| | | // crnStatusDtos.add(crnStatusDto); |
| | | // continue; |
| | | // } |
| | | // if (basCrnp.getCrnSts() != 3){ |
| | | // crnStatusDto.setCrnStatus(500); |
| | | // crnStatusDto.setCrnErrMsg("堆垛机处于非自动状态"); |
| | | // crnStatusDtos.add(crnStatusDto); |
| | | // continue; |
| | | // } |
| | | // |
| | | // crnStatusDto.setCrnStatus(200); |
| | | // crnStatusDto.setCrnErrMsg(""); |
| | | // crnStatusDtos.add(crnStatusDto); |
| | | // |
| | | // |
| | | // } |
| | | // |
| | | // return R.ok(crnStatusDtos); |
| | | // } |
| | | |
| | | |
| | | } |