diff --git a/dsBaseRpc/Config/Config.ini b/dsBaseRpc/Config/Config.ini index 85d4ec3f..62bd776f 100644 --- a/dsBaseRpc/Config/Config.ini +++ b/dsBaseRpc/Config/Config.ini @@ -7,7 +7,7 @@ pwd = DsideaL147258369 [distribute] #发布功能的配置 ip = server.dsmin.com -port = 26611 +port = 22 user = root pwd = dsideal remotePath = /usr/local/dsMin/dsBaseRpc/ @@ -32,7 +32,7 @@ KafkaAddress = server.dsmin.com:9092 # 数据汇集的地址 [dataExchange] -host = http://10.10.14.239:9009 +host = http://10.10.14.186:9009 exchangeUrl = /v1/dataex/DataexSet SystemAuthUrl = /v1/dataex/SystemAuth SystemId = BASE_GO diff --git a/dsBaseRpc/Linux上安装Go环境+配置DLV.txt b/dsBaseRpc/Linux上安装Go环境+配置DLV.txt index 4de6d55b..69c73c23 100644 --- a/dsBaseRpc/Linux上安装Go环境+配置DLV.txt +++ b/dsBaseRpc/Linux上安装Go环境+配置DLV.txt @@ -2,19 +2,19 @@ wget -c https://studygolang.com/dl/golang/go1.14.6.linux-amd64.tar.gz tar -C /usr/local/ -zxvf go1.14.6.linux-amd64.tar.gz -echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile.d/go.sh -echo "export PATH=$PATH:/home/user/go/bin" >> /etc/profile.d/go.sh -echo "export PATH=$PATH:/root/go/bin" >> /etc/profile.d/go.sh +echo "export PATH=$PATH:/usr/local/go/bin:/home/user/go/bin" >> /etc/profile.d/go.sh source /etc/profile.d/go.sh mkdir -p ~/home/user/go echo "export GOPATH=/home/user/go" >> /etc/profile.d/gopath.sh +#设置代理 +echo "export GO111MODULE=on" >> /etc/profile.d/gopath.sh +echo "export GOPROXY=https://goproxy.cn,direct" >> /etc/profile.d/gopath.sh + source /etc/profile.d/gopath.sh chmod +x /etc/profile.d/*.sh echo $GOPATH -#设置代理 -go env -w GOPROXY=https://goproxy.cn,direct # 下载dlv yum install git -y @@ -23,6 +23,7 @@ go get github.com/go-delve/delve/cmd/dlv # Goland配置方法 https://www.jianshu.com/p/e74e940a64d9 +cd /usr/local/dsMin/dsBaseRpc dlv --listen=:2345 --headless=true --api-version=2 exec ./dsBaseRpc # 构建 diff --git a/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go b/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go index 622d3bc7..2f8472c0 100644 --- a/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go +++ b/dsBaseRpc/RpcService/BaseClass/BaseClassDao/BaseClassDao.go @@ -2,6 +2,7 @@ package BaseClassDao import ( "dsBaseRpc/RpcService/BaseClass/BaseClassProto" + "dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao" "dsBaseRpc/Utils/CommonUtil" "dsBaseRpc/Utils/DbUtil" "dsBaseRpc/Utils/SqlKit" @@ -76,6 +77,29 @@ func UpdateBaseClass(model models.TBaseClass, ForceUpdateFields []string) (int64 return affected, err } +/** +功能:指定单位(部门)下是不是存在班级 +作者:黄海 +时间:2020-07-27 +*/ +func ExistClass(orgId string) (bool, error) { + var sql string + if BaseOrganizationDao.IsBuMen(orgId) { + sql = `select count(*) as c from t_base_class where b_use=1 and org_id=?` + } else { + sql = `select count(*) as c from t_base_class where b_use=1 and bureau_id=?` + } + list, err := db.SQL(sql, orgId).Query().List() + if err != nil { + return false, err + } + if list[0]["c"].(int64) > 0 { + return true, nil + } else { + return false, nil + } +} + //分页查询 func PageBaseClass(in *BaseClassProto.QueryArg) ([]map[string]interface{}, int32, error) { //接收传入参数 @@ -97,8 +121,8 @@ func PageBaseClass(in *BaseClassProto.QueryArg) ([]map[string]interface{}, int32 return nil, 0, err } //调用多查询字段通用方法 - list, count, err := SqlKit.QueryForPk(sql) - return list, count, err + list, err := db.SQL(sql).Query().List() + return list, int32(len(list)), err } //根据学校ID获取学部(学段)信息 diff --git a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go index 2361dcdc..cb2de51f 100644 --- a/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go +++ b/dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationService/BaseOrganizationService.go @@ -5,7 +5,6 @@ import ( "dsBaseRpc/Const" "dsBaseRpc/Const/ErrorConst" "dsBaseRpc/RpcService/BaseClass/BaseClassDao" - "dsBaseRpc/RpcService/BaseClass/BaseClassProto" "dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationDao" "dsBaseRpc/RpcService/BaseOrganization/BaseOrganizationProto" "dsBaseRpc/RpcService/BaseOrganizationManager/BaseOrganizationManagerDao" @@ -309,18 +308,14 @@ func (s *Rpc) DeleteBaseOrganization(ctx context.Context, in *BaseOrganizationPr return &reply, err } //判断是不是有可用的班级 - var inClass BaseClassProto.QueryArg - inClass.BureauId = in.Ids[i] - inClass.Page = 1 - inClass.Limit = 1 - _, count, err = BaseClassDao.PageBaseClass(&inClass) + exist, err := BaseClassDao.ExistClass(in.Ids[i]) if err != nil { - LogUtil.Error(ErrorConst.SqlUpdateError, "执行PageBaseClass时发生严重错误:"+err.Error()) + LogUtil.Error(ErrorConst.SqlUpdateError, "执行ExistClass时发生严重错误:"+err.Error()) reply.Success = false reply.Message = Const.DataBaseActionError return &reply, err } - if count > 0 { + if exist { reply.Success = false //判断是单位还是部门 if BaseOrganizationDao.IsBuMen(inTeacher.OrgId) { diff --git a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go index c04df891..71e7b8c1 100644 --- a/dsSso/Controller/ControllerOauth2/ControllerOauth2.go +++ b/dsSso/Controller/ControllerOauth2/ControllerOauth2.go @@ -43,7 +43,6 @@ func Routers(r *gin.RouterGroup) { r.GET("/getCaptchaPng", getCaptchaPng) //退出接口 r.GET("/logout", logout) - r.POST("/logout", logout) return } @@ -328,13 +327,6 @@ func authorizePost(context *gin.Context) { }) return } - //if CommonUtil.ConvertStringToInt(identityId) > 1 { - // context.JSON(http.StatusOK, Model.Res{ - // Code: http.StatusNotImplemented, - // Msg: "非管理员用户暂不能登录,敬请期待!!", - // }) - // return - //} } else { context.JSON(http.StatusOK, Model.Res{ Code: http.StatusNotImplemented, diff --git a/dsSso/autologin.html b/dsSso/autologin.html new file mode 100644 index 00000000..aa686fb5 --- /dev/null +++ b/dsSso/autologin.html @@ -0,0 +1,23 @@ + + + + 自动登录 + + + + + + + + + + +