| | |
| | | }); |
| | | |
| | | //获取ERP入库表sql |
| | | //DataTable dt = DapperHelper.lissql("h_p_MesInErpProductWareHous"); |
| | | DataTable dt = DapperHelper.lissql("h_p_MesInErpProductWareHous"); |
| | | //写入ERP入库记录主表 |
| | | //sql = @"" + dt.Rows[0]["cname"].ToString() + ""; |
| | | //list.Add(new |
| | | //{ |
| | | // str = sql, |
| | | // parm = new |
| | | // { |
| | | // code = obj["head"]["hbillno"].ToString(), |
| | | // sourceVoucherId = obj["head"]["sourceVoucherId"].ToString(), |
| | | // sourceVoucherCode = obj["head"]["sourceVoucherCode"].ToString(), |
| | | // saleOrderId = obj["head"]["saleOrderId"].ToString(), |
| | | // saleOrderCode = obj["head"]["saleOrderCode"].ToString(), |
| | | // rdDirectionFlag = obj["head"]["rdDirectionFlag"].ToString(), |
| | | // makerid = obj["head"]["makerid"].ToString(), |
| | | // maker = obj["head"]["maker"].ToString(), |
| | | // accountingyear = obj["head"]["accountingyear"].ToString(), |
| | | // VoucherYear = obj["head"]["VoucherYear"].ToString(), |
| | | // VoucherPeriod = obj["head"]["VoucherPeriod"].ToString(), |
| | | // ManufactureOrderCode = obj["head"]["ManufactureOrderCode"].ToString(), |
| | | // idbusitype = obj["head"]["idbusitype"].ToString(), |
| | | // iddepartment = obj["head"]["iddepartment"].ToString(), |
| | | // idrdstyle = obj["head"]["idrdstyle"].ToString(), |
| | | // idwarehouse = obj["head"]["idwarehouse"].ToString(), |
| | | // voucherState = obj["head"]["voucherState"].ToString(), |
| | | // idvouchertype = obj["head"]["idvouchertype"].ToString(), |
| | | // voucherdate = obj["head"]["voucherdate"].ToString(), |
| | | // madedate = obj["head"]["madedate"].ToString(), |
| | | // createdtime = obj["head"]["createdtime"].ToString(), |
| | | // DataSource = obj["head"]["DataSource"].ToString(), |
| | | sql = @"" + dt.Rows[0]["cname"].ToString() + ""; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | code = obj["head"]["hbillno"].ToString(), |
| | | sourceVoucherId = obj["head"]["sourceVoucherId"].ToString(), |
| | | sourceVoucherCode = obj["head"]["sourceVoucherCode"].ToString(), |
| | | saleOrderId = obj["head"]["saleOrderId"].ToString(), |
| | | saleOrderCode = obj["head"]["saleOrderCode"].ToString(), |
| | | rdDirectionFlag = obj["head"]["rdDirectionFlag"].ToString(), |
| | | makerid = obj["head"]["makerid"].ToString(), |
| | | maker = obj["head"]["maker"].ToString(), |
| | | accountingyear = obj["head"]["accountingyear"].ToString(), |
| | | VoucherYear = obj["head"]["VoucherYear"].ToString(), |
| | | VoucherPeriod = obj["head"]["VoucherPeriod"].ToString(), |
| | | ManufactureOrderCode = obj["head"]["ManufactureOrderCode"].ToString(), |
| | | idbusitype = obj["head"]["idbusitype"].ToString(), |
| | | iddepartment = obj["head"]["iddepartment"].ToString(), |
| | | idrdstyle = obj["head"]["idrdstyle"].ToString(), |
| | | idwarehouse = obj["head"]["idwarehouse"].ToString(), |
| | | voucherState = obj["head"]["voucherState"].ToString(), |
| | | idvouchertype = obj["head"]["idvouchertype"].ToString(), |
| | | voucherdate = obj["head"]["voucherdate"].ToString(), |
| | | madedate = obj["head"]["madedate"].ToString(), |
| | | createdtime = obj["head"]["createdtime"].ToString(), |
| | | DataSource = obj["head"]["DataSource"].ToString(), |
| | | |
| | | // } |
| | | //}); |
| | | } |
| | | }); |
| | | //写入ERP、MES入库记录子表 |
| | | for (int j = 0; j < subsum_arra.Count; j++) |
| | | { |
| | | //写入ERP入库记录子表 |
| | | //sql = @"" + dt.Rows[1]["cname"].ToString() + ""; |
| | | //list.Add(new |
| | | //{ |
| | | // str = sql, |
| | | // parm = new |
| | | // { |
| | | // code= subsum_arra[j]["code"].ToString(), |
| | | // arrivalQuantity = subsum_arra[j]["arrivalQuantity"].ToString(), |
| | | // quantity = subsum_arra[j]["quantity"].ToString(), |
| | | // compositionQuantity = subsum_arra[j]["compositionQuantity"].ToString(), |
| | | // baseQuantity = subsum_arra[j]["baseQuantity"].ToString(), |
| | | // sourceVoucherId = subsum_arra[j]["sourceVoucherId"].ToString(), |
| | | // sourceVoucherCode = subsum_arra[j]["sourceVoucherCode"].ToString(), |
| | | // sourceVoucherDetailId = subsum_arra[j]["sourceVoucherDetailId"].ToString(), |
| | | // idsourcevouchertype = subsum_arra[j]["idsourcevouchertype"].ToString(), |
| | | // saleOrderId = subsum_arra[j]["saleOrderId"].ToString(), |
| | | // saleOrderCode = subsum_arra[j]["saleOrderCode"].ToString(), |
| | | // saleOrderDetailId = subsum_arra[j]["saleOrderDetailId"].ToString(), |
| | | // ManufactureOrderId = subsum_arra[j]["ManufactureOrderId"].ToString(), |
| | | // ManufactureOrderCode = subsum_arra[j]["ManufactureOrderCode"].ToString(), |
| | | // ManufactureOrderDetailId = subsum_arra[j]["ManufactureOrderDetailId"].ToString(), |
| | | // idbusiTypeByMergedFlow = subsum_arra[j]["idbusiTypeByMergedFlow"].ToString(), |
| | | // idinventory = subsum_arra[j]["idinventory"].ToString(), |
| | | // idbaseunit = subsum_arra[j]["idbaseunit"].ToString(), |
| | | // idunit= subsum_arra[j]["idunit"].ToString(), |
| | | // idwarehouse = subsum_arra[j]["idwarehouse"].ToString(), |
| | | // SourceVoucherIdByMergedFlow = subsum_arra[j]["SourceVoucherIdByMergedFlow"].ToString(), |
| | | // SourceVoucherCodeByMergedFlow = subsum_arra[j]["SourceVoucherCodeByMergedFlow"].ToString(), |
| | | // SourceVoucherDetailIdByMergedFlow = subsum_arra[j]["SourceVoucherDetailIdByMergedFlow"].ToString(), |
| | | // idsourceVoucherTypeByMergedFlow = subsum_arra[j]["idsourceVoucherTypeByMergedFlow"].ToString(), |
| | | // createdtime = subsum_arra[j]["createdtime"].ToString(), |
| | | // DataSource = subsum_arra[j]["DataSource"].ToString() |
| | | // } |
| | | //}); |
| | | sql = @"" + dt.Rows[1]["cname"].ToString() + ""; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | | parm = new |
| | | { |
| | | code = subsum_arra[j]["code"].ToString(), |
| | | arrivalQuantity = subsum_arra[j]["arrivalQuantity"].ToString(), |
| | | quantity = subsum_arra[j]["quantity"].ToString(), |
| | | compositionQuantity = subsum_arra[j]["compositionQuantity"].ToString(), |
| | | baseQuantity = subsum_arra[j]["baseQuantity"].ToString(), |
| | | sourceVoucherId = subsum_arra[j]["sourceVoucherId"].ToString(), |
| | | sourceVoucherCode = subsum_arra[j]["sourceVoucherCode"].ToString(), |
| | | sourceVoucherDetailId = subsum_arra[j]["sourceVoucherDetailId"].ToString(), |
| | | idsourcevouchertype = subsum_arra[j]["idsourcevouchertype"].ToString(), |
| | | saleOrderId = subsum_arra[j]["saleOrderId"].ToString(), |
| | | saleOrderCode = subsum_arra[j]["saleOrderCode"].ToString(), |
| | | saleOrderDetailId = subsum_arra[j]["saleOrderDetailId"].ToString(), |
| | | ManufactureOrderId = subsum_arra[j]["ManufactureOrderId"].ToString(), |
| | | ManufactureOrderCode = subsum_arra[j]["ManufactureOrderCode"].ToString(), |
| | | ManufactureOrderDetailId = subsum_arra[j]["ManufactureOrderDetailId"].ToString(), |
| | | idbusiTypeByMergedFlow = subsum_arra[j]["idbusiTypeByMergedFlow"].ToString(), |
| | | idinventory = subsum_arra[j]["idinventory"].ToString(), |
| | | idbaseunit = subsum_arra[j]["idbaseunit"].ToString(), |
| | | idunit = subsum_arra[j]["idunit"].ToString(), |
| | | idwarehouse = subsum_arra[j]["idwarehouse"].ToString(), |
| | | SourceVoucherIdByMergedFlow = subsum_arra[j]["SourceVoucherIdByMergedFlow"].ToString(), |
| | | SourceVoucherCodeByMergedFlow = subsum_arra[j]["SourceVoucherCodeByMergedFlow"].ToString(), |
| | | SourceVoucherDetailIdByMergedFlow = subsum_arra[j]["SourceVoucherDetailIdByMergedFlow"].ToString(), |
| | | idsourceVoucherTypeByMergedFlow = subsum_arra[j]["idsourceVoucherTypeByMergedFlow"].ToString(), |
| | | createdtime = subsum_arra[j]["createdtime"].ToString(), |
| | | DataSource = subsum_arra[j]["DataSource"].ToString() |
| | | } |
| | | }); |
| | | //写入MES入库记录子表 |
| | | sql = @"insert into TK_WMS_Inwh_Sub(hbillno,rownumber,materiel_code,storehouse_code,qty) |
| | | values(@hbillno,@rownumber,@materiel_code,@storehouse_code,@qty)"; |