Browse Source

Merge branch 'xt_statistics_branch' of http://git.shengws.com/csx/XT_New into xt_statistics_branch

csx 4 years ago
parent
commit
2e27a79bdf

+ 78 - 1
controllers/new_mobile_api_controllers/new_common_api_controller.go View File

@@ -446,7 +446,7 @@ func (this *NewCommonApiController) GetMobileProjectlsit() {
446 446
 	fourQuarterEndStr := fourQuarterEnd + " 23:59:59"
447 447
 	fourQuarterEnds, _ := utils.ParseTimeStringToTime("2006-01-02 15:04:05", fourQuarterEndStr)
448 448
 	fourQuarterEndStrUnix := fourQuarterEnds.Unix()
449
-	fmt.Println("第四季度结束时间", fourQuarterEndStrUnix)
449
+	//fmt.Println("第四季度结束时间", fourQuarterEndStrUnix)
450 450
 
451 451
 	//按季度统计
452 452
 	if itemtype == 1 {
@@ -662,3 +662,80 @@ func (this *NewCommonApiController) GetMobileMonthProjectList() {
662 662
 		"monthNolist": monthNolist,
663 663
 	})
664 664
 }
665
+
666
+func (this *NewCommonApiController) GetAllMobileMajorInspection() {
667
+	adminUser := this.GetMobileAdminUserInfo()
668
+	orgid := adminUser.Org.Id
669
+	inspection, err := service.GetMajorInspectionByOrgid(orgid)
670
+	if len(inspection) == 0 {
671
+		inspect, err := service.GetDefaultByOrgId(0)
672
+		if err != nil {
673
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
674
+			return
675
+		}
676
+		this.ServeSuccessJSON(map[string]interface{}{
677
+			"inspection": inspect,
678
+		})
679
+	} else {
680
+		if err != nil {
681
+			this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
682
+			return
683
+		}
684
+		this.ServeSuccessJSON(map[string]interface{}{
685
+			"inspection": inspection,
686
+		})
687
+	}
688
+}
689
+
690
+func (this *NewCommonApiController) GetMobilePatient() {
691
+	adminUser := this.GetMobileAdminUserInfo()
692
+	orgid := adminUser.Org.Id
693
+	startime := this.GetString("startime")
694
+	endtime := this.GetString("endtime")
695
+	startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
696
+	fmt.Println("parseDateErr", parseDateErr)
697
+	statime := startDate.Unix()
698
+	fmt.Println("开始时间", statime)
699
+	endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
700
+	entime := endDate.Unix()
701
+	fmt.Println("结束日期", entime)
702
+	limit, _ := this.GetInt64("limit")
703
+	fmt.Println("limit", limit)
704
+	page, _ := this.GetInt64("page")
705
+	fmt.Println("page", page)
706
+	patientInfo, total, err := service.GetPatientListData(orgid, statime, entime, limit, page)
707
+	info, _ := service.GetPatientListInfo(orgid, statime, entime)
708
+	if err != nil {
709
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
710
+		return
711
+	}
712
+	this.ServeSuccessJSON(map[string]interface{}{
713
+		"patientInfo": patientInfo,
714
+		"total":       total,
715
+		"list":        info,
716
+	})
717
+}
718
+
719
+func (this *NewCommonApiController) GetMobilePatientDetailCheck() {
720
+
721
+	adminUser := this.GetMobileAdminUserInfo()
722
+	orgid := adminUser.Org.Id
723
+	id, _ := this.GetInt64("id")
724
+	startime := this.GetString("startime")
725
+	endtime := this.GetString("endtime")
726
+	startDate, parseDateErr := utils.ParseTimeStringToTime("2006-01-02", startime)
727
+	fmt.Println("parseDateErr", parseDateErr)
728
+	statime := startDate.Unix()
729
+	fmt.Println("开始时间", statime)
730
+	endDate, _ := utils.ParseTimeStringToTime("2006-01-02", endtime)
731
+	entime := endDate.Unix()
732
+	fmt.Println("结束日期", entime)
733
+	checkDetail, err := service.GetPatientDetailCheck(id, orgid, statime, entime)
734
+	if err != nil {
735
+		this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
736
+		return
737
+	}
738
+	this.ServeSuccessJSON(map[string]interface{}{
739
+		"checkDetail": checkDetail,
740
+	})
741
+}

+ 3 - 0
controllers/new_mobile_api_controllers/new_common_api_router.go View File

@@ -22,4 +22,7 @@ func NewCommonApiControllersRegisterRouters() {
22 22
 	beego.Router("m/api/getmobileprojectlist", &NewCommonApiController{}, "Get:GetMobileProjectlsit")
23 23
 	beego.Router("/m/api/getmobilefirstquarter", &NewCommonApiController{}, "Get:GetMobileFirstQuarter")
24 24
 	beego.Router("/m/api/getmobilemonthprojectlist", &NewCommonApiController{}, "Get:GetMobileMonthProjectList")
25
+	beego.Router("/m/api/getallmobilemajorinspection", &NewCommonApiController{}, "Get:GetAllMobileMajorInspection")
26
+	beego.Router("/m/api/getmobilepatientlist", &NewCommonApiController{}, "Get:GetMobilePatient")
27
+	beego.Router("/m/api/getmobilepatientdetailcheck", &NewCommonApiController{}, "Get:GetMobilePatientDetailCheck")
25 28
 }