| 
															
																@ -183,6 +183,12 @@ public class JMJkEduArticleService extends BaseService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            }else{ 
															 | 
															
															 | 
															
																            }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                heapm.setPointNumber(0);//文章点赞数 
															 | 
															
															 | 
															
																                heapm.setPointNumber(0);//文章点赞数 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(!StringUtils.isEmpty(article.getString("collectionNumberCount"))){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                heapm.setCollectionNumber(Integer.valueOf(article.getString("collectionNumberCount")));//文章点赞数 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                heapm.setCollectionNumber(0);//文章点赞数 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																             
															 | 
															
															 | 
															
																             
															 | 
														
													
												
													
														
															| 
															 | 
															
																            heapm.setArticleCover(article.getString("articleCover"));//封面 
															 | 
															
															 | 
															
																            heapm.setArticleCover(article.getString("articleCover"));//封面 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if(article.getString("insertTime")!=null){ 
															 | 
															
															 | 
															
																            if(article.getString("insertTime")!=null){ 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -520,51 +526,54 @@ public class JMJkEduArticleService extends BaseService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        List<HealthEduArticleES> healthEduArticleESList = new ArrayList<>(); 
															 | 
															
															 | 
															
																        List<HealthEduArticleES> healthEduArticleESList = new ArrayList<>(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        Doctor doctor = doctorDao.findByCode(sendCode); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        AdminTeam adminTeam =null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        if(teamId!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String resultSql =""; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String whereSql =""; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        switch (currentUserRoleLevel){ 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            case "1":{resultSql +=" DISTINCT (province_name) as name"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                whereSql+=" and province ='"+currentUserRoleCode+"'";break;} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            case "2":{resultSql +=" DISTINCT (city_name) as name"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                whereSql+=" and city ='"+currentUserRoleCode+"'";break;} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            case "3":{resultSql +=" DISTINCT (town_name) as name"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                whereSql+=" and town ='"+currentUserRoleCode+"'";break;} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            case "4":{resultSql +=" DISTINCT (name) as name"; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                whereSql+=" and code ='"+currentUserRoleCode+"'";break;} 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            adminTeam = adminTeamService.getTeam(teamId); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String doctorName = returnList.get(0).get("name")+""; 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Doctor doctor = doctorDao.findByCode(sendCode); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        AdminTeam adminTeam = adminTeamService.getTeam(teamId); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        Patient one = null; 
															 | 
															
															 | 
															
																        Patient one = null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        String batchNo = UUID.randomUUID().toString(); 
															 | 
															
															 | 
															
																        String batchNo = UUID.randomUUID().toString(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        for (String patient : patientSet) { 
															 | 
															
															 | 
															
																        for (String patient : patientSet) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            one = patientDao.findByCode(patient); 
															 | 
															
															 | 
															
																            one = patientDao.findByCode(patient); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            HealthEduArticleES healthEduArticleES = new HealthEduArticleES(); 
															 | 
															
															 | 
															
																            HealthEduArticleES healthEduArticleES = new HealthEduArticleES(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            healthEduArticleES.setDoctorCode(doctor.getCode()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            healthEduArticleES.setDoctorName(doctor.getName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setBatchNo(batchNo); 
															 | 
															
															 | 
															
																            healthEduArticleES.setBatchNo(batchNo); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setPatientCode(patient); 
															 | 
															
															 | 
															
																            healthEduArticleES.setPatientCode(patient); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setPatientName(one.getName()); 
															 | 
															
															 | 
															
																            healthEduArticleES.setPatientName(one.getName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            if(sendType==2){ 
															 | 
															
															 | 
															
																            if(sendType==2){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                healthEduArticleES.setDoctorCode(currentUserRoleCode); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                healthEduArticleES.setDoctorName(doctorName); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                String resultSql =""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                String whereSql =""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                switch (currentUserRoleLevel){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    case "1":{resultSql +=" DISTINCT (province_name) as name"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        whereSql+=" and province ='"+currentUserRoleCode+"'";break;} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    case "2":{resultSql +=" DISTINCT (city_name) as name"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        whereSql+=" and city ='"+currentUserRoleCode+"'";break;} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    case "3":{resultSql +=" DISTINCT (town_name) as name"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        whereSql+=" and town ='"+currentUserRoleCode+"'";break;} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    case "4":{resultSql +=" DISTINCT (name) as name"; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                        whereSql+=" and code ='"+currentUserRoleCode+"'";break;} 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                String sql = "select "+resultSql+" from dm_hospital  where level=2 "+whereSql ; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                List<Map<String, Object>> returnList = jdbcTemplate.queryForList(sql); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                String sendName = returnList.get(0).get("name")+""; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                healthEduArticleES.setSendName(sendName); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                healthEduArticleES.setSendLevel("4"); 
															 | 
															
															 | 
															
																                healthEduArticleES.setSendLevel("4"); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            }else{ 
															 | 
															
															 | 
															
																            }else{ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                healthEduArticleES.setSendName(doctor.getName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																                healthEduArticleES.setSendLevel(doctor.getLevel()+""); 
															 | 
															
															 | 
															
																                healthEduArticleES.setSendLevel(doctor.getLevel()+""); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            } 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setSendCode(doctor.getCode()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setSendName(doctor.getName()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setSendPic(doctor.getPhoto()); 
															 | 
															
															 | 
															
																            healthEduArticleES.setSendPic(doctor.getPhoto()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setSendSex(doctor.getSex()+""); 
															 | 
															
															 | 
															
																            healthEduArticleES.setSendSex(doctor.getSex()+""); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setAdminTeamCode(adminTeam.getId()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setAdminTeamName(adminTeam.getName()); 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(adminTeam!=null){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                healthEduArticleES.setAdminTeamCode(adminTeam.getId()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                healthEduArticleES.setAdminTeamName(adminTeam.getName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setHospital(doctor.getHospital()); 
															 | 
															
															 | 
															
																            healthEduArticleES.setHospital(doctor.getHospital()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setHospitalName(doctor.getHospitalName()); 
															 | 
															
															 | 
															
																            healthEduArticleES.setHospitalName(doctor.getHospitalName()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																            healthEduArticleES.setTown(doctor.getTown()); 
															 | 
															
															 | 
															
																            healthEduArticleES.setTown(doctor.getTown()); 
															 | 
														
													
												
											
												
													
														
															 | 
															
																@ -1088,6 +1097,48 @@ public class JMJkEduArticleService extends BaseService { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																        } 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    } 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																     
															 | 
															
															 | 
															
																     
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    /** 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * 居民单条文章增加已读状态 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param patient 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     * @param articleId 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     */ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    public void readPatientArticle(String patient,String articleId){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        JestClient jestClient = null; 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																         
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        try { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            jestClient = elasticFactory.getJestClient(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            searchSourceBuilder.query( 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    new BoolQueryBuilder() 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            .must(QueryBuilders.matchQuery("patientCode", patient)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                            .must(QueryBuilders.matchQuery("articleId", articleId)) 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            ); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            SearchResult result = jestClient.execute(search); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            List<HealthEduArticleES> dataList = result.getSourceAsObjectList(HealthEduArticleES.class); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if(!dataList.isEmpty()){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                //根据id批量删除 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                for (HealthEduArticleES obj : dataList) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    Delete index = new Delete.Builder(obj.getId()).build(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                    bulk.addAction(index); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                BulkResult br = jestClient.execute(bulk.build()); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            for (HealthEduArticleES healthEduArticleES:dataList) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                healthEduArticleES.setIsRead(1); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            elastricSearchSave.save(dataList,esIndex,esType); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            jestClient.shutdownClient(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        }catch (Exception e){ 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            e.printStackTrace(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } finally { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            if (jestClient != null) { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																                jestClient.shutdownClient(); 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																            } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																        } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																    } 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																     
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 | 
														
													
												
													
														
															| 
															 | 
															
																    public JSONArray pushArticleLogs(int page, int pagesize, String patientCode,String level1Type) throws Exception { 
															 | 
															
															 | 
															
																    public JSONArray pushArticleLogs(int page, int pagesize, String patientCode,String level1Type) throws Exception { 
															 | 
														
													
												
													
														
															| 
															 | 
															
																 
															 | 
															
															 | 
															
																 
															 |