Просмотр исходного кода

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

28169 1 год назад
Родитель
Сommit
bfb4991076
5 измененных файлов: 216 добавлений и 9 удалений
  1. 1 1
      conf/app.conf
  2. 144 0
      controllers/public_api_controller.go
  3. 69 8
      main.go
  4. 1 0
      service/app_version.go
  5. 1 0
      service/his_hospital_service.go

+ 1 - 1
conf/app.conf Просмотреть файл

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9531
3
-runmode = dev
3
+runmode = prod
4 4
 #dev/prod
5 5
 
6 6
 #

+ 144 - 0
controllers/public_api_controller.go Просмотреть файл

@@ -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{}{

+ 69 - 8
main.go Просмотреть файл

@@ -3,6 +3,7 @@ package main
3 3
 import (
4 4
 	_ "XT_New/routers"
5 5
 	"XT_New/service"
6
+	"encoding/xml"
6 7
 	"github.com/astaxie/beego"
7 8
 )
8 9
 
@@ -23,14 +24,74 @@ func main() {
23 24
 	//beego.BConfig.WebConfig.Session.SessionGCMaxLifetime = 6000
24 25
 	//beego.BConfig.WebConfig.AutoRender = false
25 26
 	//
26
-	//fmt.Println(0 % 4)
27
-	//fmt.Println(1 % 4)
28
-	//fmt.Println(2 % 4)
29
-	//fmt.Println(3 % 4)
30
-	//fmt.Println(4 % 4)
31
-	//fmt.Println(5 % 4)
32
-	//fmt.Println(6 % 4)
33
-	//fmt.Println(7 % 4)
34 27
 
35 28
 	beego.Run()
29
+
30
+}
31
+
32
+type Envelope struct {
33
+	XMLName xml.Name `xml:"soap:Envelope"`
34
+	Soap    string   `xml:"xmlns:soap,attr"`
35
+	Xsi     string   `xml:"xmlns:xsi,attr"`
36
+	Xsd     string   `xml:"xmlns:xsd,attr"`
37
+	Body    Body     `xml:"soap:Body"`
38
+}
39
+
40
+type Body struct {
41
+	XMLName      xml.Name     `xml:"soap:Body"`
42
+	GetReportReq GetReportReq `xml:"GetReportList"`
43
+}
44
+
45
+type GetReportReq struct {
46
+	XMLName       xml.Name `xml:"http://tempuri.org/ GetReportList"`
47
+	Key           string   `xml:"key"`
48
+	BeginDateTime string   `xml:"BeginDateTime"`
49
+	EndDateTime   string   `xml:"EndDateTime"`
50
+	DateType      int      `xml:"DateType"`
51
+	PrintState    int      `xml:"PrintState"`
52
+}
53
+
54
+type EnvelopeTwo struct {
55
+	XMLName xml.Name     `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
56
+	Body    EnvelopeBody `xml:"Body"`
57
+}
58
+
59
+type EnvelopeBody struct {
60
+	GetReportListResponse GetReportListResponse `xml:"GetReportListResponse"`
61
+}
62
+
63
+type GetReportListResponse struct {
64
+	XMLName             xml.Name `xml:"http://tempuri.org/ GetReportListResponse"`
65
+	GetReportListResult string   `xml:"GetReportListResult"`
66
+}
67
+
68
+type ReportData struct {
69
+	Res   int    `json:"Res"`
70
+	Error string `json:"Error"`
71
+	Data  []Data `json:"Data"`
72
+}
73
+
74
+type Data struct {
75
+	RecordID           string `json:"RecordID"`
76
+	PatientName        string `json:"PatientName"`
77
+	Sex                string `json:"Sex"`
78
+	Age                int    `json:"Age"`
79
+	AgeUnit            string `json:"AgeUnit"`
80
+	OfficeName         string `json:"OfficeName"`
81
+	BedCode            string `json:"BedCode"`
82
+	Barcode            string `json:"Barcode"`
83
+	CustomerBarcode    string `json:"CustomerBarcode"`
84
+	SampleCode         string `json:"SampleCode"`
85
+	SampleCategory     string `json:"SampleCategory"`
86
+	SampleDescription  string `json:"SampleDescription"`
87
+	Diagnostics        string `json:"Diagnostics"`
88
+	TakeSampleDateTime string `json:"TakeSampleDateTime"`
89
+	ReceiveDateTime    string `json:"ReceiveDateTime"`
90
+	AuditDateTime      string `json:"AuditDateTime"`
91
+	InspectDate        string `json:"InspectDate"`
92
+	SendDoctor         string `json:"SendDoctor"`
93
+	InspectDoctorName  string `json:"InspectDoctorName"`
94
+	AuditorName        string `json:"AuditorName"`
95
+	Instrument         string `json:"Instrument"`
96
+	Comment            string `json:"Comment"`
36 97
 }

+ 1 - 0
service/app_version.go Просмотреть файл

@@ -679,6 +679,7 @@ func (HisPrescriptionProjectTen) TableName() string {
679 679
 }
680 680
 
681 681
 func GetHisPatient11111(orgid int64) (paitent []*models.HisHospitalCheckRecord, err error) {
682
+
682 683
 	err = XTReadDB().Model(&paitent).Where("user_org_id = ?  and status = 1 AND in_hosptial_time >= '2022-12-01 00:00:00' AND in_hosptial_time <= '2022-12-31 23:59:59'", orgid).Find(&paitent).Error
683 684
 	return paitent, err
684 685
 }

+ 1 - 0
service/his_hospital_service.go Просмотреть файл

@@ -602,6 +602,7 @@ func GetHisInHospitalHistory(keyword string, startime int64, endtime int64, limi
602 602
 	if orgid > 0 {
603 603
 		db = db.Where("user_org_id = ?", orgid)
604 604
 	}
605
+
605 606
 	err = db.Count(&total).Offset(offset).Limit(limit).Order("id desc").Find(&hisPatient).Error
606 607
 	return hisPatient, total, err
607 608
 }