之前oss跳过的处理

20230922-ljl-fixBug
daixiaogang 1 year ago
parent 7999ece378
commit b1ce4800eb

@ -1209,6 +1209,15 @@ public class MoveService {
return CommonTool.successResult();
}
public void delOssMainImgUrls(String[] mainImgUrls) {
// TODO 回头再删除
// foreach ($urls as $url) {
// if (strpos($url, Zc::C('dy-honor-pub.domain')) !== false) {
// OssTool::deleteImmutableObject(str_replace(Zc::C('dy-honor-pub.domain'), '', $url));
// }
// }
}
private void addMaterialBizAuditStatusLog(long shopId, List<String> materialIds, StrStrMap materialIdAndOriginUrlMap) {
List<List<String>> chunkMaterialIds = CommonTool.chunkList(materialIds, 50);
for (List<String> smallMaterialIds : chunkMaterialIds) {

@ -368,7 +368,7 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
// TODO 几个方法的实现
deleteShopCategoryBrand(shopId, productDetailBase, addRet);
addRet = rebuildAddRetReason(addRet, brandList, condition, queueMsg.getCid(), accessToken);
delOssMainImgUrls(((String) productDetailBase.get("mainImgUrls")).split("\\|"));
moveService.delOssMainImgUrls(((String) productDetailBase.get("mainImgUrls")).split("\\|"));
// if (CommonTool.isSuccessRet(addRet)) {
// ProductAddV2Data productAddV2Data = (ProductAddV2Data) addRet.getData().get("data");
// long productId = productAddV2Data.getProductId();
@ -392,14 +392,7 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
return addRet;
}
private void delOssMainImgUrls(String[] mainImgUrls) {
// TODO 回头再删除
// foreach ($urls as $url) {
// if (strpos($url, Zc::C('dy-honor-pub.domain')) !== false) {
// OssTool::deleteImmutableObject(str_replace(Zc::C('dy-honor-pub.domain'), '', $url));
// }
// }
}
// TODO
private Ret rebuildAddRetReason(Ret addRet, JSONArray brandList, MoveShopSettingBO condition, String cid, AccessToken accessToken) {

@ -490,8 +490,7 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
sourceImgUrlToOssImgUrlMap.put(imgUrl, filter.put("url", currOssImgUrl));
ret = uploadMaterialImageSyncToDd(shopId, filter, accessToken);
// TODO: 2023/9/13 涉及到oss
// delOssMainImgUrls(Collections.singletonList(currOssImgUrl));
moveService.delOssMainImgUrls(new String[]{currOssImgUrl});
if (CommonTool.isSuccessRet(ret)) {
continue;
}
@ -513,18 +512,14 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
return CommonTool.failResult("gif动图不处理");
}
// TODO: 2023/9/13 涉及到oss 暂时不处理
// imageData = CommonTool.convertImageToJpg(imageData);
// String moveDir = "temp/ddTransfer";
// String ossPath = String.format("%s/%s/%s.%s", moveDir, LocalDate.now().toString(), UUID.randomUUID().toString(), "jpg");
// Ret ret = OssTool.uploadImmutableObjectByContent(ossPath, imageData);
// if (CommonTool.isFailRet(ret)) {
// return ret;
// }
//
// return CommonTool.successResult("ossUrl", OssTool.getPubOssUrlByOssPath(ossPath));
String moveDir = "temp/ddTransfer";
String ossPath = String.format("%s/%s/%s.%s", moveDir, new SimpleDateFormat("yyyy-MM-dd").format(new Date()), UUID.randomUUID(), "jpg");
Ret ret = storageService.uploadContent(ossPath, imageData);
if (CommonTool.isFailRet(ret)) {
return ret;
}
StrStrMap strMap = new StrStrMap();
strMap.put("ossUrl", "");
strMap.put("ossUrl", storageService.getPubOssUrlByOssPath(ossPath));
return Ret.success(strMap);
}

Loading…
Cancel
Save