脚本详情项禁用后,该脚本详情项的结果不参与装置的检测结果
This commit is contained in:
@@ -37,8 +37,8 @@ import com.njcn.gather.script.service.IPqScriptDtlsService;
|
|||||||
import com.njcn.gather.script.service.IPqScriptService;
|
import com.njcn.gather.script.service.IPqScriptService;
|
||||||
import com.njcn.gather.source.pojo.po.PqSource;
|
import com.njcn.gather.source.pojo.po.PqSource;
|
||||||
import com.njcn.gather.source.service.IPqSourceService;
|
import com.njcn.gather.source.service.IPqSourceService;
|
||||||
|
import com.njcn.gather.storage.mapper.DetectionDataDealMapper;
|
||||||
import com.njcn.gather.storage.pojo.param.StorageParam;
|
import com.njcn.gather.storage.pojo.param.StorageParam;
|
||||||
import com.njcn.gather.storage.pojo.po.AdBaseResult;
|
|
||||||
import com.njcn.gather.storage.service.AdHarmonicService;
|
import com.njcn.gather.storage.service.AdHarmonicService;
|
||||||
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
import com.njcn.gather.storage.service.AdNonHarmonicService;
|
||||||
import com.njcn.gather.storage.service.TableGenService;
|
import com.njcn.gather.storage.service.TableGenService;
|
||||||
@@ -95,7 +95,6 @@ public class AdPlanServiceImpl extends ServiceImpl<AdPlanMapper, AdPlan> impleme
|
|||||||
private final ISysTestConfigService sysTestConfigService;
|
private final ISysTestConfigService sysTestConfigService;
|
||||||
private final IDevTypeService devTypeService;
|
private final IDevTypeService devTypeService;
|
||||||
private final IDictTypeService dictTypeService;
|
private final IDictTypeService dictTypeService;
|
||||||
private final AdNonHarmonicService adNonHarmonicService;
|
|
||||||
private final AdHarmonicService adHarmonicService;
|
private final AdHarmonicService adHarmonicService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,9 +3,17 @@ package com.njcn.gather.storage.mapper;
|
|||||||
import com.njcn.db.mybatisplus.mapper.BatchBaseMapper;
|
import com.njcn.db.mybatisplus.mapper.BatchBaseMapper;
|
||||||
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
import com.njcn.gather.storage.pojo.po.AdHarmonicResult;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public interface DetectionDataDealMapper extends BatchBaseMapper<AdHarmonicResult> {
|
public interface DetectionDataDealMapper extends BatchBaseMapper<AdHarmonicResult> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据设备ID查询禁用的脚本详情索引
|
||||||
|
*
|
||||||
|
* @param devId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<Integer> listDisabledScriptDtlIndexs(String devId);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
<mapper namespace="com.njcn.gather.storage.mapper.DetectionDataDealMapper">
|
<mapper namespace="com.njcn.gather.storage.mapper.DetectionDataDealMapper">
|
||||||
|
|
||||||
|
|
||||||
|
<select id="listDisabledScriptDtlIndexs" resultType="java.lang.Integer">
|
||||||
|
select distinct dtls.Script_Index
|
||||||
|
from pq_script_dtls dtls
|
||||||
|
inner join ad_plan plan on dtls.Script_Id = plan.Script_Id
|
||||||
|
inner join pq_dev dev on dev.Plan_Id = plan.id
|
||||||
|
where dev.id = #{devId}
|
||||||
|
and dev.State = 1
|
||||||
|
and dtls.Enable = 0
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import java.util.stream.Collectors;
|
|||||||
public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<DetectionDataDealMapper, AdHarmonicResult> implements DetectionDataDealService {
|
public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<DetectionDataDealMapper, AdHarmonicResult> implements DetectionDataDealService {
|
||||||
|
|
||||||
private final AdNonHarmonicService adNonHarmonicService;
|
private final AdNonHarmonicService adNonHarmonicService;
|
||||||
|
private final DetectionDataDealMapper detectionDataDealMapper;
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -95,11 +96,13 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Integer> devResult(List<String> ids, List<String> valueType, String code) {
|
public Map<String, Integer> devResult(List<String> ids, List<String> valueType, String code) {
|
||||||
|
List<Integer> disabledScriptDtlIndexs = detectionDataDealMapper.listDisabledScriptDtlIndexs(ids.get(0));
|
||||||
List<AdNonHarmonicResult> noHarm = new ArrayList<>();
|
List<AdNonHarmonicResult> noHarm = new ArrayList<>();
|
||||||
for (String id : ids) {
|
for (String id : ids) {
|
||||||
DynamicTableNameHandler.setTableName("ad_non_harmonic_result_" + code);
|
DynamicTableNameHandler.setTableName("ad_non_harmonic_result_" + code);
|
||||||
noHarm.addAll(adNonHarmonicService.list(new LambdaQueryWrapper<AdNonHarmonicResult>()
|
noHarm.addAll(adNonHarmonicService.list(new LambdaQueryWrapper<AdNonHarmonicResult>()
|
||||||
.like(AdNonHarmonicResult::getMonitorId, id)
|
.like(AdNonHarmonicResult::getMonitorId, id)
|
||||||
|
.notIn(CollUtil.isNotEmpty(disabledScriptDtlIndexs), AdNonHarmonicResult::getSort, disabledScriptDtlIndexs)
|
||||||
.in(CollUtil.isNotEmpty(valueType), AdNonHarmonicResult::getAdType, valueType)
|
.in(CollUtil.isNotEmpty(valueType), AdNonHarmonicResult::getAdType, valueType)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
@@ -109,6 +112,7 @@ public class DetectionDataServiceImpl extends ReplenishMybatisServiceImpl<Detect
|
|||||||
DynamicTableNameHandler.setTableName("ad_harmonic_result_" + code);
|
DynamicTableNameHandler.setTableName("ad_harmonic_result_" + code);
|
||||||
harm.addAll(this.list(new LambdaQueryWrapper<AdHarmonicResult>()
|
harm.addAll(this.list(new LambdaQueryWrapper<AdHarmonicResult>()
|
||||||
.like(AdHarmonicResult::getMonitorId, id)
|
.like(AdHarmonicResult::getMonitorId, id)
|
||||||
|
.notIn(CollUtil.isNotEmpty(disabledScriptDtlIndexs), AdHarmonicResult::getSort, disabledScriptDtlIndexs)
|
||||||
.in(CollUtil.isNotEmpty(valueType), AdHarmonicResult::getAdType, valueType)
|
.in(CollUtil.isNotEmpty(valueType), AdHarmonicResult::getAdType, valueType)
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user