陈少旭 1 year ago
parent
commit
93d748bbbb
1 changed files with 144 additions and 0 deletions
  1. 144 0
      controllers/public_api_controller.go

+ 144 - 0
controllers/public_api_controller.go View File

@@ -75,6 +75,7 @@ func PublicApiRegistRouters() {
75 75
 	beego.Router("/handleExportData10138", &PublicApiController{}, "get:HandleExportData10138")
76 76
 
77 77
 	beego.Router("/handleData10265", &PublicApiController{}, "get:HandleData10265")
78
+	//beego.Router("/handleData10265two", &PublicApiController{}, "get:HandleData10265two")
78 79
 
79 80
 	beego.Router("/handleData10106", &PublicApiController{}, "get:HandleData10106")
80 81
 	beego.Router("/handleData10318", &PublicApiController{}, "get:HandleData10318")
@@ -92,6 +93,33 @@ func PublicApiRegistRouters() {
92 93
 	//
93 94
 	//beego.Router("/hande10138", &PublicApiController{}, "get:HandleOrderInfoData10138")
94 95
 
96
+	//935887
97
+
98
+	beego.Router("/handle10210", &PublicApiController{}, "get:Handle10210")
99
+
100
+	beego.Router("/handle10210", &PublicApiController{}, "get:Handle10210")
101
+
102
+	//beego.Router("/handle10028", &PublicApiController{}, "get:Handle10028")
103
+
104
+	beego.Router("/handleTeamData", &PublicApiController{}, "get:HandleTeamData")
105
+
106
+}
107
+
108
+func (c *PublicApiController) HandleTeamData() {
109
+
110
+	teams, _ := service.GetAllProjectTeam(10191)
111
+	var hisProjectList []*models.XtHisProjectList
112
+	for _, item := range teams {
113
+		ids := strings.Split(item.ItemId, ",")
114
+		project, _ := service.GetProjectHisListByIds(ids)
115
+		for _, sp := range project {
116
+			sp.PN = item.ProjectTeam
117
+		}
118
+		hisProjectList = append(hisProjectList, project...)
119
+	}
120
+	c.ServeSuccessJSON(map[string]interface{}{
121
+		"ps": hisProjectList,
122
+	})
95 123
 }
96 124
 
97 125
 type ResultFiveT struct {
@@ -113,6 +141,85 @@ func (c *PublicApiController) HandleSchedule() {
113 141
 
114 142
 }
115 143
 
144
+//func (c *PublicApiController) Handle10028() {
145
+//	HisPrescriptionTemplates, _ := service.GetHisPrescriptionTemplatesListTwo()
146
+//	for _, item := range HisPrescriptionTemplates {
147
+//		prescription, _ := service.GetHisPrescriptionTemplatetwo(item.ID)
148
+//		for _, subitem := range prescription {
149
+//			subitem.Status = 1
150
+//			service.CreateHisPrescriptionInfoTemplate(subitem)
151
+//		}
152
+//	}
153
+//
154
+//}
155
+
156
+func (c *PublicApiController) Handle10210() {
157
+
158
+	doctor_advices, _ := service.GetHisDoctorAdviceInfothree(10210, 1683561600)
159
+	for _, item := range doctor_advices {
160
+		strs := strings.Split(item.FeedetlSn, "-")
161
+		news := strs[0] + "-" + strs[1] + "-" + strconv.FormatInt(item.ID, 10)
162
+		item.FeedetlSn = news
163
+		service.SaveHisDoctorAdvice(item)
164
+	}
165
+
166
+	projects, _ := service.GetHisPrescriptionProjectByIDFour(10210, 1683561600)
167
+	for _, item := range projects {
168
+		strs := strings.Split(item.FeedetlSn, "-")
169
+		news := strs[0] + "-" + strs[1] + "-" + strconv.FormatInt(item.ID, 10)
170
+		item.FeedetlSn = news
171
+		service.SaveHisProject(item)
172
+	}
173
+
174
+	//doctor, _ := service.GetHisDoctorAdviceInfotwo(935886)
175
+	//index := 0
176
+	//total := 100
177
+	//for index = 0; index < total; index++ {
178
+	//	doctor.ID = 0
179
+	//	service.SaveHisDoctorAdvice(&doctor)
180
+	//}
181
+
182
+	//doctor2, _ := service.GetHisDoctorAdviceInfotwo(935887)
183
+	//index2 := 0
184
+	//total2 := 100
185
+	//for index2 = 0; index2 < total2; index2++ {
186
+	//	doctor2.ID = 0
187
+	//	service.SaveHisDoctorAdvice(&doctor2)
188
+	//}
189
+
190
+	//p, _ := service.GetHisPrescriptionProjectByID(2242486)
191
+	//index3 := 0
192
+	//total3 := 50
193
+	//for index3 = 0; index3 < total3; index3++ {
194
+	//	p.ID = 0
195
+	//	service.SaveHisProject(&p)
196
+	//}
197
+
198
+	//p2, _ := service.GetHisPrescriptionProjectByIDThree(2242487)
199
+	//index4 := 0
200
+	//total4 := 100
201
+	//for index4 = 0; index4 < total4; index4++ {
202
+	//	p2.ID = 0
203
+	//	service.SaveHisProject(&p2)
204
+	//}
205
+	//
206
+	//p3, _ := service.GetHisPrescriptionProjectByIDThree(2242488)
207
+	//index5 := 0
208
+	//total5 := 100
209
+	//for index5 = 0; index5 < total5; index5++ {
210
+	//	p3.ID = 0
211
+	//	service.SaveHisProject(&p3)
212
+	//}
213
+	//
214
+	//p4, _ := service.GetHisPrescriptionProjectByIDThree(2242489)
215
+	//index6 := 0
216
+	//total6 := 100
217
+	//for index6 = 0; index6 < total6; index6++ {
218
+	//	p4.ID = 0
219
+	//	service.SaveHisProject(&p4)
220
+	//}
221
+}
222
+
116 223
 func (c *PublicApiController) HandleOne() {
117 224
 	//fmt.Println("~~~~~~")
118 225
 	//start_time := c.GetString("start_time")
@@ -2378,6 +2485,43 @@ func (c *PublicApiController) HandleData10265() {
2378 2485
 
2379 2486
 }
2380 2487
 
2488
+//func (c *PublicApiController) HandleData10265two() {
2489
+//	orders, _ := service.GetHisOrder10265two()
2490
+//	for _, items := range orders {
2491
+//		if items.AdviceId == 0 && items.ProjectId > 0 {
2492
+//			p, _ := service.GetHisPrescriptionProjectByIDTwoone(items.ProjectId)
2493
+//			if p.Type == 2 {
2494
+//				if p.HisProject.MedicalCoverage == 1 {
2495
+//					items.ChrgitmLv = "01"
2496
+//				} else if p.HisProject.MedicalCoverage == 2 {
2497
+//					items.ChrgitmLv = "02"
2498
+//				} else {
2499
+//					items.ChrgitmLv = "03"
2500
+//				}
2501
+//			} else {
2502
+//				if p.GoodInfo.MedicalInsuranceLevel == 1 {
2503
+//					items.ChrgitmLv = "01"
2504
+//				} else if p.GoodInfo.MedicalInsuranceLevel == 2 {
2505
+//					items.ChrgitmLv = "02"
2506
+//				} else {
2507
+//					items.ChrgitmLv = "03"
2508
+//				}
2509
+//			}
2510
+//		}
2511
+//		if items.AdviceId > 0 && items.ProjectId == 0 {
2512
+//			info, _ := service.GetHisDoctorAdviceInfo(items.AdviceId)
2513
+//			if info.Drug.MedicalInsuranceLevel == 1 {
2514
+//				items.ChrgitmLv = "01"
2515
+//			} else if info.Drug.MedicalInsuranceLevel == 2 {
2516
+//				items.ChrgitmLv = "02"
2517
+//			} else {
2518
+//				items.ChrgitmLv = "03"
2519
+//			}
2520
+//		}
2521
+//		service.SaveOrderInfo(items)
2522
+//	}
2523
+//}
2524
+
2381 2525
 //func (c *PublicApiController) HandleOrderInfoData() {
2382 2526
 //	orders, _ := service.GetHisOrderInfoDetail()
2383 2527
 //	c.ServeSuccessJSON(map[string]interface{}{