| | |
| | | if (task.getTaskSts() == TaskStsType.WCS_EXECUTE_OUT_ARRIVED.id
|
| | | || task.getTaskSts() == TaskStsType.WCS_EXECUTE_OUT_TASK_DONE.id ) {
|
| | | // 到达拣选位,控制播种墙亮灯
|
| | | List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
|
| | | .eq(CacheSite::getSiteNo, arrivedParam.getSlotCode())
|
| | | .eq(CacheSite::getBarcode, task.getBarcode()));
|
| | | if(cacheSites.size() == 0) {
|
| | | CacheSite cacheSite = cacheSiteService.getOne(new LambdaQueryWrapper<CacheSite>()
|
| | | .eq(CacheSite::getChannel, task.getTargetSite())
|
| | | .isNull(CacheSite::getOrderId).orderByAsc(CacheSite::getId));
|
| | | // List<CacheSite> cacheSites = cacheSiteService.list(new LambdaQueryWrapper<CacheSite>()
|
| | | // .eq(CacheSite::getBarcode, task.getBarcode()));
|
| | | if(Objects.isNull(cacheSite)) {
|
| | | log.error("条码:{},未找到播种墙亮灯",task.getBarcode());
|
| | | throw new CoolException("未找到播种墙");
|
| | | }
|
| | | for (CacheSite cacheSite:cacheSites) {
|
| | | // 获取任务明细数量
|
| | | List<TaskDetl> taskDetlByTaskId = taskDetlService.getTaskDetlByTaskId(task.getId());
|
| | | int sum = (int)taskDetlByTaskId.stream().mapToDouble(TaskDetl::getAnfme).sum();
|
| | | SlapLightControlParam slapLightControlParam = new SlapLightControlParam();
|
| | | slapLightControlParam
|
| | | .setControllerCode(cacheSite.getMemo())
|
| | | .setTagCode(cacheSite.getSiteNo())
|
| | | .setColor("GREEN")
|
| | | .setIndex(cacheSite.getIndex())
|
| | | .setMode("LIGHT")
|
| | | .setDisplay(sum + "");
|
| | | // 发起亮灯请求
|
| | | log.info("任务{}到达拣选位,播种墙亮灯下发",task.getTaskNo(), JSONObject.toJSONString(slapLightControlParam));
|
| | | CommonReponse response = HttpEssUtils.post("到达拣选位,播种墙亮灯", HttpEssUtils.PLT_SEND_COMMAND, slapLightControlParam);
|
| | | if (response.getCode().equals(0)) {
|
| | | log.info("任务{}到达拣选位,播种墙{}亮灯成功",task.getTaskNo(),cacheSite.getSiteNo());
|
| | | } else {
|
| | | log.info("任务{}到达拣选位,播种墙{}亮灯失败",task.getTaskNo(),cacheSite.getSiteNo());
|
| | | }
|
| | | }
|
| | |
|
| | | // 获取任务明细数量
|
| | | List<TaskDetl> taskDetlByTaskId = taskDetlService.getTaskDetlByTaskId(task.getId());
|
| | | int sum = (int)taskDetlByTaskId.stream().mapToDouble(TaskDetl::getAnfme).sum();
|
| | | SlapLightControlParam slapLightControlParam = new SlapLightControlParam();
|
| | | slapLightControlParam
|
| | | .setControllerCode(cacheSite.getMemo())
|
| | | .setTagCode(cacheSite.getSiteNo())
|
| | | .setColor("GREEN")
|
| | | .setIndex(cacheSite.getIndex())
|
| | | .setMode("LIGHT")
|
| | | .setDisplay(sum + "");
|
| | | // 发起亮灯请求
|
| | | log.info("任务{}到达拣选位,播种墙亮灯下发",task.getTaskNo(), JSONObject.toJSONString(slapLightControlParam));
|
| | | CommonReponse response = HttpEssUtils.post("到达拣选位,播种墙亮灯", HttpEssUtils.PLT_SEND_COMMAND, slapLightControlParam);
|
| | | if (response.getCode().equals(0)) {
|
| | | log.info("任务{}到达拣选位,播种墙{}亮灯成功",task.getTaskNo(),cacheSite.getSiteNo());
|
| | | } else {
|
| | | log.info("任务{}到达拣选位,播种墙{}亮灯失败",task.getTaskNo(),cacheSite.getSiteNo());
|
| | | }
|
| | |
|
| | | boolean update = taskService.update(new LambdaUpdateWrapper<Task>()
|
| | | .set(Task::getTaskSts, TaskStsType.WAVE_SEED.id)
|
| | | .set(Task::getOriginSite, arrivedParam.getSlotCode())
|
| | |
| | | if (!update) {
|
| | | throw new CoolException("容器到达任务更新失败!!");
|
| | | }
|
| | |
|
| | | } else if(task.getTaskSts().equals(TaskStsType.UPDATED_OUT.id)) {
|
| | | ConveyorStarParam conveyorStarParam = new ConveyorStarParam();
|
| | | conveyorStarParam.setSlotCode(task.getOriginSite())
|