| 
					
				 | 
			
			
				@ -17,6 +17,8 @@ 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.patient.BasePatientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.prescription.service.entrance.EntranceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.patient.dao.BasePatientDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.web.MixEnvelop; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -57,6 +59,8 @@ public class BaseComplaintService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BasePatientDao basePatientDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private EnterpriseService enterpriseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${wechat.id}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private String wxId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${wechat.flag}") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -196,6 +200,14 @@ public class BaseComplaintService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 患者举报接口 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public BaseComplaintDO patiemtComplaint(String json) throws Exception{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyHospitalSysDictDO wlyyHospitalSysDictDO= wlyyHospitalSysDictDao.findById("complaintOpenControl"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (wlyyHospitalSysDictDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (!"1".equalsIgnoreCase(wlyyHospitalSysDictDO.getDictValue())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                throw new Exception("投诉通道已关闭"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            throw new Exception("投诉通道已关闭"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BaseComplaintDO baseComplaintDO =objectMapper.readValue(json,BaseComplaintDO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BaseComplaintDictDO baseComplaintDictDO = baseComplaintDictDao.findById(baseComplaintDO.getComplaintId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (baseComplaintDictDO!=null){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -254,7 +266,7 @@ public class BaseComplaintService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            baseComplaintDO.setAcceptor(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            baseComplaintDO.setComplaintId(complaintId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BaseComplaintDictDO baseComplaintDictDO = baseComplaintDictDao.findById(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BaseComplaintDictDO baseComplaintDictDO = baseComplaintDictDao.findById(complaintId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (baseComplaintDictDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                complaitTypeName=baseComplaintDictDO.getName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                baseComplaintDO.setComplaintName(complaitTypeName); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -320,16 +332,12 @@ public class BaseComplaintService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    //查询投诉列表 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop findComplaintList(String doctor,String status,String patientName,String patientId,String keyWord,String complaintId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop findComplaintList(String role,String doctor,String status,String patientName,String patientId,String keyWord,String complaintId, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  String startTime,String endTime,Integer page ,Integer pageSize){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        MixEnvelop mixEnvelop = new MixEnvelop(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BaseDoctorRoleDO>  rolelist= baseDoctorRoleDao.findByDoctorCode(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Boolean queryAll=false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (BaseDoctorRoleDO baseDoctorRoleDO:rolelist){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("admin".equalsIgnoreCase(baseDoctorRoleDO.getRoleCode())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                queryAll=true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                break; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("admin".equalsIgnoreCase(role)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            queryAll=true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql="select t.id as \"id\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " t.complaint_id as \"complaintId\"," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -546,11 +554,10 @@ public class BaseComplaintService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    * 查询投诉数量*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map<String,Object> findComplaintCount(String doctor){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map<String,Object> findComplaintCount(String doctor,String role){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BaseComplaintDoctorDO baseComplaintDoctorDO=baseComplaintDoctorDao.findbyDoctorAndDel(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BaseDoctorRoleDO>  rolelist= baseDoctorRoleDao.findByDoctorCode(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Boolean queryAll=false; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (rolelist!=null&&rolelist.contains("admin")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("admin".equalsIgnoreCase(role)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            queryAll=true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer complaints=0; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -575,6 +582,26 @@ public class BaseComplaintService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /* 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 查询投诉数量*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map<String,Object> findComplaintCountPatient(String patient){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer complaints=0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer recieve=0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer deal=0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        complaints=baseComplaintDao.getCountByStatusByPatient("0",patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        recieve=baseComplaintDao.getCountByStatusByPatient("1",patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        deal=baseComplaintDao.getCountByStatusByPatient("2",patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer total = complaints+recieve+deal; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map map=new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        map.put("complaints",complaints); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        map.put("recieve",recieve); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        map.put("deal",deal); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        map.put("total",total); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return map; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 |