go
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
using System;
|
||||
using com.itextpdf.text.pdf;
|
||||
using Model;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using PagedList;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Entity;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http;
|
||||
using PagedList;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using static TreeView;
|
||||
using System.Data.Entity;
|
||||
|
||||
/// <summary>
|
||||
/// orderdetail 的摘要说明
|
||||
@@ -59,4 +63,29 @@ public class orderdetailController:ApiController
|
||||
if (ret.list == null) throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
return Ok(ret);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/orderdetail/GetDetailToPrint")]
|
||||
public IHttpActionResult GetDetailToPrint([FromBody] dynamic data)
|
||||
{
|
||||
if (data.param is Newtonsoft.Json.Linq.JArray items)
|
||||
{
|
||||
string[] details = new string[items.Count];
|
||||
int i = 0;
|
||||
foreach (var item in items)
|
||||
{
|
||||
details[i] = item["order_no"] + item["num"].ToString();
|
||||
i++;
|
||||
}
|
||||
string sql = @"select * from pro_order_detail where order_no+convert(varchar,num) in ({0}) ";
|
||||
//var p =new SqlParameter[]{ new SqlParameter("p0", String.Join(",", details))};
|
||||
var ret = _db.Database.SqlQuery<pro_order_detail>(sql, String.Join(",", details)).ToList();
|
||||
if (ret == null) throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
return Ok(ret);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new HttpResponseException(HttpStatusCode.NotFound);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user