whyclxw
2024-03-11 9c7775cba452509063d95e7593519f572fa2d4fa
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.whyc.service;
 
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whyc.dto.Login;
import com.whyc.mapper.CarCameraHisMapper;
import com.whyc.peopleCamera.Acs.AcsMain;
import com.whyc.pojo.CarCameraHis;
import com.whyc.pojo.PeopleCarmera;
import com.whyc.pojo.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.io.UnsupportedEncodingException;
import java.util.List;
 
@Service
public class CarCameraHisService {
    @Autowired(required = false)
    private CarCameraHisMapper hisMapper;
 
    @Autowired(required = false)
    private AcsMain acsMain_p;
 
    @Autowired(required = false)
    private com.whyc.carCamera.Acs.AcsMain acsMain;
 
    //获取门禁历史数据
    public Response getCarCameraHis(int carCameraId,int pageCurr,int pageSize) {
        PageHelper.startPage(pageCurr,pageSize);
        List<CarCameraHis> list=hisMapper.getCarCameraHis(carCameraId);
        PageInfo pageInfo=new PageInfo(list);
        return new Response().setII(1,list.size()>0,pageInfo,"获取门禁历史数据");
    }
 
    //从以人为中心获取事件
    public Response getCarCameraHis_people(Login login) throws UnsupportedEncodingException, InterruptedException {
        List<PeopleCarmera> list=acsMain_p.getCarCameraHis_people(login);
        if(list!=null){
            for (PeopleCarmera pc:list) {
                String carId=pc.getCarId();
                pc.setFacepath(acsMain.getFaceCInfo(login,carId));
            }
            return new Response().setII(1,true,list,"获取门禁历史数据");
        }else{
            return new Response().set(1,false,"获取失败");
        }
    }
}