| 
					
				 | 
			
			
				@ -33,6 +33,7 @@ import com.yihu.jw.order.dao.ConsultOrderDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.order.pay.wx.WeChatConfig; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.order.pay.ylz.YlzPayService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.patient.dao.BasePatientDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.IdCardUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.QrcodeUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.common.XMLUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.util.date.DateUtil; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -42,6 +43,7 @@ import com.yihu.jw.utils.ByteToInputStream; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.BasePatientWechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.WechatDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.dao.WxPayLogDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.wechat.enterprise.EnterpriseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.mysql.query.BaseJpaService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.collections.map.HashedMap; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.apache.commons.lang3.StringUtils; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -108,6 +110,8 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private XzzxEntranceService xzzxEntranceService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${wechat.flag}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private boolean flag; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private EnterpriseService enterpriseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -992,7 +996,32 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")||businessOrderDO.getOrderCategory().equalsIgnoreCase("3")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           wlyyOutpatientDO.setPayStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           outpatientDao.save(wlyyOutpatientDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //发送企业模板消息给医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patientDO = new BasePatientDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String msg = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String name=outpatientDO.getPatientName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sex = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String age=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String date = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String title = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (patientDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (outpatientDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (outpatientDO.getType().equalsIgnoreCase("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "图文复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else if (outpatientDO.getType().equalsIgnoreCase("2")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "视频复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            System.out.println("发送企业模板消息成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -1027,7 +1056,32 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("2")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            WlyyOutpatientDO wlyyOutpatientDO = outpatientDao.findById(businessOrderDO.getRelationCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            wlyyOutpatientDO.setPayStatus(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            outpatientDao.save(wlyyOutpatientDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            WlyyOutpatientDO outpatientDO = outpatientDao.save(wlyyOutpatientDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //发送企业模板消息给医生 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patientDO = new BasePatientDO(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String msg = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String name=outpatientDO.getPatientName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String sex = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String age=""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String date = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String title = ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String url="https://hlwyy.xmzsh.com/hlwyy/ims-app-web/#/onlineChat/detail?_rs_title="+outpatientDO.getDescription()+"&type=3&id="+outpatientDO.getId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (patientDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                sex= IdCardUtil.getSexForIdcard(patientDO.getIdcard()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                age = IdCardUtil.getAgeForIdcard(patientDO.getIdcard())+""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (outpatientDO!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if (outpatientDO.getType().equalsIgnoreCase("1")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "图文复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    msg = name+"("+sex+" "+age+"岁)向您发起了图文复诊,点击查看"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                }else if (outpatientDO.getType().equalsIgnoreCase("2")){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    title = "视频复诊"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    date = DateUtil.dateToStrLong(outpatientDO.getRegisterDate()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    msg = name+"("+sex+" "+age+"岁)预约了"+date+"的视频复诊,点击查看"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            enterpriseService.sendTWMesByDoctor("zsyy",outpatientDO.getDoctor(),title,msg,url); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            System.out.println("发送企业模板消息成功"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } else if (businessOrderDO.getOrderCategory().equalsIgnoreCase("4")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            List<WlyyPrescriptionDO> wlyyPrescriptionDOS = prescriptionDao.findById(businessOrderDO.getRelationCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (wlyyPrescriptionDOS!=null&&wlyyPrescriptionDOS.size()!=0){ 
			 |