소스 검색

医保对接

csx 2 년 전
부모
커밋
744958af36
2개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 0
      controllers/his_api_controller.go
  2. 6 1
      service/his_service.go

+ 4 - 0
controllers/his_api_controller.go 파일 보기

@@ -4813,6 +4813,8 @@ func (c *HisApiController) GetUploadInfo() {
4813 4813
 			tmpstring := strconv.FormatInt(order.ID, 10)
4814 4814
 			//扣押金
4815 4815
 			errmsg = service.SpendDeposit(c.GetAdminUserInfo().CurrentOrgId, id, c.GetAdminUserInfo().AdminUser.Id, tmpstring, decimal)
4816
+			order.Decimal = decimal
4817
+			service.UpDateOrderTwo(order)
4816 4818
 			if errmsg != nil {
4817 4819
 				c.ServeFailJsonSend(enums.ErrorCodeParamWrong, errmsg.Error())
4818 4820
 				//c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeCreateOrderException)
@@ -6242,6 +6244,7 @@ func (c *HisApiController) GetFaPiaoData() {
6242 6244
 
6243 6245
 	}
6244 6246
 
6247
+	pre_pay_money := service.GetUserMoney(order.PatientId, adminUser.CurrentOrgId)
6245 6248
 	admin, _ := service.GetAdminUserInfoByID(adminUser.CurrentOrgId, adminUser.AdminUser.Id)
6246 6249
 
6247 6250
 	c.ServeSuccessJSON(map[string]interface{}{
@@ -6290,6 +6293,7 @@ func (c *HisApiController) GetFaPiaoData() {
6290 6293
 		"zhenChaCostSelfTotal":        zhenChaCostSelfTotal,
6291 6294
 		"zhenChaCostPartSelfTotal":    zhenChaCostPartSelfTotal,
6292 6295
 		"his_hospital_record":         his_hospital_record,
6296
+		"pre_pay_money":               pre_pay_money,
6293 6297
 	})
6294 6298
 
6295 6299
 }

+ 6 - 1
service/his_service.go 파일 보기

@@ -1210,7 +1210,7 @@ func UpdataOrderStatus(id int64, number string, user_org_id int64) (err error) {
1210 1210
 }
1211 1211
 
1212 1212
 func UpdataHospitalOrderStatus(id int64, number string, user_org_id int64, log string, result string) (err error) {
1213
-	err = writeDb.Model(&models.HisOrder{}).Where("status = 1 AND id = ? AND user_org_id = ?", id, user_org_id).Updates(map[string]interface{}{"order_status": 3, "mtime": time.Now().Unix(), "refund_request_log": log, "refund_log": result, "status": 0}).Error
1213
+	err = writeDb.Model(&models.HisOrder{}).Where("status = 1 AND id = ? AND user_org_id = ?", id, user_org_id).Updates(map[string]interface{}{"order_status": 1, "mtime": time.Now().Unix(), "refund_request_log": log, "refund_log": result, "status": 1}).Error
1214 1214
 	err = writeDb.Model(&models.HisPrescription{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"order_status": 4, "mtime": time.Now().Unix()}).Error
1215 1215
 	err = writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"prescription_status": 4, "mtime": time.Now().Unix()}).Error
1216 1216
 	return
@@ -2488,3 +2488,8 @@ func UpdataOrderStatusThree(number string, user_org_id int64) (err error) {
2488 2488
 	err = writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"prescription_status": 5, "mtime": time.Now().Unix()}).Error
2489 2489
 	return
2490 2490
 }
2491
+
2492
+func UpDateOrderTwo(order *models.HisOrder) (err error) {
2493
+	err = writeDb.Save(&order).Error
2494
+	return
2495
+}