浏览代码

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

test_user 6 天前
父节点
当前提交
993b97da72
共有 2 个文件被更改,包括 157 次插入145 次删除
  1. 132 53
      controllers/sg/his_api_controller.go
  2. 25 92
      service/ah_dianzichufang.go

+ 132 - 53
controllers/sg/his_api_controller.go 查看文件

@@ -34,8 +34,6 @@ import (
34 34
 	"syscall"
35 35
 	"time"
36 36
 	"unsafe"
37
-	"github.com/go-ole/go-ole"
38
-
39 37
 )
40 38
 
41 39
 type HisApiController struct {
@@ -5380,7 +5378,7 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5380 5378
 	struct3505.Bchno = "---"
5381 5379
 	struct3505.FixmedinsCode = miConfig.Code
5382 5380
 	struct3505.Code = miConfig.Code
5383
-	struct3505.FinlTrnsPric =  strconv.FormatFloat(drug.HisDoctorAdviceInfo.Price, 'f', -1, 64)
5381
+	struct3505.FinlTrnsPric = strconv.FormatFloat(drug.HisDoctorAdviceInfo.Price, 'f', -1, 64)
5384 5382
 
5385 5383
 	roles, _ := service.GetAdminUserInfoByID(org_id, pre.Creator)
5386 5384
 	struct3505.PrscDrName = roles.UserName
@@ -5494,8 +5492,7 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5494 5492
 
5495 5493
 	}
5496 5494
 
