From 7f1c12e20be4524e34f2646382e46d7d2ad4d920 Mon Sep 17 00:00:00 2001 From: weitingdong <2480899115@qq.com> Date: Thu, 18 Jul 2024 14:13:11 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InspectionObjectController.java | 23 +++------- .../excel/InspectionObjectExcel.java | 6 +-- .../mapper/InspectionObjectMapper.java | 2 +- .../mapper/InspectionObjectMapper.xml | 46 ++++++++----------- .../service/IInspectionObjectService.java | 4 +- .../impl/InspectionObjectServiceImpl.java | 16 ++++++- .../controller/EquipmentLedgerController.java | 14 ++---- .../ToolInventoryRecordController.java | 8 ++-- .../leger/excel/EquipmentLedgerExcel.java | 2 +- .../leger/excel/ToolInventoryRecordExcel.java | 6 +-- .../leger/mapper/EquipmentLedgerMapper.java | 2 +- .../leger/mapper/EquipmentLedgerMapper.xml | 38 +++++++++++---- .../mapper/ToolInventoryRecordMapper.java | 2 +- .../mapper/ToolInventoryRecordMapper.xml | 42 +++++++++-------- .../service/IEquipmentLedgerService.java | 4 +- .../service/IToolInventoryRecordService.java | 5 +- .../impl/EquipmentLedgerServiceImpl.java | 16 ++++++- .../impl/ToolInventoryRecordServiceImpl.java | 18 +++++++- 18 files changed, 151 insertions(+), 103 deletions(-) diff --git a/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java b/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java index f97c086..6e22fb6 100644 --- a/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java +++ b/src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java @@ -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 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 queryWrapper = Condition.getQueryWrapper(entity, InspectionObject.class); - queryWrapper.lambda().eq(InspectionObject::getIsDeleted, DafConstant.DB_NOT_DELETED); - queryWrapper.orderByAsc("object_No"); - - List list = inspectionObjectService.export(queryWrapper); + InspectionObjectVO vo = DataUtils.mapToEntity(entity, InspectionObjectVO::new); + List list = inspectionObjectService.export(vo); response.setContentType("application/vnd.ms-excel"); response.setCharacterEncoding(Charsets.UTF_8.name()); String fileName = URLEncoder.encode("巡检对象数据导出", Charsets.UTF_8.name()); diff --git a/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java b/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java index b4f2129..3340325 100644 --- a/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java +++ b/src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java @@ -21,11 +21,11 @@ public class InspectionObjectExcel implements Serializable { @ColumnWidth(15) @ExcelProperty(value = "对象名称") - private String objectNameExt; + private String objectName; @ColumnWidth(15) @ExcelProperty(value = "场站") - private String stationsName; + private String station; @ColumnWidth(15) @ExcelProperty(value = "对象类型") @@ -37,7 +37,7 @@ public class InspectionObjectExcel implements Serializable { @ColumnWidth(15) @ExcelProperty(value = "对象状态") - private String istatusName; + private String istatus; @ColumnWidth(15) @ExcelProperty(value = "KKS编号") diff --git a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java index b2788b1..2cfe86d 100644 --- a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java +++ b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java @@ -28,7 +28,7 @@ public interface InspectionObjectMapper extends BaseMapper { */ List selectInspectionObjectPage(IPage page, InspectionObjectVO inspectionObject); - List exportData(@Param("ew") Wrapper queryWrapper); + List exportData(@Param("vo") InspectionObjectVO inspectionObject); /** * 获取路线编号 diff --git a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml index f14bfa2..50df11f 100644 --- a/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml +++ b/src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml @@ -34,33 +34,27 @@ , kks_no , object_type , cancel_reason - , CASE - WHEN station = '1' - THEN '景和光伏' - WHEN station = '2' - THEN '北沙一光伏' - WHEN station = '3' - THEN '北沙二光伏' - WHEN station = '4' - THEN '达坂城风电一场' - ELSE '' - END AS stations_name - , CASE - WHEN istatus = '1' - THEN '已生效' - WHEN istatus = '0' - THEN '未生效' - ELSE '' - END AS istatus_name - , CASE - WHEN object_name = '1' - THEN '巡检对象01' - WHEN object_name = '2' - THEN '巡检对象02' - ELSE '' - END AS object_name_ext + ,station + ,istatus + ,object_name , tools_code_id - FROM i_inspection_object ${ew.customSqlSegment} + FROM i_inspection_object a + where a.is_deleted = 0 + + and a.object_no LIKE CONCAT('%', #{vo.objectNo}, '%') + + + AND a.object_name LIKE CONCAT('%', #{vo.objectName}, '%') + + + AND a.object_area LIKE CONCAT('%', #{vo.objectArea}, '%') + + + and a.istatus = #{vo.istatus} + + + and a.station = #{vo.station} + SELECT eq_ledger_code,device_description,kks_encoding,eq_type,asset_code,manufacturer, manufacturer_country,manufacturer_part_no,manufacture_date,manufacturing_serial_no, - model,size_and_size,object_weight, - CASE - WHEN check_status = '1' THEN '审核中' - WHEN check_status = '2' THEN '已审核' - WHEN check_status = '3' THEN '未通过' - ELSE '' - END AS check_status_ext - FROM l_equipment_ledger ${ew.customSqlSegment} + model,size_and_size,object_weight,check_status + FROM l_equipment_ledger a + where a.is_deleted = 0 + + and a.major LIKE CONCAT('%', #{vo.major}, '%') + + + and a.installation_location LIKE CONCAT('%', #{vo.installationLocation}, '%') + + + and a.eq_ledger_code LIKE CONCAT('%', #{vo.eqLedgerCode}, '%') + + + and a.device_description LIKE CONCAT('%', #{vo.deviceDescription}, '%') + + + and a.eq_type LIKE CONCAT('%', #{vo.eqType}, '%') + + + and a.maintenance_team LIKE CONCAT('%', #{vo.maintenanceTeam}, '%') + + + and a.manufacturing_serial_no LIKE CONCAT('%', #{vo.manufacturingSerialNo}, '%') + + + and a.user_status = #{vo.userStatus} + + + and a.station = #{vo.station} +