|
|
@ -18,7 +18,10 @@ package org.energy.modules.leger.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.secure.DafUser; |
|
|
|
import com.dayu.daf.core.tool.constant.DafConstant; |
|
|
|
import com.dayu.daf.core.tool.constant.DafConstant; |
|
|
|
|
|
|
|
import com.qiniu.util.StringUtils; |
|
|
|
|
|
|
|
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; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
|
import io.swagger.annotations.ApiParam; |
|
|
@ -37,7 +40,6 @@ 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.system.excel.UserExcel; |
|
|
|
|
|
|
|
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; |
|
|
@ -49,8 +51,11 @@ import springfox.documentation.annotations.ApiIgnore; |
|
|
|
|
|
|
|
|
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.net.URLEncoder; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
import java.util.stream.Stream; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设备台账编码一览 控制器 |
|
|
|
* 设备台账编码一览 控制器 |
|
|
@ -85,9 +90,39 @@ public class EquipmentLedgerController extends DafController { |
|
|
|
@GetMapping("/list") |
|
|
|
@GetMapping("/list") |
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
@ApiOperationSupport(order = 2) |
|
|
|
@ApiOperation(value = "分页", notes = "传入equipmentLedger") |
|
|
|
@ApiOperation(value = "分页", notes = "传入equipmentLedger") |
|
|
|
|
|
|
|
// public R<IPage<EquipmentLedger>> list(@ApiIgnore @RequestParam Map<String, Object> equipmentLedger, Query query) {
|
|
|
|
public R<IPage<EquipmentLedger>> list(EquipmentLedger equipmentLedger, Query query) { |
|
|
|
public R<IPage<EquipmentLedger>> list(EquipmentLedger equipmentLedger, Query query) { |
|
|
|
query.setAscs("eq_ledger_code"); |
|
|
|
QueryWrapper<EquipmentLedger> qw = new QueryWrapper<>(); |
|
|
|
IPage<EquipmentLedger> pages = equipmentLedgerService.page(Condition.getPage(query), Condition.getQueryWrapper(equipmentLedger)); |
|
|
|
qw.orderByAsc("eq_ledger_code"); |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(equipmentLedger.getMajor())) { |
|
|
|
|
|
|
|
qw.lambda().like(EquipmentLedger::getMajor, equipmentLedger.getMajor()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (null != equipmentLedger.getUserStatus()) { |
|
|
|
|
|
|
|
qw.lambda().eq(EquipmentLedger::getUserStatus, equipmentLedger.getUserStatus()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (null != equipmentLedger.getStation()) { |
|
|
|
|
|
|
|
qw.lambda().eq(EquipmentLedger::getStation, equipmentLedger.getStation()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(equipmentLedger.getInstallationLocation())) { |
|
|
|
|
|
|
|
qw.lambda().like(EquipmentLedger::getInstallationLocation, equipmentLedger.getInstallationLocation()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(equipmentLedger.getEqLedgerCode())) { |
|
|
|
|
|
|
|
qw.lambda().like(EquipmentLedger::getEqLedgerCode, equipmentLedger.getEqLedgerCode()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(equipmentLedger.getDeviceDescription())) { |
|
|
|
|
|
|
|
qw.lambda().like(EquipmentLedger::getDeviceDescription, equipmentLedger.getDeviceDescription()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(equipmentLedger.getEqType())) { |
|
|
|
|
|
|
|
qw.lambda().like(EquipmentLedger::getEqType, equipmentLedger.getEqType()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(equipmentLedger.getMaintenanceTeam())) { |
|
|
|
|
|
|
|
qw.lambda().like(EquipmentLedger::getMaintenanceTeam, equipmentLedger.getMaintenanceTeam()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (StringUtil.isNotEmpty(equipmentLedger.getManufacturingSerialNo())) { |
|
|
|
|
|
|
|
qw.lambda().like(EquipmentLedger::getManufacturingSerialNo, equipmentLedger.getManufacturingSerialNo()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
IPage<EquipmentLedger> pages = equipmentLedgerService.page(Condition.getPage(query), qw); |
|
|
|
|
|
|
|
|
|
|
|
return R.data(pages); |
|
|
|
return R.data(pages); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|