|
@ -1,5 +1,6 @@
|
|
|
package com.yihu.jw.hospital.module.rehabilitation.service;
|
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.yihu.fastdfs.FastDFSUtil;
|
|
@ -146,10 +147,10 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
public ObjEnvelop createRehabilitationTemplateDetail(List<RehabilitationTemplateDetailDO> details, String templateId) {
|
|
|
List<RehabilitationTemplateDetailDO> detailDOList = templateDetailDao.findTemplateDetailByTemplateId(templateId);
|
|
|
List<RehabilitationTemplateDetailDO> delList = new ArrayList<>();
|
|
|
Map<String,String> map = new HashMap<>();
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
for (RehabilitationTemplateDetailDO detail : details) {
|
|
|
if(StringUtils.isNotBlank(detail.getId())){
|
|
|
map.put(detail.getId(),"");
|
|
|
if (StringUtils.isNotBlank(detail.getId())) {
|
|
|
map.put(detail.getId(), "");
|
|
|
}
|
|
|
detail.setTemplateId(templateId);
|
|
|
detail.setCreateTime(new Date());
|
|
@ -160,12 +161,12 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
for (RehabilitationTemplateDetailDO detailDO:detailDOList){
|
|
|
if(!map.containsKey(detailDO.getId())){
|
|
|
for (RehabilitationTemplateDetailDO detailDO : detailDOList) {
|
|
|
if (!map.containsKey(detailDO.getId())) {
|
|
|
delList.add(detailDO);
|
|
|
}
|
|
|
}
|
|
|
if(delList.size()>0){
|
|
|
if (delList.size() > 0) {
|
|
|
templateDetailDao.deleteAll(delList);
|
|
|
}
|
|
|
return ObjEnvelop.getSuccess(SpecialistMapping.api_success, true);
|
|
@ -211,13 +212,13 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
return ObjEnvelop.getSuccess(SpecialistMapping.api_success, true);
|
|
|
}
|
|
|
|
|
|
public RehabilitationPlanTemplateDO findByTemplateId(String templateId){
|
|
|
public RehabilitationPlanTemplateDO findByTemplateId(String templateId) {
|
|
|
RehabilitationPlanTemplateDO templateDO = templateDao.findById(templateId).orElse(null);
|
|
|
List<RehabilitationTemplateDetailDO> list = templateDetailDao.findTemplateDetailByTemplateId(templateId);
|
|
|
List<RehabilitationServiceItemDO> itemDOList = serviceItemDao.findList();
|
|
|
if(itemDOList.size()>0){
|
|
|
Map<String,String> map = itemDOList.stream().collect(Collectors.toMap(RehabilitationServiceItemDO::getCode,RehabilitationServiceItemDO::getName));
|
|
|
for (RehabilitationTemplateDetailDO detailDO:list){
|
|
|
if (itemDOList.size() > 0) {
|
|
|
Map<String, String> map = itemDOList.stream().collect(Collectors.toMap(RehabilitationServiceItemDO::getCode, RehabilitationServiceItemDO::getName));
|
|
|
for (RehabilitationTemplateDetailDO detailDO : list) {
|
|
|
detailDO.setName(map.get(detailDO.getHospitalServiceItemId()));
|
|
|
}
|
|
|
}
|
|
@ -259,8 +260,8 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
/**
|
|
|
* 查询专病中心列表
|
|
|
*/
|
|
|
public MixEnvelop selectByCondition(String name, Integer page, Integer size){
|
|
|
String orderBy = " order by sort asc,create_time desc limit "+(page-1)*size+","+size;
|
|
|
public MixEnvelop selectByCondition(String name, Integer page, Integer size) {
|
|
|
String orderBy = " order by sort asc,create_time desc limit " + (page - 1) * size + "," + size;
|
|
|
String condition = " ";
|
|
|
String sql = "SELECT\n" +
|
|
|
"\tid,\n" +
|
|
@ -287,25 +288,26 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
"\trehabilitation_template_id 'rehabilitationTemplateId'\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_disease_hospital dh where dh.status='1' and rehabilitation_type='1' ";
|
|
|
if (StringUtils.isNoneBlank(name)){
|
|
|
condition +=" and name like '%"+name+"%' ";
|
|
|
if (StringUtils.isNoneBlank(name)) {
|
|
|
condition += " and name like '%" + name + "%' ";
|
|
|
}
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql+condition+orderBy);
|
|
|
String sqlCount ="select COUNT(1) as total from base_disease_hospital where 1=1 ";
|
|
|
Long count = jdbcTemplate.queryForObject(sqlCount+condition,Long.class);
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql + condition + orderBy);
|
|
|
String sqlCount = "select COUNT(1) as total from base_disease_hospital where 1=1 ";
|
|
|
Long count = jdbcTemplate.queryForObject(sqlCount + condition, Long.class);
|
|
|
return MixEnvelop.getSuccessListWithPage("success", list, page, size, count);
|
|
|
}
|
|
|
|
|
|
//创建康复计划
|
|
|
public PatientRehabilitationPlanDO createPatientRehabilitationPlan(PatientRehabilitationPlanDO planDO,List<RehabilitationDetailDO> details) {
|
|
|
public PatientRehabilitationPlanDO createPatientRehabilitationPlan(PatientRehabilitationPlanDO planDO, List<RehabilitationDetailDO> details) {
|
|
|
|
|
|
String sql = "SELECT t.plan_doctor,t.plan_doctor_name from wlyy_rehabilitation_plan_template t,base_disease_hospital d " +
|
|
|
"WHERE d.id='"+planDO.getDisease()+"' and t.id =d.rehabilitation_template_id ";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
if(list.size()>0){
|
|
|
planDO.setPlanDoctor(list.get(0).get("plan_doctor")+"");
|
|
|
planDO.setPlanDoctorName(list.get(0).get("plan_doctor_name")+"");
|
|
|
"WHERE d.id='" + planDO.getDisease() + "' and t.id =d.rehabilitation_template_id ";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
if (list.size() > 0) {
|
|
|
planDO.setPlanDoctor(list.get(0).get("plan_doctor") + "");
|
|
|
planDO.setPlanDoctorName(list.get(0).get("plan_doctor_name") + "");
|
|
|
}
|
|
|
System.out.println("111=>" + JSON.toJSONString(list));
|
|
|
PatientMedicalRecordsDO recordsDO = planDO.getMedicalRecordsDO();
|
|
|
String medicalRecordsCode = UUID.randomUUID().toString().replaceAll("-", "");
|
|
|
recordsDO.setCode(medicalRecordsCode);
|
|
@ -317,23 +319,24 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
recordsDO.setDiseaseName(planDO.getDiseaseName());
|
|
|
recordsDO.setCreateTime(new Date());
|
|
|
patientMedicalRecordsDao.save(recordsDO);
|
|
|
|
|
|
System.out.println("recordsDO==>" + JSON.toJSONString(recordsDO));
|
|
|
planDO.setMedicalRecordsCode(medicalRecordsCode);
|
|
|
String patientInfoCode = planDO.getPatientInfoCode();
|
|
|
|
|
|
planDO.setStatus(3);//待分配 执行医生和科室
|
|
|
|
|
|
planDO.setTitle(planDO.getName()+"的康复计划");
|
|
|
planDO.setTitle(planDO.getName() + "的康复计划");
|
|
|
planDO.setHealthStatusCode("2");
|
|
|
planDO.setPlanType(1);
|
|
|
planDO.setPayment(2);
|
|
|
planDO.setCreateTime(new Date());
|
|
|
planDO.setUpdateTime(new Date());
|
|
|
planDO = patientRehabilitationPlanDao.save(planDO);
|
|
|
System.out.println("planDO==>" + JSON.toJSONString(planDO));
|
|
|
System.out.println("-------------------");
|
|
|
List<RehabilitationDetailDO> detailDOList = new ArrayList<>();
|
|
|
for (RehabilitationDetailDO detailDO:details){
|
|
|
System.out.println("details==>" + JSON.toJSONString(details));
|
|
|
for (RehabilitationDetailDO detailDO : details) {
|
|
|
RehabilitationTemplateDetailDO templateDetailDO = templateDetailDao.findById(detailDO.getId()).orElse(null);
|
|
|
|
|
|
System.out.println("templateDetailDO==>" + templateDetailDO);
|
|
|
String frequency_code = templateDetailDO.getFrequencyCode();//频次
|
|
|
RehabilitationDetailDO detail = new RehabilitationDetailDO();
|
|
|
detail.setHospitalServiceItemId(templateDetailDO.getHospitalServiceItemId());
|
|
@ -351,10 +354,11 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
detailDOList.add(detail);
|
|
|
}
|
|
|
rehabilitationDetailDao.saveAll(detailDOList);
|
|
|
rehabilitationManageService.addPlanLog(planDO.getId(),planDO.getPlanDoctor(),planDO.getPlanDoctorName());
|
|
|
if(StringUtils.isNotBlank(patientInfoCode)){
|
|
|
rehabilitationManageService.addPlanLog(planDO.getId(), planDO.getPlanDoctor(), planDO.getPlanDoctorName());
|
|
|
if (StringUtils.isNotBlank(patientInfoCode)) {
|
|
|
RehabilitationPatientInfoDO infoDO = rehabilitationPatientInfoDao.findByCode(patientInfoCode);
|
|
|
if(StringUtils.isBlank(infoDO.getDiagnosis())){
|
|
|
System.out.println("infoDO==>" + infoDO);
|
|
|
if (StringUtils.isBlank(infoDO.getDiagnosis())) {
|
|
|
infoDO.setDept(recordsDO.getDept());
|
|
|
infoDO.setDeptName(recordsDO.getDeptName());
|
|
|
infoDO.setDiagnosis(recordsDO.getAdmittingDiagnosis());
|
|
@ -367,6 +371,7 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
rehabilitationPatientInfoDao.save(infoDO);
|
|
|
}
|
|
|
planDO.setDetailDOList(detailDOList);
|
|
|
System.out.println("创建完成");
|
|
|
return planDO;
|
|
|
}
|
|
|
|
|
@ -719,245 +724,245 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
// List<Frequency> list = jdbcTemplate.query(sql, new BeanPropertyRowMapper(Frequency.class));
|
|
|
// return ListEnvelop.getSuccess(SpecialistMapping.api_success, list);
|
|
|
String sql = " SELECT dict_code 'code',dict_value 'name' from wlyy_hospital_sys_dict WHERE dict_name = 'plan_frequency' ";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
return ListEnvelop.getSuccess(SpecialistMapping.api_success, list);
|
|
|
}
|
|
|
|
|
|
public List<String> getFrequencyDate(String code,String date,String unit,String time,Long timeType) throws ParseException {
|
|
|
public List<String> getFrequencyDate(String code, String date, String unit, String time, Long timeType) throws ParseException {
|
|
|
List<String> list = new ArrayList<>();
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
String nowDate = date+":00";
|
|
|
String nowDate = date + ":00";
|
|
|
Date date6 = DateUtil.strToDateLong(nowDate);
|
|
|
String date9 = sdf.format(date6)+" 09:00:00";//白天
|
|
|
String date21 = sdf.format(date6)+" 21:00:00";//白天
|
|
|
String date9s = DateUtil.getNextDay(date6,1)+" 09:00:00";//晚上
|
|
|
String date9 = sdf.format(date6) + " 09:00:00";//白天
|
|
|
String date21 = sdf.format(date6) + " 21:00:00";//白天
|
|
|
String date9s = DateUtil.getNextDay(date6, 1) + " 09:00:00";//晚上
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
if (unit.equalsIgnoreCase("D")&&!code.equalsIgnoreCase("qod")){
|
|
|
if (unit.equalsIgnoreCase("D") && !code.equalsIgnoreCase("qod")) {
|
|
|
String[] str = time.split(",");
|
|
|
for (int i=0;i<str.length;i++){
|
|
|
for (int i = 0; i < str.length; i++) {
|
|
|
Date date1 = sdf.parse(date);
|
|
|
calendar.setTime(date1);
|
|
|
String lastDay = sdf.format(calendar.getTime()) + " "+str[i];
|
|
|
String lastDay = sdf.format(calendar.getTime()) + " " + str[i];
|
|
|
list.add(lastDay);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("D")&&code.equalsIgnoreCase("qod")){
|
|
|
} else if (unit.equalsIgnoreCase("D") && code.equalsIgnoreCase("qod")) {
|
|
|
Date date1 = sdf.parse(date);
|
|
|
calendar.setTime(date1);
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) +1);
|
|
|
String lastDay = sdf.format(calendar.getTime()) + " "+time;
|
|
|
calendar.set(Calendar.DATE, calendar.get(Calendar.DATE) + 1);
|
|
|
String lastDay = sdf.format(calendar.getTime()) + " " + time;
|
|
|
list.add(lastDay);
|
|
|
}else if (unit.equalsIgnoreCase("H")&&code.equalsIgnoreCase("q0.5h")){
|
|
|
} else if (unit.equalsIgnoreCase("H") && code.equalsIgnoreCase("q0.5h")) {
|
|
|
Date date1 = sdf.parse(date);
|
|
|
calendar.setTime(date1);
|
|
|
String endTime = null;
|
|
|
String lastDay = null;
|
|
|
if (timeType == 0){
|
|
|
if (timeType == 0) {
|
|
|
lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
endTime = sdf.format(calendar.getTime()) + " 23:59:59";
|
|
|
}else if ( timeType == 1){
|
|
|
} else if (timeType == 1) {
|
|
|
lastDay = date9;
|
|
|
endTime = date21;
|
|
|
}else if (timeType == 2){
|
|
|
} else if (timeType == 2) {
|
|
|
lastDay = date21;
|
|
|
endTime = date9s;
|
|
|
}
|
|
|
Date date2 = sdf1.parse(lastDay);
|
|
|
Date date3 = sdf1.parse(endTime);
|
|
|
Long time1 = date2.getTime();
|
|
|
for (int i=0;i<47;i++){
|
|
|
time1 += 30*60*1000;
|
|
|
for (int i = 0; i < 47; i++) {
|
|
|
time1 += 30 * 60 * 1000;
|
|
|
String day = sdf1.format(time1);
|
|
|
Date date4 = sdf1.parse(day);
|
|
|
if (date4.compareTo(date3)==-1 || date4.compareTo(date3) == 0){
|
|
|
if (date4.compareTo(date3) == -1 || date4.compareTo(date3) == 0) {
|
|
|
list.add(day);
|
|
|
}
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("H")&& code.equalsIgnoreCase("q2h")){
|
|
|
} else if (unit.equalsIgnoreCase("H") && code.equalsIgnoreCase("q2h")) {
|
|
|
Date date1 = sdf.parse(date);
|
|
|
calendar.setTime(date1);
|
|
|
/* String lastDay = sdf.format(calendar.getTime()) + " 00:00:00";*/
|
|
|
String endTime = null;
|
|
|
String lastDay = null;
|
|
|
if (timeType == 0){
|
|
|
if (timeType == 0) {
|
|
|
lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
endTime = sdf.format(calendar.getTime()) + " 23:59:59";
|
|
|
}else if ( timeType == 1){
|
|
|
} else if (timeType == 1) {
|
|
|
lastDay = date9;
|
|
|
endTime = date21;
|
|
|
}else if (timeType == 2){
|
|
|
} else if (timeType == 2) {
|
|
|
lastDay = date21;
|
|
|
endTime = date9s;
|
|
|
}
|
|
|
Date date2 = sdf1.parse(lastDay);
|
|
|
Date date3 = sdf1.parse(endTime);
|
|
|
calendar.setTime(date2);
|
|
|
for (int i=0;i<11;i++){
|
|
|
calendar.set(Calendar.HOUR,calendar.get(Calendar.HOUR)+2);
|
|
|
for (int i = 0; i < 11; i++) {
|
|
|
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 2);
|
|
|
Date date4 = sdf1.parse(sdf1.format(calendar.getTime()));
|
|
|
System.out.print(sdf1.format(calendar.getTime()));
|
|
|
if (date4.compareTo(date3)==-1||date4.compareTo(date3) == 0){
|
|
|
if (date4.compareTo(date3) == -1 || date4.compareTo(date3) == 0) {
|
|
|
list.add(sdf1.format(calendar.getTime()));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}else if (unit.equalsIgnoreCase("H")&&code.equalsIgnoreCase("q3h")){
|
|
|
} else if (unit.equalsIgnoreCase("H") && code.equalsIgnoreCase("q3h")) {
|
|
|
Date date1 = sdf.parse(date);
|
|
|
calendar.setTime(date1);
|
|
|
//String lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
String endTime = null;
|
|
|
String lastDay = null;
|
|
|
if (timeType == 0){
|
|
|
if (timeType == 0) {
|
|
|
lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
endTime = sdf.format(calendar.getTime()) + " 23:59:59";
|
|
|
}else if ( timeType == 1){
|
|
|
} else if (timeType == 1) {
|
|
|
lastDay = date9;
|
|
|
endTime = date21;
|
|
|
}else if (timeType == 2){
|
|
|
} else if (timeType == 2) {
|
|
|
lastDay = date21;
|
|
|
endTime = date9s;
|
|
|
}
|
|
|
Date date2 = sdf1.parse(lastDay);
|
|
|
Date date3 = sdf1.parse(endTime);
|
|
|
calendar.setTime(date2);
|
|
|
for (int i=0;i<7;i++){
|
|
|
calendar.set(Calendar.HOUR,calendar.get(Calendar.HOUR)+3);
|
|
|
for (int i = 0; i < 7; i++) {
|
|
|
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 3);
|
|
|
Date date4 = sdf1.parse(sdf1.format(calendar.getTime()));
|
|
|
if (date4.compareTo(date3)==-1||date4.compareTo(date3) == 0){
|
|
|
if (date4.compareTo(date3) == -1 || date4.compareTo(date3) == 0) {
|
|
|
list.add(sdf1.format(calendar.getTime()));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("H")&&code.equalsIgnoreCase("q4h")){
|
|
|
} else if (unit.equalsIgnoreCase("H") && code.equalsIgnoreCase("q4h")) {
|
|
|
Date date1 = sdf.parse(date);
|
|
|
calendar.setTime(date1);
|
|
|
//String lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
String endTime = null;
|
|
|
String lastDay = null;
|
|
|
if (timeType == 0){
|
|
|
if (timeType == 0) {
|
|
|
lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
endTime = sdf.format(calendar.getTime()) + " 23:59:59";
|
|
|
}else if ( timeType == 1){
|
|
|
} else if (timeType == 1) {
|
|
|
lastDay = date9;
|
|
|
endTime = date21;
|
|
|
}else if (timeType == 2){
|
|
|
} else if (timeType == 2) {
|
|
|
lastDay = date21;
|
|
|
endTime = date9s;
|
|
|
}
|
|
|
Date date2 = sdf1.parse(lastDay);
|
|
|
Date date3 = sdf1.parse(endTime);
|
|
|
calendar.setTime(date2);
|
|
|
for (int i=0;i<5;i++){
|
|
|
calendar.set(Calendar.HOUR,calendar.get(Calendar.HOUR)+4);
|
|
|
for (int i = 0; i < 5; i++) {
|
|
|
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 4);
|
|
|
Date date4 = sdf1.parse(sdf1.format(calendar.getTime()));
|
|
|
if (date4.compareTo(date3)==-1||date4.compareTo(date3) == 0){
|
|
|
if (date4.compareTo(date3) == -1 || date4.compareTo(date3) == 0) {
|
|
|
list.add(sdf1.format(calendar.getTime()));
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("H")&&code.equalsIgnoreCase("qh")){
|
|
|
} else if (unit.equalsIgnoreCase("H") && code.equalsIgnoreCase("qh")) {
|
|
|
Date date1 = sdf.parse(date);
|
|
|
calendar.setTime(date1);
|
|
|
//String lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
String endTime = null;
|
|
|
String lastDay = null;
|
|
|
if (timeType == 0){
|
|
|
if (timeType == 0) {
|
|
|
lastDay = sdf.format(calendar.getTime()) + " 00:00:00";
|
|
|
endTime = sdf.format(calendar.getTime()) + " 23:59:59";
|
|
|
}else if ( timeType == 1){
|
|
|
} else if (timeType == 1) {
|
|
|
lastDay = date9;
|
|
|
endTime = date21;
|
|
|
}else if (timeType == 2){
|
|
|
} else if (timeType == 2) {
|
|
|
lastDay = date21;
|
|
|
endTime = date9s;
|
|
|
}
|
|
|
Date date2 = sdf1.parse(lastDay);
|
|
|
Date date3 = sdf1.parse(endTime);
|
|
|
calendar.setTime(date2);
|
|
|
for (int i=0;i<23;i++){
|
|
|
calendar.set(Calendar.HOUR,calendar.get(Calendar.HOUR)+1);
|
|
|
for (int i = 0; i < 23; i++) {
|
|
|
calendar.set(Calendar.HOUR, calendar.get(Calendar.HOUR) + 1);
|
|
|
Date date4 = sdf1.parse(sdf1.format(calendar.getTime()));
|
|
|
if (date4.compareTo(date3)==-1||date4.compareTo(date3) == 0){
|
|
|
if (date4.compareTo(date3) == -1 || date4.compareTo(date3) == 0) {
|
|
|
list.add(sdf1.format(calendar.getTime()));
|
|
|
}
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("qw_1")){
|
|
|
String date2 = DateUtil.getWeek(date,"1")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("qw_1")) {
|
|
|
String date2 = DateUtil.getWeek(date, "1") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("qw_2")){
|
|
|
String date2 = DateUtil.getWeek(date,"2")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("qw_2")) {
|
|
|
String date2 = DateUtil.getWeek(date, "2") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("qw_3")){
|
|
|
String date2 = DateUtil.getWeek(date,"3")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("qw_3")) {
|
|
|
String date2 = DateUtil.getWeek(date, "3") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("qw_4")){
|
|
|
String date2 = DateUtil.getWeek(date,"4")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("qw_4")) {
|
|
|
String date2 = DateUtil.getWeek(date, "4") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("qw_5")){
|
|
|
String date2 = DateUtil.getWeek(date,"5")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("qw_5")) {
|
|
|
String date2 = DateUtil.getWeek(date, "5") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("qw_6")){
|
|
|
String date2 = DateUtil.getWeek(date,"6")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("qw_6")) {
|
|
|
String date2 = DateUtil.getWeek(date, "6") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("qw_7")){
|
|
|
String date2 = DateUtil.getWeek(date,"7")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("qw_7")) {
|
|
|
String date2 = DateUtil.getWeek(date, "7") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("tiw135")){
|
|
|
String date2 = DateUtil.getWeek(date,"1")+" 08:00:00";
|
|
|
String date4 = DateUtil.getWeek(date,"3")+" 08:00:00";
|
|
|
String date5 = DateUtil.getWeek(date,"5")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("tiw135")) {
|
|
|
String date2 = DateUtil.getWeek(date, "1") + " 08:00:00";
|
|
|
String date4 = DateUtil.getWeek(date, "3") + " 08:00:00";
|
|
|
String date5 = DateUtil.getWeek(date, "5") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
if (date4.compareTo(date3)==1){
|
|
|
if (date4.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
if (date5.compareTo(date3) == 1){
|
|
|
if (date5.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}else if (unit.equalsIgnoreCase("W")&&code.equalsIgnoreCase("tiw246")){
|
|
|
String date2 = DateUtil.getWeek(date,"2")+" 08:00:00";
|
|
|
String date4 = DateUtil.getWeek(date,"4")+" 08:00:00";
|
|
|
String date5 = DateUtil.getWeek(date,"6")+" 08:00:00";
|
|
|
} else if (unit.equalsIgnoreCase("W") && code.equalsIgnoreCase("tiw246")) {
|
|
|
String date2 = DateUtil.getWeek(date, "2") + " 08:00:00";
|
|
|
String date4 = DateUtil.getWeek(date, "4") + " 08:00:00";
|
|
|
String date5 = DateUtil.getWeek(date, "6") + " 08:00:00";
|
|
|
Date date1 = new Date();
|
|
|
String date3 = sdf1.format(date1);
|
|
|
if (date2.compareTo(date3)==1){
|
|
|
if (date2.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
if (date4.compareTo(date3)==1){
|
|
|
if (date4.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
if (date5.compareTo(date3) == 1){
|
|
|
if (date5.compareTo(date3) == 1) {
|
|
|
list.add(date2);
|
|
|
}
|
|
|
}
|
|
@ -966,28 +971,29 @@ public class RehabilitationPlanService extends BaseJpaService<RehabilitationPlan
|
|
|
|
|
|
/**
|
|
|
* 获取康复计划修改记录
|
|
|
*
|
|
|
* @param planId
|
|
|
* @return
|
|
|
*/
|
|
|
public List<Map<String,Object>> getRehabilitationPlanLog(String planId){
|
|
|
String sql ="select date_format(a.create_time, '%Y-%m-%d %H:%i:%s') 'createTime', a.* " +
|
|
|
public List<Map<String, Object>> getRehabilitationPlanLog(String planId) {
|
|
|
String sql = "select date_format(a.create_time, '%Y-%m-%d %H:%i:%s') 'createTime', a.* " +
|
|
|
"from wlyy_patient_rehabilitation_plan_log a " +
|
|
|
"where a.plan_id = '"+planId+"' ORDER BY a.create_time DESC";
|
|
|
List<Map<String,Object>> planLogList = jdbcTemplate.queryForList(sql);
|
|
|
"where a.plan_id = '" + planId + "' ORDER BY a.create_time DESC";
|
|
|
List<Map<String, Object>> planLogList = jdbcTemplate.queryForList(sql);
|
|
|
return planLogList;
|
|
|
}
|
|
|
|
|
|
public List<Map<String, Object>> getRehabilitationDetailItemByPatient(String patientId, String planId) {
|
|
|
String sql="SELECT\n" +
|
|
|
String sql = "SELECT\n" +
|
|
|
" b.title 'planTitle', c.`name` 'itemName' ,b.`status` 'planStatus',a.* \n" +
|
|
|
"FROM\n" +
|
|
|
" wlyy_rehabilitation_plan_detail a\n" +
|
|
|
" INNER JOIN wlyy_patient_rehabilitation_plan b ON a.plan_id=b.id\n" +
|
|
|
" INNER JOIN wlyy_rehabilitation_service_item c ON a.hospital_service_item_id=c.`id`\n" +
|
|
|
" WHERE 1=1 \n" +
|
|
|
" AND a.plan_id='"+planId+"'\n" +
|
|
|
" AND b.patient='"+patientId+"' ";
|
|
|
List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
" AND a.plan_id='" + planId + "'\n" +
|
|
|
" AND b.patient='" + patientId + "' ";
|
|
|
List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
|
|
|
return list;
|
|
|
}
|
|
|
|