diff --git a/ZR.Admin.WebApi/Controllers/mes/md/MdProductDefineController.cs b/ZR.Admin.WebApi/Controllers/mes/md/MdProductDefineController.cs index 89835487..97abbfcf 100644 --- a/ZR.Admin.WebApi/Controllers/mes/md/MdProductDefineController.cs +++ b/ZR.Admin.WebApi/Controllers/mes/md/MdProductDefineController.cs @@ -10,6 +10,7 @@ using ZR.Model.mes.md; using ZR.Model.mes.md.DTO; using ZR.Service.mes.md; using ZR.Service.mes.md.IService; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace ZR.Admin.WebApi.Controllers.mes.md { @@ -79,6 +80,10 @@ namespace ZR.Admin.WebApi.Controllers.mes.md [HttpPost("addProductDefine")] public IActionResult addProductDefine([FromBody] MdProductDefine products) { + if (products == null) + { + return ToResponse(new ApiResult((int)ResultCode.NO_DATA, "null")); + } if (products != null) { products.ToCreate(HttpContext); diff --git a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj index 01efaafa..7b6e1fba 100644 --- a/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj +++ b/ZR.Admin.WebApi/ZR.Admin.WebApi.csproj @@ -30,6 +30,7 @@ + diff --git a/ZR.Model/mes/md/MdProductDefine.cs b/ZR.Model/mes/md/MdProductDefine.cs index 77476777..add19b36 100644 --- a/ZR.Model/mes/md/MdProductDefine.cs +++ b/ZR.Model/mes/md/MdProductDefine.cs @@ -35,17 +35,11 @@ namespace ZR.Model.mes.md public string ProductUnitName { get; set; } /// - /// 工艺路线code + /// 产线json /// - [SugarColumn(ColumnName="processRoute_code" )] - public string ProcessrouteCode { get; set; } - [SugarColumn(IsIgnore = true)] - public string ProcessrouteCodeName { get; set; } - /// - /// 工艺路线 - /// - [SugarColumn(ColumnName="processRoute_name" )] - public string ProcessrouteName { get; set; } + [SugarColumn(ColumnName= "worklineArray")] + public string WorklineArray { get; set; } + /// /// 预留字段1 /// diff --git a/ZR.Service/mes/md/MdProductDefineService.cs b/ZR.Service/mes/md/MdProductDefineService.cs index e47a70c6..3f8e1fa6 100644 --- a/ZR.Service/mes/md/MdProductDefineService.cs +++ b/ZR.Service/mes/md/MdProductDefineService.cs @@ -1,6 +1,7 @@ using Infrastructure.Attribute; using Infrastructure.Extensions; using JinianNet.JNTemplate; +using Microsoft.AspNetCore.Mvc.Formatters.Xml; using Microsoft.Extensions.DependencyInjection; using SqlSugar; using System; @@ -84,6 +85,7 @@ namespace ZR.Service.mes.md return Context.Queryable().ToList(); } + public List GetWorklineList() { return Context.Queryable().ToList();