之前oss跳过的处理

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

@ -1209,6 +1209,15 @@ public class MoveService {
return CommonTool.successResult(); 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) { private void addMaterialBizAuditStatusLog(long shopId, List<String> materialIds, StrStrMap materialIdAndOriginUrlMap) {
List<List<String>> chunkMaterialIds = CommonTool.chunkList(materialIds, 50); List<List<String>> chunkMaterialIds = CommonTool.chunkList(materialIds, 50);
for (List<String> smallMaterialIds : chunkMaterialIds) { for (List<String> smallMaterialIds : chunkMaterialIds) {

@ -368,7 +368,7 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
// TODO 几个方法的实现 // TODO 几个方法的实现
deleteShopCategoryBrand(shopId, productDetailBase, addRet); deleteShopCategoryBrand(shopId, productDetailBase, addRet);
addRet = rebuildAddRetReason(addRet, brandList, condition, queueMsg.getCid(), accessToken); 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)) { // if (CommonTool.isSuccessRet(addRet)) {
// ProductAddV2Data productAddV2Data = (ProductAddV2Data) addRet.getData().get("data"); // ProductAddV2Data productAddV2Data = (ProductAddV2Data) addRet.getData().get("data");
// long productId = productAddV2Data.getProductId(); // long productId = productAddV2Data.getProductId();
@ -392,14 +392,7 @@ public class ProcessMovePublishToPicTaskService extends TaskBaseService {
return addRet; 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 // TODO
private Ret rebuildAddRetReason(Ret addRet, JSONArray brandList, MoveShopSettingBO condition, String cid, AccessToken accessToken) { 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)); sourceImgUrlToOssImgUrlMap.put(imgUrl, filter.put("url", currOssImgUrl));
ret = uploadMaterialImageSyncToDd(shopId, filter, accessToken); ret = uploadMaterialImageSyncToDd(shopId, filter, accessToken);
// TODO: 2023/9/13 涉及到oss moveService.delOssMainImgUrls(new String[]{currOssImgUrl});
// delOssMainImgUrls(Collections.singletonList(currOssImgUrl));
if (CommonTool.isSuccessRet(ret)) { if (CommonTool.isSuccessRet(ret)) {
continue; continue;
} }
@ -513,18 +512,14 @@ public class ProcessProductPublishTaskService extends TaskBaseService {
return CommonTool.failResult("gif动图不处理"); return CommonTool.failResult("gif动图不处理");
} }
// TODO: 2023/9/13 涉及到oss 暂时不处理 String moveDir = "temp/ddTransfer";
// imageData = CommonTool.convertImageToJpg(imageData); String ossPath = String.format("%s/%s/%s.%s", moveDir, new SimpleDateFormat("yyyy-MM-dd").format(new Date()), UUID.randomUUID(), "jpg");
// String moveDir = "temp/ddTransfer"; Ret ret = storageService.uploadContent(ossPath, imageData);
// String ossPath = String.format("%s/%s/%s.%s", moveDir, LocalDate.now().toString(), UUID.randomUUID().toString(), "jpg"); if (CommonTool.isFailRet(ret)) {
// Ret ret = OssTool.uploadImmutableObjectByContent(ossPath, imageData); return ret;
// if (CommonTool.isFailRet(ret)) { }
// return ret;
// }
//
// return CommonTool.successResult("ossUrl", OssTool.getPubOssUrlByOssPath(ossPath));
StrStrMap strMap = new StrStrMap(); StrStrMap strMap = new StrStrMap();
strMap.put("ossUrl", ""); strMap.put("ossUrl", storageService.getPubOssUrlByOssPath(ossPath));
return Ret.success(strMap); return Ret.success(strMap);
} }

Loading…
Cancel
Save