|  | @ -3,9 +3,12 @@ package com.yihu.jw.service.channel;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | import com.fasterxml.jackson.databind.ObjectMapper;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.prescription.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.order.BusinessOrderDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.prescription.dao.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.prescription.service.PrescriptionLogService;
 | 
	
		
			
				|  |  | import com.yihu.jw.im.service.ImService;
 | 
	
		
			
				|  |  | import com.yihu.jw.order.BusinessOrderService;
 | 
	
		
			
				|  |  | import com.yihu.jw.order.dao.BusinessOrderDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionDiagnosisVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionInfoVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
 | 
	
	
		
			
				|  | @ -38,6 +41,8 @@ public class PrescriptionStatusUpdateService {
 | 
	
		
			
				|  |  |     private static Logger logger = LoggerFactory.getLogger(PrescriptionStatusUpdateService.class);
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private JdbcTemplate jdbcTemplate;
 | 
	
		
			
				|  |  |     @Value("${wechat.id}")
 | 
	
		
			
				|  |  |     private String wechatId;
 | 
	
		
			
				|  |  |     @Value("${hlwyyEntrance.url}")
 | 
	
		
			
				|  |  |     private String hlwyyEntranceUrl;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
	
		
			
				|  | @ -51,6 +56,10 @@ public class PrescriptionStatusUpdateService {
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private ImService imService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BusinessOrderDao businessOrderDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BusinessOrderService businessOrderService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PrescriptionLogService prescriptionLogService;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public void autoPush() throws Exception {
 | 
	
	
		
			
				|  | @ -291,6 +300,22 @@ public class PrescriptionStatusUpdateService {
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |                 outpatientDao.save(outpatientDOs);
 | 
	
		
			
				|  |  |                 if (wechatId.equalsIgnoreCase(""))
 | 
	
		
			
				|  |  |                 //退费
 | 
	
		
			
				|  |  |                 for (WlyyOutpatientDO outpatientDO:outpatientDOs){
 | 
	
		
			
				|  |  |                     BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outpatientDO.getId());
 | 
	
		
			
				|  |  |                     if (businessOrderDO!=null){
 | 
	
		
			
				|  |  |                         try {
 | 
	
		
			
				|  |  |                             if (businessOrderDO.getPayType()==1){
 | 
	
		
			
				|  |  |                                 businessOrderService.orderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
 | 
	
		
			
				|  |  |                             }else if (businessOrderDO.getPayType()==3){
 | 
	
		
			
				|  |  |                                 businessOrderService.ylzOrderRefund(wechatId,businessOrderDO.getPatient(),businessOrderDO.getOrderNo(),businessOrderDO.getPayPrice(),businessOrderDO.getDescription());
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                         } catch (Exception e) {
 | 
	
		
			
				|  |  |                             e.printStackTrace();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                 logger.info("setOutPatientOver count :"+outpatientDOs.size());
 |