Browse Source

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

yeshijie 7 years ago
parent
commit
3e54804d0e

+ 13 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -743,16 +743,21 @@ public class PatientHealthIndexService extends BaseService {
                    DecimalFormat df1 = new DecimalFormat("###.00");
                    obj.setValue3(df1.format(bmi));
                    double bmiMin = new Double("18.5");
                    double bmiMax = new Double("23.9");
                    if(patientAimSports != null && StringUtils.isNoneEmpty(patientAimSports.getCode())){
                        bmiMin = Double.parseDouble(patientAimSports.getBmiMin());
                        bmiMax = Double.parseDouble(patientAimSports.getBmiMax());
                    }
                        //设置BMI值
                        if(bmi < Double.parseDouble(patientAimSports.getBmiMin())){
                            obj.setValue4("1");
                        }else if(bmi > Double.parseDouble(patientAimSports.getBmiMax())){
                            obj.setValue4("-1");
                        }else{
                            obj.setValue4("0");
                        }
                    //设置BMI值
                    if(bmi < bmiMin){
                        obj.setValue4("1");
                    }else if(bmi > bmiMax){
                        obj.setValue4("-1");
                    }else{
                        obj.setValue4("0");
                    }
                    break;

+ 15 - 9
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/label/SignPatientLabelInfoService.java

@ -307,8 +307,10 @@ public class SignPatientLabelInfoService extends BaseService {
                    "   t1.doctor = ? " +
                    "   OR t1.doctor_health = ? " +
                    "  ) " +
                    "  AND t1. STATUS > 0 " +
                    "  AND t1.admin_team_code = ?" ;
                    "  AND t1. STATUS > 0  AND t1.admin_team_code = ?";
            if(isSlowDisease){
                sql = sql + "  AND p.diease >0 " ;
            }
            if(StringUtils.isNotBlank(diseaseCondition)){
                sql = sql + " AND p.disease_condition ="+diseaseCondition;
            }
@ -536,11 +538,11 @@ public class SignPatientLabelInfoService extends BaseService {
                                //判断微信绑定情况
                                re = openid1.compareTo(openid2);
                            }else{
                                re = diseaseCondition1 - diseaseCondition2;
                                re = diseaseCondition2 - diseaseCondition1;
                            }
                        }else{
                            re = disease1 - disease2;
                            re = disease2 - disease1;
                        }
                    }else{
@ -3582,7 +3584,7 @@ public class SignPatientLabelInfoService extends BaseService {
     * @return
     * @throws Exception
     */
    public JSONArray getPatientByTeamCodeExitDoctor(long teamCode, String labelCode, String labelType, int page, int pagesize, boolean sortByStandardStatus, String diseaseCondition) throws Exception {
    public JSONArray getPatientByTeamCodeExitDoctor(long teamCode, String labelCode, String labelType, int page, int pagesize, boolean isSlowDisease, String diseaseCondition) throws Exception {
        Map<String, JSONObject> result = new TreeMap<>();
        List<Map<String, Object>> signList = new ArrayList<>();
@ -3642,6 +3644,9 @@ public class SignPatientLabelInfoService extends BaseService {
            }else{
                args = new Object[]{teamCode};
            }
            if(isSlowDisease){
                sql = sql + " AND p.disease >0 ";
            }
            sql = sql +
                    " ) f " +
                    "WHERE " +
@ -3880,11 +3885,11 @@ public class SignPatientLabelInfoService extends BaseService {
                                //判断微信绑定情况
                                re = openid1.compareTo(openid2);
                            }else{
                                re = diseaseCondition1 - diseaseCondition2;
                                re = diseaseCondition2 - diseaseCondition1;
                            }
                        }else{
                            re = disease1 - disease2;
                            re = disease2 - disease1;
                        }
                    }else{
@ -4092,10 +4097,11 @@ public class SignPatientLabelInfoService extends BaseService {
                "    (t1.doctor = ? or t1.doctor_health = ?) " +
                "    AND t1.status > 0 " +
                "    AND t2.status = 1) " +
                (StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : " AND (t2.label = 4 or t2.label = 5 )") +
                (StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : "") +
                (StringUtils.isNotEmpty(labelType) ? " AND t2.label_type = ? " : "") +
                (teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "")+
                (StringUtils.isNotEmpty(diseaseCondition) ? " AND t3.diseaseCondition = ? " : "");
        sql = sql + " AND t3.disease > 0 AND t3.status > 0 ";
        if (matcher.find()) {
            sql = sql + "  AND (t1.idcard like ?) ";
@ -4344,7 +4350,7 @@ public class SignPatientLabelInfoService extends BaseService {
                "  AND" +
                (isIdcard ? " p.idcard like ? " : " t1.name like ? ");
        sqlTemp = sqlTemp + " AND p.disease_condition = "+diseaseCondition;
        sqlTemp = sqlTemp + " AND p.disease_condition = "+diseaseCondition+" AND p.diease >0 AND p.status >0 ";
        String sql = sqlTemp + " order by t2.diseaseCondition,t2.disease,t2,diseaseCondition,t2.openid desc  limit " + page + "," + pagesize;
        signList = jdbcTemplate.queryForList(sql, args);

+ 8 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -808,8 +808,13 @@ public class PatientService extends TokenService {
                "    f.`code` " +
                "   FROM " +
                "    wlyy_sign_family f " ;
        if(isSlowDisease){
            totalGSql = totalGSql + " ,wlyy_patient p WHERE f.patient = p.code AND p.disease >0 AND p.status > 0 ";
        }
        if(StringUtils.isNotBlank(diseaseCondition)){
            totalGSql = totalGSql + " ,wlyy_patient p WHERE f.patient = p.code AND p.disease_condition = "+diseaseCondition +" AND ";
            totalGSql = totalGSql + " AND p.disease_condition = "+diseaseCondition +" AND ";
        }else{
            totalGSql = totalGSql + " WHERE ";
        }
@ -830,7 +835,7 @@ public class PatientService extends TokenService {
                " d.`year` = '" + DateUtil.getSignYear() + "' " ;
        if(isSlowDisease){
            //获取预警分组数量
            totalGSql = totalGSql +"  AND d. CODE in (4,5)  ";
//            totalGSql = totalGSql +"  AND d. CODE in (4,5)  ";
        }
        totalGSql = totalGSql +
@ -886,7 +891,7 @@ public class PatientService extends TokenService {
        if(isSlowDisease){
            //获取预警分组数量
            fousGSql = fousGSql +"  AND d. CODE in (4,5)  ";
//            fousGSql = fousGSql +"  AND d. CODE in (4,5)  ";
        }
        fousGSql = fousGSql +