月球大数据地理空间分析展示平台-【后端】-月球后台服务
13693261870
2023-08-28 910c0d09275fc7ac411a0bcbe87bc7b5ead533ee
src/main/java/com/moon/server/controller/sys/ResController.java
@@ -137,12 +137,11 @@
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                entity.setCreateUser(ue.getId());
                entity.setDepid(ue.getDepcode());
            }
            permsService.clearPermsCache();
            int count = resService.insert(entity);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -162,13 +161,12 @@
            if (ue != null) {
                for (ResEntity entity : list) {
                    entity.setCreateUser(ue.getId());
                    entity.setDepid(ue.getDepcode());
                }
            }
            permsService.clearPermsCache();
            int count = resService.inserts(list);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -184,10 +182,8 @@
    @GetMapping(value = "/delete")
    public ResponseMsg<Integer> delete(int id) {
        try {
            permsService.clearPermsCache();
            int count = resService.delete(id);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -207,10 +203,8 @@
                return fail("id数组不能为空", -1);
            }
            permsService.clearPermsCache();
            int count = resService.deletes(ids);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -230,12 +224,11 @@
            UserEntity ue = tokenService.getCurrentUser(req);
            if (ue != null) {
                entity.setUpdateUser(ue.getId());
                entity.setDepid(ue.getDepcode());
            }
            permsService.clearPermsCache();
            int count = resService.update(entity);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {
@@ -256,13 +249,12 @@
            if (ue != null) {
                for (ResEntity entity : list) {
                    entity.setUpdateUser(ue.getId());
                    entity.setDepid(ue.getDepcode());
                }
            }
            permsService.clearPermsCache();
            int count = resService.updates(list);
            if (count > 0) {
                permsService.clearResCache();
            }
            return success(count);
        } catch (Exception ex) {