有功功率趋势定时任务算法完善
This commit is contained in:
@@ -45,6 +45,7 @@ public enum PvDeviceResponseEnum {
|
||||
TWO_SUB_VOLTAGE_EMPTY_MUST("A0368","II类监测点变电站母线必须为空"),
|
||||
LINE_DEVICE_NO_MATCH("A0369","监测点所属装置型号不匹配"),
|
||||
NO_SUB("A0370","当前单位下不存在台区或变电站"),
|
||||
NEWSTATION_REPEAT("A0371","新能源场站名称已存在"),
|
||||
;
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.njcn.common.pojo.exception.BusinessException;
|
||||
import com.njcn.device.biz.enums.DeviceResponseEnum;
|
||||
import com.njcn.device.pq.enums.PvDeviceResponseEnum;
|
||||
import com.njcn.device.pq.mapper.LineDetailMapper;
|
||||
import com.njcn.device.pq.mapper.NewStationMapper;
|
||||
import com.njcn.device.pq.pojo.param.NewStationQueryParam;
|
||||
@@ -45,10 +46,19 @@ public class NewStationServiceImpl extends ServiceImpl<NewStationMapper, NewStat
|
||||
NewStation newStation = new NewStation();
|
||||
BeanUtil.copyProperties(newStationEdit, newStation);
|
||||
newStation.setState(1);
|
||||
LambdaQueryWrapper<NewStation> lambdaQueryWrapper = new LambdaQueryWrapper();
|
||||
lambdaQueryWrapper.eq(NewStation::getName,newStation.getName()).eq(NewStation::getState,1);
|
||||
boolean result ;
|
||||
if(newStation.getId() != null){
|
||||
lambdaQueryWrapper.ne(NewStation::getId,newStation.getId());
|
||||
if(!this.baseMapper.selectList(lambdaQueryWrapper).isEmpty()){
|
||||
throw new BusinessException(PvDeviceResponseEnum.NEWSTATION_REPEAT.getMessage());
|
||||
}
|
||||
result = this.updateById(newStation);
|
||||
}else{
|
||||
if(!this.baseMapper.selectList(lambdaQueryWrapper).isEmpty()){
|
||||
throw new BusinessException(PvDeviceResponseEnum.NEWSTATION_REPEAT.getMessage());
|
||||
}
|
||||
newStation.setId(IdUtil.simpleUUID());
|
||||
result = this.save(newStation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user