Commit 266f7e88 authored by maqing's avatar maqing

查看详情

parent 04277280
...@@ -96,34 +96,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -96,34 +96,7 @@ public class TaskServiceImpl implements TaskService {
*/ */
@Override @Override
public List<TaskReportVO> taskReportList(String name, String certiCode, String tel) { public List<TaskReportVO> taskReportList(String name, String certiCode, String tel) {
List<TaskReportVO> taskReportVOS = taskMapper.taskReportList(name, certiCode, tel); return taskMapper.taskReportList(name, certiCode, tel);
Map<Object, Object> typeMap = new HashMap<>();
Map<Object, Object> taskReportProxyMap = new HashMap<>();
for (int i = 0; i < taskReportVOS.size(); i++) {
String reportId = taskReportVOS.get(i).getReportId();
List<ChAprReportFraction> chAprReportFractions = chAprReportFractionMapper.selectList(new LambdaQueryWrapper<ChAprReportFraction>().eq(ChAprReportFraction::getReportId, reportId));
Map<String, Object> typeHashMap = new HashMap<>();
for (ChAprReportFraction chAprReportFraction: chAprReportFractions) {
String taskReportType = chAprReportFraction.getTaskReportType();
if(!typeHashMap.containsKey(taskReportType)){
List<ChAprReportFraction> typeList = chAprReportFractions.stream().filter(c-> c.getTaskReportType().equals(taskReportType)).collect(Collectors.toList());
Map<String, Object> hashMap = new HashMap<>();
for (ChAprReportFraction chTaskReportFraction:typeList) {
String taskReportProxy = chTaskReportFraction.getTaskReportProxy();
if(!hashMap.containsKey(taskReportProxy)){
List<ChAprReportFraction> collect = typeList.stream().filter(c->c.getTaskReportProxy().equals(taskReportProxy)).collect(Collectors.toList());
hashMap.put(taskReportProxy,collect);
}
}
taskReportVOS.get(i).getChAprReportFractions().put(taskReportType,hashMap);
//typeHashMap.put(taskReportType,hashMap);
}
}
}
return taskReportVOS;
} }
/** /**
...@@ -207,7 +180,10 @@ public class TaskServiceImpl implements TaskService { ...@@ -207,7 +180,10 @@ public class TaskServiceImpl implements TaskService {
personInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
if(!chAprReportFractions.isEmpty() && chAprReportFractions.size()>0){ if(!chAprReportFractions.isEmpty() && chAprReportFractions.size()>0){
chAprReportFractionService.updateChAprReportFraction(chAprReportFractions); for (ChAprReportFraction chAprReportFraction: chAprReportFractions) {
chAprReportFraction.setReportId(report.getReportId());
}
chAprReportFractionService.insertChAprReportFraction(chAprReportFractions);
} }
// 更新评定任务状态为已完成,并记录完成时间 // 更新评定任务状态为已完成,并记录完成时间
ChAprTask task = new ChAprTask(); ChAprTask task = new ChAprTask();
...@@ -220,7 +196,31 @@ public class TaskServiceImpl implements TaskService { ...@@ -220,7 +196,31 @@ public class TaskServiceImpl implements TaskService {
@Override @Override
public TaskReportVO getReportById(String reportId) { public TaskReportVO getReportById(String reportId) {
return taskMapper.getReportById(reportId); TaskReportVO reportById = taskMapper.getReportById(reportId);
List<ChAprReportFraction> chAprReportFractions = chAprReportFractionMapper.selectList(new LambdaQueryWrapper<ChAprReportFraction>().eq(ChAprReportFraction::getReportId, 125));
if(chAprReportFractions.isEmpty()|| chAprReportFractions.size()==0){
return reportById;
}
Map<String, Object> typeHashMap = new HashMap<>();
for (ChAprReportFraction chAprReportFraction: chAprReportFractions) {
String taskReportType = chAprReportFraction.getTaskReportType();
if(!typeHashMap.containsKey(taskReportType)){
List<ChAprReportFraction> typeList = chAprReportFractions.stream().filter(c-> c.getTaskReportType().equals(taskReportType)).collect(Collectors.toList());
Map<String, Object> hashMap = new HashMap<>();
for (ChAprReportFraction chTaskReportFraction:typeList) {
String taskReportProxy = chTaskReportFraction.getTaskReportProxy();
if(!hashMap.containsKey(taskReportProxy)){
List<ChAprReportFraction> collect = typeList.stream().filter(c->c.getTaskReportProxy().equals(taskReportProxy)).collect(Collectors.toList());
hashMap.put(taskReportProxy,collect);
}
}
typeHashMap.put(taskReportType,hashMap);
reportById.setChAprReportFractions(typeHashMap);
}
}
return reportById;
} }
/** /**
* 评定报告修改 * 评定报告修改
......
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
LEFT JOIN CH_APR_TASK task ON report.TASK_ID = task.TASK_ID LEFT JOIN CH_APR_TASK task ON report.TASK_ID = task.TASK_ID
LEFT JOIN CH_DISABLE_INFO info ON task.disable_info_id = info.disab_info_id LEFT JOIN CH_DISABLE_INFO info ON task.disable_info_id = info.disab_info_id
left join ch_apr_organ aprOrgan on task.apr_organ_id = aprOrgan.apr_organ_id left join ch_apr_organ aprOrgan on task.apr_organ_id = aprOrgan.apr_organ_id
left join ch_srv_organ organ on aprOrgan.organ_id = organ.organ_id --left join ch_srv_organ organ on aprOrgan.organ_id = organ.organ_id
LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL lev ON report.DISABLE_LEVEL_ID = lev.DISABLE_LEVEL_ID LEFT JOIN CH_CFG_SRV_DISABLE_LEVEL lev ON report.DISABLE_LEVEL_ID = lev.DISABLE_LEVEL_ID
left join CH_FND_ORGAN fndOrgan on task.ORGAN_ID = fndOrgan.ORGAN_ID left join CH_FND_ORGAN fndOrgan on task.ORGAN_ID = fndOrgan.ORGAN_ID
<where> <where>
......
...@@ -23,7 +23,7 @@ public class ChAprReportFraction { ...@@ -23,7 +23,7 @@ public class ChAprReportFraction {
/** /**
* CH_APR_REPORT.ID * CH_APR_REPORT.ID
*/ */
private String reportId; private Integer reportId;
/** /**
* 评定报告序号 * 评定报告序号
*/ */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment