From 307ea3042f5b03e735772e5d3eaad8d5fc16b6ba Mon Sep 17 00:00:00 2001 From: 101captain <237651143@qq.com> Date: 星期五, 18 二月 2022 17:23:22 +0800 Subject: [PATCH] Merge branch 'master' of http://gitlab.nhys.cdnhxx.com/root/zhihuishequ --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AssemblyUtils.java | 32 ++++++++++++++++++++++++++++---- 1 files changed, 28 insertions(+), 4 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AssemblyUtils.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AssemblyUtils.java index 05e1b65..bc6a887 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AssemblyUtils.java +++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/utlis/AssemblyUtils.java @@ -44,10 +44,10 @@ for (ComActQuestnaireAnswerContentVO userAnswers : answerContentVOList) { a++; if(answerContentVOList.size()==26&&a==9){ - userData.add(""); + userData.add(" "); } //判断是文字描述直接跳过 - if (userAnswers.getOptionType().equals(5) || userAnswers.getOptionType().equals(11) + if (userAnswers.getOptionType().equals(5) || (StringUtils.isNotEmpty(userAnswers.getAnswerContent()) && userAnswers.getAnswerContent().contains(noExport))) { continue; } @@ -94,7 +94,19 @@ if(userAnswers.getOptionType().equals(11)){ reserveSubId = userAnswers.getReserveSubId(); try { - userData.add(new URL(userAnswers.getAnswerContent())); + if(StringUtils.isNotEmpty(userAnswers.getAnswerContent())){ + if(userAnswers.getAnswerContent().contains("_compress")){ + userData.add(new URL(userAnswers.getAnswerContent())); + } + else { + userData.add(new URL(userAnswers.getAnswerContent().substring(0,userAnswers.getAnswerContent().lastIndexOf("."))+"_compress.jpg")); + log.info(userAnswers.getAnswerContent().substring(0,userAnswers.getAnswerContent().lastIndexOf("."))+"_compress.jpg"); + } + //userData.add(new File("/workspace/minio/data/files/"+userAnswers.getAnswerContent().substring(userAnswers.getAnswerContent().indexOf("files/")+6))); + } + else { + userData.add(" "); + } }catch (Exception e){ userData.add(" "); log.error("导出转换图片失败!"); @@ -138,7 +150,19 @@ if(userAnswers.getOptionType().equals(11)){ reserveSubId = userAnswers.getReserveSubId(); try { - userData.add(new URL(userAnswers.getAnswerContent())); + if(StringUtils.isNotEmpty(userAnswers.getAnswerContent())){ + if(userAnswers.getAnswerContent().contains("_compress")){ + userData.add(new URL(userAnswers.getAnswerContent())); + log.info(userAnswers.getAnswerContent().substring(0,userAnswers.getAnswerContent().lastIndexOf("."))+"_compress.jpg"); + } + else { + userData.add(new URL(userAnswers.getAnswerContent().substring(0,userAnswers.getAnswerContent().lastIndexOf("."))+"_compress.jpg")); + } + //userData.add(new File("/workspace/minio/data/files/"+userAnswers.getAnswerContent().substring(userAnswers.getAnswerContent().indexOf("files/")+6))); + } + else { + userData.add(" "); + } }catch (Exception e){ userData.add(" "); log.error("导出转换图片失败!"); -- Gitblit v1.7.1