| | |
| | | * 根据访客推送访客记录编码,处理访客记录、在场人员等信息 |
| | | */ |
| | | private void dealVisitDataByRequstIccm(EventVisitIccmInfoRequest request, List<Integer> delRetentionLis, List<Retention> retentionList, InoutDayCount inoutDayCount) { |
| | | |
| | | EventVisitIccmDataRequest model = request.getData(); |
| | | EventVisitIccmInvoiceParamRequest data = request.getData().getVisitorInvoices(); |
| | | MPJLambdaWrapper<Visits> queryWrapper = new MPJLambdaWrapper<>(); |
| | |
| | | updateVistis.setId(visits.getId()); |
| | | if (Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.VISIT_SIGN_ICCM_IN.getKey()) { |
| | | //如果是访客登记,录入人员的在场数据记录 |
| | | // retentionList.add(getRetentionModelByVisitRequest(visits, request.getHappenTime(),request.getSrcType())); |
| | | //retentionList.add(getRetentionModelByVisitRequest(visits, request.getHappenTime(),request.getSrcType())); |
| | | //来访时间 |
| | | if(Constants.equalsInteger(visits.getStatus(),Constants.VisitStatus.xfSuccess)){ |
| | | inoutDayCount.setSigninVisitorNum(Constants.formatIntegerNum(inoutDayCount.getSigninVisitorNum())+1); |
| | |
| | | updateVistis.setOutType(Constants.ZERO); |
| | | updateVistis.setOutInfo("访客正常签离"); |
| | | } |
| | | delRetentionLis.add(visits.getMemberId()); |
| | | }else{ |
| | | //如果人员信息存在,切是访客通行,则删除之前的所有进场数据(无论此次推送是进厂还是出场推送事件) |
| | | delRetentionLis.add(visits.getMemberId()); |
| | |
| | | event.setCreateDate(DateUtil.getISO8601DateByStr2(request.getHappenTime())); |
| | | if(event.getCreateDate() == null){ |
| | | event.setCreateDate(new Date()); |
| | | } |
| | | if (Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.VISIT_SIGN_ICCM_PASS.getKey()) { |
| | | //如果是访客通行事件,进入进出事件 |
| | | if(request.getData()!=null&&request.getData().getParamValues()!=null && |
| | | StringUtils.equals(request.getData().getParamValues().getInOrOut(),"0")){ |
| | | event.setInOrOut("0");//进 |
| | | }else{ |
| | | event.setInOrOut("1");//出 |
| | | } |
| | | } |
| | | event.setVisitorWorkUint(detail.getUnit()); |
| | | event.setVisitorId(detail.getVisitorId()); |
| | |
| | | event.setEventCmd(request.getData().getEventCmd()); |
| | | event.setCardNo(request.getData().getCardNo()); |
| | | event.setCarAttributeName(request.getData().getCarAttributeName()); |
| | | |
| | | event.setCarType(Constants.RetentionCarType.unknown);//默认未登记车辆 |
| | | if(request.getData().getInResult()!=null && request.getData().getInResult().getRlsResult() !=null ){ |
| | | //放行方式 |
| | | event.setReleaseWay(request.getData().getInResult().getRlsResult().getReleaseWay()); |
| | |
| | | .selectAs(Platform::getName,PlatformJob::getPlatformName) |
| | | .selectAs(Platform::getLedContent,PlatformJob::getLedContent) |
| | | .leftJoin(Platform.class,Platform::getId,PlatformJob::getPlatformId) |
| | | // .eq(StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeFront,status.getPlateNo() )//前车牌号 |
| | | // .eq(!StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeBack,status.getPlateNo() )//后车牌号 |
| | | // .eq(StringUtils.equals(status.getStockStatus(),"front"),PlatformJob::getCarCodeFront,status.getPlateNo() )//前车牌号 |
| | | .eq(PlatformJob::getIsdeleted,Constants.ZERO ) |
| | | .eq(PlatformJob::getPlatformId,model.getPlatformId() ) |
| | | .orderByDesc(PlatformJob::getCallDate) |
| | | .last("limit 1 ")); |
| | | if(job == null){ |
| | | if(StringUtils.equals(status.getMotionStatus(),"enter")){ |
| | | //如果月台当前没作业,直接提示车辆停错 |
| | | Platform platform = platformMapper.selectJoinOne(Platform.class, new MPJLambdaWrapper<Platform>() |
| | | .selectAll(Platform.class) |
| | | .eq(Platform::getIsdeleted,Constants.ZERO ) |
| | | .eq(PlatformJob::getId,model.getPlatformId() ) |
| | | .last("limit 1 ")); |
| | | if(platform!=null){ |
| | | dealCarsAndPlatformErrorBiz(platform,status); |
| | | } |
| | | } |
| | | continue;//如果作业为空,跳过处理 |
| | | } |
| | | PlatformJob update = new PlatformJob(); |
| | |
| | | platformBroadcastLogMapper.insert(logList); |
| | | } |
| | | } |
| | | private void dealCarsAndPlatformErrorBiz( Platform model, EventPlatformCarsStatusInfoRequest status) { |
| | | //处理车辆进入错误月台业务逻辑 |
| | | SavePlatformWarnEventDTO savePlatformWarnEventDTO = new SavePlatformWarnEventDTO(); |
| | | savePlatformWarnEventDTO.setPlatformJobId(model.getId()); |
| | | savePlatformWarnEventDTO.setPlatformId(model.getId()); |
| | | savePlatformWarnEventDTO.setCarCode(status.getPlateNo()); |
| | | savePlatformWarnEventDTO.setEventType(Constants.PlatformWarnEvent.STOP_ERROR.getKey()); |
| | | platformWarnEventService.savePlatformWarnEvent(savePlatformWarnEventDTO); |
| | | |
| | | int speed = 13; |
| | | try { |
| | | speed = Integer.parseInt(systemDictDataBiz.queryByCode(Constants.HK_PARAM,Constants.LED_CONTENT_SPEED).getCode()); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | List<PlatformDevice> deviceList = platformDeviceMapper.selectList(new QueryWrapper<PlatformDevice>().lambda() |
| | | .eq(PlatformDevice::getPlatformId,model.getId()) |
| | | .eq(PlatformDevice::getIsdeleted,Constants.ZERO)); |
| | | if(deviceList ==null || deviceList.size() == 0){ |
| | | return; |
| | | } |
| | | String content =Constants.PlatformLedContent.WRONG_IN.getInfo(); |
| | | content = content.replace("${param2}",model.getName()); |
| | | content = content.replace("${param}",status.getPlateNo()); |
| | | List<String> broadcastList = new ArrayList<>(); |
| | | List<String> ledList = new ArrayList<>(); |
| | | String bNames = ""; |
| | | List<PlatformBroadcastLog> logList = new ArrayList<>(); |
| | | for(PlatformDevice device : deviceList){ |
| | | if(StringUtils.isBlank(device.getHkId())){ |
| | | continue; |
| | | } |
| | | if(Constants.equalsInteger(device.getType(),Constants.TWO)){ |
| | | //如果是广播点 |
| | | bNames += device.getName()+";"; |
| | | broadcastList.add(device.getHkId()); |
| | | } |
| | | } |
| | | if(broadcastList.size()>0){ |
| | | PlatformJob job = new PlatformJob(); |
| | | job.setId(-1); |
| | | job.setCarCodeFront(status.getPlateNo()); |
| | | job.setPlatformId(model.getId()); |
| | | PlatformBroadcastLog log = dealBroadcastBiz(job,broadcastList,bNames,Constants.PlatformBroadcastContent.WRONG_IN.getInfo().replace("${param}",status.getPlateNo())); |
| | | logList.add(log); |
| | | } |
| | | if(logList.size()>0){ |
| | | platformBroadcastLogMapper.insert(logList); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 广播通知 |