瀏覽代碼

Merge branch 'master' of http://git.shengws.com/csx/gdyb

csx 3 年之前
父節點
當前提交
8a6941b8da
共有 3 個文件被更改,包括 185 次插入183 次删除
  1. 3 3
      conf/app.conf
  2. 179 177
      controllers/sg/his_api_controller.go
  3. 3 3
      service/his_service.go

+ 3 - 3
conf/app.conf 查看文件

@@ -1,6 +1,6 @@
1 1
 appname = 血透
2 2
 httpport = 9532
3
-runmode = prod
3
+runmode = dev
4 4
 
5 5
 #
6 6
 copyrequestbody = true
@@ -156,8 +156,8 @@ front_end_domain = "http://xt.test.sgjyun.com/#"
156 156
 
157 157
 org_id = 4
158 158
 #url  = "http://192.168.1.228:17001/szsi-portal/transData"
159
-gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/"
160
-#gdyb_url = "http://10.97.240.206/ebus/sztest_hosp/poc/hsa/hgs/"
159
+#gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/"
160
+gdyb_url = "http://10.97.240.206/ebus/sztest_hosp/poc/hsa/hgs/"
161 161
 url = "http://192.168.1.88:6666/szsi-portal/transData"
162 162
 #gdyb_url = "http://igb.hsa.gdgov.cn/ebus/gdyb_api/prd/hsa/hgs/"
163 163
 #gdyb_url = "http://10.87.67.83:8080/mbs-hi-intf/web/api/webservices/hb/interface/"

+ 179 - 177
controllers/sg/his_api_controller.go 查看文件

