| | |
| | | package com.doumee.service.impl; |
| | | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.haikang.model.HKConstants; |
| | | import com.doumee.core.haikang.model.param.BaseListPageResponse; |
| | | import com.doumee.core.haikang.model.param.BaseResponse; |
| | | import com.doumee.core.haikang.model.param.request.AcsDeviceStatusListRequest; |
| | | import com.doumee.core.haikang.model.param.request.TempCarInRecordListRequest; |
| | | import com.doumee.core.haikang.model.param.respose.AscDeviceStatusInfoResponse; |
| | | import com.doumee.core.haikang.model.param.respose.TempCarInRecordInfoResponse; |
| | | import com.doumee.core.haikang.service.HKService; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.VisitEventMapper; |
| | |
| | | CountDataResponse cModel =carEventMapper.selectJoinOne(CountDataResponse.class,wrapper); |
| | | vModel.setMemberCarNum(vModel.getMemberCarNum());//今日员工车辆进场数 |
| | | vModel.setVisitCarNum(vModel.getCarInNum() - vModel.getMemberCarNum());//今日预约车辆进场数 |
| | | vModel.setCarNum(getCarInRecordCount()); |
| | | return vModel; |
| | | } |
| | | public int getCarInRecordCount(){ |
| | | try { |
| | | List<TempCarInRecordInfoResponse> allDoorList = new ArrayList<>(); |
| | | Date date =DateUtil.getDateFromString(DateUtil.getShortTime(new Date()) +" 00:00:00"); |
| | | |
| | | int curPage = 1; |
| | | //分页遍历循环查询所有门禁设备数据 |
| | | TempCarInRecordListRequest param = new TempCarInRecordListRequest(); |
| | | param.setStartTime(DateUtil.getISO8601Timestamp2(date)); |
| | | param.setPageNo(curPage); |
| | | param.setPageSize(1); |
| | | BaseResponse<BaseListPageResponse<TempCarInRecordInfoResponse>> response = HKService.tempCarInRecords(param); |
| | | if(response == null || !StringUtils.equals(response.getCode(), HKConstants.RESPONSE_SUCCEE)){ |
| | | throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "对不起,海康同步数据失败~"); |
| | | } |
| | | BaseListPageResponse r = response.getData(); |
| | | return r.getTotal(); |
| | | }catch (Exception e){ |
| | | |
| | | } |
| | | |
| | | return 0; |
| | | } |
| | | @Override |
| | | public List<CarsDataListResponse> carsDataList(BaseRequest param){ |
| | | List<CarsDataListResponse> list = new ArrayList<>(); |