| | |
| | | import com.zy.common.model.StartupDto; |
| | | import com.zy.common.service.CommonService; |
| | | import com.zy.common.utils.HttpHandler; |
| | | import com.zy.common.web.param.ApplyChangeEnd; |
| | | import com.zy.common.web.param.ErrorMsg; |
| | | import com.zy.common.web.param.SearchEmptyParam; |
| | | import com.zy.common.web.param.SearchLocParam; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | if (Cools.isEmpty(param.getFromPort())) { |
| | | return Re.error("源站编号不能为空"); |
| | | } |
| | | // if(Cools.isEmpty(param.getWarehouse())){ |
| | | // return Re.error("仓库编号不能为空"); |
| | | // } |
| | | // if(!param.getWarehouse().equals(warehouse)){ |
| | | // return Re.error("仓库编号不匹配"); |
| | | // } |
| | | if(Cools.isEmpty(param.getWarehouse())){ |
| | | return Re.error("仓库编号不能为空"); |
| | | } |
| | | if(!param.getWarehouse().equals(warehouse)){ |
| | | return Re.error("仓库编号不匹配"); |
| | | } |
| | | List<WaitPakin> waitPakins = null; |
| | | if (param.getFromPort().equals("101")) { |
| | | |
| | |
| | | return Re.error("条码不能为空"); |
| | | } |
| | | waitPakins = waitPakinService.selectList(new EntityWrapper<WaitPakin>().eq("zpallet", param.getBarCode())); |
| | | if (Cools.isEmpty(waitPakins) && param.getIoType() != 10) { |
| | | if (Cools.isEmpty(waitPakins)) { |
| | | WrkMast wrkMast = wrkMastService.selectByBarcode(param.getBarCode()); |
| | | if (wrkMast != null && wrkMast.getIoType() == 103) { |
| | | return Re.parse(CodeRes.PICK_600); |
| | |
| | | if (Cools.isEmpty(param.getCargoHeight())) { |
| | | return Re.error("高低检测信号不能为空"); |
| | | } |
| | | if (!param.getBarCode().startsWith("7")&&!param.getBarCode().startsWith("8")){ |
| | | return Re.error("未定义的托盘码规则"); |
| | | } |
| | | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(Integer.valueOf(param.getFromPort()), true); |
| | | sourceStaNo.setLocType1(param.getCargoHeight().shortValue()); |
| | | sourceStaNo.setLocType1(param.getCargoHeight().shortValue()); // 高低库位 |
| | | if (param.getBarCode().startsWith("7")){ |
| | | sourceStaNo.setLocType2((short) 1); // 宽窄库位 1.窄库位1200*1000*990 1期库位 |
| | | }else if (param.getBarCode().startsWith("8")){ |
| | | sourceStaNo.setLocType2((short) 2); // 宽窄库位 2.宽库位1200*1000*1270 2期库位 |
| | | } |
| | | LocTypeDto locTypeDto = new LocTypeDto(sourceStaNo); |
| | | |
| | | StartupDto dto = null; |
| | |
| | | default: |
| | | break; |
| | | } |
| | | log.info("WCS入库接口返参:{},托盘码:{}", dto, param.getBarCode()); |
| | | log.info("WCS满板入库接口返参:{},托盘码:{}", dto, param.getBarCode()); |
| | | return Re.ok(); |
| | | } |
| | | |
| | |
| | | @ResponseBody |
| | | public synchronized Re getLocNo(@RequestBody SearchEmptyParam param) { |
| | | log.info("收到WCS空板入库接口请求====>>入参:{}", param); |
| | | // if(Cools.isEmpty(param.getWarehouse())){ |
| | | // return Re.error("仓库编号不能为空"); |
| | | // } |
| | | // if(!param.getWarehouse().equals(warehouse)){ |
| | | // return Re.error("仓库编号不匹配"); |
| | | // } |
| | | if(Cools.isEmpty(param.getWarehouse())){ |
| | | return Re.error("仓库编号不能为空"); |
| | | } |
| | | if(!param.getWarehouse().equals(warehouse)){ |
| | | return Re.error("仓库编号不匹配"); |
| | | } |
| | | |
| | | // 源站点状态检测 |
| | | BasDevp sourceStaNo = basDevpService.checkSiteStatus(Integer.valueOf(param.getFromPort()), true); |
| | |
| | | StartupDto dto = null; |
| | | |
| | | dto = emptyPlateIn(Integer.valueOf(param.getFromPort()), locTypeDto); |
| | | log.info("WCS入库接口返参:{},托盘码:{}", dto); |
| | | log.info("WCS空板入库接口返参:{}", dto); |
| | | return Re.ok(); |
| | | } |
| | | |
| | | @PostMapping("/fromwcs/errorReport") |
| | | @ResponseBody |
| | | public synchronized Re errReport(@RequestBody ErrorMsg param){ |
| | | log.info("收到WCS任务入库异常上报===>>入参:{}",param); |
| | | if(Cools.isEmpty(param.getWarehouse())){ |
| | | return Re.error("仓库编号不能为空"); |
| | | } |
| | | if(!param.getWarehouse().equals(warehouse)){ |
| | | return Re.error("仓库编号不匹配"); |
| | | } |
| | | return Re.ok(); |
| | | } |
| | | |
| | | @PostMapping("/fromwcs/applyChangeEnd") |
| | | @ResponseBody |
| | | public synchronized Re applyChangeEnd(@RequestBody ApplyChangeEnd param){ |
| | | log.info("收到WCS申请最终目的位置===>>入参:{}",param); |
| | | if(Cools.isEmpty(param.getWarehouse())){ |
| | | return Re.error("仓库编号不能为空"); |
| | | } |
| | | if(!param.getWarehouse().equals(warehouse)){ |
| | | return Re.error("仓库编号不匹配"); |
| | | } |
| | | if (Cools.isEmpty(param.getTaskId())){ |
| | | return Re.error("任务编号不能为空"); |
| | | } |
| | | WrkMast wrkMast = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", param.getTaskId())); |
| | | if (wrkMast == null){ |
| | | return Re.error("WMS不存在任务号:" + param.getTaskId() + "任务"); |
| | | } |
| | | if (wrkMast.getIoType() > 100){ |
| | | return Re.error("任务号:" + param.getTaskId() + "是出库任务"); |
| | | } |
| | | if (wrkMast.getWrkSts() == 4 || wrkMast.getWrkSts() == 5 || wrkMast.getWrkSts() == 14 || wrkMast.getWrkSts() == 15){ |
| | | return Re.error("任务号:" + param.getTaskId() + "已结束"); |
| | | } |
| | | String targetNo = wrkMast.getLocNo(); |
| | | return Re.ok(targetNo); |
| | | } |
| | | |
| | | |
| | |
| | | LocTypeDto locTypeDto = new LocTypeDto(); |
| | | locTypeDto.setLocType1(locType1); |
| | | //注意一个板只能放同一种物料(检索新库位) |
| | | StartupDto dto = commonService.getLocNoRunPick(4, 1, 101, wrkDetls.get(0).getMatnr(), wrkDetls.get(0).getBatch(), null, 4, locTypeDto, 2); |
| | | // StartupDto dto = commonService.getLocNoRunPick(4, 1, 101, wrkDetls.get(0).getMatnr(), wrkDetls.get(0).getBatch(), null, 4, locTypeDto, 2); |
| | | FindLocNoAttributeVo findLocNoAttributeVo = new FindLocNoAttributeVo(); |
| | | findLocNoAttributeVo.setMatnr(wrkDetls.get(0).getMatnr()); |
| | | StartupDto dto = commonService.getLocNoNew(1, 101, findLocNoAttributeVo,locTypeDto,null); |
| | | Date now = new Date(); |
| | | wrkMast.setIoTime(now); |
| | | wrkMast.setIoType(wrkMast.getIoType() - 50); // 入出库类型: 103->53,104->54,107->57 |
| | |
| | | map.put("posiY", locMast.getBay1()); |
| | | map.put("posiZ", locMast.getLev1()); |
| | | map.put("cargoNo", locMast.getLocNo()); |
| | | if(locMast.getLev1() == 1 && locMast.getRow1() == 8 && locMast.getBay1() == 1){ |
| | | if(locMast.getLev1() == 1 && locMast.getRow1() == 6 && locMast.getBay1() == 1){ |
| | | map.put("type", "6"); |
| | | }else { |
| | | map.put("type", "0"); |
| | |
| | | try { |
| | | // 保存接口日志 |
| | | apiLogService.save( |
| | | "wms同步wcs库位失败", |
| | | "wms同步wcs库位", |
| | | url + "/" + loc, |
| | | null, |
| | | "127.0.0.1", |