| 
					
				 | 
			
			
				@ -38,6 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.BeanPropertyRowMapper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.jdbc.core.JdbcTemplate; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.stereotype.Service; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import org.springframework.transaction.annotation.Transactional; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.beans.PropertyDescriptor; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.lang.reflect.Method; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -47,6 +48,7 @@ import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * Created by Trick on 2019/5/17. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Service 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				@Transactional 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, PrescriptionDao> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    @Autowired 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -103,9 +105,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String sql ="SELECT " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.id, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.saas_id AS saasId, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.recipe_no AS recipeNo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.visit_no AS visitNo, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.real_order AS realOrder," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.origin_real_order AS originRealOrder," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.adm_no AS admNo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.origin_adm_no AS originAdmNo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.serial_no AS serialNo," + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.type AS type, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.patient_code AS patientCode, " + 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                " p.patient_name AS patientName, " + 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -256,6 +260,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String reservationTime = json.getString("reservationTime"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Integer consultType = json.getInteger("consultType"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String originRealOrder = json.getString("originRealOrder"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String originAdmNo = json.getString("originAdmNo"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        String serialNo = json.getString("serialNo"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BasePatientDO basePatientDO = basePatientDao.findById(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PatientMedicareCardDO cardDO = basePatientMedicareCardDao.findByTypeAndPatientCodeAndDel(PatientMedicareCardDO.Type.MedicareCard.getType(),patient,"1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        BaseDoctorDO baseDoctorDO = baseDoctorDao.findOne(doctor); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -321,4 +330,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public Boolean cancelPrescription(String prescriptionId){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        WlyyPrescriptionDO prescriptionDO = prescriptionDao.findOne(prescriptionId); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        prescriptionDO.setStatus(-2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        return true; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				} 
			 |