| 
					
				 | 
			
			
				@@ -18,6 +18,7 @@ import cn.hnthyy.thmz.mapper.his.mz.MzDepositFileMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hnthyy.thmz.mapper.his.mz.MzPatientMiMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hnthyy.thmz.mapper.his.mz.MzReceiptSerialMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hnthyy.thmz.mapper.his.mz.MzVisitTableMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import cn.hnthyy.thmz.mapper.his.yp.YpMzFytjMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hnthyy.thmz.mapper.thmz.ClinicMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hnthyy.thmz.mapper.thmz.ReceiptMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import cn.hnthyy.thmz.service.his.mz.MzPatientMiService; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -81,6 +82,8 @@ public class MzReceiptSerialServiceImpl implements MzReceiptSerialService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private MzVisitTableService mzVisitTableService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     private UserService userService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private YpMzFytjMapper ypMzFytjMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     @Override 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public List<MzReceiptSerial> queryTallyReceiptSerial(String patientId) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         return mzReceiptSerialMapper.selectTallyReceiptSerial(patientId); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -302,6 +305,11 @@ public class MzReceiptSerialServiceImpl implements MzReceiptSerialService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //更新收费明细表发票流水号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         mzChargeDetailMapper.updateBySerialNo(receiptNo, serialNo, oriSerialNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        //已发药更新发药记录流水号 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        int count = ypMzFytjMapper.queryYpMzFytjByOriSerialNo(oriSerialNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(count > 0){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            ypMzFytjMapper.updateYpMzFytjBySerialNo(receiptNo, serialNo, oriSerialNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         //更新接诊记录缴费次数 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         Clinic clinic=new Clinic(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         clinic.setPatientId(mzReceiptSerial.getPatientId()); 
			 |