Ver Fonte

fix 数据权限语句null bug

疯狂的狮子li há 4 anos atrás
pai
commit
dfcd84c2bc

+ 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
         lqw.$mpMethod($condition, ${ClassName}::get$AttrName, bo.get$AttrName());
 #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();
         if (params.get("begin$AttrName") != null && params.get("end$AttrName") != null) {
             lqw.between(${ClassName}::get$AttrName ,params.get("begin$AttrName"), params.get("end$AttrName"));