diff --git a/dsBaseWeb/Business/BaseStudent/BaseStudentController/BaseStudentController.go b/dsBaseWeb/Business/BaseStudent/BaseStudentController/BaseStudentController.go index aeabedb8..1bd5c816 100644 --- a/dsBaseWeb/Business/BaseStudent/BaseStudentController/BaseStudentController.go +++ b/dsBaseWeb/Business/BaseStudent/BaseStudentController/BaseStudentController.go @@ -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, + }) +} diff --git a/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoService.go b/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoService.go index 05ed4241..7b8ebe7e 100644 --- a/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoService.go +++ b/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoService.go @@ -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 +} diff --git a/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoServiceRpc.go b/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoServiceRpc.go index 93efb052..94a25c32 100644 --- a/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoServiceRpc.go +++ b/dsBaseWeb/Business/BaseStudent/BaseStudentService/BaseStudentProtoServiceRpc.go @@ -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 +} diff --git a/dsBaseWeb/Business/BaseTeacher/BaseTeacherController/BaseTeacherController.go b/dsBaseWeb/Business/BaseTeacher/BaseTeacherController/BaseTeacherController.go index 1bad0bf0..3a597ddc 100644 --- a/dsBaseWeb/Business/BaseTeacher/BaseTeacherController/BaseTeacherController.go +++ b/dsBaseWeb/Business/BaseTeacher/BaseTeacherController/BaseTeacherController.go @@ -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, + }) +} \ No newline at end of file diff --git a/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoService.go b/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoService.go index 6030c5ba..a080f7cf 100644 --- a/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoService.go +++ b/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoService.go @@ -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 } diff --git a/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoServiceRpc.go b/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoServiceRpc.go index 0eda556b..c25b2547 100644 --- a/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoServiceRpc.go +++ b/dsBaseWeb/Business/BaseTeacher/BaseTeacherService/BaseTeacherProtoServiceRpc.go @@ -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 +}