wujunjie 7 anni fa
parent
commit
06cb8e8743

+ 24 - 21
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -106,10 +106,10 @@ public class JMJkEduArticleService extends BaseService {
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where  doctorCode='" + sendCode + "' and userType = 2");
        if(sendType==1){
            sql2.append(" and sendType='"+sendType+"' ");
        }
//        if(sendType==1){
//
//            sql2.append(" and sendType='"+sendType+"' ");
//        }
        if(!StringUtils.isEmpty(firstLevelCategoryId)){
            sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
        }
@ -119,8 +119,8 @@ public class JMJkEduArticleService extends BaseService {
        if(myArticle==1){
            sql2.append(" and operatorId="+sendCode);
        }
        sql2.append(" and currentUserRoleCode ="+currentUserRole);
        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
//        sql2.append(" and currentUserRoleCode ="+currentUserRole);
//        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
        if(!StringUtils.isEmpty(articleTitle)){
            sql2.append(" and articleTitle like'%"+articleTitle+"%'");
        }
@ -132,11 +132,11 @@ public class JMJkEduArticleService extends BaseService {
            sendTimeEnd = elasticsearchUtil.changeTime(sendTimeEnd);
            sql2.append(" and createTime <='"+sendTimeEnd+"'");
        }
        sql2.append(" order by createTime limit " + page + "," + pagesize);
        sql2.append(" order by createTime desc limit " + page + "," + pagesize);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(), HealthEduArticleES.class, esIndex, esType);
        Map<String, HealthEduArticlePatientModel> result = new HashMap<>();
        HealthEduArticlePatientModel heapm = null;
        com.alibaba.fastjson.JSONObject article = null;
        JSONObject article = null;
        Doctor doctor = null;
    
        List<HealthEduArticlePatientModel> resultList = new ArrayList<>();
@ -215,11 +215,11 @@ public class JMJkEduArticleService extends BaseService {
                                                              String currentUserRoleLevel,String articleTitle,String sendTimeStart,String sendTimeEnd) throws Exception {
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where  sendCode='" + sendCode + "' and userType = 2" );
        if(sendType==1){
            sql2.append(" and sendType='"+sendType+"' ");
        }
                " where  doctorCode='" + sendCode + "' and userType = 2" );
//        if(sendType==1){
//
//            sql2.append(" and sendType='"+sendType+"' ");
//        }
        if(!StringUtils.isEmpty(firstLevelCategoryId)){
            sql2.append("and firstLevelCategoryId="+firstLevelCategoryId);
        }
@ -229,8 +229,8 @@ public class JMJkEduArticleService extends BaseService {
        if(myArticle==1){
            sql2.append(" and operatorId="+sendCode);
        }
        sql2.append(" and currentUserRoleCode ="+currentUserRole);
        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
//        sql2.append(" and currentUserRoleCode ="+currentUserRole);
//        sql2.append(" and currentUserRoleLevel="+currentUserRoleLevel);
        if(!StringUtils.isEmpty(articleTitle)){
            sql2.append(" and articleTitle like'%"+articleTitle+"%'");
        }
@ -550,13 +550,16 @@ public class JMJkEduArticleService extends BaseService {
            sendName = returnList.get(0).get("name")+"";
        }
        Map<String,Object> resultMap = labelService.fetchUserHighestAuthority(sendCode);
        List<String> roleList = (List<String>)resultMap.get("roleList");
        List<RoleVo> roleVoLists= new ArrayList<>();
        for(String temp:roleList){
            RoleVo roleVo = new RoleVo();
            roleVo.setCode(temp);
            roleVoLists.add(roleVo);
        if(resultMap.containsKey("roleList") && resultMap.get("roleList") != null){
            List<String> roleList = (List<String>)resultMap.get("roleList");
            for(String temp:roleList){
                RoleVo roleVo = new RoleVo();
                roleVo.setCode(temp);
                roleVoLists.add(roleVo);
            }
        }
        JSONObject article = thirdJkEduArticleService.getArticalById(articleId,"");
        Date createTime = new Date();
        for (String patient : patientSet) {
@ -1182,7 +1185,7 @@ public class JMJkEduArticleService extends BaseService {
        
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql, HealthEduArticleES.class, esIndex, esType);
        HealthEduArticlePatientModel heapm = null;
        com.alibaba.fastjson.JSONObject article = null;
        JSONObject article = null;
        List<HealthEduArticlePatientModel> result = new ArrayList<>();
        Doctor doctor = null;
        for (HealthEduArticleES one : esList) {