diff --git a/Service/Station/BatteryOpModelDetailService.cs b/Service/Station/BatteryOpModelDetailService.cs index a67b193..0fa80b8 100644 --- a/Service/Station/BatteryOpModelDetailService.cs +++ b/Service/Station/BatteryOpModelDetailService.cs @@ -97,11 +97,6 @@ public class BatteryOpModelDetailService : BaseServices List batteryOpModelDetails = await _batteryOpModelDetailRepository.QueryAsync(); foreach (var detail in batteryOpModelDetails) { - if (detail.ModelId == input.ModelId) - { - return Result.Fail("模型id在模型详情表已存在"); - } - if (detail.StartTime == input.StartTime && detail.Id != input.Id || detail.EndTime == input.EndTime && detail.Id != input.Id) { @@ -147,11 +142,7 @@ public class BatteryOpModelDetailService : BaseServices List batteryOpModelDetails = await _batteryOpModelDetailRepository.QueryAsync(); foreach (var detail in batteryOpModelDetails) { - if (detail.ModelId == batteryOpReq.ModelId&& detail.Id != batteryOpReq.Id) - { - return Result.Fail("模型id在模型详情表已存在"); - } - + if (detail.StartTime == batteryOpReq.StartTime && detail.Id != batteryOpReq.Id || detail.EndTime == batteryOpReq.EndTime && detail.Id != batteryOpReq.Id) {