系统配置
This commit is contained in:
@@ -7,6 +7,8 @@ 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.param.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmCountVO;
|
||||
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -20,9 +22,10 @@ import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/16 16:33【需求编号】
|
||||
@@ -59,4 +62,15 @@ public class CsEquipmentAlarmController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryList")
|
||||
@ApiOperation("设备警告分页查询")
|
||||
@ApiImplicitParam(name = "csEquipmentAlarmPageParm", value = "设备警告查询参数", required = true)
|
||||
public HttpResult<List<CsEquipmentAlarmVO>> querList(@RequestBody @Validated CsEquipmentAlarmPageParm csEquipmentAlarmPageParm ){
|
||||
String methodDescribe = getMethodDescribe("querList");
|
||||
|
||||
List<CsEquipmentAlarmVO> list = csEquipmentAlarmPOService.querList (csEquipmentAlarmPageParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ 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.cswarn.pojo.parm.CsEventDetailParm;
|
||||
import com.njcn.cswarn.service.CsEventDetailPOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -19,9 +20,10 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
|
||||
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (cs_event_detail)表控制层
|
||||
*
|
||||
@@ -39,10 +41,21 @@ public class CsEventDetailPOController extends BaseController {
|
||||
@PostMapping("/queryPage")
|
||||
@ApiOperation("暂态警告分页查询")
|
||||
@ApiImplicitParam(name = "csEventDetailPageParm", value = "暂态警告查询参数", required = true)
|
||||
public HttpResult<IPage<CsEventDetailVO>> queryPage(@RequestBody @Validated CsEventDetailPageParm csEventDetailPageParm ){
|
||||
public HttpResult<IPage<CsEventDetailVO>> queryPage(@RequestBody @Validated CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm ){
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
|
||||
IPage<CsEventDetailVO> page = csEventDetailPOService.queryPage (csEventDetailPageParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryList")
|
||||
@ApiOperation("暂态警告分页查询")
|
||||
@ApiImplicitParam(name = "csEventDetailPageParm", value = "暂态警告查询参数", required = true)
|
||||
public HttpResult<List<CsEventDetailVO>> queryList(@RequestBody @Validated CsEventDetailParm csEventDetailParm ){
|
||||
String methodDescribe = getMethodDescribe("queryList");
|
||||
|
||||
List<CsEventDetailVO> page = csEventDetailPOService.queryList (csEventDetailParm);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class CsStatLimitRateDPOController extends BaseController {
|
||||
private final CsStatLimitRateDPOService csStatLimitRateDPOService;
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryPage")
|
||||
@ApiOperation("设备模板分页查询")
|
||||
@ApiOperation("稳态警告分页查询")
|
||||
@ApiImplicitParam(name = "csStatLimitRatePageParm", value = "设备警告查询参数", required = true)
|
||||
public HttpResult<IPage<CsStatLimitRateDVO>> queryPage(@RequestBody @Validated CsStatLimitRatePageParm csStatLimitRatePageParm ){
|
||||
String methodDescribe = getMethodDescribe("queryPage");
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.njcn.cswarn.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.cswarn.pojo.parm.CsEventDetailParm;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
|
||||
import com.njcn.cswarn.pojo.po.CsEventDetailPO;
|
||||
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
|
||||
|
||||
@@ -15,5 +15,5 @@ import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsEventDetailPOMapper extends BaseMapper<CsEventDetailPO> {
|
||||
Page<CsEventDetailVO> queryPage(Page<CsEventDetailVO> returnpage, @Param("csEventDetailPageParm") CsEventDetailPageParm csEventDetailPageParm);
|
||||
Page<CsEventDetailVO> queryPage(Page<CsEventDetailVO> returnpage, @Param("csEventDetailPageParm") CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm);
|
||||
}
|
||||
@@ -2,11 +2,14 @@ package com.njcn.cswarn.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmCountVO;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -28,4 +31,8 @@ public interface CsEquipmentAlarmPOService extends IService<CsEquipmentAlarmPO>{
|
||||
CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
|
||||
|
||||
IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
|
||||
|
||||
|
||||
|
||||
List<CsEquipmentAlarmVO> querList(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
|
||||
}
|
||||
|
||||
@@ -2,10 +2,12 @@ package com.njcn.cswarn.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
|
||||
import com.njcn.cswarn.pojo.parm.CsEventDetailParm;
|
||||
import com.njcn.cswarn.pojo.po.CsEventDetailPO;
|
||||
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -18,5 +20,7 @@ import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
|
||||
public interface CsEventDetailPOService extends IService<CsEventDetailPO>{
|
||||
|
||||
|
||||
IPage<CsEventDetailVO> queryPage(CsEventDetailPageParm csEventDetailPageParm);
|
||||
}
|
||||
IPage<CsEventDetailVO> queryPage(CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm);
|
||||
|
||||
List<CsEventDetailVO> queryList(CsEventDetailParm csEventDetailPageParm);
|
||||
}
|
||||
|
||||
@@ -7,9 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.api.AppProjectFeignClient;
|
||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.cswarn.mapper.CsEquipmentAlarmPOMapper;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmCountVO;
|
||||
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.enums.DicDataTypeEnum;
|
||||
@@ -20,7 +22,6 @@ import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||
|
||||
@@ -55,6 +56,7 @@ public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmP
|
||||
CsEquipmentAlarmPO csEquipmentAlarmPO = new CsEquipmentAlarmPO();
|
||||
BeanUtils.copyProperties(csEquipmentAlarmAddParm,csEquipmentAlarmPO);
|
||||
csEquipmentAlarmPO.setStatus("1");
|
||||
csEquipmentAlarmPO.setDealFlag("0");
|
||||
this.save(csEquipmentAlarmPO);
|
||||
|
||||
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
|
||||
@@ -111,5 +113,41 @@ public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmP
|
||||
return returnpage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEquipmentAlarmVO> querList(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
|
||||
QueryWrapper<CsEquipmentAlarmPO> queryWrapper = new QueryWrapper<>();
|
||||
|
||||
queryWrapper.eq("status", "1");
|
||||
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getProjectId()),CsEquipmentAlarmPO.COL_PROJECT_ID,csEquipmentAlarmPageParm.getProjectId());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getEquipmentId()),CsEquipmentAlarmPO.COL_EQUIPMENT_ID,csEquipmentAlarmPageParm.getEquipmentId());
|
||||
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getAlarmLevel()),CsEquipmentAlarmPO.COL_ALARM_LEVEL,csEquipmentAlarmPageParm.getAlarmLevel());
|
||||
queryWrapper.ge(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getStartTime());
|
||||
queryWrapper.le(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getEndTime());
|
||||
queryWrapper.orderByDesc("create_time");
|
||||
|
||||
List<CsEquipmentAlarmPO> csEquipmentAlarmPOS = this.getBaseMapper().selectList(queryWrapper);
|
||||
List<String> collect1 = csEquipmentAlarmPOS.stream().map(CsEquipmentAlarmPO::getProjectId).distinct().collect(toList());
|
||||
List<String> collect2 = csEquipmentAlarmPOS.stream().map(CsEquipmentAlarmPO::getEquipmentId).distinct().collect(toList());
|
||||
|
||||
List<CsEquipmentDeliveryPO> data = equipmentFeignClient.queryDeviceById(collect2).getData();
|
||||
List<AppProjectPO> data1 = appProjectFeignClient.queryProjectById(collect1).getData();
|
||||
List<DictData> data3 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.ALARM_TYPE.getCode()).getData();
|
||||
|
||||
Map<String, String> collect3 = data.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, CsEquipmentDeliveryPO::getName));
|
||||
Map<String, String> collect4 = data1.stream().collect(Collectors.toMap(AppProjectPO::getId, AppProjectPO::getName));
|
||||
Map<String, String> collect5 = data3.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
|
||||
|
||||
|
||||
List<CsEquipmentAlarmVO> collect = csEquipmentAlarmPOS.stream().map(temp -> {
|
||||
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
|
||||
csEquipmentAlarmVO.setEquipmentName(collect3.get(temp.getEquipmentId()));
|
||||
csEquipmentAlarmVO.setAlarmLevelName(collect4.get(temp.getAlarmLevel()));
|
||||
csEquipmentAlarmVO.setProjectName(collect5.get(temp.getProjectId()));
|
||||
return csEquipmentAlarmVO;
|
||||
}).collect(toList());
|
||||
|
||||
return collect;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -4,14 +4,16 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.cswarn.mapper.CsEventDetailPOMapper;
|
||||
import com.njcn.cswarn.pojo.parm.CsEventDetailParm;
|
||||
import com.njcn.cswarn.service.CsEventDetailPOService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.njcn.cswarn.pojo.parm.CsEventDetailPageParm;
|
||||
import com.njcn.cswarn.pojo.po.CsEventDetailPO;
|
||||
import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -26,9 +28,14 @@ import com.njcn.cswarn.pojo.vo.CsEventDetailVO;
|
||||
public class CsEventDetailPOServiceImpl extends ServiceImpl<CsEventDetailPOMapper, CsEventDetailPO> implements CsEventDetailPOService {
|
||||
|
||||
@Override
|
||||
public IPage<CsEventDetailVO> queryPage(CsEventDetailPageParm csEventDetailPageParm) {
|
||||
public IPage<CsEventDetailVO> queryPage(CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm) {
|
||||
Page<CsEventDetailVO> returnpage = new Page<> (csEventDetailPageParm.getPageNum ( ), csEventDetailPageParm.getPageSize ( ));
|
||||
returnpage = this.getBaseMapper().queryPage(returnpage,csEventDetailPageParm);
|
||||
return returnpage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsEventDetailVO> queryList(CsEventDetailParm csEventDetailPageParm) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user