feat(sis):
- 图像库图片改为通过ossId获取 - SisPersonLibImg 字段 imgUrl 更改为 imgOssId,类型同步更改 - 移除SisDeviceManage 中的 accessControlId 字段
This commit is contained in:
@@ -68,11 +68,6 @@ public class SisDeviceManage extends BaseEntity {
|
||||
*/
|
||||
private Integer vcrPort;
|
||||
|
||||
/**
|
||||
* 门禁id
|
||||
*/
|
||||
private Long accessControlId;
|
||||
|
||||
/**
|
||||
* 设备账号
|
||||
*/
|
||||
|
@@ -39,9 +39,9 @@ public class SisPersonLibImg extends TenantEntity {
|
||||
private String imgName;
|
||||
|
||||
/**
|
||||
* 图片的存储地址
|
||||
* 图片ossId
|
||||
*/
|
||||
private String imgUrl;
|
||||
private Long imgOssId;
|
||||
|
||||
/**
|
||||
* 性别 1:男 2:女 99:未说明
|
||||
|
@@ -66,11 +66,6 @@ public class SisDeviceManageBo extends BaseEntity {
|
||||
*/
|
||||
private Long vcrPort;
|
||||
|
||||
/**
|
||||
* 门禁id
|
||||
*/
|
||||
private Long accessControlId;
|
||||
|
||||
/**
|
||||
* 设备账号
|
||||
*/
|
||||
|
@@ -39,10 +39,10 @@ public class SisPersonLibImgBo extends BaseEntity {
|
||||
private String imgName;
|
||||
|
||||
/**
|
||||
* 图片的存储地址
|
||||
* 图片ossId
|
||||
*/
|
||||
@NotBlank(message = "图片的存储地址不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String imgUrl;
|
||||
@NotBlank(message = "图片ossId不能为空", groups = {AddGroup.class, EditGroup.class})
|
||||
private String imgOssId;
|
||||
|
||||
/**
|
||||
* 性别 1:男2:女 99:未说明
|
||||
|
@@ -73,12 +73,6 @@ public class SisDeviceManageVo implements Serializable {
|
||||
@ExcelProperty(value = "录像机端口")
|
||||
private Integer vcrPort;
|
||||
|
||||
/**
|
||||
* 门禁id
|
||||
*/
|
||||
@ExcelProperty(value = "门禁id")
|
||||
private Long accessControlId;
|
||||
|
||||
/**
|
||||
* 设备账号
|
||||
*/
|
||||
|
@@ -45,10 +45,10 @@ public class SisPersonLibImgVo implements Serializable {
|
||||
private String imgName;
|
||||
|
||||
/**
|
||||
* 图片的存储地址
|
||||
* 图片ossId
|
||||
*/
|
||||
@ExcelProperty(value = "图片的存储地址")
|
||||
private String imgUrl;
|
||||
@ExcelProperty(value = "图片ossId")
|
||||
private Long imgOssId;
|
||||
|
||||
/**
|
||||
* 性别 1:男
|
||||
|
@@ -4,11 +4,14 @@ import cn.hutool.core.lang.Assert;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.resource.api.RemoteFileService;
|
||||
import org.dromara.sis.domain.SisAuthRecord;
|
||||
import org.dromara.sis.domain.bo.SingleAuthRecordBo;
|
||||
import org.dromara.sis.domain.bo.SisAuthRecordBo;
|
||||
@@ -57,6 +60,9 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
private final ISisLibDeviceImgRefService sisLibDeviceImgRefService;
|
||||
private final ISisAccessControlDeviceService sisAccessControlDeviceService;
|
||||
|
||||
@DubboReference
|
||||
private final RemoteFileService remoteFileService;
|
||||
|
||||
/**
|
||||
* 查询授权记录
|
||||
*
|
||||
@@ -142,14 +148,18 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
List<SisAccessControlVo> acList = sisAccessControlService.queryListByIds(bo.getAcIds());
|
||||
Assert.notEmpty(acList, "门禁设备不存在!");
|
||||
|
||||
|
||||
|
||||
try {
|
||||
log.info("开始对宇视盒子下发照片,图片:{}、设备:{}", bo.getImgIds(), eqpIds);
|
||||
|
||||
for (SisPersonLibImgVo imgVo : imgList) {
|
||||
for (Long eqpId : eqpIds) {
|
||||
long eqp_lib_id;
|
||||
Integer eqp_lib_img_id;
|
||||
byte[] imageByte = Files.readAllBytes(Paths.get(imgVo.getImgUrl()));
|
||||
|
||||
byte[] imageByte = remoteFileService.downloadToByteArray(imgVo.getImgOssId());
|
||||
Assert.notNull(imageByte, "图片下载失败");
|
||||
// byte[] imageByte = Files.readAllBytes(Paths.get(imgVo.getImgUrl()));
|
||||
|
||||
SisAccessControlDeviceVo vo = sisAccessControlDeviceService.queryById(eqpId);
|
||||
Assert.notNull(vo, "门禁控制设备不存在,id=" + eqpId);
|
||||
@@ -207,7 +217,8 @@ public class SisAuthRecordServiceImpl implements ISisAuthRecordService {
|
||||
|
||||
log.info("开始写入E8平台,图片:{}、门禁:{}", bo.getImgIds(), bo.getAcIds());
|
||||
for (SisPersonLibImgVo imgVo : imgList) {
|
||||
byte[] imageByte = Files.readAllBytes(Paths.get(imgVo.getImgUrl()));
|
||||
byte[] imageByte = remoteFileService.downloadToByteArray(imgVo.getImgOssId());
|
||||
Assert.notNull(imageByte, "图片下载失败");
|
||||
|
||||
log.info("E8平台上传图片,{}", imgVo.getId());
|
||||
String url = e8VouchService.uploadFace(imageByte);
|
||||
|
@@ -81,7 +81,6 @@ public class SisDeviceManageServiceImpl implements ISisDeviceManageService {
|
||||
lqw.eq(bo.getParentId() != null, SisDeviceManage::getParentId, bo.getParentId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getVcrIp()), SisDeviceManage::getVcrIp, bo.getVcrIp());
|
||||
lqw.eq(bo.getVcrPort() != null, SisDeviceManage::getVcrPort, bo.getVcrPort());
|
||||
lqw.eq(bo.getAccessControlId() != null, SisDeviceManage::getAccessControlId, bo.getAccessControlId());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
|
@@ -82,7 +82,7 @@ public class SisPersonLibImgServiceImpl implements ISisPersonLibImgService {
|
||||
lqw.orderByAsc(SisPersonLibImg::getId);
|
||||
lqw.eq(bo.getLibId() != null, SisPersonLibImg::getLibId, bo.getLibId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getImgName()), SisPersonLibImg::getImgName, bo.getImgName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getImgUrl()), SisPersonLibImg::getImgUrl, bo.getImgUrl());
|
||||
lqw.eq(bo.getImgOssId() != null, SisPersonLibImg::getImgOssId, bo.getImgOssId());
|
||||
lqw.eq(bo.getSex() != null, SisPersonLibImg::getSex, bo.getSex());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getEmail()), SisPersonLibImg::getEmail, bo.getEmail());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTel()), SisPersonLibImg::getTel, bo.getTel());
|
||||
|
Reference in New Issue
Block a user