Kaynağa Gözat

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

wangzhinan 5 yıl önce
ebeveyn
işleme
78af7c03dc

+ 7 - 4
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/controller/SpecialistController.java

@ -126,9 +126,11 @@ public class SpecialistController extends EnvelopRestEndpoint {
                                                        @ApiParam(name = "teamCode", value = "医生当前所在团队") @RequestParam(required = true) String teamCode,
                                                        @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = true)String labelCode,
                                                        @ApiParam(name = "page", value = "第几页,1开始") @RequestParam(required = true)Integer page,
                                                        @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size){
                                                        @ApiParam(name = "size", value = "每页大小") @RequestParam(required = true)Integer size,
                                                        @ApiParam(name = "shareDoctor", value = "共管医生") @RequestParam(required = false)String shareDoctor
                                                                        ){
        try {
            return specialistService.getPatientByLabel(doctor,labelType,teamCode,labelCode,page,size);
            return specialistService.getPatientByLabel(doctor,labelType,teamCode,labelCode,page,size,shareDoctor);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());
@ -142,9 +144,10 @@ public class SpecialistController extends EnvelopRestEndpoint {
    public MixEnvelop<Long, Long> getLabelpatientCount(@ApiParam(name = "doctor", value = "医生") @RequestParam(required = true)String doctor,
                                                 @ApiParam(name = "labelType", value = "标签类型") @RequestParam(required = true)String labelType,
                                                       @ApiParam(name = "teamCode", value = "医生团队") @RequestParam(required = true)Long teamCode,
                                                 @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = true)String labelCode) {
                                                 @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = true)String labelCode,
                                                       @ApiParam(name = "labelCode", value = "标签code") @RequestParam(required = false)String shareDoctor) {
        try {
            return specialistService.getLabelpatientCount(doctor,labelType,labelCode,teamCode);
            return specialistService.getLabelpatientCount(doctor,labelType,labelCode,teamCode,shareDoctor);
        }catch (Exception e){
            e.printStackTrace();
            tracer.getCurrentSpan().logEvent(e.getMessage());

+ 24 - 9
svr/svr-wlyy-specialist/src/main/java/com/yihu/jw/service/SpecialistService.java

@ -187,7 +187,7 @@ public class SpecialistService{
    }
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType,String teamCode, String labelCode, Integer page, Integer size){
    public MixEnvelop<PatientLabelVO, PatientLabelVO> getPatientByLabel(String doctor, String labelType,String teamCode, String labelCode, Integer page, Integer size,String shareDoctor){
        String sql="SELECT " +
                " p. NAME, " +
                " p. CODE, " +
@ -223,8 +223,11 @@ public class SpecialistService{
                "  AND i.`status` = '1' " +
                " ) lb " +
                " JOIN "+basedb+".wlyy_patient p ON p. CODE = lb.patient " +
                " JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient " +
                " WHERE s.team_code ='" +teamCode+"' "+
                " JOIN wlyy_specialist_patient_relation s ON s.patient = lb.patient ";
        if(StringUtils.isNotBlank(shareDoctor)){
            sql = sql + " JOIN "+basedb+".wlyy_doctor_special_share sp ON s.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
        }
        sql = sql +" WHERE s.team_code ='" +teamCode+"' "+
                " AND s.status >=0  AND s.sign_status >0"+
                " LIMIT "+(page-1)*size+","+size;
        System.out.print("日志:"+sql);
@ -244,8 +247,11 @@ public class SpecialistService{
                    "a.id AS specialCode " +
                    "FROM wlyy_specialist.wlyy_specialist_patient_relation a " +
                    "JOIN "+basedb+".wlyy_patient_disease_server b ON a.id=b.specialist_relation_code AND b.disease=" +labelCode+" and b.del=1 "+
                    "JOIN "+basedb+".wlyy_patient c ON a.patient=c.CODE " +
                    "LEFT JOIN "+basedb+".wlyy_sign_patient_label_info d ON a.patient=d.patient AND d.label_type=8 AND d.`status`=1" +
                    "JOIN "+basedb+".wlyy_patient c ON a.patient=c.CODE ";
            if(StringUtils.isNotBlank(shareDoctor)){
                sql = sql + " JOIN "+basedb+".wlyy_doctor_special_share sp ON a.id = sp.special_code and sp.doctor = '"+shareDoctor+"' ";
            }
            sql = sql +"LEFT JOIN "+basedb+".wlyy_sign_patient_label_info d ON a.patient=d.patient AND d.label_type=8 AND d.`status`=1" +
                    " WHERE a.sign_status> 0 AND a.`status`>=0 " +
//                    "AND a.doctor='"+doctor+"' OR a.health_assistant= '"+doctor+
                    " AND a.team_code ='" +teamCode+"' "+
@ -273,7 +279,7 @@ public class SpecialistService{
        return MixEnvelop.getSuccess(SpecialistMapping.api_success,PatientLabelVOs);
    }
    public MixEnvelop<Long, Long> getLabelpatientCount(String doctor, String labelType, String label,Long teamCode){
    public MixEnvelop<Long, Long> getLabelpatientCount(String doctor, String labelType, String label,Long teamCode,String shareDoctor){
        String sql = "SELECT " +
                " COUNT(1) as total " +
                " FROM " +
@ -282,9 +288,18 @@ public class SpecialistService{
                "   i.label = '"+label+"' "+
                "  AND i.label_type = '"+labelType+"' " +
                "  AND i.`status` = '1' " +
                " AND i.patient in ( " +
                " select patient from  wlyy_specialist_patient_relation  WHERE team_code ='" +teamCode+"' "+
                " AND STATUS >= 0 AND sign_status > 0 )";
                " AND i.patient in (" +
                "SELECT" +
                "a.patient AS patient " +
                "FROM" +
                "wlyy_specialist_patient_relation a ";
        if(StringUtils.isNotBlank(shareDoctor)){
            sql = sql + " JOIN wlyy.wlyy_doctor_special_share b ON b.special_code = a.id AND b.doctor = '"+shareDoctor+"' ";
        }
        sql = sql+"WHERE" +
                "a.team_code = '"+teamCode+"' " +
                "AND a.STATUS >= 0 " +
                "AND a.sign_status > 0)";
        System.out.print("日志:"+sql);
        List<Map<String,Object>> rstotal = jdbcTemplate.queryForList(sql);
        Long count = 0L;