| | |
| | | |
| | | public interface AgvWrkMastService extends IService<AgvWrkMast> { |
| | | |
| | | public void updateWrkStsByWrkNo(int wrkNo, long wrkSts); |
| | | public Boolean updateWrkStsByWrkNo(int wrkNo, long wrkSts); |
| | | |
| | | public void updateWrkStsByWrkNo(int wrkNo, long wrkSts,String manuType,long userId); |
| | | |
| | |
| | | private AgvWrkMastService agvWrkMastService; |
| | | |
| | | |
| | | public void updateWrkStsByWrkNo(int wrkNo, long wrkSts) { |
| | | public Boolean updateWrkStsByWrkNo(int wrkNo, long wrkSts) { |
| | | AgvWrkMast agvWrkMast = this.selectById(wrkNo); |
| | | //判断要修改的工作档状态是否合理,如果不合理则抛出异常 |
| | | checkWrkSts(agvWrkMast, wrkSts); |
| | | agvWrkMast.setWrkSts(wrkSts); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | this.updateById(agvWrkMast); |
| | | return this.updateById(agvWrkMast); |
| | | } |
| | | |
| | | public void updateWrkStsByWrkNo(int wrkNo, long wrkSts, String manuType, long userId) { |
| | |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | |
| | | code = Integer.parseInt(jsonObject.get("code").toString()); |
| | | code = Integer.parseInt(jsonObject.get("code").toString()); |
| | | if (code != 0) { |
| | | if (code == 6) { |
| | | log.info("AGV任务单号已上报:{}", response); |
| | |
| | | throw new CoolException("调用AGV响应错误"); |
| | | //return 1; |
| | | } finally { |
| | | if(code !=6){ |
| | | if (code != 6) { |
| | | apiLogService.save( |
| | | namespace, |
| | | url + path, |
| | |
| | | throw new CoolException("任务下发失败"); |
| | | } |
| | | |
| | | agvWrkMast.setWrkSts(202L); |
| | | agvWrkMast.setModiTime(new Date()); |
| | | boolean b = agvWrkMastService.updateById(agvWrkMast); |
| | | //agvWrkMast.setWrkSts(202L); |
| | | //agvWrkMast.setModiTime(new Date()); |
| | | //boolean b = agvWrkMastService.updateById(agvWrkMast); |
| | | boolean b = agvWrkMastService.updateWrkStsByWrkNo(Math.abs(agvWrkMast.getWrkNo()), 202L); |
| | | if (!b) { |
| | | log.info("更新任务状态失败,{}", agvWrkMast.getWrkNo()); |
| | | throw new CoolException("更新任务状态失败"); |
| | | }else { |
| | | } else { |
| | | log.info("更新任务状态成功,{}", agvWrkMast.getWrkNo()); |
| | | } |
| | | if (agvWrkMast.getIoType() == 1) { |