首检添加数据看板
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.IdentityModel.Tokens;
|
||||
using ZR.Admin.WebApi.Extensions;
|
||||
using ZR.Model.mes.md;
|
||||
using ZR.Model.mes.pro;
|
||||
using ZR.Service.mes.pro.IService;
|
||||
using ZR.Service.MES.md;
|
||||
|
||||
namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
{
|
||||
@@ -30,9 +27,9 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
/// <param name="color">颜色</param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("list")]
|
||||
public IActionResult List(int pageNum, int pageSize, int year=-1, int week=-1, string partNumber = "", string color = "")
|
||||
public IActionResult List(int pageNum, int pageSize, int year = -1, int week = -1, string partNumber = "", string color = "")
|
||||
{
|
||||
(List<ProWorkplan>,int) data = proWorkplanService.GetAllData(pageNum, pageSize, year, week, partNumber, color);
|
||||
(List<ProWorkplan>, int) data = proWorkplanService.GetAllData(pageNum, pageSize, year, week, partNumber, color);
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
}
|
||||
@@ -46,7 +43,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
public IActionResult AddWorkPlan([FromBody] ProWorkplan proWorkplan)
|
||||
{
|
||||
int data = 0;
|
||||
if (proWorkplan!=null)
|
||||
if (proWorkplan != null)
|
||||
{
|
||||
proWorkplan.ToCreate(HttpContext);
|
||||
data = proWorkplanService.AddWorkPlan(proWorkplan);
|
||||
@@ -68,7 +65,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
{
|
||||
proWorkplan.ToUpdate(HttpContext);
|
||||
data = proWorkplanService.UpdateWorkPlan(proWorkplan);
|
||||
|
||||
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
@@ -137,7 +134,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
List<ProWorkorder> lstWorkorder = proWorkplanService.GetWorkorderListByPlanId(workPlanId);
|
||||
|
||||
// 计算所有工单的数量和,生产计划的数量:比较
|
||||
if(lstWorkplan!=null && lstWorkplan.Count==1)
|
||||
if (lstWorkplan != null && lstWorkplan.Count == 1)
|
||||
{
|
||||
int countWorkplan = int.Parse(lstWorkplan[0].ActualplanNumber.Trim());
|
||||
|
||||
@@ -152,7 +149,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
countWorkorder += proWorkorder.Actualnumber.GetValueOrDefault();
|
||||
|
||||
// 计划数>0 计划数要大于等于当前工单总数
|
||||
if(countWorkplan > 0 && (countWorkplan>= countWorkorder))
|
||||
if (countWorkplan > 0 && (countWorkplan >= countWorkorder))
|
||||
{
|
||||
proWorkorder.Partnumber = lstWorkplan[0].Partnumber;
|
||||
proWorkorder.ToCreate(HttpContext);
|
||||
@@ -197,7 +194,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
ProWorkorder currentWorkorder = null;
|
||||
foreach (ProWorkorder item in lstWorkorder)
|
||||
{
|
||||
if(item.Id.Equals(workorderId)) // 找到当前工单ID的对象
|
||||
if (item.Id.Equals(workorderId)) // 找到当前工单ID的对象
|
||||
{
|
||||
//if(!string.IsNullOrEmpty(item.Wrokerorder_status)) isArrange = item.Isarrange;
|
||||
isArrange = item.Wrokerorder_status.ToString();
|
||||
@@ -223,7 +220,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
{
|
||||
countWorkorder += item.Actualnumber.GetValueOrDefault();
|
||||
}
|
||||
if(currentWorkorder!=null) countWorkorder -= currentWorkorder.Actualnumber.GetValueOrDefault(); // 减去当前工单的数值
|
||||
if (currentWorkorder != null) countWorkorder -= currentWorkorder.Actualnumber.GetValueOrDefault(); // 减去当前工单的数值
|
||||
|
||||
// 再加上要更新的值
|
||||
countWorkorder += proWorkorder.Actualnumber.GetValueOrDefault();
|
||||
@@ -241,7 +238,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
}
|
||||
}
|
||||
else data = 3;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -277,7 +274,7 @@ namespace ZR.Admin.WebApi.Controllers.MES.pro
|
||||
}
|
||||
else data = 3;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
return ToResponse(new ApiResult(200, "success", data));
|
||||
|
||||
Reference in New Issue
Block a user