解决已完成的计划绑定新设备时,需要将计划重新改为检测中状态
This commit is contained in:
@@ -678,7 +678,7 @@ public class DetectionServiceImpl {
|
|||||||
NumberFormat nf = NumberFormat.getInstance();
|
NumberFormat nf = NumberFormat.getInstance();
|
||||||
nf.setMaximumFractionDigits(6);
|
nf.setMaximumFractionDigits(6);
|
||||||
nf.setGroupingUsed(false);
|
nf.setGroupingUsed(false);
|
||||||
data.setRadius(nf.format(-errSys.getMaxErrorValue()) + "~" + nf.format(-errSys.getMaxErrorValue()));
|
data.setRadius(nf.format(-errSys.getMaxErrorValue()) + "~" + nf.format(errSys.getMaxErrorValue()));
|
||||||
setDetection(dataRule, harmDataList, errSys, data, v);
|
setDetection(dataRule, harmDataList, errSys, data, v);
|
||||||
}
|
}
|
||||||
info.add(data);
|
info.add(data);
|
||||||
@@ -817,7 +817,7 @@ public class DetectionServiceImpl {
|
|||||||
nf.setMaximumFractionDigits(6);
|
nf.setMaximumFractionDigits(6);
|
||||||
nf.setGroupingUsed(false);
|
nf.setGroupingUsed(false);
|
||||||
errSysDtl.setMaxErrorValue(maxErrorMultiply(errSysDtl.getMaxErrorValue(), data, channelData, errSysDtl.getErrorValueType()));
|
errSysDtl.setMaxErrorValue(maxErrorMultiply(errSysDtl.getMaxErrorValue(), data, channelData, errSysDtl.getErrorValueType()));
|
||||||
detectionData.setRadius(nf.format(-errSysDtl.getMaxErrorValue()) + "~" + nf.format(-errSysDtl.getMaxErrorValue()));
|
detectionData.setRadius(nf.format(-errSysDtl.getMaxErrorValue()) + "~" + nf.format(errSysDtl.getMaxErrorValue()));
|
||||||
setDetection(dataRule, list, errSysDtl, detectionData, channelData);
|
setDetection(dataRule, list, errSysDtl, detectionData, channelData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public interface IPqDevService extends IService<PqDev> {
|
|||||||
* @param devIds 设备id列表
|
* @param devIds 设备id列表
|
||||||
* @return 绑定成功返回true,否则返回false
|
* @return 绑定成功返回true,否则返回false
|
||||||
*/
|
*/
|
||||||
boolean bind(String planId, List<String> devIds);
|
Integer bind(String planId, List<String> devIds);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取饼图数据
|
* 获取饼图数据
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||||
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
import com.njcn.common.pojo.enums.common.DataStateEnum;
|
||||||
import com.njcn.common.pojo.exception.BusinessException;
|
import com.njcn.common.pojo.exception.BusinessException;
|
||||||
import com.njcn.common.pojo.poi.PullDown;
|
import com.njcn.common.pojo.poi.PullDown;
|
||||||
@@ -48,7 +49,6 @@ import org.springframework.transaction.annotation.Transactional;
|
|||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -150,7 +150,38 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return this.lambdaUpdate().set(PqDev::getState, DataStateEnum.DELETED.getCode()).in(PqDev::getId, param.getIds()).update();
|
if (CollUtil.isNotEmpty(param.getIds())) {
|
||||||
|
MPJLambdaWrapper<PqDev> queryWrapper = new MPJLambdaWrapper<>();
|
||||||
|
queryWrapper.selectAll(PqDev.class)
|
||||||
|
.selectAs("t1.Name", PqDev::getPlanId)
|
||||||
|
.leftJoin("ad_plan t1 on t1.Id = t.Plan_Id")
|
||||||
|
.in(PqDev::getId, param.getIds())
|
||||||
|
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode());
|
||||||
|
List<PqDev> devList = this.baseMapper.selectJoinList(PqDev.class, queryWrapper);
|
||||||
|
Map<String, List<PqDev>> collect = devList.stream().filter(x -> StrUtil.isNotBlank(x.getPlanId())).collect(Collectors.groupingBy(PqDev::getPlanId));
|
||||||
|
StringBuffer str;
|
||||||
|
if (CollUtil.isNotEmpty(collect)) {
|
||||||
|
str = new StringBuffer();
|
||||||
|
collect.forEach((k, v) -> {
|
||||||
|
str.append(k + ": ");
|
||||||
|
for (int i = 0; i < v.size(); i++) {
|
||||||
|
if ( i==v.size()-1) {
|
||||||
|
str.append(v.get(i).getName());
|
||||||
|
} else {
|
||||||
|
str.append(v.get(i).getName() + ",");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
str.append(" &&");
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
str = null;
|
||||||
|
}
|
||||||
|
if (ObjectUtil.isNotNull(str)) {
|
||||||
|
throw new BusinessException(DevResponseEnum.DEVICE_DELETE, str.toString());
|
||||||
|
}
|
||||||
|
return this.lambdaUpdate().set(PqDev::getState, DataStateEnum.DELETED.getCode()).in(PqDev::getId, param.getIds()).update();
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -285,14 +316,34 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = {Exception.class})
|
@Transactional(rollbackFor = {Exception.class})
|
||||||
public boolean bind(String planId, List<String> devIds) {
|
public Integer bind(String planId, List<String> devIds) {
|
||||||
|
//先将这个绑定的计划全部剔除掉
|
||||||
this.lambdaUpdate().set(PqDev::getPlanId, null).eq(PqDev::getPlanId, planId).update();
|
this.lambdaUpdate().set(PqDev::getPlanId, null).eq(PqDev::getPlanId, planId).update();
|
||||||
|
//然后进行状态绑定
|
||||||
if (ObjectUtil.isNotEmpty(devIds)) {
|
if (ObjectUtil.isNotEmpty(devIds)) {
|
||||||
this.lambdaUpdate().set(PqDev::getPlanId, planId).in(PqDev::getId, devIds).update();
|
this.lambdaUpdate().set(PqDev::getPlanId, planId).in(PqDev::getId, devIds).update();
|
||||||
}
|
List<PqDev> list = this.list(new LambdaQueryWrapper<PqDev>().in(PqDev::getId, devIds));
|
||||||
|
//判断是否有处了未检的其他设备
|
||||||
|
List<Integer> notUnchecked = list.stream().map(PqDev::getCheckState).filter(x -> !x.equals(CheckStateEnum.UNCHECKED.getValue())).distinct().collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(notUnchecked)) {
|
||||||
|
List<Integer> unchecked = list.stream().map(PqDev::getCheckState).filter(x -> x.equals(CheckStateEnum.UNCHECKED.getValue())).distinct().collect(Collectors.toList());
|
||||||
|
if (CollUtil.isNotEmpty(unchecked)) {
|
||||||
|
return CheckStateEnum.CHECKING.getValue();
|
||||||
|
}
|
||||||
|
List<Integer> checking = list.stream().map(PqDev::getCheckState).filter(x -> x.equals(CheckStateEnum.CHECKING.getValue())).distinct().collect(Collectors.toList());
|
||||||
|
if (checking.size() == notUnchecked.size()) {
|
||||||
|
return CheckStateEnum.CHECKING.getValue();
|
||||||
|
}
|
||||||
|
List<Integer> checked = list.stream().map(PqDev::getCheckState).filter(x -> x.equals(CheckStateEnum.CHECKED.getValue()) ||
|
||||||
|
x.equals(CheckStateEnum.DOCUMENTED.getValue())
|
||||||
|
).distinct().collect(Collectors.toList());
|
||||||
|
if (checked.size() == notUnchecked.size()) {
|
||||||
|
return CheckStateEnum.CHECKED.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
}
|
||||||
|
}
|
||||||
|
return CheckStateEnum.UNCHECKED.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Override
|
// @Override
|
||||||
@@ -616,7 +667,7 @@ public class PqDevServiceImpl extends ServiceImpl<PqDevMapper, PqDev> implements
|
|||||||
long start = Long.parseLong(split[0]);
|
long start = Long.parseLong(split[0]);
|
||||||
long end = Long.parseLong(split[1]);
|
long end = Long.parseLong(split[1]);
|
||||||
// 避免起始大于结束
|
// 避免起始大于结束
|
||||||
if(start > end){
|
if (start > end) {
|
||||||
long temp = start;
|
long temp = start;
|
||||||
start = end;
|
start = end;
|
||||||
end = temp;
|
end = temp;
|
||||||
|
|||||||
@@ -21,7 +21,10 @@ public enum DevResponseEnum {
|
|||||||
IMPORT_DATASOURCE_ERROR("A001013","当前模式下一个检测计划只能有一个数据源" ),
|
IMPORT_DATASOURCE_ERROR("A001013","当前模式下一个检测计划只能有一个数据源" ),
|
||||||
DEV_UN_CHECKED("A001013","装置还未检测完成!" ),
|
DEV_UN_CHECKED("A001013","装置还未检测完成!" ),
|
||||||
DEV_UN_REPORT("A001013","装置报告未生成!" ),
|
DEV_UN_REPORT("A001013","装置报告未生成!" ),
|
||||||
DEVICE_DIS_ERROR("A001014","装置配置异常" );
|
DEVICE_DIS_ERROR("A001014","装置配置异常" ),
|
||||||
|
DEVICE_DELETE("A001015","设备无法删除,已绑定计划! " )
|
||||||
|
|
||||||
|
;
|
||||||
|
|
||||||
private final String message;
|
private final String message;
|
||||||
private final String code;
|
private final String code;
|
||||||
|
|||||||
@@ -75,51 +75,60 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
.orderByAsc(AdHarmonicResult::getTimeId)
|
.orderByAsc(AdHarmonicResult::getTimeId)
|
||||||
;
|
;
|
||||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
||||||
List<Double> harmNum = param.getHarmNum();
|
Map<String, List<RawDataVO>> info = new LinkedHashMap<>(3);
|
||||||
|
if(CollectionUtil.isNotEmpty(adHarmonicResults)){
|
||||||
|
List<Double> harmNum = param.getHarmNum();
|
||||||
|
RawDataVO dataVO;
|
||||||
|
List<RawDataVO> rawDataVOS;
|
||||||
|
DictTree dictData = dictTreeMapper.selectById(adHarmonicResults.get(0).getAdType());
|
||||||
|
String unit;
|
||||||
|
if (DictDataEnum.I2_50.getCode().equals(dictData.getCode()) || DictDataEnum.SI_1_49.getCode().equals(dictData.getCode())) {
|
||||||
|
unit = "A";
|
||||||
|
} else {
|
||||||
|
unit = "%";
|
||||||
|
}
|
||||||
|
for (AdHarmonicResult harmonicResult : adHarmonicResults) {
|
||||||
|
for (Double i : harmNum) {
|
||||||
|
dataVO = new RawDataVO();
|
||||||
|
dataVO.setHarmNum(i);
|
||||||
|
dataVO.setUnit(unit);
|
||||||
|
try {
|
||||||
|
Field timeId = harmonicResult.getClass().getDeclaredField("timeId");
|
||||||
|
timeId.setAccessible(true);
|
||||||
|
LocalDateTime localDateTime = (LocalDateTime) timeId.get(harmonicResult);
|
||||||
|
dataVO.setTime(localDateTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
||||||
|
|
||||||
Map<String, List<RawDataVO>> info=new LinkedHashMap<>(3);
|
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
||||||
RawDataVO dataVO;
|
fieldA.setAccessible(true);
|
||||||
List<RawDataVO> rawDataVOS;
|
BigDecimal decimalA = new BigDecimal(fieldA.get(harmonicResult) + "");
|
||||||
for (AdHarmonicResult harmonicResult : adHarmonicResults) {
|
dataVO.setDataA(decimalA.toPlainString());
|
||||||
for (Double i : harmNum) {
|
|
||||||
dataVO = new RawDataVO();
|
|
||||||
dataVO.setHarmNum(i);
|
|
||||||
dataVO.setUnit("%");
|
|
||||||
try {
|
|
||||||
Field timeId = harmonicResult.getClass().getDeclaredField("timeId");
|
|
||||||
timeId.setAccessible(true);
|
|
||||||
LocalDateTime localDateTime = (LocalDateTime) timeId.get(harmonicResult);
|
|
||||||
dataVO.setTime(localDateTime.format(DateTimeFormatter.ofPattern(DatePattern.NORM_DATETIME_PATTERN)));
|
|
||||||
|
|
||||||
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
Field fieldB = harmonicResult.getClass().getDeclaredField("bValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldA.setAccessible(true);
|
fieldB.setAccessible(true);
|
||||||
BigDecimal decimalA = new BigDecimal(fieldA.get(harmonicResult)+"");
|
BigDecimal decimalB = new BigDecimal(fieldB.get(harmonicResult) + "");
|
||||||
dataVO.setDataA(decimalA.toPlainString());
|
dataVO.setDataB(decimalB.toPlainString());
|
||||||
|
|
||||||
Field fieldB = harmonicResult.getClass().getDeclaredField("bValue" + isHarmOrInHarm(i).intValue());
|
Field fieldC = harmonicResult.getClass().getDeclaredField("cValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldB.setAccessible(true);
|
fieldC.setAccessible(true);
|
||||||
BigDecimal decimalB = new BigDecimal(fieldB.get(harmonicResult)+"");
|
BigDecimal decimalC = new BigDecimal(fieldC.get(harmonicResult) + "");
|
||||||
dataVO.setDataB(decimalB.toPlainString());
|
dataVO.setDataC(decimalC.toPlainString());
|
||||||
|
} catch (NoSuchFieldException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
} catch (IllegalAccessException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
if (info.containsKey(String.valueOf(i))) {
|
||||||
|
info.get(String.valueOf(i)).add(dataVO);
|
||||||
|
} else {
|
||||||
|
rawDataVOS = new ArrayList<>();
|
||||||
|
rawDataVOS.add(dataVO);
|
||||||
|
info.put(String.valueOf(i), rawDataVOS);
|
||||||
|
}
|
||||||
|
|
||||||
Field fieldC = harmonicResult.getClass().getDeclaredField("cValue" + isHarmOrInHarm(i).intValue());
|
|
||||||
fieldC.setAccessible(true);
|
|
||||||
BigDecimal decimalC = new BigDecimal(fieldC.get(harmonicResult)+"");
|
|
||||||
dataVO.setDataC(decimalC.toPlainString());
|
|
||||||
} catch (NoSuchFieldException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
} catch (IllegalAccessException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
if(info.containsKey(String.valueOf(i))){
|
|
||||||
info.get(String.valueOf(i)).add(dataVO);
|
|
||||||
}else{
|
|
||||||
rawDataVOS=new ArrayList<>();
|
|
||||||
rawDataVOS.add(dataVO);
|
|
||||||
info.put(String.valueOf(i),rawDataVOS) ;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicTableNameHandler.remove();
|
DynamicTableNameHandler.remove();
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
@@ -135,16 +144,16 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
.orderByAsc(AdHarmonicResult::getTimeId);
|
.orderByAsc(AdHarmonicResult::getTimeId);
|
||||||
|
|
||||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
||||||
Map<String, RawResultDataVO> info=new LinkedHashMap<>(3);
|
Map<String, RawResultDataVO> info = new LinkedHashMap<>(3);
|
||||||
if(CollUtil.isNotEmpty(adHarmonicResults)){
|
if (CollUtil.isNotEmpty(adHarmonicResults)) {
|
||||||
List<Double> harmNum = param.getHarmNum();
|
List<Double> harmNum = param.getHarmNum();
|
||||||
RawResultDataVO dataVO;
|
RawResultDataVO dataVO;
|
||||||
DictTree dictData = dictTreeMapper.selectById(adHarmonicResults.get(0).getAdType());
|
DictTree dictData = dictTreeMapper.selectById(adHarmonicResults.get(0).getAdType());
|
||||||
String unit;
|
String unit;
|
||||||
if(DictDataEnum.I2_50.getCode().equals(dictData.getCode())||DictDataEnum.SI_1_49.getCode().equals(dictData.getCode())){
|
if (DictDataEnum.I2_50.getCode().equals(dictData.getCode()) || DictDataEnum.SI_1_49.getCode().equals(dictData.getCode())) {
|
||||||
unit="A";
|
unit = "A";
|
||||||
}else{
|
} else {
|
||||||
unit="%";
|
unit = "%";
|
||||||
}
|
}
|
||||||
for (AdHarmonicResult harmonicResult : adHarmonicResults) {
|
for (AdHarmonicResult harmonicResult : adHarmonicResults) {
|
||||||
for (Double i : harmNum) {
|
for (Double i : harmNum) {
|
||||||
@@ -155,19 +164,19 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
try {
|
try {
|
||||||
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
Field fieldA = harmonicResult.getClass().getDeclaredField("aValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldA.setAccessible(true);
|
fieldA.setAccessible(true);
|
||||||
RawResultDataVO.DetectionData a = JSON.parseObject(fieldA.get(harmonicResult)+"", RawResultDataVO.DetectionData.class);
|
RawResultDataVO.DetectionData a = JSON.parseObject(fieldA.get(harmonicResult) + "", RawResultDataVO.DetectionData.class);
|
||||||
dataVO.setDataA(a);
|
dataVO.setDataA(a);
|
||||||
|
|
||||||
Field fieldB = harmonicResult.getClass().getDeclaredField("bValue" + isHarmOrInHarm(i).intValue());
|
Field fieldB = harmonicResult.getClass().getDeclaredField("bValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldB.setAccessible(true);
|
fieldB.setAccessible(true);
|
||||||
RawResultDataVO.DetectionData b = JSON.parseObject(fieldB.get(harmonicResult)+"", RawResultDataVO.DetectionData.class);
|
RawResultDataVO.DetectionData b = JSON.parseObject(fieldB.get(harmonicResult) + "", RawResultDataVO.DetectionData.class);
|
||||||
dataVO.setDataB(b);
|
dataVO.setDataB(b);
|
||||||
|
|
||||||
Field fieldC = harmonicResult.getClass().getDeclaredField("cValue" + isHarmOrInHarm(i).intValue());
|
Field fieldC = harmonicResult.getClass().getDeclaredField("cValue" + isHarmOrInHarm(i).intValue());
|
||||||
fieldC.setAccessible(true);
|
fieldC.setAccessible(true);
|
||||||
RawResultDataVO.DetectionData c = JSON.parseObject(fieldC.get(harmonicResult)+"", RawResultDataVO.DetectionData.class);
|
RawResultDataVO.DetectionData c = JSON.parseObject(fieldC.get(harmonicResult) + "", RawResultDataVO.DetectionData.class);
|
||||||
dataVO.setDataC(c);
|
dataVO.setDataC(c);
|
||||||
if(ObjectUtil.isNotNull(a)){
|
if (ObjectUtil.isNotNull(a)) {
|
||||||
dataVO.setRadius(a.getRadius());
|
dataVO.setRadius(a.getRadius());
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException e) {
|
} catch (NoSuchFieldException e) {
|
||||||
@@ -175,7 +184,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
} catch (IllegalAccessException e) {
|
} catch (IllegalAccessException e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
}
|
}
|
||||||
info.put(String.valueOf(i),dataVO) ;
|
info.put(String.valueOf(i), dataVO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -192,15 +201,16 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
LambdaQueryWrapper<AdHarmonicResult> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AdHarmonicResult> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
lambdaQueryWrapper.select(AdHarmonicResult::getSort)
|
lambdaQueryWrapper.select(AdHarmonicResult::getSort)
|
||||||
.eq(AdHarmonicResult::getResultFlag, 2)
|
.eq(AdHarmonicResult::getResultFlag, 2)
|
||||||
.eq(AdHarmonicResult::getScriptId,param.getScriptId());
|
.eq(AdHarmonicResult::getScriptId, param.getScriptId());
|
||||||
List<AdHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
List<AdHarmonicResult> adHarmonicResultList = this.list(lambdaQueryWrapper);
|
||||||
List<Integer> indexes = new ArrayList<>(adHarmonicResultList.stream().map(AdHarmonicResult::getSort).collect(Collectors.toList()));
|
List<Integer> indexes = new ArrayList<>(adHarmonicResultList.stream().map(AdHarmonicResult::getSort).collect(Collectors.toList()));
|
||||||
|
|
||||||
DynamicTableNameHandler.setTableName(prefixNon + param.getCode());
|
DynamicTableNameHandler.setTableName(prefixNon + param.getCode());
|
||||||
LambdaQueryWrapper<AdNonHarmonicResult> resultLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AdNonHarmonicResult> resultLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
resultLambdaQueryWrapper.select(AdNonHarmonicResult::getSort)
|
resultLambdaQueryWrapper.select(AdNonHarmonicResult::getSort)
|
||||||
.eq(AdNonHarmonicResult::getResultFlag,2)
|
.eq(AdNonHarmonicResult::getResultFlag, 2)
|
||||||
.eq(AdNonHarmonicResult::getScriptId,param.getScriptId());;
|
.eq(AdNonHarmonicResult::getScriptId, param.getScriptId());
|
||||||
|
;
|
||||||
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
List<AdNonHarmonicResult> nonHarmonicResults = adNonHarmonicMapper.selectList(resultLambdaQueryWrapper);
|
||||||
indexes.addAll(nonHarmonicResults.stream().map(AdNonHarmonicResult::getSort).collect(Collectors.toList()));
|
indexes.addAll(nonHarmonicResults.stream().map(AdNonHarmonicResult::getSort).collect(Collectors.toList()));
|
||||||
|
|
||||||
@@ -210,7 +220,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AdHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam) {
|
public AdHarmonicResult getSingleResult(SingleNonHarmParam singleNonHarmParam) {
|
||||||
if(ObjectUtil.isNotNull(singleNonHarmParam)){
|
if (ObjectUtil.isNotNull(singleNonHarmParam)) {
|
||||||
String prefix = "ad_harmonic_result_";
|
String prefix = "ad_harmonic_result_";
|
||||||
DynamicTableNameHandler.setTableName(prefix + singleNonHarmParam.getPlanCode());
|
DynamicTableNameHandler.setTableName(prefix + singleNonHarmParam.getPlanCode());
|
||||||
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
MPJLambdaWrapper<AdHarmonicResult> wrapper = new MPJLambdaWrapper<>();
|
||||||
@@ -218,7 +228,7 @@ public class AdHarmonicServiceImpl extends ServiceImpl<AdHarmonicMappper, AdHarm
|
|||||||
.eq(AdHarmonicResult::getSort, singleNonHarmParam.getSort())
|
.eq(AdHarmonicResult::getSort, singleNonHarmParam.getSort())
|
||||||
.eq(AdHarmonicResult::getAdType, singleNonHarmParam.getAdType());
|
.eq(AdHarmonicResult::getAdType, singleNonHarmParam.getAdType());
|
||||||
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
List<AdHarmonicResult> adHarmonicResults = this.getBaseMapper().selectJoinList(AdHarmonicResult.class, wrapper);
|
||||||
if (CollectionUtil.isNotEmpty(adHarmonicResults)){
|
if (CollectionUtil.isNotEmpty(adHarmonicResults)) {
|
||||||
return adHarmonicResults.get(0);
|
return adHarmonicResults.get(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -226,6 +226,13 @@ public class AdNonHarmonicServiceImpl extends ServiceImpl<AdNonHarmonicMapper, A
|
|||||||
case "DUR":
|
case "DUR":
|
||||||
unit="s";
|
unit="s";
|
||||||
break;
|
break;
|
||||||
|
/**
|
||||||
|
* 暂态-持续时间
|
||||||
|
*/
|
||||||
|
case "VA":
|
||||||
|
case "IA":
|
||||||
|
unit="°";
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
return unit;
|
return unit;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user