| 
					
				 | 
			
			
				@ -28,6 +28,7 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.im.ConsultTeamDo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseDoctorPatientFollowDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.org.BaseOrgDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.BaseNatPatientFamilyMemberDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.BasePatientDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.patient.PatientMedicareCardDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.entity.base.words.BaseSensitiveDO; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -60,6 +61,7 @@ import com.yihu.jw.hospital.doctor.dao.DoctorWorkTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.doctor.dao.PatientRegisterTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.doctor.dao.WlyyDoctorOnlineTimeDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.drugstore.dao.BaseDrugStoreDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.family.dao.WlyyNatPatientFamilyMemberDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.httplog.service.BaseOperateLogService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.jw.hospital.mapping.dao.DoctorMappingDao; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -333,6 +335,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private HealthCareService healthCareService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private HcyyPrescriptionService hcyyPrescriptionService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    private WlyyNatPatientFamilyMemberDao natPatientFamilyMemberDao; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public static String entranceUrl = "http://172.16.100.240:10023/xzzx/"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12179,7 +12183,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Map saveNatAppointment(String chargeAmount,String inspectionName,String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushFlag,String cardNoType,String consumer, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo,String idnoType,Integer source) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                  String checkPart,String chargeFlag,String chargeCode,String icdCode,String preNo,String idnoType,Integer source,String patientHisId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Map returnMap = new HashMap(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer winNo = 6; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (checkPart==null||checkPart==""){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12292,6 +12296,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setAmpm(pm); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setConsumer(consumer); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setConsumerName(name); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO.setPatientHisId(patientHisId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    try { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        rs = entranceService.BS10111(mediaCard, map.get("doctorMappingCode").toString(), map.get("deptCode").toString(), "31", "6", demoFlag); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12716,11 +12721,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String userName = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String idcard = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (patientDO != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                userName = patientDO.getName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                userName = baseNatAppointmentDO.getName(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                idcard = patientDO.getIdcard(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String hisId = patientMappingService.findHisPatNoByPatient(baseNatAppointmentDO.getPatientId(),baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("cardNo:" + baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(!patientDO.getIdcard().equalsIgnoreCase(baseNatAppointmentDO.getCardNo())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hisId = baseNatAppointmentDO.getPatientHisId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject jsonObject1 =entranceService.BS15054(hisId,baseNatAppointmentDO.getRealOrder(),demoFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("获取待结算数据 res: " + res.toString()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12867,7 +12875,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return "发送成功!"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,Integer page ,Integer pageSize){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public MixEnvelop getNatRecords(String patientId,String id,String payStatus,String appointmentTime, String isSuccess,String idcard,Integer page ,Integer pageSize){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql = "select t.name as \"name\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.card_no as \"cardNo\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.card_type as \"cardType\"," + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12883,6 +12891,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.dept_name as \"deptName\","+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.id as \"id\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.card_no_type as \"cardNoType\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.province_name as \"provinceName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.city_name as \"cityName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.town_name as \"townName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.street_name as \"streetName\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.address as \"address\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.HOSPITAL_FLAG as \"hospitalFlag\"," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                "t.charge_amount as \"chargeAmount\"," ; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if ("xm_tasy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12914,6 +12927,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+=" and t.is_success ="+isSuccess; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNoneBlank(idcard)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql+="  and t.card_no ='"+idcard+"' "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (StringUtils.isNoneBlank(appointmentTime)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -12945,8 +12961,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public void savePayStatusByHis(String patientId) throws Exception { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<BaseNatAppointmentDO> baseNatAppointmentDOList = baseNatAppointmentDao.findPayStatusByPatientId(patientId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (BaseNatAppointmentDO baseNatAppointmentDO:baseNatAppointmentDOList){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            BasePatientDO patientDO = basePatientDao.findById(baseNatAppointmentDO.getPatientId()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            String hisId = patientMappingService.findHisPatNoByPatient(patientId,baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("cardNo:" + baseNatAppointmentDO.getMedicare()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(!patientDO.getIdcard().equalsIgnoreCase(baseNatAppointmentDO.getCardNo())){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                hisId = baseNatAppointmentDO.getPatientHisId(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject jsonObject1 =entranceService.BS15054(hisId,baseNatAppointmentDO.getRealOrder(),demoFlag); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            net.sf.json.JSONObject res = jsonObject1.getJSONObject("resquest"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            logger.info("获取待结算数据 res: " + res.toString()); 
			 |