mirror of https://gitee.com/makejava/EasyCode.git
优化网友提供的去表前缀PR
This commit is contained in:
parent
541414a951
commit
415edcdaa3
|
@ -118,8 +118,9 @@ public class CodeGenerateServiceImpl implements CodeGenerateService {
|
|||
// 生成代码
|
||||
for (TableInfo tableInfo : tableInfoList) {
|
||||
// 表名去除前缀
|
||||
if (tableInfo.getName().startsWith(tableInfo.getPreName())) {
|
||||
tableInfo.setName(tableInfo.getName().replace(tableInfo.getPreName(), ""));
|
||||
if (tableInfo.getObj().getName().startsWith(tableInfo.getPreName())) {
|
||||
String newName = tableInfo.getObj().getName().replace(tableInfo.getPreName(), "");
|
||||
tableInfo.setName(NameUtils.getInstance().getClassName(newName));
|
||||
}
|
||||
// 构建参数
|
||||
Map<String, Object> param = getDefaultParam();
|
||||
|
|
|
@ -211,7 +211,7 @@ public class SelectSavePath extends JDialog {
|
|||
TableInfo tableInfo = tableInfoService.getTableInfoAndConfig(cacheDataUtils.getSelectDbTable());
|
||||
tableInfo.setSavePath(savePath);
|
||||
tableInfo.setSavePackageName(packageField.getText());
|
||||
tableInfo.setPreName(NameUtils.getInstance().firstUpperCase(preField.getText()));
|
||||
tableInfo.setPreName(preField.getText());
|
||||
Module module = getSelectModule();
|
||||
if (module != null) {
|
||||
tableInfo.setSaveModelName(module.getName());
|
||||
|
@ -328,6 +328,9 @@ public class SelectSavePath extends JDialog {
|
|||
if (!StringUtils.isEmpty(tableInfo.getSavePackageName())) {
|
||||
packageField.setText(tableInfo.getSavePackageName());
|
||||
}
|
||||
if (!StringUtils.isEmpty(tableInfo.getPreName())) {
|
||||
preField.setText(tableInfo.getPreName());
|
||||
}
|
||||
String savePath = tableInfo.getSavePath();
|
||||
if (!StringUtils.isEmpty(savePath)) {
|
||||
// 判断是否需要拼接项目路径
|
||||
|
|
Loading…
Reference in New Issue