瀏覽代碼

add 数据迁移 增加日志删除接口

lvxianyun 2 年之前
父節點
當前提交
ec248f82fd

+ 11 - 0
dmp-business/dmp-rwd/src/main/java/com/persagy/dmp/rwd/migrate/controller/DigitalMigrateLogController.java

@@ -79,6 +79,17 @@ public class DigitalMigrateLogController {
         return ResultHelper.multi(voList);
     }
 
+    @PostMapping("/deleteAllLog")
+    public CommonResult deleteAllLog(@RequestBody QueryCriteria criteria) {
+        ParamCheckUtil.checkParam(CommonConstant.QUERY_GROUPCODE,CommonConstant.QUERY_PROJECTID);
+        QueryWrapper<SyncData> wrapper = new QueryWrapper<>();
+        // 添加所属项目条件
+        ConditionUtil.ensureProjectCriteriaDirectly(wrapper);
+        // 转换查询条件
+        QueryCriteriaHelper.toWrapper(wrapper, criteria, SyncData.class);
+        service.remove(wrapper);
+        return ResultHelper.success();
+    }
     /**
      * 补充默认值
      * @param voList

+ 16 - 0
dmp-comp/dmp-digital-starter/src/main/java/com/persagy/dmp/migrate/client/DigitalMigrateLogClient.java

@@ -52,4 +52,20 @@ public interface DigitalMigrateLogClient {
                                              @RequestParam("appId") String appId,
                                              @RequestParam("userId") String userId,
                                              @RequestBody List<SyncData> nodes);
+
+    /**
+     * 新增数据迁移日志-根据条件删除
+     * @param groupCode: 集团编码
+     * @param projectId: 项目ID
+     * @param appId: 应用ID
+     * @param userId: 用户ID
+     * @param criteria: 条件
+     * @return
+     */
+    @PostMapping("/deleteAllLog")
+    CommonResult deleteAllLog(@RequestParam("groupCode") String groupCode,
+                                     @RequestParam("projectId") String projectId,
+                                     @RequestParam("appId") String appId,
+                                     @RequestParam("userId") String userId,
+                                     @RequestBody QueryCriteria criteria) ;
 }

+ 19 - 0
dmp-comp/dmp-digital-starter/src/main/java/com/persagy/dmp/migrate/client/DigitalMigrateLogFacade.java

@@ -5,6 +5,8 @@ import com.persagy.dmp.basic.model.QueryCriteria;
 import com.persagy.dmp.common.model.response.CommonResult;
 import com.persagy.dmp.common.utils.ResultHelper;
 import com.persagy.dmp.rwd.migrate.entity.SyncData;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestParam;
 
 import java.util.List;
 
@@ -49,4 +51,21 @@ public class DigitalMigrateLogFacade {
         CommonResult<List<SyncData>> result = client.create(groupCode, projectId, appId, userId, syncDataList);
         return ResultHelper.getContent(result);
     }
+
+    /**
+     * 新增数据迁移日志-根据条件删除
+     * @param groupCode: 集团编码
+     * @param projectId: 项目ID
+     * @param appId: 应用ID
+     * @param userId: 用户ID
+     * @param criteria: 条件
+     * @return
+     */
+    public static CommonResult deleteAllLog(@RequestParam("groupCode") String groupCode,
+                              @RequestParam("projectId") String projectId,
+                              @RequestParam("appId") String appId,
+                              @RequestParam("userId") String userId,
+                              @RequestBody QueryCriteria criteria) {
+       return client.deleteAllLog(groupCode,projectId,appId,userId,criteria);
+    }
 }