WebAPI接收二维数组

做安卓手持时,需要将扫描到的轮胎条码号传递给后台接口,由于是二维数组后台不知该如何接收,再次记录下;

前台post数据:

items: any = {
    'one': [],
    'two': [],
    'three': [],
    'four': [],
    'five': []
  };
  inStorageConfim() {
    if (this.items["one"].length == 0 && this.items["two"].length == 0 && this.items["three"].length == 0
      && this.items["four"].length == 0 && this.items["five"].length == 0) {
      this.appService.toast('请先扫描轮胎再入库');
    } else if (this.alertInputValue == null) {
      this.appService.toast('请选择站台');
    } else {
      // 入库操作
      var postA = new Array();
      postA[0] = this.getItems('one');
      postA[1] = this.getItems('two');
      postA[2] = this.getItems('three');
      postA[3] = this.getItems('four');
      postA[4] = this.getItems('five');
      this.appService.httpPost(AppGlobal.API.sendBarcode, { TyreList: postA }, rs => { });
    }
  }
后台部分:
 [HttpPost]
        public void ReceiveBarcode([FromBody] ProductsIDList tyreInfo)
        {
            Console.WriteLine(tyreInfo.TyreList);
            Console.ReadLine();
        }
 public class TyreInStorage
    {
        public int BAT_QTY { get; set; }
        public int EACH_BAT_QTY { get; set; }
        public string PalletNo { get; set; }
        public string Barcode { get; set; }
        public string PRODUCT_ID { get; set; }
        public string PRODUCT_GUID { get; set; }
        public string STACK_IDX { get; set; }
        public string LAYRE_IDX { get; set; }
    }
    public class ProductsIDList
    {
        //重点
        public List<List<TyreInStorage>> TyreList { get; set; }
        public string PalletNo { get; set; }
        public string LocNo { get; set; }
    }

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值