Explorar el Código

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

csx hace 4 años
padre
commit
4382a7a127
Se han modificado 2 ficheros con 15 adiciones y 15 borrados
  1. 12 12
      controllers/sg/his_api_controller.go
  2. 3 3
      service/his_service.go

+ 12 - 12
controllers/sg/his_api_controller.go Ver fichero

@@ -2675,22 +2675,22 @@ func (c *HisApiController) Refund() {
2675 2675
 }
2676 2676
 
2677 2677
 func (c *HisApiController) RefundNumber() {
2678
-	record_time := c.GetString("record_time")
2679
-	patient_id, _ := c.GetInt64("patient_id")
2678
+	//record_time := c.GetString("record_time")
2679
+	//patient_id, _ := c.GetInt64("patient_id")
2680 2680
 	admin_user_id, _ := c.GetInt64("admin_user_id")
2681 2681
 
2682 2682
 	his_patient_id, _ := c.GetInt64("id")
2683 2683
 
2684
-	timeLayout := "2006-01-02"
2685
-	loc, _ := time.LoadLocation("Local")
2684
+	//timeLayout := "2006-01-02"
2685
+	//loc, _ := time.LoadLocation("Local")
2686 2686
 	adminUser := c.GetAdminUserInfo()
2687
-	theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
2688
-	fmt.Println(err)
2689
-	if err != nil {
2690
-		c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
2691
-		return
2692
-	}
2693
-	recordDateTime := theTime.Unix()
2687
+	//theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
2688
+	//fmt.Println(err)
2689
+	//if err != nil {
2690
+	//	c.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeParamWrong)
2691
+	//	return
2692
+	//}
2693
+	//recordDateTime := theTime.Unix()
2694 2694
 	//his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
2695 2695
 
2696 2696
 	his, _ := service.GetHisPatientRecord(adminUser.CurrentOrgId, his_patient_id)
@@ -2738,7 +2738,7 @@ func (c *HisApiController) RefundNumber() {
2738 2738
 			//err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
2739 2739
 			//service.UpdataRegStatus(patient_id, recordDateTime, adminUser.CurrentOrgId)
2740 2740
 
2741
-			service.UpdataRegStatus2(his_patient_id)
2741
+			err := service.UpdataRegStatus2(his_patient_id)
2742 2742
 
2743 2743
 			if err == nil {
2744 2744
 				c.ServeSuccessJSON(map[string]interface{}{

+ 3 - 3
service/his_service.go Ver fichero

@@ -678,9 +678,9 @@ func UpdataRegStatus(patient_id int64, record_time int64, org_id int64) {
678 678
 
679 679
 }
680 680
 
681
-func UpdataRegStatus2(id int64) {
682
-	writeDb.Model(&models.HisPatient{}).Where("id = ?", id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()})
683
-
681
+func UpdataRegStatus2(id int64) error {
682
+	err := writeDb.Model(&models.HisPatient{}).Where("id = ?", id).Updates(map[string]interface{}{"status": 0, "mtime": time.Now().Unix()}).Error
683
+	return err
684 684
 }
685 685
 func GetAdminUserInfoByID(org_id int64, admin_user_id int64) (role models.UserAdminRole, err error) {
686 686
 	err = readUserDb.Model(&models.UserAdminRole{}).Where("org_id = ? AND status = 1 AND admin_user_id = ?", org_id, admin_user_id).First(&role).Error