zhuangpei-mesbackend/DOAN.Admin.WebApi/Controllers/Mobile/product/PADPrintAndReportWorkController.cs

90 lines
3.3 KiB
C#
Raw Normal View History

2025-04-06 16:14:18 +08:00
using DOAN.Admin.WebApi.Filters;
using DOAN.Model.MES.product;
using DOAN.Model.MES.product.Dto;
using DOAN.Service.Mobile;
using Microsoft.AspNetCore.Mvc;
using DOAN.Service.Mobile.IService;
using DOAN.Model.Mobile.Dto;
using DOAN.Service.MES.product.IService;
using Infrastructure.Converter;
namespace DOAN.WebApi.Controllers.Mobile.product
{
2025-04-09 10:27:09 +08:00
/// <summary>
/// 此接口废弃
/// </summary>
2025-04-06 16:14:18 +08:00
[Route("mes/Mobile/PrintAndReportWork")]
public class PADPrintAndReportWorkController : BaseController
{
/// <summary>
/// 打印和报工表接口
/// </summary>
private readonly IPADPrintAndReportWorkService printAndReportWorkService;
public PADPrintAndReportWorkController(IPADPrintAndReportWorkService printAndReportWorkService)
{
this.printAndReportWorkService = printAndReportWorkService;
}
//TODO 检验箱标签
[HttpGet("inspectionBoxLabel")]
public IActionResult InspectionBoxLabel(string box_label,string workorder)
{
if(string.IsNullOrEmpty(box_label))
{
return ToResponse(ResultCode.NO_DATA, "箱标签不能为空");
}
if (string.IsNullOrEmpty(workorder))
{
return ToResponse(ResultCode.NO_DATA, "工单号不能为空");
}
var result = printAndReportWorkService.InspectionBoxLabel(box_label, workorder);
return SUCCESS(result);
}
2025-04-06 16:23:17 +08:00
//TODO 检验产品标签
[HttpGet("inspectionProductLabel")]
public IActionResult InspectionProductLabel(string product_label, string workorder)
{
if (string.IsNullOrEmpty(product_label))
{
return ToResponse(ResultCode.NO_DATA, "产品标签不能为空");
}
if (string.IsNullOrEmpty(workorder))
{
return ToResponse(ResultCode.NO_DATA, "工单号不能为空");
}
var result = printAndReportWorkService.InspectionProductLabel(product_label, workorder);
return SUCCESS(result);
}
2025-04-06 16:14:18 +08:00
//TODO 箱子标签和产品标签关联,及产品标签检验,及其工单报工
/// <summary>
///
/// </summary>
/// <param name="boxLabelAndProductLabelDto"></param>
/// <returns> -1是产品检验不通过其他是报工数量</returns>
[HttpPost("box_label_and_product_label")]
public IActionResult BoxLabelAndProductLabel([FromBody] BoxLabelAndProductLabelDto boxLabelAndProductLabelDto)
{
if (string.IsNullOrEmpty(boxLabelAndProductLabelDto.BoxLabel))
{
return ToResponse(ResultCode.NO_DATA, "箱标签不能为空");
}
if (boxLabelAndProductLabelDto.ProductLabelArray.Length<=0)
{
return ToResponse(ResultCode.NO_DATA, "产品标签不能为空");
}
if (string.IsNullOrEmpty(boxLabelAndProductLabelDto.Workorder))
{
return ToResponse(ResultCode.NO_DATA, "工单号不能为空");
}
var result = printAndReportWorkService.BoxLabelAndProductLabel(boxLabelAndProductLabelDto);
return SUCCESS(result);
}
}
}