更新研发
This commit is contained in:
+21
-9
@@ -171,8 +171,8 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB, makeCod
|
||||
}
|
||||
|
||||
idSlice = append(idSlice, tableInfo)
|
||||
for _, info := range tableInfo {
|
||||
|
||||
for _, info1 := range tableInfo {
|
||||
info := DeepCopyMap(info1).(Map)
|
||||
if info.GetString("label") == "" {
|
||||
info["label"] = info.GetString("name")
|
||||
}
|
||||
@@ -193,11 +193,17 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB, makeCod
|
||||
//"add": false, "info": false, "edit": false, "list": true,
|
||||
//"must": false,
|
||||
}
|
||||
|
||||
//备注以空格隔开,空格后的是其他备注
|
||||
indexNum := strings.Index(info.GetString("label"), ":")
|
||||
if indexNum > 0 {
|
||||
indexNum := strings.Index(info.GetString("label"), " ")
|
||||
if indexNum > -1 {
|
||||
coloum["label"] = info.GetString("label")[:indexNum]
|
||||
}
|
||||
//去除数据信息,是用:号分割的
|
||||
indexNum = strings.Index(coloum.GetString("label"), ":")
|
||||
if indexNum > -1 {
|
||||
coloum["label"] = coloum.GetString("label")[:indexNum]
|
||||
}
|
||||
|
||||
for _, ColumnName := range ColumnNameType {
|
||||
if (ColumnName.Strict && coloum.GetString("name") == ColumnName.Name) ||
|
||||
@@ -311,7 +317,6 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB, makeCod
|
||||
|
||||
//生成id,判断数据库是否有改变,以保证数据库和配置文件匹配唯一
|
||||
id := Md5(ObjToStr(idSlice))
|
||||
|
||||
if id == that.Config.GetString("id") {
|
||||
if isMake { //有生成包文件
|
||||
fmt.Println("有新的业务代码生成,请重新运行")
|
||||
@@ -326,7 +331,7 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB, makeCod
|
||||
isMenusGet := false //判断是否被目录收录
|
||||
for indexKey, _ := range that.IndexMenus {
|
||||
indexCode := strings.Index(indexKey, fk)
|
||||
if indexCode == 0 {
|
||||
if indexCode == 0 || indexCode == 4 {
|
||||
isMenusGet = false
|
||||
continue
|
||||
}
|
||||
@@ -352,7 +357,7 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB, makeCod
|
||||
//if tablePrefixCode != -1 {
|
||||
for ck, _ := range that.TableColumns {
|
||||
//判断不止一个前缀相同
|
||||
if strings.Index(ck, prefixName) == 0 && ck != fk {
|
||||
if (strings.Index(ck, prefixName) == 0 || strings.Index(prefixName, ck) == 4) && ck != fk {
|
||||
isNewPrefix = true
|
||||
break
|
||||
}
|
||||
@@ -372,8 +377,15 @@ func (that *MakeCode) Db2JSON(name string, path string, db *db.HoTimeDB, makeCod
|
||||
}
|
||||
//没有新前缀
|
||||
if that.IndexMenus[prefixName] != nil {
|
||||
that.IndexMenus.GetMap(prefixName)["menus"] = append(that.IndexMenus.GetMap(prefixName).GetSlice("menus"), menuIns)
|
||||
that.IndexMenus[prefixName+"/"+fk] = menuIns
|
||||
if that.IndexMenus[prefixName+"/"+fk] == nil {
|
||||
that.IndexMenus.GetMap(prefixName)["menus"] = append(that.IndexMenus.GetMap(prefixName).GetSlice("menus"), menuIns)
|
||||
that.IndexMenus[prefixName+"/"+fk] = menuIns
|
||||
} else {
|
||||
for k, v := range menuIns {
|
||||
that.IndexMenus.GetMap(prefixName + "/" + fk)[k] = v
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
that.Config["menus"] = append(that.Config.GetSlice("menus"), mMenu) //注入配置
|
||||
|
||||
Reference in New Issue
Block a user