| 
					
				 | 
			
			
				@ -51,6 +51,7 @@ import com.yihu.jw.entity.hospital.prescription.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.order.BusinessOrderDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.file_upload.FileUploadService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.consult.dao.BaseAdviceTreatmentDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.consult.dao.HospitalWaitingRoomDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.consult.dao.WlyyConsultAdviceDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.dict.WlyyChargeDictDao; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -60,6 +61,7 @@ import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.doctor.dao.WlyyDoctorOnlineTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.service.BaseOperateLogService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.mapping.dao.PatientMappingDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.mapping.service.DoctorMappingService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -309,10 +311,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private TnyyEntranceService tnyyEntranceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseJpushTemplateDao baseJpushTemplateDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    HikariDataSource dataSource; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /*@Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    HikariDataSource dataSource;*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseSensitiveDao baseSensitiveDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseOperateLogService baseOperateLogService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private BaseAdviceTreatmentDao baseAdviceTreatmentDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${demo.flag}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private boolean demoFlag; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -339,20 +345,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("findOutpatientList patNo " + patNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<WlyyOutpatientVO> wlyyOutpatientVOList  =  entranceService.BS30025(patNo, null, startTime, endTime, demoFlag,ksdm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!ksdm.equalsIgnoreCase("1500010")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<WlyyOutpatientVO> wlyyOutpatientVOList1  =  entranceService.BS30025(patNo, null, startTime, endTime, demoFlag,"1500010"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (wlyyOutpatientVOList!=null&&wlyyOutpatientVOList.size()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(wlyyOutpatientVOList1!=null&&wlyyOutpatientVOList1.size()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    for (WlyyOutpatientVO wlyyOutpatientVO:wlyyOutpatientVOList1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("==="+wlyyOutpatientVO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (wlyyOutpatientVO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            wlyyOutpatientVOList.add(wlyyOutpatientVO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNoneBlank(ksdm)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (!ksdm.equalsIgnoreCase("1500010")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<WlyyOutpatientVO> wlyyOutpatientVOList1  =  entranceService.BS30025(patNo, null, startTime, endTime, demoFlag,"1500010"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (wlyyOutpatientVOList!=null&&wlyyOutpatientVOList.size()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if(wlyyOutpatientVOList1!=null&&wlyyOutpatientVOList1.size()!=0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        for (WlyyOutpatientVO wlyyOutpatientVO:wlyyOutpatientVOList1){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("==="+wlyyOutpatientVO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (wlyyOutpatientVO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                wlyyOutpatientVOList.add(wlyyOutpatientVO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    wlyyOutpatientVOList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    wlyyOutpatientVOList = wlyyOutpatientVOList1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                wlyyOutpatientVOList = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                wlyyOutpatientVOList = wlyyOutpatientVOList1; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return wlyyOutpatientVOList; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -656,82 +664,95 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDOs = prescriptionDao.findByOutpatientId(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<WlyyPrescriptionVO> prescriptionVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BusinessOrderDO> businessOrders = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BusinessOrderDO businessOrder = new BusinessOrderDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (prescriptionDOs != null && prescriptionDOs.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            convertToModels(prescriptionDOs, prescriptionVOs, WlyyPrescriptionVO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (WlyyPrescriptionVO vo : prescriptionVOs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<WlyyPrescriptionCheckDO> prescriptionCheckDO = prescriptionCheckDao.findByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //疾病信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                vo.setDiagnosisVOs(findDiagnosisById(vo.getId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(null!=prescriptionCheckDO&&prescriptionCheckDO.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    vo.setDispUser(prescriptionCheckDO.get(0).getOperate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    vo.setDispUserName(prescriptionCheckDO.get(0).getOperateName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //药品信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<WlyyPrescriptionInfoVO> infoVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                System.out.println("=====PrescriptionId======"+vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                vo.setInfoVOs(infoVOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //检查检验信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<WlyyInspectionVO> inspectionVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                vo.setInspectionVOs(convertToModels(wlyyInspectionDao.findByPrescriptionId(vo.getId(), 1), inspectionVOs, WlyyInspectionVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (wxId.equalsIgnoreCase("xm_zsyy_wx")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (wlyyPrescriptionEmrDO1 != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = readOutPatientXml(outpatientDO.getOriginRegisterNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        //电子病历 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!"2".equalsIgnoreCase(outpatientDO.getOutpatientType())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<WlyyPrescriptionVO> prescriptionVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<BusinessOrderDO> businessOrders = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BusinessOrderDO businessOrder = new BusinessOrderDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (prescriptionDOs != null && prescriptionDOs.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                convertToModels(prescriptionDOs, prescriptionVOs, WlyyPrescriptionVO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                for (WlyyPrescriptionVO vo : prescriptionVOs) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    List<WlyyPrescriptionCheckDO> prescriptionCheckDO = prescriptionCheckDao.findByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //疾病信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    vo.setDiagnosisVOs(findDiagnosisById(vo.getId())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if(null!=prescriptionCheckDO&&prescriptionCheckDO.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        vo.setDispUser(prescriptionCheckDO.get(0).getOperate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        vo.setDispUserName(prescriptionCheckDO.get(0).getOperateName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } else if (wxId.equalsIgnoreCase("xm_xzzx_wx")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (wlyyPrescriptionEmrDO1 != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        List<WlyyPrescriptionEmrDO> listEmr = xzzxEntranceService.selectHistoryEmr(hisPatient,""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (null!=listEmr&&listEmr.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            vo.setWlyyPrescriptionEmrDO(listEmr.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //药品信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    List<WlyyPrescriptionInfoVO> infoVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    System.out.println("=====PrescriptionId======"+vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    convertToModels(prescriptionInfoDao.findByPrescriptionId(vo.getId(), 1), infoVOs, WlyyPrescriptionInfoVO.class); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    vo.setInfoVOs(infoVOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //检查检验信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    List<WlyyInspectionVO> inspectionVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    vo.setInspectionVOs(convertToModels(wlyyInspectionDao.findByPrescriptionId(vo.getId(), 1), inspectionVOs, WlyyInspectionVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (wxId.equalsIgnoreCase("xm_zsyy_wx")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (wlyyPrescriptionEmrDO1 != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO = readOutPatientXml(outpatientDO.getOriginRegisterNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //电子病历 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } else if (wxId.equalsIgnoreCase("xm_xzzx_wx")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (wlyyPrescriptionEmrDO1 != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            List<WlyyPrescriptionEmrDO> listEmr = xzzxEntranceService.selectHistoryEmr(hisPatient,""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (null!=listEmr&&listEmr.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                vo.setWlyyPrescriptionEmrDO(listEmr.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (wlyyPrescriptionEmrDO1 != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    WlyyPrescriptionEmrDO wlyyPrescriptionEmrDO1 = prescriptionEmrDao.findEmrByPrescriptionId(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (wlyyPrescriptionEmrDO1 != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        vo.setWlyyPrescriptionEmrDO(wlyyPrescriptionEmrDO1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //支付信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (null!=businessOrderDO){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        businessOrders.add(businessOrderDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //支付信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(vo.getId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (null!=businessOrderDO){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    businessOrders.add(businessOrderDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("prescriptions", prescriptionVOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("businessOrder", businessOrders); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("prescriptions", prescriptionVOs); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("businessOrder", businessOrders); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //物流信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<WlyyPrescriptionExpressageDO> expressageDOs = prescriptionExpressageDao.findByOutpatientId(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (expressageDOs != null && expressageDOs.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("expressage", convertToModel(expressageDOs.get(0), WlyyPrescriptionExpressageVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("expressage", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //物流信息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<WlyyPrescriptionExpressageDO> expressageDOs = prescriptionExpressageDao.findByOutpatientId(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (expressageDOs != null && expressageDOs.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("expressage", convertToModel(expressageDOs.get(0), WlyyPrescriptionExpressageVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("expressage", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //物流配送新 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (expressageLogDOs != null && expressageLogDOs.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("expressageLogs", convertToModels(expressageLogDOs, expressageLogVOs, WlyyPrescriptionExpressageLogVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("expressageLogs", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<BaseAdviceTreatmentDO>  treatmentDOS=baseAdviceTreatmentDao.findByRelationCode(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (treatmentDOS!=null&&treatmentDOS.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //药品 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<WlyyPrescriptionInfoDO> infoDOList=prescriptionInfoDao.findByPrescriptionId(treatmentDOS.get(0).getId(), 1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                treatmentDOS.get(0).setInfoList(infoDOList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("treatments",treatmentDOS.get(0)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                rs.put("treatments",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //物流配送新 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<WlyyPrescriptionExpressageLogDO> expressageLogDOs = prescriptionExpressageLogDao.queryByOutpatientIdOrderByCreateTimeDesc(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<WlyyPrescriptionExpressageLogVO> expressageLogVOs = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (expressageLogDOs != null && expressageLogDOs.size() > 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("expressageLogs", convertToModels(expressageLogDOs, expressageLogVOs, WlyyPrescriptionExpressageLogVO.class)); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("expressageLogs", null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //预约记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<WlyyPatientRegisterTimeDO> timeDOs = patientRegisterTimeDao.findByOutpatientId(outpatientId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1528,7 +1549,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("findDoctorByHospitalAndDept sql:" + sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("v sql:" + sql); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1734,29 +1755,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\td.req_fee as \"xtzxFee\"\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "FROM\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "\tbase_doctor t\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict d ON t.twzx_charge_type = d.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "LEFT JOIN wlyy_charge_dict d ON t.twzx_charge_type = d.charge_type and d.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "WHERE t.id = '"+doctor.get("id")+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                /*if (null!=doctor.get("chargeType")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String chargeTypeList = doctor.get("chargeType").toString(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (chargeType.contains(",")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        chargeTypeList = chargeType.replace(",","','"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            "req_fee  as \"reqFee\",zj_fee  as \"zjFee\",xt_fee  as \"xtFee\",dept_type_code as \"deptTypeCode\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            " from wlyy_charge_dict where 1=1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sqlCharge+=" and charge_type in ( '"+chargeTypeList+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (StringUtils.isNoneBlank(deptTyepCode)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                doctor.put("chargeTypeList",chargeDictDOLists); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNotBlank(doctorCode)) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3148,24 +3155,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(startTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and e.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and p.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and p.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalSql += " AND e.create_time >='" + startTime + " 00:00:00'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalSql += " AND p.create_time >='" + startTime + " 00:00:00'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(endTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and e.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and p.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    totalSql += " and p.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalSql += " AND e.create_time <='" + endTime + " 23:59:59'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                totalSql += " AND p.create_time <='" + endTime + " 23:59:59'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3234,29 +3241,29 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(startTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and e.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and p.create_time >= str_to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and e.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and p.create_time >= to_date('" + startTime + " 00:00:00','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND e.create_time >='" + startTime + " 00:00:00'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND p.create_time >='" + startTime + " 00:00:00'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNotBlank(endTime)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equals(wxId)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (flag){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and e.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and p.create_time <= str_to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and e.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sql += " and p.create_time <= to_date('" + endTime + " 23:59:59','YYYY-MM-DD HH24:MI:SS')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND e.create_time <='" + endTime + " 23:59:59'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sql += " AND p.create_time <='" + endTime + " 23:59:59'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql +=" order by e.create_time desc "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql +=" order by p.create_time desc "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        /*       sql += " LIMIT " + (page - 1) * size + "," + size + "";*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, page, size); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (Map<String, Object> map : list) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3759,39 +3766,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("sex",doctorDO.getSex()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("popularity",doctorDO.getPopularity()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("qrcode",doctorDO.getQrcode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //号别 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            /*String deptTyepCode = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_zsyy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                deptTyepCode = "6"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                List<BaseDoctorHospitalDO> depts = baseDoctorHospitalDao.findByDoctorCode(doctor); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (null!=depts&&depts.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    BaseDoctorHospitalDO baseDoctorHospitalDO = depts.get(0); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String deptcode =  baseDoctorHospitalDO.getDeptCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String hosptitalCode = baseDoctorHospitalDO.getOrgCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    List<DictHospitalDeptDO> dictHospitalDeptDO = dictHospitalDeptDao.findByOrgCodeAndCode(hosptitalCode,deptcode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if(null!=dictHospitalDeptDO&&dictHospitalDeptDO.size()>0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (StringUtils.isNotBlank(dictHospitalDeptDO.get(0).getDeptTypeCode())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            deptTyepCode = dictHospitalDeptDO.get(0).getDeptTypeCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<Map<String,Object>> chargeDictDOLists = new ArrayList<>(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            /*String chargeType = doctorDO.getChargeType(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNotBlank(chargeType)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (chargeType.contains(",")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    chargeType = chargeType.replace(",","','"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String sqlCharge = "select charge_type as \"chargeType\",charge_name as \"chargeName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        "req_fee  as \"reqFee\",zj_fee  as \"zjFee\",xt_fee  as \"xtFee\",dept_type_code as \"deptTypeCode\" " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        " from wlyy_charge_dict where 1=1"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sqlCharge+=" and charge_type in ( '"+chargeType+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (StringUtils.isNoneBlank(deptTyepCode)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sqlCharge = "SELECT\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\tm.req_fee as \"twfzFee\",\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\ta.req_fee as \"spfzFee\",\n" + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3801,12 +3776,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\td.req_fee as \"xtzxFee\"\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\tbase_doctor t\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "WHERE t.id = '"+doctorDO.getId()+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //System.out.println(chargeDictDOLists.get(1)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4090,13 +4065,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\td.req_fee as \"xtzxFee\"\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\tbase_doctor t\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "WHERE t.id = '"+doctorDO.getId()+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "WHERE t.id = '"+doctorDO.getId()+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            rs.put("chargeTypeList",chargeDictDOLists); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //机构科室信息 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4209,6 +4184,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            else if("2".equalsIgnoreCase(wlyyOutpatientDO.getType())&&"3".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                type="17"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if("2".equalsIgnoreCase(wlyyOutpatientDO.getOutpatientType())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                type="12"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            description = "居民取消"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (StringUtils.isNoneBlank(type)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4393,24 +4370,33 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您发起的视频咨询已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询,医生已接诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("12".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您发起的专科协同已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您发起的专科协同,医生已接诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("15".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您发起的家医咨询已被"+outpatientDO.getDoctorName()+"接诊,请留意医生发送的消息。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您发起的家医咨询,医生已接诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("doctorPick诊查费支付成功推送模板消息:outpatientId="+outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if("doctorRefund".equalsIgnoreCase(titelType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("9".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您的图文复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您的图文复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您的图文复诊已退号"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("16".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg =  "您的视频复诊订单已退号。由于订单退号,诊察费将退回就诊卡内余额。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您发起的视频复诊已退号"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg =  "您的视频复诊订单已退号。由于订单退号,诊察费将退回本院就诊卡内。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您的视频复诊已退号"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg =  "您的图文咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您发起的图文咨询已退号"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg =  "您的图文咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您的图文咨询已退号"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("17".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回就诊卡内余额。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您发起的视频咨询已退号"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您的视频咨询订单已退号。由于订单退号,诊察费将退回本院就诊卡内。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已退号"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("doctorRefund:outpatientId="+outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4431,6 +4417,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您发起的视频咨询已被您取消。由于订单取消将不做扣费处理。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您的视频咨询已被您取消,您可重新发起"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("12".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("patientCancel诊查费支付成功推送模板消息:outpatientId="+outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else if("systemCancelRemind".equalsIgnoreCase(titelType)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4457,8 +4446,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您有一笔未完成的在线问诊订单,请及时处理。";//您有一个视频复诊订单待支付,请及时支付。 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("视频复诊订单待支付微信消息模板推送开始"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您有一个图文咨询订单待支付,点击完成支付,如您已支付请忽略本条信息"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您有一个图文咨询订单待支付,请及时支付。"; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4468,23 +4456,24 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first =  outpatientDO.getConsumerName() + ",您好!您有一个视频咨询订单待支付,请及时支付。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("视频咨询订单待支付微信消息模板推送开始"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if ("paySuccess".equalsIgnoreCase(titelType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("9".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您已成功发起图文复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("16".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if ("16".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg =  "您已成功发起视频复诊,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if ("1".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg =  "您已成功发起图文咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您已成功发起图文咨询"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("17".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if ("17".equals(type)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                contentMsg = "您已成功发起视频咨询,请耐心等待医生接单。如长时间未接诊,建议选择其他医生"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = outpatientDO.getConsumerName() + ",您好!您已成功发起视频咨询"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("paySuccess诊查费支付成功推送模板消息:outpatientId="+outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            msgUrl="/ims-wx/index.html#/returnVisit/record?outpatientId="+outpatientId; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -4532,18 +4521,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (consultTeam.getType()!=null&&1==consultTeam.getType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = consultTeam.getName() + ",您好!您有1条图文咨询已结束,请及时对咨询医生进行评价。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("图文咨询服务评价微信消息模板推送开始"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (consultTeam.getType()!=null&&9==consultTeam.getType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if (consultTeam.getType()!=null&&9==consultTeam.getType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = consultTeam.getName() + ",您好!您有1条图文复诊已结束,请及时对咨询医生进行评价。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("图文复诊服务评价微信消息模板推送开始"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (consultTeam.getType()!=null&&16==consultTeam.getType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if (consultTeam.getType()!=null&&16==consultTeam.getType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = consultTeam.getName() + ",您好!您有1条视频复诊已结束,请及时对咨询医生进行评价。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("视频复诊服务评价微信消息模板推送开始"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (consultTeam.getType()!=null&&17==consultTeam.getType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else if (consultTeam.getType()!=null&&17==consultTeam.getType()){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                first = consultTeam.getName() + ",您好!您有1条视频咨询已结束,请及时对咨询医生进行评价。"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                logger.info("视频咨询服务评价微信消息模板推送开始"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            contentMsg = "请对" + consDoctorDO.getName() + "医生的服务进行评价"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            msgUrl="/ims-wx/index.html#/fuwupingjia?consultCode="+consultTeam.getConsult(); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5225,8 +5213,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //根据身份证计算年龄 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            for (Map<String, Object> outpatient : list) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                String idcard = (String) outpatient.get("idcard"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                int patientAge = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                int patientSex = 3; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Integer patientAge = 0; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                Integer patientSex = 3; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (null!=outpatient.get("outPatient")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   BasePatientDO basePatientDO = basePatientDao.findById(outpatient.get("outPatient").toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                   if (null!=basePatientDO){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5702,7 +5690,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (pagesize <= 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            pagesize = 10; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        testHikar(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //testHikar(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        long statr = new Date().getTime(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.id AS \"id\", " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5713,6 +5701,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.job_title_code AS \"jobTitleCode\", " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.job_title_name AS \"jobTitleName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.charge_type AS \"chargeType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.dept_code AS \"deptCode\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " h.dept_name AS \"deptName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " dw.workTotal AS \"workTotal\","+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " d.consult_status AS \"consultStatus\"," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -5895,13 +5884,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\td.req_fee as \"xtzxFee\"\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "FROM\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "\t  ("+sql+")  t \n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where t.id is not null "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n"+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " where t.id is not null"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<Map<String,Object>> chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge, params); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        //查询医生各项评价平均分 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sqlscore = "select t.doctor as \"id\" ,sum(t.score)/3 as\"score\" from ("+ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -6246,13 +6235,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\td.req_fee as \"xtzxFee\"\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "FROM\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "\tbase_doctor t\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "WHERE t.id = '"+map.get("id")+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type and m.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type and a.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type and b.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type and v.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type and d.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    " LEFT JOIN wlyy_charge_dict g ON t.jyzx_charge_type = g.charge_type and g.is_del='1'\n" + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    "WHERE t.id = '"+map.get("id")+"'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            chargeDictDOLists =  hibenateUtils.createSQLQuery(sqlCharge); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            map.put("chargeTypeList",chargeDictDOLists); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //查询医生各项评价平均分 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -8994,13 +8983,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    logger.info("进入处方签名"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //处方签名 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    xzyyPrescriptionService.SOF_SignDataWithExtraInfo(wlyyPrescriptionDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String baseSign=xzyyPrescriptionService.SOF_SignDataWithExtraInfo(wlyyPrescriptionDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //同步电子病历 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (prescriptionEmrDO != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("电子病历同步"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            xzzxEntranceService.saveEmrToEntrance(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            xzzxEntranceService.saveEmrToEntrance(prescriptionId,baseSign); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("电子病历同步"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("电子病历签名"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            xzyyPrescriptionService.SOF_SignDataWithExtraInfoEmr(wlyyPrescriptionDO); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9547,7 +9536,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public net.sf.json.JSON outpatient(String patient) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public net.sf.json.JSON outpatient(String patient,String doctorId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            baseOperateLogService.saveOperateLog(doctorId,patient,"EMR","住院病历","",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }catch (Exception e){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientMappingDO mappingDO = patientMappingDao.findByPatient(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String url = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyHospitalSysDictDO wlyyHospitalSysDictDO = hospitalSysDictDao.findById("HAI_TAI_OUTPATIENT_URL"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -9571,6 +9565,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        XMLSerializer xmlSerializer = new XMLSerializer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        net.sf.json.JSON json = xmlSerializer.read(returnValue); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info("返回json" + json); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return json; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -10772,6 +10767,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setReqFee(twPrcie1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setChargeType(twPrcie+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setChargeName(twPrcie+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setIsDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO = wlyyChargeDictDao.save(chargeDictDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                doctorDO.setTwzxChargeType(chargeDictDO.getChargeType()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -10809,6 +10805,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setReqFee(spPrcie1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setChargeType(spPrcie+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setChargeName(spPrcie+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO.setIsDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    chargeDictDO = wlyyChargeDictDao.save(chargeDictDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                doctorDO.setSpzxChargeType(chargeDictDO.getChargeType()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -10888,6 +10885,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setReqFee(price1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setChargeType(price + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setChargeName(price + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setIsDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO = wlyyChargeDictDao.save(chargeDictDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        doctorDO.setTwzxChargeType(chargeDictDO.getChargeType()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -10907,6 +10905,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setReqFee(price1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setChargeType(price + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setChargeName(price + ""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO.setIsDel("1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            chargeDictDO = wlyyChargeDictDao.save(chargeDictDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        doctorDO.setSpzxChargeType(chargeDictDO.getChargeType()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12627,7 +12626,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void testHikar(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /*public void testHikar(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ObjectName poolName = new ObjectName("com.zaxxer.hikari:type=Pool (" + dataSource.getPoolName() + ")"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12645,7 +12644,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            e.printStackTrace(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    }*/ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public String findDomainUrlInDict(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            WlyyHospitalSysDictDO wlyyHospitalSysDictDO = wlyyHospitalSysDictDao.findById("domainUrl"); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12659,5 +12658,4 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |