Bladeren bron

Merge branch 'dev' of liubing/wlyy2.0 into dev

liubing 3 jaren geleden
bovenliggende
commit
ea8b74c611

+ 10 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/care/prescription/BaseCarePrescriptionDO.java

@ -27,6 +27,7 @@ public class BaseCarePrescriptionDO extends UuidIdentityEntityWithCreateTime {
    private String sex;
    private String sex;
    private String age;
    private String age;
    private String photo;
    private String photo;
    private String type;
    @Column(name = "patient")
    @Column(name = "patient")
    public String getPatient() {
    public String getPatient() {
@ -135,4 +136,13 @@ public class BaseCarePrescriptionDO extends UuidIdentityEntityWithCreateTime {
    public void setPhoto(String photo) {
    public void setPhoto(String photo) {
        this.photo = photo;
        this.photo = photo;
    }
    }
    @Transient
    public String getType() {
        return type;
    }
    public void setType(String type) {
        this.type = type;
    }
}
}

+ 12 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/doctor/DoctorToDoWorkEndpoint.java

@ -42,6 +42,18 @@ public class DoctorToDoWorkEndpoint extends EnvelopRestEndpoint {
        }
        }
    }
    }
    @GetMapping(value = "todoworkTotal")
    @ApiOperation("待办工作总数")
    public ObjEnvelop  todoworkTotal(@ApiParam(name = "doctor", value = "doctor")
                                         @RequestParam(value = "doctor", required = true) String doctor){
        try {
            return ObjEnvelop.getSuccess("查询成功",doctorMessageService.todoworkTotal(doctor));
        }catch (Exception e){
            return failedObjEnvelopException2(e);
        }
    }
    /**************************v1.1.0新增 设备异常动态************************************/
    /**************************v1.1.0新增 设备异常动态************************************/
    @GetMapping(value = "getHealthMonitoringListNew")
    @GetMapping(value = "getHealthMonitoringListNew")
    @ApiOperation(value = "体征监测/安防监护")
    @ApiOperation(value = "体征监测/安防监护")

+ 69 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/DoctorMessageService.java

