Commit 7c5d5687 authored by zhangwanglin's avatar zhangwanglin

Merge branch 'uat_ch_master' into dev_ch_master

parents 38b7cff1 196486a1
...@@ -182,14 +182,8 @@ public class TaskController { ...@@ -182,14 +182,8 @@ public class TaskController {
if (StringUtils.isBlank(evaluateTime)) { if (StringUtils.isBlank(evaluateTime)) {
return Result.failed("评估时间不能为空!"); return Result.failed("评估时间不能为空!");
} }
Date evaluateDate;
try { Result<Object> objectResult = taskService.addReport(reportDetailVo);
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);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) { if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败 //失败
return Result.failed(objectResult.getMsg()); return Result.failed(objectResult.getMsg());
......
...@@ -32,7 +32,7 @@ public interface TaskService { ...@@ -32,7 +32,7 @@ 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,List<ChAprReportFraction> chAprReportFractions); Result<Object> addReport(ReportDetailVO reportDetailVo);
void updateReport(ReportUpdateVO vo); void updateReport(ReportUpdateVO vo);
......
...@@ -140,49 +140,50 @@ public class TaskServiceImpl implements TaskService { ...@@ -140,49 +140,50 @@ public class TaskServiceImpl implements TaskService {
/** /**
* 评定报告新增 * 评定报告新增
* * ReportDetailVO reportDetailVO
* @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 附件
*/ */
@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,List<ChAprReportFraction> chAprReportFractions) { public Result<Object> addReport(ReportDetailVO reportDetailVO) {
List<ChAprReport> chAprReports = aprReportMapper.selectList(new LambdaQueryWrapper<ChAprReport>().eq(ChAprReport::getStatus, 4).eq(ChAprReport::getTaskId, taskId)); //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) { 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(reportDetailVO.getTaskId());
report.setEffTime(new Date()); report.setEffTime(new Date());
report.setRemark(remark); report.setRemark(reportDetailVO.getRemark());
report.setDisableLevelId(disableLevelId); report.setDisableLevelId(reportDetailVO.getDisableLevelId());
report.setPolNo(polNo); report.setPolNo(reportDetailVO.getPolNo());
report.setStatus(0); 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); aprReportMapper.insert(report);
//附件上传 //附件上传
if (fileDataList != null && fileDataList.size() > 0) { if (reportDetailVO.getFileDataList() != null && reportDetailVO.getFileDataList().size() > 0) {
updateAttachs(fileDataList, report.getReportId().longValue()); updateAttachs(reportDetailVO.getFileDataList(), report.getReportId().longValue());
} }
//插入评定任务关联人员1.2(两位) //插入评定任务关联人员1.2(两位)
//person1 //person1
ChAprPersonInfo person1Info = new ChAprPersonInfo(); ChAprPersonInfo person1Info = new ChAprPersonInfo();
person1Info.setReportId(report.getReportId()); person1Info.setReportId(report.getReportId());
person1Info.setEmpId(person1); person1Info.setEmpId(reportDetailVO.getPerson1());
person1Info.setFcd(new Date()); person1Info.setFcd(new Date());
personInfoMapper.insert(person1Info); personInfoMapper.insert(person1Info);
if (person2 != null) { if (reportDetailVO.getPerson2() != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo(); ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId()); personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1); personInfo.setEmpId(reportDetailVO.getPerson1());
personInfo.setFcd(new Date()); personInfo.setFcd(new Date());
personInfoMapper.insert(personInfo); personInfoMapper.insert(personInfo);
} }
...@@ -193,15 +194,15 @@ public class TaskServiceImpl implements TaskService { ...@@ -193,15 +194,15 @@ 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){ if(!reportDetailVO.getChAprReportFractions().isEmpty() && reportDetailVO.getChAprReportFractions().size()>0){
for (ChAprReportFraction chAprReportFraction: chAprReportFractions) { for (ChAprReportFraction chAprReportFraction: reportDetailVO.getChAprReportFractions()) {
chAprReportFraction.setReportId(report.getReportId()); chAprReportFraction.setReportId(report.getReportId());
} }
chAprReportFractionService.insertChAprReportFraction(chAprReportFractions); chAprReportFractionService.insertChAprReportFraction(reportDetailVO.getChAprReportFractions());
} }
// 更新评定任务状态为已完成,并记录完成时间 // 更新评定任务状态为已完成,并记录完成时间
ChAprTask task = new ChAprTask(); ChAprTask task = new ChAprTask();
task.setTaskId(taskId); task.setTaskId(reportDetailVO.getTaskId());
task.setFinishTime(new Date()); task.setFinishTime(new Date());
task.setTaskStatus(3); // 已完成 task.setTaskStatus(3); // 已完成
taskMapper.updateById(task); taskMapper.updateById(task);
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
info.ACPT_SRV_ADDRESS acptSrvAddress,--接受服务地址详细地址 info.ACPT_SRV_ADDRESS acptSrvAddress,--接受服务地址详细地址
info.ACPT_ADDRESS acptAddress,--接受评定详细地址 info.ACPT_ADDRESS acptAddress,--接受评定详细地址
lev.DISABLE_LEVEL_NAME riskLevel, lev.DISABLE_LEVEL_NAME riskLevel,
report.EFF_TIME effTime report.EFF_TIME effTime,report.EVALUATE_TYPE
FROM ch_apr_report report FROM ch_apr_report report
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
......
...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName; ...@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.io.Serializable; import java.io.Serializable;
import java.sql.Clob;
import java.util.Date; import java.util.Date;
/** /**
......
...@@ -18,6 +18,7 @@ public class ReportDetailVO { ...@@ -18,6 +18,7 @@ public class ReportDetailVO {
String applyId; String applyId;
String polNo; String polNo;
String remark; String remark;
Integer evaluateType;
List<ChFndAttach> fileDataList; List<ChFndAttach> fileDataList;
List<ChAprReportFraction> chAprReportFractions; 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