diff --git a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java index e7b3d9f..30c8d7a 100644 --- a/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java +++ b/hzims-service-api/alarm-api/src/main/java/com/hnac/hzims/alarm/config/vo/FdpAlarmVo.java @@ -19,6 +19,10 @@ public class FdpAlarmVo { */ private String faultId; /** + * 故障ID + */ + private String UUID; + /** * 故障站点 */ private String station; @@ -55,6 +59,10 @@ public class FdpAlarmVo { * 设备名称 */ private String deviceName; + /** + * 设备名称 + */ + private String deviceCode; // /** // * 报警内容 // */ diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FDPFaultListInfoDTO.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FDPFaultListInfoDTO.java new file mode 100644 index 0000000..53a9024 --- /dev/null +++ b/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; + +} diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FDPFaultTableDTO.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FDPFaultTableDTO.java new file mode 100644 index 0000000..9da9e94 --- /dev/null +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/dto/FDPFaultTableDTO.java @@ -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; + +} diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/entity/FdpFaultHistoryDataEntity.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/entity/FdpFaultHistoryDataEntity.java new file mode 100644 index 0000000..68ef354 --- /dev/null +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/entity/FdpFaultHistoryDataEntity.java @@ -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; + +/** + *

+ * + *

+ * + * @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; +} diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/entity/FdpFaultTableListEntity.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/entity/FdpFaultTableListEntity.java new file mode 100644 index 0000000..d880f4c --- /dev/null +++ b/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; + +/** + *

+ * + *

+ * + * @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; + + +} diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java index 5e8a382..695f0af 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClient.java @@ -1,7 +1,10 @@ package com.hnac.hzims.fdp.feign; import com.hnac.hzims.EquipmentConstants; +import com.hnac.hzims.fdp.dto.FDPFaultTableDTO; import com.hnac.hzims.fdp.dto.StatisticStatusDTO; +import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; +import com.hnac.hzims.fdp.vo.FdpFaultHistoryDataVo; import com.hnac.hzims.fdp.vo.StatisticStatusVO; import org.springblade.core.tool.api.R; import org.springframework.cloud.openfeign.FeignClient; @@ -23,7 +26,10 @@ import java.util.Map; public interface IFdpDiagnoseClient { String API_PREFIX = "/feign/fdp/diagnose"; String GET_STATISTIC_STATUS = API_PREFIX + "/getStatisticStatus"; - + String GET_HISTORY_DATA = API_PREFIX + "/getHistoryData"; @PostMapping(GET_STATISTIC_STATUS) R>> getStatisticStatus(@RequestBody StatisticStatusDTO req); + + @PostMapping(GET_HISTORY_DATA) + List getHistoryData(@RequestBody FDPFaultTableDTO req); } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClientFallBack.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClientFallBack.java index 9e72d09..07ee9ee 100644 --- a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClientFallBack.java +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/feign/IFdpDiagnoseClientFallBack.java @@ -1,12 +1,17 @@ package com.hnac.hzims.fdp.feign; +import com.hnac.hzims.fdp.dto.FDPFaultTableDTO; import com.hnac.hzims.fdp.dto.StatisticStatusDTO; +import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; +import com.hnac.hzims.fdp.vo.FdpFaultHistoryDataVo; import com.hnac.hzims.fdp.vo.StatisticStatusVO; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tool.api.R; import org.springframework.stereotype.Component; +import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * @author hx @@ -18,4 +23,9 @@ public class IFdpDiagnoseClientFallBack implements IFdpDiagnoseClient { public R getStatisticStatus(StatisticStatusDTO req) { return R.fail("调用接口失败"); } + + @Override + public List getHistoryData(FDPFaultTableDTO req) { + return new ArrayList<>(); + } } diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultHistoryDataVo.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultHistoryDataVo.java new file mode 100644 index 0000000..b449803 --- /dev/null +++ b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultHistoryDataVo.java @@ -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; + +/** + *

+ * + *

+ * + * @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 list; +} diff --git a/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultTableDataVo.java b/hzims-service-api/equipment-api/src/main/java/com/hnac/hzims/fdp/vo/FdpFaultTableDataVo.java new file mode 100644 index 0000000..796139f --- /dev/null +++ b/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; + +/** + *

+ * + *

+ * + * @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 list; +} diff --git a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/IInspectReportClient.java b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/IInspectReportClient.java index 50d12d5..e9da9b5 100644 --- a/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/IInspectReportClient.java +++ b/hzims-service-api/inspect-api/src/main/java/com/hnac/hzinfo/inspect/report/feign/IInspectReportClient.java @@ -23,5 +23,5 @@ public interface IInspectReportClient { @PostMapping(GET_ALARAM_REPORT) Map getAlarmReport(@RequestParam("depts") List depts, @RequestParam("date") String date); @PostMapping(GET_INSPECT_STATISTCS_BY_NAME) - List getInspectStatisticsByName(@RequestParam("depts") List depts, @RequestParam("date") String startTime, @RequestParam("date") String endTime); + List getInspectStatisticsByName(@RequestParam("depts") List depts, @RequestParam("startTime") String startTime, @RequestParam("endTime") String endTime); } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpHistoryDataController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpHistoryDataController.java new file mode 100644 index 0000000..c29bf40 --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpHistoryDataController.java @@ -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> listPage(@RequestBody FDPFaultTableDTO req) { + return service.getHistoryData(req); + } + + + +} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java new file mode 100644 index 0000000..a8b2bc1 --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/controller/FdpListTableDataController.java @@ -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); + } + +} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/FdpDiagnoseClient.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/FdpDiagnoseClient.java index 2b471b1..33f51e3 100644 --- a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/FdpDiagnoseClient.java +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/feign/FdpDiagnoseClient.java @@ -1,7 +1,11 @@ package com.hnac.hzims.fdp.feign; +import com.hnac.hzims.fdp.dto.FDPFaultTableDTO; import com.hnac.hzims.fdp.dto.StatisticStatusDTO; +import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; import com.hnac.hzims.fdp.proxy.IDiagnoseProxy; +import com.hnac.hzims.fdp.service.IFdpHistoryDataService; +import com.hnac.hzims.fdp.vo.FdpFaultHistoryDataVo; import com.hnac.hzims.fdp.vo.StatisticStatusVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -21,10 +25,17 @@ import java.util.Map; public class FdpDiagnoseClient implements IFdpDiagnoseClient { private final IDiagnoseProxy service; + private final IFdpHistoryDataService fdpHistoryDataService; @Override @PostMapping(GET_STATISTIC_STATUS) public R>> getStatisticStatus(StatisticStatusDTO req) { return service.getStatisticStatus(req); } + + @Override + @PostMapping(GET_HISTORY_DATA) + public List getHistoryData(FDPFaultTableDTO req) { + return fdpHistoryDataService.exportHistoryData(req); + } } diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpHistoryDataService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpHistoryDataService.java new file mode 100644 index 0000000..d7a9640 --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpHistoryDataService.java @@ -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 exportHistoryData(FDPFaultTableDTO req); + R> getHistoryData(FDPFaultTableDTO req); +} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpListTableDataService.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/IFdpListTableDataService.java new file mode 100644 index 0000000..b159c32 --- /dev/null +++ b/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); +} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpHistoryDataServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpHistoryDataServiceImpl.java new file mode 100644 index 0000000..9859103 --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpHistoryDataServiceImpl.java @@ -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 exportHistoryData(FDPFaultTableDTO req) { + String result = HttpRequestUtil.postCallObjectParam(req, getFaultStatusTableData, "POST"); + if (StringUtil.isNotBlank(result)) { + R fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference>() { + }); + if (fdpFaultHistoryDataVoR.isSuccess()&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData())){ + List list = fdpFaultHistoryDataVoR.getData().getList(); + return list; + } + } + return new ArrayList<>(); + } + @Override + public R> getHistoryData(FDPFaultTableDTO req) { + IPage 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 fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference>() { + }); + if (fdpFaultHistoryDataVoR.isSuccess()&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData()) + &&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData().getList())){ + List list = fdpFaultHistoryDataVoR.getData().getList(); + page.setTotal(fdpFaultHistoryDataVoR.getData().getTotalCount()); + page.setRecords(list); + } + } + return R.data(page); + } + +} diff --git a/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java new file mode 100644 index 0000000..03eb3c1 --- /dev/null +++ b/hzims-service/equipment/src/main/java/com/hnac/hzims/fdp/service/impl/FdpListTableDataServiceImpl.java @@ -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 params = new HashMap<>(); + params.put("property",property); + String result = HttpRequestUtil.postCall(params,getNeoFaultPropertyList,"POST"); + if ("STATION".equals(property)){ + List list=new ArrayList<>(); + R> res = JSONObject.parseObject(result, new TypeReference>>() { + }); + if (res.isSuccess()&& CollectionUtil.isNotEmpty(res.getData())){ + for (String s : res.getData()) { + R stationEntityR = stationClient.getStationByCode(s); + if (stationEntityR.isSuccess()&&ObjectUtil.isNotEmpty(stationEntityR.getData())){ + StationEntity station = stationEntityR.getData(); + list.add(station); + } + } + } + return R.data(list); + } + R> res = JSONObject.parseObject(result, new TypeReference>>() { + }); + return res; + } + + @Override + public R getListByProperty(FDPFaultListInfoDTO req) { + IPage 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 fdpFaultHistoryDataVoR = JSONObject.parseObject(result, new TypeReference>() { + }); + if (!fdpFaultHistoryDataVoR.isSuccess()){ + throw new WebServiceException("请求失败,请紧急联系管理员!!!"); + } + if (fdpFaultHistoryDataVoR.isSuccess()&&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData()) + &&ObjectUtil.isNotEmpty(fdpFaultHistoryDataVoR.getData().getList())){ + List list = fdpFaultHistoryDataVoR.getData().getList(); + page.setTotal(fdpFaultHistoryDataVoR.getData().getTotalCount()); + page.setRecords(list); + } + } + return R.data(page); + } +} diff --git a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java index d87a9dc..02c94ff 100644 --- a/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java +++ b/hzims-service/hzims-alarm/src/main/java/com/hnac/hzims/alarm/source/service/impl/FdpAlarmServiceImpl.java @@ -83,10 +83,12 @@ public class FdpAlarmServiceImpl implements FdpAlarmService { private AlarmEntity getAlarmEntity(FdpAlarmVo item) { AlarmEntity entity = new AlarmEntity(); - entity.setAlarmId(item.getFaultId()); + entity.setAlarmId(item.getUUID()); + entity.setRealId(item.getFaultId()); entity.setAlarmTime(item.getCreateTime()); entity.setAlarmContext(item.getFinfo()); entity.setAlarmType(EARLY); + entity.setDeviceCode(item.getDeviceCode()); entity.setDeviceName(item.getDeviceName()); entity.setAlarmStatus(Integer.valueOf(item.getStatus())); entity.setStationId(item.getStation()); diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java index 9486a83..6671d89 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/report/service/impl/OperStationMonthReportServiceImpl.java @@ -5,7 +5,9 @@ import com.alibaba.fastjson.JSON; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.hnac.hzims.common.utils.DateUtil; +import com.hnac.hzims.fdp.dto.FDPFaultTableDTO; import com.hnac.hzims.fdp.dto.StatisticStatusDTO; +import com.hnac.hzims.fdp.entity.FdpFaultHistoryDataEntity; import com.hnac.hzims.fdp.feign.IFdpDiagnoseClient; import com.hnac.hzims.fdp.vo.StatisticStatusVO; import com.hnac.hzims.operational.access.service.IOperAccessTaskService; @@ -17,6 +19,7 @@ import com.hnac.hzims.operational.duty.service.IImsDutyMainService; import com.hnac.hzims.operational.main.common.ExcelData; import com.hnac.hzims.operational.main.enums.ColumnEnum; import com.hnac.hzims.operational.main.service.IMainSystemMonitoringService; +import com.hnac.hzims.operational.maintenance.entity.OperMaintenanceTaskEntity; import com.hnac.hzims.operational.maintenance.service.IOperMaintenanceTaskService; import com.hnac.hzims.operational.report.service.IOperStationMonthReportService; import com.hnac.hzims.operational.report.vo.*; @@ -457,32 +460,38 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor pool.execute(() -> { List list=new ArrayList<>(); if (CollectionUtil.isNotEmpty(stationEntityList)) { - StbAnalysisDTO param = new StbAnalysisDTO(); - param.setStartTime(LocalDateTime.parse(fmt.format(startDate)+" 00:00:00", org.springblade.core.tool.utils.DateUtil.DATETIME_FORMATTER)); - param.setEndTime(LocalDateTime.parse(fmt.format(endDate)+" 23:59:59", org.springblade.core.tool.utils.DateUtil.DATETIME_FORMATTER)); -// param.setStartTime(startDate.atStartOfDay()); -// param.setEndTime(endDate.at()); - List collect = stationEntityList.stream().filter(s -> ObjectUtil.isNotEmpty(s.getCode())).map(StationEntity::getCode).collect(Collectors.toList()); - param.setStations(Arrays.asList("902100000026")); -// param.setPageSize(10); -// param.setPage(0); - param.setNeedPage(false); - Result> result = soeDataClient.pageStbAnalysis(param); - if(result.isSuccess() && CollectionUtil.isNotEmpty(result.getData().getRecords())){ - List data = result.getData().getRecords(); - for (int i = 0; i < data.size(); i++) { - StbAnalysisVO stbAnalysisVO = data.get(i); + FDPFaultTableDTO fdpFaultTableDTO = new FDPFaultTableDTO(); + List stationIds = stationEntityList.stream().map(StationEntity::getCode).collect(Collectors.toList()); + String[] stationIdArray = new String[stationIds.size()]; + stationIds.toArray(stationIdArray); + fdpFaultTableDTO.setStationIds(stationIdArray); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + fdpFaultTableDTO.setCreateTimeLeft(formatter.format(LocalDateTime.of(startDate, LocalTime.MIN))); + fdpFaultTableDTO.setCreateTimeRight(formatter.format(LocalDateTime.of(endDate, LocalTime.MAX))); + fdpFaultTableDTO.setPageSize(-1); + fdpFaultTableDTO.setPageIndex(-1); + fdpFaultTableDTO.setSource("auto"); + fdpFaultTableDTO.setOrderBy("CREATE_TIME"); + int index=1; + List historyData = diagnoseClient.getHistoryData(fdpFaultTableDTO); + if (CollectionUtil.isNotEmpty(historyData)) { + Map> listMap = historyData.stream().collect(Collectors.groupingBy(FdpFaultHistoryDataEntity::getFaultId)); + for (Map.Entry> stringListEntry : listMap.entrySet()) { FDPRunReportVO fdpRunReportVO=new FDPRunReportVO(); - fdpRunReportVO.setIndex(i+1); - fdpRunReportVO.setLastBeginTime(stbAnalysisVO.getTs()); - fdpRunReportVO.setContent(stbAnalysisVO.getContent()); - fdpRunReportVO.setType(stbAnalysisVO.getFtype()); - Long count = data.stream().filter(s -> stbAnalysisVO.equals(s.getFaultid())).count(); - fdpRunReportVO.setNum(count.toString()); - fdpRunReportVO.setReason(stbAnalysisVO.getFinfo()); + List fdpFaultHistoryDataEntities = stringListEntry.getValue(); + FdpFaultHistoryDataEntity fdpFaultHistoryDataEntity = fdpFaultHistoryDataEntities.get(fdpFaultHistoryDataEntities.size() - 1); + fdpRunReportVO.setIndex(index); + fdpRunReportVO.setLastBeginTime(fdpFaultHistoryDataEntity.getCreateTime()); + fdpRunReportVO.setType("智能预警"); + fdpRunReportVO.setContent(fdpFaultHistoryDataEntity.getName()); + fdpRunReportVO.setNum(String.valueOf(fdpFaultHistoryDataEntities.size())); + fdpRunReportVO.setReason(fdpFaultHistoryDataEntity.getDiagReason()); + fdpRunReportVO.setAdvise(fdpFaultHistoryDataEntity.getDiagSolution()); list.add(fdpRunReportVO); + index++; } } + stationReportAllVo.setFdpRunReportVOList(list); } countDownLatch.countDown(); }); @@ -498,12 +507,13 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor this.getStationReportConclusionV2(stationReportAllVo, params); return stationReportAllVo; } + /** * 导出统计月报 - * - * @param month 月份 - * @param stationCode 站点编码 - * @param type 导出类型 + * @param response + * @param stationReportAllVO + * @param deptId + * @throws Exception */ @Override public void exportStationMonthReport(HttpServletResponse response, StationRunReportAllVO stationReportAllVO,Long deptId) throws Exception { @@ -540,6 +550,7 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor private HashMap getHashMap(StationRunReportAllVO stationReportAllVO, Long deptId) throws IllegalAccessException { HashMap map = new HashMap<>(); map.put("deptName", stationReportAllVO.getStationName()); + map.put("yearMon", stationReportAllVO.getYearMonth()); List userListByRoleAlias = userClient.relationUserListByRoleAlias("200000", deptId, PROJECT_MANAGER).getData(); if (CollectionUtil.isNotEmpty(userListByRoleAlias)){ User user = userListByRoleAlias.get(0); @@ -1162,8 +1173,8 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor //巡检任务统计 if (CollectionUtil.isNotEmpty(stationReportAllVo.getInspectReportVOList())) { List inspectReportVOList = stationReportAllVo.getInspectReportVOList(); - int completeInspectTaskNum = inspectReportVOList.stream().filter(vo -> Func.isNotEmpty(vo.getCompleteNum())).mapToInt(RunReportVO::getCompleteNum).sum(); - int incompleteInspectTaskNum = inspectReportVOList.stream().filter(vo -> Func.isNotEmpty(vo.getIncompleteNum())).mapToInt(RunReportVO::getIncompleteNum).sum(); + int completeInspectTaskNum =inspectReportVOList.stream().filter(vo ->"合计".equals(vo.getUserName())).mapToInt(RunReportVO::getCompleteNum).sum(); + int incompleteInspectTaskNum =inspectReportVOList.stream().filter(vo ->"合计".equals(vo.getUserName())).mapToInt(RunReportVO::getIncompleteNum).sum(); if (completeInspectTaskNum == 0 && incompleteInspectTaskNum == 0) { conclusion.append("3、无巡检任务;\r\n"); } else { @@ -1208,9 +1219,10 @@ public class OperStationMonthReportServiceImpl implements IOperStationMonthRepor } // 两票 if (CollectionUtil.isNotEmpty(stationReportAllVo.getTicketInfoStatisticVOList())) { - int sum = stationReportAllVo.getTicketInfoStatisticVOList().stream().mapToInt(TicketInfoStatisticVO::getTicketInfoNumber).sum(); - int qualifiedNum = stationReportAllVo.getTicketInfoStatisticVOList().stream().mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum(); - double ticketInfoProportion = new BigDecimal(qualifiedNum / (double) sum * 100).setScale(2, RoundingMode.HALF_DOWN).doubleValue(); + int sum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoNumber).sum(); + int qualifiedNum = stationReportAllVo.getTicketInfoStatisticVOList().stream().filter(s->"合计".equals(s.getTicketInfoType())).mapToInt(TicketInfoStatisticVO::getTicketInfoQualifiedNum).sum(); +// double ticketInfoProportion = new BigDecimal(qualifiedNum ).divide(sum,2, RoundingMode.HALF_DOWN).doubleValue(); + double ticketInfoProportion = new BigDecimal(qualifiedNum ).divide(new BigDecimal(sum*100),2, RoundingMode.HALF_DOWN).doubleValue(); String phenomenonConclusion = "5、本月开票%s张,合格率%s;"; conclusion.append(String.format(phenomenonConclusion,sum,ticketInfoProportion)).append(";\r\n"); }else { diff --git a/hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx b/hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx index 843960c..db30df2 100644 Binary files a/hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx and b/hzims-service/operational/src/main/resources/template/word/stationMonthReport.docx differ