|
|
|
@ -60,25 +60,34 @@ public class ArchiveDetailServiceImpl implements ArchiveDetailService {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// 4、统计集合里元素相同的名称及数量
|
|
|
|
|
Map<String, Integer> map = new HashMap<String, Integer>();
|
|
|
|
|
for(ExamApplyDto examApplyDto:
|
|
|
|
|
resultList){
|
|
|
|
|
String name = examApplyDto.getName() ==null ? (Objects.equals(examApplyDto.getReportType(),"10") ? "检验报告" : "检查报告"):examApplyDto.getName();
|
|
|
|
|
if(map.containsKey(name)){
|
|
|
|
|
map.put(name, map.get(name).intValue() + 1);
|
|
|
|
|
}else{
|
|
|
|
|
map.put(name, new Integer(1));
|
|
|
|
|
StringBuffer sb=new StringBuffer();
|
|
|
|
|
for (ExamApplyDto examApplyDto:
|
|
|
|
|
resultList) {
|
|
|
|
|
String authorReportTime = examApplyDto.getAuthorReportTime();
|
|
|
|
|
if(authorReportTime != null && authorReportTime.lastIndexOf(".") != -1){
|
|
|
|
|
authorReportTime = authorReportTime.substring(0,authorReportTime.lastIndexOf("."));
|
|
|
|
|
}
|
|
|
|
|
sb.append("缺失"+examApplyDto.getName() +"("+authorReportTime+"),");
|
|
|
|
|
}
|
|
|
|
|
// // 4、统计集合里元素相同的名称及数量
|
|
|
|
|
// Map<String, Integer> map = new HashMap<String, Integer>();
|
|
|
|
|
// for(ExamApplyDto examApplyDto:
|
|
|
|
|
// resultList){
|
|
|
|
|
// String name = examApplyDto.getName() ==null ? (Objects.equals(examApplyDto.getReportType(),"10") ? "检验报告" : "检查报告"):examApplyDto.getName();
|
|
|
|
|
// if(map.containsKey(name)){
|
|
|
|
|
// map.put(name, map.get(name).intValue() + 1);
|
|
|
|
|
// }else{
|
|
|
|
|
// map.put(name, new Integer(1));
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// 5、开始拼装
|
|
|
|
|
Iterator<String> keys = map.keySet().iterator();
|
|
|
|
|
StringBuffer sb=new StringBuffer();
|
|
|
|
|
while(keys.hasNext()){
|
|
|
|
|
String key = keys.next();
|
|
|
|
|
int i = map.get(key).intValue();
|
|
|
|
|
sb.append(key + "缺失" + map.get(key).intValue() + "份,");
|
|
|
|
|
}
|
|
|
|
|
// Iterator<String> keys = map.keySet().iterator();
|
|
|
|
|
|
|
|
|
|
// while(keys.hasNext()){
|
|
|
|
|
// String key = keys.next();
|
|
|
|
|
// int i = map.get(key).intValue();
|
|
|
|
|
// sb.append(key + "缺失" + map.get(key).intValue() + "份,");
|
|
|
|
|
// }
|
|
|
|
|
if(sb.length() > 0){
|
|
|
|
|
result = sb.substring(0,sb.length()-1);
|
|
|
|
|
}
|
|
|
|
|