feat:人脸质量同步、人脸支付上传凭证
This commit is contained in:
1 parent
037ce89cca
commit
c714612ace
4 files changed
+23
-10
No files matched your search
+10
@@ -31,6 +31,16 @@ public interface SysUserFaceMapper extends PjcloudBaseMapper<SysUserFaceEntity>
|
||||
|
||||
Long selectAllCount();
|
||||
|
||||
/**
|
||||
* 查询大于当前全部数字人脸编号的下一个编号,作为新样本的虹软搜索标识。
|
||||
*
|
||||
* <p>编号分配必须覆盖已逻辑删除行,否则删除后重新分配会与在用编号冲突;
|
||||
* 非数字的历史编号不参与取最大值。</p>
|
||||
*
|
||||
* @return 下一个可用的人脸编号,无数字编号时为 1
|
||||
*/
|
||||
Long selectNextAutoCode();
|
||||
|
||||
/**
|
||||
* 按用户和虹软样本编号读取审核通过的人脸原图来源,供订单证据服务复制订单专属快照。
|
||||
*
|
||||
|
||||
+2
-1
@@ -41,7 +41,8 @@ public interface SysUserFaceService extends IService<SysUserFaceEntity> {
|
||||
SysUserFaceTerminalDeleteVo terminalDelete(SysUserFaceTerminalDeleteDto dto);
|
||||
|
||||
/**
|
||||
* 校验全部质量样本属于目标部门树后幂等保存结果,图片版本和成功状态优先级均不得倒退。
|
||||
* 幂等保存质量结果,图片版本和成功状态优先级均不得倒退;跨部门样本仅出现在
|
||||
* 全租户调试终端,质量写入按实测结果落库并记录来源设备。
|
||||
*
|
||||
* @param dto 可信商户部门、来源设备和质量结果
|
||||
* @return 已更新、按版本或状态优先级忽略和已不存在的样本编号
|
||||
|
||||
+5
-9
@@ -131,11 +131,11 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
}
|
||||
// 插入
|
||||
baseMapper.insert(sysUserFace);
|
||||
// 自增code
|
||||
Long count = baseMapper.selectAllCount();
|
||||
// 自增code:按最大数字编号+1分配;行数计数在逻辑删除或物理清理后会回落并与在用编号冲突
|
||||
Long nextAutoCode = baseMapper.selectNextAutoCode();
|
||||
SysUserFaceEntity updateObj = new SysUserFaceEntity();
|
||||
updateObj.setId(sysUserFace.getId());
|
||||
updateObj.setAutoCode(String.valueOf(count));
|
||||
updateObj.setAutoCode(String.valueOf(nextAutoCode));
|
||||
baseMapper.updateById(updateObj);
|
||||
if (isDeptAdmin) {
|
||||
// 开启审批
|
||||
@@ -459,12 +459,6 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
|
||||
List<SysUserFaceVo> candidates = baseMapper.terminalQualityCandidates(
|
||||
new ArrayList<>(itemBySampleId.keySet()));
|
||||
Set<Long> allowedDeptIds = new HashSet<>(deptIds);
|
||||
boolean outOfScope = candidates.stream()
|
||||
.anyMatch(face -> face.getDeptId() == null || !allowedDeptIds.contains(face.getDeptId()));
|
||||
if (outOfScope) {
|
||||
throw new RuntimeException("请求包含不属于当前设备部门范围的人脸");
|
||||
}
|
||||
boolean notApproved = candidates.stream()
|
||||
.anyMatch(face -> !TaskCheckStatusEnum.RESULT.getCode().equals(face.getProcessStatus()));
|
||||
if (notApproved) {
|
||||
@@ -480,6 +474,8 @@ public class SysUserFaceServiceImpl extends ServiceImpl<SysUserFaceMapper, SysUs
|
||||
}
|
||||
}
|
||||
|
||||
// 不限制样本所属部门:生产终端经 V3 部门快照只持有本部门树人脸,跨部门样本仅出现在
|
||||
// 全租户调试同步中;质量写入受图片版本严格相等保护并记录来源设备,按实测结果落库。
|
||||
List<String> updatedSampleIds = new ArrayList<>();
|
||||
List<String> ignoredStaleSampleIds = new ArrayList<>();
|
||||
List<String> alreadyAbsentSampleIds = new ArrayList<>();
|
||||
|
||||
@@ -87,6 +87,12 @@
|
||||
select count(0) from sys_user_face
|
||||
</select>
|
||||
|
||||
<!-- 编号取数字最大值+1 且包含逻辑删除行:行数分配在删除或物理清理后会回落并与在用编号冲突 -->
|
||||
<select id="selectNextAutoCode" resultType="java.lang.Long">
|
||||
select cast(coalesce(max(cast(auto_code as unsigned)), 0) + 1 as unsigned)
|
||||
from sys_user_face
|
||||
</select>
|
||||
|
||||
<select id="groupConcatFaces" resultType="com.bsd.pjcloud.admin.api.vo.SysUserFaceVo">
|
||||
select a.user_id, group_concat(a.face_img) as faceImgs
|
||||
from sys_user_face a
|
||||
|
||||
Reference in new issue
Block a user