|
|
|
@ -7,6 +7,7 @@ import (
|
|
|
|
|
"dsBigData/Business/Teacher/TeacherModel"
|
|
|
|
|
"dsBigData/Business/Teacher/TeacherService"
|
|
|
|
|
"dsBigData/Model"
|
|
|
|
|
"dsBigData/Utils/CommonUtil"
|
|
|
|
|
"github.com/gin-gonic/gin"
|
|
|
|
|
"net/http"
|
|
|
|
|
"strings"
|
|
|
|
@ -156,10 +157,12 @@ func GetTeacherCountAggsEduAssistByDistrict(c *gin.Context) {
|
|
|
|
|
*/
|
|
|
|
|
func GetTeacherCountAggsSchoolByDistrict(c *gin.Context) {
|
|
|
|
|
districtCode := c.Query("districtCode")
|
|
|
|
|
//学校办学类型 -1:为全部
|
|
|
|
|
xxbxlx := c.Query("xxbxlx")
|
|
|
|
|
|
|
|
|
|
//获取学校的数组
|
|
|
|
|
schoolArr := make([]string, 0)
|
|
|
|
|
schoolInfo, err := SchoolService.PageSchoolInfoByDistrictCode(districtCode, "-1")
|
|
|
|
|
schoolInfo, err := SchoolService.PageSchoolInfoByDistrictCode(districtCode, xxbxlx)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
@ -197,6 +200,8 @@ func GetTeacherCountAggsSchoolByDistrict(c *gin.Context) {
|
|
|
|
|
teacherCountOrgArr = append(teacherCountOrgArr, teacherCountOrg)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CommonUtil.SortItems(teacherCountOrgArr, "Count", "desc")
|
|
|
|
|
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: true,
|
|
|
|
|
List: teacherCountOrgArr,
|
|
|
|
@ -274,9 +279,11 @@ func GetTeacherCountAggsXxbxlxByArea(c *gin.Context) {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
resMap := make(map[string]int)
|
|
|
|
|
resMapCount := make(map[string]int)
|
|
|
|
|
resMapPercent := make(map[string]string)
|
|
|
|
|
for i := range resArr {
|
|
|
|
|
resMap[resArr[i].XxbxlxCode] = resArr[i].Count
|
|
|
|
|
resMapCount[resArr[i].XxbxlxCode] = resArr[i].Count
|
|
|
|
|
resMapPercent[resArr[i].XxbxlxCode] = resArr[i].Percent
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TeacherCountArr := make([]TeacherModel.TeacherCountXxbxlx, 0)
|
|
|
|
@ -285,8 +292,11 @@ func GetTeacherCountAggsXxbxlxByArea(c *gin.Context) {
|
|
|
|
|
dictCode := xxbxlxInfo[i].DictCode
|
|
|
|
|
teacherCount.XxbxlxCode = dictCode
|
|
|
|
|
teacherCount.XxbxlxName = xxbxlxInfo[i].DictValue
|
|
|
|
|
if _, ok := resMap[dictCode]; ok {
|
|
|
|
|
teacherCount.Count = resMap[dictCode]
|
|
|
|
|
if _, ok := resMapCount[dictCode]; ok {
|
|
|
|
|
teacherCount.Count = resMapCount[dictCode]
|
|
|
|
|
}
|
|
|
|
|
if _, ok := resMapPercent[dictCode]; ok {
|
|
|
|
|
teacherCount.Percent = resMapPercent[dictCode]
|
|
|
|
|
}
|
|
|
|
|
TeacherCountArr = append(TeacherCountArr, teacherCount)
|
|
|
|
|
}
|
|
|
|
|