电池模型

master
CZ 5 months ago
parent bd3325234e
commit 89a25d390a

@ -60,8 +60,10 @@ public class BatteryOpModelDetailService : BaseServices<BatteryOpModelDetail>
// 删除模型
var isExistModel = await _batteryOpModelRepository.QueryByClauseAsync(u => u.ModelId == user.ModelId);
bool batteay = true;
var batteryOpModel = _batteryOpModelRepository.QueryListByClause(i => i.ModelId == user.ModelId);
if (isExistModel != null)
{
if (batteryOpModel.Count > 1) //如果模型里面还有数据,此模型就不删除
batteay = await _batteryOpModelRepository.DeleteAsync(isExistModel);
}
// 删除模型详情
@ -147,7 +149,6 @@ public class BatteryOpModelDetailService : BaseServices<BatteryOpModelDetail>
List<BatteryOpModelDetail> batteryOpModelDetails = await _batteryOpModelDetailRepository.QueryAsync();
foreach (var detail in batteryOpModelDetails)
{
if (detail.StartTime == batteryOpReq.StartTime && detail.Id != batteryOpReq.Id ||
detail.EndTime == batteryOpReq.EndTime && detail.Id != batteryOpReq.Id)
{
@ -156,7 +157,6 @@ public class BatteryOpModelDetailService : BaseServices<BatteryOpModelDetail>
}
// 通过id查找修改之前的模型id
var batteryOpModelDetail =
await _batteryOpModelDetailRepository.QueryByClauseAsync(u => u.Id == batteryOpReq.Id);

Loading…
Cancel
Save