|
|
|
@ -5,6 +5,9 @@ import (
|
|
|
|
|
"dsBigData/Business/Dict/DictService"
|
|
|
|
|
"dsBigData/Business/School/SchoolModel"
|
|
|
|
|
"dsBigData/Business/School/SchoolService"
|
|
|
|
|
"dsBigData/Business/Student/StudentService"
|
|
|
|
|
"dsBigData/Business/Teacher/TeacherDao"
|
|
|
|
|
"dsBigData/Business/Teacher/TeacherService"
|
|
|
|
|
"dsBigData/Model"
|
|
|
|
|
"dsBigData/Utils/CommonUtil"
|
|
|
|
|
"encoding/json"
|
|
|
|
@ -20,12 +23,334 @@ func Routers(r *gin.RouterGroup) {
|
|
|
|
|
rr.GET("/GetEduAssistCountByCity", GetEduAssistCountByCity)
|
|
|
|
|
rr.GET("/PageStageBySchoolId", PageStageBySchoolId)
|
|
|
|
|
|
|
|
|
|
rr.GET("/GetCityBaseInfo", GetCityBaseInfo)
|
|
|
|
|
rr.GET("/GetDistrictBaseInfo", GetDistrictBaseInfo)
|
|
|
|
|
rr.GET("/GetSchoolBaseInfo", GetSchoolBaseInfo)
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func test(c *gin.Context) {
|
|
|
|
|
count, _ := TeacherDao.GetTeacherCurrentTermAddCount("150400")
|
|
|
|
|
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
List: count,
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
功能:获取市级的基本信息统计
|
|
|
|
|
*/
|
|
|
|
|
func GetCityBaseInfo(c *gin.Context) {
|
|
|
|
|
cityCode := c.Query("cityCode")
|
|
|
|
|
|
|
|
|
|
TotalCountAndCurrentTermCountArr := make([]SchoolModel.TotalCountAndCurrentTermCount, 0)
|
|
|
|
|
|
|
|
|
|
var schoolTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
schoolTotalCount, err := SchoolService.GetOrgTotalCount(cityCode, "2")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
schoolCurrentTermCount, err := SchoolService.GetOrgCurrentTermAddCount(cityCode, "2")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
schoolTotalCountAndCurrentTermCount.Title = "学校数量"
|
|
|
|
|
schoolTotalCountAndCurrentTermCount.TotalCount = schoolTotalCount
|
|
|
|
|
schoolTotalCountAndCurrentTermCount.CurrentTermAddCount = schoolCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, schoolTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var eduAssistTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
eduAssistTotalCount, err := SchoolService.GetOrgTotalCount(cityCode, "7")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
eduAssistCurrentTermCount, err := SchoolService.GetOrgCurrentTermAddCount(cityCode, "7")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
eduAssistTotalCountAndCurrentTermCount.Title = "教辅单位数量"
|
|
|
|
|
eduAssistTotalCountAndCurrentTermCount.TotalCount = eduAssistTotalCount
|
|
|
|
|
eduAssistTotalCountAndCurrentTermCount.CurrentTermAddCount = eduAssistCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, eduAssistTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var teacherTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
teacherTotalCount, err := TeacherService.GetTeacherTotalCount(cityCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
teacherCurrentTermCount, err := TeacherService.GetTeacherCurrentTermAddCount(cityCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.Title = "教职工数量"
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.TotalCount = teacherTotalCount
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.CurrentTermAddCount = teacherCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, teacherTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var studentTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
studentTotalCount, err := StudentService.GetStudentTotalCount(cityCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
studentCurrentTermCount, err := StudentService.GetStudentCurrentTermAddCount(cityCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
studentTotalCountAndCurrentTermCount.Title = "学生数量"
|
|
|
|
|
studentTotalCountAndCurrentTermCount.TotalCount = studentTotalCount
|
|
|
|
|
studentTotalCountAndCurrentTermCount.CurrentTermAddCount = studentCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, studentTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
List: TotalCountAndCurrentTermCountArr,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
功能:获取区级的基本信息统计
|
|
|
|
|
*/
|
|
|
|
|
func GetDistrictBaseInfo(c *gin.Context) {
|
|
|
|
|
districtCode := c.Query("districtCode")
|
|
|
|
|
|
|
|
|
|
TotalCountAndCurrentTermCountArr := make([]SchoolModel.TotalCountAndCurrentTermCount, 0)
|
|
|
|
|
|
|
|
|
|
var schoolTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
schoolTotalCount, err := SchoolService.GetOrgTotalCount(districtCode, "2")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
schoolCurrentTermCount, err := SchoolService.GetOrgCurrentTermAddCount(districtCode, "2")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
schoolTotalCountAndCurrentTermCount.Title = "学校数量"
|
|
|
|
|
schoolTotalCountAndCurrentTermCount.TotalCount = schoolTotalCount
|
|
|
|
|
schoolTotalCountAndCurrentTermCount.CurrentTermAddCount = schoolCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, schoolTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var eduAssistTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
eduAssistTotalCount, err := SchoolService.GetOrgTotalCount(districtCode, "7")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
eduAssistCurrentTermCount, err := SchoolService.GetOrgCurrentTermAddCount(districtCode, "7")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
eduAssistTotalCountAndCurrentTermCount.Title = "教辅单位数量"
|
|
|
|
|
eduAssistTotalCountAndCurrentTermCount.TotalCount = eduAssistTotalCount
|
|
|
|
|
eduAssistTotalCountAndCurrentTermCount.CurrentTermAddCount = eduAssistCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, eduAssistTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var teacherTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
teacherTotalCount, err := TeacherService.GetTeacherTotalCount(districtCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
teacherCurrentTermCount, err := TeacherService.GetTeacherCurrentTermAddCount(districtCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.Title = "教职工数量"
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.TotalCount = teacherTotalCount
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.CurrentTermAddCount = teacherCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, teacherTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var studentTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
studentTotalCount, err := StudentService.GetStudentTotalCount(districtCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
studentCurrentTermCount, err := StudentService.GetStudentCurrentTermAddCount(districtCode)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
studentTotalCountAndCurrentTermCount.Title = "学生数量"
|
|
|
|
|
studentTotalCountAndCurrentTermCount.TotalCount = studentTotalCount
|
|
|
|
|
studentTotalCountAndCurrentTermCount.CurrentTermAddCount = studentCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, studentTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
List: TotalCountAndCurrentTermCountArr,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
功能:获取校级的基本信息统计
|
|
|
|
|
*/
|
|
|
|
|
func GetSchoolBaseInfo(c *gin.Context) {
|
|
|
|
|
schoolId := c.Query("schoolId")
|
|
|
|
|
|
|
|
|
|
TotalCountAndCurrentTermCountArr := make([]SchoolModel.TotalCountAndCurrentTermCount, 0)
|
|
|
|
|
|
|
|
|
|
var classTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
classTotalCount, err := SchoolService.GetClassTotalCount(schoolId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
classCurrentTermCount, err := SchoolService.GetClassCurrentTermAddCount(schoolId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
classTotalCountAndCurrentTermCount.Title = "班级数量"
|
|
|
|
|
classTotalCountAndCurrentTermCount.TotalCount = classTotalCount
|
|
|
|
|
classTotalCountAndCurrentTermCount.CurrentTermAddCount = classCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, classTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var orgTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
orgTotalCount, err := SchoolService.GetOrgTotalCount(schoolId,"3")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
orgCurrentTermCount, err := SchoolService.GetOrgCurrentTermAddCount(schoolId,"3")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
orgTotalCountAndCurrentTermCount.Title = "部门数量"
|
|
|
|
|
orgTotalCountAndCurrentTermCount.TotalCount = orgTotalCount
|
|
|
|
|
orgTotalCountAndCurrentTermCount.CurrentTermAddCount = orgCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, orgTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var teacherTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
teacherTotalCount, err := TeacherService.GetTeacherTotalCount(schoolId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
teacherCurrentTermCount, err := TeacherService.GetTeacherCurrentTermAddCount(schoolId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.Title = "教职工数量"
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.TotalCount = teacherTotalCount
|
|
|
|
|
teacherTotalCountAndCurrentTermCount.CurrentTermAddCount = teacherCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, teacherTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
var studentTotalCountAndCurrentTermCount SchoolModel.TotalCountAndCurrentTermCount
|
|
|
|
|
studentTotalCount, err := StudentService.GetStudentTotalCount(schoolId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
studentCurrentTermCount, err := StudentService.GetStudentCurrentTermAddCount(schoolId)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
studentTotalCountAndCurrentTermCount.Title = "学生数量"
|
|
|
|
|
studentTotalCountAndCurrentTermCount.TotalCount = studentTotalCount
|
|
|
|
|
studentTotalCountAndCurrentTermCount.CurrentTermAddCount = studentCurrentTermCount
|
|
|
|
|
TotalCountAndCurrentTermCountArr = append(TotalCountAndCurrentTermCountArr, studentTotalCountAndCurrentTermCount)
|
|
|
|
|
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
List: TotalCountAndCurrentTermCountArr,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
功能:根据学校ID获取该学校有哪些学段
|
|
|
|
|
*/
|
|
|
|
|
*/
|
|
|
|
|
func PageStageBySchoolId(c *gin.Context) {
|
|
|
|
|
schoolId := c.Query("schoolId")
|
|
|
|
|
|
|
|
|
|