Browse Source

11月8日库存管理

XMLWAN 3 years ago
parent
commit
d59806e34d

+ 5 - 5
controllers/dialysis_record_api_controller.go View File

@@ -817,7 +817,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
817 817
 				ScheduleType: schedual_type,
818 818
 				UpdatedTime:  time.Now().Unix(),
819 819
 			}
820
-			service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
820
+			err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
821 821
 			if err != nil {
822 822
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
823 823
 				return
@@ -846,7 +846,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
846 846
 							ScheduleType: schedual_type,
847 847
 							UpdatedTime:  time.Now().Unix(),
848 848
 						}
849
-						service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
849
+						err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
850 850
 						if err != nil {
851 851
 							this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
852 852
 							return
@@ -867,7 +867,7 @@ func (this *DialysisRecordAPIController) StartDialysis() {
867 867
 						ScheduleType: schedual_type,
868 868
 						UpdatedTime:  time.Now().Unix(),
869 869
 					}
870
-					service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
870
+					err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
871 871
 					if err != nil {
872 872
 						this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
873 873
 						return
@@ -1421,7 +1421,7 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
1421 1421
 					ScheduleType: schedual_type,
1422 1422
 					UpdatedTime:  time.Now().Unix(),
1423 1423
 				}
1424
-				service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
1424
+				err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
1425 1425
 				if err != nil {
1426 1426
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1427 1427
 					return
@@ -1444,7 +1444,7 @@ func (this *DialysisRecordAPIController) ModifyStartDialysis() {
1444 1444
 						ScheduleType: schedual_type,
1445 1445
 						UpdatedTime:  time.Now().Unix(),
1446 1446
 					}
1447
-					service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
1447
+					err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
1448 1448
 					if err != nil {
1449 1449
 						this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
1450 1450
 						return

+ 5 - 5
controllers/mobile_api_controllers/dialysis_api_controller.go View File

@@ -2084,7 +2084,7 @@ func (this *DialysisAPIController) StartDialysis() {
2084 2084
 				ScheduleType: schedual_type,
2085 2085
 				UpdatedTime:  time.Now().Unix(),
2086 2086
 			}
2087
-			service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2087
+			err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2088 2088
 			if err != nil {
2089 2089
 				this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2090 2090
 				return
@@ -2113,7 +2113,7 @@ func (this *DialysisAPIController) StartDialysis() {
2113 2113
 							ScheduleType: schedual_type,
2114 2114
 							UpdatedTime:  time.Now().Unix(),
2115 2115
 						}
2116
-						service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2116
+						err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2117 2117
 						if err != nil {
2118 2118
 							this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2119 2119
 							return
@@ -2134,7 +2134,7 @@ func (this *DialysisAPIController) StartDialysis() {
2134 2134
 						ScheduleType: schedual_type,
2135 2135
 						UpdatedTime:  time.Now().Unix(),
2136 2136
 					}
2137
-					service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2137
+					err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2138 2138
 					if err != nil {
2139 2139
 						this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2140 2140
 						return
@@ -2970,7 +2970,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
2970 2970
 					ScheduleType: schedual_type,
2971 2971
 					UpdatedTime:  time.Now().Unix(),
2972 2972
 				}
2973
-				service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2973
+				err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2974 2974
 				if err != nil {
2975 2975
 					this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2976 2976
 					return
@@ -2993,7 +2993,7 @@ func (this *DialysisAPIController) ModifyStartDialysisOrder() {
2993 2993
 						ScheduleType: schedual_type,
2994 2994
 						UpdatedTime:  time.Now().Unix(),
2995 2995
 					}
2996
-					service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2996
+					err := service.UpdateScheduleOne(daySchedule.ID, xtSchedule)
2997 2997
 					if err != nil {
2998 2998
 						this.ServeFailJSONWithSGJErrorCode(enums.ErrorCodeDataException)
2999 2999
 						return

+ 1 - 1
service/schedule_service.go View File

@@ -210,7 +210,7 @@ func UpdateSchedule(m *models.Schedule) error {
210 210
 
211 211
 func UpdateScheduleOne(id int64, schedule models.Schedule) error {
212 212
 	utx := XTWriteDB().Begin()
213
-	err := XTWriteDB().Where("id = ? and status = 1", id).Updates(map[string]interface{}{"partition_id": schedule.PartitionId, "bed_id": schedule.BedId, "schedule_type": schedule.ScheduleType}).Error
213
+	err := XTWriteDB().Model(&schedule).Where("id = ? and status = 1", id).Updates(map[string]interface{}{"partition_id": schedule.PartitionId, "bed_id": schedule.BedId, "schedule_type": schedule.ScheduleType}).Error
214 214
 	utx.Commit()
215 215
 	return err
216 216
 }