| 
					
				 | 
			
			
				@ -2,11 +2,7 @@ package com.yihu.wlyy.service.jimeiJkEdu; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONArray; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.alibaba.fastjson.JSONPObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.edu.entity.RoleWithAuthorityCheck; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.es.entity.FollowupContentESDO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.es.entity.HealthEduArticleES; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.es.entity.HealthEduArticlePatient; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.es.entity.RoleVo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.config.es.ElasticFactory; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import com.yihu.wlyy.config.es.ElastricSearchSave; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -44,8 +40,6 @@ import org.springframework.util.StringUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import java.util.*; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				import static org.bouncycastle.asn1.x509.X509ObjectIdentifiers.id; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * Created by liuwenbin on 2017/8/12. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 * 集美健教 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -127,7 +121,7 @@ public class JMJkEduArticleService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql2.append(" and currentUserRoleCode ="+currentUserRole); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtils.isEmpty(articleTitle)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql2.append(" and attachedTitle like'%"+articleTitle+"%'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql2.append(" and articleTitle like'%"+articleTitle+"%'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtils.isEmpty(sendTimeStart)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sendTimeStart = elasticsearchUtil.changeTime(sendTimeStart); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -236,7 +230,7 @@ public class JMJkEduArticleService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql2.append(" and currentUserRoleCode ="+currentUserRole); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtils.isEmpty(articleTitle)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql2.append(" and attachedTitle like'%"+articleTitle+"%'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sql2.append(" and articleTitle like'%"+articleTitle+"%'"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if(!StringUtils.isEmpty(sendTimeStart)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            sendTimeStart = elasticsearchUtil.changeTime(sendTimeStart); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -563,9 +557,13 @@ public class JMJkEduArticleService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            roleVoLists.add(roleVo); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,""); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        Date createTime = new Date(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        for (String patient : patientSet) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            one = patientDao.findByCode(patient); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if(one==null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                continue; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            HealthEduArticleES healthEduArticleES = new HealthEduArticleES(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setDoctorCode(doctor.getCode()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setDoctorName(doctor.getName()); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -593,7 +591,7 @@ public class JMJkEduArticleService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setHospitalName(doctor.getHospitalName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setTown(doctor.getTown()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setTownName(doctor.getTownName()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setCreateTime(new Date()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setCreateTime(createTime); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setSendType(sendType); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            healthEduArticleES.setArticleId(article.get("articleId") + ""); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -731,7 +729,7 @@ public class JMJkEduArticleService extends BaseService { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            if (!whereSql.endsWith(" and ( ")) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                whereSql += " or (l.label_type = 3 AND l.label in (" + labelDisease + ")) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } else { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                whereSql += " l.label_type = 1 AND l.label in (" + labelDisease + ")) "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                whereSql += " l.label_type = 1 AND l.label in (" + labelDisease + ") "; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!StringUtils.isEmpty(labelHealth) || !StringUtils.isEmpty(labelDisease)) { 
			 |