|
|
@ -2,6 +2,7 @@ package com.hnac.hzims.operational.station.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.hnac.hzims.common.service.UserAuthDataService; |
|
|
|
import com.hnac.hzims.common.service.UserAuthDataService; |
|
|
@ -37,6 +38,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.apache.commons.lang.StringUtils; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
import org.springblade.core.log.logger.BladeLogger; |
|
|
|
import org.springblade.core.log.logger.BladeLogger; |
|
|
|
|
|
|
|
import org.springblade.core.mp.base.BaseEntity; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Condition; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
|
import org.springblade.core.mp.support.Query; |
|
|
@ -106,19 +108,20 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 推送站点 |
|
|
|
* 推送站点 |
|
|
|
|
|
|
|
* |
|
|
|
* @param req 推送站点内容 |
|
|
|
* @param req 推送站点内容 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private void pushStation(StationEntity req) { |
|
|
|
private void pushStation(StationEntity req) { |
|
|
|
// 读取站点类型配置确定是否推送FDP
|
|
|
|
// 读取站点类型配置确定是否推送FDP
|
|
|
|
StationPushConfigEntity config = StationPushConfigEntity.builder().stationType(req.getType()).build(); |
|
|
|
StationPushConfigEntity config = StationPushConfigEntity.builder().stationType(req.getType()).build(); |
|
|
|
StationPushConfigVO configVO = stationPushConfigService.getOne(BeanUtil.copy(config, StationPushConfigDTO.class)); |
|
|
|
StationPushConfigVO configVO = stationPushConfigService.getOne(BeanUtil.copy(config, StationPushConfigDTO.class)); |
|
|
|
if(ObjectUtil.isNotEmpty(configVO) && configVO.getIsPush()) { |
|
|
|
if (ObjectUtil.isNotEmpty(configVO) && configVO.getIsPush()) { |
|
|
|
log.info("{}站点开始智能诊断站点推送",req.getCode()); |
|
|
|
log.info("{}站点开始智能诊断站点推送", req.getCode()); |
|
|
|
new Thread(() -> questionClient.submitStationInfo(configVO.getFdpStationType(), req.getCode(), "运维平台推送"), "智能诊断站点推送").start(); |
|
|
|
new Thread(() -> questionClient.submitStationInfo(configVO.getFdpStationType(), req.getCode(), "运维平台推送"), "智能诊断站点推送").start(); |
|
|
|
} |
|
|
|
} |
|
|
|
// 如果设备数据来源未选定其他 则进行站点初始化操作
|
|
|
|
// 如果设备数据来源未选定其他 则进行站点初始化操作
|
|
|
|
if (StationConstants.GATHER.equals(req.getDataOrigin()) && !StationConstants.HZ3000_OTHER.equals(req.getDataSource())) { |
|
|
|
if (StationConstants.GATHER.equals(req.getDataOrigin()) && !StationConstants.HZ3000_OTHER.equals(req.getDataSource())) { |
|
|
|
log.info("{}站点开始数据平台新建项目",req.getCode()); |
|
|
|
log.info("{}站点开始数据平台新建项目", req.getCode()); |
|
|
|
new Thread(() -> this.instanceProject(req), "数据平台新建项目").start(); |
|
|
|
new Thread(() -> this.instanceProject(req), "数据平台新建项目").start(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -697,8 +700,30 @@ public class StationServiceImpl extends BaseServiceImpl<StationMapper, StationEn |
|
|
|
LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
LambdaQueryWrapper<StationEntity> queryWrapper = new LambdaQueryWrapper<>(); |
|
|
|
queryWrapper.eq(StationEntity::getSignage, signage); |
|
|
|
queryWrapper.eq(StationEntity::getSignage, signage); |
|
|
|
Integer count = baseMapper.selectCount(queryWrapper); |
|
|
|
Integer count = baseMapper.selectCount(queryWrapper); |
|
|
|
if (count > 0){ |
|
|
|
if (count > 0) { |
|
|
|
throw new ServiceException("两票编号抬头已存在"); |
|
|
|
throw new ServiceException("两票编号抬头已存在"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 通过站点id获取站点名称 |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param station |
|
|
|
|
|
|
|
* @return |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public String selectStationById(String station) { |
|
|
|
|
|
|
|
if (StringUtils.isEmpty(station)) { |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
QueryWrapper<StationEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
|
|
|
queryWrapper.lambda().eq(BaseEntity::getId, station); |
|
|
|
|
|
|
|
queryWrapper.lambda().or().eq(StationEntity::getCode, station); |
|
|
|
|
|
|
|
StationEntity stationEntity = baseMapper.selectOne(queryWrapper); |
|
|
|
|
|
|
|
if (stationEntity != null) { |
|
|
|
|
|
|
|
return stationEntity.getName(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|