zhuwei 1 hafta önce
ebeveyn
işleme
10a06b5578

+ 5 - 4
blade-service/blade-system/src/main/java/org/springblade/system/controller/DictBizController.java

@@ -24,6 +24,7 @@ import org.springblade.core.boot.ctrl.BladeController;
 import org.springblade.core.cache.utils.CacheUtil;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.core.mp.support.Query;
+import org.springblade.core.secure.BladeUser;
 import org.springblade.core.tenant.annotation.NonDS;
 import org.springblade.core.tool.api.R;
 import org.springblade.system.entity.DictBiz;
@@ -159,8 +160,8 @@ public class DictBizController extends BladeController {
     @GetMapping("/dictionary")
     @ApiOperationSupport(order = 8)
     @ApiOperation(value = "获取字典", notes = "获取字典")
-    public R<List<DictBiz>> dictionary(String code) {
-        List<DictBiz> tree = dictService.getList(code, "notRoot");
+    public R<List<DictBiz>> dictionary(String code, BladeUser user) {
+        List<DictBiz> tree = dictService.getList(code, "notRoot",user.getTenantId());
         return R.data(tree);
     }
 
@@ -170,8 +171,8 @@ public class DictBizController extends BladeController {
     @GetMapping("/dictionary-tree")
     @ApiOperationSupport(order = 9)
     @ApiOperation(value = "获取字典树", notes = "获取字典树")
-    public R<List<DictBizVO>> dictionaryTree(String code) {
-        List<DictBiz> tree = dictService.getList(code, "notRoot");
+    public R<List<DictBizVO>> dictionaryTree(String code, BladeUser user) {
+        List<DictBiz> tree = dictService.getList(code, "notRoot",user.getTenantId());
         return R.data(DictBizWrapper.build().listNodeVO(tree));
     }
 

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/feign/DictBizClient.java

@@ -57,7 +57,7 @@ public class DictBizClient implements IDictBizClient {
     @Override
     @GetMapping(GET_LIST)
     public R<List<DictBiz>> getList(String code, String notRoot) {
-        return R.data(service.getList(code, notRoot));
+        return R.data(service.getList(code, notRoot,""));
     }
 
 }

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictBizMapper.java

@@ -46,7 +46,7 @@ public interface DictBizMapper extends BaseMapper<DictBiz> {
      * @param code 字典编号
      * @return
      */
-    List<DictBiz> getList(@Param("code") String code, @Param("notRoot") String notRoot);
+    List<DictBiz> getList(@Param("code") String code, @Param("notRoot") String notRoot, @Param("tenantId") String tenantId);
 
     /**
      * 获取树形节点

+ 3 - 0
blade-service/blade-system/src/main/java/org/springblade/system/mapper/DictBizMapper.xml

@@ -40,6 +40,9 @@
         <if test="notRoot != null and notRoot != ''">
             and parent_id > 0
         </if>
+        <if test="tenantId != null and tenantId != ''">
+            and tenantId = #{tenantId}
+        </if>
         and is_sealed = 0 and is_deleted = 0
         order by sort
     </select>

+ 1 - 1
blade-service/blade-system/src/main/java/org/springblade/system/service/IDictBizService.java

@@ -62,7 +62,7 @@ public interface IDictBizService extends IService<DictBiz> {
      * @param code 字典编号
      * @return
      */
-    List<DictBiz> getList(String code, String notRoot);
+    List<DictBiz> getList(String code, String notRoot,String tenantId);
 
     /**
      * 新增或修改

+ 5 - 2
blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DictBizServiceImpl.java

@@ -67,8 +67,11 @@ public class DictBizServiceImpl extends ServiceImpl<DictBizMapper, DictBiz> impl
     }
 
     @Override
-    public List<DictBiz> getList(String code, String notRoot) {
-        return baseMapper.getList(code, notRoot);
+    public List<DictBiz> getList(String code, String notRoot,String tenantId) {
+        if (tenantId==null || tenantId.equals("") || tenantId.equals("null") || Func.isNull(tenantId)) {
+            tenantId = "000000";
+        }
+        return baseMapper.getList(code, notRoot,tenantId);
     }
 
     @Override