| 
					
				 | 
			
			
				@ -22,6 +22,7 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.prescription.service.entrance.util.WebserviceUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.hospital.archive.ArchiveVO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.restmodel.hospital.prescription.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.PwdUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -2282,4 +2283,94 @@ public class EntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return i; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 建立档案 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param archiveVO 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param demoFlag 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @throws Exception 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public net.sf.json.JSONObject BS16018(ArchiveVO archiveVO, boolean demoFlag) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String fid="BS16018"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        logger.info(" BS16018 begin"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String resp=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (demoFlag) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            resp = getJosnFileResullt(fid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            StringBuffer sbs = new StringBuffer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //AccessControl :用户、密码、服务id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("<ESBEntry><AccessControl><Fid>" + fid + "</Fid><UserName>"+mqUser+"</UserName><Password>"+mqPwd+"</Password></AccessControl>"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //MessageHeader :固定值 消费方系统编号 S60,提供方系统编号 S01 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("<MessageHeader><Fid>" + fid + "</Fid><MsgDate>" + DateUtil.dateToStr(new Date(), DateUtil.YYYY_MM_DD_HH_MM_SS) + "</MsgDate><SourceSysCode>"+sourceSysCode+"</SourceSysCode><TargetSysCode>"+"TO1"+"</TargetSysCode></MessageHeader>"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("<Msg>"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("<root>"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("<request "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getId0000())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" id0000=\""+archiveVO.getId0000()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getCardno())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" cardno=\""+archiveVO.getCardno()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getXming0())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" xming0=\""+archiveVO.getXming0()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getSfzhao())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" sfzhao=\""+archiveVO.getSfzhao()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getXbie00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" xbie00=\""+archiveVO.getXbie00()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getBrnl00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" brnl00=\""+archiveVO.getBrnl00()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getYytel0())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" yytel0=\""+archiveVO.getYytel0()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getCsrq00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" csrq00=\""+archiveVO.getCsrq00()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getBjjbie())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" bjjbie=\""+archiveVO.getBjjbie()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getCardtype())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" cardtype=\""+archiveVO.getCardtype()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getGuid00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" guid00=\""+archiveVO.getGuid00()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getGrsfen())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" grsfen=\""+archiveVO.getGrsfen()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getAddres())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" addres=\""+archiveVO.getAddres()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getSmdj00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" smdj00=\""+archiveVO.getSmdj00()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getEhealthCardId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" ehealth_card_id=\""+archiveVO.getEhealthCardId()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getMindexId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" mindex_id=\""+archiveVO.getMindexId()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getSmkId())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" smk_id=\""+archiveVO.getSmkId()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(StringUtils.isNotBlank(archiveVO.getFwqd00())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sbs.append(" fwqd00=\""+archiveVO.getFwqd00()+"\" "); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append(" />"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("</root>"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("</Msg>"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //查询信息拼接 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info(fid+" sbs:"+sbs.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sbs.append("<startNum>1</startNum></MsgInfo></ESBEntry>"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            resp = MqSdkUtil.putReqAndGetRespByQueryStr(sbs.toString(), fid); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            resp = MqSdkUtil.xml2jsonArrayRootRow(resp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info(fid+" resp:"+resp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return ConvertUtil.convertListEnvelopInRequest(resp); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |