新增接口
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.bpm.listener.business;
|
||||||
|
|
||||||
|
import com.njcn.bpm.listener.BpmProcessInstanceStatusEvent;
|
||||||
|
import com.njcn.bpm.listener.BpmProcessInstanceStatusEventListener;
|
||||||
|
import com.njcn.supervision.api.DeVReportManageFeignClient;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class BpmDevReportStatusListener extends BpmProcessInstanceStatusEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private DeVReportManageFeignClient deVReportManageFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
return "device_info_add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||||
|
deVReportManageFeignClient.updateStatus(event.getBusinessKey(), event.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.njcn.bpm.listener.business;
|
||||||
|
|
||||||
|
import com.njcn.bpm.listener.BpmProcessInstanceStatusEvent;
|
||||||
|
import com.njcn.bpm.listener.BpmProcessInstanceStatusEventListener;
|
||||||
|
import com.njcn.supervision.api.TempLineFeignClient;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class BpmTempLineStatusListener extends BpmProcessInstanceStatusEventListener {
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private TempLineFeignClient tempLineFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected String getProcessDefinitionKey() {
|
||||||
|
return "temp_line_info_add";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onEvent(BpmProcessInstanceStatusEvent event) {
|
||||||
|
tempLineFeignClient.updateStatus(event.getBusinessKey(), event.getStatus());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -77,7 +77,8 @@ public class Knife4jSwaggerConfig {
|
|||||||
"com.njcn.zlevent.controller",
|
"com.njcn.zlevent.controller",
|
||||||
"com.njcn.cloud.controller",
|
"com.njcn.cloud.controller",
|
||||||
"com.njcn.zlevent.controller",
|
"com.njcn.zlevent.controller",
|
||||||
"com.njcn.prepare"
|
"com.njcn.prepare",
|
||||||
|
"com.njcn.supervision.controller"
|
||||||
)
|
)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
List<GrantType> grantTypes = new ArrayList<>();
|
List<GrantType> grantTypes = new ArrayList<>();
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -149,7 +149,7 @@ public class SupervisionDevMainReportParam {
|
|||||||
|
|
||||||
private SupervisionTempDeviceReportParam supervisionTempDeviceReportParam;
|
private SupervisionTempDeviceReportParam supervisionTempDeviceReportParam;
|
||||||
|
|
||||||
private SupervisionTempLineReportParam supervisionTempLineReportParam;
|
// private SupervisionTempLineReportParam supervisionTempLineReportParam;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.njcn.supervision.pojo.param.device;
|
package com.njcn.supervision.pojo.param.device;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
@@ -113,12 +114,14 @@ public class SupervisionTempDeviceReportParam {
|
|||||||
* 本次终端检测时间
|
* 本次终端检测时间
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="本次终端检测时间")
|
@ApiModelProperty(value="本次终端检测时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime currentTerminalDetectionTime;
|
private LocalDateTime currentTerminalDetectionTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下次终端定检时间
|
* 下次终端定检时间
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="下次终端定检时间")
|
@ApiModelProperty(value="下次终端定检时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime nextTerminalInspectionTime;
|
private LocalDateTime nextTerminalInspectionTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -173,12 +176,14 @@ public class SupervisionTempDeviceReportParam {
|
|||||||
* 投运时间
|
* 投运时间
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="投运时间")
|
@ApiModelProperty(value="投运时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime commissioningTime;
|
private LocalDateTime commissioningTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 数据更新时间
|
* 数据更新时间
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="数据更新时间")
|
@ApiModelProperty(value="数据更新时间")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||||
private LocalDateTime dataUpdateTime;
|
private LocalDateTime dataUpdateTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,11 +1,17 @@
|
|||||||
package com.njcn.supervision.pojo.param.device;
|
package com.njcn.supervision.pojo.param.device;
|
||||||
|
|
||||||
|
import com.njcn.web.pojo.param.BaseParam;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -20,6 +26,64 @@ import lombok.NoArgsConstructor;
|
|||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class SupervisionTempLineReportParam {
|
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="是否参与统计")
|
@ApiModelProperty(value="是否参与统计")
|
||||||
private Boolean isStatistical;
|
private String isStatistical;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点对象名称
|
* 监测点对象名称
|
||||||
@@ -126,7 +190,7 @@ public class SupervisionTempLineReportParam {
|
|||||||
* 是否并网点
|
* 是否并网点
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="是否并网点")
|
@ApiModelProperty(value="是否并网点")
|
||||||
private Boolean isGridConnectionPoint;
|
private String isGridConnectionPoint;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点运行状态
|
* 监测点运行状态
|
||||||
@@ -151,4 +215,29 @@ public class SupervisionTempLineReportParam {
|
|||||||
*/
|
*/
|
||||||
@ApiModelProperty(value="电压偏差下限")
|
@ApiModelProperty(value="电压偏差下限")
|
||||||
private Float voltageDeviationLowerLimit;
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -26,7 +26,7 @@ public class SupervisionDevMainReportPO extends BaseEntity {
|
|||||||
/**
|
/**
|
||||||
* id
|
* id
|
||||||
*/
|
*/
|
||||||
@TableId(value = "id", type = IdType.INPUT)
|
@TableId(value = "id", type = IdType.ASSIGN_UUID)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,11 +3,13 @@ package com.njcn.supervision.pojo.po.device;
|
|||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import io.swagger.annotations.ApiModel;
|
import com.njcn.db.bo.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -16,15 +18,60 @@ import lombok.NoArgsConstructor;
|
|||||||
* @author clam
|
* @author clam
|
||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@ApiModel(description="")
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@TableName(value = "supervision_temp_line_report")
|
@TableName(value = "supervision_temp_line_report")
|
||||||
public class SupervisionTempLineReport {
|
public class SupervisionTempLineReport extends BaseEntity {
|
||||||
@TableId(value = "id")
|
@TableId(value = "id")
|
||||||
private String 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")
|
@TableField(value = "line_id")
|
||||||
private String lineId;
|
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")
|
@TableField(value = "is_statistical")
|
||||||
private Boolean isStatistical;
|
private String isStatistical;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 监测点对象名称
|
* 监测点对象名称
|
||||||
@@ -131,7 +188,7 @@ public class SupervisionTempLineReport {
|
|||||||
* 是否并网点
|
* 是否并网点
|
||||||
*/
|
*/
|
||||||
@TableField(value = "is_grid_connection_point")
|
@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")
|
@TableField(value = "voltage_deviation_lower_limit")
|
||||||
private Float voltageDeviationLowerLimit;
|
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;
|
||||||
}
|
}
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
package com.njcn.supervision.pojo.vo.device;
|
package com.njcn.supervision.pojo.vo.device;
|
||||||
|
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -147,13 +146,18 @@ public class SupervisionDevMainReportVO {
|
|||||||
@ApiModelProperty(value = "流程实例的编号")
|
@ApiModelProperty(value = "流程实例的编号")
|
||||||
private String processInstanceId;
|
private String processInstanceId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 1:审批中;2:审批通过;3:审批不通过;4:已取消
|
||||||
|
*/
|
||||||
|
@ApiModelProperty(value = "审批状态")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty("发起人自选审批人 Map")
|
@ApiModelProperty("发起人自选审批人 Map")
|
||||||
private Map<String, List<String>> startUserSelectAssignees;
|
private Map<String, List<String>> startUserSelectAssignees;
|
||||||
|
|
||||||
private SupervisionTempDeviceReport supervisionTempDeviceReport;
|
private SupervisionTempDeviceReport supervisionTempDeviceReport;
|
||||||
|
|
||||||
private SupervisionTempLineReport supervisionTempLineReport;
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -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;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -41,6 +41,11 @@
|
|||||||
<artifactId>pq-device-api</artifactId>
|
<artifactId>pq-device-api</artifactId>
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.njcn</groupId>
|
||||||
|
<artifactId>common-swagger</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.njcn</groupId>
|
<groupId>com.njcn</groupId>
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.njcn.supervision.controller.device;
|
package com.njcn.supervision.controller.device;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.common.pojo.annotation.OperateInfo;
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
import com.njcn.common.pojo.constant.OperateType;
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
import com.njcn.common.pojo.enums.common.LogEnum;
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
@@ -8,12 +9,14 @@ import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
|||||||
import com.njcn.common.pojo.response.HttpResult;
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
import com.njcn.common.utils.HttpResultUtil;
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||||
|
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||||
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
||||||
import com.njcn.web.controller.BaseController;
|
import com.njcn.web.controller.BaseController;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiImplicitParam;
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -81,4 +84,40 @@ public class DeVReportManageController extends BaseController {
|
|||||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/updateStatus")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@Operation(summary = "更改表单状态")
|
||||||
|
public HttpResult<Object> updateStatus(String businessKey,Integer status) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateStatus");
|
||||||
|
supervisionDevMainReportPOService.updateStatus(businessKey,status);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/cancel")
|
||||||
|
@ApiOperation("取消设备录入")
|
||||||
|
@ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true)
|
||||||
|
public HttpResult<String> cancelDevMainReport(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
String methodDescribe = getMethodDescribe("cancelDevMainReport");
|
||||||
|
String id = supervisionDevMainReportPOService.cancelDevMainReport(cancelReqVO);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/getDeviceList")
|
||||||
|
@ApiOperation("获取监测点绑定设备列表")
|
||||||
|
public HttpResult<List<SupervisionTempDeviceReport>> getDeviceList() {
|
||||||
|
String methodDescribe = getMethodDescribe("getDeviceList");
|
||||||
|
List<SupervisionTempDeviceReport> id = supervisionDevMainReportPOService.getDeviceList();
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||||
|
}
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/queryDeviceDetail")
|
||||||
|
@ApiOperation("查询设备详情")
|
||||||
|
public HttpResult<SupervisionDevMainReportVO> queryDeviceDetail(@RequestParam("id") String id){
|
||||||
|
String methodDescribe = getMethodDescribe("queryDeviceDetail");
|
||||||
|
SupervisionDevMainReportVO vo = supervisionDevMainReportPOService.querySurveyDetail(id);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, vo, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,81 @@
|
|||||||
|
package com.njcn.supervision.controller.device;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.common.pojo.annotation.OperateInfo;
|
||||||
|
import com.njcn.common.pojo.constant.OperateType;
|
||||||
|
import com.njcn.common.pojo.enums.common.LogEnum;
|
||||||
|
import com.njcn.common.pojo.enums.response.CommonResponseEnum;
|
||||||
|
import com.njcn.common.pojo.response.HttpResult;
|
||||||
|
import com.njcn.common.utils.HttpResultUtil;
|
||||||
|
import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
||||||
|
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
||||||
|
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
||||||
|
import com.njcn.web.controller.BaseController;
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiImplicitParam;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 干扰源用户管理
|
||||||
|
*
|
||||||
|
* @author qijian
|
||||||
|
* @version 1.0.0
|
||||||
|
* @createTime 2022/11/11 - 9:20
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/tempLine")
|
||||||
|
@Api(tags = "电能质量临时监测点管理")
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TempLineController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
|
private final SupervisionTempLineReportService supervisionTempLineReportService;
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON,operateType= OperateType.ADD)
|
||||||
|
@PostMapping("/add")
|
||||||
|
@ApiOperation("新增临时监测点管理")
|
||||||
|
@ApiImplicitParam(name = "supervisionTempLineReportParam", value = "实体参数", required = true)
|
||||||
|
public HttpResult<String> addTempLineReport(@RequestBody @Validated SupervisionTempLineReportParam supervisionTempLineReportParam){
|
||||||
|
String methodDescribe = getMethodDescribe("addTempLineReport");
|
||||||
|
String tempLineId = supervisionTempLineReportService.addTempLineReport(supervisionTempLineReportParam);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, tempLineId, methodDescribe);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@PostMapping("/list")
|
||||||
|
@ApiOperation("分页查询当前用户能看到的接入监测装置设备")
|
||||||
|
@ApiImplicitParam(name = "supervisionTempLineReportQuery", value = "参数", required = true)
|
||||||
|
public HttpResult<Page<SupervisionTempLineReportVO>> getTempLineReport(@RequestBody @Validated SupervisionTempLineReportParam.SupervisionTempLineReportQuery supervisionTempLineReportQuery) {
|
||||||
|
String methodDescribe = getMethodDescribe("getTempLineReport");
|
||||||
|
Page<SupervisionTempLineReportVO> out = supervisionTempLineReportService.getTempLineReport(supervisionTempLineReportQuery);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, out, methodDescribe);
|
||||||
|
}
|
||||||
|
@GetMapping("/updateStatus")
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON)
|
||||||
|
@Operation(summary = "更改表单状态")
|
||||||
|
public HttpResult<Object> updateStatus(String businessKey,Integer status) {
|
||||||
|
String methodDescribe = getMethodDescribe("updateStatus");
|
||||||
|
supervisionTempLineReportService.updateStatus(businessKey,status);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
@OperateInfo(info = LogEnum.BUSINESS_COMMON, operateType = OperateType.ADD)
|
||||||
|
@PostMapping("/cancel")
|
||||||
|
@ApiOperation("取消设备录入")
|
||||||
|
@ApiImplicitParam(name = "cancelReqVO", value = "取消原因", required = true)
|
||||||
|
public HttpResult<String> cancelTempLineReport(@Validated @RequestBody BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
String methodDescribe = getMethodDescribe("cancelTempLineReport");
|
||||||
|
String id = supervisionTempLineReportService.cancelTempLineReport(cancelReqVO);
|
||||||
|
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, id, methodDescribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,7 +1,11 @@
|
|||||||
package com.njcn.supervision.mapper.device;
|
package com.njcn.supervision.mapper.device;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||||
|
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -12,4 +16,5 @@ import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
public interface SupervisionTempLineReportMapper extends BaseMapper<SupervisionTempLineReport> {
|
public interface SupervisionTempLineReportMapper extends BaseMapper<SupervisionTempLineReport> {
|
||||||
|
Page<SupervisionTempLineReportVO> page(Page<Object> objectPage, @Param("ew") QueryWrapper<SupervisionTempLineReport> quitRunningDeviceVOQueryWrapper);
|
||||||
}
|
}
|
||||||
@@ -35,4 +35,11 @@
|
|||||||
point_nature, is_statistical, Obj_Name, Power_Substation_Name, is_grid_connection_point,
|
point_nature, is_statistical, Obj_Name, Power_Substation_Name, is_grid_connection_point,
|
||||||
operation_status, main_wiring_diagram, voltage_deviation_upper_limit, voltage_deviation_lower_limit
|
operation_status, main_wiring_diagram, voltage_deviation_upper_limit, voltage_deviation_lower_limit
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
|
<select id="page" resultType="com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO">
|
||||||
|
SELECT
|
||||||
|
*
|
||||||
|
FROM supervision_temp_line_report supervision_temp_line_report
|
||||||
|
WHERE ${ew.sqlSegment}
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -2,8 +2,10 @@ package com.njcn.supervision.service.device;
|
|||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||||
|
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -26,4 +28,12 @@ public interface SupervisionDevMainReportPOService extends IService<SupervisionD
|
|||||||
Boolean removeDevReport(List<String> ids);
|
Boolean removeDevReport(List<String> ids);
|
||||||
|
|
||||||
Page<SupervisionDevMainReportVO> getDevReport(SupervisionDevMainReportParam.SupervisionDevMainReportQuery supervisionDevMainReportQuery);
|
Page<SupervisionDevMainReportVO> getDevReport(SupervisionDevMainReportParam.SupervisionDevMainReportQuery supervisionDevMainReportQuery);
|
||||||
|
|
||||||
|
void updateStatus(String businessKey, Integer status);
|
||||||
|
|
||||||
|
String cancelDevMainReport(BpmProcessInstanceCancelParam cancelReqVO);
|
||||||
|
|
||||||
|
List<SupervisionTempDeviceReport> getDeviceList();
|
||||||
|
|
||||||
|
SupervisionDevMainReportVO querySurveyDetail(String id);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,12 @@
|
|||||||
package com.njcn.supervision.service.device;
|
package com.njcn.supervision.service.device;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -13,4 +18,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||||||
public interface SupervisionTempLineReportService extends IService<SupervisionTempLineReport>{
|
public interface SupervisionTempLineReportService extends IService<SupervisionTempLineReport>{
|
||||||
|
|
||||||
|
|
||||||
|
String addTempLineReport(SupervisionTempLineReportParam supervisionTempLineReportParam);
|
||||||
|
|
||||||
|
Page<SupervisionTempLineReportVO> getTempLineReport(SupervisionTempLineReportParam.SupervisionTempLineReportQuery supervisionTempLineReportQuery);
|
||||||
|
|
||||||
|
void updateStatus(String businessKey, Integer status);
|
||||||
|
|
||||||
|
String cancelTempLineReport(BpmProcessInstanceCancelParam cancelReqVO);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,28 +8,32 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.njcn.bpm.api.BpmProcessFeignClient;
|
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||||
|
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||||
|
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||||
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.supervision.enums.FlowStatusEnum;
|
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||||
import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
import com.njcn.supervision.mapper.device.SupervisionDevMainReportPOMapper;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionDevMainReportParam;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
import com.njcn.supervision.pojo.param.device.SupervisionTempDeviceReportParam;
|
||||||
import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
import com.njcn.supervision.pojo.po.device.SupervisionDevMainReportPO;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempDeviceReport;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
|
||||||
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
import com.njcn.supervision.pojo.vo.device.SupervisionDevMainReportVO;
|
||||||
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
import com.njcn.supervision.service.device.SupervisionDevMainReportPOService;
|
||||||
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
|
import com.njcn.supervision.service.device.SupervisionTempDeviceReportService;
|
||||||
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
|
||||||
import com.njcn.user.api.DeptFeignClient;
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.user.pojo.vo.UserVO;
|
||||||
import com.njcn.web.factory.PageFactory;
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import org.springframework.beans.BeanUtils;
|
import org.springframework.beans.BeanUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -56,19 +60,19 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
|
|
||||||
private final BpmProcessFeignClient bpmProcessFeignClient;
|
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||||
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
|
private final SupervisionTempDeviceReportService supervisionTempDeviceReportService;
|
||||||
private final SupervisionTempLineReportService supervisionTempLineReportService;
|
|
||||||
private final DeptFeignClient deptFeignClient;
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String addDevReport(SupervisionDevMainReportParam supervisionDevMainReportParam) {
|
public String addDevReport(SupervisionDevMainReportParam supervisionDevMainReportParam) {
|
||||||
|
|
||||||
//判断干扰源用户是否绑定
|
//判断干扰源用户是否绑定 todo 修改校验终端名称
|
||||||
checkUserId(supervisionDevMainReportParam, false);
|
// checkUserId(supervisionDevMainReportParam, false);
|
||||||
SupervisionDevMainReportPO supervisionDevMainReportPO = new SupervisionDevMainReportPO();
|
SupervisionDevMainReportPO supervisionDevMainReportPO = new SupervisionDevMainReportPO();
|
||||||
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
|
BeanUtils.copyProperties(supervisionDevMainReportParam, supervisionDevMainReportPO);
|
||||||
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
supervisionDevMainReportPO.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
supervisionDevMainReportPO.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
this.save(supervisionDevMainReportPO);
|
this.save(supervisionDevMainReportPO);
|
||||||
String id = supervisionDevMainReportPO.getId();
|
String id = supervisionDevMainReportPO.getId();
|
||||||
//存储临时终端信息
|
//存储临时终端信息
|
||||||
@@ -78,11 +82,11 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
supervisionTempDeviceReportPO.setId(id);
|
supervisionTempDeviceReportPO.setId(id);
|
||||||
supervisionTempDeviceReportService.save(supervisionTempDeviceReportPO);
|
supervisionTempDeviceReportService.save(supervisionTempDeviceReportPO);
|
||||||
//存储临时监测点信息
|
//存储临时监测点信息
|
||||||
SupervisionTempLineReportParam supervisionTempLineReportParam = supervisionDevMainReportParam.getSupervisionTempLineReportParam();
|
// SupervisionTempLineReportParam supervisionTempLineReportParam = supervisionDevMainReportParam.getSupervisionTempLineReportParam();
|
||||||
SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
// SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
||||||
BeanUtils.copyProperties(supervisionTempLineReportParam, supervisionTempLineReport);
|
// BeanUtils.copyProperties(supervisionTempLineReportParam, supervisionTempLineReport);
|
||||||
supervisionTempDeviceReportPO.setId(id);
|
// supervisionTempDeviceReportPO.setId(id);
|
||||||
supervisionTempLineReportService.save(supervisionTempLineReport);
|
// supervisionTempLineReportService.save(supervisionTempLineReport);
|
||||||
// 发起 BPM 流程
|
// 发起 BPM 流程
|
||||||
Map<String, Object> processInstanceVariables = new HashMap<>();
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
@@ -111,25 +115,78 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Page<SupervisionDevMainReportVO> getDevReport(SupervisionDevMainReportParam.SupervisionDevMainReportQuery supervisionDevMainReportQuery) {
|
public Page<SupervisionDevMainReportVO> getDevReport(SupervisionDevMainReportParam.SupervisionDevMainReportQuery supervisionDevMainReportQuery) {
|
||||||
QueryWrapper<SupervisionDevMainReportVO> quitRunningDeviceVOQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<SupervisionDevMainReportVO> queryWrapper = new QueryWrapper<>();
|
||||||
|
String userIndex = RequestUtil.getUserIndex();
|
||||||
|
|
||||||
|
queryWrapper.in("supervision_dev_main_report.create_by", CollectionUtil.newArrayList(userIndex))
|
||||||
|
.eq("supervision_dev_main_report.state", DataStateEnum.ENABLE.getCode());
|
||||||
if (StrUtil.isNotBlank(supervisionDevMainReportQuery.getOrgId())) {
|
if (StrUtil.isNotBlank(supervisionDevMainReportQuery.getOrgId())) {
|
||||||
/*获取直接下属子单位*/
|
/*获取直接下属子单位*/
|
||||||
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionDevMainReportQuery.getOrgId()).getData();
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionDevMainReportQuery.getOrgId()).getData();
|
||||||
|
|
||||||
//添加上时间范围
|
//添加上时间范围
|
||||||
quitRunningDeviceVOQueryWrapper.between("supervision_dev_main_report.Create_Time",
|
queryWrapper.between("supervision_dev_main_report.Create_Time",
|
||||||
DateUtil.beginOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchBeginTime())),
|
DateUtil.beginOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchBeginTime())),
|
||||||
DateUtil.endOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchEndTime())));
|
DateUtil.endOfDay(DateUtil.parse(supervisionDevMainReportQuery.getSearchEndTime())));
|
||||||
}
|
}
|
||||||
quitRunningDeviceVOQueryWrapper.orderByDesc("supervision_dev_main_report.Update_Time");
|
queryWrapper.orderByDesc("supervision_dev_main_report.Update_Time");
|
||||||
Page<SupervisionDevMainReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionDevMainReportQuery), PageFactory.getPageSize(supervisionDevMainReportQuery)), quitRunningDeviceVOQueryWrapper);
|
Page<SupervisionDevMainReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionDevMainReportQuery), PageFactory.getPageSize(supervisionDevMainReportQuery)), queryWrapper);
|
||||||
page.getRecords().stream().forEach(temp->{
|
page.getRecords().stream().forEach(temp->{
|
||||||
temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgId()).getData().getName()));
|
temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgId()).getData().getName()));
|
||||||
|
//处理特殊字段,用户名、部门名
|
||||||
|
UserVO userVO = userFeignClient.getUserById(temp.getReporter()).getData();
|
||||||
|
temp.setReporter(userVO.getName());
|
||||||
|
temp.setOrgName(deptFeignClient.getDeptById(temp.getOrgId()).getData().getName());
|
||||||
});
|
});
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateStatus(String businessKey, Integer status) {
|
||||||
|
this.lambdaUpdate().set(SupervisionDevMainReportPO::getStatus,status).eq(SupervisionDevMainReportPO::getId,businessKey).update();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String cancelDevMainReport(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
//准备取消该流程,需要远程调用接口
|
||||||
|
SupervisionDevMainReportPO supervisionDevMainReportPO = this.baseMapper.selectById(cancelReqVO.getId());
|
||||||
|
//取消流程
|
||||||
|
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
|
||||||
|
//更新状态
|
||||||
|
supervisionDevMainReportPO.setStatus(BpmProcessInstanceStatusEnum.CANCEL.getStatus());
|
||||||
|
this.updateById(supervisionDevMainReportPO);
|
||||||
|
return supervisionDevMainReportPO.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<SupervisionTempDeviceReport> getDeviceList() {
|
||||||
|
String deptIndex = RequestUtil.getDeptIndex();
|
||||||
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(deptIndex).getData();
|
||||||
|
|
||||||
|
List<SupervisionDevMainReportPO> list = this.lambdaQuery()
|
||||||
|
.eq(SupervisionDevMainReportPO::getStatus, 2)
|
||||||
|
.in(CollectionUtil.isNotEmpty(data), SupervisionDevMainReportPO::getOrgId, data)
|
||||||
|
.list();
|
||||||
|
if(CollectionUtil.isNotEmpty(list)){
|
||||||
|
List<String> collect = list.stream().map(SupervisionDevMainReportPO::getId).collect(Collectors.toList());
|
||||||
|
List<SupervisionTempDeviceReport> list1 = supervisionTempDeviceReportService.lambdaQuery().in(SupervisionTempDeviceReport::getId, collect).list();
|
||||||
|
return list1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public SupervisionDevMainReportVO querySurveyDetail(String id) {
|
||||||
|
SupervisionDevMainReportVO supervisionDevMainReportVO = new SupervisionDevMainReportVO();
|
||||||
|
SupervisionDevMainReportPO byId = this.getById(id);
|
||||||
|
BeanUtils.copyProperties(byId,supervisionDevMainReportVO);
|
||||||
|
//获取普测下电站详情
|
||||||
|
SupervisionTempDeviceReport supervisionTempDeviceReport = supervisionTempDeviceReportService.lambdaQuery().eq(SupervisionTempDeviceReport::getId, id).one();
|
||||||
|
supervisionDevMainReportVO.setSupervisionTempDeviceReport(supervisionTempDeviceReport);
|
||||||
|
return supervisionDevMainReportVO;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 判断干扰源用户是否绑定设备,如果重复则提示干扰源用户已经设备
|
* @Description: 判断干扰源用户是否绑定设备,如果重复则提示干扰源用户已经设备
|
||||||
* @Param: supervisionDevMainReportParam终端详情 isExcludeSelf是否排除自己,一般新增不排除,更新时需要排除自己
|
* @Param: supervisionDevMainReportParam终端详情 isExcludeSelf是否排除自己,一般新增不排除,更新时需要排除自己
|
||||||
|
|||||||
@@ -1,10 +1,40 @@
|
|||||||
package com.njcn.supervision.service.device.impl;
|
package com.njcn.supervision.service.device.impl;
|
||||||
|
|
||||||
import org.springframework.stereotype.Service;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.njcn.bpm.api.BpmProcessFeignClient;
|
||||||
|
import com.njcn.bpm.enums.BpmProcessInstanceStatusEnum;
|
||||||
|
import com.njcn.bpm.enums.BpmTaskStatusEnum;
|
||||||
|
import com.njcn.bpm.pojo.dto.BpmProcessInstanceCreateReqDTO;
|
||||||
|
import com.njcn.bpm.pojo.param.instance.BpmProcessInstanceCancelParam;
|
||||||
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
|
import com.njcn.supervision.enums.FlowStatusEnum;
|
||||||
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
import com.njcn.supervision.mapper.device.SupervisionTempLineReportMapper;
|
||||||
|
import com.njcn.supervision.pojo.param.device.SupervisionTempLineReportParam;
|
||||||
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
import com.njcn.supervision.pojo.po.device.SupervisionTempLineReport;
|
||||||
|
import com.njcn.supervision.pojo.vo.device.SupervisionTempLineReportVO;
|
||||||
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
||||||
|
import com.njcn.user.api.DeptFeignClient;
|
||||||
|
import com.njcn.user.api.UserFeignClient;
|
||||||
|
import com.njcn.user.pojo.vo.UserVO;
|
||||||
|
import com.njcn.web.factory.PageFactory;
|
||||||
|
import com.njcn.web.utils.RequestUtil;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
@@ -14,6 +44,118 @@ import com.njcn.supervision.service.device.SupervisionTempLineReportService;
|
|||||||
* @version V1.0.0
|
* @version V1.0.0
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
|
@RequiredArgsConstructor
|
||||||
public class SupervisionTempLineReportServiceImpl extends ServiceImpl<SupervisionTempLineReportMapper, SupervisionTempLineReport> implements SupervisionTempLineReportService{
|
public class SupervisionTempLineReportServiceImpl extends ServiceImpl<SupervisionTempLineReportMapper, SupervisionTempLineReport> implements SupervisionTempLineReportService{
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 监测点建档对应的流程定义 KEY
|
||||||
|
*/
|
||||||
|
public static final String PROCESS_KEY = "line_info_add";
|
||||||
|
|
||||||
|
private final BpmProcessFeignClient bpmProcessFeignClient;
|
||||||
|
private final DeptFeignClient deptFeignClient;
|
||||||
|
private final UserFeignClient userFeignClient;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public String addTempLineReport(SupervisionTempLineReportParam supervisionTempLineReportParam) {
|
||||||
|
//判断干扰源用户是否绑定
|
||||||
|
checkLineId(supervisionTempLineReportParam, false);
|
||||||
|
|
||||||
|
SupervisionTempLineReport supervisionTempLineReport = new SupervisionTempLineReport();
|
||||||
|
BeanUtils.copyProperties(supervisionTempLineReportParam,supervisionTempLineReport);
|
||||||
|
supervisionTempLineReport.setState(DataStateEnum.ENABLE.getCode());
|
||||||
|
supervisionTempLineReport.setStatus(BpmTaskStatusEnum.RUNNING.getStatus());
|
||||||
|
|
||||||
|
this.save(supervisionTempLineReport);
|
||||||
|
String id = supervisionTempLineReport.getId();
|
||||||
|
|
||||||
|
// 发起 BPM 流程
|
||||||
|
Map<String, Object> processInstanceVariables = new HashMap<>();
|
||||||
|
BpmProcessInstanceCreateReqDTO bpmProcessInstanceCreateReqDTO = new BpmProcessInstanceCreateReqDTO();
|
||||||
|
bpmProcessInstanceCreateReqDTO.setProcessDefinitionKey(PROCESS_KEY);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setBusinessKey(id);
|
||||||
|
bpmProcessInstanceCreateReqDTO.setStartUserSelectAssignees(supervisionTempLineReportParam.getStartUserSelectAssignees());
|
||||||
|
bpmProcessInstanceCreateReqDTO.setVariables(processInstanceVariables);
|
||||||
|
String processInstanceId = bpmProcessFeignClient.createProcessInstance(supervisionTempLineReport.getCreateBy(),bpmProcessInstanceCreateReqDTO).getData();
|
||||||
|
// 将工作流的编号,更新到流程单中
|
||||||
|
supervisionTempLineReport.setProcessInstanceId(processInstanceId);
|
||||||
|
this.baseMapper.updateById(supervisionTempLineReport);
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Page<SupervisionTempLineReportVO> getTempLineReport(SupervisionTempLineReportParam.SupervisionTempLineReportQuery supervisionTempLineReportQuery) {
|
||||||
|
QueryWrapper<SupervisionTempLineReport> queryWrapper = new QueryWrapper<>();
|
||||||
|
|
||||||
|
String userIndex = RequestUtil.getUserIndex();
|
||||||
|
|
||||||
|
queryWrapper.in("supervision_temp_line_report.create_by", CollectionUtil.newArrayList(userIndex))
|
||||||
|
.eq("supervision_temp_line_report.state", DataStateEnum.ENABLE.getCode());
|
||||||
|
if (StrUtil.isNotBlank(supervisionTempLineReportQuery.getOrgId())) {
|
||||||
|
/*获取直接下属子单位*/
|
||||||
|
List<String> data = deptFeignClient.getDepSonIdtByDeptId(supervisionTempLineReportQuery.getOrgId()).getData();
|
||||||
|
|
||||||
|
//添加上时间范围
|
||||||
|
queryWrapper.between("supervision_temp_line_report.Create_Time",
|
||||||
|
DateUtil.beginOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchBeginTime())),
|
||||||
|
DateUtil.endOfDay(DateUtil.parse(supervisionTempLineReportQuery.getSearchEndTime())));
|
||||||
|
}
|
||||||
|
queryWrapper.orderByDesc("supervision_temp_line_report.Update_Time");
|
||||||
|
Page<SupervisionTempLineReportVO> page = this.baseMapper.page(new Page<>(PageFactory.getPageNum(supervisionTempLineReportQuery), PageFactory.getPageSize(supervisionTempLineReportQuery)), queryWrapper);
|
||||||
|
page.getRecords().stream().forEach(temp->{
|
||||||
|
temp.setOrgName((deptFeignClient.getDeptById(temp.getOrgId()).getData().getName()));
|
||||||
|
//处理特殊字段,用户名、部门名
|
||||||
|
UserVO userVO = userFeignClient.getUserById(temp.getReporter()).getData();
|
||||||
|
temp.setReporter(userVO.getName());
|
||||||
|
temp.setOrgName(deptFeignClient.getDeptById(temp.getOrgId()).getData().getName());
|
||||||
|
});
|
||||||
|
return page;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateStatus(String businessKey, Integer status) {
|
||||||
|
this.lambdaUpdate().set(SupervisionTempLineReport::getStatus,status).eq(SupervisionTempLineReport::getId,businessKey).update();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String cancelTempLineReport(BpmProcessInstanceCancelParam cancelReqVO) {
|
||||||
|
//准备取消该流程,需要远程调用接口
|
||||||
|
SupervisionTempLineReport supervisionDevMainReportPO = this.baseMapper.selectById(cancelReqVO.getId());
|
||||||
|
//取消流程
|
||||||
|
bpmProcessFeignClient.cancelProcessInstanceByStartUser(cancelReqVO);
|
||||||
|
//更新状态
|
||||||
|
supervisionDevMainReportPO.setStatus(BpmProcessInstanceStatusEnum.CANCEL.getStatus());
|
||||||
|
this.updateById(supervisionDevMainReportPO);
|
||||||
|
return supervisionDevMainReportPO.getId();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkLineId(SupervisionTempLineReportParam supervisionTempLineReportParam, boolean isExcludeSelf) {
|
||||||
|
LambdaQueryWrapper<SupervisionTempLineReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper
|
||||||
|
.eq(SupervisionTempLineReport::getLineId, supervisionTempLineReportParam.getLineId())
|
||||||
|
.eq(SupervisionTempLineReport::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
//更新的时候,需排除当前记录
|
||||||
|
if (isExcludeSelf) {
|
||||||
|
if(supervisionTempLineReportParam instanceof SupervisionTempLineReportParam.SupervisionTempLineReportUpdate){
|
||||||
|
lambdaQueryWrapper.ne(SupervisionTempLineReport::getId, ((SupervisionTempLineReportParam.SupervisionTempLineReportUpdate) supervisionTempLineReportParam).getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
List<SupervisionTempLineReport> list = this.baseMapper.selectList(lambdaQueryWrapper);
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
//过滤已取消的申请
|
||||||
|
list = list.stream()
|
||||||
|
.filter(temp -> !temp.getStatus().equals(FlowStatusEnum.CANCEL.getCode()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
//如果还存在,则说明有人申请过了
|
||||||
|
if (CollectionUtil.isNotEmpty(list)) {
|
||||||
|
throw new BusinessException(supervisionTempLineReportParam.getUserName().concat(",监测点编号").concat(list.get(0).getReporter()).concat("以使用"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user