Examples of EDataIntegrity


Examples of framework.generic.EDataIntegrity

        checkCommandAccessibility(COMMAND_READ);
        Job entity = getExistentEntity();
       
        int jobId = entity.getId();
        if (jobId == 0) {
            throw new EDataIntegrity("");
        }

        Iterator list = findEntityList(DangerJob.class, "key.job", jobId).iterator();
        Set<DangerJobDetails> res = new HashSet<DangerJobDetails>();
        while (list.hasNext()) {
View Full Code Here

Examples of framework.generic.EDataIntegrity

        checkCommandAccessibility(COMMAND_REMOVE);
        Job entity = getExistentEntity();
       
        int jobId = entity.getId();
        if (jobId != details.jobId){
            throw new EDataIntegrity("Вредный фактор относится к другой работе. Удаление невозможно!");
        }
       
        checkEntityExist();
        Field f[] = {
            new Field("key.job", jobId),
View Full Code Here

Examples of framework.generic.EDataIntegrity

     * @param details
     * @throws generic.ClipsServerException
     */
    private void check(CertificateTypeDetails d) throws ClipsServerException {
        if (d.reportDefinitionID == 0) {
            throw new EDataIntegrity("Не задан отчет, которым будет распечатываться справка");
        }
    }   
View Full Code Here

Examples of framework.generic.EDataIntegrity

            AuditDoc auditDoc, List<AuditDoc> auditDocList) throws ClipsServerException{
        MedexamDetails d = (MedexamDetails) details;
        //Разграничение по действиям
        //открытие больничного
    if (getId() == 0) {
            throw new EDataIntegrity("Нельзя создать медосмотр данным способом");
    } else {
            checkCommandAccessibility(COMMAND_MODIFY);
            if (entity.getDisease().getId() != d.diseaseID) {
                throw new EDataIntegrity("Нельзя заменять заболевание медосмотра");
            }
            if (entity.getMedexamType().getId() != d.medexamTypeID) {
                throw new EDataIntegrity("Нельзя менять тип у медосмотра");
            }
            if (entity.getId() != d.id) {
                throw new EDataIntegrity("Попытка подмены ID медосмотра");
            }
            entity.setResult(d.resultID == 0 ? null : findEntity(ProfChekupResult.class, d.resultID));
    }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

    @Override
    public int setMedSerrenResult(MedSerrenResultDetails details) throws ClipsServerException {
        MedSerrenResult entity = findEntity(MedSerrenResult.class, details.id);
        //Проверка полей - ничо менять нельзя
        if (entity.getSerren().getId() != details.serrenID) {
            throw new EDataIntegrity("Попытка подмены результатов медосмотра");
        }
        //Проверка безопасности - выставлять результаты может только оказавший услугу, либо суперюзер
        if (entity.getSerren().getFunctions() == null
                || entity.getSerren().getFunctions().getCollaborator().getId() != getCollaboratorId()) {
            throwNeedAdminSecurityException("Выставить результат может только сотрудник, оказавший услугу");
View Full Code Here

Examples of framework.generic.EDataIntegrity

                    "по времени действия с другим, кроме текущего. И должен начинаться позже текущего.");
            }
        }
         */
        if (d.begin != null && d.end != null && d.begin.after(d.end)) {
            throw new EDataIntegrity("Недопустимо, чтобы начало действия договора было позже его конца");
        }

        if (d.type == Contract.TYPE_OMI && d.lpuID != 0) {
            throw new EDataIntegrity("Договор ОМС нельзя заключать с клиникой");
        }

        if (d.type != Contract.TYPE_OMI && d.lpuID == 0) {
            throw new EDataIntegrity("В договоре не указана клиника");
        }

        if (d.type == Contract.TYPE_OMI) {
            throwNeedAdminSecurityException("Вы не имеете права на создание или изменение договора ОМС");
        }
View Full Code Here

Examples of framework.generic.EDataIntegrity

                    };
            int count = getEntityCount(ServiceRender.class,fields);
                   
            if (count != 0) {
                List<ServiceRender> serrenList = findEntityListWithResCount(ServiceRender.class, fields, "", 1);
                throw new EDataIntegrity("Цены на данную услугу не могут быть изменены или удалены, так как она уже кому-то назначалась "
                        + "\nПри необходимости создайте копию договора, а старый заблокируйте"
                        + "\n[" + serrenList.get(0).getInfo() + "]");
            }
        }
    }
