bug 处理

This commit is contained in:
13405411873 2025-01-06 10:32:13 +08:00
parent 5246ba16b8
commit 0ee8fb05b8
2 changed files with 84 additions and 9 deletions

View File

@ -4,7 +4,6 @@ import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.text.NumberFormat;
import java.util.*;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
@ -36,9 +35,7 @@ import com.ruoyi.system.util.pdfUtil.PdfUtil;
import com.ruoyi.system.vo.TdReportVo;
import freemarker.template.TemplateException;
import lombok.extern.slf4j.Slf4j;
import org.jfree.data.category.DefaultCategoryDataset;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.general.PieDataset;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AsdRecordMapper;
@ -47,7 +44,6 @@ import org.springframework.util.CollectionUtils;
import javax.servlet.http.HttpServletResponse;
import static com.ruoyi.system.util.AddressParser.addressResolution;
import static com.ruoyi.system.util.pdfUtil.LdtUtil.*;
import static com.ruoyi.system.util.pdfUtil.PdfUtil.*;
@ -472,7 +468,26 @@ 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("孑医测评"));
String deptName="";
try {
String deptIds="";
if (ObjectUtil.isNotEmpty(it.getChildDeptId())&&ObjectUtil.isNotEmpty(it.getScanDeptId())){
SysDept sysDept1 = deptService.selectDeptById(it.getChildDeptId());
SysDept sysDept2 = deptService.selectDeptById(it.getScanDeptId());
String deptNsm = sysDept1.getAncestors().replace(sysDept2.getAncestors(), "").replaceFirst(",", "");
deptIds= (StringUtils.isNotEmpty(deptNsm)?deptNsm+",":"")+sysDept1.getDeptId();
}
String[] split = deptIds.split(",");
for (String deptId :split){
SysDept sysDept3 = deptService.selectDeptById(Long.valueOf(deptId));
deptName = deptName+"/"+sysDept3.getDeptName();
}
deptName = deptName.replaceFirst("/","");
}catch (Exception ignored){
}
contentRowList.add(StringUtils.isNotEmpty(deptName)?deptName:"孑医测评");
contentRowList.addAll(Arrays.asList(contentRow));
for (Map item : mapList){
Map<String,String> scoreOptionMap =new HashMap<>();
@ -522,7 +537,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"
@ -564,6 +579,26 @@ public class AsdRecordServiceImpl implements IAsdRecordService
,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<>();
String deptName="";
try {
String deptIds="";
if (ObjectUtil.isNotEmpty(it.getChildDeptId())&&ObjectUtil.isNotEmpty(it.getScanDeptId())){
SysDept sysDept1 = deptService.selectDeptById(it.getChildDeptId());
SysDept sysDept2 = deptService.selectDeptById(it.getScanDeptId());
String deptNsm = sysDept1.getAncestors().replace(sysDept2.getAncestors(), "").replaceFirst(",", "");
deptIds= (StringUtils.isNotEmpty(deptNsm)?deptNsm+",":"")+sysDept1.getDeptId();
}
String[] split = deptIds.split(",");
for (String deptId :split){
SysDept sysDept3 = deptService.selectDeptById(Long.valueOf(deptId));
deptName = deptName+"/"+sysDept3.getDeptName();
}
deptName = deptName.replaceFirst("/","");
}catch (Exception ignored){
}
contentRowList.add(StringUtils.isNotEmpty(deptName)?deptName:"孑医测评");
contentRowList.addAll(Arrays.asList(contentRow));
for (Map item : mapList){
Map<String,String> scoreOptionMap =new HashMap<>();
@ -656,7 +691,26 @@ 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("孑医测评"));
String deptName="";
try {
String deptIds="";
if (ObjectUtil.isNotEmpty(it.getChildDeptId())&&ObjectUtil.isNotEmpty(it.getScanDeptId())){
SysDept sysDept1 = deptService.selectDeptById(it.getChildDeptId());
SysDept sysDept2 = deptService.selectDeptById(it.getScanDeptId());
String deptNsm = sysDept1.getAncestors().replace(sysDept2.getAncestors(), "").replaceFirst(",", "");
deptIds= (StringUtils.isNotEmpty(deptNsm)?deptNsm+",":"")+sysDept1.getDeptId();
}
String[] split = deptIds.split(",");
for (String deptId :split){
SysDept sysDept3 = deptService.selectDeptById(Long.valueOf(deptId));
deptName = deptName+"/"+sysDept3.getDeptName();
}
deptName = deptName.replaceFirst("/","");
}catch (Exception ignored){
}
contentRowList.add(StringUtils.isNotEmpty(deptName)?deptName:"孑医测评");
contentRowList.addAll(Arrays.asList(contentRow));
for (Map item : mapList){
contentRowList.add(item.get("score").toString());
@ -726,7 +780,26 @@ 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("孑医测评"));
String deptName="";
try {
String deptIds="";
if (ObjectUtil.isNotEmpty(it.getChildDeptId())&&ObjectUtil.isNotEmpty(it.getScanDeptId())){
SysDept sysDept1 = deptService.selectDeptById(it.getChildDeptId());
SysDept sysDept2 = deptService.selectDeptById(it.getScanDeptId());
String deptNsm = sysDept1.getAncestors().replace(sysDept2.getAncestors(), "").replaceFirst(",", "");
deptIds= (StringUtils.isNotEmpty(deptNsm)?deptNsm+",":"")+sysDept1.getDeptId();
}
String[] split = deptIds.split(",");
for (String deptId :split){
SysDept sysDept3 = deptService.selectDeptById(Long.valueOf(deptId));
deptName = deptName+"/"+sysDept3.getDeptName();
}
deptName = deptName.replaceFirst("/","");
}catch (Exception ignored){
}
contentRowList.add(StringUtils.isNotEmpty(deptName)?deptName:"孑医测评");
contentRowList.addAll(Arrays.asList(contentRow));
for (Map item : mapList){
contentRowList.add(item.get("score").toString());

View File

@ -57,7 +57,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
asd_children.dept_id as child_dept_id,
asd_children.tel as phone,
asd_children.parent_name,
sd.dept_name scanDeptName
asd_children.sex as childSex,
sd.dept_name scanDeptName,
sd.dept_id scan_dept_id
FROM
asd_record
LEFT JOIN asd_children ON asd_record.children_id = asd_children.id