系统配置
This commit is contained in:
@@ -1,97 +0,0 @@
|
||||
package com.njcn.csdevice.pojo.po;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/16 16:25【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "cs_equipment_alarm")
|
||||
public class CsEquipmentAlarmPO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@TableField(value = "project_id")
|
||||
private String projectId;
|
||||
|
||||
/**
|
||||
* 设备id
|
||||
*/
|
||||
@TableField(value = "equipment_id")
|
||||
private String equipmentId;
|
||||
|
||||
/**
|
||||
* 告警信息
|
||||
*/
|
||||
@TableField(value = "alarm_msg")
|
||||
private String alarmMsg;
|
||||
|
||||
/**
|
||||
* 告警级别(字典表)
|
||||
*/
|
||||
@TableField(value = "alarm_level")
|
||||
private String alarmLevel;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@TableField(value = "start_time")
|
||||
private LocalDateTime startTime;
|
||||
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@TableField(value = "end_time")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
/**
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private String status;
|
||||
|
||||
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
public static final String COL_PROJECT_ID = "project_id";
|
||||
|
||||
public static final String COL_EQUIPMENT_ID = "equipment_id";
|
||||
|
||||
public static final String COL_ALARM_MSG = "alarm_msg";
|
||||
|
||||
public static final String COL_ALARM_LEVEL = "alarm_level";
|
||||
|
||||
public static final String COL_START_TIME = "start_time";
|
||||
|
||||
public static final String COL_END_TIME = "end_time";
|
||||
|
||||
public static final String COL_STATUS = "status";
|
||||
|
||||
public static final String COL_CREATE_BY = "create_by";
|
||||
|
||||
public static final String COL_CREATE_TIME = "create_time";
|
||||
|
||||
public static final String COL_UPDATE_BY = "update_by";
|
||||
|
||||
public static final String COL_UPDATE_TIME = "update_time";
|
||||
}
|
||||
@@ -105,8 +105,10 @@ public class CsEquipmentDeliveryVO extends BaseEntity {
|
||||
/**
|
||||
* 状态(0:删除 1:未注册 2:注册 3:接入)
|
||||
*/
|
||||
@TableField(value = "status")
|
||||
private Integer status;
|
||||
|
||||
@ApiModelProperty(value="装置出厂方式")
|
||||
private String devAccessMethod ;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/7/10 18:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CsTopologyDiagramTemplateVO {
|
||||
/**
|
||||
* 拓扑图模板Id
|
||||
*/
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* 拓扑图模板名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 拓扑图文件路径
|
||||
*/
|
||||
@TableField(value = "file_path")
|
||||
private String filePath;
|
||||
|
||||
/**
|
||||
* 状态(0:删除 1:正常)
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private String status;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.njcn.csdevice.pojo.vo;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/7/5 15:09【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class DevCountVO {
|
||||
@ApiModelProperty(value = "设备总数")
|
||||
private String id;
|
||||
@ApiModelProperty(value = "设备总数")
|
||||
private Integer allDevCount;
|
||||
@ApiModelProperty(value = "在线设备数")
|
||||
private Integer onLineCount;
|
||||
@ApiModelProperty(value = "离线设备数")
|
||||
private Integer offLineCount;
|
||||
@ApiModelProperty(value = "报警设备数")
|
||||
private Integer alarmLineCount;
|
||||
@ApiModelProperty(value = "设备报警事件数")
|
||||
private Integer alarmEventCount;
|
||||
@ApiModelProperty(value = "稳态/暂态发生事件数")
|
||||
private Integer eventCount;
|
||||
@ApiModelProperty(value = "项目数")
|
||||
private Integer projectCount;
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -89,6 +89,12 @@
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.8.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.njcn</groupId>
|
||||
<artifactId>cs-warn-api</artifactId>
|
||||
<version>1.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.common.utils.HttpResultUtil;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentTransferAddParm;
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||
import com.njcn.csdevice.service.CsDeviceUserPOService;
|
||||
import com.njcn.csdevice.service.CsEquipmentTransferPOService;
|
||||
import com.njcn.web.controller.BaseController;
|
||||
@@ -64,5 +65,22 @@ public class DeviceUserController extends BaseController {
|
||||
csDeviceUserPOService.saveBatch(list);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
/**
|
||||
* @Description: 统计当前工程下的设备
|
||||
* @Param:
|
||||
* @return: com.njcn.common.pojo.response.HttpResult<java.lang.Boolean>
|
||||
* @Author: clam
|
||||
* @Date: 2023/7/5
|
||||
*/
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/devCount")
|
||||
@ApiOperation("设备统计")
|
||||
@ApiImplicitParam(name = "id", value = "工程id", required = true)
|
||||
public HttpResult<DevCountVO> devCount(@RequestParam("id") String id){
|
||||
String methodDescribe = getMethodDescribe("devCount");
|
||||
|
||||
DevCountVO result = csDeviceUserPOService.devCount (id);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -116,11 +116,11 @@ public class EquipmentDeliveryController extends BaseController {
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
}
|
||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||
@PostMapping("/queryProjectById")
|
||||
@PostMapping("/queryEquipmentById")
|
||||
@ApiOperation("设备查询通过id获取")
|
||||
@ApiImplicitParam(name = "ids", value = "设备id集合", required = true)
|
||||
public HttpResult<List<CsEquipmentDeliveryPO>> queryDeviceById(@RequestParam List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("queryDeviceById");
|
||||
public HttpResult<List<CsEquipmentDeliveryPO>> queryEquipmentById(@RequestParam List<String> ids){
|
||||
String methodDescribe = getMethodDescribe("queryEquipmentById");
|
||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryService.listByIds(ids);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEquipmentDeliveryPOS, methodDescribe);
|
||||
}
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentAlarmPO;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/16 16:25【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsEquipmentAlarmPOMapper extends BaseMapper<CsEquipmentAlarmPO> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsLineTopologyTemplate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/7/10 18:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsLineTopologyTemplateMapper extends BaseMapper<CsLineTopologyTemplate> {
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.njcn.csdevice.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsTopologyDiagramTemplate;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/7/10 18:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsTopologyDiagramTemplateMapper extends BaseMapper<CsTopologyDiagramTemplate> {
|
||||
}
|
||||
@@ -1,25 +0,0 @@
|
||||
<?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">
|
||||
<mapper namespace="com.njcn.csdevice.mapper.CsEquipmentAlarmPOMapper">
|
||||
<resultMap id="BaseResultMap" type="com.njcn.csdevice.pojo.po.CsEquipmentAlarmPO">
|
||||
<!--@mbg.generated-->
|
||||
<!--@Table cs_equipment_alarm-->
|
||||
<id column="id" jdbcType="VARCHAR" property="id" />
|
||||
<result column="project_id" jdbcType="VARCHAR" property="projectId" />
|
||||
<result column="equipment_id" jdbcType="VARCHAR" property="equipmentId" />
|
||||
<result column="alarm_msg" jdbcType="VARCHAR" property="alarmMsg" />
|
||||
<result column="alarm_level" jdbcType="VARCHAR" property="alarmLevel" />
|
||||
<result column="start_time" jdbcType="TIMESTAMP" property="startTime" />
|
||||
<result column="end_time" jdbcType="TIMESTAMP" property="endTime" />
|
||||
<result column="status" jdbcType="BIT" property="status" />
|
||||
<result column="create_by" jdbcType="VARCHAR" property="createBy" />
|
||||
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
||||
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
|
||||
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
|
||||
</resultMap>
|
||||
<sql id="Base_Column_List">
|
||||
<!--@mbg.generated-->
|
||||
id, project_id, equipment_id, alarm_msg, alarm_level, start_time, end_time, `status`,
|
||||
create_by, create_time, update_by, update_time
|
||||
</sql>
|
||||
</mapper>
|
||||
@@ -2,6 +2,8 @@ package com.njcn.csdevice.service;
|
||||
|
||||
import com.njcn.csdevice.pojo.po.CsDeviceUserPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
@@ -16,4 +18,6 @@ public interface CsDeviceUserPOService extends IService<CsDeviceUserPO>{
|
||||
Boolean add(String id);
|
||||
|
||||
Boolean share(String id);
|
||||
|
||||
DevCountVO devCount(String id);
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentAlarmAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentAlarmPO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentAlarmVO;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/16 16:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsEquipmentAlarmPOService extends IService<CsEquipmentAlarmPO>{
|
||||
|
||||
/**
|
||||
* @Description: 新增设备警告
|
||||
* @Param:
|
||||
* @return: com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO
|
||||
* @Author: clam
|
||||
* @Date: 2023/5/17
|
||||
*/
|
||||
CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
|
||||
|
||||
IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.CsLineTopologyTemplate;
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/7/10 18:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsLineTopologyTemplateService extends IService<CsLineTopologyTemplate>{
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.njcn.csdevice.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.njcn.csdevice.pojo.po.CsTopologyDiagramTemplate;
|
||||
import com.njcn.csdevice.pojo.vo.CsTopologyDiagramTemplateVO;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/7/10 18:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
public interface CsTopologyDiagramTemplateService extends IService<CsTopologyDiagramTemplate>{
|
||||
|
||||
|
||||
String uploadImage(MultipartFile issuesFile);
|
||||
|
||||
List<CsTopologyDiagramTemplateVO> queryImage();
|
||||
}
|
||||
@@ -39,6 +39,9 @@ public class RoleEngineerDevService {
|
||||
public List<String> getRoleengineer(){
|
||||
String role = RequestUtil.getUserRole();
|
||||
List<String> strings = JSONArray.parseArray(role, String.class);
|
||||
if(CollectionUtils.isEmpty(strings)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
role=strings.get(0);
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
QueryWrapper<CsEngineeringUserPO> csEngineeringUserPOQueryWrapper = new QueryWrapper<> ();
|
||||
@@ -93,6 +96,9 @@ public class RoleEngineerDevService {
|
||||
public List<String> getDevice(){
|
||||
String role = RequestUtil.getUserRole();
|
||||
List<String> strings = JSONArray.parseArray(role, String.class);
|
||||
if(CollectionUtils.isEmpty(strings)){
|
||||
return new ArrayList<>();
|
||||
}
|
||||
role=strings.get(0);
|
||||
String userIndex = RequestUtil.getUserIndex();
|
||||
QueryWrapper<CsEngineeringUserPO> csEngineeringUserPOQueryWrapper = new QueryWrapper<> ();
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsDevModelPO;
|
||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||
import com.njcn.csdevice.pojo.vo.DevCountVO;
|
||||
import com.njcn.cswarn.api.CsEquipmentAlarmFeignClient;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmParm;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||
import com.njcn.web.utils.RequestUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -16,6 +24,7 @@ import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -29,7 +38,8 @@ import java.util.Objects;
|
||||
@RequiredArgsConstructor
|
||||
public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper, CsDeviceUserPO> implements CsDeviceUserPOService{
|
||||
|
||||
|
||||
private final CsLedgerMapper csLedgerMapper;
|
||||
private final CsEquipmentAlarmFeignClient csEquipmentAlarmFeignClient;
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean add(String id) {
|
||||
@@ -66,4 +76,34 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
||||
|
||||
return save;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DevCountVO devCount(String id) {
|
||||
DevCountVO devCountVO = new DevCountVO();
|
||||
QueryWrapper<CsLedger> queryWrap = new QueryWrapper<>();
|
||||
queryWrap.eq("level",1).eq("state",1).
|
||||
like("pid",id);
|
||||
Integer integer = csLedgerMapper.selectCount(queryWrap);
|
||||
CsEquipmentAlarmParm csEquipmentAlarmPageParm = new CsEquipmentAlarmParm();
|
||||
csEquipmentAlarmPageParm.setEngineerId(id);
|
||||
|
||||
//未处理的
|
||||
csEquipmentAlarmPageParm.setDealFlag("0");
|
||||
//todo 后续添加时间条件
|
||||
// csEquipmentAlarmPageParm.setStartTime();
|
||||
// csEquipmentAlarmPageParam.setEndTime();
|
||||
List<CsEquipmentAlarmVO> data = csEquipmentAlarmFeignClient.queryList(csEquipmentAlarmPageParm).getData();
|
||||
List<String> devIds = data.stream().map(CsEquipmentAlarmVO::getEquipmentId).distinct().collect(Collectors.toList());
|
||||
devCountVO.setAlarmLineCount(devIds.size());
|
||||
devCountVO.setAlarmEventCount(data.size());
|
||||
|
||||
devCountVO.setId(id);
|
||||
devCountVO.setOnLineCount(integer);
|
||||
//
|
||||
devCountVO.setEventCount(0);
|
||||
//todo重寫 offLineCount AlarmLineCount
|
||||
devCountVO.setOffLineCount(0);
|
||||
|
||||
return devCountVO;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,99 +0,0 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.alibaba.cloud.commons.lang.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.csdevice.mapper.AppProjectMapper;
|
||||
import com.njcn.csdevice.mapper.CsEquipmentAlarmPOMapper;
|
||||
import com.njcn.csdevice.mapper.CsEquipmentDeliveryMapper;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentAlarmAddParm;
|
||||
import com.njcn.csdevice.pojo.param.CsEquipmentAlarmPageParm;
|
||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentAlarmPO;
|
||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||
import com.njcn.csdevice.pojo.vo.CsEquipmentAlarmVO;
|
||||
import com.njcn.csdevice.service.CsEquipmentAlarmPOService;
|
||||
import com.njcn.system.api.DicDataFeignClient;
|
||||
import com.njcn.system.pojo.po.DictData;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/5/16 16:24【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@Slf4j
|
||||
public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmPOMapper, CsEquipmentAlarmPO> implements CsEquipmentAlarmPOService{
|
||||
|
||||
private final CsEquipmentDeliveryMapper csEquipmentDeliveryMapper;
|
||||
private final AppProjectMapper appProjectMapper;
|
||||
private final DicDataFeignClient dicDataFeignClient;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm) {
|
||||
CsEquipmentAlarmPO csEquipmentAlarmPO = new CsEquipmentAlarmPO();
|
||||
BeanUtils.copyProperties(csEquipmentAlarmAddParm,csEquipmentAlarmPO);
|
||||
csEquipmentAlarmPO.setStatus("1");
|
||||
this.save(csEquipmentAlarmPO);
|
||||
|
||||
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
|
||||
this.poToVO(csEquipmentAlarmPO, csEquipmentAlarmVO);
|
||||
|
||||
log.info("新增设备警告:{}", csEquipmentAlarmVO.toString());
|
||||
return csEquipmentAlarmVO;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
|
||||
Page<CsEquipmentAlarmVO> returnpage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
|
||||
Page<CsEquipmentAlarmPO> queryPage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
|
||||
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");
|
||||
Page<CsEquipmentAlarmPO> csEquipmentAlarmPOPage = this.getBaseMapper().selectPage(queryPage, queryWrapper);
|
||||
List<CsEquipmentAlarmVO> collect = csEquipmentAlarmPOPage.getRecords().stream().map(temp -> {
|
||||
CsEquipmentAlarmVO csEquipmentAlarmVO = new CsEquipmentAlarmVO();
|
||||
this.poToVO(temp, csEquipmentAlarmVO);
|
||||
return csEquipmentAlarmVO;
|
||||
}).collect(Collectors.toList());
|
||||
returnpage.setRecords(collect);
|
||||
returnpage.setTotal(queryPage.getTotal());
|
||||
|
||||
return returnpage;
|
||||
}
|
||||
|
||||
private void poToVO(CsEquipmentAlarmPO csEquipmentAlarmPO, CsEquipmentAlarmVO csEquipmentAlarmVO) {
|
||||
BeanUtils.copyProperties(csEquipmentAlarmPO,csEquipmentAlarmVO);
|
||||
CsEquipmentDeliveryPO csEquipmentDeliveryPO = csEquipmentDeliveryMapper.selectById(csEquipmentAlarmPO.getEquipmentId());
|
||||
csEquipmentAlarmVO.setEquipmentName(csEquipmentDeliveryPO.getName());
|
||||
DictData data = dicDataFeignClient.getDicDataById(csEquipmentAlarmPO.getAlarmLevel()).getData();
|
||||
csEquipmentAlarmVO.setAlarmLevelName(data.getName());
|
||||
AppProjectPO appProjectPO = appProjectMapper.selectById(csEquipmentAlarmPO.getProjectId());
|
||||
csEquipmentAlarmVO.setProjectName(appProjectPO.getName());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.csdevice.mapper.CsLineTopologyTemplateMapper;
|
||||
import com.njcn.csdevice.pojo.po.CsLineTopologyTemplate;
|
||||
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/7/10 18:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
public class CsLineTopologyTemplateServiceImpl extends ServiceImpl<CsLineTopologyTemplateMapper, CsLineTopologyTemplate> implements CsLineTopologyTemplateService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
package com.njcn.csdevice.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.csdevice.constant.DataParam;
|
||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||
import com.njcn.csdevice.mapper.CsTopologyDiagramTemplateMapper;
|
||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
||||
import com.njcn.csdevice.pojo.po.AppTopologyDiagramPO;
|
||||
import com.njcn.csdevice.pojo.po.CsTopologyDiagramTemplate;
|
||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||
import com.njcn.csdevice.pojo.vo.CsTopologyDiagramTemplateVO;
|
||||
import com.njcn.csdevice.service.CsTopologyDiagramTemplateService;
|
||||
import com.njcn.oss.constant.OssPath;
|
||||
import com.njcn.oss.utils.FileStorageUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
*
|
||||
* Description:
|
||||
* Date: 2023/7/10 18:30【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class CsTopologyDiagramTemplateServiceImpl extends ServiceImpl<CsTopologyDiagramTemplateMapper, CsTopologyDiagramTemplate> implements CsTopologyDiagramTemplateService {
|
||||
|
||||
private final FileStorageUtil fileStorageUtil;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = {Exception.class})
|
||||
public String uploadImage(MultipartFile issuesFile) {
|
||||
CsTopologyDiagramTemplate csTopologyDiagramTemplate = new CsTopologyDiagramTemplate();
|
||||
|
||||
if (issuesFile.getSize() > DataParam.FILE_SIZE) {
|
||||
throw new BusinessException(AlgorithmResponseEnum.FILE_SIZE_ERROR);
|
||||
}
|
||||
String filePath = fileStorageUtil.uploadMultipart(issuesFile, OssPath.TOPOLOGY);
|
||||
csTopologyDiagramTemplate.setFilePath(filePath);
|
||||
csTopologyDiagramTemplate.setName(issuesFile.getOriginalFilename());
|
||||
csTopologyDiagramTemplate.setStatus("1");
|
||||
boolean save = this.save(csTopologyDiagramTemplate);
|
||||
AppTopologyDiagramVO vo = new AppTopologyDiagramVO();
|
||||
String fileUrl = fileStorageUtil.getFileUrl(filePath);
|
||||
return fileUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CsTopologyDiagramTemplateVO> queryImage() {
|
||||
List<CsTopologyDiagramTemplate> list = this.list(null);
|
||||
|
||||
List<CsTopologyDiagramTemplateVO> collect = list.stream().map(temp -> {
|
||||
CsTopologyDiagramTemplateVO vo = new CsTopologyDiagramTemplateVO();
|
||||
BeanUtils.copyProperties(temp, vo);
|
||||
|
||||
vo.setFilePath(fileStorageUtil.getFileUrl(vo.getFilePath()));
|
||||
return vo;
|
||||
}).collect(Collectors.toList());
|
||||
return collect;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -28,6 +29,11 @@ public class CsConfigurationParm {
|
||||
|
||||
private String remark;
|
||||
|
||||
private List<String> engeeringIds;
|
||||
|
||||
|
||||
private Integer orderBy;
|
||||
|
||||
private String fileContent;
|
||||
|
||||
|
||||
|
||||
@@ -36,6 +36,11 @@ public class CsConfigurationPO extends BaseEntity {
|
||||
|
||||
@TableField(value = "remark")
|
||||
private String remark;
|
||||
@TableField(value = "engeering_ids")
|
||||
private String engeeringIds;
|
||||
|
||||
@TableField(value = "order_By")
|
||||
private Integer orderBy;
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,8 @@ import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/31 10:35【需求编号】
|
||||
@@ -27,6 +29,11 @@ public class CsConfigurationVO extends BaseEntity {
|
||||
|
||||
private String fileContent;
|
||||
|
||||
private Integer orderBy;
|
||||
|
||||
|
||||
private List<String> engeeringIds;
|
||||
|
||||
|
||||
@ApiModelProperty(value = "操作人")
|
||||
private String operater;
|
||||
|
||||
@@ -29,6 +29,9 @@ public class CsPageVO {
|
||||
*/
|
||||
@ApiModelProperty(value="组态项目id")
|
||||
private String pid;
|
||||
|
||||
@ApiModelProperty(value="前端使用")
|
||||
private String kid;
|
||||
@ApiModelProperty(value="组态项目名称")
|
||||
private String configurationName;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
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.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.utils.NjcnBeanUtil;
|
||||
import com.njcn.csharmonic.constant.HarmonicConstant;
|
||||
import com.njcn.csharmonic.mapper.CsConfigurationMapper;
|
||||
@@ -28,10 +29,7 @@ import java.io.ByteArrayInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -54,6 +52,16 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
||||
public boolean add(CsConfigurationParm csConfigurationParm) {
|
||||
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||
BeanUtils.copyProperties(csConfigurationParm,csConfigurationPO);
|
||||
|
||||
List<String> engeeringIds = csConfigurationParm.getEngeeringIds();
|
||||
if(CollectionUtils.isEmpty(engeeringIds)){
|
||||
throw new BusinessException("请选择工程");
|
||||
}
|
||||
String engeerings = String.join(",", engeeringIds);
|
||||
|
||||
csConfigurationPO.setEngeeringIds(engeerings);
|
||||
//排序不填给个100往后排
|
||||
csConfigurationPO.setOrderBy(csConfigurationParm.getOrderBy()==0?100:csConfigurationParm.getOrderBy());
|
||||
csConfigurationPO.setImagePath(csConfigurationParm.getFileContent());
|
||||
|
||||
csConfigurationPO.setStatus("1");
|
||||
@@ -64,7 +72,21 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
||||
@Override
|
||||
public boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm) {
|
||||
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||
NjcnBeanUtil.copyPropertiesIgnoreCase(auditParm,csConfigurationPO);
|
||||
if(Objects.equals(auditParm.getStatus(),"0")){
|
||||
csConfigurationPO.setId(auditParm.getId());
|
||||
csConfigurationPO.setStatus("0");
|
||||
boolean b = this.updateById(csConfigurationPO);
|
||||
return b;
|
||||
}
|
||||
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
||||
List<String> engeeringIds = auditParm.getEngeeringIds();
|
||||
if(CollectionUtils.isEmpty(engeeringIds)){
|
||||
throw new BusinessException("请选择工程");
|
||||
}
|
||||
String engeerings = String.join(",", engeeringIds);
|
||||
|
||||
csConfigurationPO.setEngeeringIds(engeerings);
|
||||
csConfigurationPO.setOrderBy(auditParm.getOrderBy()==0?100:auditParm.getOrderBy());
|
||||
if(!Objects.isNull(auditParm.getFileContent())){
|
||||
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(auditParm.getFileContent()), HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
|
||||
csConfigurationPO.setImagePath(s);
|
||||
@@ -79,14 +101,13 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
||||
public IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam) {
|
||||
Page<CsConfigurationVO> returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||
Page<CsConfigurationPO> temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||
String deptIndex = RequestUtil.getDeptIndex();
|
||||
|
||||
|
||||
QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
|
||||
query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
|
||||
le (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchEndTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchEndTime ( )).
|
||||
ge (StringUtils.isNotBlank (csConfigurationQueryParam.getSearchBeginTime()), CsConfigurationPO.COL_CREATE_TIME, csConfigurationQueryParam.getSearchBeginTime ( )).
|
||||
eq ("status",1).orderByDesc(CsConfigurationPO.COL_CREATE_TIME);
|
||||
eq ("status",1).orderByAsc("order_by").orderByDesc(CsConfigurationPO.COL_CREATE_TIME);
|
||||
Page<CsConfigurationPO> csConfigurationPOPage = this.getBaseMapper().selectPage(temppage, query);
|
||||
List<String> collect1 = csConfigurationPOPage.getRecords().stream().map(CsConfigurationPO::getCreateBy).collect(Collectors.toList());
|
||||
Map<String, String> collect2;
|
||||
@@ -101,6 +122,13 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
||||
List<CsConfigurationVO> collect = csConfigurationPOPage.getRecords().stream().map(page -> {
|
||||
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
|
||||
BeanUtils.copyProperties(page, csDevModelPageVO);
|
||||
|
||||
if(StringUtils.isEmpty(page.getEngeeringIds())){
|
||||
csDevModelPageVO.setEngeeringIds(new ArrayList<>());
|
||||
}else {
|
||||
csDevModelPageVO.setEngeeringIds( Arrays.asList(page.getEngeeringIds().split(",")));
|
||||
|
||||
}
|
||||
if(Objects.isNull(page.getImagePath())){
|
||||
csDevModelPageVO.setFileContent(null);
|
||||
|
||||
|
||||
@@ -128,6 +128,7 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
|
||||
CsPageVO csPageVO = new CsPageVO();
|
||||
CsConfigurationPO csConfigurationPO = csConfigurationMapper.selectById(temp.getPid());
|
||||
BeanUtils.copyProperties(temp, csPageVO);
|
||||
csPageVO.setKid(temp.getKId());
|
||||
csPageVO.setConfigurationName(csConfigurationPO.getName());
|
||||
InputStream fileStream = fileStorageUtil.getFileStream(temp.getPath());
|
||||
String text = new BufferedReader(
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.njcn.cswarn.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||
import com.njcn.common.pojo.constant.ServerInfo;
|
||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.cswarn.api.fallback.CsEquipmentAlarmClientFallbackFactory;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmParm;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.cloud.openfeign.FeignClient;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@FeignClient(value = ServerInfo.CS_WARN_BOOT, path = "/EquipmentAlarm", fallbackFactory = CsEquipmentAlarmClientFallbackFactory.class,contextId = "equipmentalarm")
|
||||
public interface CsEquipmentAlarmFeignClient {
|
||||
|
||||
|
||||
@PostMapping("/queryList")
|
||||
HttpResult<List<CsEquipmentAlarmVO>> queryList(@RequestBody CsEquipmentAlarmParm csEquipmentAlarmParm);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.njcn.cswarn.api.fallback;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.common.pojo.response.HttpResult;
|
||||
import com.njcn.cswarn.api.CsEquipmentAlarmFeignClient;
|
||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmParm;
|
||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||
import feign.hystrix.FallbackFactory;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author xy
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class CsEquipmentAlarmClientFallbackFactory implements FallbackFactory<CsEquipmentAlarmFeignClient> {
|
||||
@Override
|
||||
public CsEquipmentAlarmFeignClient create(Throwable cause) {
|
||||
//判断抛出异常是否为解码器抛出的业务异常
|
||||
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
|
||||
if (cause.getCause() instanceof BusinessException) {
|
||||
BusinessException businessException = (BusinessException) cause.getCause();
|
||||
}
|
||||
Enum<?> finalExceptionEnum = exceptionEnum;
|
||||
return new CsEquipmentAlarmFeignClient() {
|
||||
|
||||
@Override
|
||||
public HttpResult<List<CsEquipmentAlarmVO>> queryList(CsEquipmentAlarmParm csEquipmentAlarmParm) {
|
||||
log.error("{}异常,降级处理,异常为:{}","查询设备警告接口异常",cause.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,17 @@
|
||||
package com.njcn.cswarn.pojo.parm;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.common.pojo.constant.PatternRegex;
|
||||
import com.njcn.web.constant.ValidMessage;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
@@ -17,16 +22,12 @@ import java.time.LocalDateTime;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CsEquipmentAlarmPageParm {
|
||||
@NotNull(message="当前页不能为空!")
|
||||
@Min(value = 1, message = "当前页不能为0")
|
||||
@ApiModelProperty(value = "当前页",name = "pageNum",dataType ="Integer",required = true)
|
||||
private Integer pageNum;
|
||||
/**显示条数*/
|
||||
@NotNull(message="显示条数不能为空!")
|
||||
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
|
||||
private Integer pageSize;
|
||||
public class CsEquipmentAlarmParm {
|
||||
|
||||
|
||||
|
||||
@ApiModelProperty(value = "工程id")
|
||||
private String engineerId;
|
||||
/**
|
||||
* 项目Id
|
||||
*/
|
||||
@@ -46,6 +47,9 @@ public class CsEquipmentAlarmPageParm {
|
||||
@ApiModelProperty(value = "告警级别")
|
||||
private String alarmLevel;
|
||||
|
||||
@ApiModelProperty(value = "处理状态")
|
||||
private String dealFlag;
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@@ -62,5 +66,18 @@ public class CsEquipmentAlarmPageParm {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CsEquipmentAlarmPageParm extends CsEquipmentAlarmParm {
|
||||
@NotNull(message="当前页不能为空!")
|
||||
@Min(value = 1, message = "当前页不能为0")
|
||||
@ApiModelProperty(value = "当前页",name = "pageNum",dataType ="Integer",required = true)
|
||||
private Integer pageNum;
|
||||
/**显示条数*/
|
||||
@NotNull(message="显示条数不能为空!")
|
||||
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -3,11 +3,17 @@ package com.njcn.cswarn.pojo.parm;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.w3c.dom.stylesheets.LinkStyle;
|
||||
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
@@ -17,15 +23,11 @@ import java.time.LocalDateTime;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CsEventDetailPageParm {
|
||||
@NotNull(message="当前页不能为空!")
|
||||
@Min(value = 1, message = "当前页不能为0")
|
||||
@ApiModelProperty(value = "当前页",name = "pageNum",dataType ="Integer",required = true)
|
||||
private Integer pageNum;
|
||||
/**显示条数*/
|
||||
@NotNull(message="显示条数不能为空!")
|
||||
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
|
||||
private Integer pageSize;
|
||||
public class CsEventDetailParm {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "工程id")
|
||||
private String engineerId;
|
||||
|
||||
/**
|
||||
* 项目Id
|
||||
@@ -33,6 +35,13 @@ public class CsEventDetailPageParm {
|
||||
@ApiModelProperty(value = "项目Id")
|
||||
private String projectId;
|
||||
|
||||
@ApiModelProperty(value = "设备id")
|
||||
private String devId;
|
||||
|
||||
@ApiModelProperty(value = "监测点id")
|
||||
private String lineId;
|
||||
|
||||
|
||||
/**
|
||||
* 开始时间
|
||||
*/
|
||||
@@ -49,6 +58,17 @@ public class CsEventDetailPageParm {
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private LocalDateTime endTime;
|
||||
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public static class CsEventDetailPageParm extends CsEventDetailParm {
|
||||
@NotNull(message="当前页不能为空!")
|
||||
@Min(value = 1, message = "当前页不能为0")
|
||||
@ApiModelProperty(value = "当前页",name = "pageNum",dataType ="Integer",required = true)
|
||||
private Integer pageNum;
|
||||
/**显示条数*/
|
||||
@NotNull(message="显示条数不能为空!")
|
||||
@ApiModelProperty(value = "显示条数",name = "pageSize",dataType ="Integer",required = true)
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -68,7 +68,11 @@ public class CsEquipmentAlarmPO extends BaseEntity {
|
||||
*/
|
||||
@TableField(value = "`status`")
|
||||
private String status;
|
||||
|
||||
/*
|
||||
* 处理状态(0:已处理 1:未处理)
|
||||
* */
|
||||
@TableField(value = "deal_flag")
|
||||
private String dealFlag;
|
||||
|
||||
|
||||
public static final String COL_ID = "id";
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.njcn.cswarn.pojo.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.njcn.db.bo.BaseEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Date: 2023/5/16 16:25【需求编号】
|
||||
*
|
||||
* @author clam
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
public class CsEquipmentAlarmCountVO extends BaseEntity {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "报警设备数")
|
||||
private Integer alarmDevCount;
|
||||
private List<AlarmDevice> devDetail;
|
||||
@Data
|
||||
public static class AlarmDevice{
|
||||
private String devId;
|
||||
private String devName;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import java.time.LocalDateTime;
|
||||
* @version V1.0.0
|
||||
*/
|
||||
@Data
|
||||
@TableName(value = "cs_equipment_alarm")
|
||||
public class CsEquipmentAlarmVO extends BaseEntity {
|
||||
/**
|
||||
* id
|
||||
|
||||
@@ -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