| | |
| | | using WMS.IBLL.IPdaServer; |
| | | using WMS.BLL.BllQualityServer; |
| | | using WMS.IBLL; |
| | | using ZXing.QrCode.Internal; |
| | | using System.Xml.Linq; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | _pdaAsnServer = pdaAsnServer; |
| | | _http = http; |
| | | } |
| | | #endregion |
| | | |
| | | #region JC34 |
| | | |
| | | |
| | | /// <summary> |
| | | /// 物料下发 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult CreateSku(object model) |
| | | { |
| | | |
| | | try |
| | | { |
| | | |
| | | return Ok(new { result = true, code = "1" ,message = "success" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { result = false, code = "400", message = e.Message }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 客户信息接收 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult CreateCustomer(object model) |
| | | { |
| | | |
| | | try |
| | | { |
| | | return Ok(new { result = true, code = "1", message = "success" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { result = false, code = "400", message = e.Message }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 入库单接收 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult CreateAsn(object model) |
| | | { |
| | | |
| | | try |
| | | { |
| | | return Ok(new { result = true, code = "1", message = "success" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { result = false, code = "400", message = e.Message }); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 出库单接收 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult CreateSo(object model) |
| | | { |
| | | |
| | | try |
| | | { |
| | | return Ok(new { result = true, code = "1", message = "success" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { result = false, code = "400", message = e.Message }); |
| | | } |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// 库存质量状态接收 |
| | | /// </summary> |
| | | /// <param name="model"></param> |
| | | /// <returns></returns> |
| | | [AllowAnonymous] |
| | | [HttpPost] |
| | | public IActionResult UpQuality(object model) |
| | | { |
| | | |
| | | try |
| | | { |
| | | // var sd = JsonConvert.SerializeObject(model); |
| | | // var sd2 = JsonConvert.DeserializeObject<BoxPalletBindVm>(sd); |
| | | |
| | | return Ok(new { result = true, code = "1", message = "success" }); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new { result = false, code = "400", message = e.Message }); |
| | | } |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | | #region 调用上游系统接口 |
| | |
| | | await _stockCheckSvc.StockAdjustAuto(model.Id); |
| | | } |
| | | //系统对接后放开 |
| | | //var bl =_stockCheckSvc.FinishCr(model.Id,_config.ErpHost + _config.DataChangeUrl, int.Parse(userId)); |
| | | var bl =_stockCheckSvc.FinishCr(model.Id,_config.ErpHost + _config.DataChangeUrl, int.Parse(userId)); |
| | | //if (bl) |
| | | //{ |
| | | return Ok(new { code = 0, count = 0, msg = "盘点单调整上传成功" }); |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 入库单据下发 |
| | | /// </summary> |
| | | /// <param name="model">入库单信息</param> |
| | | /// <returns></returns> |
| | | [Authorize] |
| | | [HttpPost] |
| | | public IActionResult CreateAsn(AsnInfo model) |
| | | { |
| | | var result = new ErpModel { Success = -1, Message = "" }; |
| | | try |
| | | { |
| | | var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | if (claimsIdentity == null) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | if (string.IsNullOrWhiteSpace(UserId)) |
| | | { |
| | | throw new Exception("未获取到用户信息"); |
| | | } |
| | | ///// <summary> |
| | | ///// 入库单据下发 |
| | | ///// </summary> |
| | | ///// <param name="model">入库单信息</param> |
| | | ///// <returns></returns> |
| | | //[Authorize] |
| | | //[HttpPost] |
| | | //public IActionResult CreateAsn(AsnInfo model) |
| | | //{ |
| | | // var result = new ErpModel { Success = -1, Message = "" }; |
| | | // try |
| | | // { |
| | | // var claimsIdentity = this.User.Identity as ClaimsIdentity; |
| | | // if (claimsIdentity == null) |
| | | // { |
| | | // throw new Exception("未获取到用户信息"); |
| | | // } |
| | | // string UserId = claimsIdentity.FindFirst(ClaimTypes.Name)?.Value; |
| | | // if (string.IsNullOrWhiteSpace(UserId)) |
| | | // { |
| | | // throw new Exception("未获取到用户信息"); |
| | | // } |
| | | |
| | | result = _arrivalNoticeSvc.CreateAsn(model); |
| | | // result = _arrivalNoticeSvc.CreateAsn(model); |
| | | |
| | | return Ok(result); |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | result.Message = e.Message; |
| | | return Ok(result); |
| | | } |
| | | } |
| | | // return Ok(result); |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // result.Message = e.Message; |
| | | // return Ok(result); |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 出库单下发接口 |
| | | /// </summary> |
| | | /// <param name="model">出库单信息</param> |
| | | /// <returns></returns> |
| | | [HttpPost] |
| | | public IActionResult CreateSo(SoInfo model) |
| | | { |
| | | try |
| | | { |
| | | SoResInfo result = _exNoticeSvc.ErpAddExportNotice(model); |
| | | return Ok(result); |
| | | ///// <summary> |
| | | ///// 出库单下发接口 |
| | | ///// </summary> |
| | | ///// <param name="model">出库单信息</param> |
| | | ///// <returns></returns> |
| | | //[HttpPost] |
| | | //public IActionResult CreateSo(SoInfo model) |
| | | //{ |
| | | // try |
| | | // { |
| | | // SoResInfo result = _exNoticeSvc.ErpAddExportNotice(model); |
| | | // return Ok(result); |
| | | |
| | | } |
| | | catch (Exception e) |
| | | { |
| | | return Ok(new ErpModel { Success = -1, Message = e.Message }); |
| | | } |
| | | } |
| | | // } |
| | | // catch (Exception e) |
| | | // { |
| | | // return Ok(new ErpModel { Success = -1, Message = e.Message }); |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 车间叫料 |