using System.Dynamic;
|
using Microsoft.AspNetCore.Mvc;
|
using NewPdaSqlServer.Dto.service;
|
using NewPdaSqlServer.entity;
|
using NewPdaSqlServer.service.QC;
|
using NewPdaSqlServer.util;
|
using Newtonsoft.Json.Linq;
|
|
namespace NewPdaSqlServer.Controllers.QC;
|
|
[Route("api/[controller]")]
|
[ApiController]
|
public class IpqcController : ControllerBase
|
{
|
IpqcService m = new IpqcService();
|
|
/// <summary>
|
/// 首检单据查询
|
/// </summary>
|
/// <param name="queryObj"></param>
|
/// <returns></returns>
|
[HttpPost("getPageSj")]
|
public ResponseResult getPageSj([FromBody] XJPageResult queryObj)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var (item, totalCount) = m.getPageSj(queryObj);
|
var tbBillList =
|
resultInfos.tbBillList = item;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos,
|
TotalCount = totalCount
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
//getItems
|
[HttpPost("getJYItem")]
|
public ResponseResult getJYItem([FromBody] JObject data)
|
{
|
var id = data["id"]?.ToString();
|
var releaseNo = data["releaseNo"]?.ToString();
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
m.GetItems(releaseNo,
|
id);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
|
/// <summary>
|
/// 首检单据查询
|
/// </summary>
|
/// <param name="queryObj"></param>
|
/// <returns></returns>
|
[HttpPost("getPageXj")]
|
public ResponseResult getPageXj([FromBody] XJPageResult queryObj)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var (item, totalCount) = m.getPageXj(queryObj);
|
var tbBillList =
|
resultInfos.tbBillList = item;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos,
|
TotalCount = totalCount
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
|
}
|