| | |
| | | import com.zy.acs.manager.core.constant.MapDataConstant; |
| | | import com.zy.acs.manager.core.domain.BackpackDto; |
| | | import com.zy.acs.manager.core.domain.VehicleFaultDto; |
| | | import com.zy.acs.manager.manager.entity.Agv; |
| | | import com.zy.acs.manager.manager.entity.AgvDetail; |
| | | import com.zy.acs.manager.manager.entity.Code; |
| | | import com.zy.acs.manager.manager.service.*; |
| | |
| | | IMessageBody msgBody = protocol.getMessageBody(); |
| | | assert msgBody != null; |
| | | |
| | | Agv agv = agvService.selectByUuid(protocol.getAgvNo()); |
| | | if (null == agv) { |
| | | Long agvId = agvService.getAgvId(protocol.getAgvNo()); |
| | | if (null == agvId) { |
| | | log.warn("Agv [{}] 尚未鉴权 !!!", protocol.getAgvNo()); |
| | | return; |
| | | } |
| | | AgvDetail detail = agvDetailService.selectByAgvId(agv.getId()); |
| | | AgvDetail detail = agvDetailService.selectByAgvId(agvId); |
| | | if (null == detail) { |
| | | detail = new AgvDetail(); |
| | | detail.setAgvId(agv.getId()); |
| | | detail.setAgvId(agvId); |
| | | if (!agvDetailService.save(detail)) { |
| | | log.error("Agv [{}] 详情更新失败 !!!", protocol.getAgvNo()); |
| | | return; |
| | |
| | | AGV_12_UP agv_12_up = (AGV_12_UP) msgBody; |
| | | |
| | | // unlock path |
| | | threadPoolRegulator.getInstance().execute(() -> { |
| | | mapService.unlockPath(protocol.getAgvNo(), agv_12_up.getQrCode()); |
| | | }); |
| | | mapService.unlockPath(protocol.getAgvNo(), agv_12_up.getQrCode()); |
| | | // threadPoolRegulator.getInstance().execute(() -> { |
| | | // |
| | | // }); |
| | | // finish jam |
| | | threadPoolRegulator.getInstance().execute(() -> jamService.checkIfFinish(agv.getId(), agv_12_up.getQrCode())); |
| | | threadPoolRegulator.getInstance().execute(() -> jamService.checkIfFinish(agvId, agv_12_up.getQrCode())); |
| | | |
| | | // websocketService.agvInfoBroadcastOnPos(new WebsocketDto<AGV_12_UP>("agv", agv.getUuid(), agv_12_up)); |
| | | this.sync(agv_12_up, detail); |
| | |
| | | private void sync(AGV_12_UP mesBody, AgvDetail detail) { |
| | | detail.setStatus(mesBody.getStatus()); |
| | | |
| | | Code code = codeService.selectByData(mesBody.getQrCode()); |
| | | Code code = codeService.getCacheByData(mesBody.getQrCode()); |
| | | if (null != code) { |
| | | detail.setCode(code.getId()); |
| | | detail.setLastCode(null); |
| | |
| | | private void sync(AGV_13_UP mesBody, AgvDetail detail) { |
| | | detail.setStatus(mesBody.getStatus()); |
| | | |
| | | Code code = codeService.selectByData(mesBody.getQrCode()); |
| | | Code code = codeService.getCacheByData(mesBody.getQrCode()); |
| | | if (null != code) { |
| | | |
| | | if (!detail.getAgvStatus().equals(AgvStatusType.CHARGE)) { |