Pārlūkot izejas kodu

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

csx 4 gadus atpakaļ
vecāks
revīzija
4382a7a127
2 mainītis faili ar 15 papildinājumiem un 15 dzēšanām
  1. 12 12
      controllers/sg/his_api_controller.go
  2. 3 3
      service/his_service.go

+ 12 - 12
controllers/sg/his_api_controller.go Parādīt failu

2675
 }
2675
 }
2676
 
2676
 
2677
 func (c *HisApiController) RefundNumber() {
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
 	admin_user_id, _ := c.GetInt64("admin_user_id")
2680
 	admin_user_id, _ := c.GetInt64("admin_user_id")
2681
 
2681
 
2682
 	his_patient_id, _ := c.GetInt64("id")
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
 	adminUser := c.GetAdminUserInfo()
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
 	//his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
2694
 	//his, _ := service.GetVMHisPatientInfo(adminUser.CurrentOrgId, patient_id, recordDateTime)
2695
 
2695
 
2696
 	his, _ := service.GetHisPatientRecord(adminUser.CurrentOrgId, his_patient_id)
2696
 	his, _ := service.GetHisPatientRecord(adminUser.CurrentOrgId, his_patient_id)
2738
 			//err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
2738
 			//err := service.UpdataOrderStatus(order_id, number, adminUser.CurrentOrgId)
2739
 			//service.UpdataRegStatus(patient_id, recordDateTime, adminUser.CurrentOrgId)
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
 			if err == nil {
2743
 			if err == nil {
2744
 				c.ServeSuccessJSON(map[string]interface{}{
2744
 				c.ServeSuccessJSON(map[string]interface{}{

+ 3 - 3
service/his_service.go Parādīt failu

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
 func GetAdminUserInfoByID(org_id int64, admin_user_id int64) (role models.UserAdminRole, err error) {
685
 func GetAdminUserInfoByID(org_id int64, admin_user_id int64) (role models.UserAdminRole, err error) {
686
 	err = readUserDb.Model(&models.UserAdminRole{}).Where("org_id = ? AND status = 1 AND admin_user_id = ?", org_id, admin_user_id).First(&role).Error
686
 	err = readUserDb.Model(&models.UserAdminRole{}).Where("org_id = ? AND status = 1 AND admin_user_id = ?", org_id, admin_user_id).First(&role).Error