Browse Source

fix:[试验管理]导出

master
15881625488@163.com 3 months ago
parent
commit
cea22ec0f7
6 changed files with 146 additions and 150 deletions
  1. +1
    -9
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java
  2. +3
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java
  3. +3
    -3
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java
  4. +4
    -4
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/TemplateBaseUtil.java
  5. +8
    -4
      hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/sp/SP001.java

+ 1
- 9
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/controller/StudyFormFillController.java View File

@ -101,15 +101,7 @@ public class StudyFormFillController extends BaseController {
studyFormFillQmxx.setFormId(form.getFormId()); studyFormFillQmxx.setFormId(form.getFormId());
List<StudyFormFillQmxx> studyFormFillQmxxList = studyFormFillQmxxService.queryList(studyFormFillQmxx); List<StudyFormFillQmxx> studyFormFillQmxxList = studyFormFillQmxxService.queryList(studyFormFillQmxx);
StudyFormFill studyFormFill=studyFormFillService.queryInfo(form.getFormId()); StudyFormFill studyFormFill=studyFormFillService.queryInfo(form.getFormId());
return AjaxResult.success(localFilePrefix + PdfExportUtil.export(
studyFormFill.getTemplateExportClass(),
studyFormFill.getTemplateExportMethod(),
studyFormFill,
studyFormFillQmxxList,
studyFormFillJcgjList,
form.getLang(),
localFilePath));
return AjaxResult.success(localFilePrefix + PdfExportUtil.export(studyFormFill.getTemplateExportClass(), studyFormFill.getTemplateExportMethod(),studyFormFill,studyFormFillQmxxList,studyFormFillJcgjList,form.getLang(),form.getJcgjlx(),localFilePath));
} }
/** /**

+ 3
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Dosage.java View File

@ -159,7 +159,7 @@ public class Dosage {
if (node.get("name") != null) { if (node.get("name") != null) {
String name = node.get("name").asText(); String name = node.get("name").asText();
String value = node.get("value").asText(); String value = node.get("value").asText();
result.add(name + ":" + value);
result.add(name + "" + value);
} }
} }
} }
@ -172,7 +172,7 @@ public class Dosage {
if (node.get("name") != null) { if (node.get("name") != null) {
String name = node.get("name").asText(); String name = node.get("name").asText();
String value = node.get("value").asText(); String value = node.get("value").asText();
result.add(name + ":" + value);
result.add(name + "" + value);
} }
} }
} }
@ -180,7 +180,7 @@ public class Dosage {
if (StringUtils.isNoneBlank(jcgj.getRemark())) { if (StringUtils.isNoneBlank(jcgj.getRemark())) {
result.add(getName("备注")+":" + jcgj.getRemark()); result.add(getName("备注")+":" + jcgj.getRemark());
} }
if (StringUtils.isNoneBlank(jcgj.getRemark())) {
if (StringUtils.isNoneBlank(jcgj.getQmrMc())) {
result.add(getName("签名人")+":" + jcgj.getQmrMc()); result.add(getName("签名人")+":" + jcgj.getQmrMc());
} }
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false);

+ 3
- 3
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/resource/Drug.java View File

@ -158,7 +158,7 @@ public class Drug {
if (node.get("name") != null) { if (node.get("name") != null) {
String name = node.get("name").asText(); String name = node.get("name").asText();
String value = node.get("value").asText(); String value = node.get("value").asText();
result.add(name + ":" + value);
result.add(name + "" + value);
} }
} }
} }
@ -171,7 +171,7 @@ public class Drug {
if (node.get("name") != null) { if (node.get("name") != null) {
String name = node.get("name").asText(); String name = node.get("name").asText();
String value = node.get("value").asText(); String value = node.get("value").asText();
result.add(name + ":" + value);
result.add(name + "" + value);
} }
} }
} }
@ -179,7 +179,7 @@ public class Drug {
if (StringUtils.isNoneBlank(jcgj.getRemark())) { if (StringUtils.isNoneBlank(jcgj.getRemark())) {
result.add(getName("备注")+":" + jcgj.getRemark()); result.add(getName("备注")+":" + jcgj.getRemark());
} }
if (StringUtils.isNoneBlank(jcgj.getRemark())) {
if (StringUtils.isNoneBlank(jcgj.getQmrMc())) {
result.add(getName("签名人")+":" + jcgj.getQmrMc()); result.add(getName("签名人")+":" + jcgj.getQmrMc());
} }
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false);

+ 4
- 4
hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/TemplateBaseUtil.java View File

@ -39,7 +39,7 @@ public class TemplateBaseUtil {
* @throws DocumentException * @throws DocumentException
*/ */
public static void addResource(Document document, String resource, String lang) throws IOException, DocumentException { public static void addResource(Document document, String resource, String lang) throws IOException, DocumentException {
// [{"mc":"布洛芬","bh":"BLF260115-0014","ph":"","nd":"18ng/mL","source":"ELN配制","ndz":18,"nddw":"ng/mL","kc":1190,"kcdw":"3","syl":"4","syldw":"3","yxzq":360,"yxzqdw":"days"}]
// [{"mc""布洛芬","bh""BLF260115-0014","ph""","nd""18ng/mL","source""ELN配制","ndz":18,"nddw""ng/mL","kc":1190,"kcdw""3","syl""4","syldw""3","yxzq":360,"yxzqdw""days"}]
language = lang; language = lang;
// 9. 表头 // 9. 表头
BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED); BaseFont bfChinese = BaseFont.createFont("STSong-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
@ -190,7 +190,7 @@ public class TemplateBaseUtil {
if (node.get("name") != null) { if (node.get("name") != null) {
String name = node.get("name").asText(); String name = node.get("name").asText();
String value = node.get("value") != null ? node.get("value").asText() : ""; String value = node.get("value") != null ? node.get("value").asText() : "";
result.add(name + ":" + value);
result.add(name + "" + value);
} }
} }
} }
@ -203,7 +203,7 @@ public class TemplateBaseUtil {
if (node.get("name") != null) { if (node.get("name") != null) {
String name = node.get("name").asText(); String name = node.get("name").asText();
String value = node.get("value") != null ? node.get("value").asText() : ""; String value = node.get("value") != null ? node.get("value").asText() : "";
result.add(name + ":" + value);
result.add(name + "" + value);
} }
} }
} }
@ -212,7 +212,7 @@ public class TemplateBaseUtil {
if (StringUtils.isNoneBlank(jcgj.getRemark())) { if (StringUtils.isNoneBlank(jcgj.getRemark())) {
result.add(getName("备注") + ":" + jcgj.getRemark()); result.add(getName("备注") + ":" + jcgj.getRemark());
} }
if (StringUtils.isNoneBlank(jcgj.getRemark())) {
if (StringUtils.isNoneBlank(jcgj.getQmrMc())) {
result.add(getName("签名人") + ":" + jcgj.getQmrMc()); result.add(getName("签名人") + ":" + jcgj.getQmrMc());
} }
PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false); PdfBaseUtil.addUnderlinedTitle(document, result.toString(), 10, false);

hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/SP001.java → hxhq-modules/hxhq-system/src/main/java/com/hxhq/business/utils/pdf/template/sp/SP001.java View File

@ -1,9 +1,10 @@
package com.hxhq.business.utils.pdf.template;
package com.hxhq.business.utils.pdf.template.sp;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.hxhq.business.domain.*; import com.hxhq.business.domain.*;
import com.hxhq.business.utils.pdf.PdfBaseUtil; import com.hxhq.business.utils.pdf.PdfBaseUtil;
import com.hxhq.business.utils.pdf.PdfExportUtil; import com.hxhq.business.utils.pdf.PdfExportUtil;
import com.hxhq.business.utils.pdf.template.TemplateBaseUtil;
import com.hxhq.common.core.utils.StringUtils; import com.hxhq.common.core.utils.StringUtils;
import com.hxhq.common.security.utils.SecurityUtils; import com.hxhq.common.security.utils.SecurityUtils;
import com.hxhq.system.api.model.LoginUser; import com.hxhq.system.api.model.LoginUser;
@ -31,7 +32,7 @@ public class SP001 {
* @param studyFormFill * @param studyFormFill
* @return * @return
*/ */
public String exportDetail(StudyFormFill studyFormFill, List<StudyFormFillQmxx> studyFormFillQmxxList, List<StudyFormFillJcgj> studyFormFillJcgjList, String lang, String localFilePath) {
public String exportDetail(StudyFormFill studyFormFill, List<StudyFormFillQmxx> studyFormFillQmxxList, List<StudyFormFillJcgj> studyFormFillJcgjList, String lang,Integer jcgjlx, String localFilePath) {
language = lang; language = lang;
Document document = null; Document document = null;
FileOutputStream fos = null; FileOutputStream fos = null;
@ -96,8 +97,11 @@ public class SP001 {
PdfBaseUtil.addUnderlinedTitle(document, getName("签名信息"), 10, true); PdfBaseUtil.addUnderlinedTitle(document, getName("签名信息"), 10, true);
TemplateBaseUtil.addQmxx(document, studyFormFillQmxxList,language); TemplateBaseUtil.addQmxx(document, studyFormFillQmxxList,language);
//稽查轨迹 //稽查轨迹
PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹"), 10, true);
TemplateBaseUtil.addJcgj(document, studyFormFillJcgjList,language);
Integer jcgjlxMark=999;
if(!jcgjlx.equals(jcgjlxMark)){
PdfBaseUtil.addUnderlinedTitle(document, getName("稽查轨迹"), 10, true);
TemplateBaseUtil.addJcgj(document, studyFormFillJcgjList,language);
}
logger.info("生成成功:{}", filePath); logger.info("生成成功:{}", filePath);
} catch (Exception e) { } catch (Exception e) {
logger.error("生成失败", e); logger.error("生成失败", e);

Loading…
Cancel
Save