57 lines
1.9 KiB
C#
57 lines
1.9 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;
|
|
|
|
namespace DOAN.WebApi.Controllers.MES.quality.IQC;
|
|
[Verify]
|
|
[Route("mes/qualityManagement/IQC/QCReportCompensation")]
|
|
public class QCReportCompensationController : BaseController
|
|
{
|
|
private IQcReportService qcReportService;
|
|
|
|
public QCReportCompensationController(IQcReportService qcReportService)
|
|
{
|
|
this.qcReportService = qcReportService;
|
|
}
|
|
|
|
//TODO 获取索赔单
|
|
[HttpGet("list")]
|
|
[ActionPermissionFilter(Permission = "qualityManagement:qcdefectcollection:list")]
|
|
public IActionResult QueryQcDefectCollection([FromQuery] QcDefectCollectionQueryDto2 parm)
|
|
{
|
|
var response = qcReportService.GetCompensationList(parm);
|
|
return SUCCESS(response);
|
|
}
|
|
|
|
//TODO 增加索赔单导出
|
|
[HttpGet("export")]
|
|
[Log(Title = "工单导出", BusinessType = BusinessType.EXPORT)]
|
|
[AllowAnonymous]
|
|
public IActionResult ClaimFormExport([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.ClaimFormExport(startTime,endTime);
|
|
|
|
var result = ExportExcelMini(list, "ClaimTable", "索赔单");
|
|
return ExportExcel(result.Item2, result.Item1);
|
|
}
|
|
} |