|  | @ -9,15 +9,18 @@ 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.hospital.prescription.WlyyPrescriptionInfoDO;
 | 
	
		
			
				|  |  | 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.dao.PrescriptionInfoDao;
 | 
	
		
			
				|  |  | 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.WlyyPrescriptionInfoVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.hospital.prescription.WlyyPrescriptionVO;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.Envelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.restmodel.web.ListEnvelop;
 | 
	
	
		
			
				|  | @ -49,6 +52,7 @@ import javax.servlet.http.HttpServletResponse;
 | 
	
		
			
				|  |  | import java.io.IOException;
 | 
	
		
			
				|  |  | import java.io.InputStream;
 | 
	
		
			
				|  |  | import java.nio.charset.Charset;
 | 
	
		
			
				|  |  | import java.util.ArrayList;
 | 
	
		
			
				|  |  | import java.util.Date;
 | 
	
		
			
				|  |  | import java.util.List;
 | 
	
		
			
				|  |  | import java.util.Map;
 | 
	
	
		
			
				|  | @ -94,6 +98,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |     private BusinessOrderDao businessOrderDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PrescriptionDao prescriptionDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PrescriptionInfoDao prescriptionInfoDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -337,22 +343,33 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |             result += inputLine;
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         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);
 | 
	
		
			
				|  |  |             if (businessOrderDO.getStatus()!=1){
 | 
	
		
			
				|  |  |                 if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
 | 
	
		
			
				|  |  |                     WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
 | 
	
		
			
				|  |  |                     JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
 | 
	
		
			
				|  |  |                     logger.info("wlyyPrescriptionDO参数入参"+object.toJSONString());
 | 
	
		
			
				|  |  |                     WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
 | 
	
		
			
				|  |  |                     List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
 | 
	
		
			
				|  |  |                     List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
 | 
	
		
			
				|  |  |                     for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
 | 
	
		
			
				|  |  |                         JSONObject jsonObject1 = (JSONObject) JSONObject.toJSON(wlyyPrescriptionInfoDO);
 | 
	
		
			
				|  |  |                         logger.info("wlyyPrescriptionInfoDO参数入参"+jsonObject1.toJSONString());
 | 
	
		
			
				|  |  |                         WlyyPrescriptionInfoVO prescriptionInfoVO = JSONObject.toJavaObject(jsonObject1,WlyyPrescriptionInfoVO.class);
 | 
	
		
			
				|  |  |                         wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
 | 
	
		
			
				|  |  |                     prescriptionVO.setPayStatus(1);
 | 
	
		
			
				|  |  |                     imService.pushPrescriptionImMessage(prescriptionVO);
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         Map<String, String> map = businessOrderService.getWxPayResultNotify(result);
 | 
	
		
			
				|  |  |         return map;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     }
 | 
	
	
		
			
				|  | @ -402,16 +419,29 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
 | 
	
		
			
				|  |  |                     JSONObject param = jsonObject.getJSONObject("param");
 | 
	
		
			
				|  |  |                     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);
 | 
	
		
			
				|  |  |                     if (businessOrderDO.getStatus()!=1){
 | 
	
		
			
				|  |  |                         if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("4")){
 | 
	
		
			
				|  |  |                             WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(businessOrderDO.getRelationCode());
 | 
	
		
			
				|  |  |                             JSONObject object = (JSONObject) JSONObject.toJSON(wlyyPrescriptionDO);
 | 
	
		
			
				|  |  |                             logger.info("wlyyPrescriptionDO参数入参"+object.toJSONString());
 | 
	
		
			
				|  |  |                             WlyyPrescriptionVO prescriptionVO = JSONObject.toJavaObject(object,WlyyPrescriptionVO.class);
 | 
	
		
			
				|  |  |                             List<WlyyPrescriptionInfoDO> wlyyPrescriptionInfoDOS = prescriptionInfoDao.findByPrescriptionId(wlyyPrescriptionDO.getId(),1);
 | 
	
		
			
				|  |  |                             List<WlyyPrescriptionInfoVO> wlyyPrescriptionInfoVOS = new ArrayList<>();
 | 
	
		
			
				|  |  |                             for (WlyyPrescriptionInfoDO wlyyPrescriptionInfoDO:wlyyPrescriptionInfoDOS){
 | 
	
		
			
				|  |  |                                 JSONObject jsonObject1 = (JSONObject) JSONObject.toJSON(wlyyPrescriptionInfoDO);
 | 
	
		
			
				|  |  |                                 logger.info("wlyyPrescriptionInfoDO参数入参"+jsonObject1.toJSONString());
 | 
	
		
			
				|  |  |                                 WlyyPrescriptionInfoVO prescriptionInfoVO = JSONObject.toJavaObject(jsonObject1,WlyyPrescriptionInfoVO.class);
 | 
	
		
			
				|  |  |                                 wlyyPrescriptionInfoVOS.add(prescriptionInfoVO);
 | 
	
		
			
				|  |  |                             }
 | 
	
		
			
				|  |  |                             prescriptionVO.setInfoVOs(wlyyPrescriptionInfoVOS);
 | 
	
		
			
				|  |  |                             prescriptionVO.setPayStatus(1);
 | 
	
		
			
				|  |  |                             imService.pushPrescriptionImMessage(prescriptionVO);
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     businessOrderService.updatePayStatus(traceNo);
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |                     response.getWriter().write("SUCCESS");
 | 
	
		
			
				|  |  |                 }
 | 
	
		
			
				|  |  |             }
 |