@ -7,6 +7,7 @@ import com.yihu.jw.care.dao.apply.PatientBedApplyDao;
import com.yihu.jw.care.dao.message.OrgNoticeDao;
import com.yihu.jw.care.dao.message.OrgNoticeDao;
import com.yihu.jw.care.dao.message.UserNoticeDao;
import com.yihu.jw.care.dao.message.UserNoticeDao;
import com.yihu.jw.care.dao.security.SecurityMonitoringOrderDao;
import com.yihu.jw.care.dao.security.SecurityMonitoringOrderDao;
import com.yihu.jw.care.service.doctor.DoctorServicePermissionsService;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -47,6 +48,10 @@ public class DoctorMessageService {
    private UserNoticeDao userNoticeDao;
    private UserNoticeDao userNoticeDao;
    @Autowired
    @Autowired
    private SystemMessageDao messageDao;
    private SystemMessageDao messageDao;
    @Autowired
    private BaseDoctorHospitalDao doctorHospitalDao;
    @Autowired
    private DoctorServicePermissionsService doctorServicePermissionsService;
    /**
    /**
     *
     *
@ -317,4 +322,68 @@ public class DoctorMessageService {
        return systemMessageDOS;
        return systemMessageDOS;
    }
    }
    public Integer todoworkTotal(String doctor){
        Integer total=0;
        BaseDoctorDO  doctorDO = baseDoctorDao.findById(doctor);
        String sql = "";
        if (null!=doctorDO){
            if (1==doctorDO.getLevel()){//社区医生
                //健康咨询+待处理续方
                 sql = " SELECT count(a.id)  FROM wlyy_consult a,wlyy_consult_team b,base_patient d WHERE a.id=b.consult " +
                        " AND b.patient=d.id  AND b.doctor='"+doctor+"'  and b.status = 0 AND a.type in (25) ";
                total += jdbcTemplate.queryForObject(sql,Integer.class);
                sql = " SELECT count(distinct a.id) from base_care_prescription a LEFT JOIN base_patient p ON a.patient = p.id, " +
                        " base_service_package_sign_record sr,base_service_package_record r,base_service_package pack, base_team_member m " +
                        " WHERE  sr.id = r.sign_id and sr.patient = a.patient and r.service_package_id = pack.id and " +
                        " m.team_code = r.team_code  and m.doctor_code = '"+doctor+"'  and a.status = 1 ";
                total += jdbcTemplate.queryForObject(sql,Integer.class);
            }
            if (2==doctorDO.getLevel()){//助老员
                //紧急救助、安防、生活
                if(doctorServicePermissionsService.isPermission(doctor,8)==1){
                    sql = " select count(ord.id) from base_emergency_assistance_order ord where 1=1  AND EXISTS (SELECT sr.patient from " +
                            " base_service_package_sign_record sr,base_service_package_record r, base_service_package_item i ,base_team_member m " +
                            " where ord.patient = CONVERT(sr.patient USING utf8) and  sr.id = r.sign_id and sr.status=1 and " +
                            " r.service_package_id = i.service_package_id and  m.team_code = r.team_code  and i.del = 1 and sr.`status`=1 " +
                            " and i.code='emergencyAssistance' and m.doctor_code = '"+doctor+"' and m.del = '1') " +
                            " and ord.status in ( '1') ";
                    total += jdbcTemplate.queryForObject(sql,Integer.class);
                }
                if(doctorServicePermissionsService.isPermission(doctor,10)==1){
                    sql = " select count(ord.id) from base_security_monitoring_order ord INNER JOIN base_patient p on p.id = ord.patient " +
                            " where 1=1    and  EXISTS ( SELECT 1 from base_service_package_sign_record sr,base_service_package_record r, " +
                            " base_service_package_item i ,base_team_member m where ord.patient = CONVERT(sr.patient USING utf8) and " +
                            "  sr.id = r.sign_id and sr.status=1 and  r.service_package_id = i.service_package_id and " +
                            "  m.team_code = r.team_code  and i.del = 1 and sr.`status`=1 and m.doctor_code = '"+doctor+"' and m.del = '1') " +
                            "  and ord.status='1'  ";
                    total += jdbcTemplate.queryForObject(sql,Integer.class);
                }
                if(doctorServicePermissionsService.isPermission(doctor,7)==1){
                    List<BaseDoctorHospitalDO> doctorHospitalDOs = doctorHospitalDao.findByDoctorCode(doctor);
                    if (doctorHospitalDOs.size()>0){
                        String hospital = doctorHospitalDOs.get(0).getOrgCode();
                        sql =" SELECT count(o.id)   FROM  base_life_care_order o LEFT JOIN base_patient p ON o.patient = p.id  " +
                                "WHERE  o.hospital = '"+hospital+"'  AND (o.`status` = 1 or -100 = 1) and o.pay_status>0 and o.status<>0 ";
                        total += jdbcTemplate.queryForObject(sql,Integer.class);
                    }
                }
            }
            if (3==doctorDO.getLevel()){//教师
                //上门、在线咨询
                sql = " SELECT count(a.id)  FROM wlyy_consult a,wlyy_consult_team b,base_patient d WHERE a.id=b.consult " +
                        " AND b.patient=d.id  AND b.doctor='"+doctor+"'  and b.status = 0 AND a.type in (23) ";
                total += jdbcTemplate.queryForObject(sql,Integer.class);
                sql = "  select count(DISTINCT o.id) as total  from base_door_coach_order o LEFT JOIN base_org h on h.code=o.hospital " +
                        " and h.del=1 where 1=1  and o.status in (3,4,5)and o.doctor= '"+doctor+"' ";
                total += jdbcTemplate.queryForObject(sql,Integer.class);
            }
        }
        return total;
    }
}
}

+ 2 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/prescription/BaseCarePrescriptionService.java

@ -55,7 +55,8 @@ public class BaseCarePrescriptionService {
                "     case p.sex " +
                "     case p.sex " +
                "     when 1 then '男'  " +
                "     when 1 then '男'  " +
                "     when 2 then '女' " +
                "     when 2 then '女' " +
                "     end AS sex, " +
                "     end AS sex," +
                "     'prescription' as type, " +
                "     TIMESTAMPDIFF(year,p.birthday,NOW()) AS age  ";
                "     TIMESTAMPDIFF(year,p.birthday,NOW()) AS age  ";
        String filters = "from base_care_prescription a" +
        String filters = "from base_care_prescription a" +
                " LEFT JOIN base_patient p ON a.patient = p.id," +
                " LEFT JOIN base_patient p ON a.patient = p.id," +