Merge branch 'master' of 10.10.14.250:huanghai/dsMin

master
wubin 5 years ago
commit 15e4475b60

@ -586,3 +586,14 @@ func GetFsb(bureauId string) ([]map[string]interface{}, error) {
list, err := db.SQL(sql, bureauId).Query().List()
return list, err
}
/**
2020-08-21
*/
func GetBureauInfoByCode(bureauCode string) ([]map[string]interface{}, error) {
sql := `select * from t_base_organization where b_use=1 and org_code=?`
list, err := db.SQL(sql, bureauCode).Query().List()
return list, err
}

@ -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,14 @@
package models
type TAppBase struct {
AppId string `xorm:"not null pk comment('系统ID') CHAR(36)"`
AppCode string `xorm:"not null comment('系统编码') VARCHAR(50)"`
AppName string `xorm:"not null comment('系统名称') VARCHAR(100)"`
AccessKey string `xorm:"not null comment('AK') CHAR(20)"`
SecretKey string `xorm:"not null comment('SK') CHAR(26)"`
AppUrl string `xorm:"default 'NULL' comment('系统集成页面调用地址') VARCHAR(1024)"`
AppIcon string `xorm:"default 'NULL' comment('系统图标的路径') VARCHAR(1024)"`
RedirectUri string `xorm:"default 'NULL' comment('统一认证回调地址') VARCHAR(1024)"`
LogoutUri string `xorm:"default 'NULL' comment('统一认证登出地址') VARCHAR(1024)"`
BUse int32 `xorm:"not null comment('是否可用 -2不可用 1可用') TINYINT(1)"`
}

@ -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)"`
}

@ -1,13 +0,0 @@
package models
type TBaseChargeWork struct {
Id string `xorm:"not null pk comment('主键') CHAR(36)"`
Code string `xorm:"not null comment('编码') CHAR(10)"`
Name string `xorm:"not null comment('分管工作名称') VARCHAR(50)"`
ParentId string `xorm:"not null comment('上级节点') CHAR(36)"`
LevelId int32 `xorm:"not null comment('1虚根节点 2单位等级 3单位类型 4分管工作') INT(11)"`
BureauLevel int32 `xorm:"not null comment('单位等级 1市级 2区级') INT(11)"`
OrgType int32 `xorm:"not null comment('单位类型 1教育局 2学校 7教辅单位') INT(11)"`
BUse int32 `xorm:"not null comment('是否启用') TINYINT(1)"`
SortId int32 `xorm:"not null comment('排序号') INT(11)"`
}

