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();
///
/// 首检单据查询
///
///
///
[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);
}
}
///
/// 首检单据查询
///
///
///
[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);
}
}
//更新检验项目认证信息
[HttpPost("updateIpqcRzxx")]
public ResponseResult updateIpqcRzxx(LLJDto ipqcDto)
{
try
{
dynamic resultInfos = new ExpandoObject();
var tbBillList = m.updateIpqcRzxx(ipqcDto);
resultInfos.tbBillList = tbBillList;
return new ResponseResult
{
status = 0,
message = "OK",
data = resultInfos
};
}
catch (Exception ex)
{
return ResponseResult.ResponseError(ex);
}
}
}