Tiger.Api/Controllers/MES/MESController.BAS_PKG_RULE.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Business.MES/BIZ/BAS_PKG_RULE.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Business.MES/Common/DoUnPack.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Business/MES/Biz.Route.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.IBusiness/MES/BIZ/IBasPkgRule.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Entitys/MES/ParameterEntity/BizBasPkgRuleParameter.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Tiger.Model.Net.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Tiger.Api/Controllers/MES/MESController.BAS_PKG_RULE.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,36 @@ using Microsoft.AspNetCore.Mvc; using Rhea.Common; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; using Tiger.Model.Entitys.MES.BizBasPkgRule; using Tiger.Model.Entitys.MES.BizMesWo; using Tiger.Model.Entitys.MES.BizMesWoBatch; namespace Tiger.Api.Controllers.MES { public partial class MESController : ControllerBase { /// <summary> /// ä¿åå è£ è§å /// </summary> /// <param name="action"></param> /// <returns></returns> [HttpPost] [Route("api/[controller]/[action]")] public async Task<IActionResult> SaveBasPkgRule([FromBody] ApiAction<BizBasPkgRuleInput> action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve<IBasPkgRule>().SaveBasPkgRule(action.Data)); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } } } Tiger.Business.MES/BIZ/BAS_PKG_RULE.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,70 @@ using Tiger.Model; using SqlSugar; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Text; using System.Threading.Tasks; using Rhea.Common; using System.Net; using System.Linq; using Newtonsoft.Json; using Tiger.IBusiness; using Microsoft.AspNetCore.Http; using Tiger.Model.Entitys.MES.BizMesWoBatch; using Tiger.Model.Entitys.MES.BizMesWo; using Tiger.Model.Entitys.MES.BizBasPkgRule; namespace Tiger.Business.MES { public partial class BizBasPkgRule : IBasPkgRule { /// <summary> /// ä¿åå è£ è§åï¼å æ¬æç»åééèå´ /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task<ApiAction> SaveBasPkgRule(BizBasPkgRuleInput input) { var result = new ApiAction(); try { var db = Biz.Db; var dbTran = db.UseTran(() => { //if (input.PkgRule!=null) //{ // var y = db.Storageable(input.PkgRule) // .WhereColumns(t => new { t.ID, t.GHOST_ROW }) // .ToStorage(); // y.AsInsertable.ExecuteCommand(); // y.AsUpdateable.ExecuteCommand(); //} var z = db.Storageable(input.PkgDtl) .WhereColumns(t => new { t.ID, t.GHOST_ROW }) .ToStorage(); z.AsInsertable.ExecuteCommand(); z.AsUpdateable.ExecuteCommand(); var o = db.Storageable(input.PkgProd) .WhereColumns(t => new { t.ID, t.GHOST_ROW }) .ToStorage(); o.AsInsertable.ExecuteCommand(); o.AsUpdateable.ExecuteCommand(); }); if (!dbTran.IsSuccess) { result.IsSuccessed = false; result.Message = $"ä¿åå è£ è§åå¼å¸¸"; } } catch (Exception ex) { result.CatchExceptionWithLog(ex, "ä¿åå è£ è§åå¼å¸¸"); } return await Task.FromResult(result); } } } Tiger.Business.MES/Common/DoUnPack.cs
@@ -25,12 +25,18 @@ /// </summary> /// <param name="input"></param> /// <returns></returns> public async Task<ApiAction<List<MES_WIP_PKG>>> Submit(DoUnPackInput input) public async Task<ApiAction<List<MES_WIP_PKG>>> Submit(DoUnPackInput input) { var result = new ApiAction<List<MES_WIP_PKG>>(); try { var wipPkg = await Biz.Db.Queryable<MES_WIP_PKG>().Where(q => q.SN == input.SN && q.AUTH_ORG == input.AUTH_ORG).FirstAsync(); if (wipPkg == null) { result.IsSuccessed = false; result.LocaleMsg = new($"æ¡ç ä¸åå¨å è£ ä¸"); return result; } var wipPkgParent = await Biz.Db.Queryable<MES_WIP_PKG>().Where(q => q.SN == wipPkg.PARENT_SN && q.AUTH_ORG == input.AUTH_ORG).FirstAsync(); var db = Biz.Db; var dbTran = db.UseTran(() => @@ -45,7 +51,7 @@ if (!dbTran.IsSuccess) { result.IsSuccessed = false; result.Message = $"æè§£å è£ å¼å¸¸"; result.LocaleMsg = new($"æè§£å è£ å¼å¸¸"); } result.Data = Biz.Db.Queryable<MES_WIP_PKG>().Where(q => q.PARENT_SN == wipPkgParent.SN).ToList(); } Tiger.Business/MES/Biz.Route.cs
@@ -273,20 +273,26 @@ try { var _route = Db.Queryable<MES_ROUTE>().Where(x => x.ROT_CODE == route.ROT_CODE).First(); if (_route != null && Db.Queryable<MES_ROUTE_NODE>().Where(x => x.ROT_ID == _route.ID).Any()) //if (_route != null && Db.Queryable<MES_ROUTE_NODE>().Where(x => x.ROT_ID == _route.ID).Any()) //{ // result.IsSuccessed = false; // result.LocaleMsg = new($"å·¥èºè·¯çº¿å·²ç»æè®¾è®¡è®°å½ï¼ä¸è½ä¿åï¼"); // return result; //} if (_route != null && Db.Queryable<MES_PROD_OPER>().Where(x => x.ROT_ID == _route.ID).Any()) { result.IsSuccessed = false; result.LocaleMsg = new($"å·¥èºè·¯çº¿å·²ç»æè®¾è®¡è®°å½ï¼ä¸è½ä¿åï¼"); result.LocaleMsg = new($"å·¥èºè·¯çº¿å·²ç»æç»å®è®°å½ï¼ä¸è½ä¿åï¼"); return result; } var db = Db; var dbTran = db.UseTran(() => { var y = db.Storageable(route) .WhereColumns(t => new { t.ROT_CODE, t.GHOST_ROW }) //.WhereColumns(t => new { t.ROT_CODE, t.GHOST_ROW }) .ToStorage(); y.AsInsertable.ExecuteCommand(); y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); y.AsUpdateable.ExecuteCommand(); }); if (!dbTran.IsSuccess) { Tiger.IBusiness/MES/BIZ/IBasPkgRule.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,17 @@ using Rhea.Common; using System; using System.Collections.Generic; using System.Data; using System.Linq; using System.Text; using System.Threading.Tasks; using Tiger.Model; using Tiger.Model.Entitys.MES.BizBasPkgRule; namespace Tiger.IBusiness { public interface IBasPkgRule { public Task<ApiAction> SaveBasPkgRule(BizBasPkgRuleInput input); } } Tiger.Model.Net/Entitys/MES/ParameterEntity/BizBasPkgRuleParameter.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,15 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Tiger.Model.Entitys.MES.BizBasPkgRule { public class BizBasPkgRuleInput { public BAS_PKG_RULE PkgRule { get; set; } public List<BAS_PKG_DTL> PkgDtl { get; set; } public List<BAS_PKG_PROD> PkgProd { get; set; } } } Tiger.Model.Net/Tiger.Model.Net.csproj
@@ -157,6 +157,7 @@ <Compile Include="Entitys\MES\MES_WO_OPER.cs" /> <Compile Include="Entitys\MES\node.cs" /> <Compile Include="Entitys\MES\ParameterEntity\BizMesWoBatchParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\BizBasPkgRuleParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\DoUnPackParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\CodeVerificationParameter.cs" /> <Compile Include="Entitys\MES\ParameterEntity\BizMesWoParameter.cs" />