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

评定任务分配

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