csx 4 年之前
父節點
當前提交
127d47c5ac
共有 6 個文件被更改,包括 963 次插入1244 次删除
  1. 880 1216
      controllers/sz/sz_his_api_controller.go
  2. 7 0
      models/his_models.go
  3. 3 0
      models/sz_his_models.go
  4. 4 4
      routers/router.go
  5. 4 0
      service/his_service.go
  6. 65 24
      service/sz_his_service.go

文件差異過大導致無法顯示
+ 880 - 1216
controllers/sz/sz_his_api_controller.go


+ 7 - 0
models/his_models.go 查看文件

650
 	PrivatePrice          float64   `gorm:"column:private_price" json:"private_price" form:"private_price"`
650
 	PrivatePrice          float64   `gorm:"column:private_price" json:"private_price" form:"private_price"`
651
 	Creator               int64     `gorm:"column:creator" json:"creator" form:"creator"`
651
 	Creator               int64     `gorm:"column:creator" json:"creator" form:"creator"`
652
 	Modify                int64     `gorm:"column:modify" json:"modify" form:"modify"`
652
 	Modify                int64     `gorm:"column:modify" json:"modify" form:"modify"`
653
+	AccountPrice          float64   `gorm:"column:account_price" json:"account_price" form:"account_price"`
654
+
655
+	SzChargeInfo            string `gorm:"column:sz_charge_info" json:"sz_charge_info" form:"sz_charge_info"`
656
+	SzProjectInfo           string `gorm:"column:sz_project_info" json:"sz_project_info" form:"sz_project_info"`
657
+	SzMedicineInsuranceInfo string `gorm:"column:sz_medicine_insurance_info" json:"sz_medicine_insurance_info" form:"sz_medicine_insurance_info"`
653
 
658
 
654
 	SettleType      int64 `gorm:"column:settle_type" json:"settle_type" form:"settle_type"`
659
 	SettleType      int64 `gorm:"column:settle_type" json:"settle_type" form:"settle_type"`
655
 	SettleStartTime int64 `gorm:"column:settle_start_time" json:"settle_start_time" form:"settle_start_time"`
660
 	SettleStartTime int64 `gorm:"column:settle_start_time" json:"settle_start_time" form:"settle_start_time"`
699
 	ProjectId        int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
704
 	ProjectId        int64   `gorm:"column:project_id" json:"project_id" form:"project_id"`
700
 	Type             int64   `gorm:"column:type" json:"type" form:"type"`
705
 	Type             int64   `gorm:"column:type" json:"type" form:"type"`
701
 	ItemId           int64   `gorm:"column:item_id" json:"item_id" form:"item_id"`
706
 	ItemId           int64   `gorm:"column:item_id" json:"item_id" form:"item_id"`
707
+	OverPricPsnPay   float64 `gorm:"column:over_pric_psn_pay" json:"over_pric_psn_pay" form:"over_pric_psn_pay"`
708
+	AllowReimburse   float64 `gorm:"column:allow_reimburse" json:"allow_reimburse" form:"allow_reimburse"`
702
 }
709
 }
703
 
710
 
704
 func (HisOrderInfo) TableName() string {
711
 func (HisOrderInfo) TableName() string {

+ 3 - 0
models/sz_his_models.go 查看文件

14
 	ChargeOrderDate    string
14
 	ChargeOrderDate    string
15
 	DoctorCode         string
15
 	DoctorCode         string
16
 	Total              float64
16
 	Total              float64
17
+	DoseCode           string
18
+	Spec               string
19
+	CustomNumber       string
17
 }
20
 }

+ 4 - 4
routers/router.go 查看文件

1
 package routers
1
 package routers
2
 
2
 
3
 import (
3
 import (
4
-	"gdyb/controllers/sg"
4
+	"gdyb/controllers/sz"
5
 	//admin_api "XT_New/controllers/admin_api_controllers"
5
 	//admin_api "XT_New/controllers/admin_api_controllers"
6
 	"github.com/astaxie/beego"
6
 	"github.com/astaxie/beego"
7
 	"github.com/astaxie/beego/plugins/cors"
7
 	"github.com/astaxie/beego/plugins/cors"
18
 		AllowCredentials: true,
18
 		AllowCredentials: true,
19
 	}))
19
 	}))
20
 
20
 
21
-	sg.HisManagerApiRegistRouters()
22
-	sg.GdybRegistRouters()
23
-	//sz.SZHisManagerApiRegistRouters()
21
+	//sg.HisManagerApiRegistRouters()
22
+	//sg.GdybRegistRouters()
23
+	sz.SZHisManagerApiRegistRouters()
24
 