5497
-
5498
-	if org_id == 10610 || org_id == 10278 || org_id == 10138 || org_id == 10537{
5495
+	if org_id == 10610 || org_id == 10278 || org_id == 10138 || org_id == 10537 {
5499 5496
 
5500 5497
 		if drug.HisDoctorAdviceInfo.BaseDrugLib.IsZeroFlag == 1 {
5501 5498
 			struct3505.TrdnFlag = "1"
@@ -5508,8 +5505,6 @@ func SaleStock(org_id int64, pre models.HisPrescription, drug *models.DrugFlow,
5508 5505
 
5509 5506
 	}
5510 5507
 
5511
-
5512
-
5513 5508
 	struct3505.RtalDocno = order.Number
5514 5509
 	struct3505.PsnCertType = "01"
5515 5510
 
@@ -8085,7 +8080,7 @@ func (c *HisApiController) GetCFYLJG001() {
8085 8080
 			drug.MedinsListCodg = subItem.BaseDrugLib.MedicalInsuranceNumber
8086 8081
 			drug.RxItemTypeCode = "11"
8087 8082
 
8088
-			drug.DrugDosform = "乳膏剂" //TODO
8083
+			drug.DrugDosform = "剂" //TODO
8089 8084
 			if subItem.BaseDrugLib.MinUnit != subItem.BaseDrugLib.DoseUnit {
8090 8085
 				drug.DrugSpec = subItem.BaseDrugLib.Dose + subItem.BaseDrugLib.DoseUnit + "*" + strconv.FormatInt(subItem.BaseDrugLib.MinNumber, 10) + subItem.BaseDrugLib.MinUnit + "/" + subItem.BaseDrugLib.MaxUnit
8091 8086
 			}
@@ -8157,18 +8152,6 @@ func (c *HisApiController) GetCFYLJG001() {
8157 8152
 		cFYLJG001.Mdtrtinfo.MaindiagCode = "N18.500"
8158 8153
 		cFYLJG001.Mdtrtinfo.MaindiagName = "慢性肾脏病5期"
8159 8154
 
8160
-		//memo := make(map[string]interface{})
8161
-		//inputData := make(map[string]interface{}, 0)
8162
-
8163
-		//type MyData struct {
8164
-		//	Insutype string `json:"insutype"`
8165
-		//}
8166
-		//
8167
-		//	data := MyData{
8168
-		//	Insutype: his.Insutype,
8169
-		//}
8170
-		//
8171
-
8172 8155
 		diagnosis_ids := strings.Split(info.Diagnosis, ",")
8173 8156
 		var config []*models.HisXtDiagnoseConfig
8174 8157
 		for _, item := range diagnosis_ids {
@@ -8208,8 +8191,49 @@ func (c *HisApiController) GetCFYLJG001() {
8208 8191
 			}
8209 8192
 		}
8210 8193
 		if miConfig.MdtrtareaAdmvs == "340699" {
8211
-			//result, request := service.GetAHCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
8212
-			//saveLog(result, request, "GetCFYLJG001", "GetCFYLJG001")
8194
+			result, request := service.GetAHCFYLJG001("http://10.66.149.64:8080/epc/api", cFYLJG001, his.Insutype)
8195
+			saveLog(result, request, "GetCFYLJG001", "GetCFYLJG001")
8196
+			var res ResultCFYLJG001
8197
+			var respJSON2 map[string]interface{}
8198
+			if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8199
+				utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8200
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8201
+				return
8202
+			}
8203
+			userJSONBytes2, _ := json.Marshal(respJSON2)
8204
+			if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
8205
+				utils.ErrorLog("解析失败:%v", err)
8206
+				c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8207
+				return
8208
+			}
8209
+			if res.Infcode == -1 {
8210
+				c.ServeSuccessJSON(map[string]interface{}{
8211
+					"failed_code": -10,
8212
+					"msg":         res.ErrMsg,
8213
+				})
8214
+				return
8215
+
8216
+			} else {
8217
+				var flow models.HisPrescriptionFlow
8218
+				flow.Ctime = time.Now().Unix()
8219
+				flow.SignDigest = ""
8220
+				flow.RxTraceCode = res.Output.RxTraceCode
8221
+				flow.HiRxno = res.Output.HiRxno
8222
+				flow.MID = his.Number
8223
+				flow.Status = 1
8224
+				flow.DCode = doctor_info.DoctorNumber
8225
+				flow.OriginalRxFile = ""
8226
+				flow.OriginalValue = ""
8227
+				flow.SignCertDn = ""
8228
+				flow.UserOrgId = c.GetAdminUserInfo().CurrentOrgId
8229
+				flow.SignCertSn = ""
8230
+				flow.Mtime = time.Now().Unix()
8231
+
8232
+				service.Createflow(&flow)
8233
+				c.ServeSuccessJSON(map[string]interface{}{
8234
+					"msg": "上传成功",
8235
+				})
8236
+			}
8213 8237
 
8214 8238
 		} else {
8215 8239
 			result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001, his.Insutype)
@@ -8246,7 +8270,7 @@ func (c *HisApiController) GetCFYLJG001() {
8246 8270
 				flow.OriginalRxFile = ""
8247 8271
 				flow.OriginalValue = ""
8248 8272
 				flow.SignCertDn = ""
8249
-				flow.UserOrgId = 10454
8273
+				flow.UserOrgId = c.GetAdminUserInfo().CurrentOrgId
8250 8274
 				flow.SignCertSn = ""
8251 8275
 				flow.Mtime = time.Now().Unix()
8252 8276
 
@@ -8257,9 +8281,9 @@ func (c *HisApiController) GetCFYLJG001() {
8257 8281
 			}
8258 8282
 		}
8259 8283
 
8260
-
8261 8284
 	}
8262 8285
 }
8286
+
8263 8287
 func (c *HisApiController) GetCFYLJG002() {
8264 8288
 	admin_user_id, _ := c.GetInt64("admin_user_id")
8265 8289
 	his_patient_id, _ := c.GetInt64("his_patient_id")
@@ -8330,9 +8354,42 @@ func (c *HisApiController) GetCFYLJG002() {
8330 8354
 	fmt.Println(err)
8331 8355
 
8332 8356
 	if miConfig.MdtrtareaAdmvs == "340699" {
8333
-		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8334
-		//saveLog(result, request, "GetCFYLJG002", "GetCFYLJG002")
8357
+		result, request := service.GetAHCFYLJG002(miConfig.Code, "http://10.66.149.64:8080/epc/api", encoded, rx_encoded, "")
8358
+		saveLog(result, request, "GetCFYLJG002", "GetCFYLJG002")
8335 8359
 
8360
+		var res2 Result002
8361
+		var respJSON2 map[string]interface{}
8362
+		if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8363
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8364
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8365
+			return
8366
+		}
8367
+		userJSONBytes2, _ := json.Marshal(respJSON2)
8368
+		if err := json.Unmarshal(userJSONBytes2, &res2); err != nil {
8369
+			utils.ErrorLog("解析失败:%v", err)
8370
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8371
+			return
8372
+		}
8373
+		if res2.Infcode == 0 {
8374
+			flow.Ctime = time.Now().Unix()
8375
+			flow.SignDigest = res2.Output.SignDigest
8376
+			flow.RxFile = res2.Output.RxFile
8377
+			flow.MID = his.Number
8378
+			flow.Status = 1
8379
+			flow.DCode = doctor_info.DoctorNumber
8380
+			flow.OriginalRxFile = rx_encoded
8381
+			flow.OriginalValue = encoded
8382
+			flow.SignCertDn = res2.Output.SignCertDn
8383
+			flow.SignCertSn = res2.Output.SignCertSn
8384
+			flow.Mtime = time.Now().Unix()
8385
+			service.Saveflow(flow)
8386
+			c.ServeSuccessJSON(map[string]interface{}{
8387
+				"msg": "预签名成功",
8388
+			})
8389
+		} else {
8390
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8391
+			return
8392
+		}
8336 8393
 	} else {
8337 8394
 		result, request := service.GetCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8338 8395
 		//result, request := service.GetCFYLJG001(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG001,his.Insutype)
@@ -8414,15 +8471,26 @@ func (c *HisApiController) GetCFYLJG003() {
8414 8471
 	cFYLJG003.Certno = his.Certno
8415 8472
 	cFYLJG003.FixmedinsName = miConfig.OrgName
8416 8473
 	cFYLJG003.FixmedinsCode = miConfig.Code
8417
-
8418 8474
 	cFYLJG003.DrCode = doctor_info.DoctorNumber
8419 8475
 	cFYLJG003.PrscDrName = doctor_info.UserName
8420 8476
 	cFYLJG003.PharDeptName = dept.Name
8421 8477
 	cFYLJG003.PharDeptCode = dept.Number
8422
-	cFYLJG003.PharCode = "HY440309002107"
8423
-	cFYLJG003.PharCertType = "01"
8424
-	cFYLJG003.PharCertno = "430482199408260023"
8425
-	cFYLJG003.PharName = "彭斯遥"
8478
+
8479
+	if c.GetAdminUserInfo().CurrentOrgId == 10721 {
8480
+		cFYLJG003.PharName = "孙莉侠"
8481
+		cFYLJG003.PharPracCertNo = "060399"
8482
+		cFYLJG003.PharCode = "HY440309002107"
8483
+		cFYLJG003.PharCertType = "01"
8484
+		cFYLJG003.PharCertno = "430482199408260023"
8485
+	} else {
8486
+		cFYLJG003.PharName = "彭斯遥"
8487
+		cFYLJG003.PharPracCertNo = "30220200943042010052"
8488
+		cFYLJG003.PharCode = "HY440309002107"
8489
+		cFYLJG003.PharCertType = "01"
8490
+		cFYLJG003.PharCertno = "430482199408260023"
8491
+
8492
+	}
8493
+
8426 8494
 	cFYLJG003.PsnCertType = "01"
8427 8495
 	cFYLJG003.RxFile = flow.RxFile
8428 8496
 	cFYLJG003.SignDigest = flow.SignDigest
@@ -8436,9 +8504,32 @@ func (c *HisApiController) GetCFYLJG003() {
8436 8504
 	cFYLJG003.PharChkTime = timeFormatTwo
8437 8505
 
8438 8506
 	if miConfig.MdtrtareaAdmvs == "340699" {
8439
-		//result, request := service.GetAHCFYLJG002(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, encoded, rx_encoded, "")
8440
-		//result, request := service.GetAHCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8441
-		//saveLog(result, request, "GetAHCFYLJG003", "GetAHCFYLJG003")
8507
+		result, request := service.GetAHCFYLJG003("http://10.66.149.64:8080/epc/api", cFYLJG003)
8508
+		saveLog(result, request, "GetAHCFYLJG003", "GetAHCFYLJG003")
8509
+		var res ResultCFYLJG003
8510
+		var respJSON2 map[string]interface{}
8511
+		if err := json.Unmarshal([]byte(string(result)), &respJSON2); err != nil {
8512
+			utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
8513
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8514
+			return
8515
+		}
8516
+		userJSONBytes2, _ := json.Marshal(respJSON2)
8517
+		if err := json.Unmarshal(userJSONBytes2, &res); err != nil {
8518
+			utils.ErrorLog("解析失败:%v", err)
8519
+			c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
8520
+			return
8521
+		}
8522
+		if res.Infcode == -1 {
8523
+			c.ServeSuccessJSON(map[string]interface{}{
8524
+				"failed_code": -10,
8525
+				"msg":         res.ErrMsg,
8526
+			})
8527
+			return
8528
+		} else {
8529
+			c.ServeSuccessJSON(map[string]interface{}{
8530
+				"info": res.Output,
8531
+			})
8532
+		}
8442 8533
 	} else {
8443 8534
 		result, request := service.GetCFYLJG003(miConfig.OrgName, curRoles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, cFYLJG003)
8444 8535
 		saveLog(result, request, "GetCFYLJG003", "GetCFYLJG003")
@@ -8469,7 +8560,6 @@ func (c *HisApiController) GetCFYLJG003() {
8469 8560
 
8470 8561
 	}
8471 8562
 
8472
-
8473 8563
 }
8474 8564
 func (c *HisApiController) GetCFYLJG004() {
8475 8565
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -8545,7 +8635,6 @@ func (c *HisApiController) GetCFYLJG004() {
8545 8635
 		}
8546 8636
 	}
8547 8637
 
8548
-
8549 8638
 }
8550 8639
 func (c *HisApiController) GetCFYLJG005() {
8551 8640
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -8606,7 +8695,6 @@ func (c *HisApiController) GetCFYLJG005() {
8606 8695
 		}
8607 8696
 	}
8608 8697
 
8609
-
8610 8698
 }
8611 8699
 func (c *HisApiController) GetCFYLJG006() {
8612 8700
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -8664,7 +8752,6 @@ func (c *HisApiController) GetCFYLJG006() {
8664 8752
 		}
8665 8753
 	}
8666 8754
 
8667
-
8668 8755
 }
8669 8756
 func (c *HisApiController) GetCFYLJG007() {
8670 8757
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -8723,7 +8810,6 @@ func (c *HisApiController) GetCFYLJG007() {
8723 8810
 		}
8724 8811
 	}
8725 8812
 
8726
-
8727 8813
 }
8728 8814
 
8729 8815
 func (c *HisApiController) GetCFYLJG008() {
@@ -9165,8 +9251,6 @@ func (c *HisApiController) Get3103() {
9165 9251
 	}
9166 9252
 }
9167 9253
 
9168
-
9169
-
9170 9254
 func (c *HisApiController) Get4201A() {
9171 9255
 	order_id, _ := c.GetInt64("order_id")
9172 9256
 	admin_user_id, _ := c.GetInt64("admin_user_id")
@@ -14849,7 +14933,7 @@ func (c *HisApiController) ReadCard() {
14849 14933
 			fmt.Println(card_sn)
14850 14934
 			patient, _ := service.GetPatientByNumber(basNumber, c.GetAdminUserInfo().CurrentOrgId)
14851 14935
 
14852
-			result, _ := service.Jxyb11012(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, patient.Name,card)
14936
+			result, _ := service.Jxyb11012(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, "1", miConfig.Url, miConfig.AccessKey, patient.Name, card)
14853 14937
 
14854 14938
 			//result := service.Jxyb1101(basNumber, miConfig.OrgName, roles.UserName, miConfig.Code, miConfig.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, card_sn, certificates)
14855 14939
 			var dat map[string]interface{}
@@ -15236,8 +15320,6 @@ func (c *HisApiController) ReadCard() {
15236 15320
 				return
15237 15321
 			}
15238 15322
 
15239
-
15240
-
15241 15323
 		} else if miConfig.MdtrtareaAdmvs == "430800" {
15242 15324
 			fmt.Println(initFlag)
15243 15325
 			fmt.Println("initFlag")
@@ -27530,7 +27612,7 @@ func (c *HisApiController) GetRegisterInfo() {
27530 27612
 					}
27531 27613
 					var result string
27532 27614
 					var requestLog string
27533
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
27615
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
27534 27616
 						var hisPrescription []*models.HisPrescription
27535 27617
 						res3101 := Checkgd3101ForOne(c, patient.ID, his, admin_user_id, "1", record_time, hisPrescription, department)
27536 27618
 						if res3101.Infcode == 0 {
@@ -27659,8 +27741,6 @@ func (c *HisApiController) GetRegisterInfo() {
27659 27741
 
27660 27742
 						for _, item := range rf {
27661 27743
 
27662
-
27663
-
27664 27744
 							if item.Insutype == insutype {
27665 27745
 								insuplc_admdvs_temp = item.InsuplcAdmdvs
27666 27746
 
@@ -27668,10 +27748,9 @@ func (c *HisApiController) GetRegisterInfo() {
27668 27748
 
27669 27749
 						}
27670 27750
 
27671
-						if len(insuplc_admdvs_tt) > 0{
27751
+						if len(insuplc_admdvs_tt) > 0 {
27672 27752
 							insuplc_admdvs_temp = insuplc_admdvs_tt
27673 27753
 
27674
-
27675 27754
 						}
27676 27755
 
27677 27756
 						result, requestLog = service.Gdyb2201A(psn_info.PsnNo, insutype, IdCardNo, miConfig.OrgName, roles.UserName, ipt_otp_no, department.Name, miConfig.Code, department.Number, doctor_info.DoctorNumber, insuplc_admdvs_temp, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, id_card_type, doctor_info.UserName, record_time_two, psn_info.VerifyNumber, admin_user_id)
@@ -31132,7 +31211,7 @@ func (c *HisApiController) GetUploadInfo() {
31132 31211
 					}
31133 31212
 					result2, src_resquest = service.Gdyb2207(his.PsnNo, his.Number, chrg_bchno, cert_no, insutype, allTotal, miConfig.OrgName, roles.UserName, miConfig.Code, his.InsuplcAdmdvs, miConfig.MdtrtareaAdmvs, miConfig.SecretKey, med_type, his.IdCardType, tempOrder.FulamtOwnpayAmt, tempOrder.OverlmtSelfPay, tempOrder.PreselfpayAmt, tempOrder.InscpScpAmt, his.IdType, acct_used_flag, "", admin_user_id)
31134 31213
 				} else {
31135
-					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
31214
+					if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
31136 31215
 						result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "7", tempOrder.ID)
31137 31216
 						if result3101.Infcode == 0 {
31138 31217
 							if len(result3101.Output.Result) > 0 {
@@ -33123,7 +33202,7 @@ func (c *HisApiController) GetPreUploadInfo() {
33123 33202
 						res.Infcode = infocode
33124 33203
 
33125 33204
 					} else {
33126
-						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255"  ||  miConfig.Code == "H44082500483"{
33205
+						if miConfig.Code == "H44030903432" || miConfig.Code == "H44030501364" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
33127 33206
 							result3101 := Checkgd3101(c, id, his_patient_id, admin_user_id, "2", record_time, prescriptions)
33128 33207
 							if result3101.Infcode == 0 {
33129 33208
 								if len(result3101.Output.Result) > 0 {
@@ -34593,7 +34672,7 @@ func (c *HisApiController) GetPreUploadInfo() {
34593 34672
 
34594 34673
 							psn_info, _ := service.GetPsnByPatientId(his.PatientId)
34595 34674
 							allTotal = fmt.Sprintf("%.2f", total_two)
34596
-							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" ||  miConfig.Code == "H44082500483" {
34675
+							if miConfig.Code == "H44030501364" || miConfig.Code == "H44030903432" || miConfig.Code == "H44030500255" || miConfig.Code == "H44082500483" {
34597 34676
 
34598 34677
 								result3101 := Checkgd3102(c, id, his_patient_id, admin_user_id, "6", order.ID)
34599 34678
 								if result3101.Infcode == 0 {
@@ -40029,7 +40108,7 @@ func (c *HisApiController) GetSettleAccounts() {
40029 40108
 		res.Output.Setlinfo.PsnCashPay = order.PsnCashPay
40030 40109
 
40031 40110
 		if res.Infcode == 0 {
40032
-			if adminUser.CurrentOrgId == 10215 || adminUser.CurrentOrgId == 10387 || adminUser.CurrentOrgId == 9919 || adminUser.CurrentOrgId == 10088 || adminUser.CurrentOrgId == 10150 || adminUser.CurrentOrgId == 10454 || adminUser.CurrentOrgId == 10644 || adminUser.CurrentOrgId == 10653 || adminUser.CurrentOrgId == 10210{
40111
+			if adminUser.CurrentOrgId == 10215 || adminUser.CurrentOrgId == 10387 || adminUser.CurrentOrgId == 9919 || adminUser.CurrentOrgId == 10088 || adminUser.CurrentOrgId == 10150 || adminUser.CurrentOrgId == 10454 || adminUser.CurrentOrgId == 10644 || adminUser.CurrentOrgId == 10653 || adminUser.CurrentOrgId == 10210 {
40033 40112
 				c.ServeSuccessJSON(map[string]interface{}{
40034 40113
 					"diagnosis":            name,
40035 40114
 					"order_infos":          orderInfos,

+ 25 - 92
service/ah_dianzichufang.go 查看文件

@@ -7,20 +7,10 @@ import (
7 7
 	"gdyb/models"
8 8
 	"io/ioutil"
9 9
 	"net/http"
10
-	//"strconv"
11
-	"time"
12
-
13
-
10
+	"os/exec"
14 11
 )
15 12
 
16
-func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, cFYLJG001 models.CFYLJG001, isu string, cainfo string) (string, string) {
17
-	// 生成签名
18
-	timestamp := time.Now().Unix()
19
-	//tempTime := time.Unix(timestamp, 0)
20
-	//timeFormatOne := tempTime.Format("2006-01-02 15:04:05")
21
-
22
-	// 生成输入报文
23
-	inputMessage := SetAHInputMessage(timestamp, org_name, opera, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
13
+func GetAHCFYLJG001(url string, cFYLJG001 models.CFYLJG001, isu string) (string, string) {
24 14
 	inputData := make(map[string]interface{}, 0)
25 15
 	inputData["mdtrtCertType"] = cFYLJG001.MdtrtCertType
26 16
 	inputData["mdtrtCertNo"] = cFYLJG001.MdtrtCertNo
@@ -46,17 +36,11 @@ func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insupl
46 36
 	inputData["valiDays"] = cFYLJG001.ValiDays
47 37
 	inputData["valiEndTime"] = cFYLJG001.ValiEndTime
48 38
 	inputData["reptFlag"] = cFYLJG001.ReptFlag
49
-
50 39
 	inputData["maxReptCnt"] = cFYLJG001.MaxReptCnt
51 40
 	inputData["minInrvDays"] = cFYLJG001.MinInrvDays
52 41
 	inputData["rxCotnFlag"] = cFYLJG001.RxCotnFlag
53 42
 	inputData["longRxFlag"] = cFYLJG001.LongRxFlag
54
-
55
-	//inputData["reptd_cnt"] = cFYLJG001.ReptdCnt
56
-	//inputData["mdtrtareaNo"] = cFYLJG001.MdtrtareaNo
57
-
58 43
 	rxdrugdetail := make([]map[string]interface{}, 0)
59
-
60 44
 	rxdrug := make(map[string]interface{})
61 45
 	for _, item := range cFYLJG001.List {
62 46
 		rxdrug["medListCodg"] = item.MedListCodg
@@ -67,11 +51,9 @@ func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insupl
67 51
 		rxdrug["tcmdrugTypeName"] = item.TcmdrugTypeName
68 52
 		rxdrug["tcmdrugTypeCode"] = item.TcmdrugTypeCode
69 53
 		rxdrug["tcmherbFoote"] = item.TcmherbFoote
70
-
71 54
 		rxdrug["mednTypeCode"] = item.MednTypeCode
72 55
 		rxdrug["mednTypeName"] = item.MednTypeName
73 56
 		rxdrug["mainMedcFlag"] = item.MainMedcFlag
74
-
75 57
 		rxdrug["urgtFlag"] = item.UrgtFlag
76 58
 		rxdrug["basMednFlag"] = item.BasMednFlag
77 59
 		rxdrug["impDrugFlag"] = item.ImpDrugFlag
@@ -95,18 +77,12 @@ func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insupl
95 77
 		rxdrug["drugPric"] = item.DrugPric
96 78
 		rxdrug["drugSumamt"] = item.DrugSumamt
97 79
 		rxdrug["hospApprFlag"] = item.HospApprFlag
98
-
99 80
 		rxdrug["selfPayRea"] = ""
100 81
 		rxdrug["realDscr"] = ""
101
-
102
-		//rxdrug["genname_codg"] = item.GennameCodg
103
-		//rxdrug["drug_totlcnt"] = item.DrugTotlcnt
104
-		//rxdrug["drug_totlcnt_emp"] = item.DrugTotlcntEmp
105 82
 		rxdrug["extras"] = ""
106 83
 		rxdrugdetail = append(rxdrugdetail, rxdrug)
107 84
 	}
108 85
 	inputData["rxdrugdetail"] = rxdrugdetail
109
-
110 86
 	mdtrtinfo := make(map[string]interface{})
111 87
 	mdtrtinfo["fixmedinsCode"] = cFYLJG001.Mdtrtinfo.FixmedinsCode
112 88
 	mdtrtinfo["fixmedinsName"] = cFYLJG001.Mdtrtinfo.FixmedinsName
@@ -162,9 +138,7 @@ func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insupl
162 138
 
163 139
 	mdtrtinfo["extras"] = data
164 140
 	inputData["mdtrtinfo"] = mdtrtinfo
165
-
166 141
 	diseinfos := make([]map[string]interface{}, 0)
167
-
168 142
 	for _, item := range cFYLJG001.Diseinfo {
169 143
 		diseinfo := make(map[string]interface{})
170 144
 		diseinfo["diagType"] = item.DiagType
@@ -174,7 +148,6 @@ func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insupl
174 148
 		diseinfo["diagName"] = item.DiagName
175 149
 		diseinfo["diagDept"] = item.DiagDept
176 150
 		diseinfo["diagDeptCode"] = ""
177
-
178 151
 		diseinfo["diagDrNo"] = item.DiagDrNo
179 152
 		diseinfo["diagDrName"] = item.DiagDrName
180 153
 		diseinfo["diagTime"] = item.DiagTime
@@ -185,30 +158,24 @@ func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insupl
185 158
 		diseinfos = append(diseinfos, diseinfo)
186 159
 	}
187 160
 	inputData["diseinfo"] = diseinfos
188
-
189
-	inputMessage["input"] = inputData
190
-	argInputMessage := make(map[string]interface{})
191
-	argInputMessage["arg0"] = inputMessage
192
-
193 161
 	var inputLog string
194
-	bytesData, err := json.Marshal(argInputMessage)
162
+	bytesData, err := json.Marshal(inputData)
195 163
 	inputLog = string(bytesData)
196
-	fmt.Println(string(bytesData))
164
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "19D43125C3E64BB784601F7B19A8D785", "6014F1F2CA6247F8960AF61A306B5DCC", "Ns0K7Gsxk1WSfxYYyBcCL3J4Q/2Tvp1bMe8JbakA9Fg=", inputLog)
165
+	out, err := cmd.Output()
166
+	fmt.Println(string(out))
197 167
 	if err != nil {
198
-		fmt.Println(err.Error())
168
+		fmt.Println("error:", err.Error())
199 169
 		return err.Error(), ""
200 170
 	}
201
-	reader := bytes.NewReader(bytesData)
202
-
203
-	url = url + "7101"
171
+	reader := bytes.NewReader(out)
172
+	url = url + "/fixmedins/uploadChk"
204 173
 	request, err := http.NewRequest("POST", url, reader)
205 174
 	if err != nil {
206 175
 		fmt.Println(err.Error())
207 176
 		return err.Error(), ""
208 177
 	}
209
-
210 178
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
211
-
212 179
 	client := http.Client{}
213 180
 	resp, err := client.Do(request)
214 181
 	if err != nil {
@@ -220,48 +187,37 @@ func GetAHCFYLJG001(org_name string, opera string, fixmedins_code string, insupl
220 187
 		fmt.Println(err.Error())
221 188
 		return err.Error(), ""
222 189
 	}
223
-	fmt.Println(string(respBytes))
224 190
 	str := string(respBytes)
225 191
 	return str, inputLog
226
-
227 192
 }
228 193
 
229
-func GetAHCFYLJG002(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, original_value string, original_rx_file string, extras string, cainfo string) (string, string) {
194
+func GetAHCFYLJG002(fixmedins_code string, url string, original_value string, original_rx_file string, extras string) (string, string) {
230 195
 	// 生成签名
231
-	timestamp := time.Now().Unix()
232 196
 	// 生成输入报文
233
-	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
234
-
235 197
 	inputData := make(map[string]interface{})
236
-	inputDatas := make(map[string]interface{})
237
-
238
-	inputMessage["infno"] = "7102"
239 198
 	inputData["fixmedinsCode"] = fixmedins_code
240 199
 	inputData["originalValue"] = original_value
241 200
 	inputData["originalRxFile"] = original_rx_file
242 201
 	inputData["extras"] = extras
243
-	inputDatas["data"] = inputData
244
-	inputMessage["input"] = inputDatas
245
-	argInputMessage := make(map[string]interface{})
246
-	argInputMessage["arg0"] = inputMessage
247 202
 	var inputLog string
248
-	bytesData, err := json.Marshal(argInputMessage)
203
+	bytesData, err := json.Marshal(inputData)
249 204
 	inputLog = string(bytesData)
250 205
 	fmt.Println(string(bytesData))
251 206
 	if err != nil {
252 207
 		fmt.Println(err.Error())
253 208
 		return err.Error(), ""
254 209
 	}
255
-	reader := bytes.NewReader(bytesData)
256
-	url = url + "7102"
257
-	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
210
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "19D43125C3E64BB784601F7B19A8D785", "6014F1F2CA6247F8960AF61A306B5DCC", "Ns0K7Gsxk1WSfxYYyBcCL3J4Q/2Tvp1bMe8JbakA9Fg=", inputLog)
211
+	out, err := cmd.Output()
212
+	fmt.Println(string(out))
213
+	reader := bytes.NewReader(out)
214
+	url = url + "/fixmedins/rxFixmedinsSign"
258 215
 	request, err := http.NewRequest("POST", url, reader)
259 216
 	if err != nil {
260 217
 		fmt.Println(err.Error())
261 218
 		return err.Error(), ""
262 219
 	}
263 220
 	request.Header.Set("Content-Type", "application/json;charset=UTF-8")
264
-
265 221
 	client := http.Client{}
266 222
 	resp, err := client.Do(request)
267 223
 	if err != nil {
@@ -276,20 +232,10 @@ func GetAHCFYLJG002(org_name string, doctor string, fixmedins_code string, insup
276 232
 	fmt.Println(string(respBytes))
277 233
 	str := string(respBytes)
278 234
 	return str, inputLog
279
-
280 235
 }
281 236
 
282
-func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, cFYLJG003 models.CFYLJG003, cainfo string) (string, string) {
283
-	//生成签名
284
-	timestamp := time.Now().Unix()
285
-	// 生成输入报文
286
-	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
287
-
237
+func GetAHCFYLJG003(url string, cFYLJG003 models.CFYLJG003) (string, string) {
288 238
 	inputData := make(map[string]interface{})
289
-	inputData2 := make(map[string]interface{})
290
-
291
-	inputMessage["infno"] = "7103"
292
-
293 239
 	inputData["rxTraceCode"] = cFYLJG003.RxTraceCode
294 240
 	inputData["hiRxno"] = cFYLJG003.HiRxno
295 241
 	inputData["mdtrtId"] = cFYLJG003.MdtrtID
@@ -314,19 +260,19 @@ func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insup
314 260
 	inputData["signDigest"] = cFYLJG003.SignDigest
315 261
 	inputData["extras"] = ""
316 262
 
317
-	//inputData["rx_frqu_name"] = cFYLJG003.RxFrquName
318
-	inputData2["data"] = inputData
319
-	inputMessage["input"] = inputData2
320 263
 	var inputLog string
321
-	bytesData, err := json.Marshal(inputMessage)
264
+	bytesData, err := json.Marshal(inputData)
322 265
 	inputLog = string(bytesData)
323
-	fmt.Println(string(bytesData))
266
+	cmd := exec.Command("java", "-jar", "yh_hb_fat.jar", "19D43125C3E64BB784601F7B19A8D785", "6014F1F2CA6247F8960AF61A306B5DCC", "Ns0K7Gsxk1WSfxYYyBcCL3J4Q/2Tvp1bMe8JbakA9Fg=", inputLog)
267
+	out, err := cmd.Output()
268
+	fmt.Println(string(out))
269
+
324 270
 	if err != nil {
325 271
 		fmt.Println(err.Error())
326 272
 		return err.Error(), ""
327 273
 	}
328 274
 	reader := bytes.NewReader(bytesData)
329
-	url = url + "7102"
275
+	url = url + "/fixmedins/rxFileUpld"
330 276
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
331 277
 	request, err := http.NewRequest("POST", url, reader)
332 278
 	if err != nil {
@@ -352,16 +298,9 @@ func GetAHCFYLJG003(org_name string, doctor string, fixmedins_code string, insup
352 298
 
353 299
 }
354 300
 
355
-func GetAHCFYLJG004(org_name string, doctor string, fixmedins_code string, insuplc_admdvs string, mdtrtarea_admvs string, url string, cFYLJG004 models.CFYLJG004, cainfo string) (string, string) {
356
-	// 生成签名
357
-	timestamp := time.Now().Unix()
358
-	// 生成输入报文
359
-	inputMessage := SetAHInputMessage(timestamp, org_name, doctor, fixmedins_code, insuplc_admdvs, mdtrtarea_admvs, cainfo)
301
+func GetAHCFYLJG004(url string, cFYLJG004 models.CFYLJG004) (string, string) {
360 302
 
361 303
 	inputData := make(map[string]interface{})
362
-	inputData1 := make(map[string]interface{})
363
-	//inputDatas := make([]map[string]interface{}, 0)
364
-	inputMessage["infno"] = "7104"
365 304
 	inputData["hiRxno"] = cFYLJG004.HiRxno
366 305
 	inputData["fixmedinsCode"] = cFYLJG004.FixmedinsCode
367 306
 	inputData["drCode"] = cFYLJG004.UndoDrCode
@@ -370,12 +309,8 @@ func GetAHCFYLJG004(org_name string, doctor string, fixmedins_code string, insup
370 309
 	inputData["undoDrCertno"] = cFYLJG004.UndoDrCertno
371 310
 	inputData["undoRea"] = cFYLJG004.UndoRea
372 311
 	inputData["undoTime"] = cFYLJG004.UndoTime
373
-	inputData1["data"] = inputData
374
-	inputMessage["input"] = inputData1
375
-	argInputMessage := make(map[string]interface{})
376
-	argInputMessage["arg0"] = inputMessage
377 312
 	var inputLog string
378
-	bytesData, err := json.Marshal(inputMessage)
313
+	bytesData, err := json.Marshal(inputData)
379 314
 	inputLog = string(bytesData)
380 315
 	fmt.Println(string(bytesData))
381 316
 	if err != nil {
@@ -383,9 +318,7 @@ func GetAHCFYLJG004(org_name string, doctor string, fixmedins_code string, insup
383 318
 		return err.Error(), ""
384 319
 	}
385 320
 	reader := bytes.NewReader(bytesData)
386
-
387 321
 	url = url + "CFYLJG004"
388
-
389 322
 	//url := "http://igb.hsa.gdgov.cn/ebus/gdyb_inf/poc/hsa/hgs/1101"
390 323
 	request, err := http.NewRequest("POST", url, reader)
391 324
 	if err != nil {