Commit 7db1a7b3 authored by zhangch's avatar zhangch
parents 567755de f2edd7f9
...@@ -92,6 +92,7 @@ public class DisableServiceImpl implements DisableService { ...@@ -92,6 +92,7 @@ public class DisableServiceImpl implements DisableService {
@Override @Override
public void addDisable(ChDisableApply chDisableApply) { public void addDisable(ChDisableApply chDisableApply) {
chDisableApply.setEffTime(new Date());
disableApplyMapper.insert(chDisableApply); disableApplyMapper.insert(chDisableApply);
} }
......
package com.hungraim.ltc.controller; 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.assessment.ChRefuseReason;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.service.TaskService; import com.hungraim.ltc.service.TaskService;
...@@ -259,18 +260,20 @@ public class TaskController { ...@@ -259,18 +260,20 @@ public class TaskController {
/** /**
* 评定任务分组管理(整组操作) * 评定任务分组管理(整组操作)
* *
* @param groupNumber 组号 * @param groupNumber 组号
* @param status 分组状态 未分配(拒绝(重新分配)):0;已分配:1;已接受:2;已完成:3;拒绝(中止):4,拒绝(终止):5 * @param status 分组状态 未分配(拒绝(重新分配)):0;已分配:1;已接受:2;已完成:3;拒绝(中止):4,拒绝(终止):5
* @param refuseReason 拒绝原因id
* @param refuseRemark 拒绝备注
*/ */
@RequestMapping("/taskGroupByGroup") @RequestMapping("/taskGroupByGroup")
public Result taskGroupByGroup(String groupNumber, Integer status) { public Result taskGroupByGroup(String groupNumber, Integer status, Integer refuseReason, String refuseRemark) {
if (StringUtils.isBlank(groupNumber)) { if (StringUtils.isBlank(groupNumber)) {
return Result.failed("组号不能为空!"); return Result.failed("组号不能为空!");
} }
if (status == null || status < 0 || status > 5) { if (status == null || status < 0 || status > 5) {
return Result.failed("状态异常!"); return Result.failed("状态异常!");
} }
Result<Object> objectResult = taskService.taskGroupByGroup(groupNumber, status); Result<Object> objectResult = taskService.taskGroupByGroup(groupNumber, status, refuseReason, refuseRemark);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) { if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败 //失败
return Result.failed(objectResult.getMsg()); return Result.failed(objectResult.getMsg());
...@@ -281,18 +284,64 @@ public class TaskController { ...@@ -281,18 +284,64 @@ public class TaskController {
/** /**
* 评定任务分组管理 * 评定任务分组管理
* *
* @param pushId 任务组id * @param pushId 任务组id
* @param status 分组状态 未分配(拒绝(重新分配)):0;已分配:1;已接受:2;已完成:3;拒绝(中止):4,拒绝(终止):5 * @param status 分组状态 未分配(拒绝(重新分配)):0;已分配:1;已接受:2;已完成:3;拒绝(中止):4,拒绝(终止):5
* @param refuseReason 拒绝原因id
* @param refuseRemark 拒绝备注
*/ */
@RequestMapping("/taskGroup") @RequestMapping("/taskGroup")
public Result taskGroup(Integer pushId, Integer status) { public Result taskGroup(Integer pushId, Integer status, Integer refuseReason, String refuseRemark) {
if (status == null || status < 0 || status > 5) { if (status == null || status < 0 || status > 5) {
return Result.failed("状态异常!"); return Result.failed("状态异常!");
} }
if (pushId == null) { if (pushId == null) {
return Result.failed("任务组id不能为空!"); return Result.failed("任务组id不能为空!");
} }
Result<Object> objectResult = taskService.taskGroup(pushId, status); Result<Object> objectResult = taskService.taskGroup(pushId, status, refuseReason, refuseRemark);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败
return Result.failed(objectResult.getMsg());
}
return Result.success();
}
/**
* 查询拒绝原因
*
* @return 拒绝原因
*/
@RequestMapping("/refuseReasonList")
public Result<List<ChRefuseReason>> refuseReasonList() {
List<ChRefuseReason> refuseReasons = taskService.refuseReasonList();
return Result.success(refuseReasons);
}
/**
* 设置预约日期和备注
*
* @param pushId 分组id
* @param time 预约日期 yyyy-MM-dd
* @param remark 备注
*/
@RequestMapping("/updatePushTimeAndRemark")
public Result updatePushTimeAndRemark(String pushId, String time, String remark) {
if (StringUtils.isBlank(pushId)) {
return Result.failed("分组id不能为空!");
}
if (StringUtils.isBlank(time)) {
return Result.failed("预约日期不能为空!");
}
if (StringUtils.isBlank(remark)) {
return Result.failed("备注不能为空!");
}
Date timeDate;
try {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
timeDate = sdf.parse(time);
} catch (ParseException e) {
return Result.failed("预约日期格式不正确!");
}
Result<Object> objectResult = taskService.updatePushTimeAndRemark(pushId, timeDate, remark);
if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) { if (!ResultCode.SUCCESS.getCode().equals(objectResult.getCode())) {
//失败 //失败
return Result.failed(objectResult.getMsg()); return Result.failed(objectResult.getMsg());
......
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* 失能人员信息Mapper
*
* @author czz
*/
@Mapper
@Repository
public interface DisableInfoMapper extends BaseMapper<ChDisableInfo> {
}
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.assessment.ChRefuseReason;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* 拒绝原因Mapper
*
* @author czz
*/
@Mapper
@Repository
public interface RefuseReasonMapper extends BaseMapper<ChRefuseReason> {
}
package com.hungraim.ltc.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hungraim.ltc.pojo.entity.assessment.ChAprTaskPushHis;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;
/**
* @author czz
*/
@Mapper
@Repository
public interface TaskPushHisMapper extends BaseMapper<ChAprTaskPushHis> {
}
package com.hungraim.ltc.service; 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.assessment.ChRefuseReason;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
import com.hungraim.ltc.util.Result; import com.hungraim.ltc.util.Result;
...@@ -59,7 +60,7 @@ public interface TaskService { ...@@ -59,7 +60,7 @@ public interface TaskService {
List<TaskGroupVO> taskGroupList(String name, String certiCode, String tel); List<TaskGroupVO> taskGroupList(String name, String certiCode, String tel);
Result<Object> taskGroup(Integer pushId, Integer status); Result<Object> taskGroup(Integer pushId, Integer status, Integer refuseReason, String refuseRemark);
List<ChCfgSrvDisableLevel> cfgSrvDisableLevelList(); List<ChCfgSrvDisableLevel> cfgSrvDisableLevelList();
...@@ -67,9 +68,13 @@ public interface TaskService { ...@@ -67,9 +68,13 @@ public interface TaskService {
List<TaskGroupInfoVO> taskGroupInfoList(String groupNumber); List<TaskGroupInfoVO> taskGroupInfoList(String groupNumber);
Result<Object> taskGroupByGroup(String groupNumber, Integer status); Result<Object> taskGroupByGroup(String groupNumber, Integer status, Integer refuseReason, String refuseRemark);
TaskGroupInfoListInfoVO taskGroupInfoListInfo(String pushId); TaskGroupInfoListInfoVO taskGroupInfoListInfo(String pushId);
List<AllotTaskHisVO> allotTaskHisList(); List<AllotTaskHisVO> allotTaskHisList();
Result<Object> updatePushTimeAndRemark(String pushId, Date timeDate, String remark);
List<ChRefuseReason> refuseReasonList();
} }
...@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -7,10 +7,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.dao.*; import com.hungraim.ltc.dao.*;
import com.hungraim.ltc.pojo.entity.assessment.*; import com.hungraim.ltc.pojo.entity.assessment.*;
import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel; import com.hungraim.ltc.pojo.entity.disable.ChCfgSrvDisableLevel;
import com.hungraim.ltc.pojo.entity.disable.ChDisableInfo;
import com.hungraim.ltc.pojo.vo.assessment.*; import com.hungraim.ltc.pojo.vo.assessment.*;
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.SerialNumberUtils; import com.hungraim.ltc.util.SerialNumberUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -37,7 +39,13 @@ public class TaskServiceImpl implements TaskService { ...@@ -37,7 +39,13 @@ public class TaskServiceImpl implements TaskService {
@Autowired @Autowired
private TaskPushMapper taskPushMapper; private TaskPushMapper taskPushMapper;
@Autowired @Autowired
private TaskPushHisMapper taskPushHisMapper;
@Autowired
private CfgSrvDisableLevelMapper cfgSrvDisableLevelMapper; private CfgSrvDisableLevelMapper cfgSrvDisableLevelMapper;
@Autowired
private DisableInfoMapper disableInfoMapper;
@Autowired
private RefuseReasonMapper refuseReasonMapper;
@Override @Override
public IPage<TaskDistributionVO> taskDistributionList(String organId, String provincial, String city, public IPage<TaskDistributionVO> taskDistributionList(String organId, String provincial, String city,
...@@ -160,28 +168,35 @@ public class TaskServiceImpl implements TaskService { ...@@ -160,28 +168,35 @@ public class TaskServiceImpl implements TaskService {
return Result.failed("评定人员必须是组长!"); return Result.failed("评定人员必须是组长!");
} }
String[] taskIds = taskId.split(","); String[] taskIds = taskId.split(",");
Date assignTime = new Date();//任务分配日期 //任务分配日期
Date assignTime = new Date();
for (String id : taskIds) { for (String id : taskIds) {
ChAprTask task = taskMapper.selectById(id); ChAprTask task = taskMapper.selectById(id);
if (task == null) { if (task == null) {
return Result.failed("无效的taskId!"); return Result.failed("无效的taskId!");
} }
//更新评定任务信息
task.setAprEmpId(Integer.parseInt(empId)); task.setAprEmpId(Integer.parseInt(empId));
task.setAssignTime(assignTime); task.setAssignTime(assignTime);
int count = taskMapper.updateById(task); taskMapper.updateById(task);
if (count != 1) { //更新失能人员信息
return Result.failed("修改失败!"); ChDisableInfo chDisableInfo = disableInfoMapper.selectById(task.getDisableInfoId());
} chDisableInfo.setLastTaskId(task.getTaskId());
disableInfoMapper.updateById(chDisableInfo);
//生成组 //生成组
ChAprTaskPush taskPush = new ChAprTaskPush(); ChAprTaskPush taskPush = new ChAprTaskPush();
taskPush.setTime(new Date());
taskPush.setAssignTime(new Date()); taskPush.setAssignTime(new Date());
taskPush.setGroupNumber(SerialNumberUtils.getSerialNumber(empId)); taskPush.setGroupNumber(SerialNumberUtils.getSerialNumber(empId));
taskPush.setTaskId(Long.parseLong(id)); taskPush.setTaskId(Long.parseLong(id));
taskPush.setEmpId(Long.parseLong(empId)); taskPush.setEmpId(Long.parseLong(empId));
taskPush.setStatus((short) 1); taskPush.setStatus((short) 1);
taskPush.setIsManual((short) 1); taskPush.setIsManual((short) 1);
//生成分组历史
ChAprTaskPushHis pushHis = new ChAprTaskPushHis();
BeanUtils.copyProperties(taskPush, pushHis);
//插入分组数据
taskPushMapper.insert(taskPush); taskPushMapper.insert(taskPush);
taskPushHisMapper.insert(pushHis);
} }
return Result.success(); return Result.success();
} }
...@@ -192,12 +207,16 @@ public class TaskServiceImpl implements TaskService { ...@@ -192,12 +207,16 @@ public class TaskServiceImpl implements TaskService {
} }
@Override @Override
public Result<Object> taskGroup(Integer pushId, Integer status) { public Result<Object> taskGroup(Integer pushId, Integer status, Integer refuseReason, String refuseRemark) {
ChAprTaskPush chAprTaskPush = taskPushMapper.selectById(pushId); ChAprTaskPush chAprTaskPush = taskPushMapper.selectById(pushId);
if (chAprTaskPush == null) { if (chAprTaskPush == null) {
return Result.failed("不存在的组!"); return Result.failed("不存在的组!");
} }
chAprTaskPush.setStatus(status.shortValue()); chAprTaskPush.setStatus(status.shortValue());
if (status == 4 || status == 5 || status == 0) {
chAprTaskPush.setRefuseReason(refuseReason.shortValue());
chAprTaskPush.setRefuseRemark(refuseRemark);
}
taskPushMapper.updateById(chAprTaskPush); taskPushMapper.updateById(chAprTaskPush);
return Result.success(); return Result.success();
} }
...@@ -218,7 +237,7 @@ public class TaskServiceImpl implements TaskService { ...@@ -218,7 +237,7 @@ public class TaskServiceImpl implements TaskService {
} }
@Override @Override
public Result<Object> taskGroupByGroup(String groupNumber, Integer status) { public Result<Object> taskGroupByGroup(String groupNumber, Integer status, Integer refuseReason, String refuseRemark) {
List<ChAprTaskPush> pushList = taskPushMapper.selectList(new QueryWrapper<ChAprTaskPush>().eq("group_number", groupNumber)); List<ChAprTaskPush> pushList = taskPushMapper.selectList(new QueryWrapper<ChAprTaskPush>().eq("group_number", groupNumber));
if (pushList == null || pushList.size() <= 0) { if (pushList == null || pushList.size() <= 0) {
return Result.failed("不存在的组!"); return Result.failed("不存在的组!");
...@@ -230,8 +249,16 @@ public class TaskServiceImpl implements TaskService { ...@@ -230,8 +249,16 @@ public class TaskServiceImpl implements TaskService {
} }
} }
for (ChAprTaskPush push : pushList) { for (ChAprTaskPush push : pushList) {
//更新任务组状态
push.setStatus(status.shortValue()); push.setStatus(status.shortValue());
if (status == 4 || status == 5 || status == 0) {
push.setRefuseReason(refuseReason.shortValue());
push.setRefuseRemark(refuseRemark);
}
taskPushMapper.updateById(push); taskPushMapper.updateById(push);
//更新评定任务状态
ChAprTask chAprTask = taskMapper.selectById(push.getTaskId());
chAprTask.setTaskStatus(status);
} }
return Result.success(); return Result.success();
} }
...@@ -245,4 +272,24 @@ public class TaskServiceImpl implements TaskService { ...@@ -245,4 +272,24 @@ public class TaskServiceImpl implements TaskService {
public List<AllotTaskHisVO> allotTaskHisList() { public List<AllotTaskHisVO> allotTaskHisList() {
return taskMapper.allotTaskHisList(); return taskMapper.allotTaskHisList();
} }
@Override
public Result<Object> updatePushTimeAndRemark(String pushId, Date timeDate, String remark) {
ChAprTaskPush chAprTaskPush = taskPushMapper.selectById(pushId);
if (chAprTaskPush == null) {
return Result.failed("无效的分组id!");
}
chAprTaskPush.setTime(timeDate);
chAprTaskPush.setRefuseRemark(remark);
int i = taskPushMapper.updateById(chAprTaskPush);
if (i <= 0) {
return Result.failed("更新失败!");
}
return Result.success();
}
@Override
public List<ChRefuseReason> refuseReasonList() {
return refuseReasonMapper.selectList(new QueryWrapper<>());
}
} }
\ No newline at end of file
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
task.accept_time acceptTime, task.accept_time acceptTime,
task.finish_time finishTime, task.finish_time finishTime,
task.task_status taskStatus, task.task_status taskStatus,
push.refuse_reason refuseReason, reason.refuse_reason refuseReason,
push.refuse_remark refuseRemark push.refuse_remark refuseRemark
from CH_APR_TASK task from CH_APR_TASK task
left join ch_apr_organ organ on task.apr_organ_id = organ.apr_organ_id left join ch_apr_organ organ on task.apr_organ_id = organ.apr_organ_id
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
left join ch_apr_task_push push on task.task_id = push.task_id left join ch_apr_task_push push on task.task_id = push.task_id
left join ch_apr_task_emp cate on task.task_id = cate.task_id left join ch_apr_task_emp cate on task.task_id = cate.task_id
left join ch_apr_report report on report.TASK_ID = task.TASK_ID left join ch_apr_report report on report.TASK_ID = task.TASK_ID
left join ch_refuse_reason reason on push.refuse_reason = reason.refuse_reason_id
<where> <where>
<if test="organIds != null"> <if test="organIds != null">
and task.apr_organ_id in and task.apr_organ_id in
...@@ -233,6 +234,7 @@ ...@@ -233,6 +234,7 @@
<select id="taskGroupInfoList" resultType="com.hungraim.ltc.pojo.vo.assessment.TaskGroupInfoVO"> <select id="taskGroupInfoList" resultType="com.hungraim.ltc.pojo.vo.assessment.TaskGroupInfoVO">
select push.task_push_id taskPushId, select push.task_push_id taskPushId,
push.time time, push.time time,
push.assign_time assignTime,
push.Group_number groupNumber, push.Group_number groupNumber,
task.apr_organ_id aprOrganId, task.apr_organ_id aprOrganId,
organ.ORGAN_NAME organName, organ.ORGAN_NAME organName,
...@@ -252,13 +254,14 @@ ...@@ -252,13 +254,14 @@
emp.real_name empRealName, emp.real_name empRealName,
emp.certi_code empCertiCode, emp.certi_code empCertiCode,
push.status status, push.status status,
push.Refuse_reason refuseReason,/*拒绝原因*/ reason.Refuse_reason refuseReason,/*拒绝原因*/
push.Refuse_remark remark/*备注*/ push.Refuse_remark remark/*备注*/
from ch_apr_task_push push from ch_apr_task_push push
left join ch_apr_task task on push.task_id = task.task_id left join ch_apr_task task on push.task_id = task.task_id
left join CH_FND_ORGAN organ on organ.organ_id = task.organ_id left join CH_FND_ORGAN organ on organ.organ_id = task.organ_id
left join ch_disable_info disable on task.disable_info_id = disable.disab_info_id left join ch_disable_info disable on task.disable_info_id = disable.disab_info_id
left join ch_apr_emp emp on emp.emp_id = push.emp_id left join ch_apr_emp emp on emp.emp_id = push.emp_id
left join ch_refuse_reason reason on push.refuse_reason = reason.refuse_reason_id
where push.group_number = #{groupNumber} where push.group_number = #{groupNumber}
</select> </select>
......
...@@ -21,7 +21,7 @@ public class ChAprTaskPushHis implements Serializable { ...@@ -21,7 +21,7 @@ public class ChAprTaskPushHis implements Serializable {
/** /**
* 任务推送ID(年月日+串码6) * 任务推送ID(年月日+串码6)
*/ */
@TableId(type = IdType.INPUT) @TableId(value = "his_task_push_id", type = IdType.INPUT)
private Long hisTaskPushId; private Long hisTaskPushId;
/** /**
......
package com.hungraim.ltc.pojo.entity.assessment;
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 lombok.Data;
/**
* 拒绝原因基表:ch_refuse_reason
*/
@Data
@TableName("CH_REFUSE_REASON")
@KeySequence("SEQ_CH_REFUSE_REASON")
public class ChRefuseReason {
/**
* 拒绝原因id
*/
@TableId(value = "refuse_reason_id", type = IdType.INPUT)
private Integer refuseReasonId;
/**
* 拒绝原因名称
*/
private String refuseReason;
}
...@@ -15,11 +15,16 @@ public class TaskGroupInfoVO { ...@@ -15,11 +15,16 @@ public class TaskGroupInfoVO {
*/ */
private String taskPushId; private String taskPushId;
/** /**
* 分组日期 * 预约时间
*/ */
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8") @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date time; private Date time;
/** /**
* 分组日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date assignTime;
/**
* 组号 * 组号
*/ */
private String groupNumber; private String groupNumber;
......
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