ABP framework conditions for export by

web layer

.js Export Events:

 

// exported to excel document
$ ( '# btn-Export'). The Click (function () {
// get a parameter query
var temp = {// here variable name and the name of the controller key must have been, here changes, the controller also need to change the same
ProcessSteps_RecordId: $ ( "# ProcessSteps_RecordId") Val (),.
OperationModeId: $ ( "# OperationModeId") Val (),.
ScanCodeProduce:. $ ( "# ScanCodeProduce") Val ( ),
ReceiveValue: $ ( "# ReceiveValue") Val (),.
IsOK: $ ( "# IsOK") Val (),.
SerialNumber: $ ( "# SerialNumber") Val (),.
OperationCategory: $ ( "# OperationCategory ") Val (),.
StationID: $ (" # StationName ") Val (),.
LineID: $ (" # LineName ") Val (),.
MinTime: $ (." # MinTime1 ") Val (),
MaxTime: $ ( "# MaxTime1") Val ().
};

layer.load (0, {
Shade: [0.3, '# 000'] //0.1 transparent white background
});

_processSteps_Detail_RecordService
.getProcessSteps_Detail_RecordToExcel(temp)
.done(function (result) {
layer.closeAll('loading');
app.downloadTempFile(result);
});

});

Comment:

'#' Character is behind the HTML in the name of Id

temp inside condition (this layer will be passed Application method), getProcessSteps_Detail_RecordToExcel (temp) method is a method corresponding to the Application layer.

 

Application layer

interface:

Task<FileDto> GetProcessSteps_Detail_RecordToExcel(GetProcessSteps_Detail_RecordInput input);

method:

public async Task<FileDto> GetProcessSteps_Detail_RecordToExcel(GetProcessSteps_Detail_RecordInput input)
{
var OperationCategoryDir = DictionaryDto.OperationCategoryDir;
var IsOKDir = DictionaryDto.IsOKDir;

//初步过滤
var query = from pdr in _processSteps_Detail_RecordRepository.GetAll()
join ed in _EnumDictRepository.GetAll() on pdr.OperationModeId equals ed.Id
join pr in _processSteps_RecordRepository.GetAll() on pdr.ProcessSteps_RecordId equals pr.Id
join p in _ProcessStepsRepository.GetAll() on pr.ProcessStepsId equals p.Id
join s in _StationRepository.GetAll() on p.StationId equals s.Id
join l in _LineRepository.GetAll() on s.LineId equals l.Id
orderby pdr.Id descending
select new ProcessSteps_Detail_RecordListDto()
{
Id = pdr.Id,
LineId = l.Id,
};

query = query
.WhereIf(!(input.LineId == "0"), u => u.LineId == LineId)
;


var list = query.ToList();

var fileDto = _processSteps_Detail_RecordListExcelExporter.ExportProcessSteps_Detail_RecordToFile(list);

return fileDto;
}

Note: the corresponding interface method

Guess you like

Origin www.cnblogs.com/Prode/p/11285909.html