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

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

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