提交代码
This commit is contained in:
@@ -35,6 +35,12 @@
|
|||||||
<artifactId>common-microservice</artifactId>
|
<artifactId>common-microservice</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>cs-warn-api</artifactId>
|
||||||
|
<version>1.0.0</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
<properties>
|
<properties>
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
|||||||
@@ -28,5 +28,7 @@ public interface RoleEngineerDevFeignClient {
|
|||||||
|
|
||||||
@PostMapping("/getDevice")
|
@PostMapping("/getDevice")
|
||||||
public HttpResult<List<String>> getDevice();
|
public HttpResult<List<String>> getDevice();
|
||||||
|
@PostMapping("/getRoleproject")
|
||||||
|
public HttpResult<List<String>> getRoleProject();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ public class RoleEngineerDevClientFallbackFactory implements FallbackFactory<Rol
|
|||||||
log.error("{}异常,降级处理,异常为:{}","查询角色设备异常",cause.toString());
|
log.error("{}异常,降级处理,异常为:{}","查询角色设备异常",cause.toString());
|
||||||
throw new BusinessException(finalExceptionEnum);
|
throw new BusinessException(finalExceptionEnum);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public HttpResult<List<String>> getRoleProject() {
|
||||||
|
log.error("{}异常,降级处理,异常为:{}","查询角色项目异常",cause.toString());
|
||||||
|
throw new BusinessException(finalExceptionEnum);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
@@ -50,7 +51,9 @@ public class AppProjectAddParm {
|
|||||||
private BigDecimal lat;
|
private BigDecimal lat;
|
||||||
|
|
||||||
@ApiModelProperty(value = "拓扑图文件")
|
@ApiModelProperty(value = "拓扑图文件")
|
||||||
@NotNull(message="拓扑图文件不能为空!")
|
|
||||||
private MultipartFile[] files;
|
private MultipartFile[] files;
|
||||||
|
|
||||||
|
@ApiModelProperty(value="拓扑图模版id集合")
|
||||||
|
private List<String> topoIds;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,8 +42,7 @@ public class AppTopologyDiagramAddParm {
|
|||||||
@ApiModelProperty(value = "拓扑图文件")
|
@ApiModelProperty(value = "拓扑图文件")
|
||||||
private MultipartFile file;
|
private MultipartFile file;
|
||||||
|
|
||||||
@ApiModelProperty(value = "拓扑图模板")
|
|
||||||
private String topoId;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,58 @@
|
|||||||
|
package com.njcn.csdevice.pojo.param;
|
||||||
|
|
||||||
|
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 java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Date: 2023/5/18 14:01【需求编号】
|
||||||
|
*
|
||||||
|
* @author clam
|
||||||
|
* @version V1.0.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
public class CsLineParm {
|
||||||
|
|
||||||
|
private String topoId;
|
||||||
|
private String projectId;
|
||||||
|
|
||||||
|
private String devId;
|
||||||
|
/**
|
||||||
|
* 监测点名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 字典表:安装位置(负载侧,电网侧, 输出侧)
|
||||||
|
*/
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 电压等级
|
||||||
|
*/
|
||||||
|
private String volGrade;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PT变比
|
||||||
|
*/
|
||||||
|
private BigDecimal ptRatio;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* CT变比
|
||||||
|
*/
|
||||||
|
private BigDecimal ctRatio;
|
||||||
|
|
||||||
|
private Double lat;
|
||||||
|
private Double lng;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -33,6 +33,11 @@ public class AppTopologyDiagramPO extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
@TableField(value = "name")
|
@TableField(value = "name")
|
||||||
private String name;
|
private String name;
|
||||||
|
/**
|
||||||
|
* 拓扑图模板Id
|
||||||
|
*/
|
||||||
|
@TableField(value = "topo_id")
|
||||||
|
private String topoId;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
package com.njcn.csdevice.pojo.vo;
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
||||||
import com.njcn.db.bo.BaseEntity;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -29,6 +32,9 @@ public class AppTopologyDiagramVO extends BaseEntity {
|
|||||||
@ApiModelProperty(value = "拓扑图名称")
|
@ApiModelProperty(value = "拓扑图名称")
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "拓扑图模板名称")
|
||||||
|
private String topoId;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,5 +58,9 @@ public class AppTopologyDiagramVO extends BaseEntity {
|
|||||||
@ApiModelProperty(value = "status")
|
@ApiModelProperty(value = "status")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
private List<CsLineTopologyTemplateVO> csLineTopologyTemplateVOList;
|
||||||
|
|
||||||
|
private List<AppLineTopologyDiagramPO> appsLineTopologyDiagramPO;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,12 @@
|
|||||||
package com.njcn.csdevice.pojo.vo;
|
package com.njcn.csdevice.pojo.vo;
|
||||||
|
|
||||||
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
|
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
* Date: 2023/7/5 15:09【需求编号】
|
* Date: 2023/7/5 15:09【需求编号】
|
||||||
@@ -13,16 +17,22 @@ import lombok.Data;
|
|||||||
|
|
||||||
@Data
|
@Data
|
||||||
public class DevCountVO {
|
public class DevCountVO {
|
||||||
@ApiModelProperty(value = "设备总数")
|
@ApiModelProperty(value = "工程id")
|
||||||
private String id;
|
private String id;
|
||||||
@ApiModelProperty(value = "设备总数")
|
@ApiModelProperty(value = "设备总数")
|
||||||
private Integer allDevCount;
|
private Integer allDevCount;
|
||||||
|
private List<CsEquipmentDeliveryPO> allDevs;
|
||||||
@ApiModelProperty(value = "在线设备数")
|
@ApiModelProperty(value = "在线设备数")
|
||||||
private Integer onLineCount;
|
private Integer onLineCount;
|
||||||
|
private List<CsEquipmentDeliveryPO> onLineDevs;
|
||||||
|
|
||||||
@ApiModelProperty(value = "离线设备数")
|
@ApiModelProperty(value = "离线设备数")
|
||||||
private Integer offLineCount;
|
private Integer offLineCount;
|
||||||
|
private List<CsEquipmentDeliveryPO> offLineDevs;
|
||||||
@ApiModelProperty(value = "报警设备数")
|
@ApiModelProperty(value = "报警设备数")
|
||||||
private Integer alarmLineCount;
|
private Integer alarmLineCount;
|
||||||
|
private List<CsEquipmentAlarmVO> alarmLineDevs;
|
||||||
|
|
||||||
@ApiModelProperty(value = "设备报警事件数")
|
@ApiModelProperty(value = "设备报警事件数")
|
||||||
private Integer alarmEventCount;
|
private Integer alarmEventCount;
|
||||||
@ApiModelProperty(value = "稳态/暂态发生事件数")
|
@ApiModelProperty(value = "稳态/暂态发生事件数")
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsLineParm;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
import com.njcn.csdevice.service.CsLinePOService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -35,7 +36,7 @@ public class CslineController extends BaseController {
|
|||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryLineById")
|
@PostMapping("/queryLineById")
|
||||||
@ApiOperation("监测点查询通过设备id获取")
|
@ApiOperation("监测点查询通过id获取")
|
||||||
@ApiImplicitParam(name = "ids", value = "设备id获集合", required = true)
|
@ApiImplicitParam(name = "ids", value = "设备id获集合", required = true)
|
||||||
public HttpResult<List<CsLinePO>> queryLineById(@RequestParam List<String> ids){
|
public HttpResult<List<CsLinePO>> queryLineById(@RequestParam List<String> ids){
|
||||||
String methodDescribe = getMethodDescribe("queryLineById");
|
String methodDescribe = getMethodDescribe("queryLineById");
|
||||||
@@ -62,4 +63,15 @@ public class CslineController extends BaseController {
|
|||||||
csLinePOService.saveBatch(list);
|
csLinePOService.saveBatch(list);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// @OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
// @PostMapping("/addLineList")
|
||||||
|
// @ApiOperation("批量新增监测点及绑定关系")
|
||||||
|
// @ApiImplicitParam(name = "list", value = "监测点数据集", required = true)
|
||||||
|
// public HttpResult<String> addLines(@RequestBody List<CsLineParm> list){
|
||||||
|
// String methodDescribe = getMethodDescribe("addLines");
|
||||||
|
// csLinePOService.addLines(list);
|
||||||
|
// return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.pojo.param.CsLineTopologyTemplateParm;
|
import com.njcn.csdevice.pojo.param.CsLineTopologyTemplateParm;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
||||||
import com.njcn.csdevice.pojo.vo.CsTopologyDiagramTemplateVO;
|
import com.njcn.csdevice.pojo.vo.CsTopologyDiagramTemplateVO;
|
||||||
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -42,4 +43,14 @@ public class CsLineTopologyTemplateController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,flag, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,flag, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.UPLOAD)
|
||||||
|
@PostMapping("/queryByTopoId")
|
||||||
|
@ApiOperation("根据拓扑图id查询监测点位置")
|
||||||
|
public HttpResult<List<CsLineTopologyTemplateVO>> queryByTopoId(@RequestParam("topoId") String topoId){
|
||||||
|
String methodDescribe = getMethodDescribe("queryByTopoId");
|
||||||
|
List<CsLineTopologyTemplateVO> csLineTopologyTemplateVOS = csLineTopologyTemplateService.queryByTopoId(topoId);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS,csLineTopologyTemplateVOS, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,6 +52,16 @@ public class RoleEngineerDevController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, roleengineer, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, roleengineer, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/getRoleproject")
|
||||||
|
@ApiOperation("角色项目查询")
|
||||||
|
public HttpResult<List<String>> getRoleProject(){
|
||||||
|
String methodDescribe = getMethodDescribe("getRoleProject");
|
||||||
|
|
||||||
|
List<String> roleProject = roleEngineerDevService.getRoleProject();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, roleProject, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/getDevice")
|
@PostMapping("/getDevice")
|
||||||
@ApiOperation("角色设备查询")
|
@ApiOperation("角色设备查询")
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package com.njcn.csdevice.service;
|
|||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
||||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -17,4 +20,6 @@ public interface AppLineTopologyDiagramService extends IService<AppLineTopologyD
|
|||||||
|
|
||||||
|
|
||||||
AppTopologyDiagramVO query(String devId);
|
AppTopologyDiagramVO query(String devId);
|
||||||
}
|
|
||||||
|
List<AppLineTopologyDiagramPO> queryByTopoId(String id);
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.csdevice.service;
|
package com.njcn.csdevice.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsLineParm;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -26,4 +27,5 @@ public interface CsLinePOService extends IService<CsLinePO>{
|
|||||||
List<CsLinePO> queryByDevId(String devId);
|
List<CsLinePO> queryByDevId(String devId);
|
||||||
|
|
||||||
|
|
||||||
}
|
// void addLines(List<CsLineParm> list);
|
||||||
|
}
|
||||||
|
|||||||
@@ -12,4 +12,6 @@ import java.util.List;
|
|||||||
public interface RoleEngineerDevService {
|
public interface RoleEngineerDevService {
|
||||||
List<String> getRoleengineer();
|
List<String> getRoleengineer();
|
||||||
List<String> getDevice();
|
List<String> getDevice();
|
||||||
|
|
||||||
|
List<String> getRoleProject();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import com.njcn.csdevice.pojo.param.AppTopologyDiagramQueryParm;
|
|||||||
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
||||||
import com.njcn.csdevice.service.AppLineTopologyDiagramService;
|
import com.njcn.csdevice.service.AppLineTopologyDiagramService;
|
||||||
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
import com.njcn.csdevice.service.CsLinePOService;
|
||||||
@@ -49,6 +50,13 @@ public class AppLineTopologyDiagramServiceImpl extends ServiceImpl<AppLineTopolo
|
|||||||
throw new BusinessException("设备下未找到拓扑图信息");
|
throw new BusinessException("设备下未找到拓扑图信息");
|
||||||
}
|
}
|
||||||
AppTopologyDiagramVO appTopologyDiagramVO = appTopologyDiagramVOS.get(0);
|
AppTopologyDiagramVO appTopologyDiagramVO = appTopologyDiagramVOS.get(0);
|
||||||
|
appTopologyDiagramVO.setAppsLineTopologyDiagramPO(this.queryByTopoId(appTopologyDiagramVO.getId()));
|
||||||
return appTopologyDiagramVO;
|
return appTopologyDiagramVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AppLineTopologyDiagramPO> queryByTopoId(String id) {
|
||||||
|
List<AppLineTopologyDiagramPO> list = this.lambdaQuery().eq(AppLineTopologyDiagramPO::getId, id).list();
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,18 +10,22 @@ import com.njcn.common.pojo.exception.BusinessException;
|
|||||||
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
import com.njcn.csdevice.enums.AlgorithmResponseEnum;
|
||||||
import com.njcn.csdevice.mapper.AppProjectMapper;
|
import com.njcn.csdevice.mapper.AppProjectMapper;
|
||||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||||
|
import com.njcn.csdevice.mapper.CsTopologyDiagramTemplateMapper;
|
||||||
import com.njcn.csdevice.pojo.param.*;
|
import com.njcn.csdevice.pojo.param.*;
|
||||||
import com.njcn.csdevice.pojo.po.AppProjectPO;
|
import com.njcn.csdevice.pojo.po.*;
|
||||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
|
||||||
import com.njcn.csdevice.pojo.vo.AppProjectVO;
|
import com.njcn.csdevice.pojo.vo.AppProjectVO;
|
||||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
||||||
import com.njcn.csdevice.service.AppProjectService;
|
import com.njcn.csdevice.service.AppProjectService;
|
||||||
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
||||||
|
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -42,7 +46,8 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
private final AppProjectMapper appProjectMapper;
|
private final AppProjectMapper appProjectMapper;
|
||||||
private final AppTopologyDiagramService appTopologyDiagramService;
|
private final AppTopologyDiagramService appTopologyDiagramService;
|
||||||
private final CsLedgerMapper csLedgerMapper;
|
private final CsLedgerMapper csLedgerMapper;
|
||||||
|
private final CsTopologyDiagramTemplateMapper csTopologyDiagramTemplateMapper;
|
||||||
|
private final CsLineTopologyTemplateService csLineTopologyDiagramTemplateService;
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean addAppProject(AppProjectAddParm appProjectAddOrAuditParm) {
|
public Boolean addAppProject(AppProjectAddParm appProjectAddOrAuditParm) {
|
||||||
@@ -58,14 +63,47 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
BeanUtils.copyProperties (appProjectAddOrAuditParm, appProjectPO);
|
BeanUtils.copyProperties (appProjectAddOrAuditParm, appProjectPO);
|
||||||
appProjectPO.setStatus ("1");
|
appProjectPO.setStatus ("1");
|
||||||
boolean save = this.save (appProjectPO);
|
boolean save = this.save (appProjectPO);
|
||||||
for (int i = 0; i < appProjectAddOrAuditParm.getFiles ( ).length; i++) {
|
//如何使用拓扑图模板则将拓扑图模板复制绑定
|
||||||
|
if(!CollectionUtils.isEmpty(appProjectAddOrAuditParm.getTopoIds()) ){
|
||||||
|
List<AppTopologyDiagramPO> appTopologyDiagramPOS = new ArrayList<>();
|
||||||
|
List<CsLineTopologyTemplate> csLineTopologyTemplates = new ArrayList<>();
|
||||||
|
appProjectAddOrAuditParm.getTopoIds().forEach(temp->{
|
||||||
|
AppTopologyDiagramPO appTopologyDiagramPO = new AppTopologyDiagramPO();
|
||||||
|
CsTopologyDiagramTemplate csTopologyDiagramTemplate = csTopologyDiagramTemplateMapper.selectById(temp);
|
||||||
|
appTopologyDiagramPO.setFilePath (csTopologyDiagramTemplate.getFilePath());
|
||||||
|
appTopologyDiagramPO.setProjectId (appProjectPO.getId());
|
||||||
|
appTopologyDiagramPO.setName (csTopologyDiagramTemplate.getName());
|
||||||
|
appTopologyDiagramPO.setStatus ("1");
|
||||||
|
appTopologyDiagramPO.setTopoId(temp);
|
||||||
|
appTopologyDiagramService.save(appTopologyDiagramPO);
|
||||||
|
|
||||||
|
//如何使用拓扑图模板生成监测点模版
|
||||||
|
// List<CsLineTopologyTemplateVO> csLineTopologyTemplateVOS = csLineTopologyDiagramTemplateService.queryByTopoId(temp);
|
||||||
|
// List<CsLineTopologyTemplate> collect = csLineTopologyTemplateVOS.stream().map(temp1 -> {
|
||||||
|
// CsLineTopologyTemplate csLineTopologyTemplate = new CsLineTopologyTemplate();
|
||||||
|
// BeanUtils.copyProperties(temp1, csLineTopologyTemplate);
|
||||||
|
// csLineTopologyTemplate.setId(null);
|
||||||
|
// csLineTopologyTemplate.setStatus("1");
|
||||||
|
// csLineTopologyTemplate.setTopoId(appTopologyDiagramPO.getId());
|
||||||
|
// return csLineTopologyTemplate;
|
||||||
|
// }).collect(Collectors.toList());
|
||||||
|
// csLineTopologyTemplates.addAll(collect);
|
||||||
|
});
|
||||||
|
csLineTopologyDiagramTemplateService.saveBatch(csLineTopologyTemplates);
|
||||||
|
|
||||||
|
|
||||||
AppTopologyDiagramAddParm appTopologyDiagramAddParm = new AppTopologyDiagramAddParm ( );
|
|
||||||
appTopologyDiagramAddParm.setProjectId (appProjectPO.getId ( ));
|
|
||||||
appTopologyDiagramAddParm.setTopologyDiagramName (appProjectAddOrAuditParm.getFiles ( )[i].getOriginalFilename ( ));
|
|
||||||
appTopologyDiagramAddParm.setFile (appProjectAddOrAuditParm.getFiles ( )[i]);
|
|
||||||
appTopologyDiagramService.addAppTopologyDiagram (appTopologyDiagramAddParm);
|
|
||||||
}
|
}
|
||||||
|
if(Objects.nonNull( appProjectAddOrAuditParm.getFiles ( ))){
|
||||||
|
for (int i = 0; i < appProjectAddOrAuditParm.getFiles ( ).length; i++) {
|
||||||
|
|
||||||
|
AppTopologyDiagramAddParm appTopologyDiagramAddParm = new AppTopologyDiagramAddParm ( );
|
||||||
|
appTopologyDiagramAddParm.setProjectId (appProjectPO.getId ( ));
|
||||||
|
appTopologyDiagramAddParm.setTopologyDiagramName (appProjectAddOrAuditParm.getFiles ( )[i].getOriginalFilename ( ));
|
||||||
|
appTopologyDiagramAddParm.setFile (appProjectAddOrAuditParm.getFiles ( )[i]);
|
||||||
|
appTopologyDiagramService.addAppTopologyDiagram (appTopologyDiagramAddParm);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
CsLedger csLedger = csLedgerMapper.selectById(appProjectAddOrAuditParm.getEngineeringId());
|
CsLedger csLedger = csLedgerMapper.selectById(appProjectAddOrAuditParm.getEngineeringId());
|
||||||
Optional.ofNullable(csLedger).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ENGINEERING_DATA_ERROR));
|
Optional.ofNullable(csLedger).orElseThrow(()-> new BusinessException(AlgorithmResponseEnum.ENGINEERING_DATA_ERROR));
|
||||||
CsLedger csLedger1 = new CsLedger();
|
CsLedger csLedger1 = new CsLedger();
|
||||||
@@ -152,6 +190,7 @@ class AppProjectServiceImpl extends ServiceImpl<AppProjectMapper, AppProjectPO>
|
|||||||
appTopologyDiagramQueryParm.setProjectId(temp.getId());
|
appTopologyDiagramQueryParm.setProjectId(temp.getId());
|
||||||
List<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryAppTopologyDiagram(appTopologyDiagramQueryParm);
|
List<AppTopologyDiagramVO> appTopologyDiagramVOList = appTopologyDiagramService.queryAppTopologyDiagram(appTopologyDiagramQueryParm);
|
||||||
temp.setTopologyDiagramPaths(appTopologyDiagramVOList);
|
temp.setTopologyDiagramPaths(appTopologyDiagramVOList);
|
||||||
|
|
||||||
return temp;
|
return temp;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
returnpage.setRecords(collect);
|
returnpage.setRecords(collect);
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import com.njcn.csdevice.pojo.po.AppTopologyDiagramPO;
|
|||||||
import com.njcn.csdevice.pojo.po.CsLineTopologyTemplate;
|
import com.njcn.csdevice.pojo.po.CsLineTopologyTemplate;
|
||||||
import com.njcn.csdevice.pojo.po.CsTopologyDiagramTemplate;
|
import com.njcn.csdevice.pojo.po.CsTopologyDiagramTemplate;
|
||||||
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
import com.njcn.csdevice.pojo.vo.AppTopologyDiagramVO;
|
||||||
|
import com.njcn.csdevice.pojo.vo.CsLineTopologyTemplateVO;
|
||||||
|
import com.njcn.csdevice.service.AppLineTopologyDiagramService;
|
||||||
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
import com.njcn.csdevice.service.AppTopologyDiagramService;
|
||||||
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
import com.njcn.csdevice.service.CsLineTopologyTemplateService;
|
||||||
import com.njcn.oss.constant.OssPath;
|
import com.njcn.oss.constant.OssPath;
|
||||||
@@ -54,19 +56,13 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
private final AppProjectMapper appServiceMapper;
|
private final AppProjectMapper appServiceMapper;
|
||||||
|
|
||||||
private final AppTopologyDiagramMapper appTopologyDiagramMapper;
|
private final AppTopologyDiagramMapper appTopologyDiagramMapper;
|
||||||
private final CsTopologyDiagramTemplateMapper csTopologyDiagramTemplateMapper;
|
|
||||||
|
private final CsLineTopologyTemplateService csLineTopologyTemplateService;
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public AppTopologyDiagramVO addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm) {
|
public AppTopologyDiagramVO addAppTopologyDiagram(AppTopologyDiagramAddParm appTopologyDiagramAddParm) {
|
||||||
AppTopologyDiagramPO appTopologyDiagramPO = new AppTopologyDiagramPO();
|
AppTopologyDiagramPO appTopologyDiagramPO = new AppTopologyDiagramPO();
|
||||||
//如何使用拓扑图模板则将拓扑图模板
|
|
||||||
if(StringUtils.isNotBlank(appTopologyDiagramAddParm.getTopoId()) ){
|
|
||||||
CsTopologyDiagramTemplate csTopologyDiagramTemplate = csTopologyDiagramTemplateMapper.selectById(appTopologyDiagramAddParm.getTopoId());
|
|
||||||
appTopologyDiagramPO.setFilePath (csTopologyDiagramTemplate.getFilePath());
|
|
||||||
appTopologyDiagramPO.setProjectId (appTopologyDiagramAddParm.getProjectId ()==null?"":appTopologyDiagramAddParm.getProjectId ());
|
|
||||||
appTopologyDiagramPO.setName (csTopologyDiagramTemplate.getName());
|
|
||||||
appTopologyDiagramPO.setStatus ("1");
|
|
||||||
}else{
|
|
||||||
MultipartFile file = appTopologyDiagramAddParm.getFile ( );
|
MultipartFile file = appTopologyDiagramAddParm.getFile ( );
|
||||||
if(file.getSize()> DataParam.FILE_SIZE){
|
if(file.getSize()> DataParam.FILE_SIZE){
|
||||||
throw new BusinessException(AlgorithmResponseEnum.FILE_SIZE_ERROR);
|
throw new BusinessException(AlgorithmResponseEnum.FILE_SIZE_ERROR);
|
||||||
@@ -77,7 +73,7 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
appTopologyDiagramPO.setName (appTopologyDiagramAddParm.getTopologyDiagramName ());
|
appTopologyDiagramPO.setName (appTopologyDiagramAddParm.getTopologyDiagramName ());
|
||||||
appTopologyDiagramPO.setStatus ("1");
|
appTopologyDiagramPO.setStatus ("1");
|
||||||
boolean save = this.save (appTopologyDiagramPO);
|
boolean save = this.save (appTopologyDiagramPO);
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
AppTopologyDiagramVO vo = new AppTopologyDiagramVO();
|
AppTopologyDiagramVO vo = new AppTopologyDiagramVO();
|
||||||
@@ -128,6 +124,8 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
AppProjectPO appProjectPO = appServiceMapper.selectById(vo.getProjectId());
|
AppProjectPO appProjectPO = appServiceMapper.selectById(vo.getProjectId());
|
||||||
vo.setProjectName(appProjectPO.getName());
|
vo.setProjectName(appProjectPO.getName());
|
||||||
vo.setFilePath (fileStorageUtil.getFileUrl (vo.getFilePath ()));
|
vo.setFilePath (fileStorageUtil.getFileUrl (vo.getFilePath ()));
|
||||||
|
List<CsLineTopologyTemplateVO> csLineTopologyTemplateVOS = csLineTopologyTemplateService.queryByTopoId(temp.getTopoId());
|
||||||
|
vo.setCsLineTopologyTemplateVOList(csLineTopologyTemplateVOS);
|
||||||
return vo;
|
return vo;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
return collect;
|
return collect;
|
||||||
@@ -154,6 +152,8 @@ public class AppTopologyDiagramServiceImpl extends ServiceImpl<AppTopologyDiagra
|
|||||||
AppProjectPO appProjectPO = appServiceMapper.selectById(vo.getProjectId());
|
AppProjectPO appProjectPO = appServiceMapper.selectById(vo.getProjectId());
|
||||||
vo.setProjectName(appProjectPO.getName());
|
vo.setProjectName(appProjectPO.getName());
|
||||||
vo.setFilePath (fileStorageUtil.getFileUrl (temp.getFilePath ( )));
|
vo.setFilePath (fileStorageUtil.getFileUrl (temp.getFilePath ( )));
|
||||||
|
List<CsLineTopologyTemplateVO> csLineTopologyTemplateVOS = csLineTopologyTemplateService.queryByTopoId(temp.getTopoId());
|
||||||
|
vo.setCsLineTopologyTemplateVOList(csLineTopologyTemplateVOS);
|
||||||
return vo;
|
return vo;
|
||||||
}).collect (Collectors.toList ( ));
|
}).collect (Collectors.toList ( ));
|
||||||
returnpage.setRecords (collect);
|
returnpage.setRecords (collect);
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.util.CollectionUtils;
|
import org.springframework.util.CollectionUtils;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@@ -87,17 +88,28 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
List<String> device = roleEngineerDevService.getDevice();
|
List<String> device = roleEngineerDevService.getDevice();
|
||||||
if(CollectionUtils.isEmpty(device)){
|
if(CollectionUtils.isEmpty(device)){
|
||||||
devCountVO.setOnLineCount(0);
|
devCountVO.setOnLineCount(0);
|
||||||
|
devCountVO.setOnLineDevs(new ArrayList<>());
|
||||||
devCountVO.setOffLineCount(0);
|
devCountVO.setOffLineCount(0);
|
||||||
|
devCountVO.setOffLineDevs(new ArrayList<>());
|
||||||
|
|
||||||
devCountVO.setAllDevCount(0);
|
devCountVO.setAllDevCount(0);
|
||||||
|
devCountVO.setAllDevs(new ArrayList<>());
|
||||||
|
|
||||||
}else {
|
}else {
|
||||||
devCountVO.setAllDevCount(device.size());
|
devCountVO.setAllDevCount(device.size());
|
||||||
|
|
||||||
QueryWrapper<CsEquipmentDeliveryPO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CsEquipmentDeliveryPO> queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.in("id",device);
|
queryWrapper.in("id",device);
|
||||||
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectList(queryWrapper);
|
List<CsEquipmentDeliveryPO> csEquipmentDeliveryPOS = csEquipmentDeliveryMapper.selectList(queryWrapper);
|
||||||
long count = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 1).count();
|
devCountVO.setAllDevs(csEquipmentDeliveryPOS);
|
||||||
long count1 = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 2).count();
|
List<CsEquipmentDeliveryPO> collect = csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 1).collect(Collectors.toList());
|
||||||
devCountVO.setOnLineCount(Integer.valueOf(count1+""));
|
List<CsEquipmentDeliveryPO> collect2= csEquipmentDeliveryPOS.stream().filter(temp -> temp.getRunStatus() == 2).collect(Collectors.toList());
|
||||||
devCountVO.setOffLineCount(Integer.valueOf(count+""));
|
devCountVO.setOnLineCount(collect.size());
|
||||||
|
devCountVO.setOnLineDevs(collect);
|
||||||
|
devCountVO.setOffLineCount(collect2.size());
|
||||||
|
devCountVO.setOffLineDevs(collect2);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -111,7 +123,7 @@ public class CsDeviceUserPOServiceImpl extends ServiceImpl<CsDeviceUserPOMapper,
|
|||||||
// csEquipmentAlarmPageParam.setEndTime();
|
// csEquipmentAlarmPageParam.setEndTime();
|
||||||
List<CsEquipmentAlarmVO> data = csEquipmentAlarmFeignClient.queryList(csEquipmentAlarmPageParm).getData();
|
List<CsEquipmentAlarmVO> data = csEquipmentAlarmFeignClient.queryList(csEquipmentAlarmPageParm).getData();
|
||||||
List<String> devIds = data.stream().map(CsEquipmentAlarmVO::getEquipmentId).distinct().collect(Collectors.toList());
|
List<String> devIds = data.stream().map(CsEquipmentAlarmVO::getEquipmentId).distinct().collect(Collectors.toList());
|
||||||
|
devCountVO.setAlarmLineDevs(data);
|
||||||
devCountVO.setAlarmEventCount(data.size());
|
devCountVO.setAlarmEventCount(data.size());
|
||||||
|
|
||||||
devCountVO.setId(id);
|
devCountVO.setId(id);
|
||||||
|
|||||||
@@ -1,14 +1,19 @@
|
|||||||
package com.njcn.csdevice.service.impl;
|
package com.njcn.csdevice.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
import com.njcn.csdevice.mapper.CsLedgerMapper;
|
||||||
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
import com.njcn.csdevice.mapper.CsLinePOMapper;
|
||||||
|
import com.njcn.csdevice.pojo.param.CsLineParm;
|
||||||
|
import com.njcn.csdevice.pojo.po.AppLineTopologyDiagramPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsLedger;
|
import com.njcn.csdevice.pojo.po.CsLedger;
|
||||||
import com.njcn.csdevice.pojo.po.CsLinePO;
|
import com.njcn.csdevice.pojo.po.CsLinePO;
|
||||||
import com.njcn.csdevice.service.CsLinePOService;
|
import com.njcn.csdevice.service.CsLinePOService;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -43,8 +48,55 @@ public class CsLinePOServiceImpl extends ServiceImpl<CsLinePOMapper, CsLinePO> i
|
|||||||
queryWrapper.eq("state",1).eq("pid",devId);
|
queryWrapper.eq("state",1).eq("pid",devId);
|
||||||
List<CsLedger> csLedgerList = csLedgerMapper.selectList(queryWrapper);
|
List<CsLedger> csLedgerList = csLedgerMapper.selectList(queryWrapper);
|
||||||
List<String> csPairList = csLedgerList.stream().map(CsLedger::getId).collect(Collectors.toList());
|
List<String> csPairList = csLedgerList.stream().map(CsLedger::getId).collect(Collectors.toList());
|
||||||
|
if(CollectionUtil.isEmpty(csPairList)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
List<CsLinePO> csLinePOS = this.listByIds(csPairList);
|
List<CsLinePO> csLinePOS = this.listByIds(csPairList);
|
||||||
csLinePOS.forEach(temp->temp.setDevId(devId));
|
csLinePOS.forEach(temp->temp.setDevId(devId));
|
||||||
return csLinePOS;
|
return csLinePOS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * 1.平台端默认配置拓扑图模板,包含拓扑图信息(cs_topology_diagram_template)和拓扑图上监测点的点位信息(cs_line_topology_template)
|
||||||
|
// *
|
||||||
|
// * 2.移动端新增项目时可以上传自己的拓扑图也可以选择拓扑图模板
|
||||||
|
// * 维护项目和拓扑图关系(cs_topology_diagram,这个表的id可以使用拓扑图模板id);
|
||||||
|
// * 用户使用拓扑图模板,则根据模板id查(cs_line_topology_template)库中有几个监测点,绑定到监测点模板关系表中(cs_line_topology_diagram);
|
||||||
|
// * 用户自己添加拓扑图,则新增拓扑图信息(cs_topology_diagram),同时记录用户在此拓扑图上的点位信息(cs_line_topology_diagram)
|
||||||
|
// *
|
||||||
|
// * 3.用户注册直连设备,根据模板信息返回监测点数量,页面选择拓扑图,根据(cs_topology_diagram)拓扑图id查询(cs_line_topology_diagram)拓扑图监测点关系表,获取监测点信息。根据位置来获取打点信息。
|
||||||
|
// * 注:cs_line_topology_diagram这个表还需要加个位置字段,不然无法根据位置来匹配对应的监测点
|
||||||
|
// *
|
||||||
|
// * 4.保存之后要在这些表中同步数据(cs_line、cs_ledger)
|
||||||
|
// *
|
||||||
|
// * @param list
|
||||||
|
// */
|
||||||
|
// @Override
|
||||||
|
// @Transactional(rollbackFor = Exception.class)
|
||||||
|
// public void addLines(List<CsLineParm> list) {
|
||||||
|
// List<CsLedger> csLedgerLis = new ArrayList<>();
|
||||||
|
// list.stream().forEach(temp->{
|
||||||
|
// CsLinePO csLinePO = new CsLinePO();
|
||||||
|
// BeanUtils.copyProperties(temp,csLinePO);
|
||||||
|
// this.save(csLinePO);
|
||||||
|
// String lineId = csLinePO.getLineId();
|
||||||
|
// CsLedger csLedger = new CsLedger();
|
||||||
|
//
|
||||||
|
// csLedger.setId(lineId);
|
||||||
|
// csLedger.setPid(temp.getDevId());
|
||||||
|
// csLedger.setLevel(3);
|
||||||
|
// csLedger.setSort(1);
|
||||||
|
// csLedger.setState(1);
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// AppLineTopologyDiagramPO appLineTopologyDiagramPO = new AppLineTopologyDiagramPO();
|
||||||
|
// appLineTopologyDiagramPO.setId(temp.getTopoId());
|
||||||
|
// appLineTopologyDiagramPO.setStatus("1");
|
||||||
|
// appLineTopologyDiagramPO.setLineId(lineId);
|
||||||
|
// appLineTopologyDiagramPO.setLat(temp.getLat());
|
||||||
|
// appLineTopologyDiagramPO.setLng(temp.getLng());
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
//
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,6 +138,21 @@ public class RoleEngineerDevServiceImpl implements RoleEngineerDevService {
|
|||||||
return collect;
|
return collect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<String> getRoleProject() {
|
||||||
|
List<String> roleengineer = this.getRoleengineer();
|
||||||
|
if(CollectionUtils.isEmpty(roleengineer)){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
QueryWrapper<CsLedger> csLedgerQueryWrapper = new QueryWrapper<>();
|
||||||
|
csLedgerQueryWrapper.clear();
|
||||||
|
csLedgerQueryWrapper.eq("level",1).eq("state",1).in("pid",roleengineer);
|
||||||
|
List<CsLedger> csLedgers = csLedgerMapper.selectList(csLedgerQueryWrapper);
|
||||||
|
List<String> collect = csLedgers.stream().map(CsLedger::getId).distinct().collect(Collectors.toList());
|
||||||
|
|
||||||
|
|
||||||
|
return collect;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ public class CommonStatisticalQueryParam {
|
|||||||
private String statisticalId;
|
private String statisticalId;
|
||||||
@ApiModelProperty(value = "取值类型(Max,Min,cp95,avg)")
|
@ApiModelProperty(value = "取值类型(Max,Min,cp95,avg)")
|
||||||
private String valueType;
|
private String valueType;
|
||||||
@ApiModelProperty(value = "频次20-50")
|
@ApiModelProperty(value = "频次2-50")
|
||||||
private String frequency;
|
private String frequency;
|
||||||
|
|
||||||
@ApiModelProperty(value = "开始时间")
|
@ApiModelProperty(value = "开始时间")
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ public class CsConfigurationParm {
|
|||||||
|
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
private List<String> engeeringIds;
|
private List<String> projectIds;
|
||||||
|
|
||||||
|
|
||||||
private Integer orderBy;
|
private Integer orderBy;
|
||||||
|
|||||||
@@ -36,8 +36,8 @@ public class CsConfigurationPO extends BaseEntity {
|
|||||||
|
|
||||||
@TableField(value = "remark")
|
@TableField(value = "remark")
|
||||||
private String remark;
|
private String remark;
|
||||||
@TableField(value = "engeering_ids")
|
@TableField(value = "project_ids")
|
||||||
private String engeeringIds;
|
private String projectIds;
|
||||||
|
|
||||||
@TableField(value = "order_By")
|
@TableField(value = "order_By")
|
||||||
private Integer orderBy;
|
private Integer orderBy;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ public class CsConfigurationVO extends BaseEntity {
|
|||||||
private Integer orderBy;
|
private Integer orderBy;
|
||||||
|
|
||||||
|
|
||||||
private List<String> engeeringIds;
|
private List<String> projectIds;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "操作人")
|
@ApiModelProperty(value = "操作人")
|
||||||
|
|||||||
@@ -5,13 +5,19 @@ import com.github.tocrhz.mqtt.annotation.MqttSubscribe;
|
|||||||
import com.github.tocrhz.mqtt.annotation.NamedValue;
|
import com.github.tocrhz.mqtt.annotation.NamedValue;
|
||||||
import com.github.tocrhz.mqtt.annotation.Payload;
|
import com.github.tocrhz.mqtt.annotation.Payload;
|
||||||
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
import com.github.tocrhz.mqtt.publisher.MqttPublisher;
|
||||||
|
import com.njcn.csharmonic.param.CommonStatisticalQueryParam;
|
||||||
import com.njcn.csharmonic.pojo.vo.CsRtDataVO;
|
import com.njcn.csharmonic.pojo.vo.CsRtDataVO;
|
||||||
|
import com.njcn.csharmonic.pojo.vo.ThdDataVO;
|
||||||
import com.njcn.csharmonic.service.ILineTargetService;
|
import com.njcn.csharmonic.service.ILineTargetService;
|
||||||
|
import com.njcn.csharmonic.service.StableDataService;
|
||||||
|
import com.njcn.system.api.CsStatisticalSetFeignClient;
|
||||||
|
import com.njcn.system.pojo.po.EleEpdPqd;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
import org.eclipse.paho.client.mqttv3.MqttMessage;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -27,7 +33,8 @@ public class MqttMessageHandler {
|
|||||||
private final MqttPublisher publisher;
|
private final MqttPublisher publisher;
|
||||||
|
|
||||||
private final ILineTargetService lineTargetService;
|
private final ILineTargetService lineTargetService;
|
||||||
|
private final CsStatisticalSetFeignClient csStatisticalSetFeignClient;
|
||||||
|
private final StableDataService stableDataService;
|
||||||
/**
|
/**
|
||||||
* 实时数据应答
|
* 实时数据应答
|
||||||
*/
|
*/
|
||||||
@@ -37,4 +44,26 @@ public class MqttMessageHandler {
|
|||||||
Gson gson = new Gson();
|
Gson gson = new Gson();
|
||||||
publisher.send("/zl/rtData/"+pageId,gson.toJson(list),1,false);
|
publisher.send("/zl/rtData/"+pageId,gson.toJson(list),1,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 实时数据应答
|
||||||
|
*/
|
||||||
|
@MqttSubscribe(value = "/zl/askDevData/{devId}",qos = 1)
|
||||||
|
public void responseTopoData(String topic, @NamedValue("devId") String devId, MqttMessage message, @Payload String payload) {
|
||||||
|
List<ThdDataVO> result = new ArrayList<>();
|
||||||
|
//1.查询拓扑图配置的指标:拓扑图扑图配置:7677f94c749dedaff30f911949cbd724
|
||||||
|
List<EleEpdPqd> data = csStatisticalSetFeignClient.queryStatisticalSelect("7677f94c749dedaff30f911949cbd724").getData();
|
||||||
|
data.forEach(temp->{
|
||||||
|
CommonStatisticalQueryParam commonStatisticalQueryParam = new CommonStatisticalQueryParam();
|
||||||
|
commonStatisticalQueryParam.setDevId(devId);
|
||||||
|
commonStatisticalQueryParam.setStatisticalId(temp.getId());
|
||||||
|
commonStatisticalQueryParam.setValueType("cp95");
|
||||||
|
List<ThdDataVO> thdDataVOS = stableDataService.queryFisrtCommonStatistical(commonStatisticalQueryParam);
|
||||||
|
result.addAll(thdDataVOS);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
Gson gson = new Gson();
|
||||||
|
publisher.send("/zl/devData/"+devId,gson.toJson(result),1,false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
<select id="queryPage" resultMap="BaseResultMap">
|
<select id="queryPage" resultMap="BaseResultMap">
|
||||||
select * from cs_configuration a where a.status="1"
|
select * from cs_configuration a where a.status="1"
|
||||||
and
|
and
|
||||||
SUBSTRING_INDEX(a.engeering_ids,',',1) in
|
SUBSTRING_INDEX(a.project_ids,',',1) in
|
||||||
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
|
||||||
#{item}
|
#{item}
|
||||||
</foreach>
|
</foreach>
|
||||||
|
|||||||
@@ -53,15 +53,15 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
|
||||||
BeanUtils.copyProperties(csConfigurationParm,csConfigurationPO);
|
BeanUtils.copyProperties(csConfigurationParm,csConfigurationPO);
|
||||||
|
|
||||||
List<String> engeeringIds = csConfigurationParm.getEngeeringIds();
|
List<String> projectIds = csConfigurationParm.getProjectIds();
|
||||||
if(CollectionUtils.isEmpty(engeeringIds)){
|
if(CollectionUtils.isEmpty(projectIds)){
|
||||||
throw new BusinessException("请选择工程");
|
throw new BusinessException("请选择项目");
|
||||||
}
|
}
|
||||||
String engeerings = String.join(",", engeeringIds);
|
String projects = String.join(",", projectIds);
|
||||||
|
|
||||||
csConfigurationPO.setEngeeringIds(engeerings);
|
csConfigurationPO.setProjectIds(projects);
|
||||||
//排序不填给个100往后排
|
//排序不填给个100往后排
|
||||||
csConfigurationPO.setOrderBy(csConfigurationParm.getOrderBy()==0?100:csConfigurationParm.getOrderBy());
|
csConfigurationPO.setOrderBy(Objects.isNull(csConfigurationParm.getOrderBy())?100:csConfigurationParm.getOrderBy());
|
||||||
csConfigurationPO.setImagePath(csConfigurationParm.getFileContent());
|
csConfigurationPO.setImagePath(csConfigurationParm.getFileContent());
|
||||||
|
|
||||||
csConfigurationPO.setStatus("1");
|
csConfigurationPO.setStatus("1");
|
||||||
@@ -79,10 +79,10 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
return b;
|
return b;
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
BeanUtils.copyProperties(auditParm,csConfigurationPO);
|
||||||
List<String> engeeringIds = auditParm.getEngeeringIds();
|
List<String> projectIds = auditParm.getProjectIds();
|
||||||
if(!CollectionUtils.isEmpty(engeeringIds)){
|
if(!CollectionUtils.isEmpty(projectIds)){
|
||||||
String engeerings = String.join(",", engeeringIds);
|
String projects = String.join(",", projectIds);
|
||||||
csConfigurationPO.setEngeeringIds(engeerings);
|
csConfigurationPO.setProjectIds(projects);
|
||||||
|
|
||||||
}
|
}
|
||||||
if(!Objects.isNull(auditParm.getOrderBy())){
|
if(!Objects.isNull(auditParm.getOrderBy())){
|
||||||
@@ -105,7 +105,7 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
Page<CsConfigurationVO> returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
Page<CsConfigurationVO> returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||||
Page<CsConfigurationPO> temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
Page<CsConfigurationPO> temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
|
||||||
|
|
||||||
List<String> data1 = roleEngineerDevFeignClient.getRoleengineer().getData();
|
List<String> data1 = roleEngineerDevFeignClient.getRoleProject().getData();
|
||||||
if(CollectionUtils.isEmpty(data1)){
|
if(CollectionUtils.isEmpty(data1)){
|
||||||
return returnpage;
|
return returnpage;
|
||||||
}
|
}
|
||||||
@@ -130,10 +130,10 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
|
|||||||
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
|
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
|
||||||
BeanUtils.copyProperties(page, csDevModelPageVO);
|
BeanUtils.copyProperties(page, csDevModelPageVO);
|
||||||
|
|
||||||
if(StringUtils.isEmpty(page.getEngeeringIds())){
|
if(StringUtils.isEmpty(page.getProjectIds())){
|
||||||
csDevModelPageVO.setEngeeringIds(new ArrayList<>());
|
csDevModelPageVO.setProjectIds(new ArrayList<>());
|
||||||
}else {
|
}else {
|
||||||
csDevModelPageVO.setEngeeringIds( Arrays.asList(page.getEngeeringIds().split(",")));
|
csDevModelPageVO.setProjectIds( Arrays.asList(page.getProjectIds().split(",")));
|
||||||
|
|
||||||
}
|
}
|
||||||
if(Objects.isNull(page.getImagePath())){
|
if(Objects.isNull(page.getImagePath())){
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ public class StableDataServiceImpl implements StableDataService {
|
|||||||
vo.setStatMethod(temp.getValueType());
|
vo.setStatMethod(temp.getValueType());
|
||||||
vo.setStatisticalData(BigDecimal.valueOf(temp.getValue()).setScale(4, RoundingMode.UP).doubleValue());
|
vo.setStatisticalData(BigDecimal.valueOf(temp.getValue()).setScale(4, RoundingMode.UP).doubleValue());
|
||||||
vo.setStatisticalIndex(data.getId());
|
vo.setStatisticalIndex(data.getId());
|
||||||
|
vo.setStatisticalName(temp.getStatisticalName());
|
||||||
return vo;
|
return vo;
|
||||||
}).collect(Collectors.toList());
|
}).collect(Collectors.toList());
|
||||||
|
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ import com.njcn.common.pojo.enums.common.LogEnum;
|
|||||||
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.csdevice.pojo.param.CsEquipmentAlarmPageParm;
|
|
||||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
|
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
|
||||||
|
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmParm;
|
||||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||||
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
|
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
@@ -54,7 +54,7 @@ public class CsEquipmentAlarmController extends BaseController {
|
|||||||
@PostMapping("/queryPage")
|
@PostMapping("/queryPage")
|
||||||
@ApiOperation("设备警告分页查询")
|
@ApiOperation("设备警告分页查询")
|
||||||
@ApiImplicitParam(name = "csEquipmentAlarmPageParm", value = "设备警告查询参数", required = true)
|
@ApiImplicitParam(name = "csEquipmentAlarmPageParm", value = "设备警告查询参数", required = true)
|
||||||
public HttpResult<IPage<CsEquipmentAlarmVO>> queryPage(@RequestBody @Validated CsEquipmentAlarmPageParm csEquipmentAlarmPageParm ){
|
public HttpResult<IPage<CsEquipmentAlarmVO>> queryPage(@RequestBody @Validated CsEquipmentAlarmParm.CsEquipmentAlarmPageParm csEquipmentAlarmPageParm ){
|
||||||
String methodDescribe = getMethodDescribe("queryPage");
|
String methodDescribe = getMethodDescribe("queryPage");
|
||||||
|
|
||||||
IPage<CsEquipmentAlarmVO> page = csEquipmentAlarmPOService.queryPage (csEquipmentAlarmPageParm);
|
IPage<CsEquipmentAlarmVO> page = csEquipmentAlarmPOService.queryPage (csEquipmentAlarmPageParm);
|
||||||
@@ -65,11 +65,11 @@ public class CsEquipmentAlarmController extends BaseController {
|
|||||||
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
@PostMapping("/queryList")
|
@PostMapping("/queryList")
|
||||||
@ApiOperation("设备警告分页查询")
|
@ApiOperation("设备警告分页查询")
|
||||||
@ApiImplicitParam(name = "csEquipmentAlarmPageParm", value = "设备警告查询参数", required = true)
|
@ApiImplicitParam(name = "csEquipmentAlarm", value = "设备警告查询参数", required = true)
|
||||||
public HttpResult<List<CsEquipmentAlarmVO>> querList(@RequestBody @Validated CsEquipmentAlarmPageParm csEquipmentAlarmPageParm ){
|
public HttpResult<List<CsEquipmentAlarmVO>> querList(@RequestBody @Validated CsEquipmentAlarmParm csEquipmentAlarm ){
|
||||||
String methodDescribe = getMethodDescribe("querList");
|
String methodDescribe = getMethodDescribe("querList");
|
||||||
|
|
||||||
List<CsEquipmentAlarmVO> list = csEquipmentAlarmPOService.querList (csEquipmentAlarmPageParm);
|
List<CsEquipmentAlarmVO> list = csEquipmentAlarmPOService.querList (csEquipmentAlarm);
|
||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ package com.njcn.cswarn.service;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
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.CsEquipmentAlarmAddParm;
|
||||||
|
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmParm;
|
||||||
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
|
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
|
||||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||||
|
|
||||||
@@ -29,9 +29,9 @@ public interface CsEquipmentAlarmPOService extends IService<CsEquipmentAlarmPO>{
|
|||||||
*/
|
*/
|
||||||
CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
|
CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
|
||||||
|
|
||||||
IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
|
IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmParm.CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
List<CsEquipmentAlarmVO> querList(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
|
List<CsEquipmentAlarmVO> querList(CsEquipmentAlarmParm csEquipmentAlarm);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.csdevice.api.AppProjectFeignClient;
|
import com.njcn.csdevice.api.AppProjectFeignClient;
|
||||||
import com.njcn.csdevice.api.EquipmentFeignClient;
|
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.AppProjectPO;
|
||||||
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
import com.njcn.csdevice.pojo.po.CsEquipmentDeliveryPO;
|
||||||
import com.njcn.cswarn.mapper.CsEquipmentAlarmPOMapper;
|
import com.njcn.cswarn.mapper.CsEquipmentAlarmPOMapper;
|
||||||
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
|
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmAddParm;
|
||||||
|
import com.njcn.cswarn.pojo.parm.CsEquipmentAlarmParm;
|
||||||
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
|
import com.njcn.cswarn.pojo.po.CsEquipmentAlarmPO;
|
||||||
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
import com.njcn.cswarn.pojo.vo.CsEquipmentAlarmVO;
|
||||||
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
|
import com.njcn.cswarn.service.CsEquipmentAlarmPOService;
|
||||||
@@ -76,7 +76,7 @@ public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmP
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
|
public IPage<CsEquipmentAlarmVO> queryPage(CsEquipmentAlarmParm.CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
|
||||||
Page<CsEquipmentAlarmVO> returnpage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
|
Page<CsEquipmentAlarmVO> returnpage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
|
||||||
Page<CsEquipmentAlarmPO> queryPage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
|
Page<CsEquipmentAlarmPO> queryPage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
|
||||||
QueryWrapper<CsEquipmentAlarmPO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CsEquipmentAlarmPO> queryWrapper = new QueryWrapper<>();
|
||||||
@@ -113,15 +113,15 @@ public class CsEquipmentAlarmPOServiceImpl extends ServiceImpl<CsEquipmentAlarmP
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CsEquipmentAlarmVO> querList(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
|
public List<CsEquipmentAlarmVO> querList(CsEquipmentAlarmParm csEquipmentAlarmParm) {
|
||||||
QueryWrapper<CsEquipmentAlarmPO> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CsEquipmentAlarmPO> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
queryWrapper.eq("status", "1");
|
queryWrapper.eq("status", "1");
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getProjectId()),CsEquipmentAlarmPO.COL_PROJECT_ID,csEquipmentAlarmPageParm.getProjectId());
|
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmParm.getProjectId()),CsEquipmentAlarmPO.COL_PROJECT_ID,csEquipmentAlarmParm.getProjectId());
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getEquipmentId()),CsEquipmentAlarmPO.COL_EQUIPMENT_ID,csEquipmentAlarmPageParm.getEquipmentId());
|
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmParm.getEquipmentId()),CsEquipmentAlarmPO.COL_EQUIPMENT_ID,csEquipmentAlarmParm.getEquipmentId());
|
||||||
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmPageParm.getAlarmLevel()),CsEquipmentAlarmPO.COL_ALARM_LEVEL,csEquipmentAlarmPageParm.getAlarmLevel());
|
queryWrapper.eq(StringUtils.isNotBlank(csEquipmentAlarmParm.getAlarmLevel()),CsEquipmentAlarmPO.COL_ALARM_LEVEL,csEquipmentAlarmParm.getAlarmLevel());
|
||||||
queryWrapper.ge(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getStartTime());
|
queryWrapper.ge(Objects.nonNull(csEquipmentAlarmParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmParm.getStartTime());
|
||||||
queryWrapper.le(Objects.nonNull(csEquipmentAlarmPageParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmPageParm.getEndTime());
|
queryWrapper.le(Objects.nonNull(csEquipmentAlarmParm.getStartTime()),CsEquipmentAlarmPO.COL_START_TIME,csEquipmentAlarmParm.getEndTime());
|
||||||
queryWrapper.orderByDesc("create_time");
|
queryWrapper.orderByDesc("create_time");
|
||||||
|
|
||||||
List<CsEquipmentAlarmPO> csEquipmentAlarmPOS = this.getBaseMapper().selectList(queryWrapper);
|
List<CsEquipmentAlarmPO> csEquipmentAlarmPOS = this.getBaseMapper().selectList(queryWrapper);
|
||||||
|
|||||||
Reference in New Issue
Block a user