【添加】config修复完毕
This commit is contained in:
+6
-6
@@ -42,7 +42,7 @@ import com.jero.common.util.BrowserUtils;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import com.jero.common.util.TokenUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.online.cgform.a.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.link.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.converter.ConvertUtil;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformEnhanceJs;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
@@ -60,7 +60,7 @@ import org.jeecg.modules.online.cgform.util.CgFormExcelHandler;
|
||||
import org.jeecg.modules.online.cgform.util.CgformUtil;
|
||||
import org.jeecg.modules.online.cgform.util.EnhanceJsUtil;
|
||||
import org.jeecg.modules.online.cgform.util.GenerateCodeFileToZip;
|
||||
import org.jeecg.modules.online.config.b.d;
|
||||
import org.jeecg.modules.online.config.util.DbTableUtil;
|
||||
import org.jeecg.modules.online.config.exception.BusinessException;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.jeecgframework.poi.excel.ExcelExportUtil;
|
||||
@@ -115,7 +115,7 @@ public class OnlCgformApiController {
|
||||
public Result<?> a(@RequestBody OnlCgformModel var1) {
|
||||
try {
|
||||
String var2 = var1.getHead().getTableName();
|
||||
return d.a(var2) ? Result.error("数据库表[" + var2 + "]已存在,请从数据库导入表单") : this.onlCgformHeadService.addAll(var1);
|
||||
return DbTableUtil.a(var2) ? Result.error("数据库表[" + var2 + "]已存在,请从数据库导入表单") : this.onlCgformHeadService.addAll(var1);
|
||||
} catch (Exception var3) {
|
||||
a.error("OnlCgformApiController.addAll()发生异常:" + var3.getMessage(), var3);
|
||||
return Result.error("操作失败");
|
||||
@@ -661,7 +661,7 @@ public class OnlCgformApiController {
|
||||
MultipartHttpServletRequest var49 = (MultipartHttpServletRequest)var2;
|
||||
Map var50 = var49.getFileMap();
|
||||
DataSource var51 = (DataSource)SpringContextUtils.getApplicationContext().getBean(DataSource.class);
|
||||
String var52 = d.a(var51);
|
||||
String var52 = DbTableUtil.a(var51);
|
||||
Iterator var53 = var50.entrySet().iterator();
|
||||
|
||||
while(true) {
|
||||
@@ -980,7 +980,7 @@ public class OnlCgformApiController {
|
||||
public Result<?> i(@RequestParam("tbname") String var1, @RequestParam("id") String var2) {
|
||||
OnlCgformHead var3;
|
||||
if (oConvertUtils.isEmpty(var2)) {
|
||||
if (d.a(var1)) {
|
||||
if (DbTableUtil.a(var1)) {
|
||||
return Result.OK(-1);
|
||||
}
|
||||
|
||||
@@ -990,7 +990,7 @@ public class OnlCgformApiController {
|
||||
}
|
||||
} else {
|
||||
var3 = (OnlCgformHead)this.onlCgformHeadService.getById(var2);
|
||||
if (!var1.equals(var3.getTableName()) && d.a(var1)) {
|
||||
if (!var1.equals(var3.getTableName()) && DbTableUtil.a(var1)) {
|
||||
return Result.OK(-1);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.jeecg.modules.online.cgform.a.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.link.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.converter.convert.ConfigConvert;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package org.jeecg.modules.online.cgform.a;
|
||||
package org.jeecg.modules.online.cgform.link;
|
||||
|
||||
public class LinkDown {
|
||||
private String a;
|
||||
+1
-1
@@ -7,7 +7,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.online.cgform.a.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.link.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
import org.jeecg.modules.online.cgform.model.TreeModel;
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.jeecg.modules.online.cgform.a.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.link.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformHead;
|
||||
import org.jeecg.modules.online.cgform.model.TreeModel;
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ import org.apache.shiro.SecurityUtils;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.online.cgform.a.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.link.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformHead;
|
||||
import org.jeecg.modules.online.cgform.mapper.OnlCgformFieldMapper;
|
||||
|
||||
+14
-13
@@ -51,9 +51,10 @@ import org.jeecg.modules.online.cgform.service.IOnlCgformFieldService;
|
||||
import org.jeecg.modules.online.cgform.service.IOnlCgformHeadService;
|
||||
import org.jeecg.modules.online.cgform.service.IOnlCgformIndexService;
|
||||
import org.jeecg.modules.online.cgform.util.CgformUtil;
|
||||
import org.jeecg.modules.online.config.a.b;
|
||||
import org.jeecg.modules.online.config.b.c;
|
||||
import org.jeecg.modules.online.config.b.d;
|
||||
import org.jeecg.modules.online.config.config.CgformConfigModel;
|
||||
import org.jeecg.modules.online.config.config.DataBaseConfig;
|
||||
import org.jeecg.modules.online.config.util.DbTableProcess;
|
||||
import org.jeecg.modules.online.config.util.DbTableUtil;
|
||||
import org.jeecg.modules.online.config.exception.BusinessException;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
@@ -89,7 +90,7 @@ public class OnlCgformHeadServiceImpl extends ServiceImpl<OnlCgformHeadMapper, O
|
||||
@Autowired
|
||||
private OnlCgformEnhanceSqlMapper onlCgformEnhanceSqlMapper;
|
||||
@Autowired
|
||||
private b dataBaseConfig;
|
||||
private DataBaseConfig dataBaseConfig;
|
||||
@Autowired
|
||||
private IOnlAuthPageService onlAuthPageService;
|
||||
|
||||
@@ -284,7 +285,7 @@ public class OnlCgformHeadServiceImpl extends ServiceImpl<OnlCgformHeadMapper, O
|
||||
var5.eq(OnlCgformField::getCgformHeadId, code);
|
||||
var5.orderByAsc(OnlCgformField::getOrderNum);
|
||||
List var6 = this.fieldService.list(var5);
|
||||
org.jeecg.modules.online.config.a.a var7 = new org.jeecg.modules.online.config.a.a();
|
||||
CgformConfigModel var7 = new CgformConfigModel();
|
||||
var7.setTableName(var4);
|
||||
var7.setJformPkType(var3.getIdType());
|
||||
var7.setJformPkSequence(var3.getIdSequence());
|
||||
@@ -293,10 +294,10 @@ public class OnlCgformHeadServiceImpl extends ServiceImpl<OnlCgformHeadMapper, O
|
||||
var7.setDbConfig(this.dataBaseConfig);
|
||||
if ("normal".equals(synMethod)) {
|
||||
long var8 = System.currentTimeMillis();
|
||||
boolean var10 = d.a(var4);
|
||||
boolean var10 = DbTableUtil.a(var4);
|
||||
a.info("==判断表是否存在消耗时间" + (System.currentTimeMillis() - var8) + "毫秒");
|
||||
if (var10) {
|
||||
c var11 = new c();
|
||||
DbTableProcess var11 = new DbTableProcess();
|
||||
List var12 = var11.b(var7);
|
||||
Iterator var13 = var12.iterator();
|
||||
|
||||
@@ -339,16 +340,16 @@ public class OnlCgformHeadServiceImpl extends ServiceImpl<OnlCgformHeadMapper, O
|
||||
}
|
||||
}
|
||||
} else {
|
||||
c.a(var7);
|
||||
DbTableProcess.a(var7);
|
||||
}
|
||||
} else if ("force".equals(synMethod)) {
|
||||
DbTableHandleI var20 = d.getTableHandle();
|
||||
DbTableHandleI var20 = DbTableUtil.getTableHandle();
|
||||
String var9 = var20.dropTableSQL(var4);
|
||||
((OnlCgformHeadMapper)this.baseMapper).executeDDL(var9);
|
||||
c.a(var7);
|
||||
DbTableProcess.a(var7);
|
||||
}
|
||||
|
||||
this.indexService.createIndex(code, d.getDatabaseType(), var4);
|
||||
this.indexService.createIndex(code, DbTableUtil.getDatabaseType(), var4);
|
||||
var3.setIsDbSynch("Y");
|
||||
if (var3.getTableVersion() == 1) {
|
||||
var3.setTableVersion(2);
|
||||
@@ -364,10 +365,10 @@ public class OnlCgformHeadServiceImpl extends ServiceImpl<OnlCgformHeadMapper, O
|
||||
throw new DBException("实体配置不存在");
|
||||
} else {
|
||||
long var3 = System.currentTimeMillis();
|
||||
boolean var5 = d.a(var2.getTableName());
|
||||
boolean var5 = DbTableUtil.a(var2.getTableName());
|
||||
a.info("==判断表是否存在消耗时间 " + (System.currentTimeMillis() - var3) + "毫秒");
|
||||
if (var5) {
|
||||
String var6 = d.getTableHandle().dropTableSQL(var2.getTableName());
|
||||
String var6 = DbTableUtil.getTableHandle().dropTableSQL(var2.getTableName());
|
||||
a.info(" 删除表 executeDDL: " + var6);
|
||||
((OnlCgformHeadMapper)this.baseMapper).executeDDL(var6);
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ import org.apache.shiro.SecurityUtils;
|
||||
import com.jero.common.system.api.ISysBaseAPI;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.online.cgform.a.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.link.LinkDown;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformButton;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformEnhanceJs;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
|
||||
+8
-7
@@ -64,6 +64,7 @@ import org.jeecg.modules.online.cgform.enums.CgformValidPatternEnum;
|
||||
import org.jeecg.modules.online.cgform.mapper.OnlCgformHeadMapper;
|
||||
import org.jeecg.modules.online.cgform.model.TreeSelectColumn;
|
||||
import org.jeecg.modules.online.cgform.service.IOnlCgformFieldService;
|
||||
import org.jeecg.modules.online.config.util.DbTableUtil;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.jeecgframework.poi.excel.entity.params.ExcelExportEntity;
|
||||
import org.slf4j.Logger;
|
||||
@@ -213,7 +214,7 @@ public class CgformUtil {
|
||||
String var5 = "";
|
||||
|
||||
try {
|
||||
var5 = org.jeecg.modules.online.config.b.d.getDatabaseType();
|
||||
var5 = DbTableUtil.getDatabaseType();
|
||||
} catch (SQLException var15) {
|
||||
var15.printStackTrace();
|
||||
} catch (DBException var16) {
|
||||
@@ -776,7 +777,7 @@ public class CgformUtil {
|
||||
String var5 = "";
|
||||
|
||||
try {
|
||||
var5 = org.jeecg.modules.online.config.b.d.getDatabaseType();
|
||||
var5 = DbTableUtil.getDatabaseType();
|
||||
} catch (SQLException var15) {
|
||||
var15.printStackTrace();
|
||||
} catch (DBException var16) {
|
||||
@@ -859,7 +860,7 @@ public class CgformUtil {
|
||||
String var5 = "";
|
||||
|
||||
try {
|
||||
var5 = org.jeecg.modules.online.config.b.d.getDatabaseType();
|
||||
var5 = DbTableUtil.getDatabaseType();
|
||||
} catch (SQLException var12) {
|
||||
var12.printStackTrace();
|
||||
} catch (DBException var13) {
|
||||
@@ -1613,7 +1614,7 @@ public class CgformUtil {
|
||||
}
|
||||
|
||||
public static JSONObject a(JSONObject var0) {
|
||||
if (!org.jeecg.modules.online.config.b.d.a()) {
|
||||
if (!DbTableUtil.a()) {
|
||||
return var0;
|
||||
} else {
|
||||
JSONObject var1 = new JSONObject();
|
||||
@@ -1702,7 +1703,7 @@ public class CgformUtil {
|
||||
String var5 = "";
|
||||
|
||||
try {
|
||||
var5 = org.jeecg.modules.online.config.b.d.getDatabaseType();
|
||||
var5 = DbTableUtil.getDatabaseType();
|
||||
} catch (SQLException var14) {
|
||||
var14.printStackTrace();
|
||||
} catch (DBException var15) {
|
||||
@@ -1763,7 +1764,7 @@ public class CgformUtil {
|
||||
String var5 = "";
|
||||
|
||||
try {
|
||||
var5 = org.jeecg.modules.online.config.b.d.getDatabaseType();
|
||||
var5 = DbTableUtil.getDatabaseType();
|
||||
} catch (SQLException var11) {
|
||||
var11.printStackTrace();
|
||||
} catch (DBException var12) {
|
||||
@@ -1958,7 +1959,7 @@ public class CgformUtil {
|
||||
return ay;
|
||||
} else {
|
||||
try {
|
||||
ay = org.jeecg.modules.online.config.b.d.getDatabaseType();
|
||||
ay = DbTableUtil.getDatabaseType();
|
||||
return ay;
|
||||
} catch (Exception var1) {
|
||||
var1.printStackTrace();
|
||||
|
||||
+4
-4
@@ -38,7 +38,7 @@ import org.jeecg.modules.online.cgreport.service.IOnlCgreportItemService;
|
||||
import org.jeecg.modules.online.cgreport.service.IOnlCgreportParamService;
|
||||
import org.jeecg.modules.online.cgreport.util.CgReportQueryParamUtil;
|
||||
import org.jeecg.modules.online.cgreport.util.SqlUtil;
|
||||
import org.jeecg.modules.online.config.b.d;
|
||||
import org.jeecg.modules.online.config.util.DbTableUtil;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -65,7 +65,7 @@ public class OnlCgreportHeadServiceImpl extends ServiceImpl<OnlCgreportHeadMappe
|
||||
String var4 = null;
|
||||
|
||||
try {
|
||||
var4 = d.getDatabaseType();
|
||||
var4 = DbTableUtil.getDatabaseType();
|
||||
} catch (DBException var19) {
|
||||
var19.printStackTrace();
|
||||
}
|
||||
@@ -341,7 +341,7 @@ public class OnlCgreportHeadServiceImpl extends ServiceImpl<OnlCgreportHeadMappe
|
||||
String var8 = null;
|
||||
|
||||
try {
|
||||
var8 = d.getDatabaseType();
|
||||
var8 = DbTableUtil.getDatabaseType();
|
||||
} catch (DBException var7) {
|
||||
var7.printStackTrace();
|
||||
}
|
||||
@@ -372,7 +372,7 @@ public class OnlCgreportHeadServiceImpl extends ServiceImpl<OnlCgreportHeadMappe
|
||||
Map var3 = this.mapper.queryCgReportMainConfig(reportId);
|
||||
List var4 = this.mapper.queryCgReportItems(reportId);
|
||||
List var5 = this.mapper.queryCgReportParams(reportId);
|
||||
if (d.a()) {
|
||||
if (DbTableUtil.a()) {
|
||||
var2.put("main", CgformUtil.b(var3));
|
||||
var2.put("items", CgformUtil.d(var4));
|
||||
} else {
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ import com.jero.common.util.DateUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.online.cgform.util.CgformUtil;
|
||||
import org.jeecg.modules.online.cgreport.entity.OnlCgreportItem;
|
||||
import org.jeecg.modules.online.config.b.d;
|
||||
import org.jeecg.modules.online.config.util.DbTableUtil;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@@ -182,7 +182,7 @@ public class CgReportQueryParamUtil {
|
||||
String var5 = var3;
|
||||
if (var3 == null) {
|
||||
try {
|
||||
var5 = d.getDatabaseType();
|
||||
var5 = DbTableUtil.getDatabaseType();
|
||||
} catch (SQLException var14) {
|
||||
var14.printStackTrace();
|
||||
} catch (DBException var15) {
|
||||
|
||||
+6
-6
@@ -1,11 +1,11 @@
|
||||
|
||||
package org.jeecg.modules.online.config.a;
|
||||
package org.jeecg.modules.online.config.config;
|
||||
|
||||
import java.util.List;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformIndex;
|
||||
|
||||
public class a {
|
||||
public class CgformConfigModel {
|
||||
private String a;
|
||||
private String b;
|
||||
private String c;
|
||||
@@ -21,9 +21,9 @@ public class a {
|
||||
private String m;
|
||||
private String n;
|
||||
private String o;
|
||||
private b p;
|
||||
private DataBaseConfig p;
|
||||
|
||||
public a() {
|
||||
public CgformConfigModel() {
|
||||
}
|
||||
|
||||
public String getTableName() {
|
||||
@@ -146,11 +146,11 @@ public class a {
|
||||
this.o = treeFieldname;
|
||||
}
|
||||
|
||||
public b getDbConfig() {
|
||||
public DataBaseConfig getDbConfig() {
|
||||
return this.p;
|
||||
}
|
||||
|
||||
public void setDbConfig(b dbConfig) {
|
||||
public void setDbConfig(DataBaseConfig dbConfig) {
|
||||
this.p = dbConfig;
|
||||
}
|
||||
}
|
||||
+7
-7
@@ -1,5 +1,5 @@
|
||||
|
||||
package org.jeecg.modules.online.config.a;
|
||||
package org.jeecg.modules.online.config.config;
|
||||
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -10,23 +10,23 @@ import org.springframework.stereotype.Component;
|
||||
@ConfigurationProperties(
|
||||
prefix = "spring.datasource.dynamic.datasource.master"
|
||||
)
|
||||
public class b {
|
||||
public class DataBaseConfig {
|
||||
@Autowired
|
||||
private c dmDataBaseConfig;
|
||||
private DmDataBaseConfig dmDataBaseConfig;
|
||||
private String a;
|
||||
private String b;
|
||||
private String c;
|
||||
private String d;
|
||||
private d e;
|
||||
private Druid e;
|
||||
|
||||
public b() {
|
||||
public DataBaseConfig() {
|
||||
}
|
||||
|
||||
public d getDruid() {
|
||||
public Druid getDruid() {
|
||||
return this.e == null ? this.dmDataBaseConfig.getDruid() : this.e;
|
||||
}
|
||||
|
||||
public void setDruid(d druid) {
|
||||
public void setDruid(Druid druid) {
|
||||
this.e = druid;
|
||||
}
|
||||
|
||||
+6
-6
@@ -1,5 +1,5 @@
|
||||
|
||||
package org.jeecg.modules.online.config.a;
|
||||
package org.jeecg.modules.online.config.config;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -8,21 +8,21 @@ import org.springframework.stereotype.Component;
|
||||
@ConfigurationProperties(
|
||||
prefix = "spring.datasource.druid"
|
||||
)
|
||||
public class c {
|
||||
public class DmDataBaseConfig {
|
||||
private String a;
|
||||
private String b;
|
||||
private String c;
|
||||
private String d;
|
||||
private d e;
|
||||
private Druid e;
|
||||
|
||||
public c() {
|
||||
public DmDataBaseConfig() {
|
||||
}
|
||||
|
||||
public d getDruid() {
|
||||
public Druid getDruid() {
|
||||
return this.e;
|
||||
}
|
||||
|
||||
public void setDruid(d druid) {
|
||||
public void setDruid(Druid druid) {
|
||||
this.e = druid;
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
|
||||
package org.jeecg.modules.online.config.a;
|
||||
package org.jeecg.modules.online.config.config;
|
||||
|
||||
public class d {
|
||||
public class Druid {
|
||||
private String a;
|
||||
|
||||
public d() {
|
||||
public Druid() {
|
||||
}
|
||||
|
||||
public String getPublicKey() {
|
||||
+6
-6
@@ -1,15 +1,15 @@
|
||||
|
||||
package org.jeecg.modules.online.config.service;
|
||||
|
||||
import org.jeecg.modules.online.config.b.a;
|
||||
import org.jeecg.modules.online.config.util.ColumnMeta;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
|
||||
public interface DbTableHandleI {
|
||||
String getAddColumnSql(a var1);
|
||||
String getAddColumnSql(ColumnMeta var1);
|
||||
|
||||
String getReNameFieldName(a var1);
|
||||
String getReNameFieldName(ColumnMeta var1);
|
||||
|
||||
String getUpdateColumnSql(a var1, a var2) throws DBException;
|
||||
String getUpdateColumnSql(ColumnMeta var1, ColumnMeta var2) throws DBException;
|
||||
|
||||
String getMatchClassTypeByDataType(String var1, int var2);
|
||||
|
||||
@@ -17,9 +17,9 @@ public interface DbTableHandleI {
|
||||
|
||||
String getDropColumnSql(String var1);
|
||||
|
||||
String getCommentSql(a var1);
|
||||
String getCommentSql(ColumnMeta var1);
|
||||
|
||||
String getSpecialHandle(a var1, a var2);
|
||||
String getSpecialHandle(ColumnMeta var1, ColumnMeta var2);
|
||||
|
||||
String dropIndexs(String var1, String var2);
|
||||
|
||||
|
||||
+10
-10
@@ -2,22 +2,22 @@
|
||||
package org.jeecg.modules.online.config.service.a;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.modules.online.config.b.a;
|
||||
import org.jeecg.modules.online.config.util.ColumnMeta;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
|
||||
public class c implements DbTableHandleI {
|
||||
public c() {
|
||||
public class DbTableDmHandleImpl implements DbTableHandleI {
|
||||
public DbTableDmHandleImpl() {
|
||||
}
|
||||
|
||||
public String getAddColumnSql(a columnMeta) {
|
||||
public String getAddColumnSql(ColumnMeta columnMeta) {
|
||||
return " ADD " + this.a(columnMeta) + "";
|
||||
}
|
||||
|
||||
public String getReNameFieldName(a columnMeta) {
|
||||
public String getReNameFieldName(ColumnMeta columnMeta) {
|
||||
return "RENAME COLUMN " + columnMeta.getOldColumnName() + " TO " + columnMeta.getColumnName() + "";
|
||||
}
|
||||
|
||||
public String getUpdateColumnSql(a cgformcolumnMeta, a datacolumnMeta) {
|
||||
public String getUpdateColumnSql(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return " MODIFY " + this.a(cgformcolumnMeta, datacolumnMeta) + "";
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class c implements DbTableHandleI {
|
||||
return " DROP COLUMN " + fieldName.toUpperCase() + "";
|
||||
}
|
||||
|
||||
private String a(a var1) {
|
||||
private String a(ColumnMeta var1) {
|
||||
String var2 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var2 = var1.getColumnName() + " varchar2(" + var1.getColumnSize() + ")";
|
||||
@@ -81,7 +81,7 @@ public class c implements DbTableHandleI {
|
||||
return var2;
|
||||
}
|
||||
|
||||
private String a(a var1, a var2) {
|
||||
private String a(ColumnMeta var1, ColumnMeta var2) {
|
||||
String var3 = "";
|
||||
String var4 = "";
|
||||
if (!var2.getIsNullable().equals(var1.getIsNullable())) {
|
||||
@@ -109,11 +109,11 @@ public class c implements DbTableHandleI {
|
||||
return var3;
|
||||
}
|
||||
|
||||
public String getCommentSql(a columnMeta) {
|
||||
public String getCommentSql(ColumnMeta columnMeta) {
|
||||
return "COMMENT ON COLUMN " + columnMeta.getTableName() + "." + columnMeta.getColumnName() + " IS '" + columnMeta.getComment() + "'";
|
||||
}
|
||||
|
||||
public String getSpecialHandle(a cgformcolumnMeta, a datacolumnMeta) {
|
||||
public String getSpecialHandle(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+14
-14
@@ -2,22 +2,22 @@
|
||||
package org.jeecg.modules.online.config.service.a;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.modules.online.config.b.a;
|
||||
import org.jeecg.modules.online.config.util.ColumnMeta;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
|
||||
public class b implements DbTableHandleI {
|
||||
public b() {
|
||||
public class DbTableMysqlHandleImpl implements DbTableHandleI {
|
||||
public DbTableMysqlHandleImpl() {
|
||||
}
|
||||
|
||||
public String getAddColumnSql(a columnMeta) {
|
||||
public String getAddColumnSql(ColumnMeta columnMeta) {
|
||||
return " ADD COLUMN " + this.a(columnMeta) + ";";
|
||||
}
|
||||
|
||||
public String getReNameFieldName(a columnMeta) {
|
||||
public String getReNameFieldName(ColumnMeta columnMeta) {
|
||||
return "CHANGE COLUMN " + columnMeta.getOldColumnName() + " " + this.b(columnMeta) + " ;";
|
||||
}
|
||||
|
||||
public String getUpdateColumnSql(a cgformcolumnMeta, a datacolumnMeta) {
|
||||
public String getUpdateColumnSql(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return " MODIFY COLUMN " + this.b(cgformcolumnMeta, datacolumnMeta) + ";";
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public class b implements DbTableHandleI {
|
||||
return " DROP COLUMN " + fieldName + ";";
|
||||
}
|
||||
|
||||
private String a(a var1, a var2) {
|
||||
private String a(ColumnMeta var1, ColumnMeta var2) {
|
||||
String var3 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var3 = var1.getColumnName() + " varchar(" + var1.getColumnSize() + ") " + ("Y".equals(var1.getIsNullable()) ? "NULL" : "NOT NULL");
|
||||
@@ -80,26 +80,26 @@ public class b implements DbTableHandleI {
|
||||
return var3;
|
||||
}
|
||||
|
||||
private String b(a var1, a var2) {
|
||||
private String b(ColumnMeta var1, ColumnMeta var2) {
|
||||
String var3 = this.a(var1, var2);
|
||||
return var3;
|
||||
}
|
||||
|
||||
private String a(a var1) {
|
||||
String var2 = this.a(var1, (a)null);
|
||||
private String a(ColumnMeta var1) {
|
||||
String var2 = this.a(var1, (ColumnMeta)null);
|
||||
return var2;
|
||||
}
|
||||
|
||||
private String b(a var1) {
|
||||
String var2 = this.a(var1, (a)null);
|
||||
private String b(ColumnMeta var1) {
|
||||
String var2 = this.a(var1, (ColumnMeta)null);
|
||||
return var2;
|
||||
}
|
||||
|
||||
public String getCommentSql(a columnMeta) {
|
||||
public String getCommentSql(ColumnMeta columnMeta) {
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getSpecialHandle(a cgformcolumnMeta, a datacolumnMeta) {
|
||||
public String getSpecialHandle(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+10
-9
@@ -2,21 +2,22 @@
|
||||
package org.jeecg.modules.online.config.service.a;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.modules.online.config.util.ColumnMeta;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
|
||||
public class a implements DbTableHandleI {
|
||||
public a() {
|
||||
public class DbTableOracleHandleImpl implements DbTableHandleI {
|
||||
public DbTableOracleHandleImpl() {
|
||||
}
|
||||
|
||||
public String getAddColumnSql(org.jeecg.modules.online.config.b.a columnMeta) {
|
||||
public String getAddColumnSql(ColumnMeta columnMeta) {
|
||||
return " ADD " + this.a(columnMeta) + "";
|
||||
}
|
||||
|
||||
public String getReNameFieldName(org.jeecg.modules.online.config.b.a columnMeta) {
|
||||
public String getReNameFieldName(ColumnMeta columnMeta) {
|
||||
return "RENAME COLUMN " + columnMeta.getOldColumnName() + " TO " + columnMeta.getColumnName() + "";
|
||||
}
|
||||
|
||||
public String getUpdateColumnSql(org.jeecg.modules.online.config.b.a cgformcolumnMeta, org.jeecg.modules.online.config.b.a datacolumnMeta) {
|
||||
public String getUpdateColumnSql(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return " MODIFY " + this.a(cgformcolumnMeta, datacolumnMeta) + "";
|
||||
}
|
||||
|
||||
@@ -57,7 +58,7 @@ public class a implements DbTableHandleI {
|
||||
return " DROP COLUMN " + fieldName.toUpperCase() + "";
|
||||
}
|
||||
|
||||
private String a(org.jeecg.modules.online.config.b.a var1) {
|
||||
private String a(ColumnMeta var1) {
|
||||
String var2 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var2 = var1.getColumnName() + " varchar2(" + var1.getColumnSize() + ")";
|
||||
@@ -80,7 +81,7 @@ public class a implements DbTableHandleI {
|
||||
return var2;
|
||||
}
|
||||
|
||||
private String a(org.jeecg.modules.online.config.b.a var1, org.jeecg.modules.online.config.b.a var2) {
|
||||
private String a(ColumnMeta var1, ColumnMeta var2) {
|
||||
String var3 = "";
|
||||
String var4 = "";
|
||||
if (!var2.getIsNullable().equals(var1.getIsNullable())) {
|
||||
@@ -108,11 +109,11 @@ public class a implements DbTableHandleI {
|
||||
return var3;
|
||||
}
|
||||
|
||||
public String getCommentSql(org.jeecg.modules.online.config.b.a columnMeta) {
|
||||
public String getCommentSql(ColumnMeta columnMeta) {
|
||||
return "COMMENT ON COLUMN " + columnMeta.getTableName() + "." + columnMeta.getColumnName() + " IS '" + columnMeta.getComment() + "'";
|
||||
}
|
||||
|
||||
public String getSpecialHandle(org.jeecg.modules.online.config.b.a cgformcolumnMeta, org.jeecg.modules.online.config.b.a datacolumnMeta) {
|
||||
public String getSpecialHandle(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+12
-12
@@ -2,27 +2,27 @@
|
||||
package org.jeecg.modules.online.config.service.a;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.modules.online.config.b.a;
|
||||
import org.jeecg.modules.online.config.util.ColumnMeta;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
|
||||
public class d implements DbTableHandleI {
|
||||
public d() {
|
||||
public class DbTablePostgresHandleImpl implements DbTableHandleI {
|
||||
public DbTablePostgresHandleImpl() {
|
||||
}
|
||||
|
||||
public String getAddColumnSql(a columnMeta) {
|
||||
public String getAddColumnSql(ColumnMeta columnMeta) {
|
||||
return " ADD COLUMN " + this.a(columnMeta) + ";";
|
||||
}
|
||||
|
||||
public String getReNameFieldName(a columnMeta) {
|
||||
public String getReNameFieldName(ColumnMeta columnMeta) {
|
||||
return " RENAME COLUMN " + columnMeta.getOldColumnName() + " to " + columnMeta.getColumnName() + ";";
|
||||
}
|
||||
|
||||
public String getUpdateColumnSql(a cgformcolumnMeta, a datacolumnMeta) throws DBException {
|
||||
public String getUpdateColumnSql(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) throws DBException {
|
||||
return " ALTER COLUMN " + this.a(cgformcolumnMeta, datacolumnMeta) + ";";
|
||||
}
|
||||
|
||||
public String getSpecialHandle(a cgformcolumnMeta, a datacolumnMeta) {
|
||||
public String getSpecialHandle(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return " ALTER COLUMN " + this.b(cgformcolumnMeta, datacolumnMeta) + ";";
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class d implements DbTableHandleI {
|
||||
return " DROP COLUMN " + fieldName + ";";
|
||||
}
|
||||
|
||||
private String a(a var1, a var2) throws DBException {
|
||||
private String a(ColumnMeta var1, ColumnMeta var2) throws DBException {
|
||||
String var3 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var3 = var1.getColumnName() + " type character varying(" + var1.getColumnSize() + ") ";
|
||||
@@ -80,7 +80,7 @@ public class d implements DbTableHandleI {
|
||||
return var3;
|
||||
}
|
||||
|
||||
private String b(a var1, a var2) {
|
||||
private String b(ColumnMeta var1, ColumnMeta var2) {
|
||||
String var3 = "";
|
||||
if (!var1.a(var2)) {
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
@@ -107,7 +107,7 @@ public class d implements DbTableHandleI {
|
||||
return var3;
|
||||
}
|
||||
|
||||
private String a(a var1) {
|
||||
private String a(ColumnMeta var1) {
|
||||
String var2 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var2 = var1.getColumnName() + " character varying(" + var1.getColumnSize() + ") ";
|
||||
@@ -129,7 +129,7 @@ public class d implements DbTableHandleI {
|
||||
return var2;
|
||||
}
|
||||
|
||||
private String b(a var1) {
|
||||
private String b(ColumnMeta var1) {
|
||||
String var2 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var2 = var1.getColumnName() + " character varying(" + var1.getColumnSize() + ") ";
|
||||
@@ -144,7 +144,7 @@ public class d implements DbTableHandleI {
|
||||
return var2;
|
||||
}
|
||||
|
||||
public String getCommentSql(a columnMeta) {
|
||||
public String getCommentSql(ColumnMeta columnMeta) {
|
||||
return "COMMENT ON COLUMN " + columnMeta.getTableName() + "." + columnMeta.getColumnName() + " IS '" + columnMeta.getComment() + "'";
|
||||
}
|
||||
|
||||
+11
-11
@@ -2,22 +2,22 @@
|
||||
package org.jeecg.modules.online.config.service.a;
|
||||
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.online.config.b.a;
|
||||
import org.jeecg.modules.online.config.util.ColumnMeta;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
|
||||
public class e implements DbTableHandleI {
|
||||
public e() {
|
||||
public class DbTableSQLServerHandleImpl implements DbTableHandleI {
|
||||
public DbTableSQLServerHandleImpl() {
|
||||
}
|
||||
|
||||
public String getAddColumnSql(a columnMeta) {
|
||||
public String getAddColumnSql(ColumnMeta columnMeta) {
|
||||
return " ADD " + this.a(columnMeta) + ";";
|
||||
}
|
||||
|
||||
public String getReNameFieldName(a columnMeta) {
|
||||
public String getReNameFieldName(ColumnMeta columnMeta) {
|
||||
return " sp_rename '" + columnMeta.getTableName() + "." + columnMeta.getOldColumnName() + "', '" + columnMeta.getColumnName() + "', 'COLUMN';";
|
||||
}
|
||||
|
||||
public String getUpdateColumnSql(a cgformcolumnMeta, a datacolumnMeta) {
|
||||
public String getUpdateColumnSql(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return " ALTER COLUMN " + this.a(cgformcolumnMeta, datacolumnMeta) + ";";
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class e implements DbTableHandleI {
|
||||
return " DROP COLUMN " + fieldName + ";";
|
||||
}
|
||||
|
||||
private String a(a var1, a var2) {
|
||||
private String a(ColumnMeta var1, ColumnMeta var2) {
|
||||
String var3 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var3 = var1.getColumnName() + " nvarchar(" + var1.getColumnSize() + ") " + ("Y".equals(var1.getIsNullable()) ? "NULL" : "NOT NULL");
|
||||
@@ -77,7 +77,7 @@ public class e implements DbTableHandleI {
|
||||
return var3;
|
||||
}
|
||||
|
||||
private String a(a var1) {
|
||||
private String a(ColumnMeta var1) {
|
||||
String var2 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var2 = var1.getColumnName() + " nvarchar(" + var1.getColumnSize() + ") " + ("Y".equals(var1.getIsNullable()) ? "NULL" : "NOT NULL");
|
||||
@@ -98,7 +98,7 @@ public class e implements DbTableHandleI {
|
||||
return var2;
|
||||
}
|
||||
|
||||
private String b(a var1) {
|
||||
private String b(ColumnMeta var1) {
|
||||
String var2 = "";
|
||||
if (var1.getColunmType().equalsIgnoreCase("string")) {
|
||||
var2 = var1.getColumnName() + " nvarchar(" + var1.getColumnSize() + ") " + ("Y".equals(var1.getIsNullable()) ? "NULL" : "NOT NULL");
|
||||
@@ -113,7 +113,7 @@ public class e implements DbTableHandleI {
|
||||
return var2;
|
||||
}
|
||||
|
||||
public String getCommentSql(a columnMeta) {
|
||||
public String getCommentSql(ColumnMeta columnMeta) {
|
||||
StringBuffer var2 = new StringBuffer("EXECUTE ");
|
||||
if (oConvertUtils.isEmpty(columnMeta.getOldColumnName())) {
|
||||
var2.append("sp_addextendedproperty");
|
||||
@@ -130,7 +130,7 @@ public class e implements DbTableHandleI {
|
||||
return var2.toString();
|
||||
}
|
||||
|
||||
public String getSpecialHandle(a cgformcolumnMeta, a datacolumnMeta) {
|
||||
public String getSpecialHandle(ColumnMeta cgformcolumnMeta, ColumnMeta datacolumnMeta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
+9
-9
@@ -1,9 +1,9 @@
|
||||
|
||||
package org.jeecg.modules.online.config.b;
|
||||
package org.jeecg.modules.online.config.util;
|
||||
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
|
||||
public class a {
|
||||
public class ColumnMeta {
|
||||
private String a;
|
||||
private String b;
|
||||
private String c;
|
||||
@@ -16,16 +16,16 @@ public class a {
|
||||
private String j;
|
||||
private String k;
|
||||
|
||||
public a() {
|
||||
public ColumnMeta() {
|
||||
}
|
||||
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == this) {
|
||||
return true;
|
||||
} else if (!(obj instanceof a)) {
|
||||
} else if (!(obj instanceof ColumnMeta)) {
|
||||
return false;
|
||||
} else {
|
||||
a var2 = (a)obj;
|
||||
ColumnMeta var2 = (ColumnMeta)obj;
|
||||
if (!this.e.contains("date") && !this.e.contains("blob") && !this.e.contains("text")) {
|
||||
return this.e.equals(var2.getColunmType()) && this.i.equals(var2.i) && this.d == var2.getColumnSize() && this.a(this.f, var2.getComment()) && this.a(this.g, var2.getFieldDefault());
|
||||
} else {
|
||||
@@ -37,10 +37,10 @@ public class a {
|
||||
public boolean a(Object var1, String var2) {
|
||||
if (var1 == this) {
|
||||
return true;
|
||||
} else if (!(var1 instanceof a)) {
|
||||
} else if (!(var1 instanceof ColumnMeta)) {
|
||||
return false;
|
||||
} else {
|
||||
a var3 = (a)var1;
|
||||
ColumnMeta var3 = (ColumnMeta)var1;
|
||||
if ("SQLSERVER".equals(var2)) {
|
||||
if (!this.e.contains("date") && !this.e.contains("blob") && !this.e.contains("text")) {
|
||||
return this.e.equals(var3.getColunmType()) && this.i.equals(var3.i) && this.d == var3.getColumnSize() && this.a(this.g, var3.getFieldDefault());
|
||||
@@ -67,11 +67,11 @@ public class a {
|
||||
}
|
||||
}
|
||||
|
||||
public boolean a(a var1) {
|
||||
public boolean a(ColumnMeta var1) {
|
||||
return var1 == this ? true : this.a(this.f, var1.getComment());
|
||||
}
|
||||
|
||||
public boolean b(a var1) {
|
||||
public boolean b(ColumnMeta var1) {
|
||||
return var1 == this ? true : this.a(this.f, var1.getComment());
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
|
||||
package org.jeecg.modules.online.config.b;
|
||||
package org.jeecg.modules.online.config.util;
|
||||
|
||||
public class b {
|
||||
public class DataBaseConst {
|
||||
public static final String a = "BigDecimal";
|
||||
public static final String b = "Blob";
|
||||
public static final String c = "Date";
|
||||
@@ -15,6 +15,6 @@ public class b {
|
||||
public static final String k = "textarea";
|
||||
public static final String l = "varchar";
|
||||
|
||||
public b() {
|
||||
public DataBaseConst() {
|
||||
}
|
||||
}
|
||||
+34
-34
@@ -1,5 +1,5 @@
|
||||
|
||||
package org.jeecg.modules.online.config.b;
|
||||
package org.jeecg.modules.online.config.util;
|
||||
|
||||
import com.alibaba.druid.filter.config.ConfigTools;
|
||||
import com.google.common.collect.Lists;
|
||||
@@ -30,24 +30,24 @@ import org.hibernate.tool.schema.TargetType;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
import org.jeecg.modules.online.config.a.a;
|
||||
import org.jeecg.modules.online.config.a.b;
|
||||
import org.jeecg.modules.online.config.config.CgformConfigModel;
|
||||
import org.jeecg.modules.online.config.config.DataBaseConfig;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class c {
|
||||
private static final Logger a = LoggerFactory.getLogger(c.class);
|
||||
public class DbTableProcess {
|
||||
private static final Logger a = LoggerFactory.getLogger(DbTableProcess.class);
|
||||
private static final String b = "org/jeecg/modules/online/config/engine/tableTemplate.ftl";
|
||||
private static DbTableHandleI c;
|
||||
|
||||
public c() throws SQLException, DBException {
|
||||
c = d.getTableHandle();
|
||||
public DbTableProcess() throws SQLException, DBException {
|
||||
c = DbTableUtil.getTableHandle();
|
||||
}
|
||||
|
||||
public static void a(a var0) throws IOException, TemplateException, HibernateException, SQLException, DBException {
|
||||
String var1 = d.getDatabaseType();
|
||||
public static void a(CgformConfigModel var0) throws IOException, TemplateException, HibernateException, SQLException, DBException {
|
||||
String var1 = DbTableUtil.getDatabaseType();
|
||||
if ("ORACLE".equals(var1)) {
|
||||
ArrayList var2 = Lists.newArrayList();
|
||||
|
||||
@@ -63,10 +63,10 @@ public class c {
|
||||
var0.setColumns(var2);
|
||||
}
|
||||
|
||||
String var15 = g.a("org/jeecg/modules/online/config/engine/tableTemplate.ftl", a(var0, var1));
|
||||
String var15 = FreemarkerHelper.a("org/jeecg/modules/online/config/engine/tableTemplate.ftl", a(var0, var1));
|
||||
a.info(var15);
|
||||
HashMap var16 = new HashMap();
|
||||
b var17 = var0.getDbConfig();
|
||||
DataBaseConfig var17 = var0.getDbConfig();
|
||||
var16.put("hibernate.connection.driver_class", var17.getDriverClassName());
|
||||
var16.put("hibernate.connection.url", var17.getUrl());
|
||||
var16.put("hibernate.connection.username", var17.getUsername());
|
||||
@@ -87,7 +87,7 @@ public class c {
|
||||
var16.put("hibernate.show_sql", true);
|
||||
var16.put("hibernate.format_sql", true);
|
||||
var16.put("hibernate.temp.use_jdbc_metadata_defaults", false);
|
||||
var16.put("hibernate.dialect", d.b(var1));
|
||||
var16.put("hibernate.dialect", DbTableUtil.b(var1));
|
||||
var16.put("hibernate.hbm2ddl.auto", "create");
|
||||
var16.put("hibernate.connection.autocommit", false);
|
||||
var16.put("hibernate.current_session_context_class", "thread");
|
||||
@@ -128,9 +128,9 @@ public class c {
|
||||
|
||||
}
|
||||
|
||||
public List<String> b(a var1) throws DBException, SQLException {
|
||||
String var2 = d.getDatabaseType();
|
||||
String var3 = d.a(var1.getTableName(), var2);
|
||||
public List<String> b(CgformConfigModel var1) throws DBException, SQLException {
|
||||
String var2 = DbTableUtil.getDatabaseType();
|
||||
String var3 = DbTableUtil.a(var1.getTableName(), var2);
|
||||
String var4 = "alter table " + var3 + " ";
|
||||
ArrayList var5 = new ArrayList();
|
||||
|
||||
@@ -146,12 +146,12 @@ public class c {
|
||||
String var10;
|
||||
while(var9.hasNext()) {
|
||||
var10 = (String)var9.next();
|
||||
org.jeecg.modules.online.config.b.a var11;
|
||||
ColumnMeta var11;
|
||||
if (!var6.containsKey(var10)) {
|
||||
var11 = (org.jeecg.modules.online.config.b.a)var7.get(var10);
|
||||
var11 = (ColumnMeta)var7.get(var10);
|
||||
String var17 = (String)var8.get(var10);
|
||||
if (var8.containsKey(var10) && var6.containsKey(var17)) {
|
||||
org.jeecg.modules.online.config.b.a var13 = (org.jeecg.modules.online.config.b.a)var6.get(var17);
|
||||
ColumnMeta var13 = (ColumnMeta)var6.get(var17);
|
||||
String var14 = c.getReNameFieldName(var11);
|
||||
if ("SQLSERVER".equals(var2)) {
|
||||
var5.add(var14);
|
||||
@@ -178,8 +178,8 @@ public class c {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var11 = (org.jeecg.modules.online.config.b.a)var6.get(var10);
|
||||
org.jeecg.modules.online.config.b.a var12 = (org.jeecg.modules.online.config.b.a)var7.get(var10);
|
||||
var11 = (ColumnMeta)var6.get(var10);
|
||||
ColumnMeta var12 = (ColumnMeta)var7.get(var10);
|
||||
if (!var11.a(var12, var2)) {
|
||||
var5.add(var4 + this.a(var12, var11));
|
||||
}
|
||||
@@ -209,7 +209,7 @@ public class c {
|
||||
return var5;
|
||||
}
|
||||
|
||||
private static Map<String, Object> a(a var0, String var1) {
|
||||
private static Map<String, Object> a(CgformConfigModel var0, String var1) {
|
||||
HashMap var2 = new HashMap();
|
||||
Iterator var3 = var0.getColumns().iterator();
|
||||
|
||||
@@ -223,22 +223,22 @@ public class c {
|
||||
return var2;
|
||||
}
|
||||
|
||||
private Map<String, org.jeecg.modules.online.config.b.a> c(String var1, String var2) throws SQLException {
|
||||
private Map<String, ColumnMeta> c(String var1, String var2) throws SQLException {
|
||||
HashMap var3 = new HashMap();
|
||||
Connection var4 = null;
|
||||
|
||||
try {
|
||||
var4 = d.getConnection();
|
||||
var4 = DbTableUtil.getConnection();
|
||||
} catch (Exception var21) {
|
||||
a.error(var21.getMessage(), var21);
|
||||
}
|
||||
|
||||
DatabaseMetaData var5 = var4.getMetaData();
|
||||
b var6 = (b)SpringContextUtils.getBean(b.class);
|
||||
DataBaseConfig var6 = (DataBaseConfig)SpringContextUtils.getBean(DataBaseConfig.class);
|
||||
String var7 = null;
|
||||
|
||||
try {
|
||||
var7 = d.getDatabaseType();
|
||||
var7 = DbTableUtil.getDatabaseType();
|
||||
} catch (DBException var20) {
|
||||
var20.printStackTrace();
|
||||
}
|
||||
@@ -256,7 +256,7 @@ public class c {
|
||||
}
|
||||
|
||||
while(var9.next()) {
|
||||
org.jeecg.modules.online.config.b.a var10 = new org.jeecg.modules.online.config.b.a();
|
||||
ColumnMeta var10 = new ColumnMeta();
|
||||
var10.setTableName(var2);
|
||||
String var11 = var9.getString("COLUMN_NAME").toLowerCase();
|
||||
var10.setColumnName(var11);
|
||||
@@ -281,14 +281,14 @@ public class c {
|
||||
return var3;
|
||||
}
|
||||
|
||||
private Map<String, org.jeecg.modules.online.config.b.a> c(a var1) {
|
||||
private Map<String, ColumnMeta> c(CgformConfigModel var1) {
|
||||
HashMap var2 = new HashMap();
|
||||
List var3 = var1.getColumns();
|
||||
Iterator var5 = var3.iterator();
|
||||
|
||||
while(var5.hasNext()) {
|
||||
OnlCgformField var6 = (OnlCgformField)var5.next();
|
||||
org.jeecg.modules.online.config.b.a var4 = new org.jeecg.modules.online.config.b.a();
|
||||
ColumnMeta var4 = new ColumnMeta();
|
||||
var4.setTableName(var1.getTableName().toLowerCase());
|
||||
var4.setColumnId(var6.getId());
|
||||
var4.setColumnName(var6.getDbFieldName().toLowerCase());
|
||||
@@ -323,23 +323,23 @@ public class c {
|
||||
return c.getDropColumnSql(var1);
|
||||
}
|
||||
|
||||
private String a(org.jeecg.modules.online.config.b.a var1, org.jeecg.modules.online.config.b.a var2) throws DBException {
|
||||
private String a(ColumnMeta var1, ColumnMeta var2) throws DBException {
|
||||
return c.getUpdateColumnSql(var1, var2);
|
||||
}
|
||||
|
||||
private String b(org.jeecg.modules.online.config.b.a var1, org.jeecg.modules.online.config.b.a var2) {
|
||||
private String b(ColumnMeta var1, ColumnMeta var2) {
|
||||
return c.getSpecialHandle(var1, var2);
|
||||
}
|
||||
|
||||
private String a(org.jeecg.modules.online.config.b.a var1) {
|
||||
private String a(ColumnMeta var1) {
|
||||
return c.getReNameFieldName(var1);
|
||||
}
|
||||
|
||||
private String b(org.jeecg.modules.online.config.b.a var1) {
|
||||
private String b(ColumnMeta var1) {
|
||||
return c.getAddColumnSql(var1);
|
||||
}
|
||||
|
||||
private String c(org.jeecg.modules.online.config.b.a var1) {
|
||||
private String c(ColumnMeta var1) {
|
||||
return c.getCommentSql(var1);
|
||||
}
|
||||
|
||||
@@ -379,7 +379,7 @@ public class c {
|
||||
ArrayList var3 = new ArrayList();
|
||||
|
||||
try {
|
||||
var1 = d.getConnection();
|
||||
var1 = DbTableUtil.getConnection();
|
||||
DatabaseMetaData var4 = var1.getMetaData();
|
||||
var2 = var4.getIndexInfo((String)null, (String)null, var0, false, false);
|
||||
ResultSetMetaData var5 = var2.getMetaData();
|
||||
+16
-14
@@ -1,5 +1,5 @@
|
||||
|
||||
package org.jeecg.modules.online.config.b;
|
||||
package org.jeecg.modules.online.config.util;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.DatabaseMetaData;
|
||||
@@ -12,20 +12,22 @@ import javax.sql.DataSource;
|
||||
import org.hibernate.Session;
|
||||
import com.jero.common.util.SpringContextUtils;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import org.jeecg.modules.online.config.config.DataBaseConfig;
|
||||
import org.jeecg.modules.online.config.exception.DBException;
|
||||
import org.jeecg.modules.online.config.service.DbTableHandleI;
|
||||
import org.jeecg.modules.online.config.service.a.a;
|
||||
import org.jeecg.modules.online.config.service.a.b;
|
||||
import org.jeecg.modules.online.config.service.a.c;
|
||||
import org.jeecg.modules.online.config.service.a.e;
|
||||
import org.jeecg.modules.online.config.service.a.DbTableDmHandleImpl;
|
||||
import org.jeecg.modules.online.config.service.a.DbTableMysqlHandleImpl;
|
||||
import org.jeecg.modules.online.config.service.a.DbTableOracleHandleImpl;
|
||||
import org.jeecg.modules.online.config.service.a.DbTablePostgresHandleImpl;
|
||||
import org.jeecg.modules.online.config.service.a.DbTableSQLServerHandleImpl;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class d {
|
||||
private static final Logger b = LoggerFactory.getLogger(d.class);
|
||||
public class DbTableUtil {
|
||||
private static final Logger b = LoggerFactory.getLogger(DbTableUtil.class);
|
||||
public static String a = "";
|
||||
|
||||
public d() {
|
||||
public DbTableUtil() {
|
||||
}
|
||||
|
||||
public static DbTableHandleI getTableHandle() throws SQLException, DBException {
|
||||
@@ -61,19 +63,19 @@ public class d {
|
||||
|
||||
switch(var3) {
|
||||
case 0:
|
||||
var0 = new b();
|
||||
var0 = new DbTableMysqlHandleImpl();
|
||||
break;
|
||||
case 1:
|
||||
var0 = new c();
|
||||
var0 = new DbTableOracleHandleImpl();
|
||||
break;
|
||||
case 2:
|
||||
var0 = new a();
|
||||
var0 = new DbTableDmHandleImpl();
|
||||
break;
|
||||
case 3:
|
||||
var0 = new e();
|
||||
var0 = new DbTableSQLServerHandleImpl();
|
||||
break;
|
||||
case 4:
|
||||
var0 = new org.jeecg.modules.online.config.service.a.d();
|
||||
var0 = new DbTablePostgresHandleImpl();
|
||||
}
|
||||
|
||||
return (DbTableHandleI)var0;
|
||||
@@ -207,7 +209,7 @@ public class d {
|
||||
}
|
||||
|
||||
String var6 = a(var0, var5);
|
||||
org.jeecg.modules.online.config.a.b var7 = (org.jeecg.modules.online.config.a.b)SpringContextUtils.getBean(org.jeecg.modules.online.config.a.b.class);
|
||||
DataBaseConfig var7 = (DataBaseConfig)SpringContextUtils.getBean(DataBaseConfig.class);
|
||||
String var8 = var7.getUsername();
|
||||
if ("ORACLE".equals(var5) || "DM".equals(var5)) {
|
||||
var8 = var8 != null ? var8.toUpperCase() : null;
|
||||
+3
-3
@@ -1,14 +1,14 @@
|
||||
|
||||
package org.jeecg.modules.online.config.b;
|
||||
package org.jeecg.modules.online.config.util;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map;
|
||||
|
||||
public class e {
|
||||
public class ExtendJsonConvert {
|
||||
protected static Map<String, String> a = new HashMap();
|
||||
|
||||
public e() {
|
||||
public ExtendJsonConvert() {
|
||||
}
|
||||
|
||||
private static String a(String var0, int var1) {
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
|
||||
package org.jeecg.modules.online.config.b;
|
||||
package org.jeecg.modules.online.config.util;
|
||||
|
||||
import java.util.Comparator;
|
||||
import org.jeecg.modules.online.cgform.entity.OnlCgformField;
|
||||
|
||||
public class f implements Comparator<OnlCgformField> {
|
||||
public f() {
|
||||
public class FieldNumComparator implements Comparator<OnlCgformField> {
|
||||
public FieldNumComparator() {
|
||||
}
|
||||
|
||||
public int a(OnlCgformField var1, OnlCgformField var2) {
|
||||
public int compare(OnlCgformField var1, OnlCgformField var2) {
|
||||
if (var1 != null && var1.getOrderNum() != null && var2 != null && var2.getOrderNum() != null) {
|
||||
Integer var3 = var1.getOrderNum();
|
||||
Integer var4 = var2.getOrderNum();
|
||||
+5
-5
@@ -1,5 +1,5 @@
|
||||
|
||||
package org.jeecg.modules.online.config.b;
|
||||
package org.jeecg.modules.online.config.util;
|
||||
|
||||
import freemarker.template.Configuration;
|
||||
import freemarker.template.Template;
|
||||
@@ -8,11 +8,11 @@ import java.util.Map;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class g {
|
||||
private static final Logger a = LoggerFactory.getLogger(g.class);
|
||||
public class FreemarkerHelper {
|
||||
private static final Logger a = LoggerFactory.getLogger(FreemarkerHelper.class);
|
||||
private static Configuration b;
|
||||
|
||||
public g() {
|
||||
public FreemarkerHelper() {
|
||||
}
|
||||
|
||||
public static String a(String var0, String var1, Map<String, Object> var2) {
|
||||
@@ -35,6 +35,6 @@ public class g {
|
||||
static {
|
||||
b = new Configuration(Configuration.VERSION_2_3_28);
|
||||
b.setNumberFormat("0.#####################");
|
||||
b.setClassForTemplateLoading(g.class, "/");
|
||||
b.setClassForTemplateLoading(FreemarkerHelper.class, "/");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user