csx 3 年 前
コミット
202fe9fa86
共有2 個のファイルを変更した19 個の追加14 個の削除を含む
  1. 8 7
      controllers/coordinate_controller.go
  2. 11 7
      service/coordinate_service.go

+ 8 - 7
controllers/coordinate_controller.go ファイルの表示

99
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
99
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
100
 		return
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
 	fmt.Println(patien_id)
105
 	fmt.Println(patien_id)
106
 	fmt.Println(infoSeq)
106
 	fmt.Println(infoSeq)
107
 	fmt.Println(docId)
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
 	if order.ID == 0 {
111
 	if order.ID == 0 {
111
 		json := make(map[string]interface{})
112
 		json := make(map[string]interface{})
112
 		json["msg"] = "结算记录不存在,请检查参数是否正确"
113
 		json["msg"] = "结算记录不存在,请检查参数是否正确"
135
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
136
 		utils.ErrorLog("接口返回数据解析JSON失败: %v", err)
136
 		return
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
 	order, _ := service.GetHisOrderFour(patien_id, infoSeq, docId)
142
 	order, _ := service.GetHisOrderFour(patien_id, infoSeq, docId)
142
 	if order.ID == 0 {
143
 	if order.ID == 0 {
143
 		json := make(map[string]interface{})
144
 		json := make(map[string]interface{})

+ 11 - 7
service/coordinate_service.go ファイルの表示

15
 	//input := make(map[string]interface{})
15
 	//input := make(map[string]interface{})
16
 	inputData := make(map[string]interface{})
16
 	inputData := make(map[string]interface{})
17
 	inputData["patType"] = "1"                  // 就诊凭证编号
17
 	inputData["patType"] = "1"                  // 就诊凭证编号
18
-	inputData["patIdNo"] = "440510199211080033" // 开始时间
19
-	inputData["patName"] = "测试患者"               // 人员姓名
18
+	inputData["patIdNo"] = "440510199211080038" // 开始时间
19
+	inputData["patName"] = "测试患者4"              // 人员姓名
20
 
20
 
21
 	inputData["patMobile"] = "13535547902" // 人员姓名
21
 	inputData["patMobile"] = "13535547902" // 人员姓名
22
 	inputData["patSex"] = "M"              // 人员姓名
22
 	inputData["patSex"] = "M"              // 人员姓名
23
 	inputData["patMarriage"] = "1"         // 人员姓名
23
 	inputData["patMarriage"] = "1"         // 人员姓名
24
 	inputData["birthday"] = "1992-10-23"   // 人员姓名
24
 	inputData["birthday"] = "1992-10-23"   // 人员姓名
25
 	inputData["patAddress"] = "11111"      // 人员姓名
25
 	inputData["patAddress"] = "11111"      // 人员姓名
26
-	inputData["thirdPartyID"] = "6933"     // 人员姓名
26
+	inputData["thirdPartyID"] = "6936"     // 人员姓名
27
 	inputData["patAge"] = "30"             // 人员姓名
27
 	inputData["patAge"] = "30"             // 人员姓名
28
 	//input["req"] = inputData
28
 	//input["req"] = inputData
29
 
29
 
79
 	inputData["patientId"] = reg.PatientId
79
 	inputData["patientId"] = reg.PatientId
80
 	inputData["patientName"] = reg.PatientName
80
 	inputData["patientName"] = reg.PatientName
81
 	inputData["idCardNo"] = reg.IdCardNo
81
 	inputData["idCardNo"] = reg.IdCardNo
82
-	inputData["phone"] = "13535547901"
83
-	inputData["doctorId"] = "1111"
82
+	inputData["phone"] = ""
83
+	inputData["doctorId"] = ""
84
 	inputData["doctorLevelCode"] = ""
84
 	inputData["doctorLevelCode"] = ""
85
 	inputData["regDate"] = reg.RegDate
85
 	inputData["regDate"] = reg.RegDate
86
 
86
 
97
 
97
 
98
 	inputData["treatFee"] = reg.TreatFee
98
 	inputData["treatFee"] = reg.TreatFee
99
 	inputData["operatorId"] = reg.OperatorId
99
 	inputData["operatorId"] = reg.OperatorId
100
-	inputData["remark"] = "111111"
100
+	inputData["remark"] = "血透"
101
 
101
 
102
 	inputData["orderType"] = "0"
102
 	inputData["orderType"] = "0"
103
 	inputData["clinicCode"] = ""
103
 	inputData["clinicCode"] = ""
322
 }
322
 }
323
 
323
 
324
 func GetHisOrderFour(patient_id string, infoSeq string, docId string) (order models.HisOrder, err error) {
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
 	return
330
 	return
327
 }
331
 }