From 20d70b954a41a6dad91794701aea43c8d3cb16f7 Mon Sep 17 00:00:00 2001 From: lxw Date: Fri, 21 Jun 2024 17:32:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E5=9E=8Bbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service/Station/BatteryOpModelDetailService.cs | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) 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) {