Browse Source

医保对接

csx 4 years ago
parent
commit
2b11e11334
2 changed files with 6 additions and 0 deletions
  1. 2 0
      controllers/his_api_controller.go
  2. 4 0
      service/his_service.go

+ 2 - 0
controllers/his_api_controller.go View File

@@ -2278,6 +2278,8 @@ func (c *HisApiController) Refund() {
2278 2278
 		}
2279 2279
 
2280 2280
 		err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
2281
+		service.UpdataRegStatus(patient_id, recordDateTime, adminUser.CurrentOrgId)
2282
+
2281 2283
 		if err == nil {
2282 2284
 			c.ServeSuccessJSON(map[string]interface{}{
2283 2285
 				"msg": "退费成功",

+ 4 - 0
service/his_service.go View File

@@ -590,6 +590,10 @@ func UpdataOrderStatus(id int64, number string, user_org_id int64) (err error) {
590 590
 
591 591
 }
592 592
 
593
+func UpdataRegStatus(patient_id int64, record_time int64, org_id int64) {
594
+	writeDb.Model(&models.HisPatient{}).Where("patient_id = ? AND status = 1 AND record_date =? AND user_org_id = ?", patient_id, record_time, org_id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()})
595
+
596
+}
593 597
 func GetAdminUserInfoByID(org_id int64, admin_user_id int64) (role models.UserAdminRole, err error) {
594 598
 	err = readUserDb.Model(&models.UserAdminRole{}).Where("org_id = ? AND status = 1 AND admin_user_id = ?", org_id, admin_user_id).First(&role).Error
595 599
 	return