|
|
@@ -90,6 +90,25 @@ public class StoreImgController {
|
|
|
}
|
|
|
Integer imgType = storeImgInfoVo.getImgType();
|
|
|
Integer storeId = storeImgInfoVo.getStoreId();
|
|
|
+ // imgType=38:仅落库 store_img,不走环境相册、门店图片模式、异步取色、头图审核状态等分支
|
|
|
+ if (Integer.valueOf(38).equals(imgType)) {
|
|
|
+ int deleteCount = storeImgService.saveOrUpdateImg(storeId, imgType);
|
|
|
+ log.info("StoreImgController.saveOrUpdateImg imgType=38 store_img only, deleteCount={}", deleteCount);
|
|
|
+ for (StoreImg storeImg : storeImgList) {
|
|
|
+ if (storeImg != null) {
|
|
|
+ storeImg.setStoreId(storeId);
|
|
|
+ storeImg.setImgType(imgType);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Integer id = storeImgList.get(0).getId();
|
|
|
+ if (storeImgService.saveOrUpdateBatch(storeImgList)) {
|
|
|
+ if (id != null) {
|
|
|
+ return R.success("修改成功");
|
|
|
+ }
|
|
|
+ return R.success("新增成功");
|
|
|
+ }
|
|
|
+ return R.fail("失败");
|
|
|
+ }
|
|
|
// 图片由前端直连 AI 审核;服务端不再对门店图调用 moderate,避免保存被误拦截(仅与环境相册查询并行占位)
|
|
|
CompletableFuture<AiContentModerationUtil.AuditResult> auditFuture = CompletableFuture
|
|
|
.completedFuture(new AiContentModerationUtil.AuditResult(true, null));
|
|
|
@@ -104,24 +123,24 @@ public class StoreImgController {
|
|
|
if (!auditResult.isPassed()) {
|
|
|
return R.fail(auditResult.getFailureReason());
|
|
|
}
|
|
|
- if (imgType != null && imgType == 4) {
|
|
|
- List<StoreOfficialAlbum> albumList;
|
|
|
- try {
|
|
|
- albumList = albumFuture.get(10, TimeUnit.SECONDS);
|
|
|
- } catch (Exception e) {
|
|
|
- log.error("查询环境相册异常", e);
|
|
|
- return R.fail("查询环境相册失败");
|
|
|
- }
|
|
|
- if (albumList == null || albumList.isEmpty()) {
|
|
|
- return R.fail("没有默认环境相册");
|
|
|
- }
|
|
|
- StoreOfficialAlbum album = albumList.get(0);
|
|
|
- storeImgList.forEach(storeImg -> storeImg.setBusinessId(album.getId()));
|
|
|
- storeOfficialAlbumService.lambdaUpdate()
|
|
|
- .eq(StoreOfficialAlbum::getId, album.getId())
|
|
|
- .setSql("img_count = img_count + " + storeImgList.size())
|
|
|
- .update();
|
|
|
- }
|
|
|
+// if (imgType != null && imgType == 4) {
|
|
|
+// List<StoreOfficialAlbum> albumList;
|
|
|
+// try {
|
|
|
+// albumList = albumFuture.get(10, TimeUnit.SECONDS);
|
|
|
+// } catch (Exception e) {
|
|
|
+// log.error("查询环境相册异常", e);
|
|
|
+// return R.fail("查询环境相册失败");
|
|
|
+// }
|
|
|
+// if (albumList == null || albumList.isEmpty()) {
|
|
|
+// return R.fail("没有默认环境相册");
|
|
|
+// }
|
|
|
+// StoreOfficialAlbum album = albumList.get(0);
|
|
|
+// storeImgList.forEach(storeImg -> storeImg.setBusinessId(album.getId()));
|
|
|
+// storeOfficialAlbumService.lambdaUpdate()
|
|
|
+// .eq(StoreOfficialAlbum::getId, album.getId())
|
|
|
+// .setSql("img_count = img_count + " + storeImgList.size())
|
|
|
+// .update();
|
|
|
+// }
|
|
|
boolean isHeadImage = imgType != null && (imgType == 20 || imgType == 21);
|
|
|
// 清空storeid,imgType下图片
|
|
|
int deleteCount = storeImgService.saveOrUpdateImg(storeImgInfoVo.getStoreId(),storeImgInfoVo.getImgType());
|