更改 工单删除逻辑
This commit is contained in:
@@ -253,7 +253,27 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
int data = 0;
|
||||
if (!string.IsNullOrEmpty(id))
|
||||
{
|
||||
data = proWorkplanService.DeleteWorkorder(id);
|
||||
// 查询所有生产工单,根据生产计划ID
|
||||
List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderListById(id);
|
||||
|
||||
if (lstWorkorder != null && lstWorkorder.Count == 1)
|
||||
{
|
||||
string isArrange = "0";
|
||||
|
||||
// 排产状态非空
|
||||
if (!string.IsNullOrEmpty(lstWorkorder[0].Isarrange))
|
||||
{
|
||||
isArrange = lstWorkorder[0].Isarrange;
|
||||
}
|
||||
|
||||
// 排产状态为 0 ,可执行删除
|
||||
if ("0".Equals(isArrange))
|
||||
{
|
||||
data = proWorkplanService.DeleteWorkorder(id);
|
||||
}
|
||||
else data = 2;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
|
||||
Reference in New Issue
Block a user