haungxing
10 months ago
20 changed files with 745 additions and 34 deletions
@ -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; |
||||
|
||||
} |
@ -0,0 +1,45 @@
|
||||
package com.hnac.hzims.fdp.dto; |
||||
|
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
/** |
||||
* @author HX |
||||
*/ |
||||
@Data |
||||
public class FDPFaultTableDTO { |
||||
|
||||
@ApiModelProperty("站点ID数组") |
||||
private String[] stationIds; |
||||
|
||||
@ApiModelProperty("故障ID") |
||||
private String faultId; |
||||
|
||||
@ApiModelProperty("筛选来源,可以为“auto”或“manual”") |
||||
private String source; |
||||
|
||||
@ApiModelProperty("故障名称模糊匹配") |
||||
private String nameLike; |
||||
|
||||
@ApiModelProperty("筛选故障处理结果,可为“处理中”、“误报”、“处理完成”、“延后处理”") |
||||
private String result; |
||||
|
||||
@ApiModelProperty("分页的每页数量,-1则为不限制数量") |
||||
private Integer pageSize; |
||||
|
||||
@ApiModelProperty("分页的序号") |
||||
private Integer pageIndex; |
||||
|
||||
@ApiModelProperty("排序方式") |
||||
private String orderBy; |
||||
|
||||
@ApiModelProperty("升降序方式,“asc”或“desc”") |
||||
private String orderKind; |
||||
|
||||
@ApiModelProperty("查询开始时间") |
||||
private String createTimeLeft; |
||||
|
||||
@ApiModelProperty("查询结束时间") |
||||
private String createTimeRight; |
||||
|
||||
} |
@ -0,0 +1,110 @@
|
||||
package com.hnac.hzims.fdp.entity; |
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField; |
||||
import com.baomidou.mybatisplus.annotation.TableField; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import io.swagger.annotations.ApiModel; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
import lombok.EqualsAndHashCode; |
||||
import org.springblade.core.tenant.mp.TenantEntity; |
||||
|
||||
/** |
||||
* <p> |
||||
* |
||||
* </p> |
||||
* |
||||
* @author ty |
||||
* @since 2024-02-05 |
||||
*/ |
||||
|
||||
@Data |
||||
public class FdpFaultHistoryDataEntity{ |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@ApiModelProperty("uuid") |
||||
@JSONField(name = "ID") |
||||
private String id; |
||||
|
||||
@ApiModelProperty(value = "故障ID") |
||||
@JSONField(name = "FAULT_ID") |
||||
private String faultId; |
||||
|
||||
|
||||
@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 = "故障发生的概率") |
||||
@JSONField(name = "STATUS") |
||||
private Float status; |
||||
|
||||
|
||||
@ApiModelProperty(value = "发生故障的时间") |
||||
@JSONField(name = "CREATE_TIME") |
||||
private String createTime; |
||||
|
||||
|
||||
@ApiModelProperty(value = "故障结束的时间") |
||||
@JSONField(name = "DELETE_TIME") |
||||
private String deleteTime; |
||||
|
||||
|
||||
@ApiModelProperty(value = "故障有效时间") |
||||
@JSONField(name = "LIFE_TIME") |
||||
private String lifeTime; |
||||
|
||||
|
||||
@ApiModelProperty(value = "故障优先级,越大优先级越高") |
||||
@JSONField(name = "PRIORITY") |
||||
private String priority; |
||||
|
||||
@ApiModelProperty(value = "来源") |
||||
@JSONField(name = "SOURCE") |
||||
private String source; |
||||
|
||||
@ApiModelProperty(value = "故障的其它信息") |
||||
@JSONField(name = "INFO") |
||||
private String info; |
||||
|
||||
@ApiModelProperty(value = "故障的业务ID") |
||||
@JSONField(name = "TASK_ID") |
||||
private String taskId; |
||||
|
||||
@ApiModelProperty(value = "故障处理结果,可为“处理中”、“误报”、“处理完成”、“延后处理”") |
||||
@JSONField(name = "RESULT") |
||||
private String result; |
||||
|
||||
@ApiModelProperty(value = "关于误报、延后处理的其它补充信息") |
||||
@JSONField(name = "RESULT_INFO") |
||||
private String resultInfo; |
||||
|
||||
@ApiModelProperty(value = "诊断的原因") |
||||
@JSONField(name = "DIAG_REASON") |
||||
private String diagReason; |
||||
|
||||
@ApiModelProperty(value = "诊断的解决方法") |
||||
@JSONField(name = "DIAG_SOLUTION") |
||||
private String diagSolution; |
||||
|
||||
@ApiModelProperty(value = "创建故障人") |
||||
@JSONField(name = "CREATE_USER") |
||||
private String createUser; |
||||
|
||||
@ApiModelProperty(value = "故障结束标记") |
||||
@JSONField(name = "IS_DELETED") |
||||
private Integer isDeleted; |
||||
} |
@ -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; |
||||
|
||||
|
||||
} |
@ -0,0 +1,29 @@
|
||||
package com.hnac.hzims.fdp.vo; |
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField; |
||||
import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; |
||||
import io.swagger.annotations.ApiModelProperty; |
||||
import lombok.Data; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* <p> |
||||
* |
||||
* </p> |
||||
* |
||||
* @author ty |
||||
* @since 2024-02-05 |
||||
*/ |
||||
|
||||
@Data |
||||
public class FdpFaultHistoryDataVo { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
@ApiModelProperty(value = "") |
||||
@JSONField(name = "totalCount") |
||||
private Integer totalCount; |
||||
@ApiModelProperty(value = "") |
||||
@JSONField(name = "list") |
||||
private List<FdpFaultHistoryDataEntity> list; |
||||
} |
@ -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; |
||||
} |
@ -0,0 +1,65 @@
|
||||
package com.hnac.hzims.fdp.controller; |
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
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.FDPFaultTableDTO; |
||||
import com.hnac.hzims.fdp.dto.FdpTaskDTO; |
||||
import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; |
||||
import com.hnac.hzims.fdp.entity.FdpTaskEntity; |
||||
import com.hnac.hzims.fdp.service.IFdpHistoryDataService; |
||||
import com.hnac.hzims.fdp.service.IFdpTaskService; |
||||
import com.hnac.hzims.fdp.vo.FdpTaskVO; |
||||
import com.hnac.hzims.fdp.vo.TaskStatisticsVo; |
||||
import com.hnac.hzims.fdp.wrapper.FdpTaskWrapper; |
||||
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; |
||||
import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; |
||||
import io.swagger.annotations.Api; |
||||
import io.swagger.annotations.ApiOperation; |
||||
import io.swagger.annotations.ApiParam; |
||||
import lombok.AllArgsConstructor; |
||||
import org.springblade.core.boot.ctrl.BladeController; |
||||
import org.springblade.core.log.annotation.ApiLog; |
||||
import org.springblade.core.mp.support.Condition; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.Func; |
||||
import org.springblade.core.tool.utils.ObjectUtil; |
||||
import org.springblade.core.tool.utils.StringUtil; |
||||
import org.springframework.web.bind.annotation.*; |
||||
|
||||
import javax.validation.Valid; |
||||
|
||||
/** |
||||
* 故障诊断任务表 |
||||
* |
||||
* @author ty |
||||
* @created 2024-02-05 |
||||
**/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/fdp/history") |
||||
@Api(tags = "故障诊断任务表") |
||||
public class FdpHistoryDataController extends BladeController { |
||||
|
||||
private final IFdpHistoryDataService service; |
||||
/** |
||||
* 分页 |
||||
*/ |
||||
@ApiLog |
||||
@PostMapping("/listPage") |
||||
@ApiOperationSupport(order = 50) |
||||
@ApiOperation(value = "分页 查询参数:name,emId,faultId,reasonId,satisfaction") |
||||
@OperationAnnotation(moduleName = "智能诊断",title = "智能诊断任务",operatorType = OperatorType.MOBILE,businessType = |
||||
BusinessType.GENCODE, |
||||
action = "分页查询智能诊断任务列表") |
||||
public R<IPage<FdpFaultHistoryDataEntity>> listPage(@RequestBody FDPFaultTableDTO req) { |
||||
return service.getHistoryData(req); |
||||
} |
||||
|
||||
|
||||
|
||||
} |
@ -0,0 +1,59 @@
|
||||
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.*; |
||||
|
||||
import javax.annotation.Resource; |
||||
|
||||
|
||||
/** |
||||
* 故障诊断任务表 |
||||
* |
||||
* @author ty |
||||
* @created 2024-02-05 |
||||
**/ |
||||
@RestController |
||||
@AllArgsConstructor |
||||
@RequestMapping("/fdp/list/table") |
||||
@Api(tags = "故障诊断任务表") |
||||
public class FdpListTableDataController extends BladeController { |
||||
|
||||
@Resource |
||||
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); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,31 @@
|
||||
package com.hnac.hzims.fdp.service; |
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
import com.hnac.hzims.fdp.dto.FDPFaultTableDTO; |
||||
import com.hnac.hzims.fdp.dto.FdpTaskDTO; |
||||
import com.hnac.hzims.fdp.dto.StatisticStatusDTO; |
||||
import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; |
||||
import com.hnac.hzims.fdp.entity.FdpTaskEntity; |
||||
import com.hnac.hzims.fdp.vo.FdpFaultHistoryDataVo; |
||||
import com.hnac.hzims.fdp.vo.FdpTaskVO; |
||||
import com.hnac.hzims.fdp.vo.TaskStatisticsVo; |
||||
import com.hnac.hzims.operational.defect.entity.OperPhenomenonEntity; |
||||
import com.hnac.hzims.operational.defect.vo.OperPhenomenonVO; |
||||
import org.springblade.core.mp.base.BaseService; |
||||
import org.springblade.core.mp.support.Query; |
||||
import org.springblade.core.tool.api.R; |
||||
|
||||
import java.util.List; |
||||
|
||||
/** |
||||
* 服务类 |
||||
* |
||||
* @author ty |
||||
* @created 2024-02-06 |
||||
**/ |
||||
public interface IFdpHistoryDataService{ |
||||
|
||||
|
||||
List<FdpFaultHistoryDataEntity> exportHistoryData(FDPFaultTableDTO req); |
||||
R<IPage<FdpFaultHistoryDataEntity>> getHistoryData(FDPFaultTableDTO req); |
||||
} |
@ -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); |
||||
} |
@ -0,0 +1,73 @@
|
||||
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.FDPFaultTableDTO; |
||||
import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; |
||||
import com.hnac.hzims.fdp.service.IFdpHistoryDataService; |
||||
import com.hnac.hzims.fdp.util.HttpRequestUtil; |
||||
import com.hnac.hzims.fdp.vo.FdpFaultHistoryDataVo; |
||||
import lombok.AllArgsConstructor; |
||||
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 java.util.*; |
||||
|
||||
|
||||
/** |
||||
* @author hx |
||||
* @version 1.0 |
||||
* @date 2023/3/6 10:18 |
||||
*/ |
||||
@Service |
||||
@RequiredArgsConstructor |
||||
@Slf4j |
||||
public class FdpHistoryDataServiceImpl implements IFdpHistoryDataService { |
||||
@Value("${url.getFaultStatusTableData}") |
||||
private String getFaultStatusTableData; |
||||
@Override |
||||
public List<FdpFaultHistoryDataEntity> exportHistoryData(FDPFaultTableDTO req) { |
||||
String result = HttpRequestUtil.postCallObjectParam(req, getFaultStatusTableData, "POST"); |
||||
if (StringUtil.isNotBlank(result)) { |
||||
R<FdpFaultHistoryDataVo> fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference<R<FdpFaultHistoryDataVo>>() { |
||||
}); |
||||
if (fdpFaultHistoryDataVoR.isSuccess()&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData())){ |
||||
List<FdpFaultHistoryDataEntity> list = fdpFaultHistoryDataVoR.getData().getList(); |
||||
return list; |
||||
} |
||||
} |
||||
return new ArrayList<>(); |
||||
} |
||||
@Override |
||||
public R<IPage<FdpFaultHistoryDataEntity>> getHistoryData(FDPFaultTableDTO req) { |
||||
IPage<FdpFaultHistoryDataEntity> page = new Page<>(); |
||||
page.setSize(req.getPageSize()); |
||||
page.setCurrent(req.getPageIndex()); |
||||
req.setOrderBy("CREATE_TIME"); |
||||
if (StringUtil.isBlank(req.getSource())){ |
||||
req.setSource("auto"); |
||||
} |
||||
String result = HttpRequestUtil.postCallObjectParam(req, getFaultStatusTableData, "POST"); |
||||
if (StringUtil.isNotBlank(result)) { |
||||
R<FdpFaultHistoryDataVo> fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference<R<FdpFaultHistoryDataVo>>() { |
||||
}); |
||||
if (fdpFaultHistoryDataVoR.isSuccess()&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData()) |
||||
&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData().getList())){ |
||||
List<FdpFaultHistoryDataEntity> list = fdpFaultHistoryDataVoR.getData().getList(); |
||||
page.setTotal(fdpFaultHistoryDataVoR.getData().getTotalCount()); |
||||
page.setRecords(list); |
||||
} |
||||
} |
||||
return R.data(page); |
||||
} |
||||
|
||||
} |
@ -0,0 +1,97 @@
|
||||
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 com.hnac.hzims.operational.station.entity.StationEntity; |
||||
import com.hnac.hzims.operational.station.feign.IStationClient; |
||||
import lombok.RequiredArgsConstructor; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springblade.core.tool.api.R; |
||||
import org.springblade.core.tool.utils.CollectionUtil; |
||||
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.annotation.Resource; |
||||
import javax.xml.ws.WebServiceException; |
||||
import java.util.ArrayList; |
||||
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 { |
||||
@Resource |
||||
private IStationClient stationClient; |
||||
@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"); |
||||
if ("STATION".equals(property)){ |
||||
List<StationEntity> list=new ArrayList<>(); |
||||
R<List<String>> res = JSONObject.parseObject(result, new TypeReference<R<List<String>>>() { |
||||
}); |
||||
if (res.isSuccess()&& CollectionUtil.isNotEmpty(res.getData())){ |
||||
for (String s : res.getData()) { |
||||
R<StationEntity> stationEntityR = stationClient.getStationByCode(s); |
||||
if (stationEntityR.isSuccess()&&ObjectUtil.isNotEmpty(stationEntityR.getData())){ |
||||
StationEntity station = stationEntityR.getData(); |
||||
list.add(station); |
||||
} |
||||
} |
||||
} |
||||
return R.data(list); |
||||
} |
||||
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); |
||||
} |
||||
} |
Binary file not shown.
Loading…
Reference in new issue