Commit 166419ac authored by 蔡镇泽's avatar 蔡镇泽

查询服务计划制定详情列表

parent 8eeb22c5
package com.hungraim.ltc.pojo.vo.governance;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* 服务计划详情VO
*
* @author czz
*/
@Data
public class SrvTaskInfoListVO implements Serializable {
/**
* 服务方案id
*/
private String programId;
/**
* 失能人员id
*/
private String disabInfoId;
/**
* SrvTaskInfoVOs
*/
private List<SrvTaskInfoVO> taskList;
}
\ No newline at end of file
......@@ -12,6 +12,14 @@ import java.io.Serializable;
@Data
public class SrvTaskInfoVO implements Serializable {
/**
* 服务方案id
*/
private String programId;
/**
* 失能人员id
*/
private String disabInfoId;
/**
* 服务计划id
*/
private String srvTaskId;
......@@ -35,4 +43,8 @@ public class SrvTaskInfoVO implements Serializable {
* 具体护理日期 yyyy-MM-dd
*/
private String[] taskDetails;
}
/**
* 服务计划状态
*/
private String taskStatus;
}
\ No newline at end of file
......@@ -75,5 +75,5 @@ public class SrvTaskVO {
/**
* 计划状态
*/
private String status;
private String taskCount;
}
......@@ -2,10 +2,7 @@ package com.hungraim.ltc.governance.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.service.SrvTaskService;
import com.hungraim.ltc.pojo.vo.governance.OrganEmpVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskDetailVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskVO;
import com.hungraim.ltc.pojo.vo.governance.*;
import com.hungraim.ltc.util.DateUtils;
import com.hungraim.ltc.util.Result;
import lombok.extern.slf4j.Slf4j;
......@@ -98,77 +95,93 @@ public class SrvTaskController {
* @param programId 服务方案id
*/
@RequestMapping("/getSrvTaskInfo")
public Result<List<SrvTaskInfoVO>> getSrvTaskInfoList(String programId) {
public Result<SrvTaskInfoListVO> getSrvTaskInfoList(String programId) {
if (StringUtils.isBlank(programId)) {
return Result.failed("参数异常!");
}
List<SrvTaskInfoVO> taskInfos = srvTaskService.getSrvTaskInfoList(programId);
return Result.success(taskInfos);
List<SrvTaskInfoListVO> listVOS = new ArrayList<>();
SrvTaskInfoListVO taskInfoListVO = new SrvTaskInfoListVO();
if (taskInfos != null && taskInfos.size() > 0) {
taskInfoListVO.setProgramId(taskInfos.get(0).getProgramId());
taskInfoListVO.setDisabInfoId(taskInfos.get(0).getDisabInfoId());
taskInfoListVO.setTaskList(taskInfos);
}
return Result.success(taskInfoListVO);
}
/**
* 新增服务计划
*
* @param programId 服务方案id
* @param srvEmpId 护理人员id
* @param taskDetails 具体护理日期 yyyy-MM-dd
*/
@RequestMapping("/addSrvTask")
public Result<List<SrvTaskInfoVO>> addSrvTask(Long programId, Long srvEmpId, String[] taskDetails) {
if (programId == null) {
return Result.failed("服务方案id不能为空!");
}
if (srvEmpId == null) {
return Result.failed("护理人员id不能为空!");
}
if (taskDetails == null || taskDetails.length <= 0) {
return Result.failed("具体护理日期不能为空!");
public Result<List<SrvTaskInfoVO>> addSrvTask(SrvTaskInfoListVO param) {
String programId = param.getProgramId();
List<SrvTaskInfoVO> taskList = param.getTaskList();
if (StringUtils.isBlank(programId) || taskList == null || taskList.size() <= 0) {
return Result.failed("参数错误!");
}
try {
List<Date> dates = new ArrayList<>();
for (String detail : taskDetails) {
Date date = DateUtils.strToDate(detail);
dates.add(date);
for (int i = 0; i < taskList.size(); i++) {
SrvTaskInfoVO srvTaskInfoVO = taskList.get(i);
if (srvTaskInfoVO.getSrvEmpId() == null) {
return Result.failed("护理人员id不能为空!");
}
if (srvTaskInfoVO.getTaskDetails() == null || srvTaskInfoVO.getTaskDetails().length <= 0) {
return Result.failed("具体护理日期不能为空!");
}
List<Date> dates = new ArrayList<>();
for (String detail : srvTaskInfoVO.getTaskDetails()) {
Date date = DateUtils.strToDate(detail);
dates.add(date);
}
srvTaskService.addSrvTask(Long.parseLong(programId), Long.parseLong(srvTaskInfoVO.getSrvEmpId()), dates);
}
srvTaskService.addSrvTask(programId, srvEmpId, dates);
} catch (RuntimeException e) {
//添加失败
return Result.failed(e.getMessage());
}
//添加成功
return Result.success();
List<SrvTaskInfoVO> taskInfos = srvTaskService.getSrvTaskInfoList(programId);
return Result.success(taskInfos);
}
/**
* 修改服务计划
*
* @param taskId 服务计划id
* @param srvEmpId 护理人员id
* @param taskDetails 具体护理日期 yyyy-MM-dd(逗号分隔)
*/
@RequestMapping("/updateSrvTask")
public Result<Object> updateSrvTask(String taskId, Long srvEmpId, String[] taskDetails) {
if (taskId == null) {
return Result.failed("taskId不能为空!");
}
if (srvEmpId == null) {
return Result.failed("护理人员id不能为空!");
}
if (taskDetails == null || taskDetails.length <= 0) {
return Result.failed("具体护理日期不能为空!");
public Result<Object> updateSrvTask(SrvTaskInfoListVO param) {
String programId = param.getProgramId();
List<SrvTaskInfoVO> taskList = param.getTaskList();
if (StringUtils.isBlank(programId) || taskList == null || taskList.size() <= 0) {
return Result.failed("参数错误!");
}
try {
List<Date> dates = new ArrayList<>();
for (String detail : taskDetails) {
Date date = DateUtils.strToDate(detail);
dates.add(date);
for (int i = 0; i < taskList.size(); i++) {
String taskId = taskList.get(i).getSrvTaskId();
String srvEmpId = taskList.get(i).getSrvEmpId();
String[] taskDetails = taskList.get(i).getTaskDetails();
if (StringUtils.isBlank(taskId)) {
return Result.failed("taskId不能为空!");
}
if (StringUtils.isBlank(srvEmpId)) {
return Result.failed("护理人员id不能为空!");
}
if (taskDetails == null || taskDetails.length <= 0) {
return Result.failed("具体护理日期不能为空!");
}
List<Date> dates = new ArrayList<>();
for (String detail : taskDetails) {
Date date = DateUtils.strToDate(detail);
dates.add(date);
}
srvTaskService.updateSrvTask(taskId, Long.parseLong(srvEmpId), dates);
}
srvTaskService.updateSrvTask(taskId, srvEmpId, dates);
} catch (RuntimeException e) {
//修改失败
return Result.failed(e.getMessage());
}
//修改成功
return Result.success();
List<SrvTaskInfoVO> taskInfos = srvTaskService.getSrvTaskInfoList(programId);
return Result.success(taskInfos);
}
}
......@@ -36,12 +36,12 @@
--服务方案终止日
program.PROGRAM_EDN_DATE programEdnDate,
--计划状态
task.status status
from ch_srv_task task--服务计划
(select count(*) from ch_srv_task where program_id = program.PROGRAM_ID) taskCount
from ch_srv_program program--服务方案
left join ch_srv_task task on program.program_id = task.program_id--服务计划
left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员
left join ch_apr_task aprtask on disable.last_task_id = aprtask.task_id--评定任务
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
left join ch_srv_program program on task.program_id = program.program_id--服务方案
left join ch_srv_organ organ on program.srv_organ_id = organ.srv_organ_id--服务机构
left join ch_fnd_srv_mode mode1 on program.srv_mode_id = mode1.srv_mode_id--服务方式
left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_id--护理人员
......@@ -106,8 +106,8 @@
detail.SRV_DATE srvDate,
--任务状态
detail.status status
from ch_srv_task_detail detail--服务计划
left join ch_srv_task task on detail.srv_task_id = task.srv_task_id--服务计划
from ch_srv_task task--服务计划
left join ch_srv_task_detail detail on task.srv_task_id = detail.srv_task_id--服务计划详情
left join ch_disable_info disable on task.disab_info_id = disable.disab_info_id--失能人员
left join ch_apr_task aprtask on disable.last_task_id = aprtask.task_id--评定任务
left join ch_apr_report report on aprtask.task_id = report.task_id--评定报告
......@@ -150,7 +150,9 @@
<!--查询服务计划信息-->
<select id="getSrvTaskInfoList" resultType="com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO">
select task.srv_task_id srvTaskId,
select task.program_id programId,
task.disab_info_id disabInfoId,
task.srv_task_id programId,
--服务人员id
task.srv_emp_id srvEmpId,
--服务人员姓名
......@@ -158,7 +160,9 @@
--服务人员资质id
emp.emp_type_id empTypeId,
--服务人员资质名称
empType.emp_type_name empTypeName
empType.emp_type_name empTypeName,
--服务人员资质名称
task.STATUS taskStatus
from ch_srv_task task--服务计划
left join ch_srv_organ_emp emp on task.srv_emp_id = emp.emp_id--护理人员
left join ch_emp_type empType on emp.emp_type_id = empType.emp_type--护理人员资质
......
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