|
|
@ -18,7 +18,6 @@ package org.energy.modules.inspection.controller; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.alibaba.excel.EasyExcel; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.dayu.daf.core.log.annotation.ApiLog; |
|
|
|
import com.dayu.daf.core.log.annotation.ApiLog; |
|
|
|
import com.dayu.daf.core.tool.constant.DafConstant; |
|
|
|
|
|
|
|
import com.xkcoding.http.util.StringUtil; |
|
|
|
import com.xkcoding.http.util.StringUtil; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.Api; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
|
import io.swagger.annotations.ApiOperation; |
|
|
@ -36,8 +35,7 @@ import com.dayu.daf.core.tool.utils.Func; |
|
|
|
import lombok.SneakyThrows; |
|
|
|
import lombok.SneakyThrows; |
|
|
|
import org.apache.commons.codec.Charsets; |
|
|
|
import org.apache.commons.codec.Charsets; |
|
|
|
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
|
|
|
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
|
|
|
import org.energy.modules.leger.entity.EquipmentLedger; |
|
|
|
import org.energy.modules.system.util.DataUtils; |
|
|
|
import org.energy.modules.system.entity.Dict; |
|
|
|
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
@ -218,17 +216,15 @@ public class InspectionRouteController extends DafController { |
|
|
|
@ApiOperation(value = "导出", notes = "传入") |
|
|
|
@ApiOperation(value = "导出", notes = "传入") |
|
|
|
@ApiLog |
|
|
|
@ApiLog |
|
|
|
public void exportInspectionRoute(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
|
|
|
public void exportInspectionRoute(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
|
|
|
if (entity.containsKey("stations_equal")) { |
|
|
|
entity.remove("daf-auth"); |
|
|
|
entity.put("stations_equal", Integer.parseInt((String) entity.get("stations_equal"))); |
|
|
|
entity.forEach((key, value) -> { |
|
|
|
} |
|
|
|
if (!"stations".equals(key) && !"istatus".equals(key)) |
|
|
|
if (entity.containsKey("istatus_equal")) { |
|
|
|
{ |
|
|
|
entity.put("istatus_equal", Integer.parseInt((String) entity.get("istatus_equal"))); |
|
|
|
entity.put(key, "%" + value + "%"); |
|
|
|
} |
|
|
|
} |
|
|
|
QueryWrapper<InspectionRoute> queryWrapper = Condition.getQueryWrapper(entity, InspectionRoute.class); |
|
|
|
}); |
|
|
|
queryWrapper.lambda().eq(InspectionRoute::getIsDeleted, DafConstant.DB_NOT_DELETED); |
|
|
|
InspectionRoute vo = DataUtils.mapToEntity(entity, InspectionRoute::new); |
|
|
|
queryWrapper.orderByAsc("route_no"); |
|
|
|
List<InspectionRouteExcel> list = inspectionRouteService.export(vo); |
|
|
|
|
|
|
|
|
|
|
|
List<InspectionRouteExcel> list = inspectionRouteService.export(queryWrapper); |
|
|
|
|
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
response.setCharacterEncoding(Charsets.UTF_8.name()); |
|
|
|
response.setCharacterEncoding(Charsets.UTF_8.name()); |
|
|
|
String fileName = URLEncoder.encode("巡检路线数据导出", Charsets.UTF_8.name()); |
|
|
|
String fileName = URLEncoder.encode("巡检路线数据导出", Charsets.UTF_8.name()); |
|
|
|