@@ -11,7 +11,7 @@ import (
11 11
 	"gdyb/service"
12 12
 	"gdyb/utils"
13 13
 	"github.com/astaxie/beego"
14
-	"github.com/jinzhu/gorm"
14
+	//"github.com/jinzhu/gorm"
15 15
 	"github.com/shopspring/decimal"
16 16
 	"io"
17 17
 	"io/ioutil"
@@ -47,7 +47,7 @@ func HisManagerApiRegistRouters() {
47 47
 	beego.Router("/api/org/info", &HisApiController{}, "get:GetOrgInfo")
48 48
 	//beego.Router("/api/testcard", &HisApiController{}, "get:TestGetBasBaseInfo")
49 49
 
50
-	beego.Router("/api/readcard", &HisApiController{}, "get:ReadCard")
50
+	//beego.Router("/api/readcard", &HisApiController{}, "get:ReadCard")
51 51
 
52 52
 	//beego.Router("/api/testpay", &HisApiController{}, "get:TestPay")
53 53
 
@@ -113,9 +113,9 @@ func (c *HisApiController) CheckCardPWD() {
113 113
 		})
114 114
 		return
115 115
 	} else {
116
-		if res.Output.Baseinfo.CheckStat == "0" {
116
+		if res.Output.Result.CheckStat == "0" {
117 117
 			var msg string
118
-			switch res.Output.Baseinfo.CardStat {
118
+			switch res.Output.Result.CardStat {
119 119
 			case "00":
120 120
 				msg = "未激活"
121 121
 				break
@@ -177,169 +177,169 @@ func (c *HisApiController) CheckCardPWD() {
177 177
 
178 178
 }
179 179
 
180
-func (c *HisApiController) ReadCard() {
181
-	id_card_type, _ := c.GetInt64("id_card_type")
182
-	admin_user_id, _ := c.GetInt64("admin_user_id")
183
-	certificates, _ := c.GetInt64("certificates")
184
-
185
-	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
186
-	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
187
-	if initFlag == 0 {
188
-		c.TestGetBasBaseInit()
189
-	}
190
-	switch id_card_type {
191
-	case 1:
192
-		basStr := c.GetBasBaseInfo()
193
-		if len(basStr) == 0 {
194
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
195
-			return
196
-		}
197
-		fmt.Println(basStr)
198
-		bas := strings.Split(basStr, "|")
199
-		basNumber := bas[2]
200
-		fmt.Println(basNumber)
201
-		card_sn := bas[3]
202
-		fmt.Println(card_sn)
203
-		result := service.Gdyb1101B(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
204
-		var dat map[string]interface{}
205
-		if err := json.Unmarshal([]byte(result), &dat); err == nil {
206
-			fmt.Println(dat)
207
-		} else {
208
-			fmt.Println(err)
209
-		}
210
-
211
-		userJSONBytes, _ := json.Marshal(dat)
212
-		var res ResultTwo
213
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
214
-			utils.ErrorLog("解析失败:%v", err)
215
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
216
-			return
217
-		}
218
-
219
-		if res.Infcode == 0 {
220
-			patient, err := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
221
-			if err == gorm.ErrRecordNotFound {
222
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
223
-				return
224
-			} else if err != nil {
225
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
226
-				return
227
-
228
-			} else {
229
-				c.ServeSuccessJSON(map[string]interface{}{
230
-					"patient": patient,
231
-					"number":  basNumber,
232
-				})
233
-			}
234
-		} else {
235
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
236
-			return
237
-		}
238
-		break
239
-	case 2:
240
-		SFZStr := c.GetSFZBaseInfo()
241
-		id_card_str := strings.Split(SFZStr, "^")
242
-		id_card_number := id_card_str[0]
243
-		card_sn := ""
244
-		result := service.Gdyb1101B(id_card_number, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
245
-		var dat map[string]interface{}
246
-		if err := json.Unmarshal([]byte(result), &dat); err == nil {
247
-			fmt.Println(dat)
248
-		} else {
249
-			fmt.Println(err)
250
-		}
251
-
252
-		userJSONBytes, _ := json.Marshal(dat)
253
-		var res ResultTwo
254
-		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
255
-			utils.ErrorLog("解析失败:%v", err)
256
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
257
-			return
258
-		}
259
-
260
-		if res.Infcode == 0 {
261
-			patient, err := service.GetPatientByNumber(id_card_number, c.GetAdminUserInfo().CurrentOrgId)
262
-			if err == gorm.ErrRecordNotFound {
263
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
264
-				return
265
-			} else if err != nil {
266
-				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
267
-				return
268
-
269
-			} else {
270
-				c.ServeSuccessJSON(map[string]interface{}{
271
-					"patient": patient,
272
-					"number":  id_card_number,
273
-				})
274
-			}
275
-		} else {
276
-			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
277
-			return
278
-		}
279
-
280
-		break
281
-	case 3:
282
-		break
283
-	}
284
-
285
-}
180
+//func (c *HisApiController) ReadCard() {
181
+//	id_card_type, _ := c.GetInt64("id_card_type")
182
+//	admin_user_id, _ := c.GetInt64("admin_user_id")
183
+//	certificates, _ := c.GetInt64("certificates")
184
+//
185
+//	roles, _ := service.GetAdminUserInfoByID(c.GetAdminUserInfo().CurrentOrgId, admin_user_id)
186
+//	miConfig, _ := service.FindMedicalInsuranceInfo(c.GetAdminUserInfo().CurrentOrgId)
187
+//	if initFlag == 0 {
188
+//		c.TestGetBasBaseInit()
189
+//	}
190
+//	switch id_card_type {
191
+//	case 1:
192
+//		basStr := c.GetBasBaseInfo()
193
+//		if len(basStr) == 0 {
194
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
195
+//			return
196
+//		}
197
+//		fmt.Println(basStr)
198
+//		bas := strings.Split(basStr, "|")
199
+//		basNumber := bas[2]
200
+//		fmt.Println(basNumber)
201
+//		card_sn := bas[3]
202
+//		fmt.Println(card_sn)
203
+//		result := service.Gdyb1101B(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
204
+//		var dat map[string]interface{}
205
+//		if err := json.Unmarshal([]byte(result), &dat); err == nil {
206
+//			fmt.Println(dat)
207
+//		} else {
208
+//			fmt.Println(err)
209
+//		}
210
+//
211
+//		userJSONBytes, _ := json.Marshal(dat)
212
+//		var res ResultTwo
213
+//		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
214
+//			utils.ErrorLog("解析失败:%v", err)
215
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
216
+//			return
217
+//		}
218
+//
219
+//		if res.Infcode == 0 {
220
+//			patient, err := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
221
+//			if err == gorm.ErrRecordNotFound {
222
+//				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
223
+//				return
224
+//			} else if err != nil {
225
+//				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
226
+//				return
227
+//
228
+//			} else {
229
+//				c.ServeSuccessJSON(map[string]interface{}{
230
+//					"patient": patient,
231
+//					"number":  basNumber,
232
+//				})
233
+//			}
234
+//		} else {
235
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
236
+//			return
237
+//		}
238
+//		break
239
+//	case 2:
240
+//		SFZStr := c.GetSFZBaseInfo()
241
+//		id_card_str := strings.Split(SFZStr, "^")
242
+//		id_card_number := id_card_str[0]
243
+//		card_sn := ""
244
+//		result := service.Gdyb1101B(id_card_number, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
245
+//		var dat map[string]interface{}
246
+//		if err := json.Unmarshal([]byte(result), &dat); err == nil {
247
+//			fmt.Println(dat)
248
+//		} else {
249
+//			fmt.Println(err)
250
+//		}
251
+//
252
+//		userJSONBytes, _ := json.Marshal(dat)
253
+//		var res ResultTwo
254
+//		if err := json.Unmarshal(userJSONBytes, &res); err != nil {
255
+//			utils.ErrorLog("解析失败:%v", err)
256
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
257
+//			return
258
+//		}
259
+//
260
+//		if res.Infcode == 0 {
261
+//			patient, err := service.GetPatientByNumber(id_card_number, c.GetAdminUserInfo().CurrentOrgId)
262
+//			if err == gorm.ErrRecordNotFound {
263
+//				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeNoPateintException)
264
+//				return
265
+//			} else if err != nil {
266
+//				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeSystemError)
267
+//				return
268
+//
269
+//			} else {
270
+//				c.ServeSuccessJSON(map[string]interface{}{
271
+//					"patient": patient,
272
+//					"number":  id_card_number,
273
+//				})
274
+//			}
275
+//		} else {
276
+//			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeHisFailedException)
277
+//			return
278
+//		}
279
+//
280
+//		break
281
+//	case 3:
282
+//		break
283
+//	}
284
+//
285
+//}
286 286
 
287 287
 var initFlag int64 = 0
288 288
 
289
-func (c *HisApiController) TestGetBasBaseInit() {
290
-	DllDef := syscall.MustLoadDLL("SSCard.dll")
291
-	Iinit := DllDef.MustFindProc("Init")
292
-	ret, _, err := Iinit.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
293
-	if ret != 0 {
294
-		fmt.Println("SSCard的报错原因:", err)
295
-		fmt.Println("SSCard的运算结果为:", ret)
296
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
297
-		return
298
-	}
299
-
300
-	result := int(ret)
301
-	fmt.Println("SSCard的运算结果为1:", result)
302
-	initFlag = 1
303
-	return
304
-}
305
-
306
-func (c *HisApiController) GetSFZBaseInfo() string {
307
-	DllDef := syscall.MustLoadDLL("SSCard.dll")
308
-	readCard := DllDef.MustFindProc("ReadSFZ")
309
-	if readCard == nil {
310
-		fmt.Println("readcard is nil")
311
-		readCard = DllDef.MustFindProc("ReadSFZ")
312
-	}
313
-
314
-	str := make([]byte, 256)
315
-	str1 := make([]byte, 256)
316
-	r, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(&str1[0])), IntPtr(1024))
317
-
318
-	fmt.Println(r)
319
-	return string(str)
320
-}
321
-
322
-func (c *HisApiController) GetBasBaseInfo() string {
323
-	DllDef := syscall.MustLoadDLL("SSCard.dll")
324
-	readCard := DllDef.MustFindProc("ReadCardBas")
325
-	if readCard == nil {
326
-		fmt.Println("readcard is nil")
327
-		readCard = DllDef.MustFindProc("ReadCardBas")
328
-	}
329
-
330
-	str := make([]byte, 1024)
331
-	str1 := make([]byte, 1024)
332
-	ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), uintptr(1024), (uintptr)(unsafe.Pointer(&str1[0])), uintptr(1024))
333
-
334
-	fmt.Println(string(str1))
335
-	fmt.Println(string(str))
289
+//func (c *HisApiController) TestGetBasBaseInit() {
290
+//	DllDef := syscall.MustLoadDLL("SSCard.dll")
291
+//	Iinit := DllDef.MustFindProc("Init")
292
+//	ret, _, err := Iinit.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
293
+//	if ret != 0 {
294
+//		fmt.Println("SSCard的报错原因:", err)
295
+//		fmt.Println("SSCard的运算结果为:", ret)
296
+//		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeReadCardException)
297
+//		return
298
+//	}
299
+//
300
+//	result := int(ret)
301
+//	fmt.Println("SSCard的运算结果为1:", result)
302
+//	initFlag = 1
303
+//	return
304
+//}
336 305
 
337
-	if ret2 != 0 {
338
-		return ""
339
-	}
340
-	return string(str)
306
+//func (c *HisApiController) GetSFZBaseInfo() string {
307
+//	DllDef := syscall.MustLoadDLL("SSCard.dll")
308
+//	readCard := DllDef.MustFindProc("ReadSFZ")
309
+//	if readCard == nil {
310
+//		fmt.Println("readcard is nil")
311
+//		readCard = DllDef.MustFindProc("ReadSFZ")
312
+//	}
313
+//
314
+//	str := make([]byte, 256)
315
+//	str1 := make([]byte, 256)
316
+//	r, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), IntPtr(1024), (uintptr)(unsafe.Pointer(&str1[0])), IntPtr(1024))
317
+//
318
+//	fmt.Println(r)
319
+//	return string(str)
320
+//}
341 321
 
342
-}
322
+//func (c *HisApiController) GetBasBaseInfo() string {
323
+//	DllDef := syscall.MustLoadDLL("SSCard.dll")
324
+//	readCard := DllDef.MustFindProc("ReadCardBas")
325
+//	if readCard == nil {
326
+//		fmt.Println("readcard is nil")
327
+//		readCard = DllDef.MustFindProc("ReadCardBas")
328
+//	}
329
+//
330
+//	str := make([]byte, 1024)
331
+//	str1 := make([]byte, 1024)
332
+//	ret2, _, _ := readCard.Call((uintptr)(unsafe.Pointer(&str[0])), uintptr(1024), (uintptr)(unsafe.Pointer(&str1[0])), uintptr(1024))
333
+//
334
+//	fmt.Println(string(str1))
335
+//	fmt.Println(string(str))
336
+//
337
+//	if ret2 != 0 {
338
+//		return ""
339
+//	}
340
+//	return string(str)
341
+//
342
+//}
343 343
 
344 344
 func prttostr(vcode uintptr) string {
345 345
 	var vbyte []byte
@@ -1082,16 +1082,16 @@ func (c *HisApiController) GetHisPatientInfo() {
1082 1082
 //	return string(str), nil
1083 1083
 //}
1084 1084
 
1085
-func CardInit() int {
1086
-	DllTestDef := syscall.MustLoadDLL("SSCard.dll")
1087
-	add := DllTestDef.MustFindProc("Init")
1088
-	ret, _, err := add.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
1089
-	if err != nil {
1090
-		fmt.Println("SSCard的运算结果为:", ret)
1091
-	}
1092
-	result := int(ret)
1093
-	return result
1094
-}
1085
+//func CardInit() int {
1086
+//	DllTestDef := syscall.MustLoadDLL("SSCard.dll")
1087
+//	add := DllTestDef.MustFindProc("Init")
1088
+//	ret, _, err := add.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
1089
+//	if err != nil {
1090
+//		fmt.Println("SSCard的运算结果为:", ret)
1091
+//	}
1092
+//	result := int(ret)
1093
+//	return result
1094
+//}
1095 1095
 
1096 1096
 //func CardInit() int {
1097 1097
 //	ret, _, err := add.Call(StrPtr("http://igb.hsa.gdgov.cn/gdyb_inf/poc/api/card/initDll"), StrPtr("440200"))
@@ -1593,13 +1593,13 @@ type Result90991 struct {
1593 1593
 	InfRefmsgid string `json:"inf_refmsgid"`
1594 1594
 	Infcode     int64  `json:"infcode"`
1595 1595
 	Output      struct {
1596
-		Baseinfo struct {
1596
+		Result struct {
1597 1597
 			PsnNo     string `json:"psn_no"`
1598 1598
 			CardStat  string `json:"card_stat"`
1599 1599
 			Certno    string `json:"certno"`
1600 1600
 			PsnName   string `json:"psn_name"`
1601 1601
 			CheckStat string `json:"check_stat"`
1602
-		} `json:"baseinfo"`
1602
+		} `json:"result"`
1603 1603
 	} `json:"output"`
1604 1604
 	RefmsgTime  string      `json:"refmsg_time"`
1605 1605
 	RespondTime string      `json:"respond_time"`
@@ -2162,7 +2162,7 @@ func (c *HisApiController) GetUploadInfo() {
2162 2162
 						SettleAccountsDate:    recordDateTime,
2163 2163
 						Ctime:                 time.Now().Unix(),
2164 2164
 						Mtime:                 time.Now().Unix(),
2165
-						Status:                1,
2165
+						Status:                0,
2166 2166
 						Number:                chrg_bchno,
2167 2167
 						Infcode:               res.Infcode,
2168 2168
 						WarnMsg:               res.WarnMsg,
@@ -2365,6 +2365,7 @@ func (c *HisApiController) GetUploadInfo() {
2365 2365
 						} else {
2366 2366
 							order, _ := service.GetHisOrderTwo(adminUser.CurrentOrgId, chrg_bchno, id)
2367 2367
 							order.OrderStatus = 2
2368
+							order.Status = 1
2368 2369
 							order.MdtrtId = res.Output.Setlinfo.MdtrtID
2369 2370
 							order.SetlId = res.Output.Setlinfo.SetlID
2370 2371
 							order.PsnNo = res.Output.Setlinfo.PsnNo
@@ -3342,7 +3343,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3342 3343
 					SettleAccountsDate:  recordDateTime,
3343 3344
 					Ctime:               time.Now().Unix(),
3344 3345
 					Mtime:               time.Now().Unix(),
3345
-					Status:              1,
3346
+					Status:              0,
3346 3347
 					Number:              chrg_bchno,
3347 3348
 					Infcode:             res.Infcode,
3348 3349
 					WarnMsg:             res.WarnMsg,
@@ -3536,6 +3537,7 @@ func (c *HisApiController) GetPreUploadInfo() {
3536 3537
 						order, _ := service.GetHisOrderTwo(adminUser.CurrentOrgId, chrg_bchno, id)
3537 3538
 						order.OrderStatus = 1
3538 3539
 						order.IsPre = 1
3540
+						order.Status = 1
3539 3541
 						order.MdtrtId = res.Output.Setlinfo.MdtrtID
3540 3542
 						order.SetlId = res.Output.Setlinfo.SetlID
3541 3543
 						order.PsnNo = res.Output.Setlinfo.PsnNo
@@ -4032,7 +4034,7 @@ func (c *HisApiController) RefundDetail() {
4032 4034
 		return
4033 4035
 	}
4034 4036
 	recordDateTime := theTime.Unix()
4035
-	his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
4037
+	his, _ := service.GetNewVMHisPatientInfo(adminUser.CurrentOrgId, his_patient_id, recordDateTime)
4036 4038
 	patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
4037 4039
 	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
4038 4040
 	config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)

+ 3 - 3
service/his_service.go 查看文件

@@ -477,8 +477,8 @@ func GetVMHisPatientInfo(org_id int64, patient_id int64, record_date int64) (inf
477 477
 	return
478 478
 }
479 479
 
480
-func GetNewVMHisPatientInfo(org_id int64, patient_id int64, record_date int64) (info models.VMHisPatient, err error) {
481
-	err = readDb.Model(&models.VMHisPatient{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND id = ?", org_id, record_date, patient_id).First(&info).Error
480
+func GetNewVMHisPatientInfo(org_id int64, his_patient_id int64, record_date int64) (info models.VMHisPatient, err error) {
481
+	err = readDb.Model(&models.VMHisPatient{}).Where("user_org_id = ? AND status = 1 AND record_date = ? AND id = ?", org_id, record_date, his_patient_id).First(&info).Error
482 482
 	return
483 483
 }
484 484
 
@@ -710,7 +710,7 @@ func GetMedicalInsuranceConfig(org_id int64) (medicalInsuranceConfig models.Medi
710 710
 }
711 711
 
712 712
 func UpdataOrderStatus(id int64, number string, user_org_id int64, log string, result string) (err error) {
713
-	err = writeDb.Model(&models.HisOrder{}).Where("status = 1 AND id = ? AND user_org_id = ?", id, user_org_id).Updates(map[string]interface{}{"order_status": 3, "mtime": time.Now().Unix(), "refund_request_log": log, "refund_log": result}).Error
713
+	err = writeDb.Model(&models.HisOrder{}).Where("status = 1 AND id = ? AND user_org_id = ?", id, user_org_id).Updates(map[string]interface{}{"order_status": 3, "mtime": time.Now().Unix(), "refund_request_log": log, "refund_log": result, "status": 0}).Error
714 714
 	err = writeDb.Model(&models.HisPrescription{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"order_status": 1, "mtime": time.Now().Unix()}).Error
715 715
 	err = writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"prescription_status": 1, "mtime": time.Now().Unix()}).Error
716 716
 	return