| | |
| | | var _wo = await Biz.Db.Queryable<BIZ_MES_WO>().Where(x => x.ORDER_NO == input.WorkOrder).FirstAsync(); |
| | | if (_wo != null) |
| | | { |
| | | _wo.CHANGE_TIME = _wo.STATUS == BIZ_MES_WO.STATUSs.Paused.GetValue() && input.Status == BIZ_MES_WO.STATUSs.Working.GetValue() ? DateTime.Now : _wo.CHANGE_TIME; |
| | | _wo.CHANGE_USER = _wo.STATUS == BIZ_MES_WO.STATUSs.Paused.GetValue() && input.Status == BIZ_MES_WO.STATUSs.Working.GetValue() ? input.UserId : _wo.CHANGE_USER; |
| | | _wo.STATUS = input.Status < 0 ? _wo.STATUS : input.Status; |
| | | _wo.ROUTE_STATUS = input.RouteStatus; |
| | | } |
| | |
| | | var _woBatch = await Biz.Db.Queryable<BIZ_MES_WO_BATCH>().Where(x => x.BATCH_NO == input.WoBatch).FirstAsync(); |
| | | if (_woBatch != null) |
| | | { |
| | | _woBatch.CHANGE_TIME = _woBatch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Paused.GetValue() && input.Status == BIZ_MES_WO_BATCH.STATUSs.Working.GetValue()? DateTime.Now: _woBatch.CHANGE_TIME; |
| | | _woBatch.CHANGE_USER = _woBatch.STATUS == BIZ_MES_WO_BATCH.STATUSs.Paused.GetValue() && input.Status == BIZ_MES_WO_BATCH.STATUSs.Working.GetValue() ? input.UserId: _woBatch.CHANGE_USER; |
| | | _woBatch.STATUS = input.Status < 0 ? _woBatch.STATUS : input.Status; |
| | | if (input.Status == BIZ_MES_WO_BATCH.STATUSs.Paused.GetValue()) |
| | | { |
| | |
| | | _woBatch.RELEASE_TIME = DateTime.Now; |
| | | _woBatch.RELEASE_USER = input.UserId; |
| | | _woBatch.ACT_LINE = input.ActLine; |
| | | _woBatch.CHANGE_USER = input.UserId; |
| | | _woBatch.CHANGE_TIME = DateTime.Now; |
| | | } |
| | | } |
| | | else |
| | |
| | | //如果是下发 |
| | | if (input.Status == BIZ_MES_WO_BATCH.STATUSs.Release.GetValue()) |
| | | { |
| | | db.Updateable(_woBatch, input.UserId).UpdateColumns(x => new { x.STATUS, x.RELEASE_USER, x.RELEASE_TIME, x.ACT_LINE, x.UPDATE_USER, x.UPDATE_TIME }).ExecuteCommand(); |
| | | db.Updateable(_woBatch, input.UserId).UpdateColumns(x => new { x.STATUS, x.RELEASE_USER, x.RELEASE_TIME, x.ACT_LINE, x.UPDATE_USER, x.UPDATE_TIME, x.CHANGE_USER,x.CHANGE_TIME }).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | db.Updateable(_woBatch, input.UserId).UpdateColumns(x => new { x.STATUS, x.UPDATE_USER, x.UPDATE_TIME }).ExecuteCommand(); |
| | | db.Updateable(_woBatch, input.UserId).UpdateColumns(x => new { x.STATUS, x.UPDATE_USER, x.UPDATE_TIME, x.CHANGE_USER, x.CHANGE_TIME }).ExecuteCommand(); |
| | | } |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | |
| | | wo = woSn.WORK_ORDER; |
| | | } |
| | | } |
| | | var ship = db.Queryable<mes_ShipList>().Where(q => q.MoDoc.Equals(wo) && q.Org == org.ID.ToInt64()).First(); |
| | | var ship = db.Queryable<mes_ShipList>().Where(q => q.MoDoc.Equals(wo) && q.Org == org.ID.ToInt64() && q.Status == 2 ).First(); |
| | | if (!ship.IsNullOrEmpty()) |
| | | { |
| | | result.Data = ship.BusinessDate.Date == DateTime.Now.Date ? new() |
| | |
| | | ProdInBatch = new() |
| | | { |
| | | WORK_ORDER = wo.ORDER_NO, |
| | | SALES_ORDER = wo.SALES_ORDER, |
| | | BATCH_NO = woSns[0].BATCH_NO, |
| | | ITEM_CODE = wo.ITEM_CODE, |
| | | ITEM_NAME = wo.ItemInfo?.ITEM_DESC, |
| | |
| | | }, |
| | | InStoreScanInfo = new() { |
| | | SN = code, |
| | | SALES_ORDER = wo.SALES_ORDER, |
| | | WORK_ORDER = wo.ORDER_NO, |
| | | BATCH_NO = woSns[0].BATCH_NO, |
| | | SCAN_QTY = woSns.Count |