修改备料任务详情数量

This commit is contained in:
qianhao.xu 2024-09-30 10:35:41 +08:00
parent 80e8c1b9ee
commit f4fbefcbd5
3 changed files with 21 additions and 4 deletions

View File

@ -114,9 +114,9 @@ namespace DOAN.Admin.Mobile.Controllers
}
//TODO 提交前校验 物料是否在指定日期 指定线内
[HttpPost("check_material_isin_date_and_line")]
public IActionResult CheckMaterialIsInDateAndLine([FromBody]CheckMaterialDto checkMaterial)
public IActionResult CheckMaterialIsInDateAndLine([FromBody] CheckMaterialDto checkMaterial)
{
if(checkMaterial == null|| string.IsNullOrEmpty(checkMaterial.LineCode)|| string.IsNullOrEmpty(checkMaterial.LineCode)|| checkMaterial.HandelDate<DateTime.MinValue.AddYears(1)) throw new CustomException("请求参数错误");
if (checkMaterial == null || string.IsNullOrEmpty(checkMaterial.LineCode) || string.IsNullOrEmpty(checkMaterial.LineCode) || checkMaterial.HandelDate < DateTime.MinValue.AddYears(1)) throw new CustomException("请求参数错误");
var response = preparationTask.CheckMaterialIsInDateAndLine(checkMaterial);
@ -143,7 +143,7 @@ namespace DOAN.Admin.Mobile.Controllers
}
//TODO 删除任务
[HttpGet("delete_task")]
public IActionResult DeleteTask(string task_code)
public IActionResult DeleteTask(string task_code)
{
if (string.IsNullOrEmpty(task_code)) throw new CustomException("请求参数错误");
var response = preparationTask.DeletePreparationMaterialTask(task_code);
@ -156,13 +156,24 @@ namespace DOAN.Admin.Mobile.Controllers
[HttpGet("delete_preparation_material_info")]
public IActionResult DeletePreparationMaterialInfo(string id)
{
if(string.IsNullOrEmpty(id)) throw new CustomException("请求参数错误");
if (string.IsNullOrEmpty(id)) throw new CustomException("请求参数错误");
var response = preparationTask.DeletePreparationMaterialInfo(id);
return SUCCESS(response);
}
//TODO 修改备料任务详情数量
[HttpGet("update_preparation_material_num")]
public IActionResult UpdatePreParationMaterialNum(string id, decimal num)
{
if (string.IsNullOrEmpty(id)) throw new CustomException("请求参数错误");
var response = preparationTask.UpdatePreParationMaterialNum(id,num);
return SUCCESS(response);
}
#endregion

View File

@ -37,6 +37,7 @@ namespace DOAN.Service.Mobile.IService
int DeletePreparationMaterialTask(string task_code);
int DeletePreparationMaterialInfo(string id);
int UpdatePreParationMaterialNum(string id, decimal num);
}
}

View File

@ -251,6 +251,11 @@ namespace DOAN.Service.Mobile
{
return Context.Deleteable<MmTaskMaterialInfoByLine>().Where(it => it.Id == id).ExecuteCommand();
}
public int UpdatePreParationMaterialNum(string id, decimal num)
{
return Context.Updateable<MmTaskMaterialInfoByLine>().Where(it => it.Id == id).SetColumns(it=>it.Quantity==num).ExecuteCommand();
}
}
}