|
@@ -56,6 +56,9 @@ func XcxApiControllersRegisterRouters() {
|
56
|
56
|
//获取数据字典数据
|
57
|
57
|
beego.Router("/xcx/api/mobile/getdataconfig", &XcxApiController{}, "Get:GetDataConfig")
|
58
|
58
|
|
|
59
|
+ //检验检查
|
|
60
|
+ beego.Router("/xcx/api/mobile/getinspectionlist", &XcxApiController{}, "Get:GetInspectionList")
|
|
61
|
+
|
59
|
62
|
}
|
60
|
63
|
|
61
|
64
|
type XcxApiController struct {
|
|
@@ -854,3 +857,31 @@ func (this *XcxApiController) GetDataConfig() {
|
854
|
857
|
"list": configList,
|
855
|
858
|
})
|
856
|
859
|
}
|
|
860
|
+
|
|
861
|
+func (this *XcxApiController) GetInspectionList() {
|
|
862
|
+
|
|
863
|
+ start_time := this.GetString("start_time")
|
|
864
|
+ end_time := this.GetString("end_time")
|
|
865
|
+ patient_id, _ := this.GetInt64("patient_id")
|
|
866
|
+ fmt.Println("patient_id", patient_id)
|
|
867
|
+ timeLayout := "2006-01-02"
|
|
868
|
+ loc, _ := time.LoadLocation("Local")
|
|
869
|
+ startTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
870
|
+ endTime, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
|
|
871
|
+
|
|
872
|
+ list, _ := service.GetInspectionGroupList(patient_id, startTime.Unix(), endTime.Unix())
|
|
873
|
+
|
|
874
|
+ insepctionList, _ := service.GetInsepctionList(patient_id, startTime.Unix(), endTime.Unix())
|
|
875
|
+
|
|
876
|
+ for _, item := range list {
|
|
877
|
+ for _, it := range insepctionList {
|
|
878
|
+ if item.ProjectId == it.ProjectId && item.InspectDate == it.InspectDate {
|
|
879
|
+ item.Childs = append(item.Childs, it)
|
|
880
|
+ }
|
|
881
|
+ }
|
|
882
|
+ }
|
|
883
|
+
|
|
884
|
+ this.ServeSuccessJSON(map[string]interface{}{
|
|
885
|
+ "list": list,
|
|
886
|
+ })
|
|
887
|
+}
|