zhuangpei-mesbackend/DOAN.Admin.WebApi/Controllers/Mobile/product/PADPrintAndReportWorkController.cs
2025-04-09 10:27:09 +08:00

90 lines
3.3 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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
{
/// <summary>
/// 此接口废弃
/// </summary>
[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);
}
//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);
}
//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);
}
}
}