去除warn

This commit is contained in:
2023-06-19 16:27:13 +08:00
parent 0b492898af
commit aea9e3a9d5
69 changed files with 512 additions and 483 deletions

View File

@@ -37,19 +37,22 @@ namespace Tnb.EquipMgr
throw Oops.Bah("该设备已存在检验计划");
}
if (entity.warn_unit == "1")//月
if (entity != null)
{
entity.next_check_time = entity.end_time.Value.AddMonths(-entity.warm_time.Value);
}else if (entity.warn_unit == "2")//天
{
entity.next_check_time = entity.end_time.Value.AddDays(-entity.warm_time.Value);
}
if (entity.warn_unit == "1")//月
{
entity.next_check_time = entity.end_time?.AddMonths(-entity.warm_time.Value);
}else if (entity.warn_unit == "2")//天
{
entity.next_check_time = entity.end_time?.AddDays(-entity.warm_time.Value);
}
entity.id = SnowflakeIdHelper.NextId();
entity.create_time = DateTime.Now;
entity.create_id = _userManager.UserId;
entity.org_id = _userManager.GetUserInfo().Result.organizeId;
await _repository.InsertAsync(entity);
entity.id = SnowflakeIdHelper.NextId();
entity.create_time = DateTime.Now;
entity.create_id = _userManager.UserId;
entity.org_id = _userManager.GetUserInfo().Result.organizeId;
await _repository.InsertAsync(entity);
}
}
}