diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/CsEquipmentAlarmPO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/CsEquipmentAlarmPO.java
deleted file mode 100644
index 4ea98fb..0000000
--- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/po/CsEquipmentAlarmPO.java
+++ /dev/null
@@ -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";
-}
\ No newline at end of file
diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java
index 47b07b4..199070b 100644
--- a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java
+++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsEquipmentDeliveryVO.java
@@ -105,8 +105,10 @@ public class CsEquipmentDeliveryVO extends BaseEntity {
/**
* 状态(0:删除 1:未注册 2:注册 3:接入)
*/
- @TableField(value = "status")
private Integer status;
+ @ApiModelProperty(value="装置出厂方式")
+ private String devAccessMethod ;
+
}
\ No newline at end of file
diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsTopologyDiagramTemplateVO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsTopologyDiagramTemplateVO.java
new file mode 100644
index 0000000..ded0799
--- /dev/null
+++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/CsTopologyDiagramTemplateVO.java
@@ -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;
+
+
+}
\ No newline at end of file
diff --git a/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/DevCountVO.java b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/DevCountVO.java
new file mode 100644
index 0000000..d2b3cd7
--- /dev/null
+++ b/cs-device/cs-device-api/src/main/java/com/njcn/csdevice/pojo/vo/DevCountVO.java
@@ -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;
+
+
+
+}
diff --git a/cs-device/cs-device-boot/pom.xml b/cs-device/cs-device-boot/pom.xml
index a047019..03bec44 100644
--- a/cs-device/cs-device-boot/pom.xml
+++ b/cs-device/cs-device-boot/pom.xml
@@ -89,6 +89,12 @@
hutool-all
5.8.5
+
+ com.njcn
+ cs-warn-api
+ 1.0.0
+ compile
+
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/DeviceUserController.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/DeviceUserController.java
index b7e2ac9..28c1155 100644
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/DeviceUserController.java
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/DeviceUserController.java
@@ -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
+ * @Author: clam
+ * @Date: 2023/7/5
+ */
+ @OperateInfo(info = LogEnum.BUSINESS_COMMON)
+ @PostMapping("/devCount")
+ @ApiOperation("设备统计")
+ @ApiImplicitParam(name = "id", value = "工程id", required = true)
+ public HttpResult devCount(@RequestParam("id") String id){
+ String methodDescribe = getMethodDescribe("devCount");
+
+ DevCountVO result = csDeviceUserPOService.devCount (id);
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, result, methodDescribe);
+ }
}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java
index a87bdb9..3ca8a1d 100644
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/controller/equipment/EquipmentDeliveryController.java
@@ -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> queryDeviceById(@RequestParam List ids){
- String methodDescribe = getMethodDescribe("queryDeviceById");
+ public HttpResult> queryEquipmentById(@RequestParam List ids){
+ String methodDescribe = getMethodDescribe("queryEquipmentById");
List csEquipmentDeliveryPOS = csEquipmentDeliveryService.listByIds(ids);
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, csEquipmentDeliveryPOS, methodDescribe);
}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsEquipmentAlarmPOMapper.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsEquipmentAlarmPOMapper.java
deleted file mode 100644
index 23a3fbc..0000000
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsEquipmentAlarmPOMapper.java
+++ /dev/null
@@ -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 {
-}
\ No newline at end of file
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsLineTopologyTemplateMapper.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsLineTopologyTemplateMapper.java
new file mode 100644
index 0000000..97e41d0
--- /dev/null
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsLineTopologyTemplateMapper.java
@@ -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 {
+}
\ No newline at end of file
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsTopologyDiagramTemplateMapper.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsTopologyDiagramTemplateMapper.java
new file mode 100644
index 0000000..3de3b6b
--- /dev/null
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/CsTopologyDiagramTemplateMapper.java
@@ -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 {
+}
\ No newline at end of file
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsEquipmentAlarmPOMapper.xml b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsEquipmentAlarmPOMapper.xml
deleted file mode 100644
index d841534..0000000
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/mapper/mapping/CsEquipmentAlarmPOMapper.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- id, project_id, equipment_id, alarm_msg, alarm_level, start_time, end_time, `status`,
- create_by, create_time, update_by, update_time
-
-
\ No newline at end of file
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsDeviceUserPOService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsDeviceUserPOService.java
index 3dd2960..220c3e5 100644
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsDeviceUserPOService.java
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsDeviceUserPOService.java
@@ -2,7 +2,9 @@ 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:
* Date: 2023/6/27 9:40【需求编号】
@@ -16,4 +18,6 @@ public interface CsDeviceUserPOService extends IService{
Boolean add(String id);
Boolean share(String id);
+
+ DevCountVO devCount(String id);
}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsEquipmentAlarmPOService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsEquipmentAlarmPOService.java
deleted file mode 100644
index 76fd9ff..0000000
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsEquipmentAlarmPOService.java
+++ /dev/null
@@ -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{
-
- /**
- * @Description: 新增设备警告
- * @Param:
- * @return: com.njcn.algorithm.pojo.vo.CsEquipmentAlarmVO
- * @Author: clam
- * @Date: 2023/5/17
- */
- CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
-
- IPage queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
-}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsLineTopologyTemplateService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsLineTopologyTemplateService.java
new file mode 100644
index 0000000..5d4dc8a
--- /dev/null
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsLineTopologyTemplateService.java
@@ -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{
+
+
+}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsTopologyDiagramTemplateService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsTopologyDiagramTemplateService.java
new file mode 100644
index 0000000..d27400e
--- /dev/null
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/CsTopologyDiagramTemplateService.java
@@ -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{
+
+
+ String uploadImage(MultipartFile issuesFile);
+
+ List queryImage();
+}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/RoleEngineerDevService.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/RoleEngineerDevService.java
index 603e8c8..5975e49 100644
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/RoleEngineerDevService.java
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/RoleEngineerDevService.java
@@ -39,6 +39,9 @@ public class RoleEngineerDevService {
public List getRoleengineer(){
String role = RequestUtil.getUserRole();
List strings = JSONArray.parseArray(role, String.class);
+ if(CollectionUtils.isEmpty(strings)){
+ return new ArrayList<>();
+ }
role=strings.get(0);
String userIndex = RequestUtil.getUserIndex();
QueryWrapper csEngineeringUserPOQueryWrapper = new QueryWrapper<> ();
@@ -93,6 +96,9 @@ public class RoleEngineerDevService {
public List getDevice(){
String role = RequestUtil.getUserRole();
List strings = JSONArray.parseArray(role, String.class);
+ if(CollectionUtils.isEmpty(strings)){
+ return new ArrayList<>();
+ }
role=strings.get(0);
String userIndex = RequestUtil.getUserIndex();
QueryWrapper csEngineeringUserPOQueryWrapper = new QueryWrapper<> ();
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java
index 5d3fd69..011ea5a 100644
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsDeviceUserPOServiceImpl.java
@@ -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 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 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 data = csEquipmentAlarmFeignClient.queryList(csEquipmentAlarmPageParm).getData();
+ List 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;
+ }
}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentAlarmPOServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentAlarmPOServiceImpl.java
deleted file mode 100644
index c050153..0000000
--- a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsEquipmentAlarmPOServiceImpl.java
+++ /dev/null
@@ -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 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 queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
- Page returnpage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
- Page queryPage = new Page<> (csEquipmentAlarmPageParm.getPageNum ( ), csEquipmentAlarmPageParm.getPageSize ( ));
- QueryWrapper 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 csEquipmentAlarmPOPage = this.getBaseMapper().selectPage(queryPage, queryWrapper);
- List 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());
- }
-}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLineTopologyTemplateServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLineTopologyTemplateServiceImpl.java
new file mode 100644
index 0000000..9df8a61
--- /dev/null
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsLineTopologyTemplateServiceImpl.java
@@ -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 implements CsLineTopologyTemplateService {
+
+}
diff --git a/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsTopologyDiagramTemplateServiceImpl.java b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsTopologyDiagramTemplateServiceImpl.java
new file mode 100644
index 0000000..0eb39b1
--- /dev/null
+++ b/cs-device/cs-device-boot/src/main/java/com/njcn/csdevice/service/impl/CsTopologyDiagramTemplateServiceImpl.java
@@ -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 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 queryImage() {
+ List list = this.list(null);
+
+ List 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;
+
+ }
+}
diff --git a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/param/CsConfigurationParm.java b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/param/CsConfigurationParm.java
index 418d21d..dc8e2a7 100644
--- a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/param/CsConfigurationParm.java
+++ b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/param/CsConfigurationParm.java
@@ -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 engeeringIds;
+
+
+ private Integer orderBy;
+
private String fileContent;
diff --git a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/po/CsConfigurationPO.java b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/po/CsConfigurationPO.java
index 42d63c1..e2ba597 100644
--- a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/po/CsConfigurationPO.java
+++ b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/po/CsConfigurationPO.java
@@ -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;
/**
diff --git a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsConfigurationVO.java b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsConfigurationVO.java
index d7f5a5b..923ff2b 100644
--- a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsConfigurationVO.java
+++ b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsConfigurationVO.java
@@ -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 engeeringIds;
+
@ApiModelProperty(value = "操作人")
private String operater;
diff --git a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsPageVO.java b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsPageVO.java
index 668da1c..bc3de4b 100644
--- a/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsPageVO.java
+++ b/cs-harmonic/cs-harmonic-api/src/main/java/com/njcn/csharmonic/pojo/vo/CsPageVO.java
@@ -29,6 +29,9 @@ public class CsPageVO {
*/
@ApiModelProperty(value="组态项目id")
private String pid;
+
+ @ApiModelProperty(value="前端使用")
+ private String kid;
@ApiModelProperty(value="组态项目名称")
private String configurationName;
diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsConfigurationServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsConfigurationServiceImpl.java
index ce44cc9..801f80b 100644
--- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsConfigurationServiceImpl.java
+++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsConfigurationServiceImpl.java
@@ -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 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 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 queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam) {
Page returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
Page temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
- String deptIndex = RequestUtil.getDeptIndex();
QueryWrapper 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 csConfigurationPOPage = this.getBaseMapper().selectPage(temppage, query);
List collect1 = csConfigurationPOPage.getRecords().stream().map(CsConfigurationPO::getCreateBy).collect(Collectors.toList());
Map collect2;
@@ -101,6 +122,13 @@ public class CsConfigurationServiceImpl extends ServiceImpl 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);
diff --git a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsPagePOServiceImpl.java b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsPagePOServiceImpl.java
index b89de00..64a5384 100644
--- a/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsPagePOServiceImpl.java
+++ b/cs-harmonic/cs-harmonic-boot/src/main/java/com/njcn/csharmonic/service/impl/CsPagePOServiceImpl.java
@@ -128,6 +128,7 @@ public class CsPagePOServiceImpl extends ServiceImpl 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(
diff --git a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/api/CsEquipmentAlarmFeignClient.java b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/api/CsEquipmentAlarmFeignClient.java
new file mode 100644
index 0000000..63db47d
--- /dev/null
+++ b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/api/CsEquipmentAlarmFeignClient.java
@@ -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> queryList(@RequestBody CsEquipmentAlarmParm csEquipmentAlarmParm);
+}
diff --git a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/api/fallback/CsEquipmentAlarmClientFallbackFactory.java b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/api/fallback/CsEquipmentAlarmClientFallbackFactory.java
new file mode 100644
index 0000000..94dbd5e
--- /dev/null
+++ b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/api/fallback/CsEquipmentAlarmClientFallbackFactory.java
@@ -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 {
+ @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> queryList(CsEquipmentAlarmParm csEquipmentAlarmParm) {
+ log.error("{}异常,降级处理,异常为:{}","查询设备警告接口异常",cause.toString());
+ throw new BusinessException(finalExceptionEnum);
+ }
+
+
+ };
+ }
+}
diff --git a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEquipmentAlarmPageParm.java b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEquipmentAlarmParm.java
similarity index 57%
rename from cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEquipmentAlarmPageParm.java
rename to cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEquipmentAlarmParm.java
index 59cc747..79a5268 100644
--- a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEquipmentAlarmPageParm.java
+++ b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEquipmentAlarmParm.java
@@ -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;
+ }
+
}
\ No newline at end of file
diff --git a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEventDetailPageParm.java b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEventDetailParm.java
similarity index 51%
rename from cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEventDetailPageParm.java
rename to cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEventDetailParm.java
index 458b446..dc22fd3 100644
--- a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEventDetailPageParm.java
+++ b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/parm/CsEventDetailParm.java
@@ -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;
+ }
}
\ No newline at end of file
diff --git a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/po/CsEquipmentAlarmPO.java b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/po/CsEquipmentAlarmPO.java
index 93b9601..4002f48 100644
--- a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/po/CsEquipmentAlarmPO.java
+++ b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/po/CsEquipmentAlarmPO.java
@@ -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";
diff --git a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/vo/CsEquipmentAlarmCountVO.java b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/vo/CsEquipmentAlarmCountVO.java
new file mode 100644
index 0000000..dea2929
--- /dev/null
+++ b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/vo/CsEquipmentAlarmCountVO.java
@@ -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 devDetail;
+ @Data
+ public static class AlarmDevice{
+ private String devId;
+ private String devName;
+ }
+
+
+}
\ No newline at end of file
diff --git a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/vo/CsEquipmentAlarmVO.java b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/vo/CsEquipmentAlarmVO.java
index e6e3087..71053ae 100644
--- a/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/vo/CsEquipmentAlarmVO.java
+++ b/cs-warn/cs-warn-api/src/main/java/com/njcn/cswarn/pojo/vo/CsEquipmentAlarmVO.java
@@ -16,7 +16,6 @@ import java.time.LocalDateTime;
* @version V1.0.0
*/
@Data
-@TableName(value = "cs_equipment_alarm")
public class CsEquipmentAlarmVO extends BaseEntity {
/**
* id
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEquipmentAlarmController.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEquipmentAlarmController.java
index fd4540d..fd5da60 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEquipmentAlarmController.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEquipmentAlarmController.java
@@ -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> querList(@RequestBody @Validated CsEquipmentAlarmPageParm csEquipmentAlarmPageParm ){
+ String methodDescribe = getMethodDescribe("querList");
+
+ List list = csEquipmentAlarmPOService.querList (csEquipmentAlarmPageParm);
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, list, methodDescribe);
+ }
}
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEventDetailPOController.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEventDetailPOController.java
index fe62bac..9ab45b0 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEventDetailPOController.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsEventDetailPOController.java
@@ -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> queryPage(@RequestBody @Validated CsEventDetailPageParm csEventDetailPageParm ){
+ public HttpResult> queryPage(@RequestBody @Validated CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm ){
String methodDescribe = getMethodDescribe("queryPage");
IPage 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> queryList(@RequestBody @Validated CsEventDetailParm csEventDetailParm ){
+ String methodDescribe = getMethodDescribe("queryList");
+
+ List page = csEventDetailPOService.queryList (csEventDetailParm);
+ return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, page, methodDescribe);
+ }
}
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsStatLimitRateDPOController.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsStatLimitRateDPOController.java
index 34d0a5c..c6fc452 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsStatLimitRateDPOController.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/controller/alarm/CsStatLimitRateDPOController.java
@@ -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> queryPage(@RequestBody @Validated CsStatLimitRatePageParm csStatLimitRatePageParm ){
String methodDescribe = getMethodDescribe("queryPage");
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/mapper/CsEventDetailPOMapper.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/mapper/CsEventDetailPOMapper.java
index 801d346..9bdba84 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/mapper/CsEventDetailPOMapper.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/mapper/CsEventDetailPOMapper.java
@@ -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 {
- Page queryPage(Page returnpage, @Param("csEventDetailPageParm") CsEventDetailPageParm csEventDetailPageParm);
+ Page queryPage(Page returnpage, @Param("csEventDetailPageParm") CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm);
}
\ No newline at end of file
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEquipmentAlarmPOService.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEquipmentAlarmPOService.java
index ba41dd4..4de17d9 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEquipmentAlarmPOService.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEquipmentAlarmPOService.java
@@ -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{
CsEquipmentAlarmVO add(CsEquipmentAlarmAddParm csEquipmentAlarmAddParm);
IPage queryPage(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
+
+
+
+ List querList(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm);
}
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEventDetailPOService.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEventDetailPOService.java
index 92309d3..640172d 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEventDetailPOService.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/CsEventDetailPOService.java
@@ -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{
- IPage queryPage(CsEventDetailPageParm csEventDetailPageParm);
- }
+ IPage queryPage(CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm);
+
+ List queryList(CsEventDetailParm csEventDetailPageParm);
+}
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEquipmentAlarmPOServiceImpl.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEquipmentAlarmPOServiceImpl.java
index e9de07c..7cb8f56 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEquipmentAlarmPOServiceImpl.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEquipmentAlarmPOServiceImpl.java
@@ -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 querList(CsEquipmentAlarmPageParm csEquipmentAlarmPageParm) {
+ QueryWrapper 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 csEquipmentAlarmPOS = this.getBaseMapper().selectList(queryWrapper);
+ List collect1 = csEquipmentAlarmPOS.stream().map(CsEquipmentAlarmPO::getProjectId).distinct().collect(toList());
+ List collect2 = csEquipmentAlarmPOS.stream().map(CsEquipmentAlarmPO::getEquipmentId).distinct().collect(toList());
+
+ List data = equipmentFeignClient.queryDeviceById(collect2).getData();
+ List data1 = appProjectFeignClient.queryProjectById(collect1).getData();
+ List data3 = dicDataFeignClient.getDicDataByTypeCode(DicDataTypeEnum.ALARM_TYPE.getCode()).getData();
+
+ Map collect3 = data.stream().collect(Collectors.toMap(CsEquipmentDeliveryPO::getId, CsEquipmentDeliveryPO::getName));
+ Map collect4 = data1.stream().collect(Collectors.toMap(AppProjectPO::getId, AppProjectPO::getName));
+ Map collect5 = data3.stream().collect(Collectors.toMap(DictData::getId, DictData::getName));
+
+
+ List 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;
+ }
+
}
diff --git a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEventDetailPOServiceImpl.java b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEventDetailPOServiceImpl.java
index 47a6775..bd996ac 100644
--- a/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEventDetailPOServiceImpl.java
+++ b/cs-warn/cs-warn-boot/src/main/java/com/njcn/cswarn/service/impl/CsEventDetailPOServiceImpl.java
@@ -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 implements CsEventDetailPOService {
@Override
- public IPage queryPage(CsEventDetailPageParm csEventDetailPageParm) {
+ public IPage queryPage(CsEventDetailParm.CsEventDetailPageParm csEventDetailPageParm) {
Page returnpage = new Page<> (csEventDetailPageParm.getPageNum ( ), csEventDetailPageParm.getPageSize ( ));
returnpage = this.getBaseMapper().queryPage(returnpage,csEventDetailPageParm);
return returnpage;
}
+
+ @Override
+ public List queryList(CsEventDetailParm csEventDetailPageParm) {
+ return null;
+ }
}