Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Ray Wang 2018-11-23 14:07:32 +08:00
commit aa0e776cb4
2 changed files with 18 additions and 11 deletions

View File

@ -20,7 +20,7 @@ import com.ruoyi.generator.domain.TableInfo;
public class GenUtils
{
/** 项目空间路径 */
private static final String PROJECT_PATH = "main/java/com/ruoyi";
private static final String PROJECT_PATH = getProjectPath();
/** mybatis空间路径 */
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 javaPath = PROJECT_PATH + "/" + moduleName + "/";
String javaPath = PROJECT_PATH;
String mybatisPath = MYBATIS_PATH + "/" + moduleName + "/" + className;
String htmlPath = TEMPLATES_PATH + "/" + moduleName + "/" + classname;
@ -145,7 +145,7 @@ public class GenUtils
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"))
@ -198,6 +198,16 @@ public class GenUtils
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)
{
String keyName = keyword.replaceAll("(?:表|信息)", "");
@ -227,11 +237,4 @@ public class GenUtils
javaTypeMap.put("datetime", "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"));
}
}

View File

@ -70,6 +70,11 @@
var editFlag = [[${@permission.hasPermi('${moduleName}:${classname}:edit')}]];
var removeFlag = [[${@permission.hasPermi('${moduleName}:${classname}:remove')}]];
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() {
var options = {
@ -98,7 +103,6 @@
title : '${column.columnComment}',
sortable: true,
formatter: function(value, row, index) {
var datas = [[${@dict.getType('${column.configInfo.value}')}]];
return $.table.selectDictLabel(datas, value);
}
},