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 LljController : ControllerBase
|
{
|
[HttpPost("getPage")]
|
public ResponseResult getPage([FromBody] XJPageResult queryObj)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var (item, totalCount) = new LljService().GetPage(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("getBadge")]
|
public ResponseResult getBadge()
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var item = new LljService().getBadge();
|
var tbBillList =
|
resultInfos.tbBillList = item;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
|
[HttpPost("setJYItem")]
|
public ResponseResult setJYItem([FromBody] JObject data)
|
{
|
var itemNo = data["itemNo"].ToString();
|
var quantity = Convert.ToDecimal(data["quantity"].ToString());
|
var releaseNo = data["releaseNo"].ToString();
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
new LljService().SetItems(itemNo, quantity, releaseNo);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
[HttpPost("saveItem")]
|
public ResponseResult saveItem([FromBody] LLJDto lljDto)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
new LljService().saveItem(lljDto);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
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 =
|
new LljService().GetItems(releaseNo,
|
id);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
//getXjDetail02ById
|
[HttpPost("getXjDetail02ById")]
|
public ResponseResult getXjDetail02ById([FromBody] JObject data)
|
{
|
var id = data["id"]?.ToString();
|
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
new LljService().getXjDetail02ById(id);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
|
[HttpPost("SetQSItemDetail")]
|
public ResponseResult SetQSItemDetail(
|
[FromBody] MesQaItemsDetectDetail12 detail)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList = new LljService();
|
var detail021 = tbBillList.SetQSItemDetail(detail);
|
resultInfos.tbBillList = detail021;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
[HttpPost("UpdateQSItemDetail")]
|
public ResponseResult UpdateQSItemDetail(
|
[FromBody] MesQaItemsDetectDetail12 detail)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList = new LljService();
|
var detail021 = tbBillList.UpdateQSItemDetail(detail);
|
resultInfos.tbBillList = detail021;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
//saveRemarksGid 主表添加不合格描述
|
[HttpPost("saveRemarksGid")]
|
public ResponseResult saveRemarksGid([FromBody] LLJDto rkjDto)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
new LljService().saveRemarksGid(rkjDto);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
//saveRemarksPid 子表添加不合格描述
|
[HttpPost("saveRemarksPid")]
|
public ResponseResult saveRemarksPid([FromBody] LLJDto rkjDto)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
new LljService().saveRemarksPid(rkjDto);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
//removeXJ 删除
|
[HttpPost("removeXJ")]
|
public ResponseResult removeXJ([FromBody] JObject data)
|
{
|
var releaseNo = data["releaseNo"]?.ToString();
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
new LljService().removeXJ(releaseNo);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
//IqcQaSubmit
|
[HttpPost("IqcQaSubmit")]
|
public ResponseResult IqcQaSubmit(LLJDto rkjDto)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList =
|
new LljService().IqcQaSubmit(rkjDto);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
|
//删除特征值
|
[HttpPost("deleteDetail13")]
|
public ResponseResult deleteDetail13(LLJDto rkjDto)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList = new LljService().deleteDetail13(rkjDto);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
//更新不合格描述
|
[HttpPost("updateRemarks")]
|
public ResponseResult updateRemarks(LLJDto rkjDto)
|
{
|
try
|
{
|
dynamic resultInfos = new ExpandoObject();
|
var tbBillList = new LljService().updateRemarks(rkjDto);
|
resultInfos.tbBillList = tbBillList;
|
return new ResponseResult
|
{
|
status = 0,
|
message = "OK",
|
data = resultInfos
|
};
|
}
|
catch (Exception ex)
|
{
|
return ResponseResult.ResponseError(ex);
|
}
|
}
|
|
|
}
|