Merge branch 'master' of 10.10.14.250:huanghai/dsMin

master
huanghai 5 years ago
commit 637985e88d

@ -31,6 +31,9 @@ func Routers(r *gin.RouterGroup) {
rr.GET("/DownLoadErrorExcel", DownLoadErrorExcel)
rr.POST("/StudentTransferInfo", StudentTransferInfo)
return
}
@ -600,3 +603,34 @@ func DownLoadErrorExcel(c *gin.Context) {
fileDir := rootPath + "/Html/ExcelTemp/" + fileId + ".xlsx"
c.File(fileDir)
}
// @Summary 修改学生信息
// @Description 修改学生信息
// @Tags 学生信息
// @Accept application/x-www-form-urlencoded
// @Produce json
// @Param personId formData string true "学生ID"
// @Param classId formData string true "班级ID"
// @Success 200 {object} Model.Res
// @Router /base/student/StudentTransferInfo [post]
// @X-EmptyLimit ["classId","personId"]
// @X-LengthLimit [{"classId":"36,36"},{"personId":"36,36"}]
// @X-Sort [10]
func StudentTransferInfo(c *gin.Context) {
//班级ID
classId := c.PostForm("classId")
//人员ID
personId := c.PostForm("personId")
r, err := BaseStudentService.StudentTransferInfo(classId, personId)
if err != nil {
c.JSON(http.StatusOK, Model.Res{
Success: false,
Message: "调用RPC服务失败",
})
return
}
c.JSON(http.StatusOK, Model.Res{
Success: r.Success,
Message: r.Message,
})
}

@ -59,3 +59,8 @@ func ImportStudentExcel(bureauId string, excelPath string, actionPersonId string
Reply, err := ImportStudentInfoExcel(BaseStudentProto.ImportArg{BureauId: bureauId, ExcelPath: excelPath, ActionPersonId: actionPersonId, ActionIpAddress: actionIpAddress})
return Reply, err
}
func StudentTransferInfo(classId string, personId string) (*BaseStudentProto.Reply, error) {
Reply, err := StudentTransfer(BaseStudentProto.StudentTransferArg{PersonId: personId, ClassId: classId})
return Reply, err
}

@ -208,3 +208,20 @@ func ImportStudentInfoExcel(importArg BaseStudentProto.ImportArg) (*BaseStudentP
}
return Reply, err
}
func StudentTransfer(arg BaseStudentProto.StudentTransferArg) (*BaseStudentProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseStudentProto.NewBaseStudentManageClient(conn)
Reply, err := c.StudentTransfer(ctx, &arg)
if err != nil {
LogUtil.Error("学生调转学校错误: ", err.Error())
}
return Reply, err
}

@ -36,6 +36,10 @@ func Routers(r *gin.RouterGroup) {
rr.POST("/DeleteTeacherMultipleBureauInfo", DeleteTeacherMultipleBureauInfo)
rr.POST("/SettingMainOrgInfo", SettingMainOrgInfo)
rr.POST("/TeacherTransferInfo", TeacherTransferInfo)
return
}
@ -761,3 +765,35 @@ func SettingMainOrgInfo(c *gin.Context) {
Message: r.Message,
})
}
// @Summary 教师调转单位
// @Description 教师调转单位
// @Tags 教师信息
// @Accept application/x-www-form-urlencoded
// @Produce json
// @Param orgId formData string true "部门ID"
// @Param personId formData string true "人员ID"
// @Success 200 {object} Model.Res
// @Router /base/teacher/TeacherTransferInfo [post]
// @X-EmptyLimit ["orgId","personId"]
// @X-LengthLimit [{"orgId":"36,36"},{"personId":"36,36"}]
// @X-RoleLimit ["1","3","4"]
// @X-Sort [15]
func TeacherTransferInfo(c *gin.Context) {
//部门ID
orgId := c.PostForm("orgId")
//人员ID
personId := c.PostForm("personId")
r, err := BaseTeacherService.TeacherTransferInfo(orgId, personId)
if err != nil {
c.JSON(http.StatusOK, Model.Res{
Success: false,
Message: "调用RPC服务失败",
})
return
}
c.JSON(http.StatusOK, Model.Res{
Success: r.Success,
Message: r.Message,
})
}

@ -140,7 +140,12 @@ func DeleteTeacherMultipleBureauInfo(id string) (*BaseTeacherProto.Reply, error)
return Reply, err
}
func SettingMainOrgInfo(id string,personId string) (*BaseTeacherProto.Reply, error) {
Reply, err := SettingMainOrg(BaseTeacherProto.SettingMainOrgArg{Id: id,PersonId:personId})
func SettingMainOrgInfo(id string, personId string) (*BaseTeacherProto.Reply, error) {
Reply, err := SettingMainOrg(BaseTeacherProto.SettingMainOrgArg{Id: id, PersonId: personId})
return Reply, err
}
func TeacherTransferInfo(orgId string, personId string) (*BaseTeacherProto.Reply, error) {
Reply, err := TeacherTransfer(BaseTeacherProto.SettingMultipleBureauArg{OrgId: orgId, PersonId: personId})
return Reply, err
}

@ -276,3 +276,20 @@ func SettingMainOrg(settingMainOrgArg BaseTeacherProto.SettingMainOrgArg) (*Base
}
return Reply, err
}
func TeacherTransfer(arg BaseTeacherProto.SettingMultipleBureauArg) (*BaseTeacherProto.Reply, error) {
//1、准备动作连接服务器
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
conn := GRpcUtil.GetConnection()
if conn == nil {
return nil, errors.New("RPC服务未启动")
}
//2、业务传参
c := BaseTeacherProto.NewBaseTeacherManageClient(conn)
Reply, err := c.TeacherTransfer(ctx, &arg)
if err != nil {
LogUtil.Error("教师调转单位错误: ", err.Error())
}
return Reply, err
}

Loading…
Cancel
Save