|  | @ -1,6 +1,7 @@
 | 
												
													
														
															|  | package com.yihu.wlyy.service.third.guahao;
 |  | package com.yihu.wlyy.service.third.guahao;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | import com.fasterxml.jackson.databind.ObjectMapper;
 |  | import com.fasterxml.jackson.databind.ObjectMapper;
 | 
												
													
														
															|  | 
 |  | import com.yihu.wlyy.entity.doctor.DoctorMapping;
 | 
												
													
														
															|  | import com.yihu.wlyy.entity.doctor.profile.Doctor;
 |  | import com.yihu.wlyy.entity.doctor.profile.Doctor;
 | 
												
													
														
															|  | import com.yihu.wlyy.entity.doctor.survey.SurveyScreenResult;
 |  | import com.yihu.wlyy.entity.doctor.survey.SurveyScreenResult;
 | 
												
													
														
															|  | import com.yihu.wlyy.entity.message.Message;
 |  | import com.yihu.wlyy.entity.message.Message;
 | 
												
											
												
													
														
															|  | @ -8,6 +9,7 @@ import com.yihu.wlyy.entity.patient.Patient;
 | 
												
													
														
															|  | import com.yihu.wlyy.entity.patient.PatientReservation;
 |  | import com.yihu.wlyy.entity.patient.PatientReservation;
 | 
												
													
														
															|  | import com.yihu.wlyy.entity.patient.SignFamily;
 |  | import com.yihu.wlyy.entity.patient.SignFamily;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.doctor.DoctorDao;
 |  | import com.yihu.wlyy.repository.doctor.DoctorDao;
 | 
												
													
														
															|  | 
 |  | import com.yihu.wlyy.repository.doctor.DoctorMappingDao;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.doctor.SurveyScreenResultDao;
 |  | import com.yihu.wlyy.repository.doctor.SurveyScreenResultDao;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.message.MessageDao;
 |  | import com.yihu.wlyy.repository.message.MessageDao;
 | 
												
													
														
															|  | import com.yihu.wlyy.repository.organization.HospitalMappingDao;
 |  | import com.yihu.wlyy.repository.organization.HospitalMappingDao;
 | 
												
											
												
													
														
															|  | @ -84,6 +86,9 @@ public class GuahaoXMService extends BaseService implements IGuahaoService {
 | 
												
													
														
															|  |     @Autowired
 |  |     @Autowired
 | 
												
													
														
															|  |     private DoctorDao doctorDao;
 |  |     private DoctorDao doctorDao;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |     @Autowired
 | 
												
													
														
															|  | 
 |  |     private DoctorMappingDao doctorMappingDao;
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |     private ObjectMapper objectMapper = new ObjectMapper();
 |  |     private ObjectMapper objectMapper = new ObjectMapper();
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
											
												
													
														
															|  | @ -119,6 +124,15 @@ public class GuahaoXMService extends BaseService implements IGuahaoService {
 | 
												
													
														
															|  |             e.printStackTrace();
 |  |             e.printStackTrace();
 | 
												
													
														
															|  |             System.out.println("获取医生信息失败");
 |  |             System.out.println("获取医生信息失败");
 | 
												
													
														
															|  |         }
 |  |         }
 | 
												
													
														
															|  | 
 |  |         DoctorMapping doctorMapping = null;
 | 
												
													
														
															|  | 
 |  |         try{
 | 
												
													
														
															|  | 
 |  |             if (doctor != null){
 | 
												
													
														
															|  | 
 |  |                 doctorMapping = doctorMappingDao.findByJwDoctorHospitalAndJwDoctor(doctor.getHospitalName(),doctorId);
 | 
												
													
														
															|  | 
 |  |             }
 | 
												
													
														
															|  | 
 |  |         }catch (Exception e){
 | 
												
													
														
															|  | 
 |  |             e.printStackTrace();
 | 
												
													
														
															|  | 
 |  |             System.out.println("获取系统医生信息失败");
 | 
												
													
														
															|  | 
 |  |         }
 | 
												
													
														
															|  |         // 保存预约记录
 |  |         // 保存预约记录
 | 
												
													
														
															|  |         PatientReservation reservation = new PatientReservation();
 |  |         PatientReservation reservation = new PatientReservation();
 | 
												
													
														
															|  |         reservation.setCode(code);
 |  |         reservation.setCode(code);
 | 
												
											
												
													
														
															|  | @ -169,17 +183,23 @@ public class GuahaoXMService extends BaseService implements IGuahaoService {
 | 
												
													
														
															|  |             SurveyScreenResult surveyScreenResult = surveyScreenResultDao.getSurveyScreenResultByCode(surveyCode);
 |  |             SurveyScreenResult surveyScreenResult = surveyScreenResultDao.getSurveyScreenResultByCode(surveyCode);
 | 
												
													
														
															|  |             surveyScreenResult.setIsOrder(1);
 |  |             surveyScreenResult.setIsOrder(1);
 | 
												
													
														
															|  |             surveyScreenResult.setReservationCode(patientReservation.getCode());
 |  |             surveyScreenResult.setReservationCode(patientReservation.getCode());
 | 
												
													
														
															|  | 
 |  |             surveyScreenResult.setFollowing(0);
 | 
												
													
														
															|  |             String sql = "update wlyy_survey_screen_result ssr set ssr.is_order = "+surveyScreenResult.getIsOrder()+"," +
 |  |             String sql = "update wlyy_survey_screen_result ssr set ssr.is_order = "+surveyScreenResult.getIsOrder()+"," +
 | 
												
													
														
															|  |                     "reservation_code = '"+surveyScreenResult.getReservationCode()+"' where ssr.id = '"+surveyScreenResult.getId()+"'";
 |  | 
 | 
												
													
														
															|  | 
 |  |                     "reservation_code = '"+surveyScreenResult.getReservationCode()+"',following = "+surveyScreenResult.getFollowing()+ " where ssr.id = '"+surveyScreenResult.getId()+"'";
 | 
												
													
														
															|  |             jdbcTemplate.update(sql);
 |  |             jdbcTemplate.update(sql);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             //发送消息
 |  |             //发送消息
 | 
												
													
														
															|  |             Message message = new Message();
 |  |             Message message = new Message();
 | 
												
													
														
															|  |             message.setCzrq(new Date());
 |  |             message.setCzrq(new Date());
 | 
												
													
														
															|  |             message.setCreateTime(new Date());
 |  |             message.setCreateTime(new Date());
 | 
												
													
														
															|  |             message.setContent("您有一个居民开通专科服务");
 |  |             message.setContent("您有一个居民开通专科服务");
 | 
												
													
														
															|  |             message.setRead(1);//设置未读
 |  |             message.setRead(1);//设置未读
 | 
												
													
														
															|  |             message.setReceiver(doctorId);//设置接受医生的code
 |  | 
 | 
												
													
														
															|  | 
 |  |             if (doctorMapping!=null){
 | 
												
													
														
															|  | 
 |  |                 message.setReceiver(doctorMapping.getDoctorCode());//设置接受医生的code
 | 
												
													
														
															|  | 
 |  |            }else {
 | 
												
													
														
															|  | 
 |  |                 message.setReceiver("40f5371c810d411ab085cb8d9f0160a6");
 | 
												
													
														
															|  | 
 |  |            }
 | 
												
													
														
															|  |             message.setSender(patient);//设置发送的用户
 |  |             message.setSender(patient);//设置发送的用户
 | 
												
													
														
															|  |             message.setSenderName(patientName);
 |  |             message.setSenderName(patientName);
 | 
												
													
														
															|  |             message.setCode(getCode());
 |  |             message.setCode(getCode());
 | 
												
											
												
													
														
															|  | @ -1242,8 +1262,8 @@ public class GuahaoXMService extends BaseService implements IGuahaoService {
 | 
												
													
														
															|  |             String startTime = map.get("startTime");
 |  |             String startTime = map.get("startTime");
 | 
												
													
														
															|  |             String endTime = map.get("endTime");
 |  |             String endTime = map.get("endTime");
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  |             /*String response = jwSmjkService.webRegisterByFamily(cardNo, patientName, clinicCard, sectionType, startTime, hospitalId, hosDeptId, hosDeptName, doctorId, doctorName,patientPhone);*/
 |  | 
 | 
												
													
														
															|  |             String response = UUID.randomUUID()+"|516|熊永强";
 |  | 
 | 
												
													
														
															|  | 
 |  |             String response = jwSmjkService.webRegisterByFamily(cardNo, patientName, clinicCard, sectionType, startTime, hospitalId, hosDeptId, hosDeptName, doctorId, doctorName,patientPhone);
 | 
												
													
														
															|  | 
 |  |             /*String response = UUID.randomUUID()+"|516|熊永强";*/
 | 
												
													
														
															|  |             re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode,surveyCode);
 |  |             re = CreateOrderAfter(response, hospitalId, hospitalName, hosDeptId, hosDeptName, doctorId, doctorName, sectionType, startTime, endTime, patient, patientName, cardNo, clinicCard, patientPhone, dname, dcode,surveyCode);
 | 
												
													
														
															|  |         } else {
 |  |         } else {
 | 
												
													
														
															|  |             throw new Exception("该排班信息错误或者不存在!");
 |  |             throw new Exception("该排班信息错误或者不存在!");
 | 
												
											
												
													
														
															|  | @ -1288,6 +1308,7 @@ public class GuahaoXMService extends BaseService implements IGuahaoService {
 | 
												
													
														
															|  |         messageDao.save(message);
 |  |         messageDao.save(message);
 | 
												
													
														
															|  |         SurveyScreenResult surveyScreenResult = surveyScreenResultDao.getSurveyScreenResultByCode(surveyCode);
 |  |         SurveyScreenResult surveyScreenResult = surveyScreenResultDao.getSurveyScreenResultByCode(surveyCode);
 | 
												
													
														
															|  |         surveyScreenResult.setIsOrder(2);
 |  |         surveyScreenResult.setIsOrder(2);
 | 
												
													
														
															|  | 
 |  |         surveyScreenResult.setFollowing(0);
 | 
												
													
														
															|  |         surveyScreenResultDao.save(surveyScreenResult);
 |  |         surveyScreenResultDao.save(surveyScreenResult);
 | 
												
													
														
															|  |         JSONObject object = new JSONObject();
 |  |         JSONObject object = new JSONObject();
 | 
												
													
														
															|  |         object.put("message",message);
 |  |         object.put("message",message);
 |