diff --git a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java index c6ac68db..68a6bbd7 100644 --- a/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java +++ b/anomaly/src/main/java/com/foreverwin/mesnac/anomaly/service/impl/AbnormalBillServiceImpl.java @@ -880,7 +880,6 @@ public class AbnormalBillServiceImpl extends ServiceImpl userResourceList){ - userResourceService.saveAll(userResourceList); + public R saveAll(@RequestBody Map param){ + String resource = (String) param.get("resource"); + String user = (String) param.get("user"); + String str = JSONUtil.toJsonStr(param.get("userResourceList")); + List userResourceList = JSONArray.parseArray(str, UserResourceDto.class); + userResourceService.saveAll(userResourceList,resource,user); return R.ok(); } diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java index c87ff219..ab1dd271 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/mapper/UserResourceMapper.java @@ -25,4 +25,6 @@ public interface UserResourceMapper extends BaseMapper { List findEnableList(@Param("site") String site, @Param("resource") String resource, @Param("user") String user); List findAll(@Param("site") String site, @Param("resource") String resource, @Param("userId") String userId); + + void deleteByUserAndResource(@Param("user")String user,@Param("resource")String resource); } \ No newline at end of file diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java index 6bf9ed8a..dc14e96d 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/UserResourceService.java @@ -34,7 +34,7 @@ public interface UserResourceService extends IService { List findAll(UserResourceDto userResourceDto); - void saveAll(List userResourceDtoList); + void saveAll(List userResourceDtoList,String resource,String user); } \ No newline at end of file diff --git a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java index 8c3ead93..f75e1261 100644 --- a/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java +++ b/dispatch/src/main/java/com/foreverwin/mesnac/dispatch/service/impl/UserResourceServiceImpl.java @@ -77,7 +77,7 @@ public class UserResourceServiceImpl extends ServiceImpl userResourceDtoList) { + public void saveAll(List userResourceDtoList,String resource,String user) { List userResourceList = new ArrayList<>(); String site = CommonMethods.getSite(); for (int i = 0; i < userResourceDtoList.size(); i++) { @@ -113,7 +113,7 @@ public class UserResourceServiceImpl extends ServiceImpl - +