浏览代码

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

chenweida 8 年之前
父节点
当前提交
a9e70635e2

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

@ -692,22 +692,25 @@ public class PatientService extends TokenService {
     * 获取医生个人分组签约数据
     * @return
     */
    public JSONArray getSignByDoctorCodeGpbyServer(String doctor){
    public JSONArray getSignByDoctorCodeGpbyServer(String doctor,String teamCode){
        String teamCodeSql="";
        if(!org.springframework.util.StringUtils.isEmpty(teamCode)){
            teamCodeSql=" and f.admin_team_code="+teamCode+" ";
        }
        // 获取总分组数量
        String totalGSql = "SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name AS serverTypeName FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"') AND f.`status`>0 AND f.server_type IS NOT NULL GROUP BY f.server_type ORDER BY f.server_type ASC";
        String totalGSql = "SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name AS serverTypeName FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"') AND f.`status`>0 AND f.server_type IS NOT NULL "+teamCodeSql+" GROUP BY f.server_type ORDER BY f.server_type ASC";
        List<Map<String,Object>> totalG = jdbcTemplate.queryForList(totalGSql);
        //获取关注量分组数量
        String fousGSql ="SELECT count(1) As focusAmount,f.server_type AS serverType,f.server_type_name AS serverTypeName  FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"') AND f.`status`>0  AND f.openid IS NOT NULL AND f.server_type IS NOT NULL GROUP BY f.server_type ";
        String fousGSql ="SELECT count(1) As focusAmount,f.server_type AS serverType,f.server_type_name AS serverTypeName  FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"') AND f.`status`>0  AND f.openid IS NOT NULL "+teamCodeSql+" AND  f.server_type IS NOT NULL GROUP BY f.server_type ";
        List<Map<String,Object>> fousG = jdbcTemplate.queryForList(fousGSql);
        //获取二级节点分组总数
        String sesTotalSql ="SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name As serverTypeName ,f.special_population AS specialPopulation,f.special_population_name AS specialPopulationName  FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"')  AND f.`status`>0  AND f.special_population Is NOT NULL AND f.server_type IS NOT NULL GROUP BY f.special_population ORDER BY f.special_population ASC ";
        String sesTotalSql ="SELECT count(1) AS Amount,f.server_type AS serverType,f.server_type_name As serverTypeName ,f.special_population AS specialPopulation,f.special_population_name AS specialPopulationName  FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"')  "+teamCodeSql+" AND f.`status`>0  AND f.special_population Is NOT NULL AND f.server_type IS NOT NULL GROUP BY f.special_population ORDER BY f.special_population ASC ";
        List<Map<String,Object>> sesTotal = jdbcTemplate.queryForList(sesTotalSql);
        //获取二级节点分组数量
        String sesFousGSql ="SELECT count(1) AS focusAmount,f.server_type  AS serverType,f.server_type_name As serverTypeName,f.special_population  AS specialPopulation,f.special_population_name  AS specialPopulationName FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"')  AND f.`status`>0  AND f.special_population Is NOT NULL AND f.openid IS NOT NULL AND f.server_type IS NOT NULL GROUP BY f.special_population ";
        String sesFousGSql ="SELECT count(1) AS focusAmount,f.server_type  AS serverType,f.server_type_name As serverTypeName,f.special_population  AS specialPopulation,f.special_population_name  AS specialPopulationName FROM wlyy_sign_family f WHERE (f.doctor ='"+doctor+"' OR f.doctor_health ='"+doctor+"')  "+teamCodeSql+" AND f.`status`>0  AND f.special_population Is NOT NULL AND f.openid IS NOT NULL AND f.server_type IS NOT NULL GROUP BY f.special_population ";
        List<Map<String,Object>> sesFousG =jdbcTemplate.queryForList(sesFousGSql);
        List<ServerLabelTree> listTree = new ArrayList<>();
@ -787,5 +790,4 @@ public class PatientService extends TokenService {
        }
        return new JSONArray(listTree);
    }
}

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

@ -200,6 +200,7 @@ public class SignPatientLabelInfoController extends BaseController {
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            return error(-1, "查询失败");
        }
    }
@ -260,7 +261,7 @@ public class SignPatientLabelInfoController extends BaseController {
            }
            if(labelType.equals("1")){
                JSONArray r= patientService.getSignByDoctorCodeGpbyServer(getUID());
                JSONArray r= patientService.getSignByDoctorCodeGpbyServer(getUID(),teamCode+"");
                return write(200, "查询成功", "data", r);
            }
@ -268,6 +269,7 @@ public class SignPatientLabelInfoController extends BaseController {
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {
            e.printStackTrace();
            error(e);
            return error(-1, "查询失败");
        }
@ -345,7 +347,7 @@ public class SignPatientLabelInfoController extends BaseController {
            }
            //xh1D201703150222
            int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, getUID(), getUID());
            //int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, "xh1D201703150222", "xh1D201703150222");
//            int result = labelInfoService.setPatientLabels(patient, "", "", health, disease, custom, "xh1D201703150222", "xh1D201703150222");
            if (result == 0) {
                return error(-1, "查不到患者信息");
@ -368,6 +370,7 @@ public class SignPatientLabelInfoController extends BaseController {
                return error(-1, "更新失败");
            }
        } catch (Exception e) {
            e.printStackTrace();
            error(e);
            return error(-1, "更新失败");
        }

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/sign/DoctorSignController.java

@ -625,7 +625,7 @@ public class DoctorSignController extends WeixinBaseController {
    @ResponseBody
    public String getSignByDoctorCodeGpbyServer(){
        try {
            JSONArray result = patientService.getSignByDoctorCodeGpbyServer(getUID());
            JSONArray result = patientService.getSignByDoctorCodeGpbyServer(getUID(),null);
            //JSONArray result = patientService.getSignByDoctorCodeGpbyServer("xh1D201703150222");
            return write(200, "查询成功", "data", result);
        } catch (Exception e) {