Commit 6d6882b9 authored by 蔡镇泽's avatar 蔡镇泽

评定任务分组管理列表

评定任务分组管理
parent 38e8fd51
......@@ -3,9 +3,11 @@ package com.hungraim.ltc.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskGroupVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -49,7 +51,13 @@ public class TaskController {
public Result<List<TaskDistributionVO>> taskDistributionList(String organId, String provincial, String city,
String street, String realName, String certiCode, String taskName, String taskTel,
String daysRemaining, String status, String isReturn, String area,
int pageNum, int pageSize) {
Integer pageNum, Integer pageSize) {
if (pageNum == null) {
pageNum = 1;
}
if (pageSize == null) {
pageSize = 10;
}
IPage<TaskDistributionVO> iPage = taskService.taskDistributionList(organId, provincial, city,
street, realName, certiCode, taskName, taskTel, daysRemaining, status, isReturn, area,
pageNum, pageSize);
......@@ -131,15 +139,52 @@ public class TaskController {
*/
@RequestMapping("/allotTask")
public Result allotTask(String taskId, Integer empId) {
if (StringUtils.isBlank(taskId)) {
if (StringUtils.isBlank(taskId) && empId != null) {
return Result.failed("id不能为空!");
}
Result<Object> objectResult = taskService.allotTask(taskId, empId);
if (!"0".equals(objectResult.getCode())) {
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败
return Result.failed(objectResult.getMsg());
}
return Result.success();
}
/**
* 评定任务分组管理列表
*
* @param name 评定人员姓名
* @param certiCode 评定人员身份证号码
* @param tel 评定人员手机号码
*/
@RequestMapping("/taskGroupList")
public Result<List<TaskGroupVO>> taskGroupList(String name, String certiCode, String tel) {
List<TaskGroupVO> taskReportList = taskService.taskGroupList(name, certiCode, tel);
return Result.success(taskReportList);
}
/**
* 评定任务分组管理
*
* @param pushId 任务清单id
* @param status 分组状态 未分配(拒绝(重新分配)):0;已分配:1;已接受:2;已完成:3;拒绝(中止):4,拒绝(终止):5
*/
@RequestMapping("/taskGroupList")
public Result taskGroup(Integer pushId, Integer status) {
if (status == null || status < 0 || status > 5) {
Result.failed("状态异常!");
}
if (pushId == null) {
Result.failed("任务清单id不能为空!");
}
Result<Object> objectResult = taskService.taskGroup(pushId, status);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败
return Result.failed(objectResult.getMsg());
}
return Result.success();
}
}
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.eval.ChAprTask;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskGroupVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
......@@ -44,4 +45,5 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
*/
List<TaskReportVO> taskReportList(String name, String certiCode, String tel);
List<TaskGroupVO> taskGroupList(String name, String certiCode, String tel);
}
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.eval.ChAprTaskPush;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* @author czz
*/
@Mapper
@Repository
public interface TaskPushMapper extends BaseMapper<ChAprTaskPush> {
}
......@@ -3,6 +3,7 @@ package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskGroupVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.util.Result;
import org.springframework.stereotype.Service;
......@@ -56,4 +57,8 @@ public interface TaskService {
void updateReport(Integer reportId, Integer person1, Integer person2, Integer person3, Integer disableLevelId, String polNo, String remark);
Result<Object> allotTask(String taskId, Integer empId);
List<TaskGroupVO> taskGroupList(String name, String certiCode, String tel);
Result<Object> taskGroup(Integer pushId, Integer status);
}
......@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.entity.eval.ChAprPersonInfo;
import com.hungraim.ltc.pojo.entity.eval.ChAprReport;
import com.hungraim.ltc.pojo.entity.eval.ChAprTask;
import com.hungraim.ltc.pojo.entity.eval.*;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskGroupVO;
import com.hungraim.ltc.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.util.Result;
......@@ -36,6 +34,8 @@ public class TaskServiceImpl implements TaskService {
private TaskEmpMapper taskEmpMapper;
@Autowired
private AprPeronInfoMapper peronInfoMapper;
@Autowired
private TaskPushMapper taskPushMapper;
@Override
public IPage<TaskDistributionVO> taskDistributionList(String organId, String provincial, String city,
......@@ -151,6 +151,11 @@ public class TaskServiceImpl implements TaskService {
@Override
public Result<Object> allotTask(String taskId, Integer empId) {
ChAprEmp chAprEmp = aprEmpMapper.selectById(empId);
if (chAprEmp.getGroupLeader() != 0) {
//不是组长
return Result.failed("评定人员必须是组长!");
}
String[] taskIds = taskId.split(",");
for (String id : taskIds) {
ChAprTask task = taskMapper.selectById(id);
......@@ -165,4 +170,20 @@ public class TaskServiceImpl implements TaskService {
}
return Result.success();
}
@Override
public List<TaskGroupVO> taskGroupList(String name, String certiCode, String tel) {
return taskMapper.taskGroupList(name, certiCode, tel);
}
@Override
public Result<Object> taskGroup(Integer pushId, Integer status) {
ChAprTaskPush chAprTaskPush = taskPushMapper.selectById(pushId);
if (chAprTaskPush == null) {
return Result.failed("不存在的分组!");
}
chAprTaskPush.setStatus(status.shortValue());
taskPushMapper.updateById(chAprTaskPush);
return Result.success();
}
}
\ No newline at end of file
......@@ -118,4 +118,36 @@
</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 = #{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>
</mapper>
\ No newline at end of file
package com.hungraim.ltc.pojo.vo.assessment;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 评定任务分组管理列表VO
*/
@Data
public class TaskGroupVO {
//任务推送id
private Integer taskPushId;
//任务分配日期
@JsonFormat(pattern = "yyyy-MM-dd")
private Date assignTime;
//机构代码
private Integer aprOrganId;
//适用机构
private String organName;
//评定机构
private String empOrganName;
//评定起点地址
private String routeStatrtLocation;
//组号
private Integer groupNumber;
//评定人员姓名
private String realName;
//评定人员身份证号码
private String certiCode;
//评定人员手机号码
private String tel;
//组状态
private Integer status;
}
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