parent
f52fc73cbd
commit
baa8558293
|
|
@ -419,8 +419,61 @@ namespace OpenAuth.App.ServiceApp.DroneSsnydManage
|
||||||
Id = project.Id,
|
Id = project.Id,
|
||||||
xiangmu_no = newXiangmuNo
|
xiangmu_no = newXiangmuNo
|
||||||
};
|
};
|
||||||
// todo 空字段是否会影响
|
await Repository.AsUpdateable(newProject).IgnoreNullColumns().ExecuteCommandAsync();
|
||||||
await Repository.UpdateAsync(newProject);
|
}
|
||||||
|
|
||||||
|
public async Task MaintainXianmuName(string id, string newXiangmuName)
|
||||||
|
{
|
||||||
|
var project = await Repository.AsQueryable().SingleAsync(a => a.Id == id && a.handle_status_id != 99);
|
||||||
|
if (project == null)
|
||||||
|
{
|
||||||
|
throw new Exception("项目不存在或停止生产");
|
||||||
|
}
|
||||||
|
|
||||||
|
var newProject = new DroneSsnyd()
|
||||||
|
{
|
||||||
|
Id = project.Id,
|
||||||
|
xiangmu_name = newXiangmuName
|
||||||
|
};
|
||||||
|
await Repository.AsUpdateable(newProject).IgnoreNullColumns().ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task ProjectRenewal(string id, DateTime newEndTime)
|
||||||
|
{
|
||||||
|
var project = await Repository.AsQueryable().SingleAsync(a => a.Id == id && a.handle_status_id != 99);
|
||||||
|
if (project == null)
|
||||||
|
{
|
||||||
|
throw new Exception("项目不存在或停止生产");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newEndTime < project.end_time)
|
||||||
|
{
|
||||||
|
throw new Exception("新的结束时间不能早于原结束时间");
|
||||||
|
}
|
||||||
|
|
||||||
|
var newProject = new DroneSsnyd()
|
||||||
|
{
|
||||||
|
Id = project.Id,
|
||||||
|
end_time = newEndTime
|
||||||
|
};
|
||||||
|
await Repository.AsUpdateable(newProject).IgnoreNullColumns().ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task CloseProject(string id)
|
||||||
|
{
|
||||||
|
var project = await Repository.AsQueryable().SingleAsync(a => a.Id == id && a.handle_status_id != 99);
|
||||||
|
if (project == null)
|
||||||
|
{
|
||||||
|
throw new Exception("项目不存在或停止生产");
|
||||||
|
}
|
||||||
|
|
||||||
|
var newProject = new DroneSsnyd()
|
||||||
|
{
|
||||||
|
Id = project.Id,
|
||||||
|
handle_status_id = 99,
|
||||||
|
handle_status_name = "项目终止",
|
||||||
|
};
|
||||||
|
await Repository.AsUpdateable(newProject).IgnoreNullColumns().ExecuteCommandAsync();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -120,7 +120,7 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
// todo 编号维护 名称维护 项目续期 项目详情 停止生产 项目称交
|
// todo 项目详情 停止生产 项目称交
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 编号维护
|
/// 编号维护
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -145,6 +145,77 @@ namespace OpenAuth.WebApi.Controllers.ServiceControllers
|
||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 名称维护
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="newXiangmuName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<Response<bool>> MaintainXianmuName(string id, string newXiangmuName)
|
||||||
|
{
|
||||||
|
var response = new Response<bool>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await droneSsnyApp.MaintainXianmuName(id, newXiangmuName);
|
||||||
|
response.Result = true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Code = 500;
|
||||||
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 项目续期
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="id"></param>
|
||||||
|
/// <param name="newEndTime"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<Response<bool>> ProjectRenewal(string id, DateTime newEndTime)
|
||||||
|
{
|
||||||
|
var response = new Response<bool>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await droneSsnyApp.ProjectRenewal(id, newEndTime);
|
||||||
|
response.Result = true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Code = 500;
|
||||||
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 停止生产
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="paths"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
[HttpPost]
|
||||||
|
public async Task<Response<bool>> CloseProject(string id)
|
||||||
|
{
|
||||||
|
var response = new Response<bool>();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await droneSsnyApp.CloseProject(id);
|
||||||
|
response.Result = true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
response.Code = 500;
|
||||||
|
response.Message = ex.InnerException?.Message ?? ex.Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 历史项目导出
|
/// 历史项目导出
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue