1.无线设备bug修改
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
package com.njcn.csharmonic.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
||||
@@ -33,7 +36,8 @@ import java.util.List;
|
||||
@RequestMapping("/event")
|
||||
@Api(tags = "暂降事件")
|
||||
@AllArgsConstructor
|
||||
public class EventController extends BaseController {
|
||||
public class CsEventController extends BaseController {
|
||||
|
||||
private final CsEventPOService csEventPOService;
|
||||
|
||||
|
||||
@@ -47,6 +51,17 @@ public class EventController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/pageQueryByLineId")
|
||||
@ApiOperation("根据监测点分页查询暂降事件")
|
||||
@ApiImplicitParam(name = "csEventUserQueryPage", value = "暂降事件查询参数", required = true)
|
||||
public HttpResult<Page<DataGroupEventVO>> pageQueryByLineId(@RequestBody CsEventUserQueryPage csEventUserQueryPage) {
|
||||
String methodDescribe = getMethodDescribe("queryEventList");
|
||||
Page<DataGroupEventVO> page = csEventPOService.pageQueryByLineId(csEventUserQueryPage);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@GetMapping("/analyseWave")
|
||||
@ApiOperation("暂态事件波形分析")
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.njcn.csharmonic.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||
import com.njcn.csharmonic.pojo.po.CsEventPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
@@ -40,5 +43,7 @@ public interface CsEventPOService extends IService<CsEventPO>{
|
||||
|
||||
List<EventDetailVO> queryEventList(CsEventUserQueryParam csEventUserQueryParam);
|
||||
|
||||
Page<DataGroupEventVO> pageQueryByLineId(CsEventUserQueryPage csEventUserQueryPage);
|
||||
|
||||
void saveBatchEventList(List<CsEventPO> csEventPOS);
|
||||
}
|
||||
|
||||
@@ -1,14 +1,22 @@
|
||||
package com.njcn.csharmonic.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.DateTime;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.api.CsLedgerFeignClient;
|
||||
import com.njcn.csdevice.api.CsLineFeignClient;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.pojo.dto.DevDetailDTO;
|
||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||
import com.njcn.csdevice.pojo.vo.DataGroupEventVO;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryPage;
|
||||
import com.njcn.csharmonic.pojo.vo.CsEventVO;
|
||||
import com.njcn.csharmonic.param.CsEventUserQueryParam;
|
||||
import com.njcn.csharmonic.pojo.vo.EventDetailVO;
|
||||
@@ -119,6 +127,25 @@ public class CsEventPOServiceImpl extends ServiceImpl<CsEventPOMapper, CsEventPO
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<DataGroupEventVO> pageQueryByLineId(CsEventUserQueryPage csEventUserQueryPage) {
|
||||
Page<DataGroupEventVO> result = new Page<>(csEventUserQueryPage.getPageNum(),csEventUserQueryPage.getPageSize());
|
||||
DateTime begin = DateUtil.parse(csEventUserQueryPage.getStartTime(), DatePattern.NORM_DATE_PATTERN);
|
||||
DateTime end = DateUtil.endOfDay(DateUtil.parse(csEventUserQueryPage.getEndTime(), DatePattern.NORM_DATE_PATTERN));
|
||||
|
||||
LambdaQueryWrapper<CsEventPO> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CsEventPO::getLineId,csEventUserQueryPage.getLineId())
|
||||
.eq(CsEventPO::getType,0).between(CsEventPO::getStartTime,begin,end)
|
||||
.orderByDesc(CsEventPO::getStartTime);
|
||||
Page<CsEventPO> page = this.page(new Page<>(csEventUserQueryPage.getPageNum(),csEventUserQueryPage.getPageSize()),lambdaQueryWrapper);
|
||||
if(CollUtil.isNotEmpty(page.getRecords())){
|
||||
List<DataGroupEventVO> dataGroupEventVOList = BeanUtil.copyToList(page.getRecords(),DataGroupEventVO.class);
|
||||
result.setRecords(dataGroupEventVOList);
|
||||
result.setTotal(page.getTotal());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveBatchEventList(List<CsEventPO> csEventPOS) {
|
||||
|
||||
Reference in New Issue
Block a user