Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
aa0e776cb4
|
|
@ -20,7 +20,7 @@ import com.ruoyi.generator.domain.TableInfo;
|
||||||
public class GenUtils
|
public class GenUtils
|
||||||
{
|
{
|
||||||
/** 项目空间路径 */
|
/** 项目空间路径 */
|
||||||
private static final String PROJECT_PATH = "main/java/com/ruoyi";
|
private static final String PROJECT_PATH = getProjectPath();
|
||||||
|
|
||||||
/** mybatis空间路径 */
|
/** mybatis空间路径 */
|
||||||
private static final String MYBATIS_PATH = "main/resources/mapper";
|
private static final String MYBATIS_PATH = "main/resources/mapper";
|
||||||
|
|
@ -124,7 +124,7 @@ public class GenUtils
|
||||||
String classname = table.getClassname();
|
String classname = table.getClassname();
|
||||||
// 大写类名
|
// 大写类名
|
||||||
String className = table.getClassName();
|
String className = table.getClassName();
|
||||||
String javaPath = PROJECT_PATH + "/" + moduleName + "/";
|
String javaPath = PROJECT_PATH;
|
||||||
String mybatisPath = MYBATIS_PATH + "/" + moduleName + "/" + className;
|
String mybatisPath = MYBATIS_PATH + "/" + moduleName + "/" + className;
|
||||||
String htmlPath = TEMPLATES_PATH + "/" + moduleName + "/" + classname;
|
String htmlPath = TEMPLATES_PATH + "/" + moduleName + "/" + classname;
|
||||||
|
|
||||||
|
|
@ -145,7 +145,7 @@ public class GenUtils
|
||||||
|
|
||||||
if (template.contains("ServiceImpl.java.vm"))
|
if (template.contains("ServiceImpl.java.vm"))
|
||||||
{
|
{
|
||||||
return javaPath + "service" + "/" + "/impl/" + className + "ServiceImpl.java";
|
return javaPath + "service" + "/impl/" + className + "ServiceImpl.java";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (template.contains("Controller.java.vm"))
|
if (template.contains("Controller.java.vm"))
|
||||||
|
|
@ -198,6 +198,16 @@ public class GenUtils
|
||||||
return basePackage;
|
return basePackage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String getProjectPath()
|
||||||
|
{
|
||||||
|
String packageName = Global.getPackageName();
|
||||||
|
StringBuffer projectPath = new StringBuffer();
|
||||||
|
projectPath.append("main/java/");
|
||||||
|
projectPath.append(packageName.replace(".", "/"));
|
||||||
|
projectPath.append("/");
|
||||||
|
return projectPath.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public static String replaceKeyword(String keyword)
|
public static String replaceKeyword(String keyword)
|
||||||
{
|
{
|
||||||
String keyName = keyword.replaceAll("(?:表|信息)", "");
|
String keyName = keyword.replaceAll("(?:表|信息)", "");
|
||||||
|
|
@ -227,11 +237,4 @@ public class GenUtils
|
||||||
javaTypeMap.put("datetime", "Date");
|
javaTypeMap.put("datetime", "Date");
|
||||||
javaTypeMap.put("timestamp", "Date");
|
javaTypeMap.put("timestamp", "Date");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args)
|
|
||||||
{
|
|
||||||
System.out.println(StringUtils.convertToCamelCase("user_name"));
|
|
||||||
System.out.println(replaceKeyword("岗位信息表"));
|
|
||||||
System.out.println(getBasePackage("com.ruoyi.system"));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,6 +70,11 @@
|
||||||
var editFlag = [[${@permission.hasPermi('${moduleName}:${classname}:edit')}]];
|
var editFlag = [[${@permission.hasPermi('${moduleName}:${classname}:edit')}]];
|
||||||
var removeFlag = [[${@permission.hasPermi('${moduleName}:${classname}:remove')}]];
|
var removeFlag = [[${@permission.hasPermi('${moduleName}:${classname}:remove')}]];
|
||||||
var prefix = ctx + "${moduleName}/${classname}";
|
var prefix = ctx + "${moduleName}/${classname}";
|
||||||
|
#foreach($column in $columns)
|
||||||
|
#if(${column.configInfo} && ${column.configInfo.type} == 'dict')
|
||||||
|
var datas = [[${@dict.getType('${column.configInfo.value}')}]];
|
||||||
|
#end
|
||||||
|
#end
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
var options = {
|
var options = {
|
||||||
|
|
@ -98,7 +103,6 @@
|
||||||
title : '${column.columnComment}',
|
title : '${column.columnComment}',
|
||||||
sortable: true,
|
sortable: true,
|
||||||
formatter: function(value, row, index) {
|
formatter: function(value, row, index) {
|
||||||
var datas = [[${@dict.getType('${column.configInfo.value}')}]];
|
|
||||||
return $.table.selectDictLabel(datas, value);
|
return $.table.selectDictLabel(datas, value);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue