This commit is contained in:
13405411873 2024-12-01 20:05:40 +08:00
parent 340a467ba1
commit 5246ba16b8
4 changed files with 19 additions and 14 deletions

View File

@ -394,7 +394,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
@Override
@DataScope(deptAlias = "sys_user")
public void exportTable1(AsdRecord asdRecord, HttpServletResponse response) throws IOException {
List<AsdRecord> list = this.selectAsdRecordListVo(asdRecord);
List<AsdRecord> list = asdRecordMapper.selectAsdRecordList(asdRecord);
//先获取当前用户的顶级机构的使用类型 筛查 诊断辅助
SysUser sysUser = SecurityUtils.getLoginUser().getUser();
SysUser user = userService.selectUserById(sysUser.getUserId());
@ -430,7 +430,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
writer.merge(0,0,6,13 ,"测评结果",true);
writer.merge(0,0,14,73 ,"测评明细",true);
//一次性写出内容强制输出标题
String[] titleRow ={"儿童姓名","性别","生日","所在地","填表人","电话","测评时间","社交回避型得分","正常型得分","主动型得分","类型","问卷总分","总答题时间"
String[] titleRow ={"扫码机构","儿童姓名","性别","生日","所在地","填表人","电话","测评时间","社交回避型得分","正常型得分","主动型得分","类型","问卷总分","总答题时间"
,"1-A-score","1-B-score","1-C-score","1-D-score","1-CHOOSE"
,"2-A-score","2-B-score","2-C-score","2-D-score","2-CHOOSE"
,"3-A-score","3-B-score","3-C-score","3-D-score","3-CHOOSE"
@ -472,6 +472,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
,String.valueOf(Integer.valueOf(reportMap.get("冷漠")) +Integer.valueOf(reportMap.get("被动"))) ,reportMap.get("正常") ,reportMap.get("主动"),it.getReportResult(),it.getTotalScore().toString(),Optional.ofNullable(it.getTimeUse()).orElse(0).toString()
};
List<String> contentRowList = new ArrayList<>();
contentRowList.add(Optional.ofNullable(it.getScanDeptName()).orElse("孑医测评"));
contentRowList.addAll(Arrays.asList(contentRow));
for (Map item : mapList){
Map<String,String> scoreOptionMap =new HashMap<>();
@ -605,7 +606,8 @@ public class AsdRecordServiceImpl implements IAsdRecordService
}
public void exportTable2(AsdRecord asdRecord, HttpServletResponse response) throws IOException {
List<AsdRecord> list = this.selectAsdRecordListVo(asdRecord);
List<AsdRecord> list = asdRecordMapper.selectAsdRecordList(asdRecord);
//通过工具类创建writer
ExcelWriter writer = ExcelUtil.getWriter();
//跳过当前行既第一行非必须在此演示用
@ -615,7 +617,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
writer.merge(0,0,6,14 ,"测评结果",true);
writer.merge(0,0,15,71 ,"测评明细",true);
//一次性写出内容强制输出标题
String[] titleRow ={"儿童姓名","性别","生日","所在地","填表人","电话","测评时间","语言得分","运动得分","交往得分","生活自理得分","感觉得分","结果","问卷总分","总答题时间"};
String[] titleRow ={"扫码机构","儿童姓名","性别","生日","所在地","填表人","电话","测评时间","语言得分","运动得分","交往得分","生活自理得分","感觉得分","结果","问卷总分","总答题时间"};
List<String> titleRowList = new ArrayList<>();
titleRowList.addAll(Arrays.asList(titleRow));
@ -654,6 +656,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
,reportMap.get("语言") ,reportMap.get("运动") ,reportMap.get("交往") ,reportMap.get("生活自理"),reportMap.get("感觉"),it.getReportResult(),it.getTotalScore().toString(),Optional.ofNullable(it.getTimeUse()).orElse(0).toString()
};
List<String> contentRowList = new ArrayList<>();
contentRowList.add(Optional.ofNullable(it.getScanDeptName()).orElse("孑医测评"));
contentRowList.addAll(Arrays.asList(contentRow));
for (Map item : mapList){
contentRowList.add(item.get("score").toString());
@ -674,7 +677,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
public void exportTable3(AsdRecord asdRecord, HttpServletResponse response) throws IOException {
List<AsdRecord> list = this.selectAsdRecordListVo(asdRecord);
List<AsdRecord> list = asdRecordMapper.selectAsdRecordList(asdRecord);
//通过工具类创建writer
ExcelWriter writer = ExcelUtil.getWriter();
//跳过当前行既第一行非必须在此演示用
@ -684,7 +687,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
writer.merge(0,0,6,14 ,"测评结果",true);
writer.merge(0,0,15,64 ,"测评明细",true);
//一次性写出内容强制输出标题
String[] titleRow ={"儿童姓名","性别","生日","所在地","填表人","电话","测评时间","想象力得分","注意力切换得分","沟通得分","细节的注意得分","社交技能得分","结果","问卷总分","总答题时间"};
String[] titleRow ={"扫码机构","儿童姓名","性别","生日","所在地","填表人","电话","测评时间","想象力得分","注意力切换得分","沟通得分","细节的注意得分","社交技能得分","结果","问卷总分","总答题时间"};
List<String> titleRowList = new ArrayList<>();
titleRowList.addAll(Arrays.asList(titleRow));
@ -723,6 +726,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
,reportMap.get("想象力") ,reportMap.get("注意力切换能力") ,reportMap.get("沟通能力") ,reportMap.get("细节的注意"),reportMap.get("社交技能"),it.getReportResult(),it.getTotalScore().toString(),Optional.ofNullable(it.getTimeUse()).orElse(0).toString()
};
List<String> contentRowList = new ArrayList<>();
contentRowList.add(Optional.ofNullable(it.getScanDeptName()).orElse("孑医测评"));
contentRowList.addAll(Arrays.asList(contentRow));
for (Map item : mapList){
contentRowList.add(item.get("score").toString());
@ -888,7 +892,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
String[] titleList={"语言","运动","交往","生活自理","感觉"};
String[] dataList ={reportMap.get("语言"),reportMap.get("运动"),reportMap.get("交往"),reportMap.get("生活自理"),reportMap.get("感觉")};
InputStream bjStream = AsdRecordServiceImpl.class.getClassLoader().getResourceAsStream("logo.png");
PdfUtil.createPdfFile2(response,titleList,dataList,asdRecord.getChildName(),asdRecord.getTotalScore(),asdRecord.getReportResult(),bjStream);
PdfUtil.createPdfFile2(response,"儿童ABC量表评定结果",titleList,dataList,asdRecord.getChildName(),asdRecord.getTotalScore(),asdRecord.getReportResult(),bjStream);
}
public void exportQuestion3Pdf(HttpServletResponse response,AsdRecord asdRecord) throws IOException, DocumentException, TemplateException {
Map<String,String> reportMap =new HashMap<>();
@ -913,7 +917,7 @@ public class AsdRecordServiceImpl implements IAsdRecordService
String[] titleList={"想象力","注意力切换能力","沟通能力","细节的注意","社交技能"};
String[] dataList ={reportMap.get("想象力"),reportMap.get("注意力切换能力"),reportMap.get("沟通能力"),reportMap.get("细节的注意"),reportMap.get("社交技能")};
InputStream bjStream = AsdRecordServiceImpl.class.getClassLoader().getResourceAsStream("logo.png");
PdfUtil.createPdfFile2(response,titleList,dataList,asdRecord.getChildName(),asdRecord.getTotalScore(),asdRecord.getReportResult(),bjStream);
PdfUtil.createPdfFile2(response,"儿童AQ量表评定结果",titleList,dataList,asdRecord.getChildName(),asdRecord.getTotalScore(),asdRecord.getReportResult(),bjStream);
}
//导出团队报告
@Override

View File

@ -387,7 +387,7 @@ public class PdfUtil {
}
public static void createPdfFile2(HttpServletResponse response, String[] titleList, String[] dataList,String name,Integer score,String result,InputStream bjStream) throws IOException, DocumentException, TemplateException {
public static void createPdfFile2(HttpServletResponse response,String pdfTitle, String[] titleList, String[] dataList,String name,Integer score,String result,InputStream bjStream) throws IOException, DocumentException, TemplateException {
try {
//文档对象 实现A4纸页面
Document document = new Document(PageSize.A4);
@ -433,7 +433,7 @@ public class PdfUtil {
//如果我们需要生成的段落里有需要动态填充的就用块一点一点的拼起来直到达到我们的效果
//段落
Paragraph p = null;
p = new Paragraph("孤独症分型问卷评定结果", titleFont);
p = new Paragraph(pdfTitle, titleFont);
p.setLeading(30);
p.setAlignment(Element.ALIGN_CENTER);//设置对齐方式这个是居中对齐
document.add(p);
@ -514,7 +514,7 @@ public class PdfUtil {
int x = 160;
//y轴坐标
int y = 280;
int y = 270;
//设置图片大小
image.scaleAbsolute(300, 300);
//设置图片位置
@ -622,7 +622,7 @@ public class PdfUtil {
//如果我们需要生成的段落里有需要动态填充的就用块一点一点的拼起来直到达到我们的效果
//段落
Paragraph p = null;
p = new Paragraph("孤独症分型问卷评定结果", titleFont);
p = new Paragraph("儿童AQ量表评定结果", titleFont);
p.setLeading(30);
p.setAlignment(Element.ALIGN_CENTER);//设置对齐方式这个是居中对齐
document.add(p);

View File

@ -106,7 +106,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
time_use as timeUse,
asd_children.username as childName,
asd_children.sex as childSex,
sys_user.phonenumber as phone
sys_user.phonenumber as phone,
sd.dept_name scanDeptName
FROM
asd_record
LEFT JOIN asd_children ON asd_record.children_id = asd_children.id

View File

@ -243,7 +243,7 @@ import "@riophae/vue-treeselect/dist/vue-treeselect.css";
label: '儿童ABC量表'
}, {
value: 'table3',
label: '成人AQ量表'
label: '儿童AQ量表'
}],
//
title: "",