|
|
@@ -18,6 +18,7 @@ import java.time.LocalDate;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author zhangcaifeng
|
|
|
@@ -146,4 +147,33 @@ public class BusJcbWjcxcController extends BaseController {
|
|
|
return sysFileService.uploadFile(localFilePath);
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation(value = "导出excel")
|
|
|
+ @GetMapping(value = "exportExcel")
|
|
|
+ public AjaxResult exportExcel(BusJcbWjcxc busJcbWjcxc) {
|
|
|
+ List<BusJcbWjcxc> list = busJcbWjcxcService.getList(busJcbWjcxc);
|
|
|
+ list = list.stream().map(x -> transData(x)).collect(Collectors.toList());
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ private BusJcbWjcxc transData(BusJcbWjcxc x) {
|
|
|
+ x.setXiangbie("检测");
|
|
|
+ if(StringUtils.YES_VALUE.equals(x.getZxwxjqzt()) ||
|
|
|
+ StringUtils.YES_VALUE.equals(x.getCxwxjqzt())
|
|
|
+ ) {
|
|
|
+ x.setYwxj("有");
|
|
|
+ } else {
|
|
|
+ x.setYwxj("无");
|
|
|
+ }
|
|
|
+ if(StringUtils.YES_VALUE.equals(x.getDljzt())){
|
|
|
+ x.setDljzt("良好");
|
|
|
+ } else {
|
|
|
+ x.setDljzt("故障");
|
|
|
+ }
|
|
|
+ return x;
|
|
|
+ }
|
|
|
+
|
|
|
}
|