数据同步,新增电站
This commit is contained in:
@@ -37,5 +37,5 @@ public interface TerminalBaseClient {
|
||||
|
||||
@ApiOperation("终端/母线/监测点同步操作")
|
||||
@PostMapping("terminalSync")
|
||||
HttpResult<Object> terminalSync( @RequestBody SyncTerminalParam syncTerminalParam);
|
||||
HttpResult<String> terminalSync( @RequestBody SyncTerminalParam syncTerminalParam);
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ public class TerminalBaseClientFallbackFactory implements FallbackFactory<Termin
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Object> terminalSync(SyncTerminalParam syncTerminalParam) {
|
||||
public HttpResult<String> terminalSync(SyncTerminalParam syncTerminalParam) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "台账同步", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@@ -146,11 +146,11 @@ public class TerminalBaseController extends BaseController {
|
||||
@ApiOperation("终端/母线/监测点同步操作")
|
||||
@OperateInfo(operateType = OperateType.ADD, info = LogEnum.BUSINESS_MEDIUM)
|
||||
@PostMapping("terminalSync")
|
||||
public HttpResult<Object> terminalSync(@Valid @RequestBody SyncTerminalParam syncTerminalParam) {
|
||||
public HttpResult<String> terminalSync(@Valid @RequestBody SyncTerminalParam syncTerminalParam) {
|
||||
String methodDescribe = getMethodDescribe("terminalSync");
|
||||
|
||||
terminalBaseService.terminalSync(syncTerminalParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, null, methodDescribe);
|
||||
String subtation = terminalBaseService.terminalSync(syncTerminalParam);
|
||||
return HttpResultUtil.assembleCommonResponseResult(CommonResponseEnum.SUCCESS, subtation, methodDescribe);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -242,5 +242,5 @@ public interface TerminalBaseService {
|
||||
* @Author: clam
|
||||
* @Date: 2024/5/29
|
||||
*/
|
||||
boolean terminalSync(SyncTerminalParam syncTerminalParam);
|
||||
String terminalSync(SyncTerminalParam syncTerminalParam);
|
||||
}
|
||||
|
||||
@@ -1812,7 +1812,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public boolean terminalSync(SyncTerminalParam syncTerminalParam) {
|
||||
public String terminalSync(SyncTerminalParam syncTerminalParam) {
|
||||
String projectIndex = null;
|
||||
String provinceIndex = null;
|
||||
String gdIndex = null;
|
||||
@@ -1847,6 +1847,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
//变电站 todo 可能新建电站
|
||||
if (Objects.nonNull(syncTerminalParam.getSubStationParam())) {
|
||||
if (StrUtil.isBlank(subIndex) && StrUtil.isNotBlank(gdIndex)) {
|
||||
Line substation = this.lambdaQuery().eq(Line::getName, syncTerminalParam.getSubStationParam().getName()).one();
|
||||
if(Objects.isNull(substation)){
|
||||
Line subStation = assembleLine(syncTerminalParam.getSubStationParam().getName(), LineBaseEnum.SUB_LEVEL.getCode(), gdIndex, projectIndex + StrUtil.COMMA + provinceIndex + StrUtil.COMMA + gdIndex, syncTerminalParam.getSubStationParam().getSort());
|
||||
this.baseMapper.insert(subStation);
|
||||
subIndex = subStation.getId();
|
||||
@@ -1859,6 +1861,8 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
sub.setLat(syncTerminalParam.getSubStationParam().getLat());
|
||||
substationMapper.insert(sub);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//装置
|
||||
@@ -1977,7 +1981,7 @@ public class TerminalBaseServiceImpl extends ServiceImpl<LineMapper, Line> imple
|
||||
deptLine.setLineId(line.getId());
|
||||
deptLineMapper.insert(deptLine);
|
||||
|
||||
return true;
|
||||
return subIndex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,5 @@ public interface UserReportFeignClient {
|
||||
@GetMapping("/updateUserReportStatus")
|
||||
HttpResult<Object> updateUserReportStatus(@RequestParam("businessKey") String businessKey, @RequestParam("status")Integer status);
|
||||
|
||||
@GetMapping("/updateUserStatus")
|
||||
HttpResult<Object> updateUserStatus(String businessKey,Integer userStatus) ;
|
||||
|
||||
}
|
||||
|
||||
@@ -33,11 +33,6 @@ public class UserReportFeignClientFallbackFactory implements FallbackFactory<Use
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HttpResult<Object> updateUserStatus(String businessKey, Integer userStatus) {
|
||||
log.error("{}异常,降级处理,异常为:{}", "更新干扰源用户状态", throwable.toString());
|
||||
throw new BusinessException(finalExceptionEnum);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,6 +205,7 @@ public class SupervisionDevMainReportPOServiceImpl extends ServiceImpl<Supervisi
|
||||
* @Date: 2024/5/11
|
||||
*/
|
||||
private void checkIp(SupervisionDevMainReportParam supervisionDevMainReportParam, boolean isExcludeSelf) {
|
||||
|
||||
LambdaQueryWrapper<SupervisionTempDeviceReport> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper
|
||||
.eq(SupervisionTempDeviceReport::getSubstation,supervisionDevMainReportParam.getSupervisionTempDeviceReportParam().getSubstation())
|
||||
|
||||
@@ -247,8 +247,10 @@ public class SupervisionTempLineDebugPOServiceImpl extends ServiceImpl<Supervisi
|
||||
syncTerminalParam.setSubVoltageParam(subVoltageParam);
|
||||
syncTerminalParam.setLineParam(lineParam);
|
||||
|
||||
terminalBaseClient.terminalSync(syncTerminalParam);
|
||||
String substation = terminalBaseClient.terminalSync(syncTerminalParam).getData();
|
||||
this.updateStatus(id,5);
|
||||
tempDevice.setSubstation(substation);
|
||||
supervisionTempDeviceReportService.updateById(tempDevice);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user