|
|
@@ -1,13 +1,19 @@
|
|
|
package com.railway.web.controller.business.catenary;
|
|
|
|
|
|
+import com.railway.business.catenary.domain.BusJcebGjsfx;
|
|
|
import com.railway.business.catenary.domain.BusJcebJyzqsjl;
|
|
|
import com.railway.business.catenary.service.IBusJcebJyzqsjlService;
|
|
|
import com.railway.common.core.controller.BaseController;
|
|
|
import com.railway.common.core.domain.AjaxResult;
|
|
|
import com.railway.common.core.page.TableDataInfo;
|
|
|
+import com.railway.common.utils.poi.EasyExcelUtil;
|
|
|
+import com.railway.system.service.ISysFileService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
+
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
import javax.validation.Valid;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
@@ -29,9 +35,11 @@ import org.springframework.web.bind.annotation.RestController;
|
|
|
public class BusJcebJyzqsjlController extends BaseController {
|
|
|
|
|
|
private final IBusJcebJyzqsjlService busJcebJyzqsjlService;
|
|
|
+ private final ISysFileService sysFileService;
|
|
|
|
|
|
- public BusJcebJyzqsjlController(IBusJcebJyzqsjlService busJcebJyzqsjlService) {
|
|
|
+ public BusJcebJyzqsjlController(IBusJcebJyzqsjlService busJcebJyzqsjlService,ISysFileService sysFileService) {
|
|
|
this.busJcebJyzqsjlService = busJcebJyzqsjlService;
|
|
|
+ this.sysFileService = sysFileService;
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "新增")
|
|
|
@@ -87,4 +95,16 @@ public class BusJcebJyzqsjlController extends BaseController {
|
|
|
return toAjax(busJcebJyzqsjlService.confirm(busJcebJyzqsjl));
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "导出excel")
|
|
|
+ @GetMapping(value = "exportExcel")
|
|
|
+ public AjaxResult exportExcel(BusJcebJyzqsjl busJcebJyzqsjl) {
|
|
|
+ List<BusJcebJyzqsjl> list = busJcebJyzqsjlService.getList(busJcebJyzqsjl);
|
|
|
+ Map<String, Object> params = new HashMap<>();
|
|
|
+
|
|
|
+ String fileName = "绝缘子清扫记录.xls";
|
|
|
+ String templateFileName = "excel/template/绝缘子清扫记录.xls";
|
|
|
+ String localFilePath = new EasyExcelUtil().getExcel(params, list, templateFileName, fileName);
|
|
|
+ return sysFileService.uploadFile(localFilePath);
|
|
|
+ }
|
|
|
+
|
|
|
}
|