| 
					
				 | 
			
			
				@ -256,15 +256,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PrescriptionSignDao prescriptionSignDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private EnterpriseService enterpriseService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private PrescriptionDiagnosisDao  prescriptionDiagnosisDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private XzyyPrescriptionService xzyyPrescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${demo.flag}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private boolean demoFlag; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Value("${wechat.id}") 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -7524,9 +7521,59 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    //同步电子病历 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    WlyyPrescriptionEmrDO prescriptionEmrDO = prescriptionEmrDao.findEmrByPrescriptionId(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (prescriptionEmrDO != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("电子病历同步"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        xzzxEntranceService.saveEmrToEntrance(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("电子病历同步"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        logger.info("电子病历签名"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        xzyyPrescriptionService.SOF_SignDataWithExtraInfoEmr(wlyyPrescriptionDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    if (object!=null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        //推送模板消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (object.getString("code").toString().equalsIgnoreCase("0")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            com.alibaba.fastjson.JSONObject jsonObject2 = object.getJSONObject("data"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            com.alibaba.fastjson.JSONObject jsonObject1 = jsonObject2.getJSONObject("PresDetail"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            //  * @param applyDepaName @param applyDoctorName 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String patientCode = outpatientDO.getConsumer(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String realerOrder = prescriptionDO.getRealOrder(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String recipeTime = DateUtil.dateToStr(prescriptionDO.getCreateTime(), "yyyyMMddHHmmss"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            List<BaseDoctorHospitalDO> doctorHospitalDOS = baseDoctorHospitalDao.findByDoctorCode(prescriptionDO.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String applyDepaName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (doctorHospitalDOS != null && doctorHospitalDOS.size() != 0) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                applyDepaName = doctorHospitalDOS.get(0).getDeptName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String voucherNo = jsonObject1.get("voucherNo") + ""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String applyDoctorName = prescriptionDO.getDoctorName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            BasePatientDO patientDO = basePatientDao.findById(patientCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String userName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String idcard = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (patientDO != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                userName = patientDO.getName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                idcard = patientDO.getIdcard(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            PatientMappingDO patientMappingDO = patientMappingDao.findByPatient(patientCode); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String userNo = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (patientMappingDO != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                userNo = patientMappingDO.getMappingCode(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String cardNo = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if (StringUtils.isNoneBlank(outpatientDO.getCardNo())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                cardNo = outpatientDO.getCardNo(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("cardNo:" + cardNo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            JSONObject jsonObject =entranceService.BS15054(patientMappingDO.getMappingCode(),prescriptionDO.getRealOrder(),demoFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            net.sf.json.JSONObject res = jsonObject.getJSONObject("resquest"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            logger.info("获取待结算数据 res: " + res.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String rsCode = res.getString("@RESULT"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            String free= 0+""; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            if ("0".equals(rsCode)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                free = res.getString("@total_charge"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            ylzPayService.msgPush("01", cardNo, "01", patientDO.getMobile(), "00", userNo, userName, idcard, voucherNo, applyDepaName, applyDoctorName, recipeTime, free, "1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                } catch (Exception e) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    e.printStackTrace(); 
			 |