| | |
| | | @Autowired |
| | | private InoutDayCountMapper inoutDayCountMapper; |
| | | @Autowired |
| | | private InoutRecordMapper inoutRecordMapper; |
| | | @Autowired |
| | | private CarEventMapper carEventMapper; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void visitLevelForCarOut(Visits visits){ |
| | | visits.setRemark("跟随访客车辆离园自动签离"); |
| | | visitLevelBiz(visits); |
| | | } |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void visitLevel(Integer visitId){ |
| | | Visits visits = visitsMapper.selectById(visitId); |
| | | visits.setRemark("平台管理员手动签离成功"); |
| | | visitLevelBiz(visits); |
| | | //产出在场人员信息 |
| | | retentionMapper.delete(new UpdateWrapper<Retention>().lambda() |
| | | .eq(Retention::getType,Constants.memberType.visitor) |
| | | .eq(Retention::getMemberId,visits.getMemberId())); |
| | | } |
| | | |
| | | private void visitLevelBiz(Visits visits) { |
| | | if(Objects.isNull(visits)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | |
| | | request.setOrderId(visits.getHkId()); |
| | | //调用海康强制签离 |
| | | BaseResponse response = HKService.iccmSignoff(request); |
| | | // BaseResponse response = HKService.outVisitAppiontment(request); |
| | | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda().set(Visits::getStatus,Constants.VisitStatus.signout) |
| | | .eq(Visits::getId,visitId)); |
| | | //产出在场人员信息 |
| | | retentionMapper.delete(new UpdateWrapper<Retention>().lambda() |
| | | .eq(Retention::getType,Constants.memberType.visitor) |
| | | .eq(Retention::getMemberId,visits.getMemberId())); |
| | | if(response!=null &&StringUtils.isNotBlank(response.getCode()) && StringUtils.equals(response.getCode(),HKConstants.RESPONSE_SUCCEE)){ |
| | | visitsMapper.update(null,new UpdateWrapper<Visits>().lambda() |
| | | .set(Visits::getStatus,Constants.VisitStatus.signout) |
| | | .set(Visits::getRemark,visits.getRemark()) |
| | | .eq(Visits::getId,visits.getId())); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"访客签离失败,请刷新重试"); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void visitCancel(Integer visitId){ |
| | | Visits visits = visitsMapper.selectById(visitId); |
| | |
| | | .apply(" DATE(TIME_INFO) = CURDATE() ") |
| | | .last(" limit 1 ") |
| | | ); |
| | | |
| | | |
| | | //今日在园人数 |
| | | pcWorkPlatformDataVO.setTodayInParkUserNum( |
| | | retentionList.stream().filter(i->!Constants.equalsInteger(i.getType(),Constants.THREE)).count() |
| | | inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() |
| | | .isNotNull(InoutRecord::getMemberPhone) |
| | | .isNull(InoutRecord::getCarCode) |
| | | .apply( " DATE(TIME_INFO) = CURDATE() " )) |
| | | //retentionList.stream().filter(i->!Constants.equalsInteger(i.getType(),Constants.THREE)).count() |
| | | ); |
| | | |
| | | pcWorkPlatformDataVO.setTodayInUserNum(Constants.ZERO); |
| | |
| | | |
| | | //在园长期相关方人数 |
| | | pcWorkPlatformDataVO.setInParkLwUserNum( |
| | | retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) |
| | | && Constants.equalsInteger(i.getCompanyType(),Constants.ZERO)).count() |
| | | inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() |
| | | .eq(InoutRecord::getMemberType,Constants.TWO) |
| | | .isNotNull(InoutRecord::getMemberPhone) |
| | | .isNull(InoutRecord::getCarCode) |
| | | .apply( " DATE(TIME_INFO) = CURDATE() " )) |
| | | // retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.TWO) |
| | | // && Constants.equalsInteger(i.getCompanyType(),Constants.ZERO)).count() |
| | | ); |
| | | pcWorkPlatformDataVO.setLwUserInNum(Constants.ZERO); |
| | | pcWorkPlatformDataVO.setLwUserOutNum(Constants.ZERO); |
| | |
| | | |
| | | //在园访客数量 |
| | | pcWorkPlatformDataVO.setInParkVisitUserNum( |
| | | retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Objects.isNull(i.getCompanyType())).count() |
| | | inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() |
| | | .eq(InoutRecord::getMemberType,Constants.ZERO) |
| | | .isNotNull(InoutRecord::getMemberPhone) |
| | | .isNull(InoutRecord::getCarCode) |
| | | .apply( " DATE(TIME_INFO) = CURDATE() " )) |
| | | //retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.ONE)&&Objects.isNull(i.getCompanyType())).count() |
| | | ); |
| | | pcWorkPlatformDataVO.setVisitUserNum(Constants.ZERO); |
| | | pcWorkPlatformDataVO.setSignLevelNum(Constants.ZERO); |
| | | |
| | | //在园货运车辆司机 |
| | | pcWorkPlatformDataVO.setInParkDriverUserNum(inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() |
| | | .eq(InoutRecord::getMemberType,Constants.THREE) |
| | | .isNotNull(InoutRecord::getMemberPhone) |
| | | .isNull(InoutRecord::getCarCode) |
| | | .apply( " DATE(TIME_INFO) = CURDATE() " ))); |
| | | |
| | | //在园车辆 |
| | | pcWorkPlatformDataVO.setTodayInParkCarNum( |
| | | retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count() |
| | | inoutRecordMapper.selectCount(new QueryWrapper<InoutRecord>().lambda() |
| | | .isNotNull(InoutRecord::getCarCode) |
| | | .isNull(InoutRecord::getMemberPhone) |
| | | .apply( " DATE(TIME_INFO) = CURDATE() " )) |
| | | //retentionList.stream().filter(i->Constants.equalsInteger(i.getType(),Constants.THREE)).count() |
| | | ); |
| | | pcWorkPlatformDataVO.setTodayInCarNum(Constants.ZERO); |
| | | pcWorkPlatformDataVO.setTodayOutCarNum(Constants.ZERO); |