Commit 8ad30bb6 authored by 蔡镇泽's avatar 蔡镇泽

评定任务分配

parent 348d4eb6
......@@ -68,11 +68,11 @@ public class TaskController {
}
/**
* 查询失能人员列表
* 查询评定人员列表
*/
@RequestMapping("/aprEmpList")
public Result<List<ChAprEmp>> aprEmpList() {
List<ChAprEmp> chAprEmps = taskService.aprEmpList();
public Result<List<ChAprEmp>> aprEmpList(Integer organId) {
List<ChAprEmp> chAprEmps = taskService.aprEmpList(organId);
return Result.success(chAprEmps);
}
......@@ -82,7 +82,11 @@ public class TaskController {
@RequestMapping("/addReport")
public Result addReport(@RequestBody ChAprReport chAprReport) {
chAprReport.setEffTime(new Date());
taskService.addReport(chAprReport);
int count = taskService.addReport(chAprReport);
if (count != 1) {
//失败
return Result.failed();
}
return Result.success();
}
......@@ -91,7 +95,11 @@ public class TaskController {
*/
@RequestMapping("/updateReport")
public Result updateReport(String reportId, Integer disableLevelId, String polNo, String remark) {
taskService.updateReport(reportId, disableLevelId, polNo, remark);
int count = taskService.updateReport(reportId, disableLevelId, polNo, remark);
if (count != 1) {
//失败
return Result.failed();
}
return Result.success();
}
......@@ -100,9 +108,9 @@ public class TaskController {
*/
@RequestMapping("/allotTask")
public Result allotTask(String taskId, String empId) {
int cout = taskService.allotTask(taskId, empId);
if (cout != 1) {
//数据插入失败
int count = taskService.allotTask(taskId, empId);
if (count != 1) {
//失败
return Result.failed();
}
return Result.success();
......
......@@ -45,11 +45,11 @@ public interface TaskService {
*/
List<TaskReportVO> taskReportList();
List<ChAprEmp> aprEmpList();
List<ChAprEmp> aprEmpList(Integer organId);
void addReport(ChAprReport chAprReport);
int addReport(ChAprReport chAprReport);
void updateReport(String reportId, Integer disableLevelId, String polNo, String remark);
int updateReport(String reportId, Integer disableLevelId, String polNo, String remark);
int allotTask(String taskId, String empId);
}
......@@ -56,22 +56,25 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public List<ChAprEmp> aprEmpList() {
public List<ChAprEmp> aprEmpList(Integer organId) {
QueryWrapper queryWrapper = new QueryWrapper<ChAprEmp>();
queryWrapper.eq("IS_LOCK", 0);
queryWrapper.eq("apr_organ_id", organId);
return aprEmpMapper.selectList(new QueryWrapper<ChAprEmp>().eq("IS_LOCK", 0));
}
@Override
public void addReport(ChAprReport chAprReport) {
aprReportMapper.insert(chAprReport);
public int addReport(ChAprReport chAprReport) {
return aprReportMapper.insert(chAprReport);
}
@Override
public void updateReport(String reportId, Integer disableLevelId, String polNo, String remark) {
public int updateReport(String reportId, Integer disableLevelId, String polNo, String remark) {
ChAprReport chAprReport = aprReportMapper.selectById(reportId);
chAprReport.setDisableLevelId(disableLevelId);
chAprReport.setPolNo(polNo);
chAprReport.setRemark(remark);
aprReportMapper.updateById(chAprReport);
return aprReportMapper.updateById(chAprReport);
}
@Override
......
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