|  | @ -6,12 +6,14 @@ import com.alibaba.fastjson.JSONObject;
 | 
	
		
			
				|  |  | import com.fasterxml.jackson.databind.ObjectMapper;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.door.dao.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.door.dao.followup.FollowUpDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.door.util.MessageUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.door.util.StreamUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
 | 
	
		
			
				|  |  | 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.patient.BasePatientDO;
 | 
	
	
		
			
				|  | @ -150,6 +152,8 @@ public class DoorOrderService {
 | 
	
		
			
				|  |  |     private FollowUpDao followupDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BasePatientWechatDao basePatientWechatDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BaseDoctorRoleDao baseDoctorRoleDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 互联网查询待服务工单数
 | 
	
	
		
			
				|  | @ -321,8 +325,15 @@ public class DoorOrderService {
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public List<Map<String, Object>> getDoorServiceDoctor(String orderId) {
 | 
	
		
			
				|  |  |         String sql = "SELECT dd.id as id,CONCAT(d.`name`,' (',dd.doctor_job_name,')') as name, dd.doctor from wlyy_door_doctor dd JOIN base_doctor d ON d.id = dd.doctor WHERE order_id=?";
 | 
	
		
			
				|  |  |         List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql, orderId);
 | 
	
		
			
				|  |  |         String sql = "SELECT dd.id as id,CONCAT(d.`name`,' (',d.job_title_name,')') as name, d.id \n" +
 | 
	
		
			
				|  |  |                 "from wlyy_door_doctor dd INNER JOIN wlyy_door_service_order  sor on dd.order_id = sor.id\n" +
 | 
	
		
			
				|  |  |                 "INNER JOIN base_doctor d ON d.id = sor.doctor WHERE order_id='"+orderId+"' \n" +
 | 
	
		
			
				|  |  |                 "UNION\n" +
 | 
	
		
			
				|  |  |                 "\n" +
 | 
	
		
			
				|  |  |                 "SELECT dd.id as id,CONCAT(d.`name`,' (',d.job_title_name,')') as name, d.id \n" +
 | 
	
		
			
				|  |  |                 "from wlyy_door_doctor dd INNER JOIN wlyy_door_service_order  sor on dd.order_id = sor.id\n" +
 | 
	
		
			
				|  |  |                 "INNER JOIN base_doctor d ON d.id = sor.nursing_staff WHERE order_id='"+orderId+"';";
 | 
	
		
			
				|  |  |         List<Map<String, Object>> mapList = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  |         return mapList;
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -734,7 +745,15 @@ public class DoorOrderService {
 | 
	
		
			
				|  |  |         if(type != null && type == 3 ){
 | 
	
		
			
				|  |  |             sql += " and o.type = " + type + " and o.proxy_patient = '" + doctorCode + "'";
 | 
	
		
			
				|  |  |         }else if(!StringUtils.isEmpty(doctorCode)){
 | 
	
		
			
				|  |  |             sql+=" and (d.doctor='"+doctorCode+"' or o.doctor='"+doctorCode+"')";
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             List<BaseDoctorRoleDO> baseDoctorRoleDOS = baseDoctorRoleDao.findByDoctorCode(doctorCode);
 | 
	
		
			
				|  |  |             if (baseDoctorRoleDOS.get(0).getRoleCode().equals("nurse")){
 | 
	
		
			
				|  |  | //                sql+=" and (d.doctor='"+doctorCode+"' or o.nursing_staff='"+doctorCode+"')";
 | 
	
		
			
				|  |  |                 sql+=" and  o.nursing_staff='"+doctorCode+"'";
 | 
	
		
			
				|  |  |             }else {
 | 
	
		
			
				|  |  |                 sql+=" and (d.doctor='"+doctorCode+"' or o.doctor='"+doctorCode+"')";
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if(examPaperStatus!=null){
 | 
	
		
			
				|  |  |             sql+=" and o.conclusion_status =1 ";
 |