70 lines
2.2 KiB
C#
70 lines
2.2 KiB
C#
using Microsoft.AspNetCore.Mvc;
|
||
using DOAN.Model.Dto;
|
||
using DOAN.Admin.WebApi.Filters;
|
||
using DOAN.Infrastructure;
|
||
using Aliyun.OSS;
|
||
using DOAN.Service.MES.quality.IPQC.IService;
|
||
using DOAN.Model.MES.quality.IPQC.Dto;
|
||
using DOAN.Model.MES.quality.IPQC;
|
||
using DOAN.Service.MES.quality.IQC.IService;
|
||
using DOAN.Service.MES.quality.IPQC;
|
||
using Infrastructure.Converter;
|
||
|
||
//创建时间:2024-09-30
|
||
namespace DOAN.WebApi.Controllers.MES.quality.IQC
|
||
{
|
||
|
||
[Verify]
|
||
[Route("mes/qualityManagement/IQC/QcReportLoss")]
|
||
public class QcReportLossController : BaseController
|
||
{
|
||
private IQcReportService qcReportService;
|
||
|
||
public QcReportLossController(IQcReportService qcReportService)
|
||
{
|
||
this.qcReportService = qcReportService;
|
||
}
|
||
|
||
//TODO 获取报损单
|
||
[HttpGet("list")]
|
||
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:list")]
|
||
public IActionResult QueryQcDefectCollection([FromQuery] QcDefectCollectionQueryDto2 parm)
|
||
{
|
||
var response = qcReportService.GetLossList(parm);
|
||
return SUCCESS(response);
|
||
}
|
||
|
||
|
||
//TODO 导出excel 报损单
|
||
|
||
/// <summary>
|
||
/// 报损单导出 启用(9/14)
|
||
/// </summary>
|
||
/// <param name="user"></param>
|
||
/// <returns></returns>
|
||
[HttpGet("export")]
|
||
[Log(Title = "工单导出", BusinessType = BusinessType.EXPORT)]
|
||
[AllowAnonymous]
|
||
public IActionResult ReportLossExport([FromQuery] DateTime startTime, DateTime endTime)
|
||
{
|
||
startTime = DOANConvertDateTime.ConvertLocalDate(startTime);
|
||
if (startTime == DateTime.MinValue)
|
||
{
|
||
throw new CustomException("startTime is null");
|
||
}
|
||
endTime = DOANConvertDateTime.ConvertLocalDate(endTime);
|
||
if (endTime == DateTime.MinValue)
|
||
{
|
||
throw new CustomException("endTime is null");
|
||
}
|
||
var list = qcReportService.ReportLossExport(startTime,endTime);
|
||
|
||
var result = ExportExcelMini(list, "ReportLoss", "报损单列表");
|
||
return ExportExcel(result.Item2, result.Item1);
|
||
}
|
||
}
|
||
}
|
||
|
||
|
||
|