jiangping
2024-10-18 a77b4b41cc6d7521756017985aac2d3b38935254
server/visits/dmvisit_service/src/main/java/com/doumee/service/business/impl/hksync/HkSyncPushServiceImpl.java
@@ -87,8 +87,6 @@
    private PlatformLogMapper platformLogMapper;
    @Autowired
    private PlatformWarnEventServiceImpl platformWarnEventService;
    @Autowired
    private PlatformJobService platformJobService;
    /**
     * 海康门禁事件推送
     * @param param
@@ -825,14 +823,12 @@
                    .last("limit 1" ));
            if(cars!=null){
                event.setMemberId(cars.getMemberId());
                    if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_IN.getKey()){
                //自有车  查询当前是否有待签到的任务
                        if(carsMapper.selectCount(new QueryWrapper<Cars>()
                                .lambda().eq(Cars::getCode,event.getPlateNos())
                                .eq(Cars::getType,Constants.ONE)
                                .eq(Cars::getIsdeleted,Constants.ZERO)
                        )>Constants.ZERO){
                            //自有车进场  查询当前是否有待签到的任务
                            //查询车辆当前是否存在进行中的任务
                            if(platformJobMapper.selectCount(new QueryWrapper<PlatformJob>().lambda()
                                    .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
@@ -872,28 +868,10 @@
                                    platformJobMapper.updateById(platformJob);
                                }
                            }
                        }
                    }else if(Constants.formatIntegerNum(request.getEventType()) == HKConstants.EventTypes.PARK_PASS_OUT.getKey()){
                        //离场判断是否存在未离场的订单数据 处理订单数据
                        List<PlatformJob> platformJobList = platformJobMapper.selectList(new QueryWrapper<PlatformJob>().lambda()
                                .eq(PlatformJob::getCarCodeFront,event.getPlateNos())
                                .eq(PlatformJob::getIsdeleted,Constants.ZERO)
                                .in(PlatformJob::getStatus,
                                        Constants.PlatformJobStatus.DONE.getKey(),
                                        Constants.PlatformJobStatus.AUTHED_LEAVE.getKey()
                                ));
                        if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(platformJobList)){
                            for (PlatformJob platformJob:platformJobList) {
                                platformJob.setStatus(Constants.PlatformJobStatus.LEAVED.getKey());
                                platformJob.setOutDate(new Date());
                                platformJob.setEditDate(new Date());
                                platformJob.setOutType(Constants.ZERO);
                                platformJobMapper.updateById(platformJob);
                                //清空授权
                                platformJobService.cancelInPark(platformJob);
                            }
                        }
                    }
                };
            }else{
                Visits visits =  visitsMapper.selectOne(new QueryWrapper<Visits>().lambda()
                        .eq(Visits::getCarNos,event.getPlateNos())