Commit 196486a1 authored by 董天德's avatar 董天德

评估类型修改

parent 7209008c
......@@ -182,14 +182,8 @@ public class TaskController {
if (StringUtils.isBlank(evaluateTime)) {
return Result.failed("评估时间不能为空!");
}
Date evaluateDate;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
evaluateDate = sdf.parse(evaluateTime);
} catch (ParseException e) {
return Result.failed("评估时间格式不正确!");
}
Result<Object> objectResult = taskService.addReport(taskId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark, fileDataList,chTaskReportFractionDtls);
Result<Object> objectResult = taskService.addReport(reportDetailVo);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败
return Result.failed(objectResult.getMsg());
......
......@@ -32,7 +32,7 @@ public interface TaskService {
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,List<ChAprReportFraction> chAprReportFractions);
Result<Object> addReport(ReportDetailVO reportDetailVo);
void updateReport(ReportUpdateVO vo);
......
......@@ -140,49 +140,50 @@ public class TaskServiceImpl implements TaskService {
/**
* 评定报告新增
*
* @param taskId 评定任务id
* @param person1 鉴定人员1id
* @param person2 鉴定人员2id
* @param person3 鉴定人员3id
* @param evaluateTime 评估时间 格式:2020-11-12
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
* @param fileDataList 附件
* ReportDetailVO reportDetailVO
*/
@Transactional(rollbackFor = Exception.class)
@Override
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));
public Result<Object> addReport(ReportDetailVO reportDetailVO) {
//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, reportDetailVO.getTaskId()));
if (chAprReports != null && chAprReports.size() > 0) {
return Result.failed("已存在的评定任务报告!");
}
//插入评定任报告
ChAprReport report = new ChAprReport();
report.setTaskId(taskId);
report.setTaskId(reportDetailVO.getTaskId());
report.setEffTime(new Date());
report.setRemark(remark);
report.setDisableLevelId(disableLevelId);
report.setPolNo(polNo);
report.setRemark(reportDetailVO.getRemark());
report.setDisableLevelId(reportDetailVO.getDisableLevelId());
report.setPolNo(reportDetailVO.getPolNo());
report.setStatus(0);
report.setEvaluateTime(evaluateTime);
Date evaluateDate;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
evaluateDate = sdf.parse(reportDetailVO.getEvaluateTime());
} catch (ParseException e) {
return Result.failed("评估时间格式不正确!");
}
report.setEvaluateTime(evaluateDate);
report.setEvaluateType(reportDetailVO.getEvaluateType());
aprReportMapper.insert(report);
//附件上传
if (fileDataList != null && fileDataList.size() > 0) {
updateAttachs(fileDataList, report.getReportId().longValue());
if (reportDetailVO.getFileDataList() != null && reportDetailVO.getFileDataList().size() > 0) {
updateAttachs(reportDetailVO.getFileDataList(), report.getReportId().longValue());
}
//插入评定任务关联人员1.2(两位)
//person1
ChAprPersonInfo person1Info = new ChAprPersonInfo();
person1Info.setReportId(report.getReportId());
person1Info.setEmpId(person1);
person1Info.setEmpId(reportDetailVO.getPerson1());
person1Info.setFcd(new Date());
personInfoMapper.insert(person1Info);
if (person2 != null) {
if (reportDetailVO.getPerson2() != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1);
personInfo.setEmpId(reportDetailVO.getPerson1());
personInfo.setFcd(new Date());
personInfoMapper.insert(personInfo);
}
......@@ -193,15 +194,15 @@ public class TaskServiceImpl implements TaskService {
personInfo.setFcd(new Date());
personInfoMapper.insert(personInfo);
}*/
if(!chAprReportFractions.isEmpty() && chAprReportFractions.size()>0){
for (ChAprReportFraction chAprReportFraction: chAprReportFractions) {
if(!reportDetailVO.getChAprReportFractions().isEmpty() && reportDetailVO.getChAprReportFractions().size()>0){
for (ChAprReportFraction chAprReportFraction: reportDetailVO.getChAprReportFractions()) {
chAprReportFraction.setReportId(report.getReportId());
}
chAprReportFractionService.insertChAprReportFraction(chAprReportFractions);
chAprReportFractionService.insertChAprReportFraction(reportDetailVO.getChAprReportFractions());
}
// 更新评定任务状态为已完成,并记录完成时间
ChAprTask task = new ChAprTask();
task.setTaskId(taskId);
task.setTaskId(reportDetailVO.getTaskId());
task.setFinishTime(new Date());
task.setTaskStatus(3); // 已完成
taskMapper.updateById(task);
......
......@@ -144,7 +144,7 @@
info.ACPT_SRV_ADDRESS acptSrvAddress,--接受服务地址详细地址
info.ACPT_ADDRESS acptAddress,--接受评定详细地址
lev.DISABLE_LEVEL_NAME riskLevel,
report.EFF_TIME effTime
report.EFF_TIME effTime,report.EVALUATE_TYPE
FROM ch_apr_report report
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
......
......@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.io.Serializable;
import java.sql.Clob;
import java.util.Date;
/**
......
......@@ -18,6 +18,7 @@ public class ReportDetailVO {
String applyId;
String polNo;
String remark;
Integer evaluateType;
List<ChFndAttach> fileDataList;
List<ChAprReportFraction> chAprReportFractions;
}
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