Merge remote-tracking branch 'origin/main'
This commit is contained in:
@@ -51,6 +51,7 @@ import net.sf.json.JSONObject;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -471,7 +472,7 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
List<AdvanceEventDetailVO> advanceEventDetailVOList = BeanUtil.copyToList(rmpEventDetailPOList, AdvanceEventDetailVO.class);
|
||||
advanceEventDetailVOList = advanceEventDetailVOList.stream().peek(item -> {
|
||||
item.setFeatureAmplitude(item.getFeatureAmplitude()*100);
|
||||
item.setFeatureAmplitude(roundHalfUp(item.getFeatureAmplitude()*100));
|
||||
|
||||
if (map.containsKey(item.getLineId())) {
|
||||
AreaLineInfoVO areaLineInfoVO = map.get(item.getLineId());
|
||||
@@ -491,7 +492,17 @@ public class EventRelevantAnalysisServiceImpl extends ServiceImpl<RmpEventAdvanc
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 四舍五入保留两位小数
|
||||
*/
|
||||
private Double roundHalfUp(double num) {
|
||||
if (num == 3.14159) {
|
||||
return num;
|
||||
}
|
||||
BigDecimal b = new BigDecimal(num);
|
||||
//保留2位小数
|
||||
return com.njcn.harmonic.utils.PubUtils.dataLimits(b.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue());
|
||||
}
|
||||
@Override
|
||||
public Page<RmpEventDetailAssPO> queryEventsAssPage(BaseParam baseParam) {
|
||||
List<LocalDateTime> timeV = PubUtils.checkLocalDate(baseParam.getSearchBeginTime(), baseParam.getSearchEndTime());
|
||||
|
||||
@@ -36,10 +36,10 @@ public class TransientParam extends DeviceInfoParam.BusinessParam {
|
||||
private BigDecimal eventValueMin;
|
||||
|
||||
@ApiModelProperty("持续时间最大值")
|
||||
private Integer persistMax;
|
||||
private Double persistMax;
|
||||
|
||||
@ApiModelProperty("持续时间最小值")
|
||||
private Integer persistMin;
|
||||
private Double persistMin;
|
||||
|
||||
@ApiModelProperty("严重度最大值")
|
||||
private BigDecimal severityMax;
|
||||
|
||||
@@ -526,6 +526,7 @@ public class TransientServiceImpl implements TransientService {
|
||||
log.info("cfg-----"+cfgPath);
|
||||
log.info("cfg-----"+datPath);
|
||||
|
||||
|
||||
//判断文件是否存在
|
||||
File file = new File(cfgPath);
|
||||
if(!file.exists()){
|
||||
@@ -540,6 +541,8 @@ public class TransientServiceImpl implements TransientService {
|
||||
log.info("cfg-----"+cfgPath);
|
||||
log.info("cfg-----"+datPath);
|
||||
cfgStream = waveFileComponent.getFileInputStreamByFilePath(cfgPath);
|
||||
datStream = waveFileComponent.getFileInputStreamByFilePath(datPath);
|
||||
|
||||
} else {
|
||||
cfgPath = OssPath.WAVE_DIR + ip + StrUtil.SLASH + waveName + GeneralConstant.CFG;
|
||||
boolean result1 = minIoUtils.checkFileIsExist(minIossProperties.getBucket(), cfgPath);
|
||||
|
||||
@@ -121,6 +121,9 @@ public class WarningLeafletVO extends BaseEntity implements Serializable{
|
||||
@ApiModelProperty("预告警单下载路径")
|
||||
private String filePath;
|
||||
|
||||
@ApiModelProperty("实际路径")
|
||||
private String absFilePath;
|
||||
|
||||
@ApiModelProperty("技术监督报告")
|
||||
private String supervisionReport;
|
||||
|
||||
|
||||
@@ -163,7 +163,9 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
x.setDutyOrgName(deptMap.get(x.getDutyOrgId()));
|
||||
}
|
||||
if (!Objects.isNull(x.getFilePath())) {
|
||||
x.setAbsFilePath(x.getFilePath());
|
||||
x.setFilePath(fileStorageUtil.getFileUrl(x.getFilePath()));
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -393,6 +395,8 @@ public class WarningLeafletServiceImpl extends ServiceImpl<WarningLeafletMapper,
|
||||
record.setDutyOrgName(deptMap.get(record.getDutyOrgId()));
|
||||
}
|
||||
if (!Objects.isNull(record.getFilePath())) {
|
||||
record.setAbsFilePath(record.getFilePath());
|
||||
|
||||
record.setFilePath(fileStorageUtil.getFileUrl(record.getFilePath()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1032,11 +1032,11 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
ExcelImportResult<SensitiveReportExcel> sensitiveUserExcelExcelImportResult = ExcelImportUtil.importExcelMore(file.getInputStream(), SensitiveReportExcel.class, params);
|
||||
log.info("Excel 解析完成,原始数据行数:{}", sensitiveUserExcelExcelImportResult.getList().size());
|
||||
//如果存在非法数据,将不合格的数据导出
|
||||
if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||
log.warn("存在校验失败的数据");
|
||||
PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
||||
return; // 校验失败直接返回
|
||||
} else {
|
||||
// if (sensitiveUserExcelExcelImportResult.isVerifyFail()) {
|
||||
// log.warn("存在校验失败的数据");
|
||||
// PoiUtil.exportFileByWorkbook(sensitiveUserExcelExcelImportResult.getFailWorkbook(), "非法用户数据.xlsx", response);
|
||||
// return; // 校验失败直接返回
|
||||
// } else {
|
||||
// 过滤掉空行数据(projectName 为空的行)
|
||||
sensitiveUserExcels = sensitiveUserExcelExcelImportResult.getList().stream()
|
||||
.filter(x -> StringUtils.isNotBlank(x.getProjectName()))
|
||||
@@ -1046,7 +1046,7 @@ public class UserReportPOServiceImpl extends ServiceImpl<UserReportPOMapper, Use
|
||||
if (CollectionUtil.isEmpty(sensitiveUserExcels)) {
|
||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_DEV_DATA_ERROR);
|
||||
}
|
||||
}
|
||||
// }
|
||||
} catch (Exception e) {
|
||||
log.error("导入失败,文件:{}", file.getOriginalFilename(), e);
|
||||
throw new BusinessException(SupervisionResponseEnum.IMPORT_SENSITIVE_REPORT_ERROR);
|
||||
|
||||
Reference in New Issue
Block a user