Quellcode durchsuchen

组被删除 同步删除自动创建数据库数据

yumeng vor 3 Jahren
Ursprung
Commit
b2d98afb5a

+ 14 - 0
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -871,6 +871,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
                 String key = token.getAccountId() + "_ProgramCreative" + "_" + nowDate;
                 redisUtil.set(key, 1, 100000L);
                 updateService.updateUnitStatus(token.getAccessToken(), token.getAccountId(), unitId, 3, "e9ca23d68d884d4ebb19d07889727dae");
+                deleteBy(token.getAccountId(),unitId);
             }
         }
     }
@@ -1700,10 +1701,13 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
 
         if (creativeCode == -1 && "/rest/openapi/v2/creative/create调用已超日限,次日可恢复调用".equals(creativeMessage)) {
             updateService.updateUnitStatus(token.getAccessToken(), token.getAccountId(), unitId, 3, "e9ca23d68d884d4ebb19d07889727dae");
+            deleteBy(token.getAccountId(),unitId);
         } else if (creativeCode == -1 && creativeMessage.contains("超过可关联的有效创意的上限")) {
             updateService.updateUnitStatus(token.getAccessToken(), token.getAccountId(), unitId, 3, "e9ca23d68d884d4ebb19d07889727dae");
+            deleteBy(token.getAccountId(),unitId);
         } else if (creativeCode == -1 && creativeMessage.contains("视频不存在")) {
             updateService.updateUnitStatus(token.getAccessToken(), token.getAccountId(), unitId, 3, "e9ca23d68d884d4ebb19d07889727dae");
+            deleteBy(token.getAccountId(),unitId);
         }
 
         AiKuaishouCreativeLevelOperationRecord record = new AiKuaishouCreativeLevelOperationRecord();
@@ -1726,6 +1730,16 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
         creativeLevelOperationRecordService.saveOrUpdate(record);
     }
 
+
+    private void deleteBy(Long accountId, Long unitId) {
+        Map<String, Object> deleteMap = new HashMap<>();
+        deleteMap.put("account_id", accountId);
+        deleteMap.put("unit_id", unitId);
+        unitLevelOperationRecordService.removeByMap(deleteMap);
+
+
+    }
+
     /**
      * @param wildcard 计划名称/组名称
      * @param strategy 账户id