Browse Source

提交代码

陈少旭 2 months ago
parent
commit
8ba5e396db
2 changed files with 1967 additions and 807 deletions
  1. 41 4
      controllers/statistics_api_controller.go
  2. 1926 803
      service/statistis_qc_service.go

+ 41 - 4
controllers/statistics_api_controller.go View File

@@ -45,6 +45,9 @@ func StatisticsApiRegistRouters() {
45 45
 	beego.Router("/api/commonqc/dialysistreat/detail", &StatisticsApiController{}, "get:GetDialysisTreatDetail")
46 46
 
47 47
 	beego.Router("/api/commonqc/patinet/weight", &StatisticsApiController{}, "get:GetPatientWeight")
48
+
49
+	beego.Router("/api/commonqc/dryweight/detail", &StatisticsApiController{}, "get:GetPatientDryWeightDetail")
50
+
48 51
 	beego.Router("/api/commonqc/weight/detail", &StatisticsApiController{}, "get:GetPatientWeightDetail")
49 52
 	beego.Router("/api/commonqc/patinet/bp", &StatisticsApiController{}, "get:GetPatientBP")
50 53
 	beego.Router("/api/commonqc/bp/detail", &StatisticsApiController{}, "get:GetPatientBPDetail")
@@ -82,14 +85,48 @@ func (c *StatisticsApiController) GetPatientWeight() {
82 85
 		"list": item,
83 86
 	})
84 87
 }
88
+func (c *StatisticsApiController) GetPatientDryWeightDetail() {
89
+	start_time := c.GetString("start_time")
90
+	end_time := c.GetString("end_time")
91
+	dry_type, _ := c.GetInt64("dry_type")
92
+	page, _ := c.GetInt64("page")
93
+	limit, _ := c.GetInt64("limit")
94
+	timeLayout := "2006-01-02"
95
+	loc, _ := time.LoadLocation("Local")
96
+	var startTime int64
97
+	if len(start_time) > 0 {
98
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
99
+		fmt.Println("err-----------", err)
100
+		if err != nil {
101
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
102
+			return
103
+		}
104
+		startTime = theTime.Unix()
105
+	}
106
+	var endTime int64
107
+	if len(end_time) > 0 {
108
+		theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 23:59:59", loc)
109
+		if err != nil {
110
+			utils.ErrorLog(err.Error())
111
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
112
+			return
113
+		}
114
+		endTime = theTime.Unix()
115
+	}
116
+	data, total, _ := service.GetNewDialysisWeightDetailTableTenSix(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, dry_type, page, limit)
117
+	fmt.Println(data)
118
+	c.ServeSuccessJSON(map[string]interface{}{
119
+		"list":  data,
120
+		"total": total,
121
+	})
122
+}
123
+
85 124
 func (c *StatisticsApiController) GetPatientWeightDetail() {
86 125
 	start_time := c.GetString("start_time")
87 126
 	end_time := c.GetString("end_time")
88 127
 	add_type, _ := c.GetInt64("add_type")
89 128
 	dry_type, _ := c.GetInt64("dry_type")
90
-	fmt.Println("dry_type")
91
-	fmt.Println(dry_type)
92
-
129
+	item_type, _ := c.GetInt64("item_type")
93 130
 	after_type, _ := c.GetInt64("after_type")
94 131
 	page, _ := c.GetInt64("page")
95 132
 	limit, _ := c.GetInt64("limit")
@@ -117,7 +154,7 @@ func (c *StatisticsApiController) GetPatientWeightDetail() {
117 154
 		}
118 155
 		endTime = theTime.Unix()
119 156
 	}
120
-	data, total, _ := service.GetNewDialysisWeightDetailTableTen(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, dry_type, after_type, page, limit, keyword)
157
+	data, total, _ := service.GetNewDialysisWeightDetailTableTenT(c.GetAdminUserInfo().CurrentOrgId, startTime, endTime, add_type, dry_type, after_type, page, limit, keyword, item_type)
121 158
 	fmt.Println(data)
122 159
 	c.ServeSuccessJSON(map[string]interface{}{
123 160
 		"list":  data,

File diff suppressed because it is too large
+ 1926 - 803
service/statistis_qc_service.go