|
|
|
@ -38,6 +38,9 @@ import org.apache.commons.codec.Charsets; |
|
|
|
|
import org.energy.modules.inspection.entity.InspectionRoute; |
|
|
|
|
import org.energy.modules.inspection.excel.InspectionObjectExcel; |
|
|
|
|
import org.energy.modules.inspection.excel.InspectionRouteExcel; |
|
|
|
|
import org.energy.modules.leger.excel.EquipmentLedgerExcel; |
|
|
|
|
import org.energy.modules.leger.vo.EquipmentLedgerVO; |
|
|
|
|
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; |
|
|
|
@ -90,8 +93,8 @@ public class InspectionObjectController extends DafController { |
|
|
|
|
if (StringUtil.isNotEmpty(inspectionObject.getObjectNo())) { |
|
|
|
|
qw.lambda().like(InspectionObject::getObjectNo, inspectionObject.getObjectNo()); |
|
|
|
|
} |
|
|
|
|
if (null != inspectionObject.getObjectName()) { |
|
|
|
|
qw.lambda().eq(InspectionObject::getObjectName, inspectionObject.getObjectName()); |
|
|
|
|
if (StringUtil.isNotEmpty(inspectionObject.getObjectName())) { |
|
|
|
|
qw.lambda().like(InspectionObject::getObjectName, inspectionObject.getObjectName()); |
|
|
|
|
} |
|
|
|
|
if (null != inspectionObject.getStation()) { |
|
|
|
|
qw.lambda().eq(InspectionObject::getStation, inspectionObject.getStation()); |
|
|
|
@ -214,20 +217,8 @@ public class InspectionObjectController extends DafController { |
|
|
|
|
@ApiOperation(value = "导出", notes = "传入") |
|
|
|
|
@ApiLog |
|
|
|
|
public void exportInspectionObject(@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("istatus_equal")) { |
|
|
|
|
entity.put("istatus_equal", Integer.parseInt((String) entity.get("istatus_equal"))); |
|
|
|
|
} |
|
|
|
|
if (entity.containsKey("objectName_equal")) { |
|
|
|
|
entity.put("objectName_equal", Integer.parseInt((String) entity.get("objectName_equal"))); |
|
|
|
|
} |
|
|
|
|
QueryWrapper<InspectionObject> queryWrapper = Condition.getQueryWrapper(entity, InspectionObject.class); |
|
|
|
|
queryWrapper.lambda().eq(InspectionObject::getIsDeleted, DafConstant.DB_NOT_DELETED); |
|
|
|
|
queryWrapper.orderByAsc("object_No"); |
|
|
|
|
|
|
|
|
|
List<InspectionObjectExcel> list = inspectionObjectService.export(queryWrapper); |
|
|
|
|
InspectionObjectVO vo = DataUtils.mapToEntity(entity, InspectionObjectVO::new); |
|
|
|
|
List<InspectionObjectExcel> list = inspectionObjectService.export(vo); |
|
|
|
|
response.setContentType("application/vnd.ms-excel"); |
|
|
|
|
response.setCharacterEncoding(Charsets.UTF_8.name()); |
|
|
|
|
String fileName = URLEncoder.encode("巡检对象数据导出", Charsets.UTF_8.name()); |
|
|
|
|