2025-01-03 16:43:02 +08:00
|
|
|
|
using Microsoft.AspNetCore.Mvc;
|
|
|
|
|
|
using ZR.Admin.WebApi.Extensions;
|
2025-01-07 17:25:08 +08:00
|
|
|
|
using ZR.Model.Dto;
|
|
|
|
|
|
using ZR.Service.Business.IBusinessService;
|
2025-01-03 16:43:02 +08:00
|
|
|
|
|
|
|
|
|
|
//创建时间:2025-01-02
|
|
|
|
|
|
namespace ZR.Admin.WebApi.Controllers
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 质量GP12业务模块
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
[Route("/mes/qc/gp12/QcGp12Controller")]
|
|
|
|
|
|
public class QcGp12Controller : BaseController
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 质量GP12业务模块接口
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
private readonly IQcGp12Service _QcGp12Service;
|
|
|
|
|
|
|
|
|
|
|
|
public QcGp12Controller(IQcGp12Service QcGp12Service)
|
|
|
|
|
|
{
|
|
|
|
|
|
_QcGp12Service = QcGp12Service;
|
|
|
|
|
|
}
|
2025-01-07 17:25:08 +08:00
|
|
|
|
|
2025-01-03 16:43:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取班组下拉
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("GetGroupOptions")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult GetGroupOptions()
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _QcGp12Service.GetGroupOptions();
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2025-01-07 17:25:08 +08:00
|
|
|
|
|
2025-01-03 16:43:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取站点下拉
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("GetStieOptions")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult GetStieOptions()
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _QcGp12Service.GetStieOptions();
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2025-01-07 17:25:08 +08:00
|
|
|
|
|
2025-01-03 16:43:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取缺陷项初始数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("GetDefectInitOptions")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult GetDefectInitOptions()
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _QcGp12Service.GetDefectInitOptions();
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2025-01-07 17:25:08 +08:00
|
|
|
|
|
2025-01-21 15:58:27 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 获取缺陷项列表初始数据
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("GetDefectTableOptions")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult GetDefectTableOptions()
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _QcGp12Service.GetDefectTableOptions();
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-01-03 16:43:02 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 解析标签
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="label">标签内容</param>
|
|
|
|
|
|
/// <param name="type">解析方式</param>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("AnalyzeLabel")]
|
|
|
|
|
|
[AllowAnonymous]
|
2025-01-07 17:25:08 +08:00
|
|
|
|
public IActionResult AnalyzeLabel(string label, int type)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _QcGp12Service.AnalyzeLabelToDto(label, type);
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 开始工单
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("StartGP12WorkOrder")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult StartGP12WorkOrder([FromBody] QcGp12WorkorderDetailDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<QcGp12WorkorderDetailDto>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _QcGp12Service.StartGP12WorkOrder(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 修改缺陷项
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("ChangeWorkOrderDefect")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult StartGP12WorkOrder([FromBody] QcGp12WorkorderDefectDto parm)
|
2025-01-03 16:43:02 +08:00
|
|
|
|
{
|
2025-01-07 17:25:08 +08:00
|
|
|
|
var modal = parm.Adapt<QcGp12WorkorderDefectDto>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _QcGp12Service.ChangeWorkOrderDefect(modal);
|
|
|
|
|
|
|
2025-01-03 16:43:02 +08:00
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2025-01-07 17:25:08 +08:00
|
|
|
|
|
2025-01-03 16:43:02 +08:00
|
|
|
|
/// <summary>
|
2025-01-07 17:25:08 +08:00
|
|
|
|
/// 获取工单缺陷项
|
2025-01-03 16:43:02 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
2025-01-07 17:25:08 +08:00
|
|
|
|
[HttpGet("GetWorkOrderDefectList")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult GetWorkOrderDefectList(string workOrder)
|
2025-01-03 16:43:02 +08:00
|
|
|
|
{
|
2025-01-07 17:25:08 +08:00
|
|
|
|
var response = _QcGp12Service.GetWorkOrderDefectList(workOrder);
|
|
|
|
|
|
|
2025-01-03 16:43:02 +08:00
|
|
|
|
return SUCCESS(response);
|
2025-01-07 17:25:08 +08:00
|
|
|
|
}
|
2025-01-03 16:43:02 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
2025-01-07 17:25:08 +08:00
|
|
|
|
/// 扫描内标签,添加标签记录
|
2025-01-03 16:43:02 +08:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
2025-01-07 17:25:08 +08:00
|
|
|
|
[HttpPost("ScanInnerLabel")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult ScanInnerLabel([FromBody] QcGp12LabelScanDto parm)
|
2025-01-03 16:43:02 +08:00
|
|
|
|
{
|
2025-01-09 17:11:32 +08:00
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<QcGp12LabelScanDto>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _QcGp12Service.ScanInnerLabel(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
2025-07-28 15:40:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
2025-01-09 17:11:32 +08:00
|
|
|
|
{
|
2025-02-22 14:28:28 +08:00
|
|
|
|
return SUCCESS("请刷新页面,错误代码:" + ex.Message);
|
2025-01-09 17:11:32 +08:00
|
|
|
|
}
|
2025-07-28 15:40:59 +08:00
|
|
|
|
|
2025-01-07 17:25:08 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 结束工单,并生成质量报表
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("EndGP12WorkOrderAndCreateStatistics")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult EndGP12WorkOrderAndCreateStatistics(string workOrder)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _QcGp12Service.EndGP12WorkOrderAndCreateStatistics(workOrder);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 更新工单相关信息
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpGet("UpdateWorkOrderDetail")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult UpdateWorkOrderDetail(string workOrder)
|
|
|
|
|
|
{
|
|
|
|
|
|
var response = _QcGp12Service.UpdateWorkOrderDetail(workOrder);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
2025-02-14 17:26:56 +08:00
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 自动生成标签记录
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
|
[HttpPost("GenerateVirtualLabel")]
|
|
|
|
|
|
[AllowAnonymous]
|
|
|
|
|
|
public IActionResult GenerateVirtualLabel([FromBody] QcGp12WorkorderDetailDto parm)
|
|
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
|
|
|
|
|
var modal = parm.Adapt<QcGp12WorkorderDetailDto>().ToCreate(HttpContext);
|
|
|
|
|
|
|
|
|
|
|
|
var response = _QcGp12Service.GenerateVirtualLabel(modal);
|
|
|
|
|
|
|
|
|
|
|
|
return SUCCESS(response);
|
|
|
|
|
|
}
|
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ToResponse(ApiResult.Error(ex.Message));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
2025-01-03 16:43:02 +08:00
|
|
|
|
}
|
2025-01-07 17:25:08 +08:00
|
|
|
|
}
|