| | |
| | | _woBatch.CHANGE_USER = input.UserId; |
| | | _woBatch.CHANGE_TIME = DateTime.Now; |
| | | } |
| | | 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 |
| | | { |
| | |
| | | else |
| | | { |
| | | 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()) |
| | | { |
| | | db.Updateable(_wo, input.UserId).UpdateColumns(x => new { x.STATUS, x.UPDATE_USER, x.UPDATE_TIME }).ExecuteCommand(); |
| | | } |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | |
| | | } |
| | | return result; |
| | | } |
| | | |
| | | #region 提交前通用方法 |
| | | /// <summary> |
| | | /// 提交前检查是否岗位、工单和不良代码 |
| | | /// </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 |
| | | } |
| | | } |