Browse Source

新增智能诊断列表页接口

zhongwei
ty 10 months ago
parent
commit
89aebc0dda
  1. 46
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FDPFaultListInfoDTO.java
  2. 58
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/entity/FdpFaultTableListEntity.java
  3. 30
      hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultTableDataVo.java
  4. 56
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java
  5. 4
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpHistoryDataService.java
  6. 19
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpListTableDataService.java
  7. 75
      hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

46
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FDPFaultListInfoDTO.java

@ -0,0 +1,46 @@
package com.hnac.hzims.fdp.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author ty
*/
@Data
public class FDPFaultListInfoDTO {
@ApiModelProperty("站点ID数组")
private String stationId;
@ApiModelProperty("设备名称")
private String deviceName;
@ApiModelProperty("故障的专业”")
private String field;
@ApiModelProperty("筛选是否用于展示")
private Integer display;
@ApiModelProperty("筛选是否是根因")
private Integer isRoot;
@ApiModelProperty("故障名称模糊匹配")
private String nameLike;
@ApiModelProperty("模糊匹配故障位置")
private String ordLike;
@ApiModelProperty("分页的每页数量,-1则为不限制数量")
private Integer pageSize;
@ApiModelProperty("分页的序号")
private Integer pageIndex;
@ApiModelProperty("排序方式")
private String orderBy;
@ApiModelProperty("升降序方式,“asc”或“desc”")
private String orderKind;
}

58
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/entity/FdpFaultTableListEntity.java

@ -0,0 +1,58 @@
package com.hnac.hzims.fdp.entity;
import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* <p>
*
* </p>
*
* @author ty
* @since 2024-02-05
*/
@Data
public class FdpFaultTableListEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("ID")
@JSONField(name = "ID")
private String id;
@ApiModelProperty(value = "站点ID")
@JSONField(name = "STATION")
private String station;
@ApiModelProperty(value = "位置")
@JSONField(name = "ORD")
private String ord;
@ApiModelProperty(value = "名称")
@JSONField(name = "NAME")
private String name;
@ApiModelProperty(value = "故障ID")
@JSONField(name = "FIELD")
private String field;
@ApiModelProperty(value = "故障所属设备ID")
@JSONField(name = "DEVICE_ID")
private String deviceId;
@ApiModelProperty(value = "故障所属设备名称")
@JSONField(name = "DEVICE_NAME")
private String deviceName;
@ApiModelProperty(value = "故障描述")
@JSONField(name = "INFO")
private String info;
}

30
hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultTableDataVo.java

@ -0,0 +1,30 @@
package com.hnac.hzims.fdp.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity;
import com.hnac.hzims.fdp.entity.FdpFaultTableListEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
/**
* <p>
*
* </p>
*
* @author ty
* @since 2024-02-05
*/
@Data
public class FdpFaultTableDataVo {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "")
@JSONField(name = "totalCount")
private Integer totalCount;
@ApiModelProperty(value = "")
@JSONField(name = "list")
private List<FdpFaultTableListEntity> list;
}

56
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java

@ -0,0 +1,56 @@
package com.hnac.hzims.fdp.controller;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import com.hnac.hzims.common.logs.annotation.OperationAnnotation;
import com.hnac.hzims.common.logs.enums.BusinessType;
import com.hnac.hzims.common.logs.enums.OperatorType;
import com.hnac.hzims.fdp.dto.FDPFaultListInfoDTO;
import com.hnac.hzims.fdp.service.IFdpListTableDataService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springblade.core.boot.ctrl.BladeController;
import org.springblade.core.log.annotation.ApiLog;
import org.springblade.core.tool.api.R;
import org.springframework.web.bind.annotation.*;
/**
* 故障诊断任务表
*
* @author ty
* @created 2024-02-05
**/
@RestController
@AllArgsConstructor
@RequestMapping("/fdp/list/table")
@Api(tags = "故障诊断任务表")
public class FdpListTableDataController extends BladeController {
private final IFdpListTableDataService service;
/**
* 分页
*/
@ApiLog
@GetMapping("/getProperty")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:name,emId,faultId,reasonId,satisfaction")
@OperationAnnotation(moduleName = "智能诊断",title = "智能诊断任务",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "分页查询智能诊断任务列表")
public R getProperty(String property) {
return service.getProperty(property);
}
@ApiLog
@PostMapping ("/getListByProperty")
@ApiOperationSupport(order = 50)
@ApiOperation(value = "分页 查询参数:name,emId,faultId,reasonId,satisfaction")
@OperationAnnotation(moduleName = "智能诊断",title = "智能诊断任务",operatorType = OperatorType.MOBILE,businessType =
BusinessType.GENCODE,
action = "分页查询智能诊断任务列表")
public R getListByProperty(@RequestBody FDPFaultListInfoDTO req) {
return service.getListByProperty(req);
}
}

