更改 增加工单 根据计划ID查询工单

This commit is contained in:
xiaowei.song
2023-11-16 09:41:52 +08:00
parent ee917a3133
commit 1db36d34d9
3 changed files with 9 additions and 5 deletions

View File

@@ -105,7 +105,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
if (!string.IsNullOrEmpty(id))
{
lst = proWorkplanService.GetWorkorderList(id);
lst = proWorkplanService.GetWorkorderListByPlanId(id);
}
return ToResponse(new ApiResult(200, "success", lst));
@@ -136,17 +136,21 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
List<ProWorkplan> lstWorkplan = proWorkplanService.GetProWorkplanById(workPlanId);
// 查询所有生产工单
List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderList(workorderId);
List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderListByPlanId(workPlanId);
// 计算所有工单的数量和,生产计划的数量:比较
if(lstWorkplan!=null && lstWorkplan.Count==1)
{
int countWorkplan = int.Parse(lstWorkplan[0].ActualplanNumber.Trim());
// 计算已有工单的计划数
int countWorkorder = 0;
foreach (ProWorkorder item in lstWorkorder)
{
countWorkorder += item.Actualnumber.GetValueOrDefault();
}
// 再加上当前订单计划数
countWorkorder += proWorkorder.Actualnumber.GetValueOrDefault();
// 计划数>0 计划数要大于等于当前工单总数
@@ -186,7 +190,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
string isArrange = "0";
// 查询所有生产工单根据生产计划ID
List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderList(workPlanId);
List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderListByPlanId(workPlanId);
// 找到要更新的工单,要判断当前工单状态
ProWorkorder currentWorkorder = null;