This commit is contained in:
qianhao.xu 2024-11-07 17:25:09 +08:00
parent 15a4afbffd
commit aa3ba91dce
4 changed files with 4 additions and 43 deletions

View File

@ -362,17 +362,6 @@ namespace DOAN.Admin.WebApi.Controllers
return SUCCESS(response);
}
// TODO 如果没有id 传入工单 手动生成报工记录
[HttpGet("manual_generation_reportwork")]
public IActionResult ManualGenerationOfReportWork(string workorder)
{
if (string.IsNullOrEmpty(workorder)) {
throw new CustomException("workorder is null");
}
var response = _ProWorkorderService.ManualGenerationOfReportWork(workorder,HttpContext.GetName());
return SUCCESS(response);
}
}

View File

@ -25,5 +25,7 @@ namespace DOAN.Service.MES.product.IService
List<ProReportworkDto> UserExport(DateTime handleDate);
int ManualGenerationOfReportWork(string workorder, string CreatedBy);
}
}

View File

@ -61,7 +61,7 @@ namespace DOAN.Service.MES.product.IService
int WorkOrderLog(string workorder, string log, string Operator);
int ManualGenerationOfReportWork(string workorder, string CreatedBy);
}
}

View File

@ -1224,37 +1224,7 @@ namespace DOAN.Service.MES.product
return result;
}
/// <summary>
/// 如果没有id 传入工单 手动生成报工记录
/// </summary>
/// <param name="workorder"></param>
/// <returns></returns>
public int ManualGenerationOfReportWork(string workorder,string CreatedBy)
{
bool isEXsit= Context.Queryable<ProReportwork>().Where(it => it.FkWorkorder == workorder).Any();
if (isEXsit) {
return -1;
}
ProWorkorder handleWorkorder= Context.Queryable<ProWorkorder>().Where(it => it.Workorder == workorder).First();
ProReportwork proReportwork =new
ProReportwork();
proReportwork.Id = XueHua;
proReportwork.FkWorkorder = workorder;
proReportwork.DispatchNum = handleWorkorder.DeliveryNum;
proReportwork.FinishedNum = null;
proReportwork.GroupCode = handleWorkorder.GroupCode;
proReportwork.LineCode = handleWorkorder.LineCode;
proReportwork.CreatedBy = CreatedBy;
proReportwork.CreatedTime = DateTime.Now;
return Context.Insertable(proReportwork).ExecuteCommand();
}
}