新增接口

This commit is contained in:
hzj
2024-05-16 18:53:25 +08:00
parent b1f9c45e4a
commit 165b1dc69d
23 changed files with 960 additions and 31 deletions

View File

@@ -0,0 +1,22 @@
package com.njcn.supervision.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.fallback.DeVReportManageFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 流程实例 Api 接口
*
* @author 芋道源码
*/
@FeignClient(value = ServerInfo.SUPERVISION, path = "/deVReport", fallbackFactory = DeVReportManageFeignClientFallbackFactory.class)
public interface DeVReportManageFeignClient {
@GetMapping("/updateStatus")
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
}

View File

@@ -0,0 +1,22 @@
package com.njcn.supervision.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.supervision.api.fallback.TempLineFeignClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* 流程实例 Api 接口
*
* @author 芋道源码
*/
@FeignClient(value = ServerInfo.SUPERVISION, path = "/tempLine", fallbackFactory = TempLineFeignClientFallbackFactory.class)
public interface TempLineFeignClient {
@GetMapping("/updateStatus")
HttpResult<Object> updateStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
}

View File

@@ -0,0 +1,37 @@
package com.njcn.supervision.api.fallback;
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.supervision.api.DeVReportManageFeignClient;
import com.njcn.supervision.utils.SupervisionEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author denghuajun
* @version 1.0.0
* @date 2022/3/16
*/
@Slf4j
@Component
public class DeVReportManageFeignClientFallbackFactory implements FallbackFactory<DeVReportManageFeignClient> {
@Override
public DeVReportManageFeignClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new DeVReportManageFeignClient() {
@Override
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
log.error("{}异常,降级处理,异常为:{}", "更新流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -0,0 +1,37 @@
package com.njcn.supervision.api.fallback;
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.supervision.api.TempLineFeignClient;
import com.njcn.supervision.utils.SupervisionEnumUtil;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
/**
* @author denghuajun
* @version 1.0.0
* @date 2022/3/16
*/
@Slf4j
@Component
public class TempLineFeignClientFallbackFactory implements FallbackFactory<TempLineFeignClient> {
@Override
public TempLineFeignClient create(Throwable throwable) {
//判断抛出异常是否为解码器抛出的业务异常
Enum<?> exceptionEnum = CommonResponseEnum.SERVICE_FALLBACK;
if (throwable.getCause() instanceof BusinessException) {
BusinessException businessException = (BusinessException) throwable.getCause();
exceptionEnum = SupervisionEnumUtil.getExceptionEnum(businessException.getResult());
}
Enum<?> finalExceptionEnum = exceptionEnum;
return new TempLineFeignClient() {
@Override
public HttpResult<Object> updateStatus(String businessKey, Integer status) {
log.error("{}异常,降级处理,异常为:{}", "更新流程状态", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -149,7 +149,7 @@ public class SupervisionDevMainReportParam {
private SupervisionTempDeviceReportParam supervisionTempDeviceReportParam;
private SupervisionTempLineReportParam supervisionTempLineReportParam;
// private SupervisionTempLineReportParam supervisionTempLineReportParam;
@Data
@EqualsAndHashCode(callSuper = true)

View File

@@ -1,5 +1,6 @@
package com.njcn.supervision.pojo.param.device;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
@@ -113,12 +114,14 @@ public class SupervisionTempDeviceReportParam {
* 本次终端检测时间
*/
@ApiModelProperty(value="本次终端检测时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime currentTerminalDetectionTime;
/**
* 下次终端定检时间
*/
@ApiModelProperty(value="下次终端定检时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime nextTerminalInspectionTime;
/**
@@ -173,12 +176,14 @@ public class SupervisionTempDeviceReportParam {
* 投运时间
*/
@ApiModelProperty(value="投运时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime commissioningTime;
/**
* 数据更新时间
*/
@ApiModelProperty(value="数据更新时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
private LocalDateTime dataUpdateTime;
/**

View File

@@ -1,11 +1,17 @@
package com.njcn.supervision.pojo.param.device;
import com.njcn.web.pojo.param.BaseParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
import java.util.List;
import java.util.Map;
/**
*
* Description:
@@ -20,6 +26,64 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class SupervisionTempLineReportParam {
@ApiModelProperty(value = "填报部门")
private String orgId;
/**
* 填报日期
*/
@ApiModelProperty(value="填报日期")
private LocalDate reportDate;
/**
* 填报人
*/
@ApiModelProperty(value="填报人")
private String reporter;
/**
* 所属地市
*/
@ApiModelProperty(value="所属地市")
private String city;
/**
* 工程预期投产日期
*/
@ApiModelProperty(value="工程预期投产日期")
private LocalDate expectedProductionDate;
/**
* 用户状态
*/
@ApiModelProperty(value="用户状态")
private String userStatus;
/**
* 关联干扰源用户id
*/
@ApiModelProperty(value="关联干扰源用户id")
private String userId;
/**
* 关联干扰源用户id名称
*/
@ApiModelProperty(value="关联干扰源用户id名称")
private String userName;
/**
* 监测终端编码
*/
@ApiModelProperty(value="监测终端编码")
private String monitoringTerminalCode;
/**
* 监测终端名称
*/
@ApiModelProperty(value="监测终端名称")
private String monitoringTerminalName;
/**
* 监测点名称
*/
@@ -108,7 +172,7 @@ public class SupervisionTempLineReportParam {
* 是否参与统计
*/
@ApiModelProperty(value="是否参与统计")
private Boolean isStatistical;
private String isStatistical;
/**
* 监测点对象名称
@@ -126,7 +190,7 @@ public class SupervisionTempLineReportParam {
* 是否并网点
*/
@ApiModelProperty(value="是否并网点")
private Boolean isGridConnectionPoint;
private String isGridConnectionPoint;
/**
* 监测点运行状态
@@ -151,4 +215,29 @@ public class SupervisionTempLineReportParam {
*/
@ApiModelProperty(value="电压偏差下限")
private Float voltageDeviationLowerLimit;
@ApiModelProperty("发起人自选审批人 Map")
private Map<String, List<String>> startUserSelectAssignees;
@Data
@EqualsAndHashCode(callSuper = true)
public static class SupervisionTempLineReportUpdate extends SupervisionTempLineReportParam {
@ApiModelProperty("id")
private String Id;
}
/**
* 分页查询实体
*/
@Data
@EqualsAndHashCode(callSuper = true)
public static class SupervisionTempLineReportQuery extends BaseParam {
@ApiModelProperty(value = "填报部门")
private String orgId;
}
}

View File

@@ -26,7 +26,7 @@ public class SupervisionDevMainReportPO extends BaseEntity {
/**
* id
*/
@TableId(value = "id", type = IdType.INPUT)
@TableId(value = "id", type = IdType.ASSIGN_UUID)
private String id;
/**

View File

@@ -3,11 +3,13 @@ package com.njcn.supervision.pojo.po.device;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import com.njcn.db.bo.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
/**
*
* Description:
@@ -16,15 +18,60 @@ import lombok.NoArgsConstructor;
* @author clam
* @version V1.0.0
*/
@ApiModel(description="")
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "supervision_temp_line_report")
public class SupervisionTempLineReport {
public class SupervisionTempLineReport extends BaseEntity {
@TableId(value = "id")
private String id;
@TableField(value = "org_id")
private String orgId;
/**
* 填报日期
*/
@TableField(value = "report_date")
private LocalDate reportDate;
/**
* 填报人
*/
@TableField(value = "reporter")
private String reporter;
/**
* 所属地市
*/
@TableField(value = "city")
private String city;
/**
* 工程预期投产日期
*/
@TableField(value = "expected_production_date")
private LocalDate expectedProductionDate;
/**
* 用户状态
*/
@TableField(value = "user_status")
private String userStatus;
/**
* 关联干扰源用户id
*/
@TableField(value = "user_id")
private String userId;
/**
* 关联干扰源用户id名称
*/
@TableField(value = "user_name")
private String userName;
/**
* 监测点名称
*/
@@ -84,7 +131,17 @@ public class SupervisionTempLineReport {
*/
@TableField(value = "line_id")
private String lineId;
/**
* 监测终端编码
*/
@TableField(value = "monitoring_terminal_code")
private String monitoringTerminalCode;
/**
* 监测终端名称
*/
@TableField(value = "monitoring_terminal_name")
private String monitoringTerminalName;
/**
* 测量间隔
*/
@@ -113,7 +170,7 @@ public class SupervisionTempLineReport {
* 是否参与统计
*/
@TableField(value = "is_statistical")
private Boolean isStatistical;
private String isStatistical;
/**
* 监测点对象名称
@@ -131,7 +188,7 @@ public class SupervisionTempLineReport {
* 是否并网点
*/
@TableField(value = "is_grid_connection_point")
private Boolean isGridConnectionPoint;
private String isGridConnectionPoint;
/**
* 监测点运行状态
@@ -156,4 +213,22 @@ public class SupervisionTempLineReport {
*/
@TableField(value = "voltage_deviation_lower_limit")
private Float voltageDeviationLowerLimit;
/**
* 流程实例的编号
*/
@TableField(value = "process_instance_id")
private String processInstanceId;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
@TableField(value = "`status`")
private Integer status;
/**
* 状态0-删除 1-正常
*/
@TableField(value = "`State`")
private Integer state;
}

View File

@@ -1,7 +1,6 @@
package com.njcn.supervision.pojo.vo.device;
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -147,13 +146,18 @@ public class SupervisionDevMainReportVO {
@ApiModelProperty(value = "流程实例的编号")
private String processInstanceId;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
@ApiModelProperty(value = "审批状态")
private Integer status;
@ApiModelProperty("发起人自选审批人 Map")
private Map<String, List<String>> startUserSelectAssignees;
private SupervisionTempDeviceReport supervisionTempDeviceReport;
private SupervisionTempLineReport supervisionTempLineReport;
}

View File

@@ -0,0 +1,225 @@
package com.njcn.supervision.pojo.vo.device;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
/**
*
* Description:
* Date: 2024/5/11 14:07【需求编号】
*
* @author clam
* @version V1.0.0
*/
@ApiModel(description="临时监测点信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class SupervisionTempLineReportVO {
private String id;
/**
* 填报日期
*/
@ApiModelProperty(value="填报日期")
private LocalDate reportDate;
/**
* 填报人
*/
@ApiModelProperty(value="填报人")
private String reporter;
@ApiModelProperty(value = "填报部门")
private String orgId;
@ApiModelProperty(value = "填报部门名称")
private String orgName;
/**
* 所属地市
*/
@ApiModelProperty(value="所属地市")
private String city;
/**
* 工程预期投产日期
*/
@ApiModelProperty(value="工程预期投产日期")
private LocalDate expectedProductionDate;
/**
* 用户状态
*/
@ApiModelProperty(value="用户状态")
private String userStatus;
/**
* 监测终端编码
*/
@ApiModelProperty(value="监测终端编码")
private String monitoringTerminalCode;
/**
* 监测终端名称
*/
@ApiModelProperty(value="监测终端名称")
private String monitoringTerminalName;
/**
* 关联干扰源用户id
*/
@ApiModelProperty(value="关联干扰源用户id")
private String userId;
/**
* 关联干扰源用户id名称
*/
@ApiModelProperty(value="关联干扰源用户id名称")
private String userName;
/**
* 监测点名称
*/
@ApiModelProperty(value="监测点名称")
private String lineName;
/**
* 监测点电压等级
*/
@ApiModelProperty(value="监测点电压等级")
private String voltageLevel;
/**
* 接入母线
*/
@ApiModelProperty(value="接入母线")
private String connectedBus;
/**
* 短路容量
*/
@ApiModelProperty(value="短路容量")
private Float shortCapacity;
/**
* 协议容量
*/
@ApiModelProperty(value="协议容量")
private Float dealCapacity;
/**
* 设备容量
*/
@ApiModelProperty(value="设备容量")
private Float devCapacity;
/**
* 基准容量
*/
@ApiModelProperty(value="基准容量")
private Float standardCapacity;
/**
* CT变比
*/
@ApiModelProperty(value="CT变比")
private Float ctRatio;
/**
* PT变比
*/
@ApiModelProperty(value="PT变比")
private Float ptRatio;
/**
* 监测点编号
*/
@ApiModelProperty(value="监测点编号")
private String lineId;
/**
* 测量间隔
*/
@ApiModelProperty(value="测量间隔")
private Integer timeInterval;
/**
* 干扰源类型
*/
@ApiModelProperty(value="干扰源类型")
private String loadType;
/**
* 干扰源类别
*/
@ApiModelProperty(value="干扰源类别")
private String businessType;
/**
* 监测点性质
*/
@ApiModelProperty(value="监测点性质")
private String pointNature;
/**
* 是否参与统计
*/
@ApiModelProperty(value="是否参与统计")
private Boolean isStatistical;
/**
* 监测点对象名称
*/
@ApiModelProperty(value="监测点对象名称")
private String objName;
/**
* 电网侧变电站
*/
@ApiModelProperty(value="电网侧变电站")
private String powerSubstationName;
/**
* 是否并网点
*/
@ApiModelProperty(value="是否并网点")
private Boolean isGridConnectionPoint;
/**
* 监测点运行状态
*/
@ApiModelProperty(value="监测点运行状态")
private String operationStatus;
/**
* 主接线图
*/
@ApiModelProperty(value="主接线图")
private String mainWiringDiagram;
/**
* 电压偏差上限
*/
@ApiModelProperty(value="电压偏差上限")
private Float voltageDeviationUpperLimit;
/**
* 电压偏差下限
*/
@ApiModelProperty(value="电压偏差下限")
private Float voltageDeviationLowerLimit;
/**
* 1:审批中2审批通过3审批不通过4已取消
*/
@ApiModelProperty(value = "审批状态")
private Integer status;
}