Commit 34441f86 authored by 蔡镇泽's avatar 蔡镇泽

评定任务分组管理(整组操作)

parent e6fef9ad
......@@ -194,8 +194,8 @@ public class TaskController {
* @param empId 评定人员id
*/
@RequestMapping("/allotTask")
public Result allotTask(String taskId, Integer empId) {
if (StringUtils.isBlank(taskId) && empId != null) {
public Result allotTask(String taskId, String empId) {
if (StringUtils.isBlank(taskId) && StringUtils.isBlank(empId)) {
return Result.failed("id不能为空!");
}
Result<Object> objectResult = taskService.allotTask(taskId, empId);
......@@ -220,6 +220,42 @@ public class TaskController {
}
/**
* 评定任务分组管理列表详情
*
* @param groupNumber 组号
*/
@RequestMapping("/taskGroupList")
public Result<List<TaskGroupInfoVO>> taskGroupInfoList(String groupNumber) {
if (StringUtils.isBlank(groupNumber)) {
return Result.failed("组号不能为空!");
}
List<TaskGroupInfoVO> groupInfoList = taskService.taskGroupInfoList(groupNumber);
return Result.success(groupInfoList);
}
/**
* 评定任务分组管理(整组操作)
*
* @param groupNumber 组号
* @param status 分组状态 未分配(拒绝(重新分配)):0;已分配:1;已接受:2;已完成:3;拒绝(中止):4,拒绝(终止):5
*/
@RequestMapping("/taskGroupByGroup")
public Result taskGroupByGroup(String groupNumber, Integer status) {
if (StringUtils.isBlank(groupNumber)) {
return Result.failed("组号不能为空!");
}
if (status == null || status < 0 || status > 5) {
Result.failed("状态异常!");
}
Result<Object> objectResult = taskService.taskGroupByGroup(groupNumber, status);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败
return Result.failed(objectResult.getMsg());
}
return Result.success();
}
/**
* 评定任务分组管理
*
* @param pushId 任务清单id
......@@ -231,7 +267,7 @@ public class TaskController {
Result.failed("状态异常!");
}
if (pushId == null) {
Result.failed("任务清单id不能为空!");
Result.failed("任务不能为空!");
}
Result<Object> objectResult = taskService.taskGroup(pushId, status);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
......
......@@ -48,4 +48,6 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
List<AprEmpVO> aprEmpList(String organName, String name, String tel, String groupLeader);
List<PersonInfoVO> personInfoList(String reportId);
List<TaskGroupInfoVO> taskGroupInfoList(String groupNumber);
}
......@@ -55,7 +55,7 @@ public interface TaskService {
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);
Result<Object> allotTask(String taskId, String empId);
List<TaskGroupVO> taskGroupList(String name, String certiCode, String tel);
......@@ -64,4 +64,8 @@ public interface TaskService {
List<ChCfgSrvDisableLevel> cfgSrvDisableLevelList();
List<PersonInfoVO> personInfoList(String reportId);
List<TaskGroupInfoVO> taskGroupInfoList(String groupNumber);
Result<Object> taskGroupByGroup(String groupNumber, Integer status);
}
......@@ -153,7 +153,7 @@ public class TaskServiceImpl implements TaskService {
}
@Override
public Result<Object> allotTask(String taskId, Integer empId) {
public Result<Object> allotTask(String taskId, String empId) {
ChAprEmp chAprEmp = aprEmpMapper.selectById(empId);
if (chAprEmp == null || chAprEmp.getGroupLeader() == null || chAprEmp.getGroupLeader() != 0) {
//不是组长
......@@ -166,7 +166,7 @@ public class TaskServiceImpl implements TaskService {
if (task == null) {
return Result.failed("无效的taskId!");
}
task.setAprEmpId(empId);
task.setAprEmpId(Integer.parseInt(empId));
task.setAssignTime(assignTime);
int count = taskMapper.updateById(task);
if (count != 1) {
......@@ -175,9 +175,9 @@ public class TaskServiceImpl implements TaskService {
//生成组
ChAprTaskPush taskPush = new ChAprTaskPush();
taskPush.setTime(new Date());
taskPush.setGroupNumber(SerialNumberUtils.getSerialNumber(empId.toString()));
taskPush.setGroupNumber(SerialNumberUtils.getSerialNumber(empId));
taskPush.setTaskId(Long.getLong(id));
taskPush.setEmpId(empId.longValue());
taskPush.setEmpId(Long.getLong(empId));
taskPush.setStatus((short) 1);
taskPush.setIsManual((short) 1);
taskPushMapper.insert(taskPush);
......@@ -194,7 +194,7 @@ public class TaskServiceImpl implements TaskService {
public Result<Object> taskGroup(Integer pushId, Integer status) {
ChAprTaskPush chAprTaskPush = taskPushMapper.selectById(pushId);
if (chAprTaskPush == null) {
return Result.failed("不存在的组!");
return Result.failed("不存在的组!");
}
chAprTaskPush.setStatus(status.shortValue());
taskPushMapper.updateById(chAprTaskPush);
......@@ -210,4 +210,28 @@ public class TaskServiceImpl implements TaskService {
public List<PersonInfoVO> personInfoList(String reportId) {
return taskMapper.personInfoList(reportId);
}
@Override
public List<TaskGroupInfoVO> taskGroupInfoList(String groupNumber) {
return taskMapper.taskGroupInfoList(groupNumber);
}
@Override
public Result<Object> taskGroupByGroup(String groupNumber, Integer status) {
List<ChAprTaskPush> pushList = taskPushMapper.selectList(new QueryWrapper<ChAprTaskPush>().eq("group_number", groupNumber));
if (pushList == null || pushList.size() <= 0) {
return Result.failed("不存在的组!");
}
short status1 = pushList.get(0).getStatus();
for (ChAprTaskPush push : pushList) {
if (status1 != push.getStatus()) {
return Result.failed("该组状态不一致,不可整组操作!");
}
}
for (ChAprTaskPush push : pushList) {
push.setStatus(status.shortValue());
taskPushMapper.updateById(push);
}
return Result.success();
}
}
\ No newline at end of file
......@@ -146,38 +146,6 @@
</where>
</select>
<select id="taskGroupList" resultType="com.hungraim.ltc.pojo.vo.assessment.TaskGroupVO">
SELECT
push.TASK_PUSH_ID taskPushId,
push.assign_time assignTime,
task.task.apr_organ_id aprOrganId,
organ.organ_name organName,
emp_organ.organ_name empOrganName,
push.ROUTE_START_LOCATION routeStatrtLocation,
push.Group_number groupNumber,
emp.real_name realName,
emp.certi_code certiCode,
emp.tel tel,
push.status status
FROM
ch_apr_task_push push
LEFT JOIN ch_apr_task task ON push.TASK_ID = task.TASK_ID
LEFT JOIN CH_APR_ORGAN organ on task.apr_organ_id = organ.apr_organ_id
LEFT JOIN ch_apr_emp emp on task.apr_emp_id = emp.emp_id
LEFT JOIN CH_APR_ORGAN emp_organ on emp.apr_organ_id = emp_organ.apr_organ_id
<where>
<if test="name != null and name != ''">
and emp.REAL_NAME like CONCAT(CONCAT('%',#{name}) ,'%')
</if>
<if test="certiCode != null and certiCode != ''">
and emp.CERTI_CODE = #{certiCode}
</if>
<if test="tel != null and tel != ''">
and emp.tel = #{tel}
</if>
</where>
</select>
<select id="aprEmpList" resultType="com.hungraim.ltc.pojo.vo.assessment.AprEmpVO">
SELECT emp.emp_id empId,
srvOrgan.srv_organ_name srvOrganName,
......@@ -212,6 +180,45 @@
</where>
</select>
<select id="taskGroupList" resultType="com.hungraim.ltc.pojo.vo.assessment.TaskGroupVO">
SELECT
push.TASK_PUSH_ID taskPushId,
push.assign_time assignTime,
task.task.apr_organ_id aprOrganId,
organ.organ_name organName,
emp_organ.organ_name empOrganName,
push.ROUTE_START_LOCATION routeStatrtLocation,
push.Group_number groupNumber,
emp.real_name realName,
emp.certi_code certiCode,
emp.tel tel,
push.status status
FROM
ch_apr_task_push push
LEFT JOIN ch_apr_task task ON push.TASK_ID = task.TASK_ID
LEFT JOIN CH_APR_ORGAN organ on task.apr_organ_id = organ.apr_organ_id
LEFT JOIN ch_apr_emp emp on task.apr_emp_id = emp.emp_id
LEFT JOIN CH_APR_ORGAN emp_organ on emp.apr_organ_id = emp_organ.apr_organ_id
<where>
<if test="name != null and name != ''">
and emp.REAL_NAME like CONCAT(CONCAT('%',#{name}) ,'%')
</if>
<if test="certiCode != null and certiCode != ''">
and emp.CERTI_CODE = #{certiCode}
</if>
<if test="tel != null and tel != ''">
and emp.tel = #{tel}
</if>
</where>
</select>
<select id="taskGroupInfoList" resultType="com.hungraim.ltc.pojo.vo.assessment.TaskGroupInfoVO">
select task.task_id taskId
from ch_apr_task_push push
left join ch_apr_organ organ on task.apr_organ_id = organ.apr_organ_id
where push.group_number = #{groupNumber}
</select>
<select id="personInfoList" resultType="com.hungraim.ltc.pojo.vo.assessment.PersonInfoVO">
SELECT emp.emp_id empId,
organ.organ_name orgaName,
......
package com.hungraim.ltc.pojo.vo.assessment;
import lombok.Data;
/**
* 评定任务分组管理列表详情
*/
@Data
public class TaskGroupInfoVO {
//
}
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