|  | @ -8,18 +8,24 @@ import com.yihu.jw.doctor.service.BaseDoctorInfoService;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.dict.DictJobTitleDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.order.BusinessOrderDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.prescription.dao.PrescriptionDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.prescription.service.PrescriptionService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.service.consult.SysDictService;
 | 
	
		
			
				|  |  | 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.WlyyPrescriptionVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ListEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ObjEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.patient.PatientRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.common.XMLUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.wechat.service.WechatInfoService;
 | 
	
		
			
				|  |  | import com.ylzinfo.onepay.sdk.OnepayDefaultClient;
 | 
	
	
		
			
				|  | @ -84,6 +90,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     private OauthYlzConfigDao oauthYlzConfigDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private HospitalDeptService hospitalDeptService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BusinessOrderDao businessOrderDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PrescriptionDao prescriptionDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -320,7 +330,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     @ResponseBody
 | 
	
		
			
				|  |  |     @ApiOperation("微信支付结果通知")
 | 
	
		
			
				|  |  |     @RequestMapping(value = "/notify", method = {RequestMethod.GET, RequestMethod.POST})
 | 
	
		
			
				|  |  |     public Map<String, String> wxPayNotify(HttpServletRequest request, HttpServletResponse response) throws IOException {
 | 
	
		
			
				|  |  |     public Map<String, String> wxPayNotify(HttpServletRequest request, HttpServletResponse response) throws Exception {
 | 
	
		
			
				|  |  |         String result = "";
 | 
	
		
			
				|  |  |         String inputLine;
 | 
	
		
			
				|  |  |         while ((inputLine = request.getReader().readLine()) != null) {
 | 
	
	
		
			
				|  | @ -328,6 +338,21 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         request.getReader().close();
 | 
	
		
			
				|  |  |         Map<String, String> map = businessOrderService.getWxPayResultNotify(result);
 | 
	
		
			
				|  |  |         //im处方发消息
 | 
	
		
			
				|  |  |         Map<String,Object> wxrs =  XMLUtil.xmltoMap(result);
 | 
	
		
			
				|  |  |         if("SUCCESS".equals(wxrs.get("return_code").toString())){
 | 
	
		
			
				|  |  |             // 我方 订单号+时间差
 | 
	
		
			
				|  |  |             String seqNo = wxrs.get("out_trade_no")+"";
 | 
	
		
			
				|  |  |             BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(seqNo);
 | 
	
		
			
				|  |  |             if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
 | 
	
		
			
				|  |  |                 WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
 | 
	
		
			
				|  |  |                 JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
 | 
	
		
			
				|  |  |                 logger.info("11111参数入参"+object.toJSONString());
 | 
	
		
			
				|  |  |                 WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
 | 
	
		
			
				|  |  |                 imService.pushPrescriptionImMessage(prescriptionVO);
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         return map;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
	
		
			
				|  | @ -378,6 +403,15 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |                     logger.info("param"+params);
 | 
	
		
			
				|  |  |                     String traceNo = param.getString("outChargeNo");
 | 
	
		
			
				|  |  |                     businessOrderService.updatePayStatus(traceNo);
 | 
	
		
			
				|  |  |                     //im处方发消息
 | 
	
		
			
				|  |  |                     BusinessOrderDO businessOrderDO = businessOrderDao.selectByOrderNo(traceNo);
 | 
	
		
			
				|  |  |                     if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
 | 
	
		
			
				|  |  |                         WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
 | 
	
		
			
				|  |  |                         JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
 | 
	
		
			
				|  |  |                         logger.info("11111参数入参"+object.toJSONString());
 | 
	
		
			
				|  |  |                         WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
 | 
	
		
			
				|  |  |                         imService.pushPrescriptionImMessage(prescriptionVO);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     response.getWriter().write("SUCCESS");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 |