using Rhea.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Tiger.IBusiness; using Tiger.Model; using Tiger.Model.Minsun; namespace Tiger.Business.WMS { /// /// 更新领料单状态 /// public partial class AGV { public ApiAction UpdateStatus(AgvMRUpdateInput input) { ApiAction response = new(); try { DbClient db = Biz.DataSource["WMS57"].Client; BIZ_ERP_PROD_OUT entity = new BIZ_ERP_PROD_OUT(); BIZ_ERP_PROD_OUT entity_x = db.Queryable().Where(x => x.SOURCECODE.Contains(input.taskId)).First(); if (entity_x != null) { entity = entity_x; } else { response.IsSuccessed = false; response.Message = $"任务ID[{input.taskId}]在领料单中查不到记录"; return response; } entity.STATUS = BIZ_ERP_PROD_OUT.STATUSs.COMPLETE.GetValue(); entity.ERP_BILL_CODE = "手工过账"; //保存数据库 var dbTran = db.UseTran(() => { db.Updateable(entity).UpdateColumns(x => new { x.STATUS, x.ERP_BILL_CODE }).ExecuteCommand(); }); if (!dbTran.IsSuccess) { response.GetResponse().CatchExceptionWithLog(dbTran.ErrorException); } response.Message = $"领料单[{entity.BILLCODE}]更新状态成功,agv可清除"; } catch (Exception ex) { response.GetResponse().CatchExceptionWithLog(ex); } return response; } } }