|
@@ -3534,33 +3534,80 @@ func (c *HisApiController) GetSettleListHospital() {
|
3534
|
3534
|
struct4101.IteminfoStruct = iteminfoStructs
|
3535
|
3535
|
struct4101.Ntly = "中国"
|
3536
|
3536
|
struct4101.AdmCaty = "A03.06"
|
3537
|
|
- result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.UserOrgId)
|
3538
|
|
- fmt.Println(result)
|
|
3537
|
+ var resOther ResultSeventeenOther
|
|
3538
|
+ var res ResultSeventeen
|
|
3539
|
+ if miConfig.MdtrtareaAdmvs == "150499" {
|
|
3540
|
+ var pp models.PublicParams
|
|
3541
|
+ pp.InsuplcAdmdvs = miConfig.InsuplcAdmdvs
|
|
3542
|
+ pp.MdtrtareaAdmvs = miConfig.MdtrtareaAdmvs
|
|
3543
|
+ pp.FixmedinsName = miConfig.OrgName
|
|
3544
|
+ pp.FixmedinsCode = miConfig.Code
|
|
3545
|
+ pp.RequestUrl = miConfig.Url
|
|
3546
|
+ pp.Cainfo = miConfig.Cainfo
|
|
3547
|
+ pp.SecretKey = miConfig.SecretKey
|
|
3548
|
+ pp.AccessKey = miConfig.AccessKey
|
|
3549
|
+ pp.OpterName = curRoles.UserName
|
|
3550
|
+ client := &http.Client{}
|
|
3551
|
+ var req *http.Request
|
|
3552
|
+ data := make(map[string]interface{})
|
|
3553
|
+ data["struct4101"] = struct4101
|
|
3554
|
+ data["pp"] = pp
|
|
3555
|
+ bytesData, _ := json.Marshal(data)
|
|
3556
|
+ req, _ = http.NewRequest("POST", "http://172.16.13.254:9532/"+"nmyb/4101", bytes.NewReader(bytesData))
|
|
3557
|
+ resp, _ := client.Do(req)
|
|
3558
|
+ defer resp.Body.Close()
|
|
3559
|
+ body, ioErr := ioutil.ReadAll(resp.Body)
|
|
3560
|
+ if ioErr != nil {
|
|
3561
|
+ utils.ErrorLog("接口返回数据读取失败: %v", ioErr)
|
|
3562
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3563
|
+ return
|
|
3564
|
+ }
|
|
3565
|
+ var respJSON map[string]interface{}
|
|
3566
|
+ if err := json.Unmarshal([]byte(body), &respJSON); err != nil {
|
|
3567
|
+ utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
|
|
3568
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3569
|
+ return
|
|
3570
|
+ }
|
3539
|
3571
|
|
3540
|
|
- var dat map[string]interface{}
|
3541
|
|
- if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
3542
|
|
- fmt.Println(dat)
|
|
3572
|
+ respJSON = respJSON["data"].(map[string]interface{})["pre"].(map[string]interface{})
|
|
3573
|
+ userJSONBytes, _ := json.Marshal(respJSON)
|
|
3574
|
+ if err := json.Unmarshal(userJSONBytes, &resOther); err != nil {
|
|
3575
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
3576
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3577
|
+ return
|
|
3578
|
+ }
|
|
3579
|
+ res.InfRefmsgid = resOther.InfRefmsgid
|
|
3580
|
+ res.Output = resOther.Output
|
|
3581
|
+ res.ErrMsg = resOther.ErrMsg
|
|
3582
|
+ infocode, _ := strconv.ParseInt(resOther.Infcode, 10, 64)
|
|
3583
|
+ res.Infcode = infocode
|
3543
|
3584
|
} else {
|
3544
|
|
- fmt.Println(err)
|
3545
|
|
- }
|
3546
|
|
- userJSONBytes, _ := json.Marshal(dat)
|
3547
|
|
- var res ResultSeventeen
|
3548
|
|
- if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
3549
|
|
- utils.ErrorLog("解析失败:%v", err)
|
3550
|
|
- c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
3551
|
|
- return
|
|
3585
|
+ result := service.Gdyb4101(struct4101, miConfig.SecretKey, miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.UserOrgId)
|
|
3586
|
+ var dat map[string]interface{}
|
|
3587
|
+ if err := json.Unmarshal([]byte(result), &dat); err == nil {
|
|
3588
|
+ fmt.Println(dat)
|
|
3589
|
+ } else {
|
|
3590
|
+ fmt.Println(err)
|
|
3591
|
+ }
|
|
3592
|
+ userJSONBytes, _ := json.Marshal(dat)
|
|
3593
|
+ if err := json.Unmarshal(userJSONBytes, &res); err != nil {
|
|
3594
|
+ utils.ErrorLog("解析失败:%v", err)
|
|
3595
|
+ c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
|
|
3596
|
+ return
|
|
3597
|
+ }
|
3552
|
3598
|
}
|
3553
|
3599
|
if res.Infcode != 0 {
|
3554
|
|
-
|
3555
|
3600
|
c.ServeSuccessJSON(map[string]interface{}{
|
3556
|
3601
|
"failed_code": -10,
|
3557
|
3602
|
"msg": res.ErrMsg,
|
3558
|
3603
|
})
|
3559
|
3604
|
return
|
3560
|
3605
|
} else {
|
3561
|
|
- order.FaPiaoNumber = zero
|
3562
|
|
- order.FaPiaoCode = last_order.FaPiaoCode
|
3563
|
|
- service.UpdateOrder(order)
|
|
3606
|
+ if miConfig.MdtrtareaAdmvs != "150499" {
|
|
3607
|
+ order.FaPiaoNumber = zero
|
|
3608
|
+ order.FaPiaoCode = last_order.FaPiaoCode
|
|
3609
|
+ service.UpdateOrder(order)
|
|
3610
|
+ }
|
3564
|
3611
|
hisFundSettleListResult := &models.HisFundSettleListResult{
|
3565
|
3612
|
Number: res.Output.SetlListId,
|
3566
|
3613
|
Status: 1,
|