浏览代码

统计修改

lyr 8 年之前
父节点
当前提交
71534f0673

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

@ -214,9 +214,7 @@ public class SignPatientLabelInfoService extends BaseService {
                        " FROM " +
                        "    wlyy_sign_family t1 " +
                        " left join " +
                        "    (select patient,label,label_type from wlyy_sign_patient_label_info where patient in " +
                        "    (select patient from wlyy_sign_family where repdoctor ='" + doctor + "' and status > 0) " +
                        "     and label_type = ? and status = 1) t2 " +
                        "    (select patient,label,label_type,label_name from wlyy_sign_patient_label_info where patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) and label_type = ?) t2 " +
                        " on t1.patient = t2.patient " +
                        " WHERE " +
                        "    t2.patient is null " +
@ -232,8 +230,7 @@ public class SignPatientLabelInfoService extends BaseService {
                        "    wlyy_sign_family t1, " +
                        "    wlyy_sign_patient_label_info t2 " +
                        " WHERE " +
                        "     t2.patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0 ) " +
                        "    AND t2.label = ? " +
                        "    t2.label = ? " +
                        "    AND t2.label_type = ? " +
                        "    AND t2.status = 1 " +
                        "    AND t1.patient = t2.patient " +
@ -578,9 +575,7 @@ public class SignPatientLabelInfoService extends BaseService {
                                " FROM" +
                                "     wlyy_sign_family t1 " +
                                " left join " +
                                "    (SELECT patient,label,label_type from wlyy_sign_patient_label_info where patient in " +
                                "    (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) " +
                                "    and label_type = ? and status = 1)  t2 " +
                                "    (select patient,label,label_type,label_name from wlyy_sign_patient_label_info where patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) and label_type = ?) t2 " +
                                " on t1.patient = t2.patient " +
                                " WHERE" +
                                "     t2.patient is null " +
@ -601,7 +596,6 @@ public class SignPatientLabelInfoService extends BaseService {
                                "     wlyy_sign_patient_label_info t2 " +
                                " WHERE" +
                                "     t1.patient = t2.patient " +
                                "     AND t2.patient in (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) " +
                                "     AND t2.label = ? " +
                                "     AND t2.label_type = ? " +
                                "     AND t2.status = 1 " +
@ -840,35 +834,35 @@ public class SignPatientLabelInfoService extends BaseService {
        List<Map<String, Object>> signList = new ArrayList<>();
        page = page * pagesize;
        Object[] args = null;
        String sql = "SELECT " +
        String sql = "select " +
                "    t1.* " +
                " FROM " +
                "    wlyy_sign_family t1 " +
                (StringUtils.isNotEmpty(labelCode) || StringUtils.isNotEmpty(labelType) ?
                        " join " : " left join ") +
                "    (select patient,label,label_name,label_type from wlyy_sign_patient_label_info  where patient in" +
                "    (select patient from wlyy_sign_family where repdoctor = '" + doctor + "' and status > 0) " +
                "     and status = 1 " +
                (StringUtils.isNotEmpty(labelCode) ? " AND label = ? " : "") +
                (StringUtils.isNotEmpty(labelType) ? " AND label_type = ? " : "") + ") t2" +
                "    wlyy_sign_patient_label_info t2 " +
                " ON t1.patient = t2.patient " +
                " WHERE " +
                "    t1.repdoctor = ? " +
                "    AND t1.status > 0 " +
                "    AND (" + (StringUtils.isNotEmpty(labelCode) || StringUtils.isNotEmpty(labelType) ? "" : " t2.patient is null OR ") + " t2.status = 1) " +
                (StringUtils.isNotEmpty(labelCode) ? " AND t2.label = ? " : "") +
                (StringUtils.isNotEmpty(labelType) ? " AND t2.label_type = ? " : "") +
                (teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "") +
                "    AND (t1.name like ? OR t2.label_name like ?) ";
                "  AND (t1.name like ? or t2.label_name like ?) ";
        if (StringUtils.isNotEmpty(labelCode)) {
            args = new Object[]{labelCode, labelType, doctor, "%" + filter + "%", "%" + filter + "%", labelCode, labelType, doctor, "%" + filter + "%", "%" + filter + "%"};
            args = new Object[]{doctor, labelCode, labelType, "%" + filter + "%", "%" + filter + "%", doctor, labelCode, labelType, "%" + filter + "%", "%" + filter + "%"};
        } else if (StringUtils.isEmpty(labelCode) && StringUtils.isNotEmpty(labelType)) {
            args = new Object[]{labelType, doctor, "%" + filter + "%", "%" + filter + "%", labelType, doctor, "%" + filter + "%", "%" + filter + "%"};
            args = new Object[]{doctor, labelType, "%" + filter + "%", "%" + filter + "%", doctor, labelType, "%" + filter + "%", "%" + filter + "%"};
        } else {
            args = new Object[]{doctor, "%" + filter + "%", "%" + filter + "%", doctor, "%" + filter + "%", "%" + filter + "%"};
        }
        String sqlDoc = sql.replaceAll("repdoctor", "doctor");
        String sqlDocHealth = sql.replaceAll("repdoctor", "doctor_health").replaceAll("t1", "t3").replaceAll("t2", "t4");
        sql = "select t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + page + "," + pagesize;
        sql = "select DISTINCT t.* from (" + sqlDoc + " union all " + sqlDocHealth + ") t limit " + page + "," + pagesize;
        signList = jdbcTemplate.queryForList(sql, args);
        if (signList != null && signList.size() > 0) {
@ -921,13 +915,8 @@ public class SignPatientLabelInfoService extends BaseService {
                    }
                }
                List<SignPatientLabelInfo> labels = labelInfoDao.findByPatientAndStatus(sign.get("patient").toString(), 1);
                if (StringUtils.isEmpty(exLabelCode) || StringUtils.isEmpty(exLabelType)) {
                }
                JSONObject json = new JSONObject();
                // 设置患者标识

+ 14 - 14
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statistics/StatisticsAllService.java

@ -270,7 +270,7 @@ public class StatisticsAllService extends BaseService {
        if (endDate.compareTo(dateFormat.format(new Date())) >= 0) {
            String val = "";
            try {
                val = redisTemplate.opsForValue().get("quota:7:" + level + ":" + area + ":" + lowCode + ":" + getQuotaTimeStamp());
                val = redisTemplate.opsForValue().get("quota:17:" + level + ":" + area + ":" + lowCode + ":" + getQuotaTimeStamp());
            } catch (Exception e) {
                val = "";
            }
@ -295,7 +295,7 @@ public class StatisticsAllService extends BaseService {
                    " from  " +
                    "     wlyy_quota_result " +
                    " where " +
                    "     quato_code = '7' " +
                    "     quato_code = '17' " +
                    "   and level1_type = ? and del = '1'" +
                    "   and quota_date = ? " +
                    "   and level2_type = ? ";
@ -334,10 +334,10 @@ public class StatisticsAllService extends BaseService {
                if (lowCode.equals("3")) {
                    num = peopleNum.getSixFiveNum();
                    taskNum = peopleNum.getSixFiveTaskNum();
                } else if (lowCode.equals("4")) {
                } else if (lowCode.equals("1")) {
                    num = peopleNum.getGxyNum();
                    taskNum = peopleNum.getGxyTaskNum();
                } else if (lowCode.equals("5")) {
                } else if (lowCode.equals("2")) {
                    num = peopleNum.getTnbNum();
                    taskNum = peopleNum.getTnbTaskNum();
                }
@ -349,10 +349,10 @@ public class StatisticsAllService extends BaseService {
                if (lowCode.equals("3")) {
                    num = peopleNum.getInt("sixFiveNum");
                    taskNum = peopleNum.getInt("sixFiveTaskNum");
                } else if (lowCode.equals("4")) {
                } else if (lowCode.equals("1")) {
                    num = peopleNum.getInt("gxyNum");
                    taskNum = peopleNum.getInt("gxyTaskNum");
                } else if (lowCode.equals("5")) {
                } else if (lowCode.equals("2")) {
                    num = peopleNum.getInt("gxyNum");
                    taskNum = peopleNum.getInt("gxyTaskNum");
                }
@ -424,10 +424,10 @@ public class StatisticsAllService extends BaseService {
                            if (lowCode.equals("3")) {
                                num = peopleNum.getSixFiveNum();
                                taskNum = peopleNum.getSixFiveTaskNum();
                            } else if (lowCode.equals("4")) {
                            } else if (lowCode.equals("1")) {
                                num = peopleNum.getGxyNum();
                                taskNum = peopleNum.getGxyTaskNum();
                            } else if (lowCode.equals("5")) {
                            } else if (lowCode.equals("2")) {
                                num = peopleNum.getTnbNum();
                                taskNum = peopleNum.getTnbTaskNum();
                            }
@ -446,10 +446,10 @@ public class StatisticsAllService extends BaseService {
                            if (lowCode.equals("3")) {
                                num = peopleNum.getInt("sixFiveNum");
                                taskNum = peopleNum.getInt("sixFiveTaskNum");
                            } else if (lowCode.equals("4")) {
                            } else if (lowCode.equals("1")) {
                                num = peopleNum.getInt("gxyNum");
                                taskNum = peopleNum.getInt("gxyTaskNum");
                            } else if (lowCode.equals("5")) {
                            } else if (lowCode.equals("2")) {
                                num = peopleNum.getInt("tnbNum");
                                taskNum = peopleNum.getInt("tnbTaskNum");
                            }
@ -1458,9 +1458,9 @@ public class StatisticsAllService extends BaseService {
                if (peopleNum != null) {
                    if (lowCode.equals("3")) {
                        taskNum = peopleNum.getSixFiveTaskNum();
                    } else if (lowCode.equals("4")) {
                    } else if (lowCode.equals("1")) {
                        taskNum = peopleNum.getGxyTaskNum();
                    } else if (lowCode.equals("5")) {
                    } else if (lowCode.equals("2")) {
                        taskNum = peopleNum.getTnbTaskNum();
                    }
                }
@ -1469,9 +1469,9 @@ public class StatisticsAllService extends BaseService {
                if (peopleNum != null) {
                    if (lowCode.equals("3")) {
                        taskNum = peopleNum.getInt("sixFiveTaskNum");
                    } else if (lowCode.equals("4")) {
                    } else if (lowCode.equals("1")) {
                        taskNum = peopleNum.getInt("gxyTaskNum");
                    } else if (lowCode.equals("5")) {
                    } else if (lowCode.equals("2")) {
                        taskNum = peopleNum.getInt("tnbTaskNum");
                    }
                }

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/SignPatientLabelInfoController.java

@ -207,13 +207,13 @@ public class SignPatientLabelInfoController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/patient_search")
    public String searchPatientByNameOrLabel(String filter,
    public String searchPatientByNameOrLabel(@RequestParam(required = true)String filter,
                                             @RequestParam(required = false) String labelCode,
                                             @RequestParam(required = false) String labelType,
                                             @RequestParam(required = false) Long teamCode,
                                             @RequestParam(required = false) String exLabelCode,
                                             @RequestParam(required = false) String exLabelType,
                                             int page, int pagesize) {
                                             @RequestParam(required = true)int page, @RequestParam(required = true)int pagesize) {
        try {
            if (StringUtils.isEmpty(filter)) {
                return error(-1, "搜索字段不能为空");

+ 2 - 2
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/StatisticsController.java

@ -165,7 +165,7 @@ public class StatisticsController extends BaseController {
                                            @RequestParam(required = true) int level,
                                            @RequestParam(required = true) String index,
                                            @RequestParam(required = true)int sort,
                                            @RequestParam(required = true)String lowLevel) {
                                            @RequestParam(required = false)String lowLevel) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();
@ -197,7 +197,7 @@ public class StatisticsController extends BaseController {
                                        @RequestParam(required = true)int level,
                                        @RequestParam(required = true)String index,
                                        @RequestParam(required = true)int sort,
                                        @RequestParam(required = true)String lowLevel) {
                                        @RequestParam(required = false)String lowLevel) {
        try {
            String[] indexes = index.split(",");
            JSONObject result = new JSONObject();