改太多
This commit is contained in:
1 parent
be5352efed
commit
1cb2a7a35e
48 files changed
+17970
-485
No files matched your search
@@ -109,5 +109,40 @@ public class orderdetailController:ApiController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
[Route("api/orderdetail/GetDetailToPrintByOrder")]
|
||||
public IHttpActionResult GetDetailToPrintByOrder([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"].ToString();
|
||||
i++;
|
||||
}
|
||||
|
||||
var parameters = details.Select((s, j) => "@p" + j).ToArray();
|
||||
string sql = $"select * from pro_order_detail where order_no in ({string.Join(",", parameters)}) ";
|
||||
sql = sql + $"and num not in(select distinct parent_num from pro_order_detail where order_no in ({string.Join(",", parameters)}) and parent_num is not null)";
|
||||
int l = 0;
|
||||
List<SqlParameter> sqlList = new List<SqlParameter>();
|
||||
foreach (var item in details)
|
||||
{
|
||||
sqlList.Add(new SqlParameter("@p" + l, item));
|
||||
l++;
|
||||
}
|
||||
SqlParameter[] p = sqlList.ToArray();
|
||||
var ret = _db.Database.SqlQuery<pro_order_detail>(sql, p).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