Commit 26bdea71 authored by caotao's avatar caotao

Merge branch 'developer' of http://39.98.45.134:8090/moa/amos-boot-biz into developer

parents fca38276 fbe6a474
package com.yeejoin.amos.boot.module.hygf.api.dto; package com.yeejoin.amos.boot.module.hygf.api.dto;
import java.util.Date;
import java.util.List;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date;
/** /**
* 户用光伏监盘采集器表 * 户用光伏监盘采集器表
...@@ -68,4 +71,6 @@ public class JpCollectorDto extends BaseDto { ...@@ -68,4 +71,6 @@ public class JpCollectorDto extends BaseDto {
@ApiModelProperty(value = "电站地址") @ApiModelProperty(value = "电站地址")
private String addr; private String addr;
private List<String> stationIds;
} }
...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto; ...@@ -7,6 +7,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* 户用光伏监盘逆变器表 * 户用光伏监盘逆变器表
...@@ -94,4 +95,5 @@ public class JpInverterDto extends BaseDto { ...@@ -94,4 +95,5 @@ public class JpInverterDto extends BaseDto {
@ApiModelProperty(value = "所属电站") @ApiModelProperty(value = "所属电站")
private String stationName; private String stationName;
private List<String> stationIds;
} }
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.JpCollectorMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.JpCollectorMapper">
<select id="queryCollectorCountStatus" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"> <select id="queryCollectorCountStatus" resultType="Map">
select select
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
and hygf_jp_station.third_station_id =#{dto.thirdStationId} and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if> </if>
and hygf_jp_collector.`state`!=null and hygf_jp_collector.`state` in ("在线","告警","离线") and hygf_jp_collector.`state` is not null and hygf_jp_collector.`state` in ("在线","告警","离线")
</where> </where>
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper"> <mapper namespace="com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper">
<select id="queryInverterCountStatus" resultType="com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto"> <select id="queryInverterCountStatus" resultType="Map">
select select
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
<if test="dto.thirdStationId!=null"> <if test="dto.thirdStationId!=null">
and hygf_jp_station.third_station_id =#{dto.thirdStationId} and hygf_jp_station.third_station_id =#{dto.thirdStationId}
</if> </if>
and hygf_jp_inverter.`state`!=null and hygf_jp_inverter.`state` in ("在线","告警","离线") and hygf_jp_inverter.`state` is not null and hygf_jp_inverter.`state` in ("在线","告警","离线")
</where> </where>
GROUP BY hygf_jp_inverter.`state` GROUP BY hygf_jp_inverter.`state`
</select> </select>
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
#{item.stationId} #{item.stationId}
</foreach> </foreach>
</if> </if>
and hygf_jp_station.`state`!=null and hygf_jp_station.`state` in ("在线","报警","离线") and hygf_jp_station.`state` is not null and hygf_jp_station.`state` in ("在线","报警","离线")
</where> </where>
</select> </select>
......
...@@ -6,14 +6,22 @@ import io.swagger.annotations.Api; ...@@ -6,14 +6,22 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpCollectorServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.TdHygfJpInverterWarnDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -31,6 +39,9 @@ public class JpCollectorController extends BaseController { ...@@ -31,6 +39,9 @@ public class JpCollectorController extends BaseController {
@Autowired @Autowired
JpCollectorServiceImpl jpCollectorServiceImpl; JpCollectorServiceImpl jpCollectorServiceImpl;
@Autowired
JpPersonStationMapper pPersonStationMapper;
/** /**
* 新增户用光伏监盘采集器表 * 新增户用光伏监盘采集器表
* *
...@@ -53,7 +64,8 @@ public class JpCollectorController extends BaseController { ...@@ -53,7 +64,8 @@ public class JpCollectorController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}") @PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘采集器表", notes = "根据sequenceNbr更新户用光伏监盘采集器表") @ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘采集器表", notes = "根据sequenceNbr更新户用光伏监盘采集器表")
public ResponseModel<JpCollectorDto> updateBySequenceNbrJpCollector(@RequestBody JpCollectorDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) { public ResponseModel<JpCollectorDto> updateBySequenceNbrJpCollector(@RequestBody JpCollectorDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr); model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(jpCollectorServiceImpl.updateWithModel(model)); return ResponseHelper.buildResponse(jpCollectorServiceImpl.updateWithModel(model));
} }
...@@ -67,7 +79,8 @@ public class JpCollectorController extends BaseController { ...@@ -67,7 +79,8 @@ public class JpCollectorController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}") @DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘采集器表", notes = "根据sequenceNbr删除户用光伏监盘采集器表") @ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除户用光伏监盘采集器表", notes = "根据sequenceNbr删除户用光伏监盘采集器表")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){ public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorServiceImpl.removeById(sequenceNbr)); return ResponseHelper.buildResponse(jpCollectorServiceImpl.removeById(sequenceNbr));
} }
...@@ -79,7 +92,7 @@ public class JpCollectorController extends BaseController { ...@@ -79,7 +92,7 @@ public class JpCollectorController extends BaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}") @GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表") @ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个户用光伏监盘采集器表", notes = "根据sequenceNbr查询单个户用光伏监盘采集器表")
public ResponseModel<JpCollectorDto> selectOne(@PathVariable Long sequenceNbr) { public ResponseModel<JpCollectorDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryBySeq(sequenceNbr)); return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryBySeq(sequenceNbr));
} }
...@@ -93,13 +106,22 @@ public class JpCollectorController extends BaseController { ...@@ -93,13 +106,22 @@ public class JpCollectorController extends BaseController {
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page") @GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器表分页查询", notes = "户用光伏监盘采集器表分页查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器表分页查询", notes = "户用光伏监盘采集器表分页查询")
public ResponseModel<Page<JpCollectorDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam public ResponseModel<Page<JpCollectorDto>> queryForPage(@RequestParam(value = "current") int current,
(value = "size") int size,JpCollectorDto jpCollectorDto) { @RequestParam(value = "size") int size, JpCollectorDto jpCollectorDto) {
LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
if (!pPersonStation.isEmpty()) {
Page<JpCollectorDto> page = new Page<JpCollectorDto>(); Page<JpCollectorDto> page = new Page<JpCollectorDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorPage(page,jpCollectorDto)); List<String> ids = pPersonStation.stream().map(i -> i.getStationId()).collect(Collectors.toList());
jpCollectorDto.setStationIds(ids);
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorPage(page, jpCollectorDto));
} else {
return ResponseHelper.buildResponse(new Page<JpCollectorDto>());
}
} }
/** /**
...@@ -108,7 +130,7 @@ public class JpCollectorController extends BaseController { ...@@ -108,7 +130,7 @@ public class JpCollectorController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "户用光伏监盘采集器表列表全部数据查询", notes = "户用光伏监盘采集器表列表全部数据查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘采集器表列表全部数据查询", notes = "户用光伏监盘采集器表列表全部数据查询")
@GetMapping(value = "/list") @GetMapping(value = "/list")
public ResponseModel<List<JpCollectorDto>> selectForList() { public ResponseModel<List<JpCollectorDto>> selectForList() {
return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorList()); return ResponseHelper.buildResponse(jpCollectorServiceImpl.queryForJpCollectorList());
......
...@@ -6,14 +6,22 @@ import io.swagger.annotations.Api; ...@@ -6,14 +6,22 @@ import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController; import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List; import java.util.List;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterServiceImpl; import com.yeejoin.amos.boot.module.hygf.biz.service.impl.JpInverterServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel; import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpCollectorDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpPersonStation;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpPersonStationMapper;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
...@@ -31,6 +39,10 @@ public class JpInverterController extends BaseController { ...@@ -31,6 +39,10 @@ public class JpInverterController extends BaseController {
@Autowired @Autowired
JpInverterServiceImpl jpInverterServiceImpl; JpInverterServiceImpl jpInverterServiceImpl;
@Autowired
JpPersonStationMapper pPersonStationMapper;
/** /**
* 新增户用光伏监盘逆变器表 * 新增户用光伏监盘逆变器表
* *
...@@ -98,10 +110,20 @@ public class JpInverterController extends BaseController { ...@@ -98,10 +110,20 @@ public class JpInverterController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器表分页查询", notes = "户用光伏监盘逆变器表分页查询") @ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器表分页查询", notes = "户用光伏监盘逆变器表分页查询")
public ResponseModel<Page<JpInverterDto>> queryForPage(@RequestParam(value = "current") int current, public ResponseModel<Page<JpInverterDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, JpInverterDto jpInverterDto) { @RequestParam(value = "size") int size, JpInverterDto jpInverterDto) {
LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
if (!pPersonStation.isEmpty()) {
Page<JpInverterDto> page = new Page<JpInverterDto>(); Page<JpInverterDto> page = new Page<JpInverterDto>();
page.setCurrent(current); page.setCurrent(current);
page.setSize(size); page.setSize(size);
List<String> ids = pPersonStation.stream().map(i -> i.getStationId()).collect(Collectors.toList());
jpInverterDto.setStationIds(ids);
return ResponseHelper.buildResponse(jpInverterServiceImpl.queryForJpInverterPage(page, jpInverterDto)); return ResponseHelper.buildResponse(jpInverterServiceImpl.queryForJpInverterPage(page, jpInverterDto));
} else {
return ResponseHelper.buildResponse(new Page<JpInverterDto>());
}
} }
/** /**
......
...@@ -39,6 +39,9 @@ public class JpCollectorServiceImpl extends BaseService<JpCollectorDto, JpCollec ...@@ -39,6 +39,9 @@ public class JpCollectorServiceImpl extends BaseService<JpCollectorDto, JpCollec
if (jpCollectorDto.getState() != null) { if (jpCollectorDto.getState() != null) {
wrapper.eq(JpCollector::getState, jpCollectorDto.getState()); wrapper.eq(JpCollector::getState, jpCollectorDto.getState());
} }
if (!jpCollectorDto.getStationIds().isEmpty()) {
wrapper.in(JpCollector::getThirdStationId, jpCollectorDto.getStationIds());
}
entiryPage = (Page<JpCollector>) this.page(entiryPage, wrapper); entiryPage = (Page<JpCollector>) this.page(entiryPage, wrapper);
if (!ValidationUtil.isEmpty(entiryPage.getRecords())) { if (!ValidationUtil.isEmpty(entiryPage.getRecords())) {
page.setTotal(entiryPage.getTotal()); page.setTotal(entiryPage.getTotal());
......
...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterElectricityDto; ...@@ -8,6 +8,7 @@ import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterElectricityDto;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -24,6 +25,13 @@ import java.util.List; ...@@ -24,6 +25,13 @@ import java.util.List;
public class JpInverterElectricityServiceImpl public class JpInverterElectricityServiceImpl
extends BaseService<JpInverterElectricityDto, JpInverterElectricity, JpInverterElectricityMapper> extends BaseService<JpInverterElectricityDto, JpInverterElectricity, JpInverterElectricityMapper>
implements IJpInverterElectricityService { implements IJpInverterElectricityService {
@Autowired
private JpStationServiceImpl jpStationServiceImpl;
@Autowired
private JpInverterServiceImpl JpInverterServiceImpl;
/** /**
* 分页查询 * 分页查询
*/ */
...@@ -35,8 +43,10 @@ public class JpInverterElectricityServiceImpl ...@@ -35,8 +43,10 @@ public class JpInverterElectricityServiceImpl
* 列表查询 示例 * 列表查询 示例
*/ */
public List<JpInverterElectricityDto> queryForJpInverterElectricityList(String id) { public List<JpInverterElectricityDto> queryForJpInverterElectricityList(String id) {
JpInverter jpInverter = JpInverterServiceImpl.getById(id);
LambdaQueryWrapper<JpInverterElectricity> wrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<JpInverterElectricity> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JpInverterElectricity::getInverterId, id); wrapper.eq(JpInverterElectricity::getSnCode, jpInverter.getSnCode());
wrapper.eq(JpInverterElectricity::getThirdStationId, jpInverter.getThirdStationId());
List<JpInverterElectricity> list = this.list(wrapper); List<JpInverterElectricity> list = this.list(wrapper);
return Bean.toModels(list, this.getModelClass()); return Bean.toModels(list, this.getModelClass());
} }
......
...@@ -11,6 +11,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -11,6 +11,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto; import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpCollector;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter; import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper; import com.yeejoin.amos.boot.module.hygf.api.mapper.JpInverterMapper;
import com.yeejoin.amos.boot.module.hygf.api.service.IJpInverterService; import com.yeejoin.amos.boot.module.hygf.api.service.IJpInverterService;
...@@ -36,6 +37,9 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter ...@@ -36,6 +37,9 @@ public class JpInverterServiceImpl extends BaseService<JpInverterDto, JpInverter
if(StringUtils.isNotEmpty(jpInverterDto.getSnCode())) { if(StringUtils.isNotEmpty(jpInverterDto.getSnCode())) {
wrapper.likeRight(JpInverter::getSnCode, jpInverterDto.getSnCode()); wrapper.likeRight(JpInverter::getSnCode, jpInverterDto.getSnCode());
} }
if (!jpInverterDto.getStationIds().isEmpty()) {
wrapper.in(JpInverter::getThirdStationId, jpInverterDto.getStationIds());
}
wrapper.orderByDesc(JpInverter::getUpdateTime); wrapper.orderByDesc(JpInverter::getUpdateTime);
entiryPage = (Page<JpInverter>) this.page(entiryPage, wrapper); entiryPage = (Page<JpInverter>) this.page(entiryPage, wrapper);
if (!ValidationUtil.isEmpty(entiryPage.getRecords())) { if (!ValidationUtil.isEmpty(entiryPage.getRecords())) {
......
package com.yeejoin.amos.boot.module.hygf.biz.service.impl; package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import java.lang.reflect.Array; import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashMap; 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 org.apache.commons.lang3.time.DateUtils; import org.apache.commons.lang3.time.DateUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -52,7 +54,21 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -52,7 +54,21 @@ public class TdHygfJpInverterWarnServiceImpl
String[] s = tdHygfJpInverterWarnDto.getState().split(","); String[] s = tdHygfJpInverterWarnDto.getState().split(",");
tdHygfJpInverterWarnDto.setStates(Arrays.asList(s)); tdHygfJpInverterWarnDto.setStates(Arrays.asList(s));
} }
List<TdHygfJpInverterWarnDto> list = this.baseMapper.list(tdHygfJpInverterWarnDto); if (tdHygfJpInverterWarnDto.getStationName() != null) {
LambdaQueryWrapper<JpStation> wapper = new LambdaQueryWrapper<JpStation>().like(JpStation::getName,
tdHygfJpInverterWarnDto.getStationName());
if (!tdHygfJpInverterWarnDto.getStationIds().isEmpty()) {
wapper.in(JpStation::getThirdStationId, tdHygfJpInverterWarnDto.getStationIds());
}
List<JpStation> sList = jpStationServiceImpl.list(wapper);
List<String> ids = sList.stream().map(i -> i.getThirdStationId()).collect(Collectors.toList());
tdHygfJpInverterWarnDto.setStationIds(ids);
}
List<TdHygfJpInverterWarnDto> list = new ArrayList<>();
if (tdHygfJpInverterWarnDto.getStationIds().isEmpty()) {
} else {
list = this.baseMapper.list(tdHygfJpInverterWarnDto);
if (!list.isEmpty()) { if (!list.isEmpty()) {
list.forEach(i -> { list.forEach(i -> {
JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>() JpStation jpStation = jpStationServiceImpl.getOne(new LambdaQueryWrapper<JpStation>()
...@@ -67,6 +83,7 @@ public class TdHygfJpInverterWarnServiceImpl ...@@ -67,6 +83,7 @@ public class TdHygfJpInverterWarnServiceImpl
} }
}); });
} }
}
PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list); PageInfo<TdHygfJpInverterWarnDto> page = new PageInfo(list);
com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>(); com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto> pagenew = new com.baomidou.mybatisplus.extension.plugins.pagination.Page<TdHygfJpInverterWarnDto>();
pagenew.setCurrent(pageNum); pagenew.setCurrent(pageNum);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment