Commit 9f81190c authored by maqing's avatar maqing

日常生活活动能力查询

parent 109c6810
...@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.dto.QueryDto; import com.hungraim.ltc.dto.QueryDto;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReport; import com.hungraim.ltc.pojo.entity.assessment.*;
import com.hungraim.ltc.pojo.entity.assessment.ChAprTask;
import com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason;
import com.hungraim.ltc.pojo.entity.assessment.ChTaskReportFractionDtl;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.ReportUpdateVO; import com.hungraim.ltc.pojo.vo.ReportUpdateVO;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
...@@ -155,6 +152,8 @@ public class TaskController { ...@@ -155,6 +152,8 @@ public class TaskController {
String polNo = reportDetailVo.getPolNo(); String polNo = reportDetailVo.getPolNo();
String remark = reportDetailVo.getRemark(); String remark = reportDetailVo.getRemark();
List<ChFndAttach> fileDataList = reportDetailVo.getFileDataList(); List<ChFndAttach> fileDataList = reportDetailVo.getFileDataList();
List<ChAprReportFraction> chTaskReportFractionDtls = reportDetailVo.getChAprReportFractions();
if (person1 == null) { if (person1 == null) {
return Result.failed("鉴定人员1不能为空!"); return Result.failed("鉴定人员1不能为空!");
} }
...@@ -174,7 +173,7 @@ public class TaskController { ...@@ -174,7 +173,7 @@ public class TaskController {
} catch (ParseException e) { } catch (ParseException e) {
return Result.failed("评估时间格式不正确!"); return Result.failed("评估时间格式不正确!");
} }
Result<Object> objectResult = taskService.addReport(taskId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark, fileDataList); Result<Object> objectResult = taskService.addReport(taskId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark, fileDataList,chTaskReportFractionDtls);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) { if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败 //失败
return Result.failed(objectResult.getMsg()); return Result.failed(objectResult.getMsg());
...@@ -214,7 +213,7 @@ public class TaskController { ...@@ -214,7 +213,7 @@ public class TaskController {
} catch (ParseException e) { } catch (ParseException e) {
return Result.failed("评估时间格式不正确!"); return Result.failed("评估时间格式不正确!");
} }
taskService.updateReport(vo.getReportId(), vo.getPerson1(), vo.getPerson2(), vo.getPerson3(), evaluateDate, vo.getDisableLevelId(), vo.getPolNo(), vo.getRemark(), vo.getFileDataList(),vo.getChTaskReportFractionDtl()); taskService.updateReport(vo.getReportId(), vo.getPerson1(), vo.getPerson2(), vo.getPerson3(), evaluateDate, vo.getDisableLevelId(), vo.getPolNo(), vo.getRemark(), vo.getFileDataList(),vo.getChAprReportFractions());
return Result.success(); return Result.success();
} }
......
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReportFraction;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* @author mq
*/
@Mapper
@Repository
public interface ChAprReportFractionMapper extends BaseMapper<ChAprReportFraction> {
}
package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReportFraction;
import java.util.List;
/**
* @author mq
*/
public interface ChAprReportFractionService extends IService<ChAprReportFraction> {
/**
* 批量修改
* @return
*/
void updateChAprReportFraction(List<ChAprReportFraction> chAprReportFractions);
/**
* 批量新增
* @param chAprReportFractions
*/
void insertChAprReportFraction(List<ChAprReportFraction> chAprReportFractions);
}
...@@ -3,10 +3,7 @@ package com.hungraim.ltc.service; ...@@ -3,10 +3,7 @@ package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReport; import com.hungraim.ltc.pojo.entity.assessment.*;
import com.hungraim.ltc.pojo.entity.assessment.ChAprTask;
import com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason;
import com.hungraim.ltc.pojo.entity.assessment.ChTaskReportFractionDtl;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
...@@ -32,9 +29,9 @@ public interface TaskService { ...@@ -32,9 +29,9 @@ public interface TaskService {
List<AprEmpVO> aprEmpList(String provincial, String city, String area, String organName, String name, String tel, String groupLeader); List<AprEmpVO> aprEmpList(String provincial, String city, String area, String organName, String name, String tel, String groupLeader);
Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList); Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList,List<ChAprReportFraction> chAprReportFractions);
void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList,List<ChTaskReportFractionDtl> chTaskReportFractionDtls); void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList,List<ChAprReportFraction> chAprReportFractions);
Result<Object> allotTask(String taskId, String empId); Result<Object> allotTask(String taskId, String empId);
......
package com.hungraim.ltc.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hungraim.ltc.dao.ChAprReportFractionMapper;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReportFraction;
import com.hungraim.ltc.service.ChAprReportFractionService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author mq
*/
@Service
@Slf4j
@AllArgsConstructor
public class ChAprReportFractionServiceImpl extends ServiceImpl<ChAprReportFractionMapper, ChAprReportFraction> implements ChAprReportFractionService {
@Autowired
ChAprReportFractionMapper chAprReportFractionMapper;
@Override
public void updateChAprReportFraction(List<ChAprReportFraction> chAprReportFractions) {
this.updateBatchById(chAprReportFractions);
}
@Override
public void insertChAprReportFraction(List<ChAprReportFraction> chAprReportFractions) {
this.saveBatch(chAprReportFractions,chAprReportFractions.size());
}
}
...@@ -14,6 +14,7 @@ import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; ...@@ -14,6 +14,7 @@ import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo; import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo; import com.hungraim.ltc.pojo.vo.system.AttachUpdateVo;
import com.hungraim.ltc.service.ChAprReportFractionService;
import com.hungraim.ltc.service.TaskService; import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.service.TppesApiException; import com.hungraim.ltc.service.TppesApiException;
import com.hungraim.ltc.util.AttachType; import com.hungraim.ltc.util.AttachType;
...@@ -51,6 +52,10 @@ public class TaskServiceImpl implements TaskService { ...@@ -51,6 +52,10 @@ public class TaskServiceImpl implements TaskService {
private final RefuseReasonMapper refuseReasonMapper; private final RefuseReasonMapper refuseReasonMapper;
private final AttachFeignService attachFeignService; private final AttachFeignService attachFeignService;
private final ChAprReportFractionService chAprReportFractionService;
private final ChAprReportFractionMapper chAprReportFractionMapper;
private final ChTaskReportFractionDtlMapper chTaskReportFractionDtlMapper; private final ChTaskReportFractionDtlMapper chTaskReportFractionDtlMapper;
/** /**
...@@ -90,7 +95,34 @@ public class TaskServiceImpl implements TaskService { ...@@ -90,7 +95,34 @@ 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) {
return taskMapper.taskReportList(name, certiCode, tel); List<TaskReportVO> taskReportVOS = 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;
} }
/** /**
...@@ -133,14 +165,14 @@ public class TaskServiceImpl implements TaskService { ...@@ -133,14 +165,14 @@ public class TaskServiceImpl implements TaskService {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList) { public Result<Object> addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList,List<ChAprReportFraction> chAprReportFractions) {
List<ChAprReport> chAprReports = aprReportMapper.selectList(new LambdaQueryWrapper<ChAprReport>().eq(ChAprReport::getStatus, 4).eq(ChAprReport::getTaskId, taskId)); List<ChAprReport> chAprReports = aprReportMapper.selectList(new LambdaQueryWrapper<ChAprReport>().eq(ChAprReport::getStatus, 4).eq(ChAprReport::getTaskId, taskId));
if (chAprReports != null && chAprReports.size() > 0) { if (chAprReports != null && chAprReports.size() > 0) {
return Result.failed("已存在的评定任务报告!"); return Result.failed("已存在的评定任务报告!");
} }
//插入评定任报告 //插入评定任报告
ChAprReport report = new ChAprReport(); ChAprReport report = new ChAprReport();
report.setTaskId(taskId); //report.setTaskId(taskId);
report.setEffTime(new Date()); report.setEffTime(new Date());
report.setRemark(remark); report.setRemark(remark);
report.setDisableLevelId(disableLevelId); report.setDisableLevelId(disableLevelId);
...@@ -173,6 +205,9 @@ public class TaskServiceImpl implements TaskService { ...@@ -173,6 +205,9 @@ public class TaskServiceImpl implements TaskService {
personInfo.setFcd(new Date()); personInfo.setFcd(new Date());
personInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
if(!chAprReportFractions.isEmpty() && chAprReportFractions.size()>0){
chAprReportFractionService.updateChAprReportFraction(chAprReportFractions);
}
// 更新评定任务状态为已完成,并记录完成时间 // 更新评定任务状态为已完成,并记录完成时间
ChAprTask task = new ChAprTask(); ChAprTask task = new ChAprTask();
task.setTaskId(taskId); task.setTaskId(taskId);
...@@ -197,7 +232,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -197,7 +232,7 @@ public class TaskServiceImpl implements TaskService {
*/ */
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@Override @Override
public void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList,List<ChTaskReportFractionDtl> chTaskReportFractionDtls) { public void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark, List<ChFndAttach> fileDataList,List<ChAprReportFraction> chAprReportFractions) {
//update鉴定报告 //update鉴定报告
ChAprReport chAprReport = aprReportMapper.selectById(reportId); ChAprReport chAprReport = aprReportMapper.selectById(reportId);
chAprReport.setDisableLevelId(disableLevelId); chAprReport.setDisableLevelId(disableLevelId);
...@@ -248,6 +283,11 @@ public class TaskServiceImpl implements TaskService { ...@@ -248,6 +283,11 @@ public class TaskServiceImpl implements TaskService {
personInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
} }
if(!chAprReportFractions.isEmpty() && chAprReportFractions.size()>0){
chAprReportFractionService.updateChAprReportFraction(chAprReportFractions);
}
} }
......
...@@ -36,4 +36,8 @@ public class ChAprReportFraction { ...@@ -36,4 +36,8 @@ public class ChAprReportFraction {
* 标准 * 标准
*/ */
private String taskReportEvaluation; private String taskReportEvaluation;
/**
* c1(日常生活活动能力),c2(认知能力),c3(感知觉与沟通能力)分类
*/
private String taskReportType;
} }
package com.hungraim.ltc.pojo.vo; package com.hungraim.ltc.pojo.vo;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReportFraction;
import com.hungraim.ltc.pojo.entity.assessment.ChTaskReportFractionDtl; import com.hungraim.ltc.pojo.entity.assessment.ChTaskReportFractionDtl;
import lombok.Data; import lombok.Data;
...@@ -22,5 +23,5 @@ public class ReportUpdateVO { ...@@ -22,5 +23,5 @@ public class ReportUpdateVO {
String polNo; String polNo;
String remark; String remark;
List<ChFndAttach> fileDataList; List<ChFndAttach> fileDataList;
List<ChTaskReportFractionDtl> chTaskReportFractionDtl; List<ChAprReportFraction> chAprReportFractions;
} }
package com.hungraim.ltc.pojo.vo.assessment; package com.hungraim.ltc.pojo.vo.assessment;
import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach; import com.hungraim.ltc.pojo.entity.SysConfig.ChFndAttach;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReportFraction;
import com.hungraim.ltc.pojo.entity.assessment.ChTaskReportFractionDtl;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
...@@ -16,4 +18,5 @@ public class ReportDetailVO { ...@@ -16,4 +18,5 @@ public class ReportDetailVO {
String polNo; String polNo;
String remark; String remark;
List<ChFndAttach> fileDataList; List<ChFndAttach> fileDataList;
List<ChAprReportFraction> chAprReportFractions;
} }
package com.hungraim.ltc.pojo.vo.assessment; package com.hungraim.ltc.pojo.vo.assessment;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import com.hungraim.ltc.pojo.entity.assessment.ChAprReportFraction;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* 评定报告录入列表 * 评定报告录入列表
...@@ -63,6 +66,9 @@ public class TaskReportVO { ...@@ -63,6 +66,9 @@ public class TaskReportVO {
private String acptSrvArea; private String acptSrvArea;
//评定结果 //评定结果
private String riskLevel; private String riskLevel;
private Map<String,Object> chAprReportFractions;
//录入时间 //录入时间
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date effTime; private Date effTime;
......
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