测试问题修改

This commit is contained in:
cwchen 2025-04-17 18:05:45 +08:00
parent bf7315c0b4
commit e674c6f5bb
2 changed files with 10 additions and 3 deletions

View File

@ -68,6 +68,13 @@ public class SynthesisQueryServiceImpl implements SynthesisQueryService {
try { try {
Long userId = Optional.ofNullable(UserUtil.getLoginUser()).map(LoginUser::getId).orElse(0L); Long userId = Optional.ofNullable(UserUtil.getLoginUser()).map(LoginUser::getId).orElse(0L);
dto.setUserId(userId); dto.setUserId(userId);
String roleLevel = Optional.ofNullable(UserUtil.getLoginUser()).map(LoginUser::getRoleLevel).orElse("0");
String proIds = Optional.ofNullable(UserUtil.getLoginUser()).map(LoginUser::getProIds).orElse("-1");
if(Objects.equals(roleLevel, Constants.ROLE_LEVEL)){ // 项目部级
List<Long> proList = Arrays.stream(proIds.split(",")).map(String::trim).filter(s -> !s.isEmpty()).map(Long::valueOf).collect(Collectors.toList());
dto.setProIds(proList);
}
dto.setRoleLevel(roleLevel);
List<SynthesisQueryVo> list = Optional.ofNullable(synthesisQueryDao.getImgList(dto)).orElseGet(ArrayList::new); List<SynthesisQueryVo> list = Optional.ofNullable(synthesisQueryDao.getImgList(dto)).orElseGet(ArrayList::new);
PageInfo<SynthesisQueryVo> pageInfo = new PageInfo<>(list); PageInfo<SynthesisQueryVo> pageInfo = new PageInfo<>(list);
return ServerResponse.createSuccess(pageInfo); return ServerResponse.createSuccess(pageInfo);

View File

@ -23,7 +23,7 @@ public class HighQualityWatermark {
private static final int DEFAULT_FONT_STYLE = Font.BOLD; private static final int DEFAULT_FONT_STYLE = Font.BOLD;
private static final Color DEFAULT_COLOR = new Color(195, 32, 32, 255); private static final Color DEFAULT_COLOR = new Color(195, 32, 32, 255);
private static final int MIN_FONT_SIZE = 10; private static final int MIN_FONT_SIZE = 10;
private static final int MAX_FONT_SIZE = 140; private static final int MAX_FONT_SIZE = 100;
private static final float MIN_OPACITY = 0.3f; private static final float MIN_OPACITY = 0.3f;
private static final float MAX_OPACITY = 0.9f; private static final float MAX_OPACITY = 0.9f;
private static final float DEFAULT_QUALITY = 1.0f; // 最高质量(无损) private static final float DEFAULT_QUALITY = 1.0f; // 最高质量(无损)
@ -344,11 +344,11 @@ public class HighQualityWatermark {
// 准备多行水印文本 // 准备多行水印文本
List<String> watermarkLines = new ArrayList<>(); List<String> watermarkLines = new ArrayList<>();
watermarkLines.add("2024-05-12"); watermarkLines.add("2024-05-12");
String proName = "广东电网直流背靠背东莞工程大湾区南粤直流背靠背工程南粤±300kV背靠背换流站工程/新增/广东电网直流背靠背东莞工程大湾区南通道直流背靠背工程110kV环保城输变电工程电缆部分"; String proName = "2023年高压所昆明实验室主接地网接地阻抗及接地引下线电气完整性测试项目";
watermarkLines.add(proName.replaceAll("(.{18})", "$1@@")); watermarkLines.add(proName.replaceAll("(.{18})", "$1@@"));
watermarkLines.add("安全违章"); watermarkLines.add("安全违章");
watermarkLines.add("违章照片"); watermarkLines.add("违章照片");
String localPath = "C:\\Users\\10488\\Desktop\\174470065630950048665.jpg"; String localPath = "C:\\Users\\10488\\Desktop\\174488069271769683919.jpg";
String outPath = "C:\\Users\\10488\\Desktop\\output.jpg"; String outPath = "C:\\Users\\10488\\Desktop\\output.jpg";
// 添加高质量水印 // 添加高质量水印
addHighQualityWatermark(localPath, outPath, addHighQualityWatermark(localPath, outPath,