csx hace 2 años
padre
commit
202fe9fa86
Se han modificado 2 ficheros con 19 adiciones y 14 borrados
  1. 8 7
      controllers/coordinate_controller.go
  2. 11 7
      service/coordinate_service.go

+ 8 - 7
controllers/coordinate_controller.go Ver fichero

@@ -99,14 +99,15 @@ func (c *CoordinateController) Settle() {
99 99
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
100 100
 		return
101 101
 	}
102
-	patien_id := respJSON["patientId"].(string)
103
-	infoSeq := respJSON["infoSeq"].(string)
104
-	docId := respJSON["docId"].(string)
102
+	patien_id := respJSON["patientid"].(string)
103
+	infoSeq := respJSON["infoseq"].(string)
104
+	docId := respJSON["docid"].(string)
105 105
 	fmt.Println(patien_id)
106 106
 	fmt.Println(infoSeq)
107 107
 	fmt.Println(docId)
108 108
 
109
-	order, _ := service.GetHisOrderFour(patien_id, infoSeq, docId)
109
+	order, _ := service.GetHisOrderFour(patien_id, infoSeq, "")
110
+	order.SetlId = docId
110 111
 	if order.ID == 0 {
111 112
 		json := make(map[string]interface{})
112 113
 		json["msg"] = "结算记录不存在,请检查参数是否正确"
@@ -135,9 +136,9 @@ func (c *CoordinateController) Refund() {
135 136
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
136 137
 		return
137 138
 	}
138
-	patien_id := respJSON["patientId"].(string)
139
-	infoSeq := respJSON["infoSeq"].(string)
140
-	docId := respJSON["docId"].(string)
139
+	patien_id := respJSON["patientid"].(string)
140
+	infoSeq := respJSON["infoseq"].(string)
141
+	docId := respJSON["docid"].(string)
141 142
 	order, _ := service.GetHisOrderFour(patien_id, infoSeq, docId)
142 143
 	if order.ID == 0 {
143 144
 		json := make(map[string]interface{})

+ 11 - 7
service/coordinate_service.go Ver fichero

@@ -15,15 +15,15 @@ func SavePatientMessageInfo() (string, string) {
15 15
 	//input := make(map[string]interface{})
16 16
 	inputData := make(map[string]interface{})
17 17
 	inputData["patType"] = "1"                  // 就诊凭证编号
18
-	inputData["patIdNo"] = "440510199211080033" // 开始时间
19
-	inputData["patName"] = "测试患者"               // 人员姓名
18
+	inputData["patIdNo"] = "440510199211080038" // 开始时间
19
+	inputData["patName"] = "测试患者4"              // 人员姓名
20 20
 
21 21
 	inputData["patMobile"] = "13535547902" // 人员姓名
22 22
 	inputData["patSex"] = "M"              // 人员姓名
23 23
 	inputData["patMarriage"] = "1"         // 人员姓名
24 24
 	inputData["birthday"] = "1992-10-23"   // 人员姓名
25 25
 	inputData["patAddress"] = "11111"      // 人员姓名
26
-	inputData["thirdPartyID"] = "6933"     // 人员姓名
26
+	inputData["thirdPartyID"] = "6936"     // 人员姓名
27 27
 	inputData["patAge"] = "30"             // 人员姓名
28 28
 	//input["req"] = inputData
29 29
 
@@ -79,8 +79,8 @@ func SaveReg(reg models.Reg) (string, string) {
79 79
 	inputData["patientId"] = reg.PatientId
80 80
 	inputData["patientName"] = reg.PatientName
81 81
 	inputData["idCardNo"] = reg.IdCardNo
82
-	inputData["phone"] = "13535547901"
83
-	inputData["doctorId"] = "1111"
82
+	inputData["phone"] = ""
83
+	inputData["doctorId"] = ""
84 84
 	inputData["doctorLevelCode"] = ""
85 85
 	inputData["regDate"] = reg.RegDate
86 86
 
@@ -97,7 +97,7 @@ func SaveReg(reg models.Reg) (string, string) {
97 97
 
98 98
 	inputData["treatFee"] = reg.TreatFee
99 99
 	inputData["operatorId"] = reg.OperatorId
100
-	inputData["remark"] = "111111"
100
+	inputData["remark"] = "血透"
101 101
 
102 102
 	inputData["orderType"] = "0"
103 103
 	inputData["clinicCode"] = ""
@@ -322,6 +322,10 @@ func GetUnSettleMonthHisPrescription(org_id int64, patient_id int64, start_date
322 322
 }
323 323
 
324 324
 func GetHisOrderFour(patient_id string, infoSeq string, docId string) (order models.HisOrder, err error) {
325
-	err = readDb.Model(&models.HisOrder{}).Where("mdtrt_id = ? AND psn_no = ? AND setl_id = ?", infoSeq, patient_id, docId).First(&order).Error
325
+	if len(docId) > 0 {
326
+		err = readDb.Model(&models.HisOrder{}).Where("mdtrt_id = ? AND psn_no = ? AND setl_id = ? AND status = 1", infoSeq, patient_id, docId).First(&order).Error
327
+	} else {
328
+		err = readDb.Model(&models.HisOrder{}).Where("mdtrt_id = ? AND psn_no = ? AND status = 1 ", infoSeq, patient_id).First(&order).Error
329
+	}
326 330
 	return
327 331
 }