24
 
25
 }
25
 }

+ 4 - 0
service/his_service.go 查看文件

548
 	Creator               int64   `gorm:"column:creator" json:"creator" form:"creator"`
548
 	Creator               int64   `gorm:"column:creator" json:"creator" form:"creator"`
549
 	Modify                int64   `gorm:"column:modify" json:"modify" form:"modify"`
549
 	Modify                int64   `gorm:"column:modify" json:"modify" form:"modify"`
550
 
550
 
551
+	SzChargeInfo            string `gorm:"column:sz_charge_info" json:"sz_charge_info" form:"sz_charge_info"`
552
+	SzProjectInfo           string `gorm:"column:sz_project_info" json:"sz_project_info" form:"sz_project_info"`
553
+	SzMedicineInsuranceInfo string `gorm:"column:sz_medicine_insurance_info" json:"sz_medicine_insurance_info" form:"sz_medicine_insurance_info"`
554
+
551
 	HisOrderInfo        models.HisOrderInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
555
 	HisOrderInfo        models.HisOrderInfo        `gorm:"ForeignKey:ID;AssociationForeignKey:OrderId" json:"order_info"`
552
 	Patients            models.Patients            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
556
 	Patients            models.Patients            `gorm:"ForeignKey:PatientId;AssociationForeignKey:ID" json:"patient"`
553
 	HisPatient          models.HisPatient          `gorm:"ForeignKey:HisPatientId;AssociationForeignKey:ID" json:"his_patient"`
557
 	HisPatient          models.HisPatient          `gorm:"ForeignKey:HisPatientId;AssociationForeignKey:ID" json:"his_patient"`

+ 65 - 24
service/sz_his_service.go 查看文件

12
 	_ "unsafe"
12
 	_ "unsafe"
13
 )
13
 )
14
 
14
 
15
-func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_code string, account string, verify_code string) string {
15
+func SzybMZ002(doctor string, doctor_code string, fixmedins_code string, dept_code string, account string, verify_code string, serial_number string) string {
16
 	// 生成输入报文
16
 	// 生成输入报文
17
-	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
17
+	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
18
 	inputData := make(map[string]interface{})
18
 	inputData := make(map[string]interface{})
19
 	inputMessage["transType"] = "MZ002" // 交易编码
19
 	inputMessage["transType"] = "MZ002" // 交易编码
20
 
20
 
21
-	inputData["akc190"] = "G554020210305"
21
+	inputData["akc190"] = serial_number
22
 	inputData["aaz500"] = account
22
 	inputData["aaz500"] = account
23
 	inputData["bzz269"] = "000000"
23
 	inputData["bzz269"] = "000000"
24
 	inputData["aka130"] = "11"
24
 	inputData["aka130"] = "11"
71
 	str := string(respBytes)
71
 	str := string(respBytes)
72
 	return str
72
 	return str
73
 }
73
 }
74
-func SzybFY001(doctor string, doctor_code string, fixmedins_code string, datas []*models.CustomDetail, verify_code string) string {
74
+func SzybFY001(doctor string, doctor_code string, fixmedins_code string, datas []*models.CustomDetail, verify_code string, serial_number string) string {
75
 	// 生成输入报文
75
 	// 生成输入报文
76
-	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
76
+	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
77
 	inputData := make(map[string]interface{})
77
 	inputData := make(map[string]interface{})
78
 	inputMessage["transType"] = "FY001" // 交易编码
78
 	inputMessage["transType"] = "FY001" // 交易编码
79
 	inputMessage["transChannel"] = "10" // 交易编码
79
 	inputMessage["transChannel"] = "10" // 交易编码
92
 		feedetailInfo["ake001"] = item.Code
92
 		feedetailInfo["ake001"] = item.Code
93
 		feedetailInfo["ake002"] = item.CodeName
93
 		feedetailInfo["ake002"] = item.CodeName
94
 		feedetailInfo["bkm017"] = item.Code
94
 		feedetailInfo["bkm017"] = item.Code
95
-		feedetailInfo["aka070"] = "E001"
96
-		feedetailInfo["aka074"] = "75mg"
97
-
95
+		feedetailInfo["aka070"] = item.DoseCode
96
+		feedetailInfo["aka074"] = item.Spec
98
 		feedetailInfo["aka064"] = 0
97
 		feedetailInfo["aka064"] = 0
99
 		feedetailInfo["ake005"] = item.Code
98
 		feedetailInfo["ake005"] = item.Code
100
 		feedetailInfo["ake006"] = item.CodeName
99
 		feedetailInfo["ake006"] = item.CodeName
119
 		return err.Error()
118
 		return err.Error()
120
 	}
119
 	}
