| | |
| | | // 获取入库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | if (staProtocol == null || !staProtocol.isLoading()) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Integer workNo = staProtocol.getWorkNo(); |
| | | if (workNo!=9998){ |
| | | continue; |
| | | } |
| | | Integer stano = staProtocol.getStaNo(); |
| | | |
| | | // 尺寸检测异常 |
| | | boolean back = false; |
| | | String errMsg = ""; |
| | | if (staProtocol.getGrossWt()>=600){ |
| | | errMsg = "超重"; |
| | | back = true; |
| | | } |
| | | if (staProtocol.isFrontErr()) { |
| | | errMsg = "前超限"; |
| | | back = true; |
| | |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | System.out.println("扫码入库失败,{"+inSta.getStaNo()+"}入库站因{"+errMsg+"}异常,托盘已被退回"); |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setWorkNo(9999); |
| | | staProtocol.setStaNo(inSta.getBackSta()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && !staProtocol.isEmptyMk() && (workNo == 0 || (workNo>9000 && workNo<10000)) |
| | | && workNo == 9998 |
| | | && staProtocol.isPakMk() |
| | | && staProtocol.isPakMkWalk() |
| | | ) { |
| | |
| | | // 获取入库站信息 |
| | | DevpThread devpThread = (DevpThread) SlaveConnection.get(SlaveType.Devp, devp.getId()); |
| | | StaProtocol staProtocol = devpThread.getStation().get(inSta.getStaNo()); |
| | | if (staProtocol == null) { |
| | | if (staProtocol == null || !staProtocol.isLoading()) { |
| | | continue; |
| | | } else { |
| | | staProtocol = staProtocol.clone(); |
| | | } |
| | | Integer workNo = staProtocol.getWorkNo(); |
| | | if (workNo!=9997){ |
| | | continue; |
| | | } |
| | | Integer stano = staProtocol.getStaNo(); |
| | | |
| | | // 尺寸检测异常 |
| | |
| | | if (!staProtocol.isPakMk()) { |
| | | continue; |
| | | } |
| | | System.out.println("扫码入库失败,{"+inSta.getStaNo()+"}入库站因{"+errMsg+"}异常,托盘已被退回"); |
| | | // News.warn("扫码入库失败,{}入库站因{}异常,托盘已被退回", inSta.getStaNo(), errMsg); |
| | | staProtocol.setWorkNo(workNo); |
| | | staProtocol.setWorkNo(9999); |
| | | staProtocol.setStaNo(inSta.getStaNo()); |
| | | devpThread.setPakMk(staProtocol.getSiteId(), false); |
| | | MessageQueue.offer(SlaveType.Devp, devp.getId(), new Task(2, staProtocol)); |
| | |
| | | // 判断是否满足入库条件 |
| | | if (staProtocol.isAutoing() && staProtocol.isLoading() |
| | | && staProtocol.isInEnable() |
| | | && staProtocol.isEmptyMk() && (workNo == 0 || (workNo>9000 && workNo<10000)) |
| | | && (workNo == 9997) |
| | | && staProtocol.isPakMk() |
| | | && staProtocol.isPakMkWalk() |
| | | ) { |
| | |
| | | taskWrkService.updateById(taskWrk); |
| | | |
| | | |
| | | try { |
| | | HashMap<String, Object> headParam = new HashMap<>(); |
| | | headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | headParam.put("taskStatus",taskWrk.getStatusWms()); |
| | | headParam.put("ioType",taskWrk.getIoTypeWms()); |
| | | headParam.put("barCode",taskWrk.getBarcode()); |
| | | headParam.put("reportTime", LocalDateTime.now()); |
| | | headParam.put("weight",taskWrk.getScWeight().doubleValue()); |
| | | |
| | | String response; |
| | | log.error("wcs完结任务上报wms==》", headParam); |
| | | |
| | | response = new HttpHandler.Builder() |
| | | // .setHeaders(headParam) |
| | | .setUri(wmsUrl) |
| | | .setPath(taskStatusFeedbackPath) |
| | | .setJson(JSON.toJSONString(headParam)) |
| | | .build() |
| | | .doPost(); |
| | | log.error("wcs完结任务上报wms==》", response); |
| | | |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // log.error("wcs完结任务上报wms==》", jsonObject); |
| | | |
| | | apiLogService.save("wcs派发入库任务上报wms" |
| | | , wmsUrl + taskStatusFeedbackPath |
| | | , null |
| | | , "127.0.0.1" |
| | | , JSON.toJSONString(headParam) |
| | | , response |
| | | , true |
| | | ); |
| | | } catch (Exception e) { |
| | | log.error("wcs完结任务上报wms失败", taskWrk); |
| | | log.error("wcs完结任务上报wms失败,报错信息:", e); |
| | | // throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | } |
| | | // try { |
| | | // HashMap<String, Object> headParam = new HashMap<>(); |
| | | // headParam.put("taskNo",taskWrk.getTaskNo()); |
| | | // headParam.put("taskStatus",taskWrk.getStatusWms()); |
| | | // headParam.put("ioType",taskWrk.getIoTypeWms()); |
| | | // headParam.put("barCode",taskWrk.getBarcode()); |
| | | // headParam.put("reportTime", LocalDateTime.now()); |
| | | // headParam.put("weight",taskWrk.getScWeight().doubleValue()); |
| | | // |
| | | // String response; |
| | | // log.error("wcs完结任务上报wms==》", headParam); |
| | | // |
| | | // response = new HttpHandler.Builder() |
| | | // // .setHeaders(headParam) |
| | | // .setUri(wmsUrl) |
| | | // .setPath(taskStatusFeedbackPath) |
| | | // .setJson(JSON.toJSONString(headParam)) |
| | | // .build() |
| | | // .doPost(); |
| | | // log.error("wcs完结任务上报wms==》", response); |
| | | // |
| | | //// JSONObject jsonObject = JSON.parseObject(response); |
| | | //// log.error("wcs完结任务上报wms==》", jsonObject); |
| | | // |
| | | // apiLogService.save("wcs派发入库任务上报wms" |
| | | // , wmsUrl + taskStatusFeedbackPath |
| | | // , null |
| | | // , "127.0.0.1" |
| | | // , JSON.toJSONString(headParam) |
| | | // , response |
| | | // , true |
| | | // ); |
| | | // } catch (Exception e) { |
| | | // log.error("wcs完结任务上报wms失败", taskWrk); |
| | | // log.error("wcs完结任务上报wms失败,报错信息:", e); |
| | | //// throw new CoolException("wcs派发入库任务上报wms失败"); |
| | | // } |
| | | } |
| | | |
| | | } |