去除warn
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user