refactor(job): 1
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
This commit is contained in:
parent
f7cdf4bc09
commit
6e1c2e612b
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user