|
|
@ -24,6 +24,9 @@ import com.hnac.hzims.operational.station.wrapper.StationWrapper; |
|
|
|
import com.hnac.hzinfo.sdk.v5.project.ProjectClient; |
|
|
|
import com.hnac.hzinfo.sdk.v5.project.ProjectClient; |
|
|
|
import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO; |
|
|
|
import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO; |
|
|
|
import com.hnac.hzinfo.sdk.v5.project.vo.ProjectVO;*/ |
|
|
|
import com.hnac.hzinfo.sdk.v5.project.vo.ProjectVO;*/ |
|
|
|
|
|
|
|
import com.hnac.hzinfo.sdk.core.response.Result; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.sdk.v5.project.ProjectClient; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.sdk.v5.project.dto.ProjectDTO; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.RequiredArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
@ -62,7 +65,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
private final IDeptClient deptClient; |
|
|
|
private final IDeptClient deptClient; |
|
|
|
private final UserAuthDataService userAuthDataService; |
|
|
|
private final UserAuthDataService userAuthDataService; |
|
|
|
private final IUserClient userClient; |
|
|
|
private final IUserClient userClient; |
|
|
|
//private final ProjectClient projectClient;
|
|
|
|
private final ProjectClient projectClient; |
|
|
|
private final BladeLogger logger; |
|
|
|
private final BladeLogger logger; |
|
|
|
private final IQuestionClient questionClient; |
|
|
|
private final IQuestionClient questionClient; |
|
|
|
|
|
|
|
|
|
|
@ -91,19 +94,22 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
Assert.isTrue(this.saveOrUpdate(req),() -> { |
|
|
|
Assert.isTrue(this.saveOrUpdate(req),() -> { |
|
|
|
throw new ServiceException("创建/修改站点信息失败!"); |
|
|
|
throw new ServiceException("创建/修改站点信息失败!"); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// 如果设备数据来源未选定其他 则进行站点初始化操作
|
|
|
|
|
|
|
|
if(!StationConstants.HZ3000_OTHER.equals(req.getDataSource())) { |
|
|
|
// 智能诊断站点推送
|
|
|
|
// 智能诊断站点推送
|
|
|
|
ExecutorService executor = Executors.newSingleThreadExecutor(); |
|
|
|
ExecutorService executor = Executors.newSingleThreadExecutor(); |
|
|
|
executor.submit(() -> questionClient.submitStationInfo(req.getCode(), null)); |
|
|
|
executor.submit(() -> questionClient.submitStationInfo(req.getCode(), "")); |
|
|
|
// 新建项目
|
|
|
|
// 新建项目
|
|
|
|
executor.submit(() -> this.instanceProject(req)); |
|
|
|
executor.submit(() -> this.instanceProject(req)); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean instanceProject(StationEntity req) { |
|
|
|
public boolean instanceProject(StationEntity req) { |
|
|
|
if(Func.isEmpty(req.getSecretKey()) || Func.isEmpty(req.getDataSource())) { |
|
|
|
if(Func.isEmpty(req.getSecretKey()) || Func.isEmpty(req.getDataSource())) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
/*if(super.updateById(req)) { |
|
|
|
if(super.updateById(req)) { |
|
|
|
ProjectDTO projectDTO = new ProjectDTO(); |
|
|
|
ProjectDTO projectDTO = new ProjectDTO(); |
|
|
|
projectDTO.setName(req.getName()); |
|
|
|
projectDTO.setName(req.getName()); |
|
|
|
projectDTO.setSource(1); |
|
|
|
projectDTO.setSource(1); |
|
|
@ -113,7 +119,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
Result result = projectClient.saveOrUpdate(projectDTO); |
|
|
|
Result result = projectClient.saveOrUpdate(projectDTO); |
|
|
|
logger.info("operational:station:buildStation:"+req.getCode(), JSON.toJSONString(result)); |
|
|
|
logger.info("operational:station:buildStation:"+req.getCode(), JSON.toJSONString(result)); |
|
|
|
return result.getCode() == ResultCode.SUCCESS.getCode() && result.isSuccess(); |
|
|
|
return result.getCode() == ResultCode.SUCCESS.getCode() && result.isSuccess(); |
|
|
|
}*/ |
|
|
|
} |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -161,7 +167,7 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
if (ObjectUtil.isNotEmpty(req.getEndDate())) { |
|
|
|
if (ObjectUtil.isNotEmpty(req.getEndDate())) { |
|
|
|
le(StationEntity::getCreateTime, req.getEndDate()); |
|
|
|
le(StationEntity::getCreateTime, req.getEndDate()); |
|
|
|
} |
|
|
|
} |
|
|
|
orderByAsc(StationEntity::getCreateTime); |
|
|
|
//orderByAsc(StationEntity::getCreateTime);
|
|
|
|
}}; |
|
|
|
}}; |
|
|
|
queryWrapper.orderByDesc(StationEntity::getSort); |
|
|
|
queryWrapper.orderByDesc(StationEntity::getSort); |
|
|
|
queryWrapper.orderByDesc(StationEntity::getUpdateTime); |
|
|
|
queryWrapper.orderByDesc(StationEntity::getUpdateTime); |
|
|
|