Просмотр исходного кода

Merge branch 'master' into test

leon 4 лет назад
Родитель
Сommit
3cea9680e1

+ 12 - 9
src/main/java/com/mokamrp/privates/controller/pangu/DomainSecondController.java

@@ -59,16 +59,19 @@ public class DomainSecondController extends BaseController<DomainSecond> {
         }
         }
         return AjaxResult.success(res);
         return AjaxResult.success(res);
     }
     }
+
+
     @PostMapping("/delPro")
     @PostMapping("/delPro")
     public Object deletePro(@Valid @RequestBody DelHandle<DomainSecond> delHandle,@AuthUser User authUser, BindingResult bindingResult) {
     public Object deletePro(@Valid @RequestBody DelHandle<DomainSecond> delHandle,@AuthUser User authUser, BindingResult bindingResult) {
-        if (bindingResult.hasErrors()) {
+        if (bindingResult.hasErrors()){
             return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
             return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
         }
         }
-        QueryWrapper<DomainSecond> QueryWrapper = new QueryWrapper<>();
+        QueryWrapper<DomainSecond> queryWrapper = new QueryWrapper<>();
         String[] ids = delHandle.getIds().split(",");
         String[] ids = delHandle.getIds().split(",");
-        QueryWrapper.in("id", ids);
-        this.delRedis(ids,authUser.getDepartment());
-        boolean res = service.remove(QueryWrapper);
+        queryWrapper.in("id", ids);
+        List<DomainSecond> delList = domainSecondService.list(queryWrapper);
+        this.delRedis(delList);
+        boolean res = service.remove(queryWrapper);
         if (!res) {
         if (!res) {
             return AjaxResult.error("删除失败");
             return AjaxResult.error("删除失败");
         }
         }
@@ -96,10 +99,10 @@ public class DomainSecondController extends BaseController<DomainSecond> {
         return true;
         return true;
     }
     }
 
 
-    public Boolean delRedis(String[] ids,String deptId){
-        List<DomainSecond> list = domainSecondService.list(new QueryWrapper<DomainSecond>().in("id",ids));
-        for (DomainSecond domainSecond : list){
-            stringRedisTemplate.opsForSet().remove(RedisKey.PanSecondDomainList+deptId,domainSecond.getDomain());
+    public Boolean delRedis(List<DomainSecond> delList){
+//        List<DomainSecond> list = domainSecondService.list(new QueryWrapper<DomainSecond>().in("id",ids));
+        for (DomainSecond domainSecond : delList){
+            stringRedisTemplate.opsForSet().remove(RedisKey.PanSecondDomainList+domainSecond.getDeptId(),domainSecond.getDomain());
         }
         }
         return true;
         return true;
     }
     }