Prechádzať zdrojové kódy

Merge branch 'dev' of huangwenjie/wlyy2.0 into dev

huangwenjie 5 rokov pred
rodič
commit
b9e6a9a182

+ 26 - 0
business/base-service/src/main/java/com/yihu/jw/doctor/dao/BaseDoctorRoleDao.java

@ -0,0 +1,26 @@
package com.yihu.jw.doctor.dao;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * 
 * 医生与业务模块角色关联信息 数据库访问层
 * 
 * @version 
 * <pre>
 * Author	Version		Date		Changes
 * litaohong 	1.0  		2018年10月25日 	Created
 *
 * </pre>
 * @since 1.
 */
public interface BaseDoctorRoleDao extends PagingAndSortingRepository<BaseDoctorRoleDO, Integer>, JpaSpecificationExecutor<BaseDoctorRoleDO>  {
    
    List<BaseDoctorRoleDO> findByRoleCode(String roleCode);
}

+ 34 - 0
business/im-service/src/main/java/com/yihu/jw/im/service/ImService.java

@ -4,7 +4,9 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.im.ConsultDo;
import com.yihu.jw.entity.base.im.ConsultTeamDo;
import com.yihu.jw.entity.base.im.ConsultTeamDoctorDo;
@ -145,6 +147,9 @@ public class ImService {
	@Autowired
	private WlyyHttpLogDao wlyyHttpLogDao;
	
	@Autowired
	private BaseDoctorRoleDao baseDoctorRoleDao;
	
	
	
	/**
@ -1069,6 +1074,8 @@ public class ImService {
				object.put("socket_sms_type",5);
				object.put("relation_code",wlyyOutpatientDO.getId());
				imUtil.sendMessage(wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getPatient(),"1",object.toString());
				//医生接诊发送导诊护士外层消息
				this.sendOutpatientGuaidanceMessage(wlyyOutpatientDO);
			}else if("2".equals(wlyyOutpatientDO.getOutpatientType())){
				//协同门诊
				System.out.println("发送外层SOCKET消息:协同门诊");
@ -1076,12 +1083,39 @@ public class ImService {
				object.put("socket_sms_type",5);
				object.put("relation_code",wlyyOutpatientDO.getId());
				imUtil.sendMessage(wlyyOutpatientDO.getDoctor(),wlyyOutpatientDO.getGeneralDoctor(),"1",object.toString());
				//医生接诊发送导诊护士外层消息
				this.sendOutpatientGuaidanceMessage(wlyyOutpatientDO);
			}
			
			return result;
		}
	}
	
	/**
	 * 医生接诊发送导诊护士外层消息
	 * @param wlyyOutpatientDO
	 */
	private void sendOutpatientGuaidanceMessage(WlyyOutpatientDO wlyyOutpatientDO ){
		
		System.out.println("发送导诊护士外层SOCKET消息:医生接诊");
		JSONObject object = new JSONObject();
		object.put("socket_sms_type",7);
		object.put("relation_code","");
		object.put("msg_time",DateUtil.dateToStrLong(new Date()));
		String msgStr = wlyyOutpatientDO.getDoctorName()+"医生诊室 "+wlyyOutpatientDO.getPatientName();
		if("1".equals(wlyyOutpatientDO.getOutpatientType())){
			msgStr = msgStr + "  已开始复诊";
		}else if("2".equals(wlyyOutpatientDO.getOutpatientType())){
			msgStr = msgStr + "  已开始协同门诊";
		}
		object.put("msg",msgStr);
		
		List<BaseDoctorRoleDO> assistantList =  baseDoctorRoleDao.findByRoleCode("assistant");
		for (BaseDoctorRoleDO baseDoctorRoleDO:assistantList){
			imUtil.sendMessage(wlyyOutpatientDO.getDoctor(),baseDoctorRoleDO.getDoctorCode(),"1",object.toString());
		}
	}
	
	
	/**
	 * 居民结束咨询

+ 1 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/consult/DoctorConsultEndpoint.java

@ -49,6 +49,7 @@ public class DoctorConsultEndpoint extends EnvelopRestEndpoint {
	
	@Autowired
	private OutpatientDao outpatientDao;
	
	
	@GetMapping (value = BaseHospitalRequestMapping.DodtorIM.findWaitingRoomOutpatientByDoctor)