zouyu
6 天以前 dc7300e21fe53f74e08eb2fa494a83430e2e54ca
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
package com.ruoyi.common.utils.api.icc;
 
import com.dahuatech.hutool.http.Method;
import com.dahuatech.icc.exception.ClientException;
import com.dahuatech.icc.oauth.model.v202010.OauthConfigUserPwdInfo;
import com.dahuatech.icc.oauth.utils.HttpUtils;
import com.ruoyi.common.utils.api.icc.config.OauthConfigUtil;
import com.ruoyi.common.utils.api.icc.model.GetResultPageRequest;
import com.ruoyi.common.utils.api.icc.model.GetResultPageResponse;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
 
/**
 * 对接ICC开放平台工具
 */
@Slf4j
@Component
public class IccApiUtil {
 
    /**
     * 分页获取门禁进出结果
     * @param getResultPageRequest
     * @return
     * @throws ClientException
     */
    public GetResultPageResponse getAttendanceResultPage(GetResultPageRequest getResultPageRequest) {
        OauthConfigUserPwdInfo config = OauthConfigUtil.getOauthConfig();
        GetResultPageResponse response=null;
        try {
            response = HttpUtils.executeJson("/evo-apigw/evo-accesscontrol/1.0.0/card/accessControl/swingCardRecord/bycondition/combined", getResultPageRequest,null, Method.POST , config, GetResultPageResponse.class);
        } catch (ClientException e) {
            log.error(e.getErrMsg(), e);
        }
        if(!response.isSuccess()) {
            log.info("分页获取门禁进出失败:{}",response.getErrMsg());
        }
        return response;
    }
 
}