| | |
| | | // |
| | | // } |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") //出库库任务下发 |
| | | private void ShuttleOutTaskSend(){ |
| | | List<WrkMast> wrkMastsMove = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no",7).eq("wrk_sts", 11).eq("io_type",11)); |
| | | if (!wrkMastsMove.isEmpty()) { |
| | | return; |
| | | } |
| | | List<WrkMast> wrkMasts1 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | .in("io_type", 1,10,53,54,57).eq("crn_no",7)); |
| | | if (!Cools.isEmpty(wrkMasts1)){ |
| | | return; |
| | | } |
| | | List<WrkMast> wrkMasts = wrkMastService.selectToShuttleOutTask(); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | try { |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | if (locMast == null) { |
| | | throw new CoolException("下发四向车wcs任务失败"); |
| | | } |
| | | String loc = (locMast.getRow1()-16)+"-"+locMast.getBay1()+"-"+locMast.getLev1(); |
| | | ShuttleOutTask param = new ShuttleOutTask(); |
| | | param.setTaskNo(wrkMast.getWrkNo().toString()); |
| | | param.setOriginLoc(loc); |
| | | param.setOriginSite("31004"); |
| | | param.setDestSite("31002"); |
| | | param.setPriority("11"); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(shuttleWcsUrl) |
| | | .setPath("/openapi/createOutTask") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if (code.equals(200)) { |
| | | wrkMast.setWrkSts(105L); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | log.error("工作档[workNo={}]标记待处理失败", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | throw new CoolException("下发四向车wcs任务失败"); |
| | | } |
| | | |
| | | } |
| | | |
| | | @Scheduled(cron = "0/3 * * * * ? ") //移库任务下发 |
| | | private void ShuttleMoveTaskSend(){ |
| | | List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no",7).eq("wrk_sts", 11).eq("io_type",11)); |
| | | if (wrkMasts.isEmpty()) { |
| | | return; |
| | | } |
| | | try { |
| | | for (WrkMast wrkMast : wrkMasts) { |
| | | LocMast destLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo())); |
| | | LocMast originLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | if (originLoc == null || destLoc == null) { |
| | | throw new CoolException("下发四向车wcs任务失败"); |
| | | } |
| | | String originLoc1 = (originLoc.getRow1()-16)+"-"+originLoc.getBay1()+"-"+originLoc.getLev1(); |
| | | String destLoc1 = (destLoc.getRow1()-16)+"-"+destLoc.getBay1()+"-"+destLoc.getLev1(); |
| | | ShuttleMoveTask param = new ShuttleMoveTask(); |
| | | param.setTaskNo(wrkMast.getWrkNo().toString()); |
| | | param.setOriginLoc(originLoc1); |
| | | param.setDestLoc(destLoc1); |
| | | param.setRecord(true); |
| | | param.setPriority("21"); |
| | | String response = new HttpHandler.Builder() |
| | | .setUri(shuttleWcsUrl) |
| | | .setPath("/openapi/createLadenMoveTakeTask") |
| | | .setJson(JSON.toJSONString(param)) |
| | | .build() |
| | | .doPost(); |
| | | JSONObject jsonObject = JSON.parseObject(response); |
| | | Integer code = jsonObject.getInteger("code"); |
| | | if (code.equals(200)) { |
| | | wrkMast.setWrkSts(105L); |
| | | if (!wrkMastService.updateById(wrkMast)) { |
| | | log.error("工作档[workNo={}]标记待处理失败", wrkMast.getWrkNo()); |
| | | } |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | | throw new CoolException("下发四向车wcs任务失败"); |
| | | } |
| | | |
| | | } |
| | | // @Scheduled(cron = "0/3 * * * * ? ") //出库库任务下发 |
| | | // private void ShuttleOutTaskSend(){ |
| | | // List<WrkMast> wrkMastsMove = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no",7).eq("wrk_sts", 11).eq("io_type",11)); |
| | | // if (!wrkMastsMove.isEmpty()) { |
| | | // return; |
| | | // } |
| | | // List<WrkMast> wrkMasts1 = wrkMastService.selectList(new EntityWrapper<WrkMast>() |
| | | // .in("io_type", 1,10,53,54,57).eq("crn_no",7)); |
| | | // if (!Cools.isEmpty(wrkMasts1)){ |
| | | // return; |
| | | // } |
| | | // List<WrkMast> wrkMasts = wrkMastService.selectToShuttleOutTask(); |
| | | // if (wrkMasts.isEmpty()) { |
| | | // return; |
| | | // } |
| | | // try { |
| | | // for (WrkMast wrkMast : wrkMasts) { |
| | | // LocMast locMast = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | // if (locMast == null) { |
| | | // throw new CoolException("下发四向车wcs任务失败"); |
| | | // } |
| | | // String loc = (locMast.getRow1()-16)+"-"+locMast.getBay1()+"-"+locMast.getLev1(); |
| | | // ShuttleOutTask param = new ShuttleOutTask(); |
| | | // param.setTaskNo(wrkMast.getWrkNo().toString()); |
| | | // param.setOriginLoc(loc); |
| | | // param.setOriginSite("31004"); |
| | | // param.setDestSite("31002"); |
| | | // param.setPriority("11"); |
| | | // String response = new HttpHandler.Builder() |
| | | // .setUri(shuttleWcsUrl) |
| | | // .setPath("/openapi/createOutTask") |
| | | // .setJson(JSON.toJSONString(param)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // Integer code = jsonObject.getInteger("code"); |
| | | // if (code.equals(200)) { |
| | | // wrkMast.setWrkSts(105L); |
| | | // if (!wrkMastService.updateById(wrkMast)) { |
| | | // log.error("工作档[workNo={}]标记待处理失败", wrkMast.getWrkNo()); |
| | | // } |
| | | // } |
| | | // } |
| | | // }catch (Exception e){ |
| | | // throw new CoolException("下发四向车wcs任务失败"); |
| | | // } |
| | | // |
| | | // } |
| | | // |
| | | // @Scheduled(cron = "0/3 * * * * ? ") //移库任务下发 |
| | | // private void ShuttleMoveTaskSend(){ |
| | | // List<WrkMast> wrkMasts = wrkMastService.selectList(new EntityWrapper<WrkMast>().eq("crn_no",7).eq("wrk_sts", 11).eq("io_type",11)); |
| | | // if (wrkMasts.isEmpty()) { |
| | | // return; |
| | | // } |
| | | // try { |
| | | // for (WrkMast wrkMast : wrkMasts) { |
| | | // LocMast destLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getLocNo())); |
| | | // LocMast originLoc = locMastService.selectOne(new EntityWrapper<LocMast>().eq("loc_no", wrkMast.getSourceLocNo())); |
| | | // if (originLoc == null || destLoc == null) { |
| | | // throw new CoolException("下发四向车wcs任务失败"); |
| | | // } |
| | | // String originLoc1 = (originLoc.getRow1()-16)+"-"+originLoc.getBay1()+"-"+originLoc.getLev1(); |
| | | // String destLoc1 = (destLoc.getRow1()-16)+"-"+destLoc.getBay1()+"-"+destLoc.getLev1(); |
| | | // ShuttleMoveTask param = new ShuttleMoveTask(); |
| | | // param.setTaskNo(wrkMast.getWrkNo().toString()); |
| | | // param.setOriginLoc(originLoc1); |
| | | // param.setDestLoc(destLoc1); |
| | | // param.setRecord(true); |
| | | // param.setPriority("21"); |
| | | // String response = new HttpHandler.Builder() |
| | | // .setUri(shuttleWcsUrl) |
| | | // .setPath("/openapi/createLadenMoveTakeTask") |
| | | // .setJson(JSON.toJSONString(param)) |
| | | // .build() |
| | | // .doPost(); |
| | | // JSONObject jsonObject = JSON.parseObject(response); |
| | | // Integer code = jsonObject.getInteger("code"); |
| | | // if (code.equals(200)) { |
| | | // wrkMast.setWrkSts(105L); |
| | | // if (!wrkMastService.updateById(wrkMast)) { |
| | | // log.error("工作档[workNo={}]标记待处理失败", wrkMast.getWrkNo()); |
| | | // } |
| | | // } |
| | | // } |
| | | // }catch (Exception e){ |
| | | // throw new CoolException("下发四向车wcs任务失败"); |
| | | // } |
| | | // |
| | | // } |
| | | |
| | | |
| | | |