Bläddra i källkod

居民列表搜索BUG修复

huangwenjie 7 år sedan
förälder
incheckning
fce3f26278

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

@ -4064,7 +4064,7 @@ public class SignPatientLabelInfoService extends BaseService {
                                                           String labelCode, String labelType, long teamCode,
                                                           String exLabelCode,
                                                           String exLabelType,
                                                           int page, int pagesize, String diseaseCondition) throws Exception {
                                                           int page, int pagesize) throws Exception {
        Doctor doc = doctorDao.findByCode(doctor);
        Map<String,Object> patientDeviceTypeMap = new HashMap<>();//用于存储患者设备绑定情况
@ -4098,8 +4098,7 @@ public class SignPatientLabelInfoService extends BaseService {
                "    AND t2.status = 1 " +
                (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.disease_condition in (?) " : "");
                (teamCode > 0 ? (" AND admin_team_code = " + teamCode) : "");
        sql = sql + " AND t3.disease > 0 AND t3.status > 0 ";
        if (matcher.find()) {
@ -4122,40 +4121,15 @@ public class SignPatientLabelInfoService extends BaseService {
            }
        }
        if(StringUtils.isNotEmpty(diseaseCondition)){
            Object[] argsnew = new Object[args.length+1];
            for (int i = 0; i < argsnew.length; i++) {
                if(i == (argsnew.length-1)){
                    argsnew[i] = diseaseCondition;
                }else{
                    argsnew[i] = args[i];
                }
            }
            sql = sql + " order by t3.standard_status,t3.disease_condition,t3.disease,t3.openid desc limit " + page + "," + pagesize;
            signList = jdbcTemplate.queryForList(sql, argsnew);
        }else{
            sql = sql + " order by t3.standard_status,t3.disease_condition,t3.disease,t3.openid desc limit " + page + "," + pagesize;
            signList = jdbcTemplate.queryForList(sql, args);
        }
        sql = sql + " order by t3.standard_status,t3.disease_condition,t3.disease,t3.openid desc limit " + page + "," + pagesize;
        signList = jdbcTemplate.queryForList(sql, args);
//        //查询患者设备绑定情况
//        String _pdsql = "select user,sum(category_code) deviceType FROM wlyy_patient_device GROUP BY user";
//        List<Map<String,Object>> patientCodeDeviceTypes =  jdbcTemplate.queryForList(_pdsql);
//
//        if(!patientCodeDeviceTypes.isEmpty()){
//            for (Map<String,Object> patientCodeDeviceType : patientCodeDeviceTypes) {
//                String user = String.valueOf(patientCodeDeviceType.get("user"));
//                String sum = String.valueOf(patientCodeDeviceType.get("deviceType"));
//                patientDeviceTypeMap.put(user,sum);
//            }
//        }
        if (signList != null && signList.size() > 0) {
            for (Map<String, Object> sign : signList) {
                Patient p = patientDao.findByCode(sign.get("patient") == null ? "" : sign.get("patient").toString());
                System.out.println("1111");
                if (p == null) {
                    continue;
@ -4232,6 +4206,7 @@ public class SignPatientLabelInfoService extends BaseService {
                json.put("code", p.getCode());
                // 设置患者姓名
                json.put("name", p.getName());
                System.out.println(p.getName());
                // 设置患者手机号
                json.put("mobile", p.getMobile());
                // 设置患者微信openid

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/scheme/DoctorSchemeService.java

@ -73,7 +73,7 @@ public class DoctorSchemeService {
     */
    public List<String> getPatientsByDiseaseConditionDiseaseDeviceType(String teamCode, Integer disease, String diseaseCondition, Integer deviceType) throws Exception{
        String sql = "select p.code from wlyy_patient p ";
        String sql = "select DISTINCT p.code from wlyy_patient p ";
        if(-1 != deviceType){
            sql = sql + " LEFT JOIN wlyy_patient_device dev on dev.user = p.code ";

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

@ -784,8 +784,7 @@ public class SignPatientLabelInfoController extends BaseController {
                                             @RequestParam(required = false) String exLabelCode,
                                             @RequestParam(required = false) String exLabelType,
                                             @RequestParam(required = true) int page,
                                             @RequestParam(required = true) int pagesize,
                                             @RequestParam(required = true) String diseaseCondition) {
                                             @RequestParam(required = true) int pagesize) {
        try {
            if (StringUtils.isEmpty(filter)) {
                return error(-1, "搜索字段不能为空");
@ -805,8 +804,8 @@ public class SignPatientLabelInfoController extends BaseController {
            page = page - 1;
            JSONArray result = labelInfoService.searchSlowDiseasePatientByNameOrLabel(getUID(), filter, labelCode, labelType, teamCode, exLabelCode, exLabelType, page, pagesize,diseaseCondition);
//            JSONArray result = labelInfoService.searchPatientByNameOrLabel("xy201703150222", filter, labelCode, labelType, teamCode, exLabelCode, exLabelType, page, pagesize,diseaseCondition);
//            JSONArray result = labelInfoService.searchSlowDiseasePatientByNameOrLabel(getUID(), filter, labelCode, labelType, teamCode, exLabelCode, exLabelType, page, pagesize,diseaseCondition);
            JSONArray result = labelInfoService.searchSlowDiseasePatientByNameOrLabel("xy201703150222", filter, labelCode, labelType, teamCode, exLabelCode, exLabelType, page, pagesize);
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {