|  | @ -22,6 +22,7 @@ import com.yihu.jw.entity.hospital.doctor.WlyyDoctorWorkTimeDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.doctor.WlyyPatientRegisterTimeDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.message.SystemMessageDO;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.hospital.prescription.*;
 | 
	
		
			
				|  |  | import com.yihu.jw.entity.order.BusinessOrderDO;
 | 
	
	
		
			
				|  | @ -35,6 +36,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.httplog.dao.WlyyHttpLogDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.mapping.dao.PatientMappingDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.mapping.service.DoctorMappingService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.mapping.service.PatientMappingService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.message.service.SystemMessageService;
 | 
	
	
		
			
				|  | @ -44,6 +46,7 @@ import com.yihu.jw.hospital.prescription.service.entrance.YkyyEntranceService;
 | 
	
		
			
				|  |  | import com.yihu.jw.hospital.ykyy.service.YkyyService;
 | 
	
		
			
				|  |  | import com.yihu.jw.order.BusinessOrderService;
 | 
	
		
			
				|  |  | import com.yihu.jw.order.dao.BusinessOrderDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.order.pay.ylz.YlzPayService;
 | 
	
		
			
				|  |  | import com.yihu.jw.org.dao.BaseOrgDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.patient.dao.BaseDoctorPatientFollowDao;
 | 
	
		
			
				|  |  | import com.yihu.jw.patient.dao.BasePatientDao;
 | 
	
	
		
			
				|  | @ -59,6 +62,7 @@ import com.yihu.jw.restmodel.web.MixEnvelop;
 | 
	
		
			
				|  |  | import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.common.IdCardUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.util.date.DateUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.StringUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.WebserviceUtil;
 | 
	
		
			
				|  |  | import com.yihu.jw.utils.hibernate.HibenateUtils;
 | 
	
		
			
				|  |  | import com.yihu.mysql.query.BaseJpaService;
 | 
	
	
		
			
				|  | @ -193,6 +197,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |     private WlyyConsultAdviceDao wlyyConsultAdviceDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private WlyyHospitalSysDictDao hospitalSysDictDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private YlzPayService ylzPayService;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private BasePatientMedicareCardDao patientMedicareCardDao;
 | 
	
		
			
				|  |  |     @Autowired
 | 
	
		
			
				|  |  |     private PatientMappingDao patientMappingDao;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     @Value("${demo.flag}")
 | 
	
	
		
			
				|  | @ -669,6 +679,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         //1.保存就诊实体
 | 
	
		
			
				|  |  |         WlyyOutpatientDO outpatientDO = objectMapper.readValue(outpatientJson,WlyyOutpatientDO.class);
 | 
	
		
			
				|  |  |         BasePatientDO patientDO = basePatientDao.findById(outpatientDO.getPatient());
 | 
	
		
			
				|  |  |         BaseDoctorDO doctorDO = baseDoctorDao.findById(outpatientDO.getDoctor());
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         outpatientDO.setMjz("mz");
 | 
	
		
			
				|  |  |         outpatientDO.setStatus("0");
 | 
	
	
		
			
				|  | @ -683,8 +694,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
 | 
	
		
			
				|  |  |         Double price = 0.0;
 | 
	
		
			
				|  |  |         if(doctorDO!=null&&StringUtils.isNoneBlank(doctorDO.getFee())){
 | 
	
		
			
				|  |  |              price = Double.parseDouble(doctorDO.getFee());
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         Double price = 0.01;
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         businessOrderService.recharge(outpatient.getId(),"复诊-诊查费","2","复诊-诊查费",patientDO.getId(),patientDO.getName(),outpatient.getDoctor(),price);
 | 
	
		
			
				|  |  | 
 | 
	
	
		
			
				|  | @ -2028,7 +2043,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                 result.put("mes", "诊断完成");
 | 
	
		
			
				|  |  |                 return result;
 | 
	
		
			
				|  |  |             }else if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
 | 
	
		
			
				|  |  |                 Double price = 0.01;
 | 
	
		
			
				|  |  |                 Double price =  prescription.getDrugFee();
 | 
	
		
			
				|  |  |                 businessOrderService.recharge(prescription.getId(),"处方收费","4","处方收费",prescription.getPatientCode(),prescription.getPatientName(),prescription.getDoctor(),price);
 | 
	
		
			
				|  |  |                 //上传his开方
 | 
	
		
			
				|  |  |                 //sendHisDiagnosis(jsonData, outpatientDO, prescription)
 | 
	
	
		
			
				|  | @ -4036,18 +4051,43 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |     }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     public Map<String,Object> updatePatientInfo(String patient,String name,String idcard,String ssc,Integer sex,String townCode,String townName,String committeeCode,String committeeName,String address){
 | 
	
		
			
				|  |  |     public Map<String,Object> updatePatientInfo(String patient,String name,String idcard,String ssc,Integer sex,String townCode,String townName,String committeeCode,String committeeName,String address,String photo,String mobile){
 | 
	
		
			
				|  |  |         Map<String,Object> rs = new HashedMap();
 | 
	
		
			
				|  |  |         BasePatientDO basePatientDO = basePatientDao.findById(patient);
 | 
	
		
			
				|  |  |         PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
 | 
	
		
			
				|  |  |         basePatientDO.setName(name);
 | 
	
		
			
				|  |  |         basePatientDO.setIdcard(idcard);
 | 
	
		
			
				|  |  |         basePatientDO.setSex(sex);
 | 
	
		
			
				|  |  |         basePatientDO.setTownCode(townCode);
 | 
	
		
			
				|  |  |         basePatientDO.setTownName(townName);
 | 
	
		
			
				|  |  |         basePatientDO.setCommitteeCode(committeeCode);
 | 
	
		
			
				|  |  |         basePatientDO.setCommitteeName(committeeName);
 | 
	
		
			
				|  |  |         basePatientDO.setAddress(address);
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(name)){
 | 
	
		
			
				|  |  |             basePatientDO.setName(name);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(idcard)){
 | 
	
		
			
				|  |  |             basePatientDO.setIdcard(idcard);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (sex!=null){
 | 
	
		
			
				|  |  |             basePatientDO.setSex(sex);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(townCode)){
 | 
	
		
			
				|  |  |             basePatientDO.setTownCode(townCode);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(townName)){
 | 
	
		
			
				|  |  |             basePatientDO.setTownName(townName);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(committeeCode)){
 | 
	
		
			
				|  |  |             basePatientDO.setCommitteeCode(committeeCode);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(committeeName)){
 | 
	
		
			
				|  |  |             basePatientDO.setCommitteeName(committeeName);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(address)){
 | 
	
		
			
				|  |  |             basePatientDO.setAddress(address);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(photo)){
 | 
	
		
			
				|  |  |             basePatientDO.setPhoto(photo);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         if (StringUtils.isNoneBlank(mobile)){
 | 
	
		
			
				|  |  |             basePatientDO.setMobile(mobile);
 | 
	
		
			
				|  |  |         }
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |         basePatientDO = basePatientDao.save(basePatientDO);
 | 
	
		
			
				|  |  |         if (patientMedicareCardDO!=null){
 | 
	
		
			
				|  |  |             patientMedicareCardDO.setCode(ssc);
 | 
	
	
		
			
				|  | @ -5590,7 +5630,31 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  |                         //设置his药品查询条件
 | 
	
		
			
				|  |  |                         setInspectionParam(jsonData, doctorMappingDO, outpatientDO, wlyyPrescriptionDO, ins, outpatientDO.getIcd10());
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                     sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
 | 
	
		
			
				|  |  |                     Map<String,Object> map = sendHisDiagnosis(jsonData, outpatientDO, wlyyPrescriptionDO);
 | 
	
		
			
				|  |  |                     if (map.get("code").toString().equalsIgnoreCase("0")){
 | 
	
		
			
				|  |  |                         //  * @param applyDepaName @param applyDoctorName
 | 
	
		
			
				|  |  |                         WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId);
 | 
	
		
			
				|  |  |                         String patientCode = prescriptionDO.getPatientCode();
 | 
	
		
			
				|  |  |                         String realerOrder = prescriptionDO.getRealOrder();
 | 
	
		
			
				|  |  |                         String free  = prescriptionDO.getDrugFee()+"";
 | 
	
		
			
				|  |  |                         String recipeTime = DateUtil.dateToStr(prescriptionDO.getCreateTime(),"yyyyMMddHHmmss");
 | 
	
		
			
				|  |  |                         String applyDepaName = prescriptionDO.getDeptName();
 | 
	
		
			
				|  |  |                         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();
 | 
	
		
			
				|  |  |                         }
 | 
	
		
			
				|  |  |                         PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patientCode,"1");
 | 
	
		
			
				|  |  |                         ylzPayService.msgPush("01",patientMedicareCardDO.getCode(),"01",patientDO.getMobile(),"03",userNo,userName,idcard,realerOrder,applyDepaName,applyDoctorName,recipeTime,free,"1");
 | 
	
		
			
				|  |  |                     }
 | 
	
		
			
				|  |  |                 } catch (Exception e) {
 | 
	
		
			
				|  |  |                     e.printStackTrace();
 | 
	
		
			
				|  |  |                 }
 | 
	
	
		
			
				|  | @ -5865,7 +5929,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
 | 
	
		
			
				|  |  | 
 | 
	
		
			
				|  |  |     /**
 | 
	
		
			
				|  |  |      * 保存排班规则
 | 
	
		
			
				|  |  |      * @param workRoleJsons
 | 
	
		
			
				|  |  |      * @param
 | 
	
		
			
				|  |  |      * @return
 | 
	
		
			
				|  |  |      */
 | 
	
		
			
				|  |  |     public Boolean sendOutPatientSuggest(String advicesJson){
 |