|
|
@@ -1,13 +1,13 @@
|
|
|
package com.railway.web.controller.business.catenary;
|
|
|
|
|
|
import com.railway.business.catenary.domain.BusJcbJcxc;
|
|
|
+import com.railway.business.catenary.domain.vo.JcebQueryVo;
|
|
|
import com.railway.business.catenary.service.IBusJcbJcxcService;
|
|
|
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.DateUtils;
|
|
|
import com.railway.common.utils.StringUtils;
|
|
|
-import com.railway.common.utils.poi.EasyExcelUtil;
|
|
|
import com.railway.common.utils.poi.WordUtils;
|
|
|
import com.railway.system.service.ISysFileService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
@@ -16,11 +16,9 @@ import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import javax.validation.Valid;
|
|
|
-import java.time.LocalDate;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
-import java.util.stream.Collectors;
|
|
|
|
|
|
/**
|
|
|
* @author zhangcaifeng
|
|
|
@@ -147,53 +145,9 @@ public class BusJcbJcxcController extends BaseController {
|
|
|
|
|
|
@ApiOperation(value = "导出excel")
|
|
|
@GetMapping(value = "exportExcel")
|
|
|
- public AjaxResult exportExcel(BusJcbJcxc busJcbJcxc) {
|
|
|
- List<BusJcbJcxc> list = busJcbJcxcService.getList(busJcbJcxc);
|
|
|
- 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);
|
|
|
+ public AjaxResult exportExcel(JcebQueryVo query) {
|
|
|
+ String localFilePath = busJcbJcxcService.exportExcel(query);
|
|
|
return sysFileService.uploadFile(localFilePath);
|
|
|
}
|
|
|
|
|
|
- private BusJcbJcxc transData(BusJcbJcxc x) {
|
|
|
- x.setDcxh("18");
|
|
|
- x.setXiangbie("检测");
|
|
|
- if((Integer.parseInt(x.getXch()) & 1) == 1){
|
|
|
- // xch奇数
|
|
|
- if(x.getLgzzgc() != null) {
|
|
|
- x.setXxfx(x.getLgzzgc());
|
|
|
- } else {
|
|
|
- x.setXxfx(x.getGzyfzgc());
|
|
|
- }
|
|
|
- } else {
|
|
|
- // xch偶数
|
|
|
- if(x.getLgzzgc() != null) {
|
|
|
- x.setSxfx(x.getLgzzgc());
|
|
|
- } else {
|
|
|
- x.setSxfx(x.getGzyfzgc());
|
|
|
- }
|
|
|
- }
|
|
|
- x.setWxj(StringUtils.YES_VALUE.equals(x.getWxj()) ? "无" : "有");
|
|
|
- if(StringUtils.YES_VALUE.equals(x.getXcxzgazlg()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getHdjx()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getFhzzsq()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getDqssxx()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getLswst()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getXzgldydx()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getDxztlh()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getWxj()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getHddxxjzt()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getJcdxzt()) &&
|
|
|
- StringUtils.YES_VALUE.equals(x.getDljxzt())
|
|
|
- ) {
|
|
|
- x.setGlbjzt("良好");
|
|
|
- } else {
|
|
|
- x.setGlbjzt("故障");
|
|
|
- }
|
|
|
- return x;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
}
|