예제 #1
0
        public async Task <IActionResult> ExamRoomExportByTable([FromForm] IFormCollection fm)
        {
            string code  = fm["CLIENTNAME"].ToString();
            string date1 = fm["DATE1"].ToString();
            string date2 = fm["DATE2"].ToString();
            IEnumerable <REPAIDtos> rsVal = await _repairRepository.GetRepairListByDateByTable(code, date1, date2);

            if (rsVal == null)
            {
                return(Ok());
            }
            ExcelHelper           excelHeper = new ExcelHelper();
            List <ExcelGridModel> config     = new List <ExcelGridModel>
            {
                new ExcelGridModel {
                    name = "CODE", label = "客户代码", align = "left",
                },
                new ExcelGridModel {
                    name = "FACTORY", label = "加工厂", align = "left",
                },
                new ExcelGridModel {
                    name = "SN1", label = "SN1", align = "left",
                },
                new ExcelGridModel {
                    name = "SN2", label = "SN2", align = "left",
                },
                new ExcelGridModel {
                    name = "COMMAND_CODE", label = "工单", align = "left",
                },
                new ExcelGridModel {
                    name = "REPAIRBUGTYPE", label = "责任描述", align = "left",
                },
                new ExcelGridModel {
                    name = "SENDPERSON", label = "送修人", align = "left",
                },
                new ExcelGridModel {
                    name = "PERSON", label = "维修人", align = "left",
                },
                new ExcelGridModel {
                    name = "ERR_DESCRIBE", label = "不良原因", align = "left",
                },
                new ExcelGridModel {
                    name = "SCAN_TIME", label = "故障发生时间", align = "left",
                },
                new ExcelGridModel {
                    name = "POSTION_ITEMVERSION", label = "故障发生工序", align = "left",
                },
                new ExcelGridModel {
                    name = "SENDDATE", label = "送修时间", align = "left",
                },
                new ExcelGridModel {
                    name = "POSITION_CODE", label = "POSITION_CODE", align = "left",
                },
                new ExcelGridModel {
                    name = "BAD_ITEM_CODE", label = "BAD_ITEM_CODE", align = "left",
                },
                new ExcelGridModel {
                    name = "REPAIRDATE", label = "维修时间", align = "left",
                },
                new ExcelGridModel {
                    name = "SECONDTIME", label = "维修完成时间", align = "left",
                },
                new ExcelGridModel {
                    name = "SNRESULT", label = "维修结果", align = "left",
                },
                new ExcelGridModel {
                    name = "LINE_CODE", label = "线别", align = "left",
                },
                new ExcelGridModel {
                    name = "RECEIVE_PERSON", label = "接收人", align = "left",
                },
            };
            var fileName = code + "维护及时率数据.xls";

            return(excelHeper.ExcelDownload(rsVal, config, fileName));
        }