导出功能修正

main
weitingdong 12 months ago
parent 3ca337ad07
commit 7f1c12e20b
  1. 23
      src/main/java/org/energy/modules/inspection/controller/InspectionObjectController.java
  2. 6
      src/main/java/org/energy/modules/inspection/excel/InspectionObjectExcel.java
  3. 2
      src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.java
  4. 46
      src/main/java/org/energy/modules/inspection/mapper/InspectionObjectMapper.xml
  5. 4
      src/main/java/org/energy/modules/inspection/service/IInspectionObjectService.java
  6. 16
      src/main/java/org/energy/modules/inspection/service/impl/InspectionObjectServiceImpl.java
  7. 14
      src/main/java/org/energy/modules/leger/controller/EquipmentLedgerController.java
  8. 8
      src/main/java/org/energy/modules/leger/controller/ToolInventoryRecordController.java
  9. 2
      src/main/java/org/energy/modules/leger/excel/EquipmentLedgerExcel.java
  10. 6
      src/main/java/org/energy/modules/leger/excel/ToolInventoryRecordExcel.java
  11. 2
      src/main/java/org/energy/modules/leger/mapper/EquipmentLedgerMapper.java
  12. 38
      src/main/java/org/energy/modules/leger/mapper/EquipmentLedgerMapper.xml
  13. 2
      src/main/java/org/energy/modules/leger/mapper/ToolInventoryRecordMapper.java
  14. 42
      src/main/java/org/energy/modules/leger/mapper/ToolInventoryRecordMapper.xml
  15. 4
      src/main/java/org/energy/modules/leger/service/IEquipmentLedgerService.java
  16. 5
      src/main/java/org/energy/modules/leger/service/IToolInventoryRecordService.java
  17. 16
      src/main/java/org/energy/modules/leger/service/impl/EquipmentLedgerServiceImpl.java
  18. 18
      src/main/java/org/energy/modules/leger/service/impl/ToolInventoryRecordServiceImpl.java

