|  | @ -3,8 +3,10 @@ package com.yihu.jw.hospital.prescription.service;
 | 
	
		
			
				|  |  | import com.fasterxml.jackson.databind.ObjectMapper;
 | 
	
		
			
				|  |  | import com.yihu.jw.dict.dao.DictHospitalDeptDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.org.BaseOrgDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.patient.BasePatientDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
 | 
	
	
		
			
				|  | @ -35,6 +37,7 @@ import com.yihu.jw.restmodel.base.org.BaseOrgVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.doctor.WlyyDoctorWorkTimeVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.base.BaseRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.common.IdCardUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
	
		
			
				|  | @ -109,6 +112,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |     private WlyyHttpLogDao wlyyHttpLogDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private WlyyDoctorClinicRoomDao wlyyDoctorClinicRoomDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BaseDoctorHospitalDao baseDoctorHospitalDao;
 | 
	
		
			
				|  |  |     
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Value("${demo.flag}")
 | 
	
	
		
			
				|  | @ -1422,6 +1427,30 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |             rs.put("jobTitleName",doctorDO.getJobTitleName());
 | 
	
		
			
				|  |  |             rs.put("chargeType",doctorDO.getChargeType());
 | 
	
		
			
				|  |  |             rs.put("photo",doctorDO.getPhoto());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             //机构科室信息
 | 
	
		
			
				|  |  |             List<BaseDoctorHospitalDO> hospitalDOs =  baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
 | 
	
		
			
				|  |  |             if(hospitalDOs!=null&&hospitalDOs.size()>0){
 | 
	
		
			
				|  |  |                rs.put("hospital",hospitalDOs.get(0));
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                rs.put("hospital",null);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             String sql = "SELECT " +
 | 
	
		
			
				|  |  |                     " t. CODE AS roleCode, " +
 | 
	
		
			
				|  |  |                     " t. NAME AS roleName" +
 | 
	
		
			
				|  |  |                     " FROM " +
 | 
	
		
			
				|  |  |                     " base_doctor_role r " +
 | 
	
		
			
				|  |  |                     " JOIN base_doctor_role_dict t ON t.`code` = r.role_code " +
 | 
	
		
			
				|  |  |                     " WHERE " +
 | 
	
		
			
				|  |  |                     " r.doctor_code = '"+doctor+"'";
 | 
	
		
			
				|  |  |             List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |             if(list!=null&&list.size()>0){
 | 
	
		
			
				|  |  |                 rs.put("roles",list);
 | 
	
		
			
				|  |  |             }else{
 | 
	
		
			
				|  |  |                 rs.put("roles",null);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return rs;
 | 
	
	
		
			
				|  | @ -1556,7 +1585,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 "WHERE " +
 | 
	
		
			
				|  |  |                 "room.patient_id=patient.id " +
 | 
	
		
			
				|  |  |                 "AND room.outpatient_id=outpatient.id " +
 | 
	
		
			
				|  |  |                 "AND room.doctor IS NULL " +
 | 
	
		
			
				|  |  |                 "AND (room.doctor IS NULL or room.doctor='"+doctor+"') " +
 | 
	
		
			
				|  |  |                 "AND room.consult_type="+type;
 | 
	
		
			
				|  |  |         
 | 
	
		
			
				|  |  |         List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
 |