public void ReSaveStock(string data, int cid) { //[FromBody]SaveTakeStockRequest requestParams if (string.IsNullOrWhiteSpace(data)) { throw new MessageException("参数不能为空!"); } var requestParams = data.ToObject <SaveTakeStockRequest>(); if (requestParams == null) { throw new MessageException("JSON参数不正确!"); } string barcode = ""; decimal?number = null; if (requestParams.TakeStockList.Any()) { barcode = requestParams.TakeStockList[0].Barcode; number = requestParams.TakeStockList[0].Number; } TakeStockService.ReSaveStock(requestParams.StoreId, requestParams.CheckBatch, requestParams.UserCode, barcode, number, requestParams.Sure); }