Prechádzať zdrojové kódy

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

liubing 3 rokov pred
rodič
commit
65b58615d2

+ 3 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/assistance/EmergencyAssistanceService.java

@ -901,7 +901,8 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            result.put(ResponseContant.resultMsg,failMsg);
            result.put(ResponseContant.resultMsg,failMsg);
            return result;
            return result;
        }
        }
        if(!doctor.equals(assistanceDO.getDoctor())){
        //紧急救助编辑服务小结前不会有医生
        if(!permissionService.isOlderServerDoctor(doctor,assistanceDO.getPatient())){
            String failMsg = "该操作没有权限";
            String failMsg = "该操作没有权限";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,failMsg);
            result.put(ResponseContant.resultMsg,failMsg);
@ -1307,7 +1308,7 @@ public class EmergencyAssistanceService extends BaseJpaService<EmergencyAssistan
            result.put("status_0",0);//已完成
            result.put("status_0",0);//已完成
            result.put("status_1",0);//预警中
            result.put("status_1",0);//预警中
            String sql = " select ord.status,count(distinct ord.id) count from base_emergency_assistance_order ord INNER JOIN base_patient_helper ph on ord.patient = ph.patient and ph.del=1 " +
            String sql = " select ord.status,count(distinct ord.id) count from base_emergency_assistance_order ord INNER JOIN base_patient_helper ph on ord.patient = ph.patient and ph.del=1 " +
                    "  where ph.doctor='"+doctor+"'  " ;
                    "  where ph.doctor='"+doctor+"' group by ord.status  " ;
            List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql);
            List<Map<String,Object>> sqlResult = jdbcTemplate.queryForList(sql);
            for (Map<String,Object> map:sqlResult){
            for (Map<String,Object> map:sqlResult){
                result.put("status_"+map.get("status"),map.get("count"));
                result.put("status_"+map.get("status"),map.get("count"));

+ 18 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/common/PermissionService.java

@ -159,4 +159,22 @@ public class PermissionService {
    public HttpServletRequest getRequest(){
    public HttpServletRequest getRequest(){
        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
        return ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
    }
    }
    //判断社工/助老员是否为患者的服务医生 true是 false否
    public boolean isOlderServerDoctor(String doctor,String patient){
        try {
            String sql = " SELECT sum(total) from ( " +
                    "select count(id) as total from base_patient_helper ph where ph.doctor = '"+doctor+"' and patient='"+patient+"' and del=1 " +
                    "UNION all " +
                    "SELECT count(d.id) as total from base_service_package_sign_record sr,base_service_package_record r,base_team_member m,base_doctor d " +
                    " WHERE sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id and m.doctor_code = d.id  " +
                    "and m.del = '1' and sr.patient = '"+patient+"' and d.id='"+doctor+"' and d.del=1)A ";
            Integer total = jdbcTemplate.queryForObject(sql,Integer.class);
            return total>0?true:false;
        }catch (Exception e){
            e.printStackTrace();
            return false;
        }
    }
}
}

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultTeamService.java

@ -513,7 +513,7 @@ public class ConsultTeamService {
        }
        }
        ConsultDo consult = consultDao.findOne(consultTeam.getConsult());
        ConsultDo consult = consultDao.findOne(consultTeam.getConsult());
        String sessionId = patient + consultTeam.getType();
        String sessionId = patient + "_"+consultTeam.getType();
        String operatorId = endOperator;
        String operatorId = endOperator;
        String operatorName=null;
        String operatorName=null;
        if (endType==1){
        if (endType==1){
@ -524,7 +524,7 @@ public class ConsultTeamService {
            operatorName = doctorDO.getName();
            operatorName = doctorDO.getName();
        }
        }
        try {
        try {
            JSONObject obj =  imUtill.endTopics(sessionId,operatorId,operatorName,consultTeam.getConsult());
                JSONObject obj =  imUtill.endTopics(sessionId,operatorId,operatorName,consultTeam.getConsult());
            if (obj == null||obj.getInteger("status") == -1) {
            if (obj == null||obj.getInteger("status") == -1) {
                return false;
                return false;
            }
            }

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/doctor/CareDoctorService.java

@ -176,7 +176,7 @@ public class CareDoctorService extends BaseJpaService<BaseDoctorDO, BaseDoctorDa
        Integer sex = jsonObject.getInteger("sex");
        Integer sex = jsonObject.getInteger("sex");
        String introduce = jsonObject.get("introduce").toString();
        String introduce = jsonObject.get("introduce").toString();
        String expertise = jsonObject.get("expertise").toString();
        String expertise = jsonObject.get("expertise").toString();
        String photo = jsonObject.get("photo").toString();
        String photo = null==jsonObject.get("photo")?null:jsonObject.get("photo").toString();
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctorId);
        BaseDoctorDO doctorDO = baseDoctorDao.findOne(doctorId);
        if (doctorDO!=null){
        if (doctorDO!=null){
            doctorDO.setIntroduce(introduce);
            doctorDO.setIntroduce(introduce);

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/label/PatientLableService.java

@ -116,11 +116,11 @@ public class PatientLableService extends BaseJpaService<WlyyPatientLabelDO, Wlyy
        String filters ="";
        String filters ="";
        if(StringUtils.isNotBlank(labelCode)){
        if(StringUtils.isNotBlank(labelCode)){
            filters = " from base_patient_helper ph, base_patient p,wlyy_patient_label l " +
            filters = " from base_patient_helper ph, base_patient p,wlyy_patient_label l " +
                    "   WHERE ph.patient = p.id and ph.doctor='"+doctor+"' and p.del=1 and p.id = l.patient and l.label_type = 1 " +
                    "   WHERE ph.patient = p.id and ph.doctor='"+doctor+"' and p.del=1 and ph.del=1 and p.id = l.patient and l.label_type = 1 " +
                    " and l.label_code =  '"+labelCode+"' ";
                    " and l.label_code =  '"+labelCode+"' ";
        }else {
        }else {
            filters = " from base_patient_helper ph, base_patient p,wlyy_patient_label l " +
            filters = " from base_patient_helper ph, base_patient p,wlyy_patient_label l " +
                    "   WHERE ph.patient = p.id and ph.doctor='"+doctor+"' and p.del=1 and p.id = l.patient and l.label_type = 1 ";
                    "   WHERE ph.patient = p.id and ph.doctor='"+doctor+"' and p.del=1 and ph.del=1 and p.id = l.patient and l.label_type = 1 ";
        }
        }
        if(StringUtils.isNotBlank(name)){
        if(StringUtils.isNotBlank(name)){
            filters += " and (p.name like '%"+name+"%' or p.idcard like '%"+name+"%') ";
            filters += " and (p.name like '%"+name+"%' or p.idcard like '%"+name+"%') ";

+ 10 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -9,6 +9,7 @@ import com.yihu.jw.care.dao.device.*;
import com.yihu.jw.care.dao.security.*;
import com.yihu.jw.care.dao.security.*;
import com.yihu.jw.care.dao.team.BaseTeamMemberDao;
import com.yihu.jw.care.dao.team.BaseTeamMemberDao;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.service.common.DictService;
import com.yihu.jw.care.service.common.PermissionService;
import com.yihu.jw.care.service.consult.ConsultTeamService;
import com.yihu.jw.care.service.consult.ConsultTeamService;
import com.yihu.jw.care.service.contacts.ContactsService;
import com.yihu.jw.care.service.contacts.ContactsService;
import com.yihu.jw.care.service.device.DeviceService;
import com.yihu.jw.care.service.device.DeviceService;
@ -145,6 +146,8 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    private HealthIndexUtil healthIndexUtil;
    private HealthIndexUtil healthIndexUtil;
    @Autowired
    @Autowired
    private DeviceService deviceService;
    private DeviceService deviceService;
    @Autowired
    private PermissionService permissionService;
    private Logger logger = LoggerFactory.getLogger(SecurityMonitoringOrderService.class);
    private Logger logger = LoggerFactory.getLogger(SecurityMonitoringOrderService.class);
@ -1322,6 +1325,13 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
                one.setUpdateUserName(doctorDO.getName());
                one.setUpdateUserName(doctorDO.getName());
            }
            }
        }
        }
        //安防救助编辑服务小结前不会有医生
        if(!permissionService.isOlderServerDoctor(doctor,one.getPatient())){
            String failMsg = "该操作没有权限";
            result.put(ResponseContant.resultFlag, ResponseContant.fail);
            result.put(ResponseContant.resultMsg,failMsg);
            return result;
        }
        if (one == null) {
        if (one == null) {
            String failMsg = "工单不存在";
            String failMsg = "工单不存在";
            result.put("resultFlag", 0);
            result.put("resultFlag", 0);

+ 1 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/sign/ServicePackageService.java

@ -330,7 +330,7 @@ public class ServicePackageService extends BaseJpaService<ServicePackageDO, Serv
    public List<Map<String,Object>> fingdDoctorByPaitenId(String patientId,Integer doctorLevel){
    public List<Map<String,Object>> fingdDoctorByPaitenId(String patientId,Integer doctorLevel){
        String sql = "SELECT DISTINCT d.id,d.name from base_service_package_sign_record sr,base_service_package_record r,base_team_member m,base_doctor d  " +
        String sql = "SELECT DISTINCT d.id,d.name from base_service_package_sign_record sr,base_service_package_record r,base_team_member m,base_doctor d  " +
                "               WHERE sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id and m.doctor_code = d.id " +
                "               WHERE sr.status=1 and m.team_code = r.team_code and sr.id=r.sign_id and m.doctor_code = d.id " +
                "               and m.del = '1' and sr.patient = '"+patientId+"' and d.doctor_level='"+doctorLevel+"' " ;
                "               and m.del = '1' and sr.patient = '"+patientId+"' and d.doctor_level='"+doctorLevel+"' and d.del=1 " ;
        return jdbcTemplate.queryForList(sql);
        return jdbcTemplate.queryForList(sql);
    }
    }