终端台账数据同步

This commit is contained in:
hzj
2024-05-30 15:37:07 +08:00
parent df178c4882
commit 1060b94e7a
27 changed files with 556 additions and 64 deletions

View File

@@ -4,7 +4,6 @@ import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pq.api.fallback.DeptLineFeignClientFallbackFactory;
import com.njcn.device.pq.pojo.po.DeptLine;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
@@ -39,4 +38,13 @@ public interface DeptLineFeignClient {
@PostMapping("/getLineByLineIds")
HttpResult<DeptLine> getLineByLineIds(@RequestParam("id") String ids);
/**
* @Description: 部门Id获取所有子集部门绑定监测点
* @Param:
* @return: com.njcn.common.pojo.response.HttpResult<java.util.List<java.lang.String>>
* @Author: clam
* @Date: 2024/5/29
*/
@PostMapping("/getLineNodeByDeptId")
HttpResult<List<String>> getLineNodeByDeptId(@RequestParam("id") String id);
}

View File

@@ -3,13 +3,12 @@ package com.njcn.device.pq.api;
import com.njcn.common.pojo.constant.ServerInfo;
import com.njcn.common.pojo.response.HttpResult;
import com.njcn.device.pq.api.fallback.TerminalBaseClientFallbackFactory;
import com.njcn.device.pq.pojo.param.SyncTerminalParam;
import com.njcn.device.pq.pojo.po.Line;
import com.njcn.device.pq.pojo.vo.TerminalBaseVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import java.util.List;
@@ -32,7 +31,11 @@ public interface TerminalBaseClient {
*/
@PostMapping("/getSubstationById")
HttpResult<List<Line>> getSubstationById(@RequestBody List<String> list);
/*
冀北技术监督台账同步
*/
@ApiOperation("终端/母线/监测点同步操作")
@PostMapping("terminalSync")
HttpResult<Object> terminalSync( @RequestBody SyncTerminalParam syncTerminalParam);
}

View File

@@ -62,6 +62,12 @@ public class DeptLineFeignClientFallbackFactory implements FallbackFactory<DeptL
log.error("{}异常,降级处理,异常为:{}", "根据监测点id集合查询部门信息id", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<List<String>> getLineNodeByDeptId(String id) {
log.error("{}异常,降级处理,异常为:{}", "根据部门信息id查询监测点id集合", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};
}
}

View File

@@ -4,6 +4,7 @@ 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.device.pq.api.TerminalBaseClient;
import com.njcn.device.pq.pojo.param.SyncTerminalParam;
import com.njcn.device.pq.pojo.po.Line;
import com.njcn.device.biz.utils.DeviceEnumUtil;
import feign.hystrix.FallbackFactory;
@@ -37,6 +38,12 @@ public class TerminalBaseClientFallbackFactory implements FallbackFactory<Termin
throw new BusinessException(finalExceptionEnum);
}
@Override
public HttpResult<Object> terminalSync(SyncTerminalParam syncTerminalParam) {
log.error("{}异常,降级处理,异常为:{}", "台账同步", throwable.toString());
throw new BusinessException(finalExceptionEnum);
}
};

View File

@@ -0,0 +1,59 @@
package com.njcn.device.pq.pojo.param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.Valid;
/**
* pqs
* 终端新增操作bo
* @author cdf
* @date 2021/7/2
*/
@Data
@ApiModel
public class SyncTerminalParam {
private String DeptId;
@ApiModelProperty(name = "projectIndex",value = "项目索引")
private String projectIndex;
@ApiModelProperty(name = "provinceIndex",value = "省份索引")
private String provinceIndex;
@ApiModelProperty(name = "gdIndex",value = "供电索引")
private String gdIndex;
@ApiModelProperty(name = "subIndex",value = "变电站索引")
private String subIndex;
@Valid
@ApiModelProperty(name = "projectParam",value = "项目实体")
private ProjectParam projectParam;
@Valid
@ApiModelProperty(name = "provinceParam",value = "省份实体")
private ProvinceParam provinceParam;
@Valid
@ApiModelProperty(name = "gdInformationParam",value = "供电公司")
private GdInformationParam gdInformationParam;
@Valid
@ApiModelProperty(name = "subStationParam",value = "变电站")
private SubStationParam subStationParam;
@ApiModelProperty(name = "deviceParam",value = "设备信息")
private DeviceParam deviceParam;
@ApiModelProperty(name = "subVoltageParam",value = "母线信息")
@Valid
private SubVoltageParam subVoltageParam;
@ApiModelProperty(name = "lineParam",value = "监测点信息")
private LineParam lineParam;
}