|
|
|
@ -83,10 +83,14 @@ func GetStudentCountAggsOrgByDistrict(c *gin.Context) {
|
|
|
|
|
districtCode := c.Query("districtCode")
|
|
|
|
|
//学校办学类型 -1:为全部
|
|
|
|
|
xxbxlx := c.Query("xxbxlx")
|
|
|
|
|
directly := ""
|
|
|
|
|
if strings.HasSuffix(districtCode, "00") { //市
|
|
|
|
|
directly = "1"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取学校的数组
|
|
|
|
|
schoolArr := make([]string, 0)
|
|
|
|
|
schoolInfo, err := SchoolService.PageSchoolInfoByDistrictCode(districtCode, xxbxlx)
|
|
|
|
|
schoolInfo, err := SchoolService.PageSchoolInfoByDistrictCode(districtCode, xxbxlx, directly)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
@ -138,42 +142,42 @@ func GetStudentCountAggsOrgByDistrict(c *gin.Context) {
|
|
|
|
|
*/
|
|
|
|
|
func GetStudentCountAggsXxbxlxByArea(c *gin.Context) {
|
|
|
|
|
areaCode := c.Query("areaCode")
|
|
|
|
|
|
|
|
|
|
directly := c.Query("directly")
|
|
|
|
|
|
|
|
|
|
cityCode := ""
|
|
|
|
|
districtCode := ""
|
|
|
|
|
if strings.HasSuffix(areaCode, "00") { //市
|
|
|
|
|
if directly == "1" {
|
|
|
|
|
districtCode = areaCode
|
|
|
|
|
} else {
|
|
|
|
|
cityCode = areaCode
|
|
|
|
|
}
|
|
|
|
|
cityCode = areaCode
|
|
|
|
|
} else { //区
|
|
|
|
|
districtCode = areaCode
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取区的数组
|
|
|
|
|
districtArr := make([]string, 0)
|
|
|
|
|
if len(cityCode) > 0 {
|
|
|
|
|
//获取区信息
|
|
|
|
|
areaInfo, err := AreaService.PageDistrictByCityCode(cityCode, "-1")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
for i := range areaInfo {
|
|
|
|
|
districtArr = append(districtArr, areaInfo[i].AreaCode)
|
|
|
|
|
//directly=1说明获取的是中省市,不需要根据市编码获取区的数组
|
|
|
|
|
if directly == "1" {
|
|
|
|
|
if len(cityCode) > 0 {
|
|
|
|
|
//获取区信息
|
|
|
|
|
areaInfo, err := AreaService.PageDistrictByCityCode(cityCode, "-1")
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|
Message: err.Error(),
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
for i := range areaInfo {
|
|
|
|
|
districtArr = append(districtArr, areaInfo[i].AreaCode)
|
|
|
|
|
}
|
|
|
|
|
districtArr = append(districtArr, areaCode)
|
|
|
|
|
}
|
|
|
|
|
districtArr = append(districtArr, areaCode)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//获取学校的数组
|
|
|
|
|
schoolArr := make([]string, 0)
|
|
|
|
|
if len(districtCode) > 0 {
|
|
|
|
|
schoolInfo, err := SchoolService.PageSchoolInfoByDistrictCode(districtCode, "-1")
|
|
|
|
|
schoolInfo, err := SchoolService.PageSchoolInfoByDistrictCode(districtCode, "-1", directly)
|
|
|
|
|
if err != nil {
|
|
|
|
|
c.JSON(http.StatusOK, Model.Res{
|
|
|
|
|
Success: false,
|
|
|
|
|