|  | @ -7,7 +7,6 @@ import com.yihu.jw.doctor.dao.BaseDoctorDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.im.ConsultDo;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.patient.BasePatientDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.sms.SmsTemplateDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.wx.WxPayLogDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.wx.WxWechatDO;
 | 
	
	
		
			
				|  | @ -1738,7 +1737,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      * @throws Exception
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId,String wxPayType) throws Exception {
 | 
	
		
			
				|  |  |     public Map yktMedicalCardTopUp(String mzhm,Double jkje,Integer type,Integer paymentType,String patientId,String wechatId,String hospitalId,String wxPayType,String appletCode) throws Exception {
 | 
	
		
			
				|  |  |         BasePatientDO patientDO = patientDao.findById(patientId);
 | 
	
		
			
				|  |  |         BusinessOrderDO businessOrderDO = new BusinessOrderDO();
 | 
	
		
			
				|  |  |         businessOrderDO.setPatient(patientId);
 | 
	
	
		
			
				|  | @ -1776,18 +1775,37 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         businessOrderDO = businessOrderDao.save(businessOrderDO);
 | 
	
		
			
				|  |  |         List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
 | 
	
		
			
				|  |  |         WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
 | 
	
		
			
				|  |  |         String openid = "";
 | 
	
		
			
				|  |  |         if (StringUtils.isNotBlank(appletCode)){
 | 
	
		
			
				|  |  |             logger.info("appletCode不为空"+appletCode);
 | 
	
		
			
				|  |  |             Map<String,Object> objectMap = checkApplets(appletCode,wxWechatDO.getApplets(),wxWechatDO.getAppletsSecret());
 | 
	
		
			
				|  |  |             if (objectMap!=null){
 | 
	
		
			
				|  |  |                 openid = objectMap.get("openid").toString();
 | 
	
		
			
				|  |  |                 logger.info("appletCode"+appletCode);
 | 
	
		
			
				|  |  |                 logger.info("openid"+openid);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }else {
 | 
	
		
			
				|  |  |             logger.info("appletCode为空"+appletCode);
 | 
	
		
			
				|  |  |             if (StringUtils.isNoneBlank(patientId)){
 | 
	
		
			
				|  |  |                 List<BasePatientWechatDo> patientWechatDo = patientWechatDao.findByWechatIdAndPatientId(wechatId,patientId);
 | 
	
		
			
				|  |  |                 if (patientWechatDo!=null&&patientWechatDo.size()!=0){
 | 
	
		
			
				|  |  |                     openid = patientWechatDo.get(0).getOpenid();
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |        /* List<BasePatientWechatDo> patientWechatDoList = patientWechatDao.findByWechatIdAndPatientId(wechatId, patientId);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if (patientWechatDoList==null || patientWechatDoList.size()==0){
 | 
	
		
			
				|  |  |             map.put("error","无openId");
 | 
	
		
			
				|  |  |             logger.info("error=无openId");
 | 
	
		
			
				|  |  |             return map;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |         String url = wxWechatDO.getBaseUrl();
 | 
	
		
			
				|  |  |         String notifyUrl =url;
 | 
	
		
			
				|  |  |         String price = (int)(businessOrderDO.getPayPrice()*100)+"";
 | 
	
		
			
				|  |  |         map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,wxPayType,patientWechatDoList.get(0).getOpenid(),businessOrderDO.getOrderNo(),notifyUrl,patientId);
 | 
	
		
			
				|  |  |         map = unifiedorder(wechatId,businessOrderDO.getDescription(),price,wxPayType,openid,businessOrderDO.getOrderNo(),notifyUrl,patientId);
 | 
	
		
			
				|  |  |         logger.info("success="+JSONObject.toJSONString(map));
 | 
	
		
			
				|  |  |         return map;
 | 
	
		
			
				|  |  |     }
 |