|
|
@ -1,8 +1,7 @@ |
|
|
|
package com.hnac.hzims.operational.duty.service.impl; |
|
|
|
package com.hnac.hzims.operational.duty.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.IdWorker; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.hnac.hzims.operational.duty.entity.AnalyseExample; |
|
|
|
import com.hnac.hzims.operational.duty.entity.AnalyseExample; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsAnalyseExampleMapper; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsAnalyseExampleMapper; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsDutyMainMapper; |
|
|
|
import com.hnac.hzims.operational.duty.mapper.ImsDutyMainMapper; |
|
|
@ -13,16 +12,18 @@ import com.hnac.hzinfo.datasearch.analyse.domain.AnalyzeDataList; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.HzPage; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.HzPage; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.Result; |
|
|
|
import com.hnac.hzinfo.sdk.core.response.Result; |
|
|
|
import com.hnac.hzinfo.sdk.v5.analyse.AnalyseDataHandlerClient; |
|
|
|
import com.hnac.hzinfo.sdk.v5.analyse.AnalyseDataHandlerClient; |
|
|
|
|
|
|
|
import com.hnac.hzinfo.sdk.v5.analyse.vo.AnalseInstanceVO; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils; |
|
|
|
import net.logstash.logback.encoder.org.apache.commons.lang3.ObjectUtils; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
|
|
|
|
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.Query; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springframework.beans.BeanUtils; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -43,6 +44,7 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl<ImsAnalyseExam |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 根据时间段+分析实例ID查询值班日志 |
|
|
|
* 根据时间段+分析实例ID查询值班日志 |
|
|
|
|
|
|
|
* |
|
|
|
* @param analyzeDataCondition |
|
|
|
* @param analyzeDataCondition |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -60,25 +62,23 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl<ImsAnalyseExam |
|
|
|
* @return |
|
|
|
* @return |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R queryAnalyseExample(AnalyseExample analyseExample) { |
|
|
|
public R queryAnalyseExample(AnalyseExample analyseExample, Query query) { |
|
|
|
QueryWrapper<AnalyseExample> queryWrapper = getQueryWrapper(analyseExample); |
|
|
|
QueryWrapper<AnalyseExample> queryWrapper = getQueryWrapper(analyseExample); |
|
|
|
List<AnalyseExample> analyseExamples = baseMapper.selectList(queryWrapper); |
|
|
|
IPage<AnalyseExample> analyseExamples = this.page(Condition.getPage(query), queryWrapper); |
|
|
|
if (CollectionUtils.isNotEmpty(analyseExamples)){ |
|
|
|
|
|
|
|
return R.data(analyseExamples); |
|
|
|
return R.data(analyseExamples); |
|
|
|
}else { |
|
|
|
|
|
|
|
return R.success("暂无数据"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R getAnalyseId(String projectId) { |
|
|
|
public R getAnalyseId(String projectId) { |
|
|
|
Result result = handlerClient.analyseInstanceByProjectId(projectId); |
|
|
|
Result result = handlerClient.analyseInstanceByProjectId(projectId); |
|
|
|
String data = result.getData().toString(); |
|
|
|
List<AnalseInstanceVO> data = new ArrayList<>(); |
|
|
|
String s="11111111111111"; |
|
|
|
if (ObjectUtils.isNotEmpty(result.getData())) { |
|
|
|
Result result1 = handlerClient.analyseByAnalyseAttr(s); |
|
|
|
data = (List<AnalseInstanceVO>) result.getData(); |
|
|
|
String data2 = result1.getData().toString(); |
|
|
|
} |
|
|
|
System.out.println(data2); |
|
|
|
// 根据实例code拿到分析实例物模型
|
|
|
|
// if ()
|
|
|
|
// String s="11111111111111";
|
|
|
|
|
|
|
|
// Result result1 = handlerClient.analyseByAnalyseAttr(s);
|
|
|
|
|
|
|
|
// String data2 = result1.getData().toString();
|
|
|
|
return R.data(data); |
|
|
|
return R.data(data); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -89,18 +89,7 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl<ImsAnalyseExam |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public R updateAnalyseExample(AnalyseExample analyseExample) { |
|
|
|
public R updateAnalyseExample(AnalyseExample analyseExample) { |
|
|
|
AnalyseExample entity = baseMapper.selectOne(new LambdaQueryWrapper<AnalyseExample>() {{ |
|
|
|
|
|
|
|
eq(AnalyseExample::getClassId, analyseExample.getClassId()); |
|
|
|
|
|
|
|
eq(AnalyseExample::getEquipmentId,analyseExample.getEquipmentId()); |
|
|
|
|
|
|
|
last(" limit 1"); |
|
|
|
|
|
|
|
}}); |
|
|
|
|
|
|
|
if (ObjectUtils.isNotEmpty(entity)){ |
|
|
|
|
|
|
|
BeanUtils.copyProperties(analyseExample,entity); |
|
|
|
|
|
|
|
this.saveOrUpdate(analyseExample); |
|
|
|
this.saveOrUpdate(analyseExample); |
|
|
|
}else { |
|
|
|
|
|
|
|
analyseExample.setId(IdWorker.getId(analyseExample)); |
|
|
|
|
|
|
|
this.saveOrUpdate(analyseExample); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return R.success("保存成功"); |
|
|
|
return R.success("保存成功"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -110,14 +99,14 @@ public class ImsAnalyseExampleServiceImpl extends BaseServiceImpl<ImsAnalyseExam |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getId())) { |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getId())) { |
|
|
|
queryWrapper.lambda().eq(AnalyseExample::getId, analyseExample.getId()); |
|
|
|
queryWrapper.lambda().eq(AnalyseExample::getId, analyseExample.getId()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getClassName())) { |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getSiteName())) { |
|
|
|
queryWrapper.lambda().like(AnalyseExample::getClassName, analyseExample.getClassName()); |
|
|
|
queryWrapper.lambda().like(AnalyseExample::getSiteName, analyseExample.getSiteName()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getEquipmentId())) { |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getEquipmentId())) { |
|
|
|
queryWrapper.lambda().eq(AnalyseExample::getEquipmentId, analyseExample.getEquipmentId()); |
|
|
|
queryWrapper.lambda().eq(AnalyseExample::getEquipmentId, analyseExample.getEquipmentId()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getAnalyseId())) { |
|
|
|
if (ObjectUtils.isNotEmpty(analyseExample.getDeviceCode())) { |
|
|
|
queryWrapper.lambda().eq(AnalyseExample::getAnalyseId, analyseExample.getAnalyseId()); |
|
|
|
queryWrapper.lambda().eq(AnalyseExample::getDeviceCode, analyseExample.getDeviceCode()); |
|
|
|
} |
|
|
|
} |
|
|
|
return queryWrapper; |
|
|
|
return queryWrapper; |
|
|
|
} |
|
|
|
} |
|
|
|