@ -38,6 +38,9 @@ import org.apache.commons.codec.Charsets;
import org.energy.modules.inspection.entity.InspectionRoute; import org.energy.modules.inspection.entity.InspectionRoute;
import org.energy.modules.inspection.excel.InspectionObjectExcel; import org.energy.modules.inspection.excel.InspectionObjectExcel;
import org.energy.modules.inspection.excel.InspectionRouteExcel; 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.*;
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;
@ -90,8 +93,8 @@ public class InspectionObjectController extends DafController {
if (StringUtil.isNotEmpty(inspectionObject.getObjectNo())) { if (StringUtil.isNotEmpty(inspectionObject.getObjectNo())) {
qw.lambda().like(InspectionObject::getObjectNo, inspectionObject.getObjectNo()); qw.lambda().like(InspectionObject::getObjectNo, inspectionObject.getObjectNo());
} }
if (null != inspectionObject.getObjectName()) { if (StringUtil.isNotEmpty(inspectionObject.getObjectName())) {
qw.lambda().eq(InspectionObject::getObjectName, inspectionObject.getObjectName()); qw.lambda().like(InspectionObject::getObjectName, inspectionObject.getObjectName());
} }
if (null != inspectionObject.getStation()) { if (null != inspectionObject.getStation()) {
qw.lambda().eq(InspectionObject::getStation, inspectionObject.getStation()); qw.lambda().eq(InspectionObject::getStation, inspectionObject.getStation());
@ -214,20 +217,8 @@ public class InspectionObjectController extends DafController {
@ApiOperation(value = "导出", notes = "传入") @ApiOperation(value = "导出", notes = "传入")
@ApiLog @ApiLog
public void exportInspectionObject(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { public void exportInspectionObject(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) {
if (entity.containsKey("station_equal")) { InspectionObjectVO vo = DataUtils.mapToEntity(entity, InspectionObjectVO::new);
entity.put("station_equal", Integer.parseInt((String) entity.get("station_equal"))); List<InspectionObjectExcel> list = inspectionObjectService.export(vo);
}
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);
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());

@ -21,11 +21,11 @@ public class InspectionObjectExcel implements Serializable {
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "对象名称") @ExcelProperty(value = "对象名称")
private String objectNameExt; private String objectName;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "场站") @ExcelProperty(value = "场站")
private String stationsName; private String station;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "对象类型") @ExcelProperty(value = "对象类型")
@ -37,7 +37,7 @@ public class InspectionObjectExcel implements Serializable {
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "对象状态") @ExcelProperty(value = "对象状态")
private String istatusName; private String istatus;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "KKS编号") @ExcelProperty(value = "KKS编号")

@ -28,7 +28,7 @@ public interface InspectionObjectMapper extends BaseMapper<InspectionObject> {
*/ */
List<InspectionObjectVO> selectInspectionObjectPage(IPage page, InspectionObjectVO inspectionObject); List<InspectionObjectVO> selectInspectionObjectPage(IPage page, InspectionObjectVO inspectionObject);
List<InspectionObjectExcel> exportData(@Param("ew") Wrapper<InspectionObject> queryWrapper); List<InspectionObjectExcel> exportData(@Param("vo") InspectionObjectVO inspectionObject);
/** /**
* 获取路线编号 * 获取路线编号

@ -34,33 +34,27 @@
, kks_no , kks_no
, object_type , object_type
, cancel_reason , cancel_reason
, CASE ,station
WHEN station = '1' ,istatus
THEN '景和光伏' ,object_name
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
, tools_code_id , tools_code_id
FROM i_inspection_object ${ew.customSqlSegment} FROM i_inspection_object a
where a.is_deleted = 0
<if test="vo.objectNo != null and vo.objectNo != ''">
and a.object_no LIKE CONCAT('%', #{vo.objectNo}, '%')
</if>
<if test="vo.objectName != null and vo.objectName != ''">
AND a.object_name LIKE CONCAT('%', #{vo.objectName}, '%')
</if>
<if test="vo.objectArea != null and vo.objectArea != ''">
AND a.object_area LIKE CONCAT('%', #{vo.objectArea}, '%')
</if>
<if test="vo.istatus != null and vo.istatus != ''">
and a.istatus = #{vo.istatus}
</if>
<if test="vo.station != null and vo.station != ''">
and a.station = #{vo.station}
</if>
</select> </select>
<select id="getObjectList" resultMap="inspectionObjectResultMap"> <select id="getObjectList" resultMap="inspectionObjectResultMap">

@ -31,10 +31,10 @@ public interface IInspectionObjectService extends BaseService<InspectionObject>
/** /**
* 获取导出数据 * 获取导出数据
* *
* @param queryWrapper * @param inspectionObject
* @return * @return
*/ */
List<InspectionObjectExcel> export(Wrapper<InspectionObject> queryWrapper); List<InspectionObjectExcel> export(InspectionObjectVO inspectionObject);
/** /**

@ -1,6 +1,7 @@
package org.energy.modules.inspection.service.impl; package org.energy.modules.inspection.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import io.micrometer.core.instrument.util.StringUtils;
import org.energy.modules.inspection.entity.InspectionObject; import org.energy.modules.inspection.entity.InspectionObject;
import org.energy.modules.inspection.entity.InspectionRoute; import org.energy.modules.inspection.entity.InspectionRoute;
import org.energy.modules.inspection.excel.InspectionObjectExcel; import org.energy.modules.inspection.excel.InspectionObjectExcel;
@ -9,6 +10,9 @@ import org.energy.modules.inspection.vo.InspectionObjectVO;
import org.energy.modules.inspection.mapper.InspectionObjectMapper; import org.energy.modules.inspection.mapper.InspectionObjectMapper;
import org.energy.modules.inspection.service.IInspectionObjectService; import org.energy.modules.inspection.service.IInspectionObjectService;
import com.dayu.daf.core.mp.base.BaseServiceImpl; import com.dayu.daf.core.mp.base.BaseServiceImpl;
import org.energy.modules.leger.excel.EquipmentLedgerExcel;
import org.energy.modules.system.service.IDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -22,14 +26,22 @@ import java.util.List;
*/ */
@Service @Service
public class InspectionObjectServiceImpl extends BaseServiceImpl<InspectionObjectMapper, InspectionObject> implements IInspectionObjectService { public class InspectionObjectServiceImpl extends BaseServiceImpl<InspectionObjectMapper, InspectionObject> implements IInspectionObjectService {
@Autowired
IDictService dictService;
@Override @Override
public IPage<InspectionObjectVO> selectInspectionObjectPage(IPage<InspectionObjectVO> page, InspectionObjectVO inspectionObject) { public IPage<InspectionObjectVO> selectInspectionObjectPage(IPage<InspectionObjectVO> page, InspectionObjectVO inspectionObject) {
return page.setRecords(baseMapper.selectInspectionObjectPage(page, inspectionObject)); return page.setRecords(baseMapper.selectInspectionObjectPage(page, inspectionObject));
} }
@Override @Override
public List<InspectionObjectExcel> export(Wrapper<InspectionObject> queryWrapper) { public List<InspectionObjectExcel> export(InspectionObjectVO inspectionObject) {
List<InspectionObjectExcel> list = baseMapper.exportData(queryWrapper); List<InspectionObjectExcel> list = baseMapper.exportData(inspectionObject);
list.forEach(item -> {
if (StringUtils.isNotEmpty(item.getStation()))
item.setStation(dictService.getValue("station", Integer.parseInt(item.getStation())));
if (StringUtils.isNotEmpty(item.getIstatus()))
item.setIstatus(dictService.getValue("istatus", Integer.parseInt(item.getIstatus())));
});
return list; return list;
} }
@Override @Override

@ -41,6 +41,9 @@ import org.energy.modules.leger.service.ITechParametersService;
import lombok.SneakyThrows; import lombok.SneakyThrows;
import org.apache.commons.codec.Charsets; import org.apache.commons.codec.Charsets;
import org.energy.modules.leger.excel.EquipmentLedgerExcel; import org.energy.modules.leger.excel.EquipmentLedgerExcel;
import org.energy.modules.smart.excel.WorkPermitExcel;
import org.energy.modules.smart.vo.WorkPermitVO;
import org.energy.modules.system.util.DataUtils;
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;
@ -222,15 +225,8 @@ public class EquipmentLedgerController extends DafController {
@ApiOperation(value = "导出", notes = "传入") @ApiOperation(value = "导出", notes = "传入")
@ApiLog @ApiLog
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) {
if (entity.containsKey("station_equal")) { EquipmentLedgerVO vo = DataUtils.mapToEntity(entity, EquipmentLedgerVO::new);
entity.put("station_equal", Integer.parseInt((String) entity.get("station_equal"))); List<EquipmentLedgerExcel> list = equipmentLedgerService.export(vo);
}
if (entity.containsKey("userStatus_equal")) {
entity.put("userStatus_equal", Integer.parseInt((String) entity.get("userStatus_equal")));
}
QueryWrapper<EquipmentLedger> queryWrapper = Condition.getQueryWrapper(entity, EquipmentLedger.class);
queryWrapper.lambda().eq(EquipmentLedger::getIsDeleted, DafConstant.DB_NOT_DELETED);
List<EquipmentLedgerExcel> list = equipmentLedgerService.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());

@ -35,8 +35,11 @@ import com.dayu.daf.core.tool.api.R;
import com.dayu.daf.core.tool.utils.Func; import com.dayu.daf.core.tool.utils.Func;
import org.energy.modules.leger.entity.EquipmentLedger; import org.energy.modules.leger.entity.EquipmentLedger;
import org.energy.modules.leger.entity.TechParameters; import org.energy.modules.leger.entity.TechParameters;
import org.energy.modules.leger.excel.EquipmentLedgerExcel;
import org.energy.modules.leger.excel.ToolInventoryRecordExcel; import org.energy.modules.leger.excel.ToolInventoryRecordExcel;
import org.energy.modules.leger.service.*; import org.energy.modules.leger.service.*;
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.*;
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;
@ -212,9 +215,8 @@ public class ToolInventoryRecordController extends DafController {
@ApiOperation(value = "导出", notes = "传入") @ApiOperation(value = "导出", notes = "传入")
@ApiLog @ApiLog
public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) { public void exportUser(@ApiIgnore @RequestParam Map<String, Object> entity, HttpServletResponse response) {
QueryWrapper<ToolInventoryRecord> queryWrapper = Condition.getQueryWrapper(entity, ToolInventoryRecord.class); ToolInventoryRecordVO vo = DataUtils.mapToEntity(entity, ToolInventoryRecordVO::new);
queryWrapper.lambda().eq(ToolInventoryRecord::getIsDeleted, DafConstant.DB_NOT_DELETED); List<ToolInventoryRecordExcel> list = toolInventoryRecordService.export(vo);
List<ToolInventoryRecordExcel> list = toolInventoryRecordService.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());

@ -88,6 +88,6 @@ public class EquipmentLedgerExcel implements Serializable {
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "审核状态") @ExcelProperty(value = "审核状态")
private String checkStatusExt; private String checkStatus;
} }

@ -56,7 +56,7 @@ public class ToolInventoryRecordExcel implements Serializable {
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "场站") @ExcelProperty(value = "场站")
private String stationsExt; private String stations;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "工器具类别") @ExcelProperty(value = "工器具类别")
@ -88,10 +88,10 @@ public class ToolInventoryRecordExcel implements Serializable {
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "是否检验周期内") @ExcelProperty(value = "是否检验周期内")
private String isInspectionPeriodExt; private String isInspectionPeriod;
@ColumnWidth(15) @ColumnWidth(15)
@ExcelProperty(value = "审核状态") @ExcelProperty(value = "审核状态")
private String checkStatusExt; private String checkStatus;
} }

@ -28,7 +28,7 @@ public interface EquipmentLedgerMapper extends BaseMapper<EquipmentLedger> {
*/ */
List<EquipmentLedgerVO> selectEquipmentLedgerPage(IPage page, EquipmentLedgerVO equipmentLedger); List<EquipmentLedgerVO> selectEquipmentLedgerPage(IPage page, EquipmentLedgerVO equipmentLedger);
List<EquipmentLedgerExcel> exportData(@Param("ew") Wrapper<EquipmentLedger> queryWrapper); List<EquipmentLedgerExcel> exportData(@Param("vo") EquipmentLedgerVO equipmentLedger);
/** /**
* 获取kks编号 * 获取kks编号

@ -59,14 +59,36 @@
<select id="exportData" resultType="org.energy.modules.leger.excel.EquipmentLedgerExcel"> <select id="exportData" resultType="org.energy.modules.leger.excel.EquipmentLedgerExcel">
SELECT eq_ledger_code,device_description,kks_encoding,eq_type,asset_code,manufacturer, SELECT eq_ledger_code,device_description,kks_encoding,eq_type,asset_code,manufacturer,
manufacturer_country,manufacturer_part_no,manufacture_date,manufacturing_serial_no, manufacturer_country,manufacturer_part_no,manufacture_date,manufacturing_serial_no,
model,size_and_size,object_weight, model,size_and_size,object_weight,check_status
CASE FROM l_equipment_ledger a
WHEN check_status = '1' THEN '审核中' where a.is_deleted = 0
WHEN check_status = '2' THEN '已审核' <if test="vo.major != null and vo.major != ''">
WHEN check_status = '3' THEN '未通过' and a.major LIKE CONCAT('%', #{vo.major}, '%')
ELSE '' </if>
END AS check_status_ext <if test="vo.installationLocation != null and vo.installationLocation != ''">
FROM l_equipment_ledger ${ew.customSqlSegment} and a.installation_location LIKE CONCAT('%', #{vo.installationLocation}, '%')
</if>
<if test="vo.eqLedgerCode != null and vo.eqLedgerCode != ''">
and a.eq_ledger_code LIKE CONCAT('%', #{vo.eqLedgerCode}, '%')
</if>
<if test="vo.deviceDescription != null and vo.deviceDescription != ''">
and a.device_description LIKE CONCAT('%', #{vo.deviceDescription}, '%')
</if>
<if test="vo.eqType != null and vo.eqType != ''">
and a.eq_type LIKE CONCAT('%', #{vo.eqType}, '%')
</if>
<if test="vo.maintenanceTeam != null and vo.maintenanceTeam != ''">
and a.maintenance_team LIKE CONCAT('%', #{vo.maintenanceTeam}, '%')
</if>
<if test="vo.manufacturingSerialNo != null and vo.manufacturingSerialNo != ''">
and a.manufacturing_serial_no LIKE CONCAT('%', #{vo.manufacturingSerialNo}, '%')
</if>
<if test="vo.userStatus != null and vo.userStatus != ''">
and a.user_status = #{vo.userStatus}
</if>
<if test="vo.station != null and vo.station != ''">
and a.station = #{vo.station}
</if>
</select> </select>
<select id="getKksNoList" resultMap="equipmentLedgerResultMap"> <select id="getKksNoList" resultMap="equipmentLedgerResultMap">

@ -28,7 +28,7 @@ public interface ToolInventoryRecordMapper extends BaseMapper<ToolInventoryRecor
*/ */
List<ToolInventoryRecordVO> selectToolInventoryRecordPage(IPage page, ToolInventoryRecordVO toolInventoryRecord); List<ToolInventoryRecordVO> selectToolInventoryRecordPage(IPage page, ToolInventoryRecordVO toolInventoryRecord);
List<ToolInventoryRecordExcel> exportData(@Param("ew") Wrapper<ToolInventoryRecord> queryWrapper); List<ToolInventoryRecordExcel> exportData(@Param("vo") ToolInventoryRecordVO ToolInventoryRecord);
/** /**
* 获取kks编号 * 获取kks编号

@ -39,13 +39,7 @@
model_specification, model_specification,
configuration_date, configuration_date,
responsible_team, responsible_team,
CASE stations,
WHEN stations = '1' THEN '景和光伏'
WHEN stations = '2' THEN '北沙一光伏'
WHEN stations = '3' THEN '北沙二光伏'
WHEN stations = '4' THEN '达坂城风电一场'
ELSE ''
END AS stations_ext,
tool_category, tool_category,
tool_status, tool_status,
years_in_used, years_in_used,
@ -53,18 +47,28 @@
tool_type_description, tool_type_description,
tool_status_description, tool_status_description,
factory_no, factory_no,
CASE is_inspection_period,
WHEN is_inspection_period = '1' THEN '否' check_status
WHEN is_inspection_period = '2' THEN '是' FROM l_tool_inventory_record a
ELSE '' where a.is_deleted = 0
END AS is_inspection_period_ext, <if test="vo.toolsCodeId != null and vo.toolsCodeId != ''">
CASE and a.tools_code_id LIKE CONCAT('%', #{vo.toolsCodeId}, '%')
WHEN check_status = '1' THEN '审核中' </if>
WHEN check_status = '2' THEN '已审核' <if test="vo.toolName != null and vo.toolName != ''">
WHEN check_status = '3' THEN '未通过' AND a.tool_name LIKE CONCAT('%', #{vo.toolName}, '%')
ELSE '' </if>
END AS check_status_ext <if test="vo.toolCategory != null and vo.toolCategory != ''">
FROM l_tool_inventory_record ${ew.customSqlSegment} AND a.tool_category LIKE CONCAT('%', #{vo.toolCategory}, '%')
</if>
<if test="vo.toolStatus != null and vo.toolStatus != ''">
AND a.tool_status LIKE CONCAT('%', #{vo.toolCategory}, '%')
</if>
<if test="vo.isInspectionPeriod != null and vo.isInspectionPeriod != ''">
and a.is_inspection_period = #{vo.isInspectionPeriod}
</if>
<if test="vo.stations != null and vo.stations != ''">
and a.stations = #{vo.stations}
</if>
</select> </select>
<select id="getToolsCodeIdList" resultMap="toolInventoryRecordResultMap"> <select id="getToolsCodeIdList" resultMap="toolInventoryRecordResultMap">

@ -30,10 +30,10 @@ public interface IEquipmentLedgerService extends BaseService<EquipmentLedger> {
/** /**
* 获取导出数据 * 获取导出数据
* *
* @param queryWrapper * @param equipmentLedger
* @return * @return
*/ */
List<EquipmentLedgerExcel> export(Wrapper<EquipmentLedger> queryWrapper); List<EquipmentLedgerExcel> export(EquipmentLedgerVO equipmentLedger);
/** /**
* 获取路线编号 * 获取路线编号

@ -5,6 +5,7 @@ import org.energy.modules.leger.entity.EquipmentLedger;
import org.energy.modules.leger.entity.ToolInventoryRecord; import org.energy.modules.leger.entity.ToolInventoryRecord;
import org.energy.modules.leger.excel.EquipmentLedgerExcel; import org.energy.modules.leger.excel.EquipmentLedgerExcel;
import org.energy.modules.leger.excel.ToolInventoryRecordExcel; import org.energy.modules.leger.excel.ToolInventoryRecordExcel;
import org.energy.modules.leger.vo.EquipmentLedgerVO;
import org.energy.modules.leger.vo.ToolInventoryRecordVO; import org.energy.modules.leger.vo.ToolInventoryRecordVO;
import com.dayu.daf.core.mp.base.BaseService; import com.dayu.daf.core.mp.base.BaseService;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -31,10 +32,10 @@ public interface IToolInventoryRecordService extends BaseService<ToolInventoryRe
/** /**
* 获取导出数据 * 获取导出数据
* *
* @param queryWrapper * @param ToolInventoryRecord
* @return * @return
*/ */
List<ToolInventoryRecordExcel> export(Wrapper<ToolInventoryRecord> queryWrapper); List<ToolInventoryRecordExcel> export(ToolInventoryRecordVO ToolInventoryRecord);
/** /**
* 获取路线编号 * 获取路线编号

@ -1,6 +1,7 @@
package org.energy.modules.leger.service.impl; package org.energy.modules.leger.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import io.micrometer.core.instrument.util.StringUtils;
import org.energy.modules.inspection.entity.InspectionObject; import org.energy.modules.inspection.entity.InspectionObject;
import org.energy.modules.leger.entity.EquipmentLedger; import org.energy.modules.leger.entity.EquipmentLedger;
import org.energy.modules.leger.vo.EquipmentLedgerVO; import org.energy.modules.leger.vo.EquipmentLedgerVO;
@ -8,6 +9,10 @@ import org.energy.modules.leger.mapper.EquipmentLedgerMapper;
import org.energy.modules.leger.service.IEquipmentLedgerService; import org.energy.modules.leger.service.IEquipmentLedgerService;
import com.dayu.daf.core.mp.base.BaseServiceImpl; import com.dayu.daf.core.mp.base.BaseServiceImpl;
import org.energy.modules.leger.excel.EquipmentLedgerExcel; import org.energy.modules.leger.excel.EquipmentLedgerExcel;
import org.energy.modules.smart.excel.WorkPermitExcel;
import org.energy.modules.smart.vo.WorkPermitVO;
import org.energy.modules.system.service.IDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
@ -22,14 +27,21 @@ import java.util.List;
@Service @Service
public class EquipmentLedgerServiceImpl extends BaseServiceImpl<EquipmentLedgerMapper, EquipmentLedger> implements IEquipmentLedgerService { public class EquipmentLedgerServiceImpl extends BaseServiceImpl<EquipmentLedgerMapper, EquipmentLedger> implements IEquipmentLedgerService {
@Autowired
IDictService dictService;
@Override @Override
public IPage<EquipmentLedgerVO> selectEquipmentLedgerPage(IPage<EquipmentLedgerVO> page, EquipmentLedgerVO equipmentLedger) { public IPage<EquipmentLedgerVO> selectEquipmentLedgerPage(IPage<EquipmentLedgerVO> page, EquipmentLedgerVO equipmentLedger) {
return page.setRecords(baseMapper.selectEquipmentLedgerPage(page, equipmentLedger)); return page.setRecords(baseMapper.selectEquipmentLedgerPage(page, equipmentLedger));
} }
@Override @Override
public List<EquipmentLedgerExcel> export(Wrapper<EquipmentLedger> queryWrapper) { public List<EquipmentLedgerExcel> export(EquipmentLedgerVO equipmentLedger) {
List<EquipmentLedgerExcel> list = baseMapper.exportData(queryWrapper); List<EquipmentLedgerExcel> list = baseMapper.exportData(equipmentLedger);
list.forEach(item -> {
if (StringUtils.isNotEmpty(item.getCheckStatus()))
item.setCheckStatus(dictService.getValue("check_status", Integer.parseInt(item.getCheckStatus())));
});
return list; return list;
} }

@ -1,13 +1,17 @@
package org.energy.modules.leger.service.impl; package org.energy.modules.leger.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.Wrapper;
import io.micrometer.core.instrument.util.StringUtils;
import org.energy.modules.leger.entity.EquipmentLedger; import org.energy.modules.leger.entity.EquipmentLedger;
import org.energy.modules.leger.entity.ToolInventoryRecord; import org.energy.modules.leger.entity.ToolInventoryRecord;
import org.energy.modules.leger.excel.EquipmentLedgerExcel; import org.energy.modules.leger.excel.EquipmentLedgerExcel;
import org.energy.modules.leger.vo.EquipmentLedgerVO;
import org.energy.modules.leger.vo.ToolInventoryRecordVO; import org.energy.modules.leger.vo.ToolInventoryRecordVO;
import org.energy.modules.leger.mapper.ToolInventoryRecordMapper; import org.energy.modules.leger.mapper.ToolInventoryRecordMapper;
import org.energy.modules.leger.service.IToolInventoryRecordService; import org.energy.modules.leger.service.IToolInventoryRecordService;
import com.dayu.daf.core.mp.base.BaseServiceImpl; import com.dayu.daf.core.mp.base.BaseServiceImpl;
import org.energy.modules.system.service.IDictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import org.energy.modules.leger.excel.ToolInventoryRecordExcel; import org.energy.modules.leger.excel.ToolInventoryRecordExcel;
@ -22,6 +26,8 @@ import java.util.List;
*/ */
@Service @Service
public class ToolInventoryRecordServiceImpl extends BaseServiceImpl<ToolInventoryRecordMapper, ToolInventoryRecord> implements IToolInventoryRecordService { public class ToolInventoryRecordServiceImpl extends BaseServiceImpl<ToolInventoryRecordMapper, ToolInventoryRecord> implements IToolInventoryRecordService {
@Autowired
IDictService dictService;
@Override @Override
public IPage<ToolInventoryRecordVO> selectToolInventoryRecordPage(IPage<ToolInventoryRecordVO> page, ToolInventoryRecordVO toolInventoryRecord) { public IPage<ToolInventoryRecordVO> selectToolInventoryRecordPage(IPage<ToolInventoryRecordVO> page, ToolInventoryRecordVO toolInventoryRecord) {
@ -29,8 +35,16 @@ public class ToolInventoryRecordServiceImpl extends BaseServiceImpl<ToolInventor
} }
@Override @Override
public List<ToolInventoryRecordExcel> export(Wrapper<ToolInventoryRecord> queryWrapper) { public List<ToolInventoryRecordExcel> export(ToolInventoryRecordVO toolInventoryRecord) {
List<ToolInventoryRecordExcel> list = baseMapper.exportData(queryWrapper); List<ToolInventoryRecordExcel> list = baseMapper.exportData(toolInventoryRecord);
list.forEach(item -> {
if (StringUtils.isNotEmpty(item.getCheckStatus()))
item.setCheckStatus(dictService.getValue("check_status", Integer.parseInt(item.getCheckStatus())));
if (StringUtils.isNotEmpty(item.getStations()))
item.setStations(dictService.getValue("station", Integer.parseInt(item.getStations())));
if (StringUtils.isNotEmpty(item.getIsInspectionPeriod()))
item.setIsInspectionPeriod(dictService.getValue("yes_no", Integer.parseInt(item.getIsInspectionPeriod())));
});
return list; return list;
} }

Loading…
Cancel
Save