Commit b8066a13 authored by wujiang's avatar wujiang

提交修改

parent 4d988671
......@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.yeejoin.amos.boot.module.hygf.biz.service.impl.TdHygfJpInverterWarnServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -43,12 +44,13 @@ public class TdHygfJpInverterWarnController extends BaseController {
@Autowired
TdHygfJpInverterWarnServiceImpl tdHygfJpInverterWarnServiceImpl;
@Autowired
JpPersonStationMapper pPersonStationMapper;
@Autowired
TdHygfJpInverterWarnMapper tdHygfJpInverterWarnMapper;
@Autowired
JpStationMapper jpStationMapper;
@Autowired
JpPersonStationMapper pPersonStationMapper;
@Autowired
TdHygfJpInverterWarnMapper tdHygfJpInverterWarnMapper;
@Autowired
JpStationMapper jpStationMapper;
/**
* 新增户用光伏监盘逆变器报警表
*
......@@ -72,9 +74,9 @@ public class TdHygfJpInverterWarnController extends BaseController {
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新户用光伏监盘逆变器报警表", notes = "根据sequenceNbr更新户用光伏监盘逆变器报警表")
public ResponseModel<TdHygfJpInverterWarnDto> updateBySequenceNbrTdHygfJpInverterWarn(@RequestBody TdHygfJpInverterWarnDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.updateWithModel(model));
public ResponseModel<TdHygfJpInverterWarnDto> updateBySequenceNbrTdHygfJpInverterWarn(
@RequestBody TdHygfJpInverterWarnDto model, @PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.updateWithModel(model));
}
......@@ -117,11 +119,22 @@ public class TdHygfJpInverterWarnController extends BaseController {
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表分页查询", notes = "户用光伏监盘逆变器报警表分页查询")
public ResponseModel<Page<TdHygfJpInverterWarnDto>> queryForPage(@RequestParam(value = "current") int current,
@RequestParam(value = "size") int size, TdHygfJpInverterWarnDto tdHygfJpInverterWarnDto) {
Page<TdHygfJpInverterWarnDto> page = new Page<TdHygfJpInverterWarnDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(
tdHygfJpInverterWarnServiceImpl.queryForTdHygfJpInverterWarnPage(page, tdHygfJpInverterWarnDto));
LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
if (!pPersonStation.isEmpty()) {
Page<TdHygfJpInverterWarnDto> page = new Page<TdHygfJpInverterWarnDto>();
page.setCurrent(current);
page.setSize(size);
List<String> ids = pPersonStation.stream().map(i -> i.getStationId()).collect(Collectors.toList());
tdHygfJpInverterWarnDto.setStationIds(ids);
return ResponseHelper.buildResponse(
tdHygfJpInverterWarnServiceImpl.queryForTdHygfJpInverterWarnPage(page, tdHygfJpInverterWarnDto));
} else {
return ResponseHelper.buildResponse(new Page<TdHygfJpInverterWarnDto>());
}
}
/**
......@@ -136,38 +149,36 @@ public class TdHygfJpInverterWarnController extends BaseController {
return ResponseHelper.buildResponse(tdHygfJpInverterWarnServiceImpl.queryForTdHygfJpInverterWarnList());
}
/**
* 获取告警统计
* **/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询")
@GetMapping(value = "/selectcount")
public ResponseModel< List<Map<String,Object>>> selectcount(JpStationDto reviewDto) {
LambdaQueryWrapper<JpStation> qugda=new LambdaQueryWrapper<>();
//获取当前人管理场站
if(reviewDto.getThirdStationId()==null){
//获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug=new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId,getUserInfo().getUserId());
List<JpPersonStation> pPersonStation=pPersonStationMapper.selectList(qug);
List ids=null;
if(pPersonStation!=null&&!pPersonStation.isEmpty()){
ids=new ArrayList();
for (JpPersonStation jpPersonStation : pPersonStation) {
ids.add(jpPersonStation.getStationId());
}
qugda.in(ids!=null,JpStation::getThirdStationId,ids);
}
}else{
qugda.eq(JpStation::getThirdStationId,reviewDto.getThirdStationId());
}
qugda.like(reviewDto.getUserName()!=null,JpStation::getUserName,reviewDto.getUserName());
qugda.like(reviewDto.getArea()!=null,JpStation::getArea,reviewDto.getArea());
List<JpStation> pPersonStation=jpStationMapper.selectList(qugda);
List<Map<String,Object>> datalist= tdHygfJpInverterWarnMapper.getCountTdHygfJpInverterWarn(pPersonStation);
return ResponseHelper.buildResponse(datalist);
}
/**
* 获取告警统计
**/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "户用光伏监盘逆变器报警表列表全部数据查询", notes = "户用光伏监盘逆变器报警表列表全部数据查询")
@GetMapping(value = "/selectcount")
public ResponseModel<List<Map<String, Object>>> selectcount(JpStationDto reviewDto) {
LambdaQueryWrapper<JpStation> qugda = new LambdaQueryWrapper<>();
// 获取当前人管理场站
if (reviewDto.getThirdStationId() == null) {
// 获取当前人管理场站
LambdaQueryWrapper<JpPersonStation> qug = new LambdaQueryWrapper<>();
qug.eq(JpPersonStation::getPersonId, getUserInfo().getUserId());
List<JpPersonStation> pPersonStation = pPersonStationMapper.selectList(qug);
List ids = null;
if (pPersonStation != null && !pPersonStation.isEmpty()) {
ids = new ArrayList();
for (JpPersonStation jpPersonStation : pPersonStation) {
ids.add(jpPersonStation.getStationId());
}
qugda.in(ids != null, JpStation::getThirdStationId, ids);
}
} else {
qugda.eq(JpStation::getThirdStationId, reviewDto.getThirdStationId());
}
qugda.like(reviewDto.getUserName() != null, JpStation::getUserName, reviewDto.getUserName());
qugda.like(reviewDto.getArea() != null, JpStation::getArea, reviewDto.getArea());
List<JpStation> pPersonStation = jpStationMapper.selectList(qugda);
List<Map<String, Object>> datalist = tdHygfJpInverterWarnMapper.getCountTdHygfJpInverterWarn(pPersonStation);
return ResponseHelper.buildResponse(datalist);
}
}
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