Sfoglia il codice sorgente

11月8日库存管理

XMLWAN 3 anni fa
parent
commit
d59806e34d

+ 5 - 5
controllers/dialysis_record_api_controller.go Vedi File

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

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

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

+ 1 - 1
service/schedule_service.go Vedi File

210
 
210
 
211
 func UpdateScheduleOne(id int64, schedule models.Schedule) error {
211
 func UpdateScheduleOne(id int64, schedule models.Schedule) error {
212
 	utx := XTWriteDB().Begin()
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
 	utx.Commit()
214
 	utx.Commit()
215
 	return err
215
 	return err
216
 }
216
 }