| 
					
				 | 
			
			
				@ -111,6 +111,8 @@ public class PrescriptionInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p1.put("adminTeamId","643"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p1.put("prescriptionType","门诊"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p1.put("date","2017-08-08 10:10:10"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p1.put("patient","37c0657335f94ed38eeced22dbed8011"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p1.put("patientName","花生"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                if(StringUtils.isNotBlank((String)p1.get("code"))){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    String sql = "SELECT p.status FROM wlyy_prescription p WHERE p.parent_code='2'"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    List<Map<String,Object>> list = jdbcTemplate.queryForList(sql); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -356,11 +358,11 @@ public class PrescriptionInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param code 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @return 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public JSONObject getContinuedPrescriptionAsDoctor(String code){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    public com.alibaba.fastjson.JSONObject getContinuedPrescriptionAsDoctor(String code){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Prescription prescription = prescriptionDao.findByCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        List<PrescriptionInfo> prescriptionInfos = prescriptionInfoDao.findByPrescriptionCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        PrescriptionReviewed reviewed  = prescriptionReviewedDao.findByPrescriptionCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject rs = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        com.alibaba.fastjson.JSONObject rs = new com.alibaba.fastjson.JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("prescription",prescription); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("prescriptionInfos",prescriptionInfos); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        rs.put("reviewed",reviewed); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -383,24 +385,11 @@ public class PrescriptionInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            Prescription p = prescriptionDao.findByCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				           //更新审核记录 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            PrescriptionReviewed reviewed = prescriptionReviewedDao.findByPrescriptionCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            PrescriptionReviewed reviewed = new PrescriptionReviewed(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setCode(getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setPrescriptionCode(code); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setRemark("医生审核"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setDoctor(p.getDoctor()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setDoctorName(p.getDoctorName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setHospital(p.getHospital()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setHospitalName(p.getHospitalName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setDept(p.getDept()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				//            reviewed.setDeptName(p.getDeptName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if("1".equals(state)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //审核通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p.setStatus(PrescriptionLog.PrescriptionLogStatus.reviewed_success.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //审核通过,前往智业开方 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p.setStatus(PrescriptionLog.PrescriptionLogStatus.adding.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p.setReviewedTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                reviewed.setReviewedTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.reviewed_success.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            }else{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //审核不通过 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                p.setStatus(PrescriptionLog.PrescriptionLogStatus.no_reviewed.getValue()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -408,6 +397,15 @@ public class PrescriptionInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                reviewed.setReason(reason); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                reviewed.setReviewedTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                reviewed.setStatus(PrescriptionReviewed.PrescriptionReviewedStatus.del.getValue()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //审核不用过发送消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                //发送Im消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                JSONObject content = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                content.put("title","我已经审核您"+ DateUtil.dateToStr(p.getCreateTime(),"yyyy-MM-dd")+"发起的续方申请"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                content.put("result","审核不通过"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                content.put("reason",reason); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                content.put("url",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                imUtill.sendTopicIM(p.getDoctor(),p.getDoctorName(),p.getConsult(),"1",content.toString(),null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionReviewedDao.save(reviewed); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionDao.save(p); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -425,17 +423,9 @@ public class PrescriptionInfoService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            log.setHospital(p.getHospital()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            log.setUserType(2); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            log.setFlag(1); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            log.setRemark("医生审核"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            log.setRemark("医生审核/开方"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            prescriptionLogDao.save(log); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //发送Im消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            JSONObject content = new JSONObject(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            content.put("title","我已经审核您"+ DateUtil.dateToStr(p.getCreateTime(),"yyyy-MM-dd")+"发起的续方申请"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            content.put("result","1".equals(state)?"审核通过":"审核不通过"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            content.put("reason","1".equals(state)?"":reason); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            content.put("url",""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            imUtill.sendTopicIM(p.getDoctor(),p.getDoctorName(),p.getConsult(),"1",content.toString(),null); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //同步智业接口 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            upLoadPrescriotionState(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return 1; 
			 |