121
 	reader := bytes.NewReader(bytesData)
120
 	reader := bytes.NewReader(bytesData)
122
-	//url := "http://192.168.1.99:10000"
123
 	url := "http://192.168.1.228:17001/szsi-portal/transData"
121
 	url := "http://192.168.1.228:17001/szsi-portal/transData"
124
-
125
 	request, err := http.NewRequest("POST", url, reader)
122
 	request, err := http.NewRequest("POST", url, reader)
126
 	if err != nil {
123
 	if err != nil {
127
 		fmt.Println(err.Error())
124
 		fmt.Println(err.Error())
145
 	str := string(respBytes)
142
 	str := string(respBytes)
146
 	return str
143
 	return str
147
 }
144
 }
148
-func SzybFY002(doctor string, doctor_code string, fixmedins_code string, datas []*models.CustomDetail, verify_code string) string {
145
+func SzybFY002(doctor string, doctor_code string, fixmedins_code string, datas []*models.CustomDetail, verify_code string, serial_number string) string {
149
 	// 生成输入报文
146
 	// 生成输入报文
150
-	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
147
+	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
151
 	inputData := make(map[string]interface{})
148
 	inputData := make(map[string]interface{})
152
 	inputMessage["transType"] = "FY002" // 交易编码
149
 	inputMessage["transType"] = "FY002" // 交易编码
153
 
150
 
154
 	inputData["akc190"] = "G554020210305"
151
 	inputData["akc190"] = "G554020210305"
155
-	inputData["bke384"] = "G5540202103316180298"
152
+	inputData["bke384"] = serial_number
156
 	inputData["listsize"] = len(datas)
153
 	inputData["listsize"] = len(datas)
157
 
154
 
158
 	feedetail := make([]map[string]interface{}, 0)
155
 	feedetail := make([]map[string]interface{}, 0)
199
 	str := string(respBytes)
196
 	str := string(respBytes)
200
 	return str
197
 	return str
201
 }
198
 }
202
-func SzybFY004(doctor string, doctor_code string, fixmedins_code string, dept_code string, total float64, number string, verify_code string) string {
199
+func SzybFY004(doctor string, doctor_code string, fixmedins_code string, dept_code string, total float64, number string, verify_code string, serial_number string) string {
203
 	// 生成输入报文
200
 	// 生成输入报文
204
-	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
201
+	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, number)
205
 	inputData := make(map[string]interface{})
202
 	inputData := make(map[string]interface{})
206
-	inputMessage["transType"] = "2021033012131415" // 交易编码
203
+	inputMessage["transType"] = "FY004" // 交易编码
207
 
204
 
208
 	inputData["akc190"] = "G554020210305"
205
 	inputData["akc190"] = "G554020210305"
209
 	inputData["aka130"] = "11"
206
 	inputData["aka130"] = "11"
212
 	inputData["aka030"] = "12"
209
 	inputData["aka030"] = "12"
213
 	inputData["akc264"] = total
210
 	inputData["akc264"] = total
214
 	inputData["ckc601"] = "0"
211
 	inputData["ckc601"] = "0"
215
-	inputData["bke384"] = "G5540202103316180298"
212
+	inputData["bke384"] = serial_number
216
 	inputMessage["transBody"] = inputData
213
 	inputMessage["transBody"] = inputData
217
 	bytesData, err := json.Marshal(inputMessage)
214
 	bytesData, err := json.Marshal(inputMessage)
218
 	fmt.Println(string(bytesData))
215
 	fmt.Println(string(bytesData))
247
 	str := string(respBytes)
244
 	str := string(respBytes)
248
 	return str
245
 	return str
249
 }
246
 }
