Kaynağa Gözat

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

csx 3 yıl önce
ebeveyn
işleme
0d6bac44ec

+ 5 - 5
controllers/sg/his_api_controller.go Dosyayı Görüntüle

@@ -3432,10 +3432,10 @@ func (c *HisApiController) Refund() {
3432 3432
 
3433 3433
 func (c *HisApiController) RefundNumber() {
3434 3434
 	record_time := c.GetString("record_time")
3435
-	patient_id, _ := c.GetInt64("patient_id")
3435
+	//patient_id, _ := c.GetInt64("patient_id")
3436 3436
 	admin_user_id, _ := c.GetInt64("admin_user_id")
3437 3437
 
3438
-	//his_patient_id, _ := c.GetInt64("id")
3438
+	his_patient_id, _ := c.GetInt64("id")
3439 3439
 
3440 3440
 	timeLayout := "2006-01-02"
3441 3441
 	loc, _ := time.LoadLocation("Local")
@@ -3447,9 +3447,9 @@ func (c *HisApiController) RefundNumber() {
3447 3447
 		return
3448 3448
 	}
3449 3449
 	recordDateTime := theTime.Unix()
3450
-	his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
3450
+	//his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
3451 3451
 
3452
-	//his, _ := service.GetNewHisPatientRecord(adminUser.CurrentOrgId, patient_id)
3452
+	his, _ := service.GetNewHisPatientRecord(adminUser.CurrentOrgId, his_patient_id)
3453 3453
 	//patientPrescription, _ := service.FindPatientPrescriptionInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
3454 3454
 	//order, _ := service.GetHisOrderByID(order_id)
3455 3455
 	miConfig, _ := service.FindMedicalInsuranceInfo(adminUser.CurrentOrgId)
@@ -3492,7 +3492,7 @@ func (c *HisApiController) RefundNumber() {
3492 3492
 
3493 3493
 		if res2.Infcode == 0 {
3494 3494
 			//err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
3495
-			service.UpdataRegStatus(patient_id, recordDateTime, adminUser.CurrentOrgId)
3495
+			service.UpdataRegStatusTwo(his_patient_id, recordDateTime, adminUser.CurrentOrgId)
3496 3496
 
3497 3497
 			//err := service.UpdataRegStatus2()
3498 3498
 

+ 7 - 0
service/his_service.go Dosyayı Görüntüle

@@ -718,7 +718,14 @@ func UpdataOrderStatus(id int64, number string, user_org_id int64, log string, r
718 718
 
719 719
 func UpdataRegStatus(patient_id int64, record_time int64, org_id int64) {
720 720
 	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()})
721
+	//writeDb.Model(&models.HisPrescription{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"order_status": 1, "mtime": time.Now().Unix()}).Error
722
+	//writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1 AND batch_number = ? AND user_org_id = ?", number, user_org_id).Updates(map[string]interface{}{"prescription_status": 1, "mtime": time.Now().Unix()}).Error
723
+}
721 724
 
725
+func UpdataRegStatusTwo(his_patient_id int64, record_time int64, org_id int64) {
726
+	writeDb.Model(&models.HisPatient{}).Where("status = 1 AND record_date =? AND user_org_id = ? AND his_patient_id = ?", record_time, org_id, his_patient_id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()})
727
+	writeDb.Model(&models.HisPrescription{}).Where("status = 1 AND user_org_id = ? AND his_patient_id = ?", org_id, his_patient_id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()})
728
+	writeDb.Model(&models.HisPrescriptionInfo{}).Where("status = 1  AND user_org_id = ? AND his_patient_id = ?", org_id, his_patient_id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()})
722 729
 }
723 730
 
724 731
 func UpdataRegStatus2(id int64) error {

+ 1 - 0
service/sz_his_service.go Dosyayı Görüntüle

@@ -1428,6 +1428,7 @@ func UpdataOrderStatusSZ(id int64, number string, user_org_id int64, his_mz_numb
1428 1428
 
1429 1429
 func UpdataHisStatusSZ(user_org_id int64, his_mz_number string, his_number string, result string) (err error) {
1430 1430
 	err = writeDb.Model(&models.HisPatient{}).Where("status = 1 AND user_org_id = ? AND mz_number = ? AND number = ?", user_org_id, his_mz_number, his_number).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix(), "refund_detail": result}).Error
1431
+
1431 1432
 	return
1432 1433
 }
1433 1434