| | |
| | | result.IsSuccessed = false; |
| | | result.LocaleMsg = new($"保存批次工单异常"); |
| | | } |
| | | //如果成功,根据条件异步保存工艺路线到产品的客户 |
| | | if (result.IsSuccessed && input.IfToCust) { |
| | | Work.DoAsync(() => { |
| | | try |
| | | { |
| | | SugarParameter[] pars = Biz.Db.Ado.GetParameters(new { WO = input.Wo.ORDER_NO, ERR_CODE = 0, ERR_MSG = "" }); |
| | | pars[1].Direction = System.Data.ParameterDirection.Output; |
| | | pars[2].Direction = System.Data.ParameterDirection.Output; |
| | | Biz.Db.Ado.UseStoredProcedure().ExecuteCommand("SP_MES_WO2CUST", pars); |
| | | //response.LocaleMsg = new(pars[2].Value.ToString()); |
| | | if (pars[1].Value.ToInt32() == 0) |
| | | { |
| | | Logger.Default.Info($"工单[{input.Wo.ORDER_NO}]下发完成后保存工艺路线数据到产品[{input.Wo.ITEM_CODE}]的客户[{input.Wo.Customer.CUST_NAME_CN}]的工艺路线中,{pars[2].Value.ToString()}"); |
| | | } |
| | | else |
| | | { |
| | | Logger.Default.Error($"工单[{input.Wo.ORDER_NO}]下发完成后保存工艺路线数据到产品[{input.Wo.ITEM_CODE}]的客户[{input.Wo.Customer.CUST_NAME_CN}]的工艺路线出错,{pars[2].Value.ToString()}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | result.CatchExceptionWithLog(ex, "保存批次工单异常"); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | |
| | | var db = Biz.Db; |
| | | var dbTran = db.UseTran(() => |
| | | { |
| | | db.Updateable(_wo, input.UserId).UpdateColumns(x => new { x.STATUS, x.ROUTE_STATUS }).ExecuteCommand(); |
| | | db.Updateable(_wo, input.UserId).UpdateColumns(x => new { x.STATUS, x.ROUTE_STATUS, x.UPDATE_USER, x.UPDATE_TIME }).ExecuteCommand(); |
| | | }); |
| | | if (!dbTran.IsSuccess) |
| | | { |
| | |
| | | //如果是下发 |
| | | 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 }).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 }).ExecuteCommand(); |
| | | } |
| | | else |
| | | { |
| | | db.Updateable(_woBatch, input.UserId).UpdateColumns(x => new { x.STATUS }).ExecuteCommand(); |
| | | db.Updateable(_woBatch, input.UserId).UpdateColumns(x => new { x.STATUS, x.UPDATE_USER, x.UPDATE_TIME }).ExecuteCommand(); |
| | | } |
| | | }); |
| | | if (!dbTran.IsSuccess) |