Tiger.Api/Controllers/MES/MESController.BIZ_MES_WO.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Business/MES/Biz.BIZ_MES_WO.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.IBusiness/MES/IBIZ_MES_WO.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
Tiger.Model.Net/Entitys/MES/BIZ_MES_WO.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
Tiger.Api/Controllers/MES/MESController.BIZ_MES_WO.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,54 @@ using Microsoft.AspNetCore.Mvc; using Rhea.Common; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; 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> SaveMesWo([FromBody] ApiAction<BIZ_MES_WO> action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().SaveMesWo(action.Data)); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } /// <summary> /// å é¤å·¥å /// </summary> /// <param name="action"></param> /// <returns></returns> [HttpPost] [Route("api/[controller]/[action]")] public async Task<IActionResult> DeleteMesWo([FromBody] ApiAction action) { ApiAction response = new(); try { response = response.GetResponse(await DI.Resolve<IBIZ_MES_WO>().DeleteMesWo(action.Data?.ToString())); } catch (System.Exception ex) { response = response.GetResponse().CatchExceptionWithLog(ex); } return Ok(response); } } } Tiger.Business/MES/Biz.BIZ_MES_WO.cs
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,100 @@ 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 static Tiger.Business.Biz; using Microsoft.AspNetCore.Http; namespace Tiger.Business { public partial class Biz { /// <summary> /// å·¥å /// </summary> public partial class BizMesWo : IBIZ_MES_WO { /// <summary> /// ä¿å /// </summary> /// <param name="wo"></param> /// <returns></returns> public async Task<ApiAction> SaveMesWo(BIZ_MES_WO wo) { var result = new ApiAction(); try { var _wo = Db.Queryable<BIZ_MES_WO>().Where(x=>x.ORDER_NO == wo.ORDER_NO).First(); if (_wo != null && _wo.STATUS!= (int)BIZ_MES_WO.STATUSs.Init) { result.IsSuccessed = false; result.LocaleMsg = new($"å·¥åå·²ç»åå¨ä¸ä¸æ¯åå§åç¶æï¼ä¸è½ä¿åä¿®æ¹ï¼"); return result; } var db = Db; var dbTran = db.UseTran(() => { var y = db.Storageable(wo) .WhereColumns(t => new { t.ORDER_NO, t.GHOST_ROW }) .ToStorage(); y.AsInsertable.ExecuteCommand(); y.AsUpdateable.IgnoreColumns(x => x.ID).ExecuteCommand(); }); if (!dbTran.IsSuccess) { result.IsSuccessed = false; result.Message = $"ä¿åå·¥åå¼å¸¸"; } } catch (Exception ex) { result.CatchExceptionWithLog(ex, "ä¿åå·¥åå¼å¸¸"); } return await Task.FromResult(result); } /// <summary> /// å é¤å·¥å /// </summary> /// <param name="woId"></param> /// <returns></returns> public async Task<ApiAction> DeleteMesWo(string woId) { var result = new ApiAction(); try { //æ¥è¯¢æ¯å¦å·²ç»æå·¥åå¨ç¨ var _wo = Db.Queryable<BIZ_MES_WO>().Where(x => x.ID == woId).First(); if (_wo != null && _wo.STATUS != (int)BIZ_MES_WO.STATUSs.Init) { result.IsSuccessed = false; result.LocaleMsg = new($"å·¥å䏿¯åå§åç¶æï¼ä¸è½å é¤ï¼"); return result; } var db = Db; var dbTran = db.UseTran(() => { db.Deleteable<BIZ_MES_WO>().Where(x => x.ID == woId).ExecuteCommand(); }); if (!dbTran.IsSuccess) { result.IsSuccessed = false; result.LocaleMsg = new($"å é¤å·¥åå¼å¸¸"); } } catch (Exception ex) { result.CatchExceptionWithLog(ex, "å é¤å·¥åå¼å¸¸"); } return await Task.FromResult(result); } } } } Tiger.IBusiness/MES/IBIZ_MES_WO.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; namespace Tiger.IBusiness { public interface IBIZ_MES_WO { public Task<ApiAction> SaveMesWo(BIZ_MES_WO wo); public Task<ApiAction> DeleteMesWo(string woId); } } Tiger.Model.Net/Entitys/MES/BIZ_MES_WO.cs
@@ -218,6 +218,18 @@ [Description("å·²å ³é")] Closed, } public enum ROUTE_STATUSs { [Description("å¾ é ç½®")] WaitSet, [Description("å·²é ç½®")] Finish, [Description("åæ¶")] Cancel, [Description("å·²å ³é")] Closed, } #endregion #region å ¬å ±æ¹æ³