Переглянути джерело

修复树表代码生成短字段无法识别问题

RuoYi 3 роки тому
батько
коміт
db83718aa6

+ 12 - 0
ruoyi-generator/src/main/resources/vm/java/serviceImpl.java.vm

@@ -157,9 +157,21 @@ public class ${ClassName}ServiceImpl implements I${ClassName}Service
         for (${ClassName} ${className} : ${className}List)
         {
             Ztree ztree = new Ztree();
+#if($treeCode.length() > 2 && $treeCode.substring(1,2).matches("[A-Z]"))
+#set($TreeCode=$treeCode)
+#else
 #set($TreeCode=$treeCode.substring(0,1).toUpperCase() + ${treeCode.substring(1)})
+#end
+#if($treeParentCode.length() > 2 && $treeParentCode.substring(1,2).matches("[A-Z]"))
+#set($TreeParentCode=$treeParentCode)
+#else
 #set($TreeParentCode=$treeParentCode.substring(0,1).toUpperCase() + ${treeParentCode.substring(1)})
+#end
+#if($treeName.length() > 2 && $treeName.substring(1,2).matches("[A-Z]"))
+#set($TreeName=$treeName)
+#else
 #set($TreeName=$treeName.substring(0,1).toUpperCase() + ${treeName.substring(1)})
+#end
             ztree.setId(${className}.get${TreeCode}());
             ztree.setpId(${className}.get${TreeParentCode}());
             ztree.setName(${className}.get${TreeName}());