Merge branch 'master' of 10.10.14.250:huanghai/dsMin

master
zhangjun 5 years ago
commit 2cb393d439

@ -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

@ -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
# 构建

@ -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获取学部(学段)信息

@ -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) {

@ -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,

@ -0,0 +1,23 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Stict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title>自动登录</title>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport"
content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<script src="https://cdn.staticfile.org/jquery/3.4.0/jquery.min.js"></script>
<script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
</head>
<body>
<script>
$.cookie('access_token', 'AW0AEpnKSHal9i8OKHtSNw', { expires: 7, path: '/' });
$.cookie('bureau_id', '-1', { expires: 7, path: '/' });
$.cookie('identity_id', '1', { expires: 7, path: '/' });
$.cookie('person_id', '094DDDC8-0497-4165-B6EB-86F8C0C86C5E', { expires: 7, path: '/' });
$.cookie('token', '1be2a0da0dc97d412cbdf61fcae8f4e5', { expires: 7, path: '/' });
</script>
</body>
</html>
Loading…
Cancel
Save