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;
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("/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;
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;
......@@ -20,20 +21,20 @@ public interface TaskService {
/**
* 评定任务分配列表
*
* @param organId 适用机构代码
* @param provincial 所在省
* @param city 所在市
* @param area 所在区域
* @param street 所在街道
* @param realName 失能人员姓名
* @param certiCode 失能人员身份证号码
* @param taskName 评定人员姓名
* @param taskTel 评定人员手机号码
* @param daysRemaining 评定剩余天数
* @param status 任务状态
* @param isReturn 是否退回
* @param pageNum 当前页
* @param pageSize 每页几条数据
* @param organId 适用机构代码
* @param provincial 所在省
* @param city 所在市
* @param area 所在区域
* @param street 所在街道
* @param realName 失能人员姓名
* @param certiCode 失能人员身份证号码
* @param taskName 评定人员姓名
* @param taskTel 评定人员手机号码
* @param daysRemaining 评定剩余天数
* @param status 任务状态
* @param isReturn 是否退回
* @param pageNum 当前页
* @param pageSize 每页几条数据
*/
IPage<TaskDistributionVO> taskDistributionList(String organId, String provincial, String city,
String street, String realName, String certiCode, String taskName, String taskTel,
......@@ -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 == null || chAprEmp.getGroupLeader() == null || 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
......@@ -84,17 +84,17 @@
</select>
<select id="taskReportList" resultType="com.hungraim.ltc.pojo.vo.assessment.TaskReportVO">
SELECT report.REPORT_ID reportId,
task.APR_ORGAN_ID organId,
organ.ORGAN_NAME organName,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE task.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) districtProvincial,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE task.DISTRICT_CITY = dis.DISTRICT_CODE) districPity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE task.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
info.REAL_NAME realName,
info.CERTI_CODE certiCode,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_F = DISE_TYPE_ID) diseTypeF,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_S = DISE_TYPE_ID) diseTypeS,
info.tel tel,
SELECT report.REPORT_ID reportId,
task.APR_ORGAN_ID organId,
organ.ORGAN_NAME organName,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE task.DISTRICT_PROVINCIAL = dis.DISTRICT_CODE) districtProvincial,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE task.DISTRICT_CITY = dis.DISTRICT_CODE) districPity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE task.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
info.REAL_NAME realName,
info.CERTI_CODE certiCode,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_F = DISE_TYPE_ID) diseTypeF,
(SELECT DISE_TYPE_CODE FROM CH_FND_DISEASE_TYPE WHERE info.DISE_TYPE_S = DISE_TYPE_ID) diseTypeS,
info.tel tel,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_PROVINCIAL = dis.DISTRICT_CODE) acptProvincial,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_CITY = dis.DISTRICT_CODE) acptCity,
(SELECT dis.DISTRICT_NAME FROM CH_FND_DISTRICT dis WHERE info.ACPT_AREA = dis.DISTRICT_CODE) acptArea,
......@@ -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.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 lombok.Data;
@Data
@TableName("CH_APR_EMP")
@KeySequence(value = "SEQ_CH_APR_EMP")
public class ChAprEmp {
@TableId(value = "emp_id", type = IdType.INPUT)
private Integer empId;
private Integer eduId;
private String aprempTypeNameF;
......
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 lombok.Data;
......@@ -7,10 +10,12 @@ import java.util.Date;
@Data
@TableName("CH_APR_REPORT_EVALUATE")
@KeySequence(value = "SEQ_CH_APR_REPORT_EVALUATE")
public class ChAprReportEvaluate {
/**
* 评定ID
*/
@TableId(value = "evaluate_id", type = IdType.INPUT)
private Integer evaluateId;
/**
......
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 lombok.Data;
@Data
@TableName("CH_APR_TASK")
@KeySequence(value = "SEQ_CH_APR_REPORT_EVALUATE")
public class ChAprTask {
@TableId(value = "task_id", type = IdType.INPUT)
private Integer taskId;
private java.util.Date assignTime;
private Integer taskStatus;
......
......@@ -21,7 +21,7 @@ public class ChAprTaskPush implements Serializable {
/**
* 任务推送ID(年月日+串码6)
*/
@TableId(type = IdType.INPUT)
@TableId(value = "task_push_id", type = IdType.INPUT)
private Long taskPushId;
/**
......
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 lombok.Data;
import java.util.Date;
@Data
@TableName("CH_CFG_APR_GROUP_DETAIL")
@KeySequence("SEQ_CH_APR_TASK_PUSH")
public class ChCfgAprGroupDetail {
/**
* 评定参数列表ID
*/
@TableId(value = "detail_id", type = IdType.INPUT)
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