Commit 8eeb22c5 authored by 蔡镇泽's avatar 蔡镇泽

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

parent 69f4afe1
package com.hungraim.ltc.pojo.vo.governance;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import java.util.Date;
/**
* 服务计划查询列表VO
*/
@Data
public class SrvTaskDetailVO {
/**
* 服务计划id
*/
private String srvTaskId;
/**
* 服务方案id
*/
private String programId;
/**
* 失能人员id
*/
private String disabInfoId;
/**
* 所在省市
*/
private String districtProvincial;
private String districtCity;
private String districtArea;
/**
* 失能人员姓名
*/
private String realName;
/**
* 手机号码
*/
private String tel;
/**
* 年龄
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date birthday;
/**
* 性别
*/
private String gender;
/**
* 诊断疾病
*/
private String disease;
/**
* 接受服务地址
*/
private String acptSrvProvincial;
private String acptSrvCity;
private String acptSrvArea;
private String acptSrvStreet;
/**
* 评定等级
*/
private String evaluateRatingType;
/**
* 评定完成日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date evaluateRafinishTimetingType;
/**
* 服务方式
*/
private String srvModeName;
/**
* 护理机构名称
*/
private String srvOrganName;
/**
* 护理服务人员
*/
private String empName;
/**
* 任务时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date srvDate;
/**
* 任务状态
*/
private String status;
}
......@@ -32,7 +32,7 @@ public class SrvTaskInfoVO implements Serializable {
*/
private String empTypeName;
/**
* 具体护理日期 yyyy-MM-dd(逗号分隔)
* 具体护理日期 yyyy-MM-dd
*/
private String taskDetails;
private String[] taskDetails;
}
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
* 服务计划制定列表VO
*/
@Data
public class SrvTaskVO extends PageInfo implements Serializable {
public class SrvTaskVO {
/**
* 服务计划id
*/
private Integer srvTaskId;
private String srvTaskId;
/**
* 服务方案id
*/
private Integer programId;
/**
* 失能人员id
*/
private Integer disabInfoId;
private String programId;
/**
* 所在省市
*/
......@@ -31,6 +25,10 @@ public class SrvTaskVO extends PageInfo implements Serializable {
private String districtCity;
private String districtArea;
/**
* 失能人员id
*/
private String disabInfoId;
/**
* 失能人员姓名
*/
private String realName;
......@@ -39,11 +37,6 @@ public class SrvTaskVO extends PageInfo implements Serializable {
*/
private String tel;
/**
* 年龄
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date birthday;
/**
* 性别
*/
private String gender;
......@@ -56,43 +49,16 @@ public class SrvTaskVO extends PageInfo implements Serializable {
*/
private String disableLevelName;
/**
* 接受服务地址
*/
private String acptSrvProvincial;
private String acptSrvCity;
private String acptSrvArea;
private String acptSrvStreet;
/**
* 评定等级
*/
private String evaluateRatingType;
/**
* 评定完成日期
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date evaluateRafinishTimetingType;
/**
* 服务方式
*/
private String srvModeName;
/**
* 护理机构名称
*/
private String srvOrganName;
/**
* 护理服务人员
*/
private String empName;
/**
* 任务时间
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date effTime;
/**
* 任务状态(服务计划状态)
*/
private String status;
/**
* 服务方案状态
*/
private String progStatus;
......@@ -100,10 +66,14 @@ public class SrvTaskVO extends PageInfo implements Serializable {
* 服务方案起始日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date srvStartTime;
private Date programDate;
/**
* 服务方案终止日
*/
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
private Date srvEndTime;
private Date programEdnDate;
/**
* 计划状态
*/
private String status;
}
......@@ -3,6 +3,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.util.DateUtils;
......@@ -53,7 +54,23 @@ public class SrvTaskController {
}
/**
* 服务计划、服务计划配置列表
* 服务计划制定列表
*
* @param organId 护理服务机构id
* @param disableName 失能人员姓名
* @param disableTel 失能人员手机号码
* @param status 服务计划状态
*/
@RequestMapping("/getSrvTaskList")
public Result<Page<SrvTaskVO>> getSrvTaskList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
Integer organId, String disableName, String disableTel, String status) {
Page<SrvTaskVO> page = new Page<>(pageNum, pageSize);
page = srvTaskService.getSrvTaskList(page, organId, disableName, disableTel, status);
return Result.success(page);
}
/**
* 服务计划查询列表
*
* @param organId 护理机构id
* @param disableName 失能人员姓名
......@@ -62,16 +79,16 @@ public class SrvTaskController {
* @param certifNum 护理人员证件号码
* @param startTime 服务计划开始时间
* @param endTime 服务计划结束时间
* @param status 任务状态(服务计划状态)
* @param status 任务状态
* @param modeId 服务方式
*/
@RequestMapping("/getSrvTaskList")
public Result<Page<SrvTaskVO>> getSrvTaskList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
@RequestMapping("/getSrvTaskDetailList")
public Result<Page<SrvTaskDetailVO>> getSrvTaskDetailList(@RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize,
Integer organId, String disableName, String disableTel,
String empName, String certifNum, String startTime, String endTime,
String status, String modeId) {
Page<SrvTaskVO> page = new Page<>(pageNum, pageSize);
page = srvTaskService.getSrvTaskList(page, organId, disableName, disableTel, empName, certifNum, startTime, endTime, status, modeId);
Page<SrvTaskDetailVO> page = new Page<>(pageNum, pageSize);
page = srvTaskService.getSrvTaskDetailList(page, organId, disableName, disableTel, empName, certifNum, startTime, endTime, status, modeId);
return Result.success(page);
}
......@@ -94,23 +111,22 @@ public class SrvTaskController {
*
* @param programId 服务方案id
* @param srvEmpId 护理人员id
* @param taskDetails 具体护理日期 yyyy-MM-dd(逗号分隔)
* @param taskDetails 具体护理日期 yyyy-MM-dd
*/
@RequestMapping("/addSrvTask")
public Result<Object> addSrvTask(Long programId, Long srvEmpId, String taskDetails) {
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 (StringUtils.isBlank(taskDetails)) {
if (taskDetails == null || taskDetails.length <= 0) {
return Result.failed("具体护理日期不能为空!");
}
try {
String[] details = taskDetails.split(",");
List<Date> dates = new ArrayList<>();
for (String detail : details) {
for (String detail : taskDetails) {
Date date = DateUtils.strToDate(detail);
dates.add(date);
}
......@@ -131,21 +147,19 @@ public class SrvTaskController {
* @param taskDetails 具体护理日期 yyyy-MM-dd(逗号分隔)
*/
@RequestMapping("/updateSrvTask")
public Result<Object> updateSrvTask(String taskId, Long srvEmpId, String taskDetails) {
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 (StringUtils.isBlank(taskDetails)) {
if (taskDetails == null || taskDetails.length <= 0) {
return Result.failed("具体护理日期不能为空!");
}
try {
String[] details = taskDetails.split(",");
List<Date> dates = new ArrayList<>();
for (String detail : details) {
for (String detail : taskDetails) {
Date date = DateUtils.strToDate(detail);
dates.add(date);
}
......
......@@ -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.serviceManage.ChSrvTask;
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 org.apache.ibatis.annotations.Mapper;
......@@ -15,11 +16,12 @@ import java.util.List;
@Repository
public interface SrvTaskMapper extends BaseMapper<ChSrvTask> {
Page<SrvTaskVO> getSrvTaskList(Page<SrvTaskVO> page, Integer organId, String disableName, String disableTel,
String empName, String certifNum, String startTime, String endTime,
String status, String modeId);
Page<SrvTaskVO> getSrvTaskList(Page<SrvTaskVO> page, Integer organId, String disableName, String disableTel, String status);
Page<SrvTaskDetailVO> getSrvTaskDetailList(Page<SrvTaskDetailVO> page, Integer organId, String disableName, String disableTel, String empName, String certifNum, String startTime, String endTime, String status, String modeId);
List<SrvTaskInfoVO> getSrvTaskInfoList(String programId);
Page<OrganEmpVO> getSrvOrganEmpList(Page<OrganEmpVO> page, String organId, String name, String certiType, String certifNum);
}
......@@ -2,6 +2,7 @@ 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.SrvTaskDetailVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskInfoVO;
import com.hungraim.ltc.pojo.vo.governance.SrvTaskVO;
import org.springframework.stereotype.Service;
......@@ -16,9 +17,7 @@ import java.util.List;
*/
@Service
public interface SrvTaskService {
Page<SrvTaskVO> getSrvTaskList(Page<SrvTaskVO> page, Integer organId, String disableName, String disableTel,
String empName, String certifNum, String startTime, String endTime,
String status, String modeId);
Page<SrvTaskVO> getSrvTaskList(Page<SrvTaskVO> page, Integer organId, String disableName, String disableTel, String status);
List<SrvTaskInfoVO> getSrvTaskInfoList(String programId);
......@@ -28,4 +27,6 @@ public interface SrvTaskService {
Page<OrganEmpVO> getSrvOrganEmpList(Page<OrganEmpVO> page, String organId, String name, String certiType, String certifNum);
Page<SrvTaskDetailVO> getSrvTaskDetailList(Page<SrvTaskDetailVO> page, Integer organId, String disableName, String disableTel, String empName, String certifNum, String startTime, String endTime, String status, String modeId);
}
......@@ -8,6 +8,7 @@ import com.hungraim.ltc.governance.service.SrvTaskService;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTask;
import com.hungraim.ltc.pojo.entity.serviceManage.ChSrvTaskDetail;
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.util.DateUtils;
......@@ -15,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
......@@ -29,7 +31,20 @@ public class SrvTaskServiceImpl implements SrvTaskService {
private ChSrvTaskDetailMapper chSrvTaskDetailMapper;
/**
* 服务计划列表
* 服务计划制定列表
*
* @param organId 护理服务机构id
* @param disableName 失能人员姓名
* @param disableTel 失能人员手机号码
* @param status 服务计划状态
*/
@Override
public Page<SrvTaskVO> getSrvTaskList(Page<SrvTaskVO> page, Integer organId, String disableName, String disableTel, String status) {
return srvTaskMapper.getSrvTaskList(page, organId, disableName, disableTel, status);
}
/**
* 服务计划查询列表
*
* @param organId 护理机构id
* @param disableName 失能人员姓名
......@@ -42,10 +57,8 @@ public class SrvTaskServiceImpl implements SrvTaskService {
* @param modeId 服务方式
*/
@Override
public Page<SrvTaskVO> getSrvTaskList(Page<SrvTaskVO> page, Integer organId, String disableName, String disableTel,
String empName, String certifNum, String startTime, String endTime,
String status, String modeId) {
return srvTaskMapper.getSrvTaskList(page, organId, disableName, disableTel, empName, certifNum, startTime, endTime, status, modeId);
public Page<SrvTaskDetailVO> getSrvTaskDetailList(Page<SrvTaskDetailVO> page, Integer organId, String disableName, String disableTel, String empName, String certifNum, String startTime, String endTime, String status, String modeId) {
return srvTaskMapper.getSrvTaskDetailList(page, organId, disableName, disableTel, empName, certifNum, startTime, endTime, status, modeId);
}
/**
......@@ -59,13 +72,13 @@ public class SrvTaskServiceImpl implements SrvTaskService {
//具体服务日期
for (SrvTaskInfoVO vo : srvTaskInfoList) {
List<ChSrvTaskDetail> taskDetails = chSrvTaskDetailMapper.selectList(new QueryWrapper<ChSrvTaskDetail>().eq("srv_task_id", vo.getSrvTaskId()));
StringBuilder sb = new StringBuilder();
List<String> srvDateList = new ArrayList<>();
for (ChSrvTaskDetail detail : taskDetails) {
Date srvDate = detail.getSrvDate();//服务日期
String s = DateUtils.dateToStryyyyMMdd(srvDate);
sb.append(s).append(",");
srvDateList.add(s);
}
vo.setTaskDetails(sb.toString());
vo.setTaskDetails(srvDateList.toArray(new String[0]));
}
return srvTaskInfoList;
}
......@@ -132,4 +145,5 @@ public class SrvTaskServiceImpl implements SrvTaskService {
public Page<OrganEmpVO> getSrvOrganEmpList(Page<OrganEmpVO> page, String organId, String name, String certiType, String certifNum) {
return srvTaskMapper.getSrvOrganEmpList(page, organId, name, certiType, certifNum);
}
}
......@@ -2,13 +2,75 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.hungraim.ltc.governance.dao.SrvTaskMapper">
<!--查询服务分配信息列表-->
<!--服务计划制定列表-->
<select id="getSrvTaskList" resultType="com.hungraim.ltc.pojo.vo.governance.SrvTaskVO">
select
--服务计划id
task.srv_task_id srvTaskId,
--服务方案id
task.program_id programId,
--所在省市
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.district_provincial = dis.DISTRICT_CODE) districtProvincial,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.district_city = dis.DISTRICT_CODE) districtCity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.DISTRICT_AREA = dis.DISTRICT_CODE) districtArea,
--失能人员id
disable.disab_info_id disabInfoId,
--失能人员姓名
disable.real_name realName,
--手机号码
disable.tel tel,
--性别
disable.gender gender,
--诊断疾病
disable.disease disease,
--失能等级
level1.disable_level_name disableLevelName,
--评定完成日期
aprtask.finish_time finishTime,
--任务时间
task.eff_time effTime,
--服务方案状态
program.prog_status progStatus,
--服务方案起始日
program.PROGRAM_DATE programDate,
--服务方案终止日
program.PROGRAM_EDN_DATE programEdnDate,
--计划状态
task.status status
from ch_srv_task task--服务计划
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--护理人员
left join ch_cfg_srv_disable_level level1 on report.disable_level_id = level1.disable_level_id--失能等级
--服务任务明细
left join ch_srv_task_detail detail on task.SRV_TASK_ID = detail.TASK_DETAIL_ID
<where>
<if test="organId != null">
and organ.SRV_ORGAN_ID = #{organId}
</if>
<if test="disableName != null and disableName != ''">
and disable.real_name = #{disableName}
</if>
<if test="disableTel != null and disableTel != ''">
and disable.tel = #{disableTel}
</if>
<if test="status != null and status != ''">
and task.status = #{status}
</if>
</where>
</select>
<!--服务计划查询列表-->
<select id="getSrvTaskDetailList" resultType="com.hungraim.ltc.pojo.vo.governance.SrvTaskDetailVO">
select
--服务计划id
task.srv_task_id srvTaskId,
--服务方案id
task.program_id programId,
--失能人员id
disable.disab_info_id disabInfoId,
--所在省市
......@@ -25,13 +87,11 @@
disable.gender gender,
--诊断疾病
disable.disease disease,
--失能等级
level1.disable_level_name disableLevelName,
--接受服务地址
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.acpt_srv_provincial = dis.DISTRICT_CODE) districtProvincial,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.acpt_srv_city = dis.DISTRICT_CODE) districtCity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.acpt_srv_area = dis.DISTRICT_CODE) districtArea,
(select STREET_NAME from CH_FND_STREET street where disable.acpt_srv_street = street.STREET_CODE) acptStreet,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.acpt_srv_provincial = dis.DISTRICT_CODE) acptSrvProvincial,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.acpt_srv_city = dis.DISTRICT_CODE) acptSrvCity,
(select DISTRICT_NAME from CH_FND_DISTRICT dis where disable.acpt_srv_area = dis.DISTRICT_CODE) acptSrvArea,
(select STREET_NAME from CH_FND_STREET street where disable.acpt_srv_street = street.STREET_CODE) acptSrvStreet,
--评定等级
report.evaluate_rating_type evaluateRatingType,
--评定完成日期
......@@ -43,16 +103,11 @@
--护理服务人员
emp.emp_name empName,
--任务时间
task.eff_time effTime,
--任务状态(服务计划状态)
task.status status,
--服务方案状态
program.prog_status progStatus,
--服务方案起始日
detail.srv_start_time srvStartTime,
--服务方案终止日
detail.srv_end_time srvEndTime
from ch_srv_task task--服务计划
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--服务计划
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--评定报告
......@@ -60,8 +115,8 @@
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--护理人员
left join ch_cfg_srv_disable_level level1 on report.disable_level_id = level1.disable_level_id--失能等级
left join ch_srv_task_detail detail on task.SRV_TASK_ID = detail.TASK_DETAIL_ID--服务任务明细
--失能等级
left join ch_cfg_srv_disable_level level1 on report.disable_level_id = level1.disable_level_id
<where>
<if test="organId != null">
and organ.SRV_ORGAN_ID = #{organId}
......@@ -79,10 +134,10 @@
and emp.certif_num = #{certifNum}
</if>
<if test="startTime != null and startTime != ''">
and detail.srv_start_time &lt;= #{startTime}
and detail.SRV_DATE &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
and detail.srv_end_time &gt;= #{endTime}
and detail.SRV_DATE &lt;;= #{endTime}
</if>
<if test="status != null and status != ''">
and task.status = #{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