refactor(job): 1
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run

This commit is contained in:
zcxlsm 2025-08-02 16:36:32 +08:00
parent f7cdf4bc09
commit 6e1c2e612b

View File

@ -78,37 +78,37 @@ public class SyncGrantAuthTask {
continue;
}
// 计算图片MD5
String nowMd5 = calculateMD5(imgByte);
// 通过MD5查询相同图片
Long remoteId = remoteSisAuthService.queryImgIdByImgMd5(nowMd5);
Long huaweiId;
if (remoteId == null) {
// 当前本地人像信息不存在相同照片直接上传华为盒子
huaweiId = syncHuaweiBox(person, imgByte);
} else {
huaweiId = remoteId;
}
if (huaweiId == null) {
log.info("华为盒子人像上传失败:{}-----{}", person.getName(), person.getId());
remoteSisAuthService.deletePersonAuth(List.of(person.getId()), new ArrayList<>());
continue;
}
Boolean update = false;
try {
update = remoteSisAuthService.updateImgByPersonId(person.getId(), huaweiId, nowMd5);
} catch (Exception e) {
remoteSisAuthService.deletePersonAuth(List.of(person.getId()), new ArrayList<>());
}
if (!update) {
log.info("更新人像信息失败:{}-----{}", person.getName(), person.getId());
remoteSisAuthService.deletePersonAuth(List.of(person.getId()), new ArrayList<>());
continue;
}
// // 计算图片MD5
// String nowMd5 = calculateMD5(imgByte);
// // 通过MD5查询相同图片
// Long remoteId = remoteSisAuthService.queryImgIdByImgMd5(nowMd5);
//
// Long huaweiId;
// if (remoteId == null) {
// // 当前本地人像信息不存在相同照片直接上传华为盒子
// huaweiId = syncHuaweiBox(person, imgByte);
// } else {
// huaweiId = remoteId;
// }
//
// if (huaweiId == null) {
// log.info("华为盒子人像上传失败:{}-----{}", person.getName(), person.getId());
// remoteSisAuthService.deletePersonAuth(List.of(person.getId()), new ArrayList<>());
// continue;
// }
//
// Boolean update = false;
// try {
// update = remoteSisAuthService.updateImgByPersonId(person.getId(), huaweiId, nowMd5);
// } catch (Exception e) {
// remoteSisAuthService.deletePersonAuth(List.of(person.getId()), new ArrayList<>());
// }
//
// if (!update) {
// log.info("更新人像信息失败:{}-----{}", person.getName(), person.getId());
// remoteSisAuthService.deletePersonAuth(List.of(person.getId()), new ArrayList<>());
// continue;
// }
// 同步人像到E8平台
Long e8Id = syncE8Plat(person, imgByte);