Commit 3e9268cf authored by 蔡镇泽's avatar 蔡镇泽

评定报告新增、修改评估时间

parent 907302cf
......@@ -15,6 +15,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
......@@ -101,17 +104,28 @@ public class TaskController {
/**
* 评定报告新增
*
* @param taskId 评定报告id
* @param taskId 评定任务id
* @param person1 鉴定人员1id
* @param person2 鉴定人员2id
* @param person3 鉴定人员3id
* @param evaluateTime 评估时间 格式:2020-11-12
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
*/
@RequestMapping("/addReport")
public Result addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
taskService.addReport(taskId, person1, person2, person3, disableLevelId, polNo, remark);
public Result addReport(Integer taskId, Integer person1, Integer person2, Integer person3, String evaluateTime, Integer disableLevelId, String polNo, String remark) {
if (person1 == null) {
return Result.failed("鉴定人员1不能为空!");
}
Date evaluateDate;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
evaluateDate = sdf.parse(evaluateTime);
} catch (ParseException e) {
return Result.failed("评估时间格式不正确!");
}
taskService.addReport(taskId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark);
return Result.success();
}
......@@ -122,12 +136,13 @@ public class TaskController {
* @param person1 鉴定人员1id
* @param person2 鉴定人员2id
* @param person3 鉴定人员3id
* @param evaluateTime 评估时间 格式:2020-11-12
* @param disableLevelId 失能等级id
* @param polNo 保单号
* @param remark 备注
*/
@RequestMapping("/updateReport")
public Result updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
public Result updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, String evaluateTime, Integer disableLevelId, String polNo, String remark) {
if (disableLevelId == null) {
return Result.failed("失能等级不能为空!");
}
......@@ -137,7 +152,14 @@ public class TaskController {
if (remark == null) {
remark = "";
}
taskService.updateReport(reportId, person1, person2, person3, disableLevelId, polNo, remark);
Date evaluateDate;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
evaluateDate = sdf.parse(evaluateTime);
} catch (ParseException e) {
return Result.failed("评估时间格式不正确!");
}
taskService.updateReport(reportId, person1, person2, person3, evaluateDate, disableLevelId, polNo, remark);
return Result.success();
}
......
......@@ -9,6 +9,7 @@ import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.util.Result;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
/**
......@@ -53,9 +54,9 @@ public interface TaskService {
List<ChAprEmp> aprEmpList(Integer organId);
void addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark);
void addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark);
void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark);
void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark);
Result<Object> allotTask(String taskId, Integer empId);
......
......@@ -70,7 +70,7 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public void addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
public void addReport(Integer taskId, Integer person1, Integer person2, Integer person3, Date evaluateTime, Integer disableLevelId, String polNo, String remark) {
ChAprReport report = new ChAprReport();
report.setTaskId(taskId);
report.setEffTime(new Date());
......@@ -78,14 +78,14 @@ public class TaskServiceImpl implements TaskService {
report.setDisableLevelId(disableLevelId);
report.setPolNo(polNo);
report.setStatus(0);
report.setEvaluateTime(evaluateTime);
aprReportMapper.insert(report);
if (person1 != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId());
personInfo.setEmpId(person1);
personInfo.setFcd(new Date());
peronInfoMapper.insert(personInfo);
}
//person1
ChAprPersonInfo person1Info = new ChAprPersonInfo();
person1Info.setReportId(report.getReportId());
person1Info.setEmpId(person1);
person1Info.setFcd(new Date());
peronInfoMapper.insert(person1Info);
if (person2 != null) {
ChAprPersonInfo personInfo = new ChAprPersonInfo();
personInfo.setReportId(report.getReportId());
......@@ -103,12 +103,13 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark) {
public void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Date evaluateDate, Integer disableLevelId, String polNo, String remark) {
//update鉴定报告
ChAprReport chAprReport = aprReportMapper.selectById(reportId);
chAprReport.setDisableLevelId(disableLevelId);
chAprReport.setPolNo(polNo);
chAprReport.setRemark(remark);
chAprReport.setEvaluateTime(evaluateDate);
aprReportMapper.updateById(chAprReport);
//修改鉴定报告人员(有就update,没有就insert)
List<ChAprPersonInfo> personInfos = peronInfoMapper.selectList(new QueryWrapper<ChAprPersonInfo>().eq("report_id", 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