package new_mobile_api_controllers import ( "XT_New/controllers" "XT_New/enums" "XT_New/models" "XT_New/service" "XT_New/utils" "encoding/json" "fmt" "github.com/jinzhu/gorm" "strconv" "time" ) type CommonApiController struct { controllers.BaseAuthAPIController } func (this *CommonApiController) GetInspectionMajor() { adminInfo := this.GetAdminUserInfo() orgid := adminInfo.CurrentOrgId major, err := service.GetInspectionMajor(orgid) if len(major) == 0 { major, _ := service.GetInspectionMajor(0) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": major, }) } if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": major, }) } func (this *CommonApiController) GetInspectionMinor() { id, _ := this.GetInt64("id") adminInfo := this.GetAdminUserInfo() orgId := adminInfo.CurrentOrgId //查询该机构是否存在小项 major, _ := service.GetInspectionMajor(orgId) if len(major) == 0 { minor, err := service.GetInspectionMinor(id, 0) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": minor, }) } else { minor, err := service.GetInspectionMinor(id, orgId) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": minor, }) } } func (this *CommonApiController) GetInspectionRange() { id, _ := this.GetInt64("id") fmt.Println("id", id) inspectionRange, err := service.GetInspectionRange(id) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspectionRange": inspectionRange, }) } func (this *CommonApiController) SaveConfiguration() { adminInfo := this.GetAdminUserInfo() orgid := adminInfo.CurrentOrgId dataBody := make(map[string]interface{}, 0) err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody) fmt.Println("err", err) inspectionmajor := int64(dataBody["inspectionMajor"].(float64)) fmt.Println("大项", inspectionmajor) inspectionMinor := int64(dataBody["inspectionMinor"].(float64)) fmt.Println("小项", inspectionMinor) minrange := dataBody["min_range"].(string) fmt.Println("minragne", minrange) largerange := dataBody["large_range"].(string) fmt.Println("largerange", largerange) sort := dataBody["sort"].(string) sorts, err := strconv.ParseInt(sort, 10, 64) fmt.Println("sort", sort) _, errcode := service.GetConfigurationById(inspectionmajor, inspectionMinor, orgid) if errcode == gorm.ErrRecordNotFound { standard := models.XtQualityControlStandard{ InspectionMajor: inspectionmajor, InspectionMinor: inspectionMinor, MinRange: minrange, LargeRange: largerange, Sort: sorts, UserOrgId: orgid, Status: 1, CreatedTime: time.Now().Unix(), } fmt.Println(standard) err = service.SaveInspection(&standard) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "standard": standard, }) } else if errcode == nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException) return } } func (this *CommonApiController) GetConfigurationlist() { limit, _ := this.GetInt64("limit") page, _ := this.GetInt64("page") adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId configurationlist, total, err := service.GetConfigurationlist(orgid, limit, page) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "configurationlist": configurationlist, "total": total, }) } func (this *CommonApiController) GetConfigurationDetail() { id, _ := this.GetInt64("id") fmt.Println("id是", id) detail, err := service.GetConfigurationDetail(id) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "configurationdetail": detail, }) } func (this *CommonApiController) GetAllInspectionminor() { minor, err := service.GetAllInspectionMinor(0) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "minor": minor, }) } func (this *CommonApiController) UpdateConfiguration() { id, _ := this.GetInt64("id") fmt.Println("id", id) dataBody := make(map[string]interface{}, 0) err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody) fmt.Println("err", err) inspectionmajor := int64(dataBody["inspectionMajor"].(float64)) fmt.Println("大项", inspectionmajor) inspectionMinor := int64(dataBody["inspectionMinor"].(float64)) fmt.Println("小项", inspectionMinor) minrange := dataBody["min_range"].(string) fmt.Println("minragne", minrange) largerange := dataBody["large_range"].(string) fmt.Println("largerange", largerange) sort := int64(dataBody["sort"].(float64)) fmt.Println("排序", sort) adminInfo := this.GetAdminUserInfo() orgId := adminInfo.CurrentOrgId configuration, err := service.GetConfigurationByIdTwo(inspectionmajor, inspectionMinor, orgId) fmt.Println("err", err) if configuration.ID > 0 && configuration.ID != id { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } standard := models.XtQualityControlStandard{ InspectionMajor: inspectionmajor, InspectionMinor: inspectionMinor, MinRange: minrange, LargeRange: largerange, Sort: sort, } err = service.UpdarteConfiguration(&standard, id) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "standard": standard, }) } func (this *CommonApiController) DeleteConfiguration() { id, _ := this.GetInt64("id") err := service.DeleteConfiguration(id) if err != nil { this.ServeFailJsonSend(enums.ErrorCodeDBDelete, "删除失败") return } returnData := make(map[string]interface{}, 0) returnData["msg"] = "ok" this.ServeSuccessJSON(returnData) return } func (this *CommonApiController) GetAllInspectiondata() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId //查询该机构是否有数据 _, errcode := service.GetAllInspectionData(orgid) if errcode == gorm.ErrRecordNotFound { inspection, err := service.GetAllInspectiondatatwo(0) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": inspection, }) } else if errcode == nil { inspection, err := service.GetAllInspectiondatatwo(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": inspection, }) } } func (this *CommonApiController) SaveCheckConfiguration() { dataBody := make(map[string]interface{}, 0) err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody) fmt.Println("err", err) adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId inspectionmajor := int64(dataBody["inspectionMajor"].(float64)) fmt.Println("大项", inspectionmajor) frequency := dataBody["frequency"].(string) fmt.Println("凭次", frequency) sort := dataBody["sort"].(string) sorts, err := strconv.ParseInt(sort, 10, 64) fmt.Println("sort", sort) _, errcode := service.GetInspectionMajorById(inspectionmajor, orgid) if errcode == gorm.ErrRecordNotFound { configuration := models.XtCheckConfiguration{ InspectionMajor: inspectionmajor, InspectionFrequency: frequency, Sort: sorts, UserOrgId: orgid, Status: 1, CreatedTime: time.Now().Unix(), } err := service.CreateCheckConfiguration(&configuration) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "configuration": configuration, }) } else if errcode == nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException) return } } func (this *CommonApiController) GetAllCheckList() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("org", orgid) page, _ := this.GetInt64("page") limit, _ := this.GetInt64("limit") checkList, total, err := service.GetAllCheckList(orgid, page, limit) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "checklist": checkList, "total": total, }) } func (this *CommonApiController) GetCheckdetail() { id, _ := this.GetInt64("id") detail, err := service.GetCheckDetail(id) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "checkdetail": detail, }) } func (this *CommonApiController) UpdateCheck() { id, _ := this.GetInt64("id") fmt.Println(id) dataBody := make(map[string]interface{}, 0) err := json.Unmarshal(this.Ctx.Input.RequestBody, &dataBody) fmt.Println(err) inspectionmajor := int64(dataBody["inspectionMajor"].(float64)) fmt.Println("大项", inspectionmajor) frequency := dataBody["frequency"].(string) fmt.Println("凭次", frequency) sort := int64(dataBody["sort"].(float64)) fmt.Println("sort", sort) adminInfo := this.GetAdminUserInfo() orgId := adminInfo.CurrentOrgId Inspection, err := service.GetInspectionMajorByIdTwo(inspectionmajor, orgId) if Inspection.ID > 0 && Inspection.ID != id { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } configuration := models.XtCheckConfiguration{ InspectionMajor: inspectionmajor, InspectionFrequency: frequency, Sort: sort, } err = service.UpdateCheck(&configuration, id) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "configuration": configuration, }) } func (this *CommonApiController) DeleteCheck() { id, _ := this.GetInt64("id") err := service.DeleteCheck(id) if err != nil { this.ServeFailJsonSend(enums.ErrorCodeDBDelete, "删除失败") return } returnData := make(map[string]interface{}, 0) returnData["msg"] = "ok" this.ServeSuccessJSON(returnData) return } func (this *CommonApiController) GetDialysisModeType() { timeLayout := "2006-01-02" loc, _ := time.LoadLocation("Local") startime := this.GetString("startime") endtime := this.GetString("endtime") fmt.Println("endtime", endtime) startTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", startime+" 00:00:00", loc) startimes := startTimes.Unix() // fmt.Println("startime",startimes) endtimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", endtime+" 00:00:00", loc) endtimeData := endtimes.Unix() // fmt.Println("结束日期",endtimeData) adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId //统计透析总量 _, total, _ := service.GetDialysiTotal(startimes, endtimeData, orgid) modeType, err := service.GetDialysisCountMode(startimes, endtimeData, orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "total": total, "modetype": modeType, }) } func (this *CommonApiController) GetTotalLapseCount() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId startime, _ := this.GetInt64("startime") fmt.Println("startime", startime) endtime, _ := this.GetInt64("endtime") fmt.Println("endtime", endtime) //统计一个月内转出的病人 //patients, total, err := service.GetTotalRollOut(startime, endtime, orgid) //统计该机构的转出人数 patients, err := service.GetTotalRollOutPatients(orgid, startime, endtime) //统计该机构转出病人 patienttwo, err := service.GetTotalRollOutPatientsTwo(orgid, startime, endtime) //统计总共病人 // _, count, _ := service.GetPatientTotalCountTwo(orgid, startime, endtime) count := service.GetPatientTotalCount(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patients": patients, "count": count, "patienttwo": patienttwo, }) } func (this *CommonApiController) GetTotalSexCount() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("orgid", orgid) startime, _ := this.GetInt64("startime") fmt.Println("开始时间", startime) endtime, _ := this.GetInt64("endtime") fmt.Println("结束时间", endtime) total := service.GetPatientTotalCount(orgid) _, totalSex, err := service.GetManPatientTotal(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "total": total, "totalSex": totalSex, }) } func (this *CommonApiController) GetTotalInfectiouscount() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("orgid", orgid) startime, _ := this.GetInt64("startime") fmt.Println("开始时间", startime) endtime, _ := this.GetInt64("endtime") fmt.Println("结束时间", endtime) //统计透析总人数 total := service.GetPatientTotalCount(orgid) //统计透析人数传染病所占比例 count, err := service.GetPatientInfectiousCount(orgid, startime, endtime) //统计其他 _, otherTotal, err := service.GetPatientOtherInfectious(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "total": total, "count": count, "otherTotal": otherTotal, }) } func (this *CommonApiController) GetTotalAgeCount() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("orgid", orgid) startime, _ := this.GetInt64("startime") fmt.Println("开始时间", startime) endtime, _ := this.GetInt64("endtime") fmt.Println("结束时间", endtime) //统计透析总人数 total := service.GetPatientTotalCount(orgid) agecount, err := service.GetTotalAgeCount(orgid) //two, err := service.GetTotalAgeCountTwo(orgid, startime, endtime) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "total": total, "ageCount": agecount, }) } func (this *CommonApiController) GetTotalDialysisCount() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("org", orgid) startime, _ := this.GetInt64("startime") fmt.Println(startime) endtime, _ := this.GetInt64("endtime") fmt.Println(endtime) recordDateStr := time.Now().Format("2006-01-02") recordDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", recordDateStr) fmt.Println("parseDateErr", parseDateErr) nowtime := recordDate.Unix() //统计透析总人数 total := service.GetPatientTotalCount(orgid) fmt.Println("total", total) //获取该机构下的所有病人数据 patients, err := service.GetTotalDialysisAgeCount(orgid) fmt.Println("patients", patients) //统计透年龄 dataage, _ := service.GetDialysisAgeData(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "total": total, "patients": patients, "nowtime": nowtime, "dataage": dataage, }) } func (this *CommonApiController) GetCurentOrgPatients() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId patients, err := service.GetCurentOrgPatients(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patients": patients, }) } func (this *CommonApiController) GetDialysislist() { startime := this.GetString("startime") fmt.Println("startime", startime) endtime := this.GetString("endtime") fmt.Println("enditme", endtime) startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("开始时间", statime) page, _ := this.GetInt64("page") fmt.Println("page", page) limit, _ := this.GetInt64("limit") fmt.Println("limit", limit) adminUser := this.GetAdminUserInfo() orgId := adminUser.CurrentOrgId dialysislist, total, err := service.GetDialysisList(statime, entime, page, limit, orgId) prescriptionList, _ := service.GetAllDialysisList(statime, entime, orgId) list, totallist, _ := service.GetDialysisPatientList(statime, entime, page, limit, orgId) fmt.Println("err", err) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "dialysislist": dialysislist, "total": total, "list": list, "totallist": totallist, "prescriptionList": prescriptionList, }) } func (this *CommonApiController) GetLastSort() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId standard, err := service.GetLastSort(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "standard": standard, }) } func (this *CommonApiController) GetLastCheckList() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId checkList, err := service.GetLastCheckList(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "checkList": checkList, }) } func (this *CommonApiController) GetDialysisDetailById() { adminUser := this.GetAdminUserInfo() orgId := adminUser.CurrentOrgId id, _ := this.GetInt64("id") fmt.Println("id", id) startime := this.GetString("startime") fmt.Println(startime) endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("开始时间", statime) fmt.Println(endtime) limit, _ := this.GetInt64("limit") fmt.Println("limit", limit) page, _ := this.GetInt64("page") fmt.Println("page", page) patients, total, err := service.GetDialysisDetailById(id, orgId, statime, entime, limit, page) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patients": patients, "total": total, }) } func (this *CommonApiController) GetPrescritionByName() { adminUser := this.GetAdminUserInfo() orgId := adminUser.CurrentOrgId //keyword := this.GetString("keyword") patientid, _ := this.GetInt64("patientid") startime := this.GetString("startime") fmt.Println(startime) endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("开始时间", statime) fmt.Println(endtime) limit, _ := this.GetInt64("limit") fmt.Println("limit", limit) page, _ := this.GetInt64("page") fmt.Println("page", page) patient, total, err := service.GetPrescritionByName(orgId, patientid, statime, entime, limit, page) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patient": patient, "total": total, }) } func (this *CommonApiController) GetStatistics() { adminUser := this.GetAdminUserInfo() orgId := adminUser.CurrentOrgId fmt.Println("orgid", orgId) startime := this.GetString("start_time") fmt.Println(startime) endtime := this.GetString("end_time") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("结束日期", entime) value, _ := this.GetInt64("value") fmt.Println("value", value) limit, _ := this.GetInt64("limit") fmt.Println("limit", limit) page, _ := this.GetInt64("page") fmt.Println("page", page) modeId, _ := this.GetInt64("mode_id") treatinfo, total, err := service.GetTreateInfo(orgId, statime, entime, value, limit, page) statistics, ttd, _ := service.GetStatistics(orgId, statime, entime, modeId) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "statistics": statistics, "ttd": ttd, "total": total, "treatinfo": treatinfo, }) } func (this *CommonApiController) GetInspectionTatolCount() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId startime := this.GetString("startime") fmt.Println(startime) endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() //fmt.Println("开始时间", statime) //endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) //entime := endDate.Unix() endTimeYMDHmsStr := endtime + " 23:59:59" endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr) entime := endDate.Unix() fmt.Println("结束日期", entime) references, err := service.GetInspectionTotalCount(orgid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } counts, err := service.GetInspectionProjectCount(orgid, statime, entime) this.ServeSuccessJSON(map[string]interface{}{ "Inspection": references, "counts": counts, }) } func (this *CommonApiController) GetInspectionDetailById() { adminUser := this.GetAdminUserInfo() orgId := adminUser.CurrentOrgId id, _ := this.GetInt64("id") fmt.Println("id", id) startime := this.GetString("startime") endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("结束日期", entime) patientdetail, err := service.GetInspectionDetailById(id, orgId, statime, entime) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patientdetail": patientdetail, }) } func (this *CommonApiController) GetSearchPatientInfo() { adminUser := this.GetAdminUserInfo() orgId := adminUser.CurrentOrgId //keyword := this.GetString("keyword") //fmt.Println("keyword", keyword) patientid, _ := this.GetInt64("patientid") startime := this.GetString("startime") endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("结束日期", entime) PatientsInfo, err := service.GetSearchPatientInfo(orgId, patientid, statime, entime) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "PatientsInfo": PatientsInfo, }) } func (this *CommonApiController) GetAllMajorInspection() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId inspection, err := service.GetMajorInspectionByOrgid(orgid) if len(inspection) == 0 { inspect, err := service.GetDefaultByOrgId(0) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": inspect, }) } else { if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "inspection": inspection, }) } } func (this *CommonApiController) GetPatientList() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId startime := this.GetString("startime") endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) //endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) // //entime := endDate.Unix() endTimeYMDHmsStr := endtime + " 23:59:59" endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr) entime := endDate.Unix() fmt.Println("结束日期", entime) limit, _ := this.GetInt64("limit") fmt.Println("limit", limit) page, _ := this.GetInt64("page") fmt.Println("page", page) patientInfo, total, err := service.GetPatientListData(orgid, statime, entime, limit, page) info, _ := service.GetPatientListInfo(orgid, statime, entime) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patientInfo": patientInfo, "total": total, "list": info, }) } func (this *CommonApiController) GetPatientDetailCheck() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId id, _ := this.GetInt64("id") startime := this.GetString("startime") endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("结束日期", entime) checkDetail, err := service.GetPatientDetailCheck(id, orgid, statime, entime) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "checkDetail": checkDetail, }) } func (this *CommonApiController) GetSearchDetailCheck() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId keyword := this.GetString("keyword") startime := this.GetString("startime") endtime := this.GetString("endtime") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("结束日期", entime) checkDetail, err := service.GetSearchDetailCheck(orgid, keyword, statime, entime) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "checkDetail": checkDetail, }) } func (this *CommonApiController) GetNormData() { orgid := this.GetAdminUserInfo().CurrentOrgId //获取系统数据 normdata, err := service.GetNormDataByOrgId(orgid) if len(normdata) == 0 { normdata, err := service.GetNormData(0) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "normdata": normdata, }) } if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "normdata": normdata, }) } func (this *CommonApiController) GetFirstQuarter() { orgid := this.GetAdminUserInfo().CurrentOrgId lapseto, _ := this.GetInt64("lapseto") fmt.Println("转归", lapseto) startime := this.GetString("startime") fmt.Println("startime", startime) startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间=====================================", statime) endtime := this.GetString("endtime") fmt.Println("endtime", endtime) endTimeYMDHmsStr := endtime + " 23:59:59" endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr) entime := endDate.Unix() fmt.Println("结束日期", entime) //group, parseDateErr := service.GetItemNameGroup(orgid, statime, entime) //quarter, err := service.GetFirstQuarter(orgid, statime, entime) count, err := service.GetQuarterTotalCount(orgid, statime, entime, lapseto) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "count": count, }) } func (this *CommonApiController) GetProjectList() { startime := this.GetString("startime") fmt.Println("startime", startime) startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endtime := this.GetString("endtime") fmt.Println("endtime", endtime) endTimeYMDHmsStr := endtime + " 23:59:59" endDate, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endTimeYMDHmsStr) entime := endDate.Unix() fmt.Println("结束日期", entime) adminInfo := this.GetAdminUserInfo() orgid := adminInfo.CurrentOrgId fmt.Println("orgid", orgid) lapseto, _ := this.GetInt64("lapseto") fmt.Println("lapseto", lapseto) itemtype, _ := this.GetInt64("itemtype") fmt.Println("type", itemtype) modetype, _ := this.GetInt64("modetype") fmt.Println("modetype", modetype) firstQuarterStart := this.GetString("first_quarter_start") firstQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", firstQuarterStart) firstQuarterStartUnix := firstQuarterStartStr.Unix() fmt.Println("第一季度开始时间", firstQuarterStartUnix) fisrtQuarterEnd := this.GetString("first_qurter_end") fisrtQuarterEndStr := fisrtQuarterEnd + " 23:59:59" fisrtQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fisrtQuarterEndStr) fisrtQuarterEndStrUnix := fisrtQuarterEnds.Unix() fmt.Println("第一季度结束时间", fisrtQuarterEndStrUnix) secondeQuarterStart := this.GetString("second_qurter_start") secondeQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", secondeQuarterStart) secondeQuarterStartUnix := secondeQuarterStartStr.Unix() fmt.Println("第二季度开始时间", secondeQuarterStartUnix) secondQuarterEnd := this.GetString("second_qurter_end") secondQuarterEndStr := secondQuarterEnd + " 23:59:59" secondQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", secondQuarterEndStr) secondQuarterEndStrUnix := secondQuarterEnds.Unix() fmt.Println("第二季度结束时间", secondQuarterEndStrUnix) threeQuarterStart := this.GetString("three_qurter_start") threeQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", threeQuarterStart) threeQuarterStartUnix := threeQuarterStartStr.Unix() fmt.Println("第三季度开始时间", threeQuarterStartUnix) threeQuarterEnd := this.GetString("three_qurter_end") threeQuarterEndStr := threeQuarterEnd + " 23:59:59" threeQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", threeQuarterEndStr) threeQuarterEndStrUnix := threeQuarterEnds.Unix() fmt.Println("第三季度结束时间", threeQuarterEndStrUnix) fourQuarterStart := this.GetString("four_qurter_start") fourQuarterStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", fourQuarterStart) fourQuarterStartUnix := fourQuarterStartStr.Unix() fmt.Println("第四季度开始时间", fourQuarterStartUnix) fourQuarterEnd := this.GetString("four_qurter_end") fourQuarterEndStr := fourQuarterEnd + " 23:59:59" fourQuarterEnds, parseDateErr := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fourQuarterEndStr) fourQuarterEndStrUnix := fourQuarterEnds.Unix() fmt.Println("第四季度结束时间", fourQuarterEndStrUnix) //按季度统计 if itemtype == 1 { //统计总共 list, err := service.GetProjectList(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix) //统计达标个数 standList, err := service.GetProjectStandList(orgid, lapseto, modetype, statime, entime, firstQuarterStartUnix, fisrtQuarterEndStrUnix, secondeQuarterStartUnix, secondQuarterEndStrUnix, threeQuarterStartUnix, threeQuarterEndStrUnix, fourQuarterStartUnix, fourQuarterEndStrUnix) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "list": list, "standList": standList, }) } } func (this *CommonApiController) GetMonthProjectList() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("orgid", orgid) lapseto, _ := this.GetInt64("lapseto") fmt.Println("lapseto", lapseto) itemtype, _ := this.GetInt64("itemtype") fmt.Println("itemtype", itemtype) modetype, _ := this.GetInt64("modetype") fmt.Println("modetype", modetype) januaryStart := this.GetString("januaryStart") fmt.Println("一月始", januaryStart) januaryStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", januaryStart) januaryStartStrUnix := januaryStartStr.Unix() fmt.Println("一月使", januaryStartStrUnix) januaryEnd := this.GetString("januaryEnd") fmt.Println("一月末", januaryEnd) januaryEndStr := januaryEnd + " 23:59:59" januaryEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", januaryEndStr) januaryEndStrUnix := januaryEndStrs.Unix() fmt.Println("一月末", januaryEndStrUnix) febStart := this.GetString("febStart") fmt.Println("二月始", febStart) febStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", febStart) febStartStrStrUnix := febStartStr.Unix() fmt.Println("二月使", febStartStrStrUnix) febEnd := this.GetString("febEnd") fmt.Println("二月末", febEnd) febEndStr := febEnd + " 23:59:59" febEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", febEndStr) febEndStrUnix := febEndStrs.Unix() fmt.Println("二月末", febEndStrUnix) marchStart := this.GetString("marchStart") fmt.Println("三月始", marchStart) marchStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", marchStart) marchStartStrUnix := marchStartStr.Unix() fmt.Println("三月使", marchStartStrUnix) marchEnd := this.GetString("marchEnd") fmt.Println("三月末", febEnd) marchEndStr := marchEnd + " 23:59:59" marchEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", marchEndStr) marchEndStrUnix := marchEndStrs.Unix() fmt.Println("三月末", marchEndStrUnix) aprStart := this.GetString("aprStart") fmt.Println("四月始", aprStart) aprStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", aprStart) aprStartStrUnix := aprStartStr.Unix() fmt.Println("四月使", aprStartStrUnix) aprEnd := this.GetString("aprEnd") fmt.Println("四月末", aprEnd) aprEndStr := aprEnd + " 23:59:59" aprEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", aprEndStr) aprEndStrsUnix := aprEndStrs.Unix() fmt.Println("四月末", aprEndStrsUnix) mayStart := this.GetString("mayStart") fmt.Println("五月始", mayStart) mayStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", mayStart) mayStartStrUnix := mayStartStr.Unix() fmt.Println("五月使", mayStartStrUnix) mayEnd := this.GetString("mayEnd") fmt.Println("五月末", mayEnd) mayEndStr := mayEnd + " 23:59:59" mayEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", mayEndStr) mayEndStrsUnix := mayEndStrs.Unix() fmt.Println("五月末", mayEndStrsUnix) junStart := this.GetString("junStart") fmt.Println("六月始", mayStart) junStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", junStart) junStartStrUnix := junStartStr.Unix() fmt.Println("六月使", junStartStrUnix) junEnd := this.GetString("junEnd") fmt.Println("六月末", junEnd) junEndStr := junEnd + " 23:59:59" junEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", junEndStr) junEndStrsUnix := junEndStrs.Unix() fmt.Println("六月末", junEndStrsUnix) julStart := this.GetString("julStart") fmt.Println("七月始", julStart) julStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", julStart) julStartStrUnix := julStartStr.Unix() fmt.Println("七月使", julStartStrUnix) julEnd := this.GetString("julEnd") fmt.Println("七月末", julEnd) julEndStr := julEnd + " 23:59:59" julEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", julEndStr) julEndStrsUnix := julEndStrs.Unix() fmt.Println("七月末", julEndStrsUnix) augStart := this.GetString("augStart") fmt.Println("八月始", augStart) augStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", augStart) augStartStrUnix := augStartStr.Unix() fmt.Println("八月使", augStartStrUnix) augEnd := this.GetString("augEnd") fmt.Println("八月末", augEnd) augEndStr := augEnd + " 23:59:59" augEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", augEndStr) augEndStrsUnix := augEndStrs.Unix() fmt.Println("八月末", augEndStrsUnix) sepStart := this.GetString("sepStart") fmt.Println("九月始", sepStart) sepStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", sepStart) sepStartStrUnix := sepStartStr.Unix() fmt.Println("九月使", sepStartStrUnix) sepEnd := this.GetString("sepEnd") fmt.Println("九月末", sepEnd) sepEndStr := sepEnd + " 23:59:59" sepEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", sepEndStr) sepEndStrsUnix := sepEndStrs.Unix() fmt.Println("九月末", sepEndStrsUnix) octStart := this.GetString("octStart") fmt.Println("10月始", octStart) octStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", octStart) octStartStrUnix := octStartStr.Unix() fmt.Println("10月使", octStartStrUnix) octEnd := this.GetString("octEnd") fmt.Println("10月末", octEnd) octEndStr := octEnd + " 23:59:59" octEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", octEndStr) octEndStrsUnix := octEndStrs.Unix() fmt.Println("10月末", octEndStrsUnix) novStart := this.GetString("novStart") fmt.Println("11月始", novStart) novStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", novStart) novStartStrUnix := novStartStr.Unix() fmt.Println("11月使", novStartStrUnix) novEnd := this.GetString("novEnd") fmt.Println("11月末", novEnd) novEndStr := novEnd + " 23:59:59" novEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", novEndStr) novEndStrsUnix := novEndStrs.Unix() fmt.Println("10月末", novEndStrsUnix) decStart := this.GetString("decStart") fmt.Println("12月始", novStart) decStartStr, _ := utils.ParseTimeStringToTime("2006-01-02", decStart) decStartStrUnix := decStartStr.Unix() fmt.Println("12月使", decStartStrUnix) decEnd := this.GetString("decEnd") fmt.Println("12月末", novEnd) decEndStr := decEnd + " 23:59:59" decEndStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", decEndStr) decEndStrsUnix := decEndStrs.Unix() fmt.Println("12月末", decEndStrsUnix) //统计总共 monthlist, err := service.GetMonthProjectList(orgid, lapseto, modetype, januaryStartStrUnix, januaryEndStrUnix, febStartStrStrUnix, febEndStrUnix, marchStartStrUnix, marchEndStrUnix, aprStartStrUnix, aprEndStrsUnix, mayStartStrUnix, mayEndStrsUnix, junStartStrUnix, junEndStrsUnix, julStartStrUnix, julEndStrsUnix, augStartStrUnix, augEndStrsUnix, sepStartStrUnix, sepEndStrsUnix, octStartStrUnix, octEndStrsUnix, novStartStrUnix, novEndStrsUnix, decStartStrUnix, decEndStrsUnix) //统计不合格 monthNolist, err := service.GetMonthProjectListTwo(orgid, lapseto, modetype, januaryStartStrUnix, januaryEndStrUnix, febStartStrStrUnix, febEndStrUnix, marchStartStrUnix, marchEndStrUnix, aprStartStrUnix, aprEndStrsUnix, mayStartStrUnix, mayEndStrsUnix, junStartStrUnix, junEndStrsUnix, julStartStrUnix, julEndStrsUnix, augStartStrUnix, augEndStrsUnix, sepStartStrUnix, sepEndStrsUnix, octStartStrUnix, octEndStrsUnix, novStartStrUnix, novEndStrsUnix, decStartStrUnix, decEndStrsUnix) fmt.Println("monthnolist=====", monthNolist) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "monthlist": monthlist, "monthNolist": monthNolist, }) } func (this *CommonApiController) GetPatientscontrol() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("org", orgid) lapstor, _ := this.GetInt64("lapstor") fmt.Println("lapstor", lapstor) startime := this.GetString("startime") fmt.Println("开始时间", startime) startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime) startimeStrUnix := startimeStr.Unix() fmt.Println("时间搓", startimeStrUnix) endtime := this.GetString("endtime") fmt.Println("结束时间", endtime) endtimeStr := endtime + " 23:59:59" endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr) endtimeStrsUnix := endtimeStrs.Unix() fmt.Println("结束时间搓", endtimeStrsUnix) page, _ := this.GetInt64("page") fmt.Println("page", page) limit, _ := this.GetInt64("limit") fmt.Println("limit", limit) patients, total, err := service.GetPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix, page, limit) fmt.Println("============================================================") control, err := service.GetLastPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix) //获取最后一次数据 if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patients": patients, "total": total, "control": control, }) } func (this *CommonApiController) GetCartogramList() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println("orgid", orgid) lapstor, _ := this.GetInt64("lapstor") fmt.Println("lapstor", lapstor) startime := this.GetString("startime") fmt.Println("开始时间", startime) startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime) startimeStrUnix := startimeStr.Unix() fmt.Println("时间搓", startimeStrUnix) endtime := this.GetString("endtime") fmt.Println("结束时间", endtime) endtimeStr := endtime + " 23:59:59" endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr) endtimeStrsUnix := endtimeStrs.Unix() fmt.Println("结束时间搓", endtimeStrsUnix) limit, _ := this.GetInt64("limit") page, _ := this.GetInt64("page") cartogramlist, err := service.GetLastPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix) _, total, err := service.GetPatientsControl(orgid, lapstor, startimeStrUnix, endtimeStrsUnix, page, limit) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "cartogramlist": cartogramlist, "total": total, }) } func (this *CommonApiController) GetPatientContor() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println(orgid) lapstor, _ := this.GetInt64("lapstor") fmt.Println("lapstor", lapstor) patientid, _ := this.GetInt64("patientid") startime := this.GetString("startime") fmt.Println("开始时间", startime) startimeStr, _ := utils.ParseTimeStringToTime("2006-01-02", startime) startimeStrUnix := startimeStr.Unix() fmt.Println("时间搓", startimeStrUnix) endtime := this.GetString("endtime") fmt.Println("结束时间", endtime) endtimeStr := endtime + " 23:59:59" endtimeStrs, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", endtimeStr) endtimeStrsUnix := endtimeStrs.Unix() fmt.Println("结束时间搓", endtimeStrsUnix) patients, err := service.GetPatientNames(orgid, patientid) patientcontorDetail, err := service.GetLastPatientsControlTwo(orgid, patientid, startimeStrUnix, endtimeStrsUnix) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "patientcontorDetail": patientcontorDetail, "name": patients.Name, }) } func (this *CommonApiController) GetQualityControl() { adminUser := this.GetAdminUserInfo() orgid := adminUser.CurrentOrgId fmt.Println(orgid) patientid, _ := this.GetInt64("patientid") startime, _ := this.GetInt64("startime") fmt.Println("startime", startime) endtime, _ := this.GetInt64("endtime") fmt.Println("endtime", endtime) itemid, _ := this.GetInt64("itemid") fmt.Println("itemid", itemid) list, err := service.GetQualityControlById(orgid, patientid, startime, endtime, itemid) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "list": list, }) } func (this *CommonApiController) GetTreatlist() { adminuser := this.GetAdminUserInfo() orgId := adminuser.CurrentOrgId startime := this.GetString("start_time") fmt.Println(startime) endtime := this.GetString("end_time") startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime) fmt.Println("parseDateErr", parseDateErr) statime := startDate.Unix() fmt.Println("开始时间", statime) endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime) entime := endDate.Unix() fmt.Println("结束日期", entime) value, _ := this.GetInt64("value") fmt.Println("value", value) list, err := service.GetTreatList(orgId, statime, entime, value) if err != nil { this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError) return } this.ServeSuccessJSON(map[string]interface{}{ "list": list, }) }