|
@@ -480,7 +480,87 @@ func ZHHisManagerApiRegistRouters() {
|
480
|
480
|
beego.Router("/zh/api/patient/info", &ZHHisApiController{}, "get:GetZHPatientInfo")
|
481
|
481
|
beego.Router("/zh/api/readcard", &ZHHisApiController{}, "get:ReadCard")
|
482
|
482
|
|
|
483
|
+ beego.Router("/zh/api/clearsettle", &ZHHisApiController{}, "get:ClearSettle")
|
|
484
|
+
|
483
|
485
|
}
|
|
486
|
+func (c *ZHHisApiController) ClearSettle() {
|
|
487
|
+ order_id, _ := c.GetInt64("order_id")
|
|
488
|
+ admin_user_id, _ := c.GetInt64("admin_user_id")
|
|
489
|
+ adminUser := c.GetAdminUserInfo()
|
|
490
|
+ var order models.HisOrder
|
|
491
|
+ order, _ = service.GetHisOrderByID(order_id)
|
|
492
|
+ record, _ := service.GetInHospitalRecordByNumber(order.MdtrtId)
|
|
493
|
+ roles, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, admin_user_id)
|
|
494
|
+ miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
|
|
495
|
+ config, _ := service.GetMedicalInsuranceConfig(adminUser.CurrentOrgId)
|
|
496
|
+ if config.IsOpen == 1 { //对接了医保,走医保流程
|
|
497
|
+ var result string
|
|
498
|
+ var requestLog string
|
|
499
|
+ result, requestLog = service.Gdyb90306(order.PsnNo, order.MdtrtId, order.SetlId, miConfig.OrgName, roles.UserName, miConfig.SecretKey, miConfig.Code, record.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs)
|
|
500
|
+ saveLog(result, requestLog, "90306", "撤销结算清单")
|
|
501
|
+
|
|
502
|
+ var dat map[string]interface{}
|
|
503
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
504
|
+ fmt.Println(dat)
|
|
505
|
+ } else {
|
|
506
|
+ fmt.Println(err)
|
|
507
|
+ }
|
|
508
|
+
|
|
509
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
510
|
+
|
|
511
|
+ var res ResultSixteen
|
|
512
|
+ var resSixteen ResultSixteen10265
|
|
513
|
+ if miConfig.Code == "H15049901371" {
|
|
514
|
+ if err := json.Unmarshal(userJSONBytes, &resSixteen); err != nil {
|
|
515
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
516
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
517
|
+ return
|
|
518
|
+ }
|
|
519
|
+ res.Cainfo = resSixteen.Cainfo
|
|
520
|
+ res.WarnMsg = resSixteen.WarnMsg
|
|
521
|
+ res.Output = resSixteen.Output
|
|
522
|
+ res.ErrMsg = resSixteen.ErrMsg
|
|
523
|
+ res.RespondTime = resSixteen.RespondTime
|
|
524
|
+ Infcode, _ := strconv.ParseInt(resSixteen.Infcode, 10, 64)
|
|
525
|
+ res.Infcode = Infcode
|
|
526
|
+
|
|
527
|
+ } else {
|
|
528
|
+
|
|
529
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
530
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
531
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
532
|
+ return
|
|
533
|
+ }
|
|
534
|
+
|
|
535
|
+ }
|
|
536
|
+
|
|
537
|
+ if res.Infcode == 0 {
|
|
538
|
+
|
|
539
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
540
|
+ "msg": "撤销成功",
|
|
541
|
+ })
|
|
542
|
+
|
|
543
|
+ } else {
|
|
544
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
545
|
+ "code": -10,
|
|
546
|
+ "msg": res.ErrMsg,
|
|
547
|
+ })
|
|
548
|
+ }
|
|
549
|
+
|
|
550
|
+ } else {
|
|
551
|
+ err := service.UpdataOrderStatus(order_id, order.Number, adminUser.CurrentOrgId, "", "")
|
|
552
|
+ if err == nil {
|
|
553
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
554
|
+ "msg": "退费成功",
|
|
555
|
+ })
|
|
556
|
+ } else {
|
|
557
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
558
|
+ return
|
|
559
|
+ }
|
|
560
|
+ }
|
|
561
|
+
|
|
562
|
+}
|
|
563
|
+
|
484
|
564
|
func (c *ZHHisApiController) GetZHPatientInfo() {
|
485
|
565
|
id_card_no := c.GetString("id_card_no")
|
486
|
566
|
admin_user_id, _ := c.GetInt64("admin_user_id")
|