|
@ -283,12 +283,12 @@ public class RehabilitationGuidanceService {
|
|
|
*
|
|
|
* @param patientCode 居民code
|
|
|
* @param doctorCode 专科医生code
|
|
|
* @param type 1康复指导2康复下转3复诊提醒4上门服务提醒5家签提醒
|
|
|
* @param type 1康复指导2康复下转3复诊提醒4上门服务提醒
|
|
|
* @param relationCode 业务关联code
|
|
|
* @param planId 计划id
|
|
|
* @throws Exception
|
|
|
*/
|
|
|
public void sendSpecialistWeixinMessage(String patientCode, String doctorCode, Integer type, String relationCode, String planId, String reservationType) throws Exception {
|
|
|
public void sendSpecialistWeixinMessage(String patientCode, String doctorCode, Integer type, String relationCode, String planId, Integer reservationType) throws Exception {
|
|
|
//康复指导
|
|
|
BasePatientDO patient = patientDao.findById(patientCode).orElse(null);
|
|
|
BaseDoctorDO doctor = doctorDao.findById(doctorCode).orElse(null);
|
|
@ -312,7 +312,6 @@ public class RehabilitationGuidanceService {
|
|
|
json.put("represented", patientCode);//被代理人
|
|
|
json.put("id", planId);
|
|
|
json.put("date", DateUtil.getStringDate());
|
|
|
// json.put("orgName", doctor.getHospitalName());
|
|
|
json.put("doctorName", doctor.getName());
|
|
|
json.put("content", "《" + rehabilitationguidanceDO.getTitle() + "》");
|
|
|
json.put("remark", "请及时阅读");
|
|
@ -340,23 +339,20 @@ public class RehabilitationGuidanceService {
|
|
|
} else if (type == 3) {
|
|
|
//复诊提醒3
|
|
|
//更新复诊类型
|
|
|
if (StringUtils.isNoneBlank(reservationType)) {
|
|
|
String updSql = "update wlyy_rehabilitation_plan_detail set reservation_type = " + reservationType + " where id = '" + relationCode + "'";
|
|
|
jdbcTemplate.execute(updSql);
|
|
|
ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(relationCode).orElse(null);
|
|
|
if(serviceItemPlanDO==null){
|
|
|
throw new ServiceException("参数错误:relationCode");
|
|
|
}
|
|
|
sendType = 11;//待办事项
|
|
|
String sql = "select pd.id,pd.execute_time as executeTime from wlyy_rehabilitation_plan_detail pd " +
|
|
|
"where pd.id ='" + relationCode + "' and pd.hospital_service_item_id='7' and pd.status <>1 order by pd.execute_time desc ";
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
String excuteTime = "";
|
|
|
if (mapList != null && mapList.size() != 0) {
|
|
|
excuteTime = DateUtil.dateToStrLong((Date) mapList.get(0).get("executeTime"));
|
|
|
if(!serviceItemPlanDO.getDoctor().equals(doctorCode)){
|
|
|
throw new ServiceException("不是您的任务,无法操作");
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(excuteTime)) {
|
|
|
json.put("first", patient.getName() + ",您好!您的下次复诊时间是[" + excuteTime + "],请按时安排就诊。您可点击“查看详情”,提前预约就诊");
|
|
|
} else {
|
|
|
json.put("first", patient.getName() + ",您好!" + doctor.getName() + "医生提醒您预约复诊。您可点击“查看详情”,提前预约就诊");
|
|
|
if("1".equals(serviceItemPlanDO.getStatus())){
|
|
|
throw new ServiceException("请勿重复提醒");
|
|
|
}
|
|
|
serviceItemPlanDO.setReservationType(reservationType);
|
|
|
rehabilitationManageService.completePlan(serviceItemPlanDO);
|
|
|
sendType = 11;//待办事项
|
|
|
json.put("first", patient.getName() + ",您好!" + doctor.getName() + "医生提醒您预约复诊。您可点击“查看详情”,提前预约就诊");
|
|
|
json.put("toUser", patientCode);
|
|
|
json.put("represented", patientCode);//被代理人
|
|
|
json.put("keyword1", "复诊预约");
|
|
@ -370,10 +366,8 @@ public class RehabilitationGuidanceService {
|
|
|
"where pd.id ='" + relationCode + "' and pd.hospital_service_item_id='4' and pd.status <>1 order by pd.execute_time desc ";
|
|
|
List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
|
|
|
String excuteTime = "";
|
|
|
String detailId = "";
|
|
|
if (mapList != null && mapList.size() != 0) {
|
|
|
excuteTime = DateUtil.dateToStrLong((Date) mapList.get(0).get("executeTime"));
|
|
|
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(excuteTime)) {
|
|
|
json.put("first", patient.getName() + ",您好!您的下次上门诊疗服务时间是[" + excuteTime + "],请按时预约上门诊疗服务。您可点击“查看详情”,提前预约就诊");
|
|
@ -392,7 +386,6 @@ public class RehabilitationGuidanceService {
|
|
|
if (StringUtils.isNotBlank(patient.getOpenid())) {
|
|
|
pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), sendType, patient.getOpenid(), patient.getName(), json);
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|