4
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpHistoryDataService.java

@ -20,8 +20,8 @@ import java.util.List;
/**
* 服务类
*
* @author xiashandong
* @created 2021-05-25 17:32
* @author ty
* @created 2024-02-06
**/
public interface IFdpHistoryDataService{

19
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpListTableDataService.java

@ -0,0 +1,19 @@
package com.hnac.hzims.fdp.service;
import com.hnac.hzims.fdp.dto.FDPFaultListInfoDTO;
import org.springblade.core.tool.api.R;
/**
* 服务类
*
* @author ty
* @created 2024-02-06
**/
public interface IFdpListTableDataService {
R getProperty(String property);
R getListByProperty(FDPFaultListInfoDTO req);
}

75
hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java

@ -0,0 +1,75 @@
package com.hnac.hzims.fdp.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hnac.hzims.fdp.dto.FDPFaultListInfoDTO;
import com.hnac.hzims.fdp.entity.FdpFaultTableListEntity;
import com.hnac.hzims.fdp.service.IFdpListTableDataService;
import com.hnac.hzims.fdp.util.HttpRequestUtil;
import com.hnac.hzims.fdp.vo.FdpFaultTableDataVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springblade.core.tool.api.R;
import org.springblade.core.tool.utils.ObjectUtil;
import org.springblade.core.tool.utils.StringUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import javax.xml.ws.WebServiceException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @author hx
* @version 1.0
* @date 2023/3/6 10:18
*/
@Service
@RequiredArgsConstructor
@Slf4j
public class FdpListTableDataServiceImpl implements IFdpListTableDataService {
@Value("${url.getNeoFaultPropertyList}")
private String getNeoFaultPropertyList;
@Value("${url.getNeoFaultTableData}")
private String getNeoFaultTableData;
@Override
public R getProperty(String property) {
Map<String,Object> params = new HashMap<>();
params.put("property",property);
String result = HttpRequestUtil.postCall(params,getNeoFaultPropertyList,"POST");
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() {
});
return res;
}
@Override
public R getListByProperty(FDPFaultListInfoDTO req) {
IPage<FdpFaultTableListEntity> page = new Page<>();
page.setSize(req.getPageSize());
page.setCurrent(req.getPageIndex());
req.setDisplay(1);
req.setIsRoot(1);
req.setOrderBy("NAME");
req.setOrderKind("desc");
String result = HttpRequestUtil.postCallObjectParam(req, getNeoFaultTableData, "POST");
if (StringUtil.isNotBlank(result)) {
R<FdpFaultTableDataVo> fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference<R<FdpFaultTableDataVo>>() {
});
if (!fdpFaultHistoryDataVoR.isSuccess()){
throw new WebServiceException("请求失败,请紧急联系管理员!!!");
}
if (fdpFaultHistoryDataVoR.isSuccess()&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData())
&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData().getList())){
List<FdpFaultTableListEntity> list = fdpFaultHistoryDataVoR.getData().getList();
page.setTotal(fdpFaultHistoryDataVoR.getData().getTotalCount());
page.setRecords(list);
}
}
return R.data(page);
}
}
Loading…
Cancel
Save