|
@@ -203,22 +203,57 @@ public class LicenseAuditAsyncService {
|
|
|
log.info("{}AI审核拒绝,已删除store_img记录,门店ID:{},图片URL:{}", licenseTypeName, storeId, imageUrl);
|
|
log.info("{}AI审核拒绝,已删除store_img记录,门店ID:{},图片URL:{}", licenseTypeName, storeId, imageUrl);
|
|
|
} else if (needApprove) {
|
|
} else if (needApprove) {
|
|
|
// 审核通过:需要检查所有图片是否都审核通过
|
|
// 审核通过:需要检查所有图片是否都审核通过
|
|
|
- // 先查询当前记录,获取所有图片URL
|
|
|
|
|
|
|
+ // 先查询当前记录,获取所有图片URL(查询状态为2或1的记录,因为第一张图片审核通过后状态会变为1)
|
|
|
StoreLicenseHistory currentHistory = licenseHistoryMapper.selectOne(
|
|
StoreLicenseHistory currentHistory = licenseHistoryMapper.selectOne(
|
|
|
new LambdaQueryWrapper<StoreLicenseHistory>()
|
|
new LambdaQueryWrapper<StoreLicenseHistory>()
|
|
|
.eq(StoreLicenseHistory::getStoreId, storeId)
|
|
.eq(StoreLicenseHistory::getStoreId, storeId)
|
|
|
.eq(StoreLicenseHistory::getLicenseStatus, licenseStatus)
|
|
.eq(StoreLicenseHistory::getLicenseStatus, licenseStatus)
|
|
|
- .eq(StoreLicenseHistory::getLicenseExecuteStatus, 2)
|
|
|
|
|
|
|
+ .in(StoreLicenseHistory::getLicenseExecuteStatus, 1, 2) // 查询状态为1或2的记录
|
|
|
.like(StoreLicenseHistory::getImgUrl, imageUrl)
|
|
.like(StoreLicenseHistory::getImgUrl, imageUrl)
|
|
|
.eq(StoreLicenseHistory::getDeleteFlag, 0)
|
|
.eq(StoreLicenseHistory::getDeleteFlag, 0)
|
|
|
|
|
+ .orderByDesc(StoreLicenseHistory::getCreatedTime) // 按创建时间倒序,获取最新的记录
|
|
|
.last("LIMIT 1")
|
|
.last("LIMIT 1")
|
|
|
);
|
|
);
|
|
|
|
|
|
|
|
if (currentHistory != null && StringUtils.isNotEmpty(currentHistory.getImgUrl())) {
|
|
if (currentHistory != null && StringUtils.isNotEmpty(currentHistory.getImgUrl())) {
|
|
|
- // 检查是否所有图片都已审核通过
|
|
|
|
|
- // 由于是异步审核,每张图片都会调用此方法,所以这里只记录单张图片的审核通过
|
|
|
|
|
- // 如果需要等所有图片都审核通过才更新状态,需要额外的机制来跟踪
|
|
|
|
|
|
|
+ // 如果状态还是2(审核中),更新为1(审核通过)
|
|
|
|
|
+ if (currentHistory.getLicenseExecuteStatus() == 2) {
|
|
|
|
|
+ updateWrapper.set(StoreLicenseHistory::getLicenseExecuteStatus, 1); // 1-审核通过
|
|
|
|
|
+ licenseHistoryMapper.update(null, updateWrapper);
|
|
|
|
|
+ }
|
|
|
log.info("{}AI审核通过,门店ID:{},图片URL:{}", licenseTypeName, storeId, imageUrl);
|
|
log.info("{}AI审核通过,门店ID:{},图片URL:{}", licenseTypeName, storeId, imageUrl);
|
|
|
|
|
+
|
|
|
|
|
+ // 审核通过后,插入store_img表(检查是否已存在,避免重复插入)
|
|
|
|
|
+ StoreImg existingImg = storeImgMapper.selectOne(
|
|
|
|
|
+ new LambdaQueryWrapper<StoreImg>()
|
|
|
|
|
+ .eq(StoreImg::getStoreId, storeId)
|
|
|
|
|
+ .eq(StoreImg::getImgType, 35)
|
|
|
|
|
+ .eq(StoreImg::getImgUrl, imageUrl)
|
|
|
|
|
+ .eq(StoreImg::getDeleteFlag, 0)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (existingImg == null) {
|
|
|
|
|
+ // 根据imgUrl在allImgUrls中的位置确定imgSort
|
|
|
|
|
+ String[] allImgUrls = currentHistory.getImgUrl().split(",");
|
|
|
|
|
+ int imgSort = 1;
|
|
|
|
|
+ for (int i = 0; i < allImgUrls.length; i++) {
|
|
|
|
|
+ if (allImgUrls[i].equals(imageUrl)) {
|
|
|
|
|
+ imgSort = i + 1;
|
|
|
|
|
+ break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ StoreImg storeImg = new StoreImg();
|
|
|
|
|
+ storeImg.setStoreId(storeId);
|
|
|
|
|
+ storeImg.setImgType(35); // 其他资质证明对应35
|
|
|
|
|
+ storeImg.setImgDescription("其他资质证明");
|
|
|
|
|
+ storeImg.setImgSort(imgSort);
|
|
|
|
|
+ storeImg.setImgUrl(imageUrl);
|
|
|
|
|
+ storeImg.setDeleteFlag(0);
|
|
|
|
|
+ storeImgMapper.insert(storeImg);
|
|
|
|
|
+ log.info("其他资质证明审核通过,已插入store_img表,门店ID:{},图片URL:{},排序:{}", storeId, imageUrl, imgSort);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.info("其他资质证明审核通过,store_img表已存在该记录,门店ID:{},图片URL:{}", storeId, imageUrl);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
@@ -251,6 +286,28 @@ public class LicenseAuditAsyncService {
|
|
|
updateWrapper.set(StoreLicenseHistory::getLicenseExecuteStatus, 1); // 1-审核通过
|
|
updateWrapper.set(StoreLicenseHistory::getLicenseExecuteStatus, 1); // 1-审核通过
|
|
|
licenseHistoryMapper.update(null, updateWrapper);
|
|
licenseHistoryMapper.update(null, updateWrapper);
|
|
|
log.info("{}AI审核通过,门店ID:{},图片URL:{}", licenseTypeName, storeId, imageUrl);
|
|
log.info("{}AI审核通过,门店ID:{},图片URL:{}", licenseTypeName, storeId, imageUrl);
|
|
|
|
|
+
|
|
|
|
|
+ // 审核通过后,插入store_img表(检查是否已存在,避免重复插入)
|
|
|
|
|
+ StoreImg existingImg = storeImgMapper.selectOne(
|
|
|
|
|
+ new LambdaQueryWrapper<StoreImg>()
|
|
|
|
|
+ .eq(StoreImg::getStoreId, storeId)
|
|
|
|
|
+ .eq(StoreImg::getImgType, 14)
|
|
|
|
|
+ .eq(StoreImg::getImgUrl, imageUrl)
|
|
|
|
|
+ .eq(StoreImg::getDeleteFlag, 0)
|
|
|
|
|
+ );
|
|
|
|
|
+ if (existingImg == null) {
|
|
|
|
|
+ StoreImg storeImg = new StoreImg();
|
|
|
|
|
+ storeImg.setStoreId(storeId);
|
|
|
|
|
+ storeImg.setImgType(14); // 营业执照对应14
|
|
|
|
|
+ storeImg.setImgDescription("营业执照");
|
|
|
|
|
+ storeImg.setImgSort(0);
|
|
|
|
|
+ storeImg.setImgUrl(imageUrl);
|
|
|
|
|
+ storeImg.setDeleteFlag(0);
|
|
|
|
|
+ storeImgMapper.insert(storeImg);
|
|
|
|
|
+ log.info("营业执照审核通过,已插入store_img表,门店ID:{},图片URL:{}", storeId, imageUrl);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ log.info("营业执照审核通过,store_img表已存在该记录,门店ID:{},图片URL:{}", storeId, imageUrl);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|