Browse Source

Merge remote-tracking branch 'origin/master'

zhongwei
yang_shj 2 years ago
parent
commit
bc262210b3
  1. 51
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FdpFaultRealDataDTO.java
  2. 9
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultRealDataVO.java
  3. 2
      hzims-service-api/hzims-operational-api/pom.xml
  4. 3
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/dto/ContentDefinitionDTO.java
  5. 2
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java
  6. 16
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IContentClient.java
  7. 4
      hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IContentDefinitionClient.java
  8. 35
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java
  9. 10
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentClient.java
  10. 2
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java
  11. 3
      hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ContentDefinitionServiceImpl.java
  12. 6
      hzims-service/inspect/src/main/resources/db/1.0.1.sql
  13. 5
      pom.xml

51
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FdpFaultRealDataDTO.java

@ -0,0 +1,51 @@
package com.hnac.hzims.fdp.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* 模型VO
*
* @author tangyu
* @created 2023-07-03 17:38
**/
@Data
@NoArgsConstructor
@AllArgsConstructor
public class FdpFaultRealDataDTO {
private static final long serialVersionUID = 1L;
/**
* 监测点ID
*/
@ApiModelProperty("监测点ID")
private String monitorId;
@ApiModelProperty("监测点名称")
private String name;
@ApiModelProperty("位置")
private String ord;
@ApiModelProperty("单代表对应一个实时数据,多代表对应一组实时数据")
private String multi;
@ApiModelProperty("数据的物模型id")
private String instance;
@ApiModelProperty("数据的物模型属性:如果multi是“多”,则包含该字符串起始的所有属性")
private String identifier;
@ApiModelProperty("物模型是否开机:无法获取当作开机处理")
private Boolean powerOn;
@ApiModelProperty("获取的实时数据如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private List<String> real;
@ApiModelProperty("获取的实时数据如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private List<String> realIdentifier;
@ApiModelProperty("获取的实时数据如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private List<String> realName;
@ApiModelProperty("实时数据时间,如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private List<Date> realTime;
}

9
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultRealDataVO.java

@ -6,7 +6,6 @@ import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
* 模型VO
@ -41,7 +40,11 @@ public class FdpFaultRealDataVO {
private Boolean powerOn;
@ApiModelProperty("获取的实时数据如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private List<String> real;
private String real;
@ApiModelProperty("获取的实时数据如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private String realIdentifier;
@ApiModelProperty("获取的实时数据如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private String realName;
@ApiModelProperty("实时数据时间,如果MULTI是“单”则为数值,MULTI是“多”则为数组")
private List<Date> realTime;
private Date realTime;
}

2
hzims-service-api/hzims-operational-api/pom.xml

@ -67,8 +67,6 @@
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
<version>4.0.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
</dependencies>

3
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/dto/ContentDefinitionDTO.java

@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import java.io.Serializable;
import java.util.List;
/**
* @ClassName ContentDefinitionDTO
@ -21,6 +22,6 @@ import java.io.Serializable;
public class ContentDefinitionDTO extends ContentDefinitionEntity implements Serializable {
@ApiModelProperty("id,按逗号分隔")
private String ids;
private List<Long> ids;
}

2
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/entity/ContentDefinitionEntity.java

@ -1,5 +1,6 @@
package com.hnac.hzinfo.inspect.obj.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.NullSerializer;
import io.swagger.annotations.ApiModelProperty;
@ -21,6 +22,7 @@ import java.io.Serializable;
**/
@Data
@EqualsAndHashCode
@TableName("hz_st_re_content_definition")
public class ContentDefinitionEntity extends TenantEntity implements Serializable {
@ApiModelProperty(value = "内容编码")

16
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IContentClient.java

@ -1,16 +1,22 @@
package com.hnac.hzinfo.inspect.obj.feign;
import com.hnac.hzinfo.inspect.Constants;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.vo.ContentVO;
import org.springblade.core.tool.api.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import java.util.List;
@FeignClient(value = Constants.APP_NAME)
public interface IContentClient {
String API_PREFIX = "/feign/content";
String DETAIL = API_PREFIX + "/detail";
String SAVE_BATCH = API_PREFIX + "/saveBatch";
String UPDATE_BATCH = API_PREFIX + "/detail";
String SAVE_BATCH = API_PREFIX + "/updateBatch";
String LIST = API_PREFIX + "/list";
String SAVE_OR_UPDATE_BATCH = API_PREFIX + "/saveOrUpdateBatch";
@ -22,4 +28,12 @@ public interface IContentClient {
@GetMapping(DETAIL)
R<ContentVO> detail(Long id);
/**
* 批量更新巡检内容
* @param request 巡检内容列表
* @return
*/
@PutMapping(UPDATE_BATCH)
R<Boolean> updateBatch(@RequestBody List<ContentDTO> request);
}

4
hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/obj/feign/IContentDefinitionClient.java

@ -57,7 +57,7 @@ public interface IContentDefinitionClient {
* @param request
* @return
*/
@GetMapping(SAVE_OR_UPDATE_BATCH)
R<Boolean> saveOrUpdateBatch(List<ContentDefinitionDTO> request);
@PostMapping(SAVE_OR_UPDATE_BATCH)
R<Boolean> saveOrUpdateBatch(@RequestBody List<ContentDefinitionDTO> request);
}

35
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpMonitorServiceImpl.java

@ -13,6 +13,7 @@ import com.hnac.hzims.EquipmentConstants;
import com.hnac.hzims.equipment.entity.EmInfoEntity;
import com.hnac.hzims.equipment.service.IEmInfoService;
import com.hnac.hzims.fdp.constants.DeviceInstanceTypeConstant;
import com.hnac.hzims.fdp.dto.FdpFaultRealDataDTO;
import com.hnac.hzims.fdp.dto.FdpMonitorDTO;
import com.hnac.hzims.fdp.dto.FdpMonitorExtendDTO;
import com.hnac.hzims.fdp.dto.FdpTaskDTO;
@ -816,38 +817,28 @@ public class FdpMonitorServiceImpl extends BaseServiceImpl<FdpMonitorMapper, Fdp
FdpHttpResponseVo fdpHttpResponseVo = JSONObject.parseObject(post, new TypeReference<FdpHttpResponseVo>() {});
if (1==fdpHttpResponseVo.getSuccess()) {
if (Func.isNotEmpty(fdpHttpResponseVo.getData())) {
List<FdpFaultRealDataVO> list = JSONObject.parseObject(fdpHttpResponseVo.getData(), new TypeReference<List<FdpFaultRealDataVO>>() {});
List<FdpFaultRealDataDTO> list = JSONObject.parseObject(fdpHttpResponseVo.getData(), new TypeReference<List<FdpFaultRealDataDTO>>() {});
if (CollectionUtil.isEmpty(list)){
return R.success("暂无数据,请稍后重试");
}
List<FdpFaultRealDataVO> res =new ArrayList<>();
for (FdpFaultRealDataVO fdpFaultRealDataVO : list) {
if (null!=fdpFaultRealDataVO.getReal()){
for (int i = 0; i < fdpFaultRealDataVO.getReal().size(); i++ ) {
for (FdpFaultRealDataDTO fdpFaultRealDataDTO : list) {
if (null!=fdpFaultRealDataDTO.getReal()){
for (int i = 0; i < fdpFaultRealDataDTO.getReal().size(); i++ ) {
FdpFaultRealDataVO dataVO=new FdpFaultRealDataVO();
BeanUtils.copyProperties(fdpFaultRealDataVO,dataVO);
String real = fdpFaultRealDataVO.getReal().get(i);
Date time = fdpFaultRealDataVO.getRealTime().get(i);
dataVO.setReal(Arrays.asList(real));
dataVO.setRealTime(Arrays.asList(time));
BeanUtils.copyProperties(fdpFaultRealDataDTO,dataVO);
dataVO.setReal(fdpFaultRealDataDTO.getReal().get(i));
dataVO.setRealTime(fdpFaultRealDataDTO.getRealTime().get(i));
dataVO.setRealName(fdpFaultRealDataDTO.getRealName().get(i));
dataVO.setRealIdentifier(fdpFaultRealDataDTO.getRealIdentifier().get(i));
res.add(dataVO);
}
}else {
res.add(fdpFaultRealDataVO);
FdpFaultRealDataVO dataVO=new FdpFaultRealDataVO();
BeanUtils.copyProperties(fdpFaultRealDataDTO,dataVO);
res.add(dataVO);
}
}
// JSONObject jsonParams = JSONObject.parseObject(fdpHttpResponseVo.getData());
// list=list.stream().map(s -> {
// if ("单".equals(s.getMulti())) {
// if (null == s.getReal()) {
// s.setReal(new ArrayList<>().toString());
// } else {
// String real = jsonParams.get("real").toString();
// s.setReal(Arrays.asList(Double.valueOf(real)).toString());
// }
// }
// return s;
// }).collect(Collectors.toList());
return R.data(res);
}
return R.success("暂无数据,请稍后重试");

10
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentClient.java

@ -1,5 +1,8 @@
package com.hnac.hzinfo.inspect.obj.feign;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.hnac.hzinfo.inspect.obj.dto.ContentDTO;
import com.hnac.hzinfo.inspect.obj.entity.ContentEntity;
import com.hnac.hzinfo.inspect.obj.services.ContentService;
import com.hnac.hzinfo.inspect.obj.vo.ContentVO;
@ -10,6 +13,7 @@ import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Optional;
/**
@ -32,5 +36,11 @@ public class ContentClient extends BladeController implements IContentClient {
return R.data(Optional.ofNullable(entity).map(content -> ContentWrapper.build().entityVO(content)).orElse(null));
}
@Override
public R<Boolean> updateBatch(List<ContentDTO> request) {
List<ContentEntity> contentList = JSONArray.parseArray(JSON.toJSONString(request), ContentEntity.class);
return R.data(contentService.updateBatchById(contentList));
}
}

2
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/feign/ContentDefinitionClient.java

@ -53,7 +53,7 @@ public class ContentDefinitionClient implements IContentDefinitionClient {
@Override
@PostMapping(SAVE_OR_UPDATE_BATCH)
public R<Boolean> saveOrUpdateBatch(List<ContentDefinitionDTO> request) {
public R<Boolean> saveOrUpdateBatch(@RequestBody List<ContentDefinitionDTO> request) {
List<ContentDefinitionEntity> list = JSONArray.parseArray(JSON.toJSONString(request), ContentDefinitionEntity.class);
return R.data(contentDefinitionService.saveOrUpdateBatch(list));
}

3
hzims-service/inspect/src/main/java/com/hnac/hzinfo/inspect/obj/services/impl/ContentDefinitionServiceImpl.java

@ -16,6 +16,7 @@ import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.tool.utils.BeanUtil;
import org.springblade.core.tool.utils.CollectionUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.stereotype.Service;
@ -40,7 +41,7 @@ public class ContentDefinitionServiceImpl extends BaseServiceImpl<ContentDefinit
public List<ContentDefinitionVO> list(ContentDefinitionDTO request) {
QueryWrapper<ContentDefinitionEntity> queryWrapper = Condition.getQueryWrapper(BeanUtil.copy(request, ContentDefinitionEntity.class));
LambdaQueryWrapper<ContentDefinitionEntity> lambda = queryWrapper.lambda();
lambda.in(StringUtil.isNotBlank(request.getIds()),ContentDefinitionEntity::getId,Func.toLongList(",",request.getIds()));
lambda.in(CollectionUtil.isNotEmpty(request.getIds()),ContentDefinitionEntity::getId,request.getIds());
return ContentDefinitionWrapper.build().listVO(this.list(lambda));
}
}

6
hzims-service/inspect/src/main/resources/db/1.0.1.sql

@ -33,11 +33,11 @@ CREATE TABLE IF NOT EXISTS `hz_st_re_content_definition` (
SET FOREIGN_KEY_CHECKS = 1;
-- 巡检内容定义添加物模型标识字段
alter table hz_st_re_content add COLUMN `model_signage` VARCHAR(64) comment '模型标识';
alter table hz_st_re_content_definition add COLUMN `model_signage` VARCHAR(64) comment '模型标识';
-- 巡检内容定义添加物模型属性标识字段
alter table hz_st_re_content add COLUMN `attr_signage` VARCHAR(50) comment '属性标识';
alter table hz_st_re_content_definition add COLUMN `attr_signage` VARCHAR(50) comment '属性标识';
-- 巡检内容定义添加物模型属性名称字段
alter table hz_st_re_content add COLUMN `attr_name` VARCHAR(64) comment '属性名称';
alter table hz_st_re_content_definition add COLUMN `attr_name` VARCHAR(64) comment '属性名称';
-- 设备巡检内容添加物模型标识字段
alter table hz_st_re_content add COLUMN `model_signage` VARCHAR(64) comment '模型标识';

5
pom.xml

@ -195,6 +195,11 @@
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>middle-api</artifactId>
<version>${hzims.project.version}</version>
</dependency>
<dependency>
<groupId>com.hnac.hzims</groupId>
<artifactId>assets-api</artifactId>
<version>${hzims.project.version}</version>
</dependency>

Loading…
Cancel
Save