From c476c9cf07c1b1920cc4bf51f60a78f5768c30fa Mon Sep 17 00:00:00 2001 From: Ben Lin <maobin001@msn.com> Date: 星期一, 23 十二月 2024 19:41:33 +0800 Subject: [PATCH] 实体变化引起变更 --- Tiger.Business.MES/BIZ/BIZ_MES_WO.cs | 38 +++++++++++++++++++++++++++++++++----- 1 files changed, 33 insertions(+), 5 deletions(-) diff --git a/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs b/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs index 575ea7f..75a63f5 100644 --- a/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs +++ b/Tiger.Business.MES/BIZ/BIZ_MES_WO.cs @@ -291,9 +291,14 @@ _woBatch.ACT_LINE = input.ActLine; _woBatch.CHANGE_USER = input.UserId; _woBatch.CHANGE_TIME = DateTime.Now; + _wo.STATUS = BIZ_MES_WO.STATUSs.Release.GetValue(); } - if (!Biz.Db.Queryable<BIZ_MES_WO_BATCH>().Where(x => x.ORDER_NO == input.WorkOrder && x.STATUS> BIZ_MES_WO_BATCH.STATUSs.Init.GetValue()).Any()) { - _wo.STATUS = BIZ_MES_WO.STATUSs.Init.GetValue(); + else + { + if (input.Status == BIZ_MES_WO_BATCH.STATUSs.Init.GetValue() && !Biz.Db.Queryable<BIZ_MES_WO_BATCH>().Where(x => x.ORDER_NO == input.WorkOrder && x.BATCH_NO != input.WoBatch && x.STATUS > BIZ_MES_WO_BATCH.STATUSs.Init.GetValue()).Any()) + { + _wo.STATUS = BIZ_MES_WO.STATUSs.Init.GetValue(); + } } } else @@ -315,7 +320,7 @@ { db.Updateable(_woBatch, input.UserId).UpdateColumns(x => new { x.STATUS, x.UPDATE_USER, x.UPDATE_TIME, x.CHANGE_USER, x.CHANGE_TIME }).ExecuteCommand(); } - if (!_wo.IsNullOrEmpty() && _wo.STATUS == BIZ_MES_WO.STATUSs.Init.GetValue()) + if (!_wo.IsNullOrEmpty()) { db.Updateable(_wo, input.UserId).UpdateColumns(x => new { x.STATUS, x.UPDATE_USER, x.UPDATE_TIME }).ExecuteCommand(); } @@ -637,12 +642,12 @@ result.Data = ship.BusinessDate.Date == DateTime.Now.Date ? new() { ShipDoc = ship.ShipDoc, - ShippingQty = ship.ShipQty, + ShippingQty = ship.ShipQty.ToDouble(), Tag = "Customer" } : new() { ShipDoc = ship.ShipDoc, - ShippingQty = ship.ShipQty, + ShippingQty = ship.ShipQty.ToDouble(), Tag = "InStoreLabel" }; result.LocaleMsg = new($"鍑鸿揣淇℃伅瀛樺湪锛�"); @@ -755,5 +760,28 @@ } return result; } + + #region 鎻愪氦鍓嶉�氱敤鏂规硶 + /// <summary> + /// 鎻愪氦鍓嶆鏌ユ槸鍚﹀矖浣嶃�佸伐鍗曞拰涓嶈壇浠g爜 + /// </summary> + /// <param name="code"></param> + /// <returns></returns> + public async Task<ApiAction<CheckCodeOutput>> CheckCode(string code) + { + var action = new ApiAction<CheckCodeOutput>($"妫�鏌ユ潯鐮亄code}鎴愬姛", new CheckCodeOutput()); + try + { + action.Data.Position = DbCache.Cache.Position[code]; + action.Data.WorkOrder = await Biz.Db.Queryable<BIZ_MES_WO>().Where(q => q.ORDER_NO == code).FirstAsync(); + action.Data.Defect = DbCache.Cache.Defect[code]; + } + catch (Exception ex) + { + action.CatchExceptionWithLog(ex, $"妫�鏌ユ潯鐮亄code}寮傚父"); + } + return action; + } + #endregion } } -- Gitblit v1.9.3