|  | @ -16,6 +16,7 @@ import com.yihu.jw.entity.base.im.ConsultTeamLogDo;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.patient.BasePatientDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.score.BaseEvaluateDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.score.BaseEvaluateScoreDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.servicePackage.ServiceItemPlanDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.consult.WlyyHospitalWaitingRoomDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.message.BaseBannerDoctorDO;
 | 
	
	
		
			
				|  | @ -46,6 +47,7 @@ import com.yihu.jw.im.util.ImUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.util.ImageCompress;
 | 
	
		
			
				|  |  | import com.yihu.jw.order.dao.BusinessOrderDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.patient.dao.BasePatientDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.rehabilitation.ServiceItemPlanDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
 | 
	
	
		
			
				|  | @ -87,7 +89,8 @@ public class ImService {
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     public ConsultDao consultDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private ServiceItemPlanDao serviceItemPlanDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     public ConsultTeamDao consultTeamDao;
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -1084,7 +1087,13 @@ public class ImService {
 | 
	
		
			
				|  |  |         ct.setStartMsgId(obj.get("start_msg_id").toString());
 | 
	
		
			
				|  |  |         consultTeamDao.save(ct);
 | 
	
		
			
				|  |  |         consultDao.save(consult);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if(ct.getType()==28){
 | 
	
		
			
				|  |  |             ServiceItemPlanDO serviceItemPlanDO = serviceItemPlanDao.findById(ct.getRelationCode()).orElse(null);
 | 
	
		
			
				|  |  |             if(serviceItemPlanDO!=null){
 | 
	
		
			
				|  |  |                 serviceItemPlanDO.setRelationCode(ct.getConsult());
 | 
	
		
			
				|  |  |                 serviceItemPlanDao.save(serviceItemPlanDO);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         JSONArray doctors = new JSONArray();
 | 
	
		
			
				|  |  |         for (String key : users.keySet()) {
 | 
	
		
			
				|  |  |             if (patient.equals(key)) {
 | 
	
	
		
			
				|  | @ -1511,6 +1520,8 @@ public class ImService {
 | 
	
		
			
				|  |  |         JSONObject jsonObject = new JSONObject();
 | 
	
		
			
				|  |  |         if ("3".equals(wlyyOutpatientDO.getOutpatientType())) {
 | 
	
		
			
				|  |  |             jsonObject.put("title", p.getName() + "申请咨询");
 | 
	
		
			
				|  |  |         } else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
 | 
	
		
			
				|  |  |             jsonObject.put("title", p.getName() + "申请康复咨询");
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             jsonObject.put("title", p.getName() + "申请复诊");
 | 
	
		
			
				|  |  |         }
 | 
	
	
		
			
				|  | @ -1555,6 +1566,9 @@ public class ImService {
 | 
	
		
			
				|  |  |                 consultTitle = "家医咨询";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
 | 
	
		
			
				|  |  |             users.put(patient, 0);
 | 
	
		
			
				|  |  |             consultTitle = "申请康复咨询";
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             users.put(patient, 0);
 | 
	
		
			
				|  |  |             consultTitle = "申请复诊";
 | 
	
	
		
			
				|  | @ -1627,6 +1641,12 @@ public class ImService {
 | 
	
		
			
				|  |  |             } else {
 | 
	
		
			
				|  |  |                 obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_GENERAL_EXPERT);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }else if("4".equals(wlyyOutpatientDO.getOutpatientType())){
 | 
	
		
			
				|  |  |             messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
 | 
	
		
			
				|  |  |             //5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+28(图文,视频,图文+视频)
 | 
	
		
			
				|  |  |             sessionId = patient + "_" + outpatientCode + "_" + ct.getType();
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             obj = imUtil.createTopics(sessionId, consult.getId(), p.getName(), users, messages, imUtil.SESSION_TYPE_KANGFUConsult);
 | 
	
		
			
				|  |  |         } else {
 | 
	
		
			
				|  |  |             messages = imUtil.getCreateTopicMessage(patient, p.getName(), consult.getTitle(), content, consult.getImages(), doctorCode);
 | 
	
		
			
				|  |  |             //5、(im创建咨询) 续方咨询的sessionid为居民code+就诊code+9(图文,视频,图文+视频)
 | 
	
	
		
			
				|  | @ -1673,7 +1693,7 @@ public class ImService {
 | 
	
		
			
				|  |  |         addLogs(ct);
 | 
	
		
			
				|  |  |         JSONObject result = imUtil.getSingleSessionInfo(sessionId, doctorCode);
 | 
	
		
			
				|  |  |         //发送外层SOCKET消息 在线复诊
 | 
	
		
			
				|  |  |         if ("1".equals(wlyyOutpatientDO.getOutpatientType()) || "3".equals(wlyyOutpatientDO.getOutpatientType())) {
 | 
	
		
			
				|  |  |         if ("1".equals(wlyyOutpatientDO.getOutpatientType()) || "3".equals(wlyyOutpatientDO.getOutpatientType())|| "4".equals(wlyyOutpatientDO.getOutpatientType())) {
 | 
	
		
			
				|  |  |             System.out.println("发送外层SOCKET消息:在线复诊");
 | 
	
		
			
				|  |  |             JSONObject object = new JSONObject();
 | 
	
		
			
				|  |  |             object.put("socket_sms_type", 5);
 |