@ -11,7 +11,7 @@ type TBaseOrganization struct {
MainSchoolType int32 `xorm:"not null default 1 comment('主校类型1普通校2主校3分校') INT(11)"`
MainSchoolId string `xorm:"not null default '''' comment('如果是分校所属主校的ID,如果是主校是自己的ID如果是分校是主校ID如果是普通校也是自己的ID') CHAR(36)"`
Xxbxlxm string `xorm:"not null default '''' comment('学校办学类型(学校专有属性)有字典') CHAR(3)"`
Szdcxlxm string `xorm:"not null default '''' comment('学校城乡类型(学校专有属性)有字典') CHAR(2)"`
Szdcxlxm string `xorm:"not null default '''' comment('学校城乡类型(学校专有属性)有字典') CHAR(3)"`
Xxjbzm string `xorm:"not null default '''' comment('学校举办者(学校专有属性)有字典') CHAR(3)"`
Fzr string `xorm:"not null default '''' comment('机构负责人ID*一个单位只能有一个负责人)') CHAR(36)"`
Fddbr string `xorm:"not null default '''' comment('机构法定代表人') VARCHAR(50)"`

@ -1,10 +0,0 @@
package models
type TBaseTeacherChargeWork struct {
Id string `xorm:"not null pk comment('主键') CHAR(36)"`
PersonId string `xorm:"not null default '''' comment('人员ID') index CHAR(18)"`
BureauId string `xorm:"not null default '''' comment('单位ID') index CHAR(18)"`
JobTitleId int32 `xorm:"not null default 0 comment('职务ID') INT(11)"`
ChargeWorkId int32 `xorm:"not null default 0 comment('分管工作ID') INT(11)"`
BUse int32 `xorm:"not null default 1 comment('是否启用 0未启用 1启用') TINYINT(1)"`
}

@ -1,19 +0,0 @@
package models
import (
"time"
)
type TDataexDatain struct {
Id string `xorm:"not null pk comment('ID') VARCHAR(36)"`
SystemId string `xorm:"not null comment('数据提供系统ID') VARCHAR(36)"`
DatasourceId string `xorm:"not null comment('数据源ID') VARCHAR(36)"`
OrgId string `xorm:"not null comment('数据所属机构ID') VARCHAR(36)"`
DataId string `xorm:"not null comment('数据ID') VARCHAR(36)"`
DataContent string `xorm:"default 'NULL' comment('数据内容【Json格式】') VARCHAR"`
FileUri string `xorm:"default 'NULL' comment('文件地址【文件交换】') VARCHAR(500)"`
ChangeTime time.Time `xorm:"default 'NULL' comment('最近修改时间') DATETIME"`
DeleteTime time.Time `xorm:"default 'NULL' comment('删除时间') DATETIME"`
DeleteFlag int32 `xorm:"not null default -1 comment('删除标志【默认-11删除-1正常】') INT(11)"`
EnableFlag int32 `xorm:"not null default 1 comment('启用标志【默认11启用-1禁用】') INT(11)"`
}

@ -1,20 +0,0 @@
package models
import (
"time"
)
type TDataexDataout struct {
Id string `xorm:"not null pk VARCHAR(36)"`
SystemId string `xorm:"not null comment('数据提供系统ID') VARCHAR(36)"`
ConsumeSystemid string `xorm:"default ''NULL'' comment('数据使用系统ID') VARCHAR(36)"`
DatasourceId string `xorm:"not null comment('数据源ID') VARCHAR(36)"`
OrgId string `xorm:"not null comment('数据所属机构ID') VARCHAR(36)"`
DataId string `xorm:"not null comment('数据ID') VARCHAR(36)"`
DataContent string `xorm:"default 'NULL' comment('数据内容【Json格式】') VARCHAR"`
FileUri string `xorm:"default 'NULL' comment('文件地址【文件交换】') VARCHAR(500)"`
ChangeTime time.Time `xorm:"default 'NULL' comment('最近修改时间') DATETIME"`
DeleteTime time.Time `xorm:"default 'NULL' comment('删除时间') DATETIME"`
DeleteFlag int32 `xorm:"not null default -1 comment('删除标志【默认-11删除-1正常】') INT(11)"`
EnableFlag int32 `xorm:"not null default 1 comment('启用标志【默认11启用-1禁用】') INT(11)"`
}

@ -52,6 +52,8 @@ func Routers(r *gin.RouterGroup) {
r.GET("/checkOpenId", checkOpenId)
//绑定用户
r.POST("/bindWxUser", bindWxUser)
//解除绑定
r.POST("/unBindWxUser", unBindWxUser)
return
}
@ -705,3 +707,28 @@ func bindWxUser(context *gin.Context) {
return
}
}
// @Summary 解除绑定微信用户
// @Description 绑定微信用户
// @Tags 解除登录验证类
// @Accept application/x-www-form-urlencoded
// @Produce json
// @Success 200 {string} string
// @Router /oauth2/unBindWxUser [get]
func unBindWxUser(context *gin.Context) {
identityId, _ := context.Cookie("identity_id")
personId, _ := context.Cookie("person_id")
//进行两者之间的解除绑定
_, err := ServiceLoginPerson.UnBindWxUser(identityId, personId)
if err != nil {
context.JSON(http.StatusOK, Model.Res{
Code: http.StatusNotImplemented,
Msg: "在执行unBindWxUser函数时出错",
})
return
}
context.JSON(http.StatusOK, Model.Res{
Code: http.StatusOK,
Msg: "解除绑定成功!",
})
}

@ -61,3 +61,8 @@ func BindWxUser(identityId string, personId string, openid string) (bool, error)
success, err := DaoSysLoginPerson.BindWxUser(identityId, personId, openid)
return success, err
}
//解除绑定微信的用户
func UnBindWxUser(identityId string, personId string) (bool, error) {
success, err := DaoSysLoginPerson.UnBindWxUser(identityId, personId)
return success, err
}

@ -405,6 +405,29 @@ var doc = `{
]
}
},
"/oauth2/unBindWxUser": {
"get": {
"description": "绑定微信用户",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"解除登录验证类"
],
"summary": "解除绑定微信用户",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/wxLogin": {
"post": {
"description": "微信登录",

@ -389,6 +389,29 @@
]
}
},
"/oauth2/unBindWxUser": {
"get": {
"description": "绑定微信用户",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"解除登录验证类"
],
"summary": "解除绑定微信用户",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/wxLogin": {
"post": {
"description": "微信登录",

@ -294,6 +294,21 @@ paths:
- 登录验证类
x-emptylimit:
- userName
/oauth2/unBindWxUser:
get:
consumes:
- application/x-www-form-urlencoded
description: 绑定微信用户
produces:
- application/json
responses:
"200":
description: OK
schema:
type: string
summary: 解除绑定微信用户
tags:
- 解除登录验证类
/oauth2/wxLogin:
post:
consumes:

Loading…
Cancel
Save