View Full Code Here

Examples of framework.generic.EDataIntegrity

        ServicePrice servicePrice = null;
        if (details.id != 0) {
            servicePrice = findEntity(ServicePrice.class, details.id);
            checkTheSame(servicePrice.getContract());
            if (servicePrice.getService().getId() != details.serviceID) {
                throw new EDataIntegrity("Зафиксирована попытка подмены данных");
            }
            int rtID = servicePrice.getReceptionType() == null ? 0 : servicePrice.getReceptionType().getId();
            if (rtID != details.receptionTypeID) {
                throw new EDataIntegrity("Зафиксирована попытка подмены данных");
            }
            checkModifyServicePrice(servicePrice, details);
            auditDoc = new AuditDoc<ServicePrice>(servicePrice, getCollaborator());
        } else {
            auditDoc = new AuditDoc<ServicePrice>(null, getCollaborator());
            servicePrice = new ServicePrice();
            checkModifyServicePrice(servicePrice, details);
            //Проверка - для посещений нельзя указывать тип приема нулл, а также типы приемов, не имеющие кодов
            // для остальных услуг тип приема должна быть нулл
            Service service = findEntity(Service.class, details.serviceID);
            if (service.getServiceGroup().getId() == ServiceGroup.SERVICE_GROUP_VISIT) {
                if (details.receptionTypeID == 0) {
                    throw new EDataIntegrity("При установке цены на посещение не указан тип приема");
                }
                ReceptionType rt = findEntity(ReceptionType.class, details.receptionTypeID);
                if (rt.getExtKey().trim().isEmpty()) {
                    throw new EDataIntegrity("При установке цены на посещение не указан тип приема");
                }
            } else {
                if (details.receptionTypeID != 0) {
                    throw new EDataIntegrity("При установке цены на услугу тип приема не должен быть указан");
                }
            }
            servicePrice.setService(findEntity(Service.class, details.serviceID));
            servicePrice.setContract(entity);
            servicePrice.setReceptionType(details.receptionTypeID == 0 ? null : findEntity(ReceptionType.class, details.receptionTypeID));
        }
        if (details.money > details.price) {
            throw new EDataIntegrity("Нельзя указывать оплату по договору больше общей стоимости услуги");
        }
        servicePrice.setMoney(details.money);
        servicePrice.setPrice(details.price);
        int id = saveEntity(servicePrice);
        auditDoc.check(servicePrice);
View Full Code Here

Examples of framework.generic.EDataIntegrity

            String packets = "";
            for (int i = 0; i < foundedPST.size(); i++) {
                PacketTemplate packetTemplate = (PacketTemplate) foundedPST.get(i);
                packets += packetTemplate.getTitle() + "\n";
            }
            throw new EDataIntegrity("В договоре присутствуют следующие пакеты, содержащие эту услугу :\n" + packets);
        }

        AuditDoc<ServicePrice> auditDoc = new AuditDoc<ServicePrice>(servicePrice, getCollaborator());
        manager.remove(servicePrice);
        auditDoc.check(null);
View Full Code Here

Examples of framework.generic.EDataIntegrity

                String serviceTitles = "";
                for (int i = 0; i < notFoundedServices.size(); i++) {
                    Service service = (Service)notFoundedServices.get(i);
                    serviceTitles += service.getCodeAndTitle() + "\n";
                }
                throw new EDataIntegrity("В договоре отсутствуют необходимые услуги : \n" + serviceTitles);
            }
            AuditDoc<ContractPacket> auditCP = new AuditDoc<ContractPacket>(null, getCollaborator());
            auditDocList.add(auditCP);
            ContractPacket cp = new ContractPacket();
            cp.setKey(new ContractPacketPK(eid, packetTemplateID));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.