微调
This commit is contained in:
@@ -57,20 +57,20 @@ public class PqScriptParam {
|
|||||||
/**
|
/**
|
||||||
* 额定电压
|
* 额定电压
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("额定电压")
|
// @ApiModelProperty("额定电压")
|
||||||
@NotNull(message = DevValidMessage.SCRIPT_TYPE_NOT_BLANK)
|
// @NotNull(message = DevValidMessage.SCRIPT_TYPE_NOT_BLANK)
|
||||||
@Min(value = 0, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
// @Min(value = 0, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
||||||
@Max(value = 380, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
// @Max(value = 380, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
||||||
private Double ratedVolt;
|
// private Double ratedVolt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 额定电流
|
* 额定电流
|
||||||
*/
|
*/
|
||||||
@ApiModelProperty("额定电流")
|
// @ApiModelProperty("额定电流")
|
||||||
@NotNull(message = DevValidMessage.SCRIPT_TYPE_NOT_BLANK)
|
// @NotNull(message = DevValidMessage.SCRIPT_TYPE_NOT_BLANK)
|
||||||
@Min(value = 0, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
// @Min(value = 0, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
||||||
@Max(value = 20, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
// @Max(value = 20, message = DevValidMessage.SCRIPT_TYPE_FORMAT_ERROR)
|
||||||
private Double ratedCurr;
|
// private Double ratedCurr;
|
||||||
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@@ -66,12 +66,12 @@ public class PqScript extends BaseEntity implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 额定电压
|
* 额定电压
|
||||||
*/
|
*/
|
||||||
private Double ratedVolt;
|
// private Double ratedVolt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 额定电流
|
* 额定电流
|
||||||
*/
|
*/
|
||||||
private Double ratedCurr;
|
// private Double ratedCurr;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 状态:0-删除 1-正常
|
* 状态:0-删除 1-正常
|
||||||
|
|||||||
@@ -9,9 +9,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
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.gather.detection.pojo.enums.DetectionCodeEnum;
|
import com.njcn.gather.detection.pojo.enums.DetectionCodeEnum;
|
||||||
import com.njcn.gather.detection.pojo.enums.DetectionResponseEnum;
|
|
||||||
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
import com.njcn.gather.device.pojo.enums.CommonEnum;
|
||||||
import com.njcn.gather.device.pojo.po.PqDev;
|
import com.njcn.gather.device.pojo.po.PqDev;
|
||||||
import com.njcn.gather.device.service.IPqDevService;
|
import com.njcn.gather.device.service.IPqDevService;
|
||||||
@@ -133,15 +131,17 @@ public class PqScriptDtlsServiceImpl extends ServiceImpl<PqScriptDtlsMapper, PqS
|
|||||||
boolean devFly = CollUtil.isNotEmpty(param.getDevIds());
|
boolean devFly = CollUtil.isNotEmpty(param.getDevIds());
|
||||||
if (devFly) {
|
if (devFly) {
|
||||||
//校验终端额定电压电流是否相同
|
//校验终端额定电压电流是否相同
|
||||||
PqScript pqScript = pqScriptMapper.selectOne(new LambdaQueryWrapper<PqScript>()
|
List<PqDev> list = pqDevService.list(new LambdaQueryWrapper<PqDev>()
|
||||||
.eq(PqScript::getId, param.getScriptId()));
|
.eq(StrUtil.isNotBlank(param.getPlanId()), PqDev::getPlanId, param.getPlanId())
|
||||||
if(ObjectUtil.isNull(pqScript)){
|
.in(PqDev::getId, param.getDevIds())
|
||||||
throw new BusinessException(DetectionResponseEnum.SCRIPT_PATTERN_NOT);
|
.eq(PqDev::getState, DataStateEnum.ENABLE.getCode())
|
||||||
}
|
);
|
||||||
|
Set<String> devTypeSet = list.stream().map(PqDev::getDevType).collect(Collectors.toSet());
|
||||||
|
List<DevType> devTypes = devTypeService.listByIds(devTypeSet);
|
||||||
//额定电压信息
|
//额定电压信息
|
||||||
voltSet.add(pqScript.getRatedVolt());
|
voltSet = devTypes.stream().map(DevType::getDevVolt).collect(Collectors.toSet());
|
||||||
//额定电流信息
|
//额定电流信息
|
||||||
currSet.add(pqScript.getRatedCurr());
|
currSet = devTypes.stream().map(DevType::getDevCurr).collect(Collectors.toSet());
|
||||||
} else {
|
} else {
|
||||||
if (param.getType() == 0) {
|
if (param.getType() == 0) {
|
||||||
voltSet.add(1.0);
|
voltSet.add(1.0);
|
||||||
|
|||||||
Reference in New Issue
Block a user