| | |
| | | // if (!wrkMastService.updateById(mast)) { |
| | | // throw new CoolException("任务状态更新失败!!"); |
| | | // } |
| | | workService.backLocOperation(mast.getWrkNo() + "", mast.getAppeUser()); |
| | | |
| | | return R.ok("接收成功,执行回库中..."); |
| | | return workService.backLocOperation(mast.getWrkNo() + "", mast.getAppeUser()); |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | }else if (!Objects.isNull(params.getType()) && params.getType().equals("move")) { |
| | | url = createLocMoveTask; |
| | | } |
| | | String response; |
| | | String response = null; |
| | | R r = R.ok(); |
| | | try { |
| | | log.info("下发搬运任务给wcs="+JSON.toJSONString(params)); |
| | |
| | | } |
| | | } |
| | | } |
| | | }else if (wrkMast.getIoType()==101){ |
| | | }else if (wrkMast.getIoType()==101 || wrkMast.getIoType()==110) { |
| | | wrkMast.setWrkSts(12L); |
| | | wrkMast.setModiTime(new Date()); |
| | | wrkMastService.updateById(wrkMast); |
| | |
| | | String s = Utils.convertLocFormat(params.getLocNo()); |
| | | LocAroundBind bind = locAroundBindService.selectOne(new EntityWrapper<LocAroundBind>() |
| | | .eq("b_loc_no", s)); |
| | | if (!Objects.isNull(bind)&&Cools.isEmpty(wrkMast.getStaNo())) { |
| | | if (!Objects.isNull(bind)) { |
| | | bind.setFreeze(1); |
| | | locAroundBindService.updateById(bind); |
| | | //冻结相邻库位 |
| | |
| | | } |
| | | //TODO 上报是否成功 |
| | | }else { |
| | | r =R.error(); |
| | | String msg = jsonObject.getString("msg"); |
| | | if (Cools.isEmpty(msg)) { |
| | | msg = jsonObject.getString("message"); |
| | | } |
| | | r = R.error(Cools.isEmpty(msg) ? "下发任务失败" : msg); |
| | | } |
| | | } catch (IOException e) { |
| | | throw new RuntimeException(e); |
| | | log.error("下发任务给wcs异常, request={}", JSON.toJSONString(params), e); |
| | | return R.error("调用WCS接口失败:" + e.getMessage()); |
| | | } catch (Exception e) { |
| | | log.error("解析WCS下发结果异常, request={}, response={}", JSON.toJSONString(params), response, e); |
| | | return R.error("WCS返回结果异常:" + e.getMessage()); |
| | | } |
| | | return r; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 上报锁定/释放库位信息 |
| | | * |
| | |
| | | url = MesConstant.RELEASE_LOCS_URL; |
| | | } |
| | | } |
| | | String response; |
| | | String response = null; |
| | | try { |
| | | response = new HttpHandler.Builder() |
| | | .setUri(MesConstant.URL) |
| | |
| | | } else { |
| | | throw new CoolException("任务号截取失败,请检查主任务档任档wrkCode字段"); |
| | | } |
| | | }else{ |
| | | String wrkNo = mast.getWrkCode(); |
| | | WrkMast orgWrk = wrkMastService.selectOne(new EntityWrapper<WrkMast>().eq("wrk_no", wrkNo)); |
| | | if (Objects.isNull(orgWrk)) { |
| | | throw new CoolException("数据错误,主任务档不存在或已删除!!"); |
| | | } |
| | | mast.setOveMk("Y"); |
| | | orgWrk.setOveMk("Y"); |
| | | if (!wrkMastService.updateById(orgWrk)) { |
| | | throw new CoolException("任务档修改失败!!"); |
| | | } |
| | | } |
| | | } |
| | | } else { |
| | |
| | | } |
| | | Double realQty = Math.round((wrkDetl.getStockQty() - wrkDetl.getAnfme()) * 10000) / 10000.0; |
| | | if (!Cools.isEmpty(weight)) { |
| | | Double val = Math.round((weight - 2.35) * 10000) / 10000.0; |
| | | Double val = Math.round((weight - 3) * 10000) / 10000.0; |
| | | //称重后,计算出真实长度 |
| | | realQty = val * matnr.getVolume(); |
| | | if (realQty<matnr.getSafeQty()){ |
| | |
| | | return locAround; |
| | | } |
| | | } |
| | | |
| | | |