ソースを参照

加了注释,还有SH大写

mainqaq 3 年 前
コミット
ae9d47d89e
共有2 個のファイルを変更した5 個の追加3 個の削除を含む
  1. 2 0
      service/role_service.go
  2. 3 3
      service/secondary_service.go

+ 2 - 0
service/role_service.go ファイルの表示

@@ -499,6 +499,8 @@ func GetAllGeneralPurviewVMsProcessed(module int) ([]*PurviewTreeViewModel, erro
499 499
 
500 500
 	return purviewVMs, nil
501 501
 }
502
+
503
+//用来处理树形结构
502 504
 func Totree(map1 map[int64]int64, map2 map[int64]*PurviewTreeViewModel, tmp int64) []*PurviewTreeViewModel {
503 505
 	var j int //用来计数
504 506
 	var tmp_purview []*PurviewTreeViewModel

+ 3 - 3
service/secondary_service.go ファイルの表示

@@ -9,10 +9,10 @@ import (
9 9
 	"time"
10 10
 )
11 11
 
12
-//生成编号,规则为:"sh-"+4位随机数
12
+//生成编号,规则为:"SH-"+4位随机数
13 13
 func CreateCode() string {
14 14
 	s := fmt.Sprintf("%04v", rand.New(rand.NewSource(time.Now().UnixNano())).Int63n(10000))
15
-	code := "sh-" + s
15
+	code := "SH-" + s
16 16
 	return code
17 17
 }
18 18
 
@@ -397,7 +397,7 @@ func Byliinit() (err error) {
397 397
 //根据xt_gobal_template 获取的机构id减去仓库表存在的机构id,把结果插入到仓库表
398 398
 func StoreReduceOrg(tx *gorm.DB) (err error) {
399 399
 	err = tx.Exec("INSERT INTO sgj_xt.xt_storehouse(storehouse_code,storehouse_name,user_org_id,ctime)" +
400
-		"SELECT CONCAT(\"sh-\",FLOOR(RAND()*9000+1000)),\"默认仓库\",tmp.id,UNIX_TIMESTAMP()" +
400
+		"SELECT CONCAT(\"SH-\",FLOOR(RAND()*9000+1000)),\"默认仓库\",tmp.id,UNIX_TIMESTAMP()" +
401 401
 		"FROM" +
402 402
 		"(select t1.org_id as id FROM sgj_xt.xt_gobal_template as t1 LEFT JOIN " +
403 403
 		"(SELECT distinct user_org_id as i FROM sgj_xt.xt_storehouse) as t2 on t1.org_id = t2.i WHERE t2.i is null and t1.status = 1)tmp").Error