Pārlūkot izejas kodu

Merge branch 'dev' of huangwenjie/patient-co-management into dev

huangwenjie 7 gadi atpakaļ
vecāks
revīzija
a7006f1aab

+ 28 - 20
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -103,8 +103,8 @@ public class JMJkEduArticleService extends BaseService {
//            sendCode = resultMap.size()>0?resultMap.get(0).get("roleCode").toString():sendCode;
//        }
        StringBuffer sql2 = new StringBuffer("select articleId,articleTitle,firstLevelCategoryName,secondLevelCategoryName,articleSource,createTime  from   " + esType +
                " where  doctorCode='" + sendCode + "'");
        StringBuffer sql2 = new StringBuffer("select * from   " + esType +
                " where  doctorCode='" + sendCode + "' and userType = 2");
        if(sendType==1){
            sql2.append(" and sendType='"+sendType+"' ");
@ -131,7 +131,7 @@ public class JMJkEduArticleService extends BaseService {
            sendTimeEnd = elasticsearchUtil.changeTime(sendTimeEnd);
            sql2.append(" and createTime <='"+sendTimeEnd+"'");
        }
        sql2.append(" group by articleId,articleTitle,firstLevelCategoryName,secondLevelCategoryName,articleSource,createTime  order by createTime limit " + page + "," + pagesize);
        sql2.append(" order by createTime limit " + page + "," + pagesize);
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(), HealthEduArticleES.class, esIndex, esType);
        Map<String, HealthEduArticlePatientModel> result = new HashMap<>();
        HealthEduArticlePatientModel heapm = null;
@ -212,8 +212,8 @@ public class JMJkEduArticleService extends BaseService {
    public List<HealthEduArticleES> pushArticleListCount(String sendCode,  String firstLevelCategoryId,String secondLevelCategoryId,Integer myArticle,Integer sendType,String currentUserRole,
                                                              String currentUserRoleLevel,String articleTitle,String sendTimeStart,String sendTimeEnd) throws Exception {
        StringBuffer sql2 = new StringBuffer("select articleId,articleTitle,firstLevelCategoryName,secondLevelCategoryName,articleSource,createTime  from   " + esType +
                " where  sendCode='" + sendCode + "'");
        StringBuffer sql2 = new StringBuffer("select from   " + esType +
                " where  sendCode='" + sendCode + "' and userType = 2" );
        if(sendType==1){
            sql2.append(" and sendType='"+sendType+"' ");
@ -240,7 +240,6 @@ public class JMJkEduArticleService extends BaseService {
            sendTimeEnd = elasticsearchUtil.changeTime(sendTimeEnd);
            sql2.append(" and createTime <='"+sendTimeEnd+"'");
        }
        sql2.append(" group by articleId,articleTitle,firstLevelCategoryName,secondLevelCategoryName,articleSource,createTime");
        List<HealthEduArticleES> esList = elasticsearchUtil.excute(sql2.toString(),HealthEduArticleES.class, esIndex, esType);
        return esList;
    }
@ -728,21 +727,30 @@ public class JMJkEduArticleService extends BaseService {
        if (!StringUtils.isEmpty(labelHealth) || !StringUtils.isEmpty(labelDisease)) {
            tableSql += " left join wlyy_sign_patient_label_info l on w.patient=l.patient ";
            whereSql += " and l.status=1 ";
            whereSql += " and ( ";
        }
        if (!StringUtils.isEmpty(labelHealth)) {
            whereSql += " (l.label_type = 2 AND l.label in (" + labelHealth + ")) ";
        }
        if (!StringUtils.isEmpty(labelDisease)) {
            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 + ") ";
    
            if (!StringUtils.isEmpty(labelHealth) && !StringUtils.isEmpty(labelDisease)) {
                whereSql += " and ( (l.label_type = 2 AND l.label in (" + labelHealth + ") ) or (l.label_type = 3 AND l.label in (" + labelDisease + ") ))";
            }else {
                if(!StringUtils.isEmpty(labelHealth)){
                    whereSql += " and (l.label_type = 2 AND l.label in (" + labelHealth + "))";
                }
                
                if(!StringUtils.isEmpty(labelDisease)){
                    whereSql += " and (l.label_type = 3 AND l.label in (" + labelDisease + "))";
                }
            }
        }
        if (!StringUtils.isEmpty(labelHealth) || !StringUtils.isEmpty(labelDisease)) {
            whereSql += ")";
        }
//        if (!StringUtils.isEmpty(labelDisease)) {
//            if (!whereSql.endsWith(" and ( ")) {
//                whereSql += " or (l.label_type = 3 AND l.label in (" + labelDisease + "))) ";
//            } else {
//                whereSql += " l.label_type = 3 AND l.label in (" + labelDisease + ")) ";
//            }
//        }
//        if (!StringUtils.isEmpty(labelHealth) || !StringUtils.isEmpty(labelDisease)) {
//            whereSql += ")";
//        }
        
        tableSql += " left join wlyy_patient p on p.code=w.patient AND p.openid IS NOT NULL and p.openid <>''";
        if (!StringUtils.isEmpty(labelSex)) {
@ -1160,7 +1168,7 @@ public class JMJkEduArticleService extends BaseService {
        pagesize = page * pagesize;
        page = (page - 1) * pagesize;
        String sql = "SELECT * FROM " + esType + "  where patientCode= '" + patientCode + "' ";
        String sql = "SELECT * FROM " + esType + "  where patientCode= '" + patientCode + "' and userType = 1";
        
        if(!StringUtils.isEmpty(level1Type)){
            sql= sql + " and firstLevelCategoryId = '"+level1Type+"' ";

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java

@ -456,8 +456,8 @@ public class ThirdJkEduArticleService extends BaseService {
                        operatorRoleCodeName = doctor.getHospitalName();
                    }
                }
                param.put("authentication", userCode);
                param.put("authenticationId", operatorRoleCodeName);
                param.put("authentication", operatorRoleCodeName);
                param.put("authenticationId", userCode);
            }
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveArticle, param.toString(), "1"));
            json = JSON.parseObject(response);

+ 2 - 2
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -101,11 +101,11 @@ pushMes:
  redis_prescription_title: redisMessage
es:
  index:
    HealthEduArticlePatient: health_edu_article_patient_test5
    HealthEduArticlePatient: health_edu_article_patient_test6
    FollowUp: wlyy_followup
    Statistics: wlyy_quota_test
  type:
    HealthEduArticlePatient: health_edu_article_patient_test5
    HealthEduArticlePatient: health_edu_article_patient_test6
    FollowUpContent: wlyy_followup_content
    Statistics: wlyy_quota_test
  host:  http://172.19.103.68:9200