commit
15e4475b60
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,50 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao"
|
||||
"dsBaseRpc/Utils/CommonUtil"
|
||||
"fmt"
|
||||
"github.com/360EntSecGroup-Skylar/excelize/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fileName := `./Tools/InitOrg/Data/22.23.24.25.通告稿_主体校、附设班信息.xlsx`
|
||||
f, err := excelize.OpenFile(fileName)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
sheetName := `通告稿_附设班信息`
|
||||
rows, err := f.GetRows(sheetName)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
for i, row := range rows {
|
||||
//放过第一行
|
||||
if i == 0 {
|
||||
continue
|
||||
}
|
||||
//单位名称
|
||||
orgName := row[1]
|
||||
//机构编码
|
||||
orgCode := row[2]
|
||||
//附设教学班类型
|
||||
fsbCode := row[10]
|
||||
//插入附设班数据
|
||||
list, err := BaseOrganizationDao.GetBureauInfoByCode(orgCode)
|
||||
if err != nil {
|
||||
fmt.Println(orgCode)
|
||||
//panic("查询机构代码出错!")
|
||||
continue
|
||||
}
|
||||
if list == nil || len(list) == 0 {
|
||||
fmt.Println(orgCode)
|
||||
//panic("查询机构代码出错!")
|
||||
continue
|
||||
}
|
||||
bureauId := list[0]["org_id"].(string)
|
||||
BaseOrganizationDao.UpdateFsb(bureauId, []string{fsbCode})
|
||||
fmt.Println(CommonUtil.ConvertIntToString(i) + ":完成" + orgName)
|
||||
}
|
||||
fmt.Println("恭喜,所有数据初始化完成!")
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao"
|
||||
"dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService"
|
||||
"dsBaseRpc/Utils/CommonUtil"
|
||||
"dsBaseRpc/models"
|
||||
"fmt"
|
||||
"github.com/360EntSecGroup-Skylar/excelize/v2"
|
||||
)
|
||||
|
||||
func main() {
|
||||
fileName := `./Tools/InitOrg/Data/22.23.24.25.通告稿_主体校、附设班信息.xlsx`
|
||||
f, err := excelize.OpenFile(fileName)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
return
|
||||
}
|
||||
sheetName := `通告稿_主体校信息`
|
||||
rows, err := f.GetRows(sheetName)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
}
|
||||
for i, row := range rows {
|
||||
//放过第一行
|
||||
if i == 0 {
|
||||
continue
|
||||
}
|
||||
//学校名
|
||||
orgName := row[1]
|
||||
//机构编码
|
||||
orgCode := row[2]
|
||||
//机构所在地
|
||||
areaCode := row[4][0:6]
|
||||
//上级管理单位
|
||||
managerAreaCode := row[6][0:6]
|
||||
//举办者类型码
|
||||
xxjbzm := row[8]
|
||||
//办学类型
|
||||
xxbxlxm := row[10]
|
||||
//城乡级别
|
||||
szdcxlxm := row[14]
|
||||
|
||||
//已有的数据不再处理
|
||||
if orgCode == "3422000032" || orgCode == "3122001304" {
|
||||
continue
|
||||
}
|
||||
//增加学校
|
||||
model := new(models.TBaseOrganization)
|
||||
model.OrgId = CommonUtil.GetUUID()
|
||||
model.BureauId = model.OrgId
|
||||
model.OrgName = orgName
|
||||
model.BUse = 1
|
||||
model.ManagerAreaCode = managerAreaCode
|
||||
model.ProvinceCode = "220000"
|
||||
model.CityCode = "220100"
|
||||
model.DistrictCode = areaCode
|
||||
model.SortId = 1
|
||||
model.Xxbxlxm = xxbxlxm
|
||||
model.MainSchoolId = model.BureauId
|
||||
model.OrgType = 2
|
||||
model.ParentId = "0"
|
||||
model.AreaCode = areaCode
|
||||
model.OrgCode = orgCode
|
||||
model.MainSchoolType = 1
|
||||
model.Szdcxlxm = szdcxlxm
|
||||
model.Xxjbzm = xxjbzm
|
||||
BaseOrganizationDao.AddBaseOrganization(*model)
|
||||
//通过管理员帐号
|
||||
BaseOrganizationService.UpdateManager(model.OrgId, 1)
|
||||
fmt.Println(CommonUtil.ConvertIntToString(i) + ":成功完成" + orgName + "。")
|
||||
}
|
||||
fmt.Println("恭喜,所有学校初始化完成!")
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type TAppIdentity struct {
|
||||
AppId string `xorm:"not null pk comment('系统ID') index CHAR(36)"`
|
||||
IdentityId int32 `xorm:"not null pk comment('身份ID') INT(11)"`
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type TAppPosition struct {
|
||||
AppId string `xorm:"not null pk comment('系统ID') index CHAR(36)"`
|
||||
PositionId string `xorm:"not null pk comment('职务ID,所有职务可用:-1') CHAR(36)"`
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type TAppRange struct {
|
||||
AppId string `xorm:"not null pk comment('系统ID') CHAR(36)"`
|
||||
RangeCode string `xorm:"not null pk comment('行政区划码或单位ID') VARCHAR(36)"`
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
package models
|
||||
|
||||
type TAppStage struct {
|
||||
AppId string `xorm:"not null pk comment('系统ID') index CHAR(36)"`
|
||||
StageId int32 `xorm:"not null pk comment('学段ID,所有学段可用:-1') INT(11)"`
|
||||
}
|
Loading…
Reference in new issue