zjh
5 天以前 661e24b717604dfc5c0f1c6385931943c2a9192e
StandardPda/MESApplication/Controllers/Warehouse/womdaaController.cs
@@ -1,4 +1,5 @@
using MES.Service.Dto.service;
using AngleSharp.Text;
using MES.Service.Dto.service;
using MES.Service.Modes;
using MES.Service.service;
using MES.Service.service.Warehouse;
@@ -111,6 +112,116 @@
            }
        }
        /// <summary>
        ///设置中箱码
        /// </summary>
        /// <returns></returns>
        [HttpPost("SetMediumBoxCode")]
        public ResponseResult SetMediumBoxCode(MesMiddleBox MesMiddleBox)
        {
            var entity = new MessageCenter();
            entity.TableName = TableName;
            entity.Url = URL + "SetMediumBoxCode";
            entity.Method = METHOD;
            entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(MesMiddleBox);
            entity.Status = 1;
            entity.CreateBy = "PL017";
            try
            {
                dynamic resultInfos = new ExpandoObject();
                var result = m.SetMediumBoxCode(MesMiddleBox);
                resultInfos.tbBillList = result;
                entity.Result = 0;
                if (result[0].ToBoolean()) entity.Result = 1;
                entity.DealWith = 1;
                _manager.save(entity);
                if (result[0].ToBoolean())
                {
                    return new ResponseResult
                    {
                        status = 0,
                        message = "OK",
                        data = resultInfos
                    };
                }
                else {
                    return new ResponseResult
                    {
                        status = 1,
                        message = result[1],
                        data = resultInfos
                    };
                }
            }
            catch (Exception ex)
            {
                entity.Result = 0;
                entity.DealWith = 0;
                entity.ResultData = ex.Message;
                _manager.save(entity);
                return ResponseResult.ResponseError(ex);
            }
        }
        /// <summary>
        ///设置栈板码
        /// </summary>
        /// <returns></returns>
        [HttpPost("SetStackCode")]
        public ResponseResult SetStackCode(MesPalletBinding mesPalletBinding)
        {
            var entity = new MessageCenter();
            entity.TableName = TableName;
            entity.Url = URL + "SetStackCode";
            entity.Method = METHOD;
            entity.Data = Newtonsoft.Json.JsonConvert.SerializeObject(mesPalletBinding);
            entity.Status = 1;
            entity.CreateBy = "PL017";
            try
            {
                dynamic resultInfos = new ExpandoObject();
                var result = m.SetStackCode(mesPalletBinding);
                resultInfos.tbBillList = result;
                entity.Result = 0;
                if (result[0].ToBoolean()) entity.Result = 1;
                entity.DealWith = 1;
                _manager.save(entity);
                if (result[0].ToBoolean())
                {
                    return new ResponseResult
                    {
                        status = 0,
                        message = "OK",
                        data = resultInfos
                    };
                }
                else
                {
                    return new ResponseResult
                    {
                        status = 1,
                        message = result[1],
                        data = resultInfos
                    };
                }
            }
            catch (Exception ex)
            {
                entity.Result = 0;
                entity.DealWith = 0;
                entity.ResultData = ex.Message;
                _manager.save(entity);
                return ResponseResult.ResponseError(ex);
            }
        }
    }
}