master
wubin 4 years ago
parent 59f6e9f86b
commit 7635f290fc

@ -0,0 +1 @@
select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_jiaofu_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end

@ -0,0 +1 @@
select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_zhandimianji_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end

@ -0,0 +1 @@
select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_xueshengsushe_area t1 INNER JOIN mv_db_base_jss_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end

@ -0,0 +1 @@
select t1.stage,t1.gatherregionc,t1.sum as total,t2.sum as studentno from mv_db_base_yundongchangdi_area t1 INNER JOIN mv_db_base_student_area t2 on t1.stage=t2.stage and t1.gatherregionc=t2.gatherregionc order by case when t1.stage='小学' then 1 when t1.stage='初中' then 2 when t1.stage='高中' then 3 end,case when t1.gatherregionc='南关区' then 1 when t1.gatherregionc='宽城区' then 2 when t1.gatherregionc='朝阳区' then 3 when t1.gatherregionc='二道区' then 4 when t1.gatherregionc='绿园区' then 5 when t1.gatherregionc='双阳区' then 6 when t1.gatherregionc='九台区' then 7 when t1.gatherregionc='直属代管' then 8 when t1.gatherregionc='新区代管' then 9 when t1.gatherregionc='经开区代管' then 10 when t1.gatherregionc='净月区代管' then 11 when t1.gatherregionc='汽车区代管' then 12 when t1.gatherregionc='省属代管' then 13 when t1.gatherregionc='莲花山度假区代管' then 14 when t1.gatherregionc='农安县' then 15 when t1.gatherregionc='榆树市' then 16 when t1.gatherregionc='德惠市' then 17 end

@ -0,0 +1 @@
select '学校总数' as didgroup,sum(count) as total from mv_db_base_school union all select '教工总数' as didgroup,jzgno as total from mv_db_base_jiaozhigong union all select '学生总数' as didgroup,sum(zaixiaono) as total from mv_db_base_student

@ -50,13 +50,20 @@ func RemoveCookie(c *gin.Context) {
host := c.Request.Host
ipStart := strings.Split(host, ".")[0]
isIntranetIP := strings.Index(ConfigUtil.IntranetIP, ipStart)
isIntranetIPBool := false
isIntranetIPArr := strings.Split(ConfigUtil.IntranetIP, ",")
for i := 0; i < len(isIntranetIPArr); i++ {
if ipStart == isIntranetIPArr[i] {
isIntranetIPBool = true
}
}
ssoServer := ""
if isIntranetIP < 0 { //小于0说明是外网
ssoServer = ConfigUtil.SsoServerWw
} else {
if isIntranetIPBool { //true为内网
ssoServer = ConfigUtil.SsoServerNw
} else {
ssoServer = ConfigUtil.SsoServerWw
}
logOutURI := ssoServer + ConfigUtil.AuthLogoutURI

@ -51,13 +51,9 @@ func SsoHandler() gin.HandlerFunc {
}
//获取访问的完整地址(包括参数)
requestUri := c.Request.RequestURI
fmt.Println("↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓")
fmt.Println(requestUri)
fmt.Println("↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑")
host := c.Request.Host
ipStart := strings.Split(host, ".")[0]
isIntranetIP := strings.Index(ConfigUtil.IntranetIP, ipStart)
//白名单中的放行
//if !strings.HasPrefix(requestUri, "/dsBaseWeb/2019/"){ //对/dsBaseWeb/2019/进行特殊检测黄海增加于2020-12-17
@ -77,15 +73,25 @@ func SsoHandler() gin.HandlerFunc {
clientId := ""
redirectURI := ""
ipStart := strings.Split(host, ".")[0]
isIntranetIPBool := false
isIntranetIPArr := strings.Split(ConfigUtil.IntranetIP, ",")
for i := 0; i < len(isIntranetIPArr); i++ {
if ipStart == isIntranetIPArr[i] {
isIntranetIPBool = true
}
}
//从配置文件中获取统一认证的服务器地址
if isIntranetIP < 0 { //小于0说明是外网
ssoServer = ConfigUtil.SsoServerWw
clientId = ConfigUtil.ClientIdWw
redirectURI = ConfigUtil.RedirectURIWw
} else {
if isIntranetIPBool { //true为内网
ssoServer = ConfigUtil.SsoServerNw
clientId = ConfigUtil.ClientIdNw
redirectURI = ConfigUtil.RedirectURINw
} else {
ssoServer = ConfigUtil.SsoServerWw
clientId = ConfigUtil.ClientIdWw
redirectURI = ConfigUtil.RedirectURIWw
}
authCodeURI := ConfigUtil.AuthCodeURI

@ -43,24 +43,31 @@ func CheckSsoCode(c *gin.Context) {
host := c.Request.Host
ipStart := strings.Split(host, ".")[0]
isIntranetIP := strings.Index(ConfigUtil.IntranetIP, ipStart)
ssoServer := ""
clientId := ""
clientSecret := ""
redirectURI := ""
if isIntranetIP < 0 { //小于0说明是外网
ssoServer = ConfigUtil.SsoServerWw
clientId = ConfigUtil.ClientIdWw
clientSecret = ConfigUtil.ClientSecretWw
redirectURI = ConfigUtil.RedirectURIWw
} else {
ipStart := strings.Split(host, ".")[0]
isIntranetIPBool := false
isIntranetIPArr := strings.Split(ConfigUtil.IntranetIP, ",")
for i := 0; i < len(isIntranetIPArr); i++ {
if ipStart == isIntranetIPArr[i] {
isIntranetIPBool = true
}
}
if isIntranetIPBool { //true为内网
ssoServer = ConfigUtil.SsoServerNw
clientId = ConfigUtil.ClientIdNw
clientSecret = ConfigUtil.ClientSecretNw
redirectURI = ConfigUtil.RedirectURINw
} else {
ssoServer = ConfigUtil.SsoServerWw
clientId = ConfigUtil.ClientIdWw
clientSecret = ConfigUtil.ClientSecretWw
redirectURI = ConfigUtil.RedirectURIWw
}
//拼统一认证验证code接口地址
@ -80,8 +87,15 @@ func CheckSsoCode(c *gin.Context) {
LogUtil.Error("statusCode: ", CommonUtil.ConvertIntToString(statusCode))
return
}
//统一认证返回的信息
respMap := CommonUtil.ConvertJsonStringToMap(string(resp))
if respMap["code"].(float64) != 200 {
LogUtil.Error("错误信息: ", respMap["msg"].(string))
return
}
accessToken := respMap["access_token"].(string)
personId := respMap["person_id"].(string)
identityId := CommonUtil.ConvertInt32ToString(int32(respMap["identity_id"].(float64)))

@ -57,7 +57,7 @@ func main() {
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
//统一认证拦截器
//r.Use(Handler.SsoHandler())
r.Use(Handler.SsoHandler())
//EXCEL目录
//r.Static("/dsBaseWeb/static", "./Static")

Loading…
Cancel
Save