feat:[REQ-3282] 暂时提交, 新增Elise相关二方SDK调用
This commit is contained in:
parent
87a84fcd14
commit
af27f5c52f
@ -0,0 +1,13 @@
|
||||
package cn.axzo.orgmanax.infra.client.elise;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
public interface EliseDeviceClient {
|
||||
|
||||
/**
|
||||
* 通过项目ID获取备案设备数量
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
Integer getSnCountByProjectId(Long projectId);
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
package cn.axzo.orgmanax.infra.client.elise;
|
||||
|
||||
import cn.axzo.orgmanax.infra.client.elise.dto.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface EliseStatesClient {
|
||||
|
||||
/**
|
||||
* 查询用户备案信息
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
List<EliseListUserStateResp> listUserState(EliseListUserStateReq req);
|
||||
|
||||
/**
|
||||
* 查询 项目是否绑定成都住建&用户备案信息
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
EliseGetPersonFilingsResp getPersonFilings(EliseListUserStateReq req);
|
||||
|
||||
/**
|
||||
* 查询用户是否需要推送监管(下一版废弃,工人进入项目就推送不依赖动态花名册,所以也无需业务侧查询用户是否需要推送,如果补偿推送由elise统一管理)
|
||||
* @return
|
||||
*/
|
||||
EliseGetWhetherPushResp getWhetherPush(EliseGetWhetherPushReq req);
|
||||
|
||||
}
|
||||
@ -0,0 +1,60 @@
|
||||
package cn.axzo.orgmanax.infra.client.elise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EliseGetPersonFilingsResp {
|
||||
|
||||
|
||||
/**
|
||||
* 是否绑定成都住建
|
||||
*/
|
||||
private boolean bindCdzj;
|
||||
|
||||
/**
|
||||
* 备案信息
|
||||
*/
|
||||
private List<PersonRegisterInfoResp> filingsInfos;
|
||||
|
||||
@Data
|
||||
public static class PersonRegisterInfoResp {
|
||||
|
||||
/**
|
||||
* axzoId
|
||||
*/
|
||||
private Long axzoId;
|
||||
/**
|
||||
* 下发时间
|
||||
*/
|
||||
private Long issueAt;
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String sourceReason;
|
||||
/**
|
||||
* 0-未备案 1-已备案
|
||||
*/
|
||||
private Integer state;
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private Long uploadAt;
|
||||
|
||||
|
||||
/**
|
||||
* 最新一次人员备案成功时间
|
||||
*/
|
||||
private Long uploadSuccessKeepOnRecordTime;
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,35 @@
|
||||
package cn.axzo.orgmanax.infra.client.elise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class EliseGetWhetherPushReq {
|
||||
|
||||
/**
|
||||
* 项目部ID
|
||||
*/
|
||||
@NotNull(message = "workspaceId is null")
|
||||
Long workspaceId;
|
||||
|
||||
/**
|
||||
* personId/acctId
|
||||
*/
|
||||
@NotNull(message = "personId is null")
|
||||
Long personId;
|
||||
|
||||
/**
|
||||
* 入场时间(状态变为在场的时间)
|
||||
*/
|
||||
@NotNull(message = "joinAt is null")
|
||||
Date joinAt;
|
||||
|
||||
/**
|
||||
* 用户类型 1工人 2从业人员
|
||||
*/
|
||||
@NotNull(message = "userType is null")
|
||||
Integer userType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
package cn.axzo.orgmanax.infra.client.elise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class EliseGetWhetherPushResp {
|
||||
|
||||
/**
|
||||
* personId
|
||||
*/
|
||||
private Long personId;
|
||||
|
||||
/**
|
||||
* 是否需要推送: true 需要 false 不需要
|
||||
*/
|
||||
private Boolean whetherPus;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,25 @@
|
||||
package cn.axzo.orgmanax.infra.client.elise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class EliseListUserStateReq {
|
||||
|
||||
/**
|
||||
* 项目部ID(很久以前的老字段定义已经转换为项目部ID)
|
||||
*/
|
||||
Long projectId;
|
||||
|
||||
/**
|
||||
* axzoId
|
||||
*/
|
||||
List<Long> axzoId;
|
||||
|
||||
/**
|
||||
* 用户类型 1工人 2从业人员
|
||||
*/
|
||||
Integer userType;
|
||||
|
||||
}
|
||||
@ -0,0 +1,43 @@
|
||||
package cn.axzo.orgmanax.infra.client.elise.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EliseListUserStateResp {
|
||||
|
||||
/**
|
||||
* axzoId
|
||||
*/
|
||||
private Long axzoId;
|
||||
/**
|
||||
* 下发时间
|
||||
*/
|
||||
private Long issueAt;
|
||||
/**
|
||||
* 项目ID
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String reason;
|
||||
/**
|
||||
* 原因
|
||||
*/
|
||||
private String sourceReason;
|
||||
/**
|
||||
* 0-未备案 1-已备案
|
||||
*/
|
||||
private Integer state;
|
||||
/**
|
||||
* 上传时间
|
||||
*/
|
||||
private Long uploadAt;
|
||||
|
||||
|
||||
/**
|
||||
* 最新一次人员备案成功时间
|
||||
*/
|
||||
private Long uploadSuccessKeepOnRecordTime;
|
||||
|
||||
}
|
||||
@ -0,0 +1,20 @@
|
||||
package cn.axzo.orgmanax.integration.sdk.elise;
|
||||
|
||||
import cn.axzo.elise.cdzj.api.EliseDeviceApi;
|
||||
import cn.axzo.orgmanax.infra.client.elise.EliseDeviceClient;
|
||||
import cn.axzo.orgmanax.integration.core.RpcWrapper;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public class EliseDeviceClientImpl implements EliseDeviceClient {
|
||||
|
||||
private final EliseDeviceApi eliseDeviceApi;
|
||||
|
||||
@Override
|
||||
public Integer getSnCountByProjectId(Long projectId) {
|
||||
return RpcWrapper.commonRes(() -> eliseDeviceApi.getSnCountByProjectId(projectId));
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,47 @@
|
||||
package cn.axzo.orgmanax.integration.sdk.elise;
|
||||
|
||||
import cn.axzo.elise.cdzj.api.EliseDeviceApi;
|
||||
import cn.axzo.elise.cdzj.api.EliseStatesApi;
|
||||
import cn.axzo.elise.cdzj.entity.request.GetWhetherPushReq;
|
||||
import cn.axzo.elise.cdzj.entity.request.PersonRegisterInfoReq;
|
||||
import cn.axzo.elise.cdzj.entity.response.GetWhetherPushRes;
|
||||
import cn.axzo.elise.cdzj.entity.response.PersonFilingsResp;
|
||||
import cn.axzo.elise.cdzj.entity.response.PersonRegisterInfoResp;
|
||||
import cn.axzo.orgmanax.infra.client.elise.EliseDeviceClient;
|
||||
import cn.axzo.orgmanax.infra.client.elise.EliseStatesClient;
|
||||
import cn.axzo.orgmanax.infra.client.elise.dto.*;
|
||||
import cn.axzo.orgmanax.integration.core.RpcWrapper;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
@Component
|
||||
public class EliseStatesClientImpl implements EliseStatesClient {
|
||||
|
||||
private final EliseStatesApi eliseStatesApi;
|
||||
|
||||
|
||||
@Override
|
||||
public List<EliseListUserStateResp> listUserState(EliseListUserStateReq req) {
|
||||
PersonRegisterInfoReq rpcReq = BeanUtil.copyProperties(req, PersonRegisterInfoReq.class);
|
||||
List<PersonRegisterInfoResp> list = RpcWrapper.commonRes(() -> eliseStatesApi.listUserState(rpcReq));
|
||||
return BeanUtil.copyToList(list, EliseListUserStateResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EliseGetPersonFilingsResp getPersonFilings(EliseListUserStateReq req) {
|
||||
PersonRegisterInfoReq rpcReq = BeanUtil.copyProperties(req, PersonRegisterInfoReq.class);
|
||||
PersonFilingsResp resp = RpcWrapper.commonRes(() -> eliseStatesApi.getPersonFilings(rpcReq));
|
||||
return BeanUtil.copyProperties(resp, EliseGetPersonFilingsResp.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EliseGetWhetherPushResp getWhetherPush(EliseGetWhetherPushReq req) {
|
||||
GetWhetherPushReq rpcReq = BeanUtil.copyProperties(req, GetWhetherPushReq.class);
|
||||
GetWhetherPushRes resp = RpcWrapper.commonRes(() -> eliseStatesApi.getWhetherPush(rpcReq));
|
||||
return BeanUtil.copyProperties(resp, EliseGetWhetherPushResp.class);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user