Commit 5c42fe63 authored by 蔡镇泽's avatar 蔡镇泽

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

parent 7ad7c1bf
package com.hungraim.ltc.pojo.vo.governance;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.hungraim.ltc.pojo.entity.PageInfo;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* 服务计划详情VO
*
* @author czz
*/
@Data
public class SrvTaskInfoVO extends PageInfo implements Serializable {
public class SrvTaskInfoVO implements Serializable {
/**
* 服务计划id
*/
private String srvTaskId;
/**
* 服务计划明细id
* 服务人员id
*/
private String taskDetailId;
private String srvEmpId;
/**
* 服务人员姓名
*/
private String empName;
/**
* 服务方案起始日
* 服务人员资质id
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date srvStartTime;
private String empTypeId;
/**
* 服务方案终止日
* 服务人员资质名称
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date srvEndTime;
private String empTypeName;
/**
* 具体护理日期 yyyy-MM-dd(逗号分隔)
*/
private String taskDetails;
}
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.SrvTaskInfoVO;
......@@ -10,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
......@@ -30,18 +32,28 @@ public class SrvTaskController {
/**
* 查询护理机构人员列表
*
* @param pageNum 页码
* @param pageSize 每页大小
* @param organId 护理服务机构id
* @param name 护理人员姓名
* @param certiType 护理人员证件类型
* @param certifNum 护理人员证件号码
*/
@RequestMapping("/getSrvOrganEmpList")
public Result<List<OrganEmpVO>> getSrvOrganEmpList(String organId, String name, String certiType, String certifNum) {
public Result<Page<OrganEmpVO>> getSrvOrganEmpList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
String organId, String name, String certiType, String certifNum) {
if (StringUtils.isBlank(organId)) {
return Result.failed("护理服务机构不能为空!");
return Result.failed("参数异常!");
}
List<OrganEmpVO> organEmps = srvTaskService.getSrvOrganEmpList(organId, name, certiType, certifNum);
return Result.success(organEmps);
if (pageNum == null) {
pageNum = 1;
}
if (pageSize == null) {
pageSize = 10;
}
Page<OrganEmpVO> page = new Page<>(pageNum, pageSize);
page = srvTaskService.getSrvOrganEmpList(page, organId, name, certiType, certifNum);
return Result.success(page);
}
/**
......@@ -66,17 +78,17 @@ public class SrvTaskController {
}
/**
* 查询服务计划制定详情
* 查询服务计划制定详情列表
*
* @param taskId 服务计划id
* @param programId 服务方案id
*/
@RequestMapping("/getSrvTaskInfo")
public Result<SrvTaskInfoVO> getSrvTaskInfo(String taskId) {
if (StringUtils.isBlank(taskId)) {
return Result.failed("taskId不能为空!");
public Result<List<SrvTaskInfoVO>> getSrvTaskInfoList(String programId) {
if (StringUtils.isBlank(programId)) {
return Result.failed("参数异常!");
}
SrvTaskInfoVO taskInfo = srvTaskService.getSrvTaskInfo(taskId);
return Result.success(taskInfo);
List<SrvTaskInfoVO> taskInfos = srvTaskService.getSrvTaskInfoList(programId);
return Result.success(taskInfos);
}
/**
......
package com.hungraim.ltc.governance.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask;
import com.hungraim.ltc.pojo.vo.governance.OrganEmpVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO;
......@@ -18,7 +19,7 @@ public interface SrvTaskMapper extends BaseMapper<ChSrvTask> {
String empName, String certifNum, String startTime, String endTime,
String status, String modeId);
SrvTaskInfoVO getSrvTaskInfo(String taskId);
List<SrvTaskInfoVO> getSrvTaskInfoList(String programId);
List<OrganEmpVO> getSrvOrganEmpList(String organId, String name, String certiType, String certifNum);
Page<OrganEmpVO> getSrvOrganEmpList(Page<OrganEmpVO> page, String organId, String name, String certiType, String certifNum);
}
package com.hungraim.ltc.governance.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.pojo.vo.governance.OrganEmpVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskVO;
......@@ -19,12 +20,12 @@ public interface SrvTaskService {
String empName, String certifNum, String startTime, String endTime,
String status, String modeId);
SrvTaskInfoVO getSrvTaskInfo(String taskId);
List<SrvTaskInfoVO> getSrvTaskInfoList(String programId);
void addSrvTask(Long programId, Long srvEmpId, Date startTime, Date endTime);
void updateSrvTask(String taskId, Long srvEmpId, Date startTime, Date endTime);
List<OrganEmpVO> getSrvOrganEmpList(String organId, String name, String certiType, String certifNum);
Page<OrganEmpVO> getSrvOrganEmpList(Page<OrganEmpVO> page, String organId, String name, String certiType, String certifNum);
}
package com.hungraim.ltc.governance.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hungraim.ltc.governance.dao.ChOrganEmpMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hungraim.ltc.governance.dao.ChSrvTaskDetailMapper;
import com.hungraim.ltc.governance.dao.SrvTaskMapper;
import com.hungraim.ltc.governance.service.SrvTaskService;
......@@ -10,6 +10,7 @@ import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
import com.hungraim.ltc.pojo.vo.governance.OrganEmpVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskVO;
import com.hungraim.ltc.util.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -26,8 +27,6 @@ public class SrvTaskServiceImpl implements SrvTaskService {
private SrvTaskMapper srvTaskMapper;
@Autowired
private ChSrvTaskDetailMapper chSrvTaskDetailMapper;
@Autowired
private ChOrganEmpMapper chOrganEmpMapper;
/**
* 服务计划列表
......@@ -52,11 +51,23 @@ public class SrvTaskServiceImpl implements SrvTaskService {
/**
* 查询服务计划制定详情
*
* @param taskId 服务计划id
* @param programId 服务方案id
*/
@Override
public SrvTaskInfoVO getSrvTaskInfo(String taskId) {
return srvTaskMapper.getSrvTaskInfo(taskId);
public List<SrvTaskInfoVO> getSrvTaskInfoList(String programId) {
List<SrvTaskInfoVO> srvTaskInfoList = srvTaskMapper.getSrvTaskInfoList(programId);
//具体服务日期
for (SrvTaskInfoVO vo : srvTaskInfoList) {
List<ChSrvTaskDetail> taskDetails = chSrvTaskDetailMapper.selectList(new QueryWrapper<ChSrvTaskDetail>().eq("srv_task_id", vo.getSrvTaskId()));
StringBuilder sb = new StringBuilder();
for (ChSrvTaskDetail detail : taskDetails) {
Date srvDate = detail.getSrvDate();//服务日期
String s = DateUtils.dateToStryyyyMMdd(srvDate);
sb.append(s).append(",");
}
vo.setTaskDetails(sb.toString());
}
return srvTaskInfoList;
}
@Transactional(rollbackFor = Exception.class)
......@@ -112,7 +123,7 @@ public class SrvTaskServiceImpl implements SrvTaskService {
}
@Override
public List<OrganEmpVO> getSrvOrganEmpList(String organId, String name, String certiType, String certifNum) {
return srvTaskMapper.getSrvOrganEmpList(organId, name, certiType, certifNum);
public Page<OrganEmpVO> getSrvOrganEmpList(Page<OrganEmpVO> page, String organId, String name, String certiType, String certifNum) {
return srvTaskMapper.getSrvOrganEmpList(page, organId, name, certiType, certifNum);
}
}
......@@ -94,22 +94,20 @@
</select>
<!--查询服务计划信息-->
<select id="getSrvTaskInfo" resultType="com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO">
<select id="getSrvTaskInfoList" resultType="com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO">
select task.srv_task_id srvTaskId,
detail.task_detail_id taskDetailId,
--服务人员id
task.srv_emp_id srvEmpId,
--服务人员姓名
emp.EMP_NAME empName,
--服务人员资质
empType.emp_type_name empTypeName,
--服务方案起始日
detail.srv_start_time srvStartTime,
--服务方案终止日
detail.srv_end_time srvEndTime
emp.emp_name empName,
--服务人员资质id
emp.emp_type_id empTypeId,
--服务人员资质名称
empType.emp_type_name empTypeName
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--护理人员资质
left join ch_srv_task_detail detail on task.srv_task_id = detail.task_detail_id--服务任务明细
where task.SRV_TASK_ID = #{taskId}
left join ch_emp_type empType on emp.emp_type_id = empType.emp_type--护理人员资质
where task.program_id = #{programId}
</select>
<!--查询护理机构人员列表-->
......
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