| 
					
				 | 
			
			
				@ -66,6 +66,7 @@ import javax.persistence.criteria.CriteriaBuilder; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.io.InputStream; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.math.BigDecimal; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.rmi.server.ExportException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.text.DecimalFormat; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3859,6 +3860,7 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        DecimalFormat df = new DecimalFormat("0.00"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        ylzMedicalRelationDO = ylzMedicailRelationDao.findByOutpatient(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BaseDoctorDO doctorDO = baseDoctorDao.findById(wlyyPrescriptionDO.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (ylzMedicalRelationDO==null){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3867,8 +3869,8 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setRelationCode(outpatientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setName(wlyyPrescriptionDO.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setTotalAmount(wlyyPrescriptionDO.getDrugFee()+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setPersonCash(wlyyPrescriptionDO.getDrugFee()+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setTotalAmount(df.format(wlyyPrescriptionDO.getDrugFee())+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setPersonCash(df.format(wlyyPrescriptionDO.getDrugFee())+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setHisSerial(wlyyPrescriptionDO.getRealOrder()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setHisBillSerial(wlyyPrescriptionDO.getRealOrder()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setDeptCode(dept); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3894,7 +3896,7 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setHisSettleNo(wlyyPrescriptionDO.getRealOrder()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setCardNo(outpatientDO.getCardNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setDate(wlyyPrescriptionDO.getCreateTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setBcwkje(wlyyPrescriptionDO.getDrugFee()+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setBcwkje(df.format(wlyyPrescriptionDO.getDrugFee())+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setLogNo(wlyyPrescriptionDO.getRealOrder()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3903,8 +3905,8 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setDel(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setMedicalState(Integer.parseInt(outpatientDO.getMedicalState())); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setName(wlyyPrescriptionDO.getPatientName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setTotalAmount(wlyyPrescriptionDO.getDrugFee()+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setPersonCash(wlyyPrescriptionDO.getDrugFee()+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setTotalAmount(df.format(wlyyPrescriptionDO.getDrugFee())+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setPersonCash(df.format(wlyyPrescriptionDO.getDrugFee())+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setHisSerial(outpatientDO.getRegisterNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setHisBillSerial(outpatientDO.getRealOrder()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setDeptCode(dept); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -3926,7 +3928,7 @@ public class YkyyEntranceService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setHisSettleNo(wlyyPrescriptionDO.getRealOrder()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setCardNo(outpatientDO.getCardNo()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setDate(wlyyPrescriptionDO.getCreateTime()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setBcwkje(wlyyPrescriptionDO.getDrugFee()+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            ylzMedicalRelationDO.setBcwkje(df.format(wlyyPrescriptionDO.getDrugFee())+""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        ylzMedicalRelationDO = ylzMedicailRelationDao.save(ylzMedicalRelationDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        ylzMedicailMxDao.deleteByMedicalId(ylzMedicalRelationDO.getId()); 
			 |