Browse Source

# 站点删除接口调整

zhongwei
haungxing 2 years ago
parent
commit
9433906785
  1. 16
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

16
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/StationServiceImpl.java

@ -131,13 +131,15 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn
boolean saveFlag = this.removeById(Long.valueOf(id)); boolean saveFlag = this.removeById(Long.valueOf(id));
if(saveFlag) { if(saveFlag) {
// 删除数据平台项目 // 删除数据平台项目
Result<ProjectVO> existProject = projectClient.getProjectByPid(stationEntity.getCode()); Result dataDelete = projectClient.delete(stationEntity.getCode());
if(existProject.isSuccess() && ObjectUtil.isNotEmpty(existProject.getData())) { Assert.isTrue(dataDelete.isSuccess(),() -> {
Result dataDelete = projectClient.delete(stationEntity.getCode()); logger.error("hzims-operational:station:removeStation",stationEntity.getCode()+"删除失败,报错信息为:"+dataDelete.getMsg());
Assert.isTrue(dataDelete.isSuccess(),() -> { throw new ServiceException("数据平台删除项目失败!");
logger.error("hzims-operational:station:removeStation",stationEntity.getCode()+"删除失败,报错信息为:"+dataDelete.getMsg()); });
throw new ServiceException("数据平台删除项目失败!"); // 删除所属机构
}); R<Dept> deptResult = sysClient.getDept(stationEntity.getRefDept());
if(deptResult.isSuccess() && ObjectUtil.isNotEmpty(deptResult.getData())) {
deptClient.deleteDeptById(stationEntity.getRefDept());
} }
// 删除智能诊断站点 // 删除智能诊断站点
questionClient.deleteStationInfo(stationEntity.getCode()); questionClient.deleteStationInfo(stationEntity.getCode());

Loading…
Cancel
Save