Browse Source

fix 数据权限语句null bug

疯狂的狮子li 4 years ago
parent
commit
dfcd84c2bc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm

+ 2 - 1
ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm

@@ -53,7 +53,8 @@ public class ${ClassName}ServiceImpl extends ServiceImpl<${ClassName}Mapper, ${C
 #end
 #end
         lqw.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName());
         lqw.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName());
 #else
 #else
-        lqw.apply(bo.getParams().get("dataScope") != null,bo.getParams().get("dataScope").toString());
+        Object dataScope = bo.getParams().get("dataScope");
+        lqw.apply(dataScope != null, dataScope != null ? dataScope.toString() : null);
         Map<String, Object> params = bo.getParams();
         Map<String, Object> params = bo.getParams();
         if (params.get("begin$AttrName") != null && params.get("end$AttrName") != null) {
         if (params.get("begin$AttrName") != null && params.get("end$AttrName") != null) {
             lqw.between(${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName"));
             lqw.between(${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName"));