Преглед на файлове

Merge remote-tracking branch 'origin/develop' into develop

linhuili преди 2 години
родител
ревизия
510465b539

+ 13 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/controller/DataMigrationController.java

@@ -211,6 +211,19 @@ public class DataMigrationController {
         return logService.queryMigrationLog(context, request);
     }
 
+    /**
+     * 根据条件 删除操作日志 物理删除
+     * @param request
+     * {
+     *     "filters": "projectId='Pj9909990004';sign=2;type='create';tableName='dt_relation';creationTime='20220125121146'"
+     * }
+     * @return
+     */
+    @PostMapping("/deleteLog")
+    public AdmResponse deleteMigrateForLog(@RequestBody AdmQueryCriteria request) {
+        InstanceUrlParam context = AdmContextUtil.toDmpContext();
+        return logService.deleteMigrationLog(context, request);
+    }
 
 
 

+ 1 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/IMigrationLogService.java

@@ -15,4 +15,5 @@ import com.persagy.proxy.common.entity.InstanceUrlParam;
 public interface IMigrationLogService {
 
     AdmResponse queryMigrationLog(InstanceUrlParam context, AdmQueryCriteria request);
+    AdmResponse deleteMigrationLog(InstanceUrlParam context, AdmQueryCriteria request);
 }

+ 13 - 0
adm-business/adm-middleware/src/main/java/com/persagy/proxy/migration/service/Impl/MigrationLogServiceImpl.java

@@ -65,6 +65,19 @@ public class MigrationLogServiceImpl implements IMigrationLogService {
         }
     }
 
+    @Override
+    public AdmResponse deleteMigrationLog(InstanceUrlParam context, AdmQueryCriteria request) {
+        QueryCriteria queryCriteria = AdmQueryCriteriaHelper.toDmpCriteria(request);
+        String groupCode = context.getGroupCode();
+        String projectId = context.getProjectId();
+        CommonResult result = DigitalMigrateLogFacade.deleteAllLog(groupCode, projectId, context.getAppId(), context.getUserId(),queryCriteria);
+        if(result.getMessage().equals(DmpResult.SUCCESS)){
+            return AdmResponse.success();
+        }else{
+            return AdmResponse.failure(result.getMessage());
+        }
+    }
+
 
     /***
      * Description: 查询所有关系类型

+ 7 - 0
adm-business/adm-server/src/main/java/com/persagy/adm/server/custom/interceptor/TokenInterceptor.java

@@ -8,6 +8,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
+import org.springframework.web.servlet.ModelAndView;
 import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
 
 import javax.servlet.http.HttpServletRequest;
@@ -36,4 +37,10 @@ public class TokenInterceptor extends HandlerInterceptorAdapter {
         }
         return super.preHandle(request, response, handler);
     }
+
+    @Override
+    public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler, ModelAndView modelAndView) throws Exception {
+        bossAuthUserThreadLocal.remove();
+        super.postHandle(request, response, handler, modelAndView);
+    }
 }