From 74472c9d22dddcb41383794caf0011043b20f817 Mon Sep 17 00:00:00 2001
From: kimi <kimi42345@gmail.com>
Date: 星期二, 31 三月 2020 13:25:47 +0800
Subject: [PATCH] fix  数据权限

---
 src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java b/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java
index 0ec4859..1af087c 100644
--- a/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java
+++ b/src/main/java/com/highdatas/mdm/service/impl/MasterAuthorServiceImpl.java
@@ -1,7 +1,5 @@
 package com.highdatas.mdm.service.impl;
 
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.mapper.EntityWrapper;
 import com.baomidou.mybatisplus.mapper.Wrapper;
 import com.baomidou.mybatisplus.service.impl.ServiceImpl;
@@ -18,7 +16,6 @@
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.security.CodeSigner;
 import java.text.MessageFormat;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -128,10 +125,9 @@
         }else {
             wrapper.isNull("maintain_field_id");
         }
+        wrapper.orderBy("order_no");
+
         List<SysField> fieldList = fieldService.selectList(wrapper);
-
-
-
         return fieldList;
     }
 
@@ -204,12 +200,14 @@
         MaintainField maintainField = fieldService.getMaintainFieldByMaintain(maintainId);
         String maintainFieldId = maintainField.getId();
 
-        List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.user).eq(MasterAuthorController.character_id, userId).eq("maintain_field_id", maintainFieldId));
+        List<MasterAuthor> masterAuthors = selectList(new EntityWrapper<MasterAuthor>()
+                .eq("table_name", maintain.getTableName())
+                .eq(Constant.TYPE, MasterAuthorType.user).eq(MasterAuthorController.character_id, userId).eq("maintain_field_id", maintainFieldId));
         if (masterAuthors.size() == 0) {
             //user 鑾峰彇role
             List<TUserRole> roles = userRoleService.selectList(new EntityWrapper<TUserRole>().eq("user_id", userId));
             List<String> roleIds = roles.stream().map(tUserRole -> tUserRole.getRoleId()).collect(Collectors.toList());
-            masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq(Constant.TYPE, MasterAuthorType.role).in(MasterAuthorController.character_id, roleIds).eq("maintain_field_id", maintainFieldId));
+            masterAuthors = selectList(new EntityWrapper<MasterAuthor>().eq("table_name", maintain.getTableName()).eq(Constant.TYPE, MasterAuthorType.role).in(MasterAuthorController.character_id, roleIds).eq("maintain_field_id", maintainFieldId));
         }
         if (masterAuthors.isEmpty()){
             return Constant.WHERE_DEFAULTUN;

--
Gitblit v1.8.0