|
|
|
@ -35,9 +35,12 @@ import com.dayu.daf.core.tool.api.R; |
|
|
|
|
import com.dayu.daf.core.tool.utils.Func; |
|
|
|
|
import lombok.SneakyThrows; |
|
|
|
|
import org.apache.commons.codec.Charsets; |
|
|
|
|
import org.energy.modules.inspection.entity.InspectionRoute; |
|
|
|
|
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
|
|
|
|
import org.energy.modules.inspection.excel.InspectionTasksExcel; |
|
|
|
|
import org.energy.modules.leger.entity.EquipmentLedger; |
|
|
|
|
import org.energy.modules.leger.excel.EquipmentLedgerExcel; |
|
|
|
|
import org.energy.modules.system.util.DataUtils; |
|
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
import org.springframework.web.bind.annotation.RequestParam; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
@ -228,15 +231,15 @@ public class InspectionTasksController extends DafController { |
|
|
|
|
@ApiOperation(value = "导出", notes = "传入") |
|
|
|
|
@ApiLog |
|
|
|
|
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { |
|
|
|
|
if (entity.containsKey("station_equal")) { |
|
|
|
|
entity.put("station_equal", Integer.parseInt((String) entity.get("station_equal"))); |
|
|
|
|
} |
|
|
|
|
if (entity.containsKey("taskStatus_equal")) { |
|
|
|
|
entity.put("taskStatus_equal", Integer.parseInt((String) entity.get("taskStatus_equal"))); |
|
|
|
|
} |
|
|
|
|
QueryWrapper<InspectionTasks> queryWrapper = Condition.getQueryWrapper(entity, InspectionTasks.class); |
|
|
|
|
queryWrapper.lambda().eq(InspectionTasks::getIsDeleted, DafConstant.DB_NOT_DELETED); |
|
|
|
|
List<InspectionTasksExcel> list = inspectionTasksService.export(queryWrapper); |
|
|
|
|
entity.remove("daf-auth"); |
|
|
|
|
entity.forEach((key, value) -> { |
|
|
|
|
if (!"station".equals(key) && !"taskStatus".equals(key)) |
|
|
|
|
{ |
|
|
|
|
entity.put(key, "%" + value + "%"); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
InspectionTasks vo = DataUtils.mapToEntity(entity, InspectionTasks::new); |
|
|
|
|
List<InspectionTasksExcel> list = inspectionTasksService.export(vo); |
|
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
|
response.setCharacterEncoding(Charsets.UTF_8.name()); |
|
|
|
|
String fileName = URLEncoder.encode("巡检任务数据导出", Charsets.UTF_8.name()); |
|
|
|
|