Commit b4a727fc authored by zhangch's avatar zhangch

Merge remote-tracking branch 'origin/master'

parents 0fee8a07 b1c45723
...@@ -3,9 +3,11 @@ package com.hungraim.ltc.controller; ...@@ -3,9 +3,11 @@ package com.hungraim.ltc.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp; import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO; 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.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.service.TaskService; import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import com.hungraim.ltc.util.ResultCode;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -49,7 +51,13 @@ public class TaskController { ...@@ -49,7 +51,13 @@ public class TaskController {
public Result<List<TaskDistributionVO>> taskDistributionList(String organId, String provincial, String city, public Result<List<TaskDistributionVO>> taskDistributionList(String organId, String provincial, String city,
String street, String realName, String certiCode, String taskName, String taskTel, String street, String realName, String certiCode, String taskName, String taskTel,
String daysRemaining, String status, String isReturn, String area, 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, IPage<TaskDistributionVO> iPage = taskService.taskDistributionList(organId, provincial, city,
street, realName, certiCode, taskName, taskTel, daysRemaining, status, isReturn, area, street, realName, certiCode, taskName, taskTel, daysRemaining, status, isReturn, area,
pageNum, pageSize); pageNum, pageSize);
...@@ -131,15 +139,52 @@ public class TaskController { ...@@ -131,15 +139,52 @@ public class TaskController {
*/ */
@RequestMapping("/allotTask") @RequestMapping("/allotTask")
public Result allotTask(String taskId, Integer empId) { public Result allotTask(String taskId, Integer empId) {
if (StringUtils.isBlank(taskId)) { if (StringUtils.isBlank(taskId) && empId != null) {
return Result.failed("id不能为空!"); return Result.failed("id不能为空!");
} }
Result<Object> objectResult = taskService.allotTask(taskId, empId); 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.failed(objectResult.getMsg());
} }
return Result.success(); 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("/taskGroup")
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; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.eval.ChAprTask; import com.hungraim.ltc.pojo.entity.eval.ChAprTask;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO; 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.pojo.vo.assessment.TaskReportVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
...@@ -44,4 +45,5 @@ public interface TaskMapper extends BaseMapper<ChAprTask> { ...@@ -44,4 +45,5 @@ public interface TaskMapper extends BaseMapper<ChAprTask> {
*/ */
List<TaskReportVO> taskReportList(String name, String certiCode, String tel); 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; ...@@ -3,6 +3,7 @@ package com.hungraim.ltc.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp; import com.hungraim.ltc.pojo.entity.eval.ChAprEmp;
import com.hungraim.ltc.pojo.vo.assessment.TaskDistributionVO; 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.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -56,4 +57,8 @@ public interface TaskService { ...@@ -56,4 +57,8 @@ public interface TaskService {
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, Integer disableLevelId, String polNo, String remark);
Result<Object> allotTask(String taskId, Integer empId); 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; ...@@ -5,11 +5,9 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.dao.*; import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.pojo.entity.eval.ChAprEmp; import com.hungraim.ltc.pojo.entity.eval.*;
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.vo.assessment.TaskDistributionVO; 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.pojo.vo.assessment.TaskReportVO;
import com.hungraim.ltc.service.TaskService; import com.hungraim.ltc.service.TaskService;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
...@@ -36,6 +34,8 @@ public class TaskServiceImpl implements TaskService { ...@@ -36,6 +34,8 @@ public class TaskServiceImpl implements TaskService {
private TaskEmpMapper taskEmpMapper; private TaskEmpMapper taskEmpMapper;
@Autowired @Autowired
private AprPeronInfoMapper peronInfoMapper; private AprPeronInfoMapper peronInfoMapper;
@Autowired
private TaskPushMapper taskPushMapper;
@Override @Override
public IPage<TaskDistributionVO> taskDistributionList(String organId, String provincial, String city, public IPage<TaskDistributionVO> taskDistributionList(String organId, String provincial, String city,
...@@ -151,6 +151,11 @@ public class TaskServiceImpl implements TaskService { ...@@ -151,6 +151,11 @@ public class TaskServiceImpl implements TaskService {
@Override @Override
public Result<Object> allotTask(String taskId, Integer empId) { public Result<Object> allotTask(String taskId, Integer empId) {
ChAprEmp chAprEmp = aprEmpMapper.selectById(empId);
if (chAprEmp == null || chAprEmp.getGroupLeader() == null || chAprEmp.getGroupLeader() != 0) {
//不是组长
return Result.failed("评定人员必须是组长!");
}
String[] taskIds = taskId.split(","); String[] taskIds = taskId.split(",");
for (String id : taskIds) { for (String id : taskIds) {
ChAprTask task = taskMapper.selectById(id); ChAprTask task = taskMapper.selectById(id);
...@@ -165,4 +170,20 @@ public class TaskServiceImpl implements TaskService { ...@@ -165,4 +170,20 @@ public class TaskServiceImpl implements TaskService {
} }
return Result.success(); 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 @@ ...@@ -118,4 +118,36 @@
</where> </where>
</select> </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> </mapper>
\ No newline at end of file
package com.hungraim.ltc.pojo.entity.eval; package com.hungraim.ltc.pojo.entity.eval;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@Data @Data
@TableName("CH_APR_EMP") @TableName("CH_APR_EMP")
@KeySequence(value = "SEQ_CH_APR_EMP")
public class ChAprEmp { public class ChAprEmp {
@TableId(value = "emp_id", type = IdType.INPUT)
private Integer empId; private Integer empId;
private Integer eduId; private Integer eduId;
private String aprempTypeNameF; private String aprempTypeNameF;
......
package com.hungraim.ltc.pojo.entity.eval; package com.hungraim.ltc.pojo.entity.eval;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
...@@ -7,10 +10,12 @@ import java.util.Date; ...@@ -7,10 +10,12 @@ import java.util.Date;
@Data @Data
@TableName("CH_APR_REPORT_EVALUATE") @TableName("CH_APR_REPORT_EVALUATE")
@KeySequence(value = "SEQ_CH_APR_REPORT_EVALUATE")
public class ChAprReportEvaluate { public class ChAprReportEvaluate {
/** /**
* 评定ID * 评定ID
*/ */
@TableId(value = "evaluate_id", type = IdType.INPUT)
private Integer evaluateId; private Integer evaluateId;
/** /**
......
package com.hungraim.ltc.pojo.entity.eval; package com.hungraim.ltc.pojo.entity.eval;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
@Data @Data
@TableName("CH_APR_TASK") @TableName("CH_APR_TASK")
@KeySequence(value = "SEQ_CH_APR_REPORT_EVALUATE")
public class ChAprTask { public class ChAprTask {
@TableId(value = "task_id", type = IdType.INPUT)
private Integer taskId; private Integer taskId;
private java.util.Date assignTime; private java.util.Date assignTime;
private Integer taskStatus; private Integer taskStatus;
......
...@@ -21,7 +21,7 @@ public class ChAprTaskPush implements Serializable { ...@@ -21,7 +21,7 @@ public class ChAprTaskPush implements Serializable {
/** /**
* 任务推送ID(年月日+串码6) * 任务推送ID(年月日+串码6)
*/ */
@TableId(type = IdType.INPUT) @TableId(value = "task_push_id", type = IdType.INPUT)
private Long taskPushId; private Long taskPushId;
/** /**
......
package com.hungraim.ltc.pojo.entity.eval; package com.hungraim.ltc.pojo.entity.eval;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.KeySequence;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data; import lombok.Data;
import java.util.Date; import java.util.Date;
@Data @Data
@TableName("CH_CFG_APR_GROUP_DETAIL") @TableName("CH_CFG_APR_GROUP_DETAIL")
@KeySequence("SEQ_CH_APR_TASK_PUSH")
public class ChCfgAprGroupDetail { public class ChCfgAprGroupDetail {
/** /**
* 评定参数列表ID * 评定参数列表ID
*/ */
@TableId(value = "detail_id", type = IdType.INPUT)
private Integer detailId; private Integer detailId;
/** /**
......
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