250
-func SzybFY005(doctor string, doctor_code string, fixmedins_code string, dept_code string, total float64, number string, verify_code string) string {
247
+func SzybFY005(doctor string, doctor_code string, fixmedins_code string, dept_code string, total float64, account string, verify_code string, serial_number string) string {
251
 	// 生成输入报文
248
 	// 生成输入报文
252
-	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
249
+	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code, serial_number)
253
 	inputData := make(map[string]interface{})
250
 	inputData := make(map[string]interface{})
254
 	inputMessage["transType"] = "FY005" // 交易编码
251
 	inputMessage["transType"] = "FY005" // 交易编码
255
 
252
 
256
-	inputData["aaz500"] = "%GAAFSAKSXSUKKWDKHDAD?;07734724145330238292?"
253
+	inputData["aaz500"] = account
257
 	inputData["bzz269"] = "000000"
254
 	inputData["bzz269"] = "000000"
258
-	inputData["akc190"] = "2021033012131415"
255
+	inputData["akc190"] = "G554020210305"
259
 
256
 
260
 	inputData["aka130"] = "11"
257
 	inputData["aka130"] = "11"
261
 	inputData["bkc320"] = doctor_code
258
 	inputData["bkc320"] = doctor_code
263
 	inputData["aka030"] = "12"
260
 	inputData["aka030"] = "12"
264
 	inputData["akc264"] = total
261
 	inputData["akc264"] = total
265
 	inputData["ckc601"] = "0"
262
 	inputData["ckc601"] = "0"
266
-	inputData["bke384"] = "G5540202103316180298"
263
+	inputData["bke384"] = serial_number
267
 
264
 
268
 	inputMessage["transBody"] = inputData
265
 	inputMessage["transBody"] = inputData
269
 
266
 
344
 	return str
341
 	return str
345
 }
342
 }
346
 
343
 
344
+func SzybJY003(doctor string, doctor_code string, fixmedins_code string, dept_code string, number string, verify_code string) string {
345
+	// 生成输入报文
346
+	inputMessage := SetSZInputMessage(doctor, doctor_code, fixmedins_code, verify_code)
347
+	inputData := make(map[string]interface{})
348
+	inputMessage["transType"] = "JY002" // 交易编码
349
+
350
+	inputData["akc190"] = "2021033012131415"
351
+	inputData["bke384"] = number
352
+
353
+	inputMessage["transBody"] = inputData
354
+	bytesData, err := json.Marshal(inputMessage)
355
+	fmt.Println(string(bytesData))
356
+	if err != nil {
357
+		fmt.Println(err.Error())
358
+		return err.Error()
359
+	}
360
+	reader := bytes.NewReader(bytesData)
361
+	//url := "http://192.168.1.99:10000"
362
+	url := "http://192.168.1.228:17001/szsi-portal/transData"
363
+
364
+	request, err := http.NewRequest("POST", url, reader)
365
+	if err != nil {
366
+		fmt.Println(err.Error())
367
+		return err.Error()
368
+	}
369
+
370
+	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
371
+
372
+	client := http.Client{}
373
+	resp, err := client.Do(request)
374
+	if err != nil {
375
+		fmt.Println(err.Error())
376
+		return err.Error()
377
+	}
378
+	respBytes, err := ioutil.ReadAll(resp.Body)
379
+	if err != nil {
380
+		fmt.Println(err.Error())
381
+		return err.Error()
382
+	}
383
+	fmt.Println(string(respBytes))
384
+	str := string(respBytes)
385
+	return str
386
+}
387
+
347
 // 生成基础报文
388
 // 生成基础报文
348
-func SetSZInputMessage(doctor string, doctor_code string, fixmedins_code string, verify_code string) map[string]interface{} {
389
+func SetSZInputMessage(doctor string, doctor_code string, fixmedins_code string, verify_code string, number string) map[string]interface{} {
349
 	month := time.Unix(1557042972, 0).Format("1")
390
 	month := time.Unix(1557042972, 0).Format("1")
350
 	year := time.Now().Format("2006")
391
 	year := time.Now().Format("2006")
351
 	month = time.Now().Format("01")
392
 	month = time.Now().Format("01")
371
 	inputMessage["operatorPass"] = ""             // 定点协议机构操作人员编码
412
 	inputMessage["operatorPass"] = ""             // 定点协议机构操作人员编码
372
 	inputMessage["serialNumber"] = fixmedins_code + year + month + day +
413
 	inputMessage["serialNumber"] = fixmedins_code + year + month + day +
373
 		fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000)) // 定点协议机构编码(5位)+日期(8位)+流水号(7位)
414
 		fmt.Sprintf("%07v", rand.New(rand.NewSource(time.Now().UnixNano())).Int31n(10000000)) // 定点协议机构编码(5位)+日期(8位)+流水号(7位)
374
-	inputMessage["serialNumber"] = "G5540202103316180298"
415
+	inputMessage["serialNumber"] = number
375
 
416
 
376
 	inputMessage["transReturnCode"] = ""                                           //
417
 	inputMessage["transReturnCode"] = ""                                           //
377
 	inputMessage["transReturnMessage"] = ""                                        //
418
 	inputMessage["transReturnMessage"] = ""                                        //