Package beans.user.client.entity

Examples of beans.user.client.entity.Client


     * @return список больничных
     */
    @Override
    public List<SicklistDetails> getSicklistList() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ_EMC);
        Client entity = getExistentEntity();
       
        List list = findEntityList(Sicklist.class, "diagOpen.serviceRender.disease.emc.client", entity, "order by a.dateOpen");
        List<SicklistDetails> res = new ArrayList<SicklistDetails>();
        Iterator i = list.iterator();
        while(i.hasNext()) {
View Full Code Here


   * @throws ClipsServerException
     */
    @Override
    public List<SicklistDetails> getSicklistsInCurrentYear() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ_EMC);
        Client entity = getExistentEntity();

        Calendar cal = GregorianCalendar.getInstance();
        cal.set(cal.get(Calendar.YEAR), 1, 1, 0, 0, 0);
        Date yearBegin = cal.getTime();

View Full Code Here

    }

    @Override
    public ClientDocumentDetails getClientDocument() throws ClipsServerException {
        checkCommandAccessibility(COMMAND_READ);
        Client entity = getExistentEntity();
        ClientDocument doc = entity.getClientDocument();
        if (doc == null) {
            doc = new ClientDocument();
        }
        return doc.getDetails(this);
    }
View Full Code Here

    @Override
    public ModificationInfo setClientDocument(ClientDocumentDetails details) throws ClipsServerException {
        checkCommandAccessibility(COMMAND_MODIFY);

        Client entity = getExistentEntity();
        AuditDoc<Client> auditDoc = new AuditDoc<Client>(entity, getCollaborator());
        ClientDocument doc = entity.getClientDocument();
       
        if (details.typeID == 0) {
            if (doc != null) {
                entity.setClientDocument(null);
                saveEntity(entity);
                removeEntity(doc);
            }
        }
        else {
            boolean newDoc = false;
            if (doc == null) {
                doc = new ClientDocument();
                newDoc = true;
            }

            doc.setNumber(details.number);
            doc.setSeries(details.series);
            doc.setDate(details.date);
            doc.setDoctype(findEntity(ClientDocumentType.class, details.typeID));
            doc.setGivenPlace(details.enterpriseID == 0 ? null : findEntity(DocumentGivenPlace.class, details.enterpriseID));

            saveEntity(doc);
            if(newDoc) {
                entity.setClientDocument(doc);
                saveEntity(entity);
            }
        }
        if (auditDoc.check(entity)) {
            return new ModificationInfo(persistAudit(auditDoc));
View Full Code Here

    return target;
    }

    @Override
    public FacilityClientChunk getClientExemption() throws ClipsServerException {
        Client client = getExistentEntity();
        Field[] fs = new Field[4];

        fs[0] = new Field("surname.id", client.getSurname() != null ? client.getSurname().getId() : null);
        fs[1] = new Field("name.id", client.getName() != null ? client.getName().getId() : null);
        fs[2] = new Field("pathronymic.id", client.getPathronymic() != null ? client.getPathronymic().getId() : null);
        fs[3] = new Field("born", client.getBorn());

        List<FacilityClient> list = findEntityList(FacilityClient.class, fs);
        if (list.isEmpty()) {
            return null;
        }
       
        FacilityClient facClient = list.get(0);
        FacilityClientChunk res = new FacilityClientChunk();
       
        res.snils = facClient.getSnils();
        res.clientId = client.getId();
       

        boolean both = (facClient.getExcemption1() != null)
                && (facClient.getExcemption2() != null);
View Full Code Here

    @Override
    public ArrayList<CommitteeDetails> getClientCommittees() throws ClipsServerException {
        ArrayList<CommitteeDetails> res = new ArrayList<CommitteeDetails>();

        Client client = getExistentEntity();
        Field[] field = new Field[]{new Field("direction.serviceRender.polis.client", client)};
        List<CommitteeDirection> comDirs = findEntityList(CommitteeDirection.class, field);
        for (CommitteeDirection dir : comDirs) {
            res.add(dir.getCommittee().getDetails(this));
        }
View Full Code Here

                + "AND c1.pathronymic.id = c2.pathronymic.id "
                + "AND c1.born = c2.born ";
        Query query = manager.createQuery(sql);
        List<Client> res = query.getResultList();
        for (int i = 0; i < res.size(); i++) {
            Client c1 = res.get(i);
            pacients.put(c1.getId(), c1);
        }
        ArrayList<Client> pacientsA = new ArrayList<Client>(pacients.values());
        HashMap<ClientUniq, ArrayList<Client>> pacientsMap = new HashMap<ClientUniq, ArrayList<Client>>();
        for (int i = 0; i < pacientsA.size(); i++) {
            Client c = pacientsA.get(i);
            ClientDetails det = c.getDetails(this);
            ClientUniq p =
                    new ClientUniq(det.surnameId, det.nameId, det.pathronId, det.born);
            ArrayList<Client> clA = pacientsMap.get(p);
            if (clA == null) {
                clA = new ArrayList<Client>();
            }
            clA.add(c);
            pacientsMap.put(p, clA);
        }
        ArrayList<AuditDetails> auditDetailsList = new ArrayList<AuditDetails>();
        Iterator<ArrayList<Client>> pacientsI = pacientsMap.values().iterator();
        while (pacientsI.hasNext()) {
            ArrayList<Client> array = pacientsI.next();
            Client dst = array.get(0);
            System.out.println("***************************************************************************");
            System.out.println("ПАЦИЕНТ ГЛАВНЫЙ " + dst.getId() + " " + dst.getFio());
            for (int i = 1; i < array.size(); i++) {
                Client src = array.get(i);
                System.out.println("  ПАЦИЕНТ " + src.getId() + " " + src.getFio());
                AuditDetails unionCollab = unionCollab(dst, src);
                if (unionCollab != null) {
                    auditDetailsList.add(unionCollab);
                }
                auditDetailsList.addAll(unionEMC(dst, src));
View Full Code Here

        clientDetails.inn = c.inn;
        clientDetails.snils = c.snils;
        clientDetails.numberEmc = c.numambk;
        ClientUniq cu = new ClientUniq(c.famID, c.nameID, c.patronID, c.dateBorn);
        Integer clientID = mapClient.get(cu);
        Client client = null;
        if (clientID != null && clientID != 0) {
            client = findEntity(Client.class, clientID);
        }
        if (client != null) {
            ClientDetails d2 = client.getDetails(this);
            d2.surnameId = clientDetails.surnameId;
            d2.nameId = clientDetails.nameId;

            d2.pathronId = clientDetails.pathronId;
            d2.sexId = clientDetails.sexId;
View Full Code Here

    public void generatePhones() throws ClipsServerException {
        throwNeedAdminSecurityException("Доступно только суперпользователю");
        List<Client> clientList = findEntityList(Client.class);
        Random r = new Random();
        for (int i = 0; i < clientList.size(); i++) {
            Client client = clientList.get(i);
            if ((i % 100) == 0) {
                System.out.println("Выполнено " + i/((float)clientList.size())*100 + "%");
            }
            String phone = "";
            int n = 1 + r.nextInt(4);
            for (int j = 0; j < n; j++) {
                phone = phone + getRandomPhone() + ";" + (j<n ? " " : "");
            }
            client.setTelephones(phone);
            manager.merge(client);
        }
    }
View Full Code Here

        Collections.sort(res, new Comparator<Polis>() {

            @Override
            public int compare(Polis p1, Polis p2) {
                int c;
                Client o1 = p1.getClient();
                Client o2 = p2.getClient();
                if (o1.getSurname()==null) {
                    return -1;
                }
                if (o2.getSurname()==null) {
                    return 1;
                }
                c = o1.getSurname().getTitle().compareTo(o2.getSurname().getTitle());
                if (c != 0) {
                    return c;
                } else {
                    if (o1.getName()==null) {
                        return -1;
                    }
                    if (o2.getName()==null) {
                        return 1;
                    }
                    c = o1.getName().getTitle().compareTo(o2.getName().getTitle());
                    if (c != 0) {
                        return c;
                    } else {
                        if (o1.getPathronymic()==null) {
                            return -1;
                        }
                        if (o2.getPathronymic()==null) {
                            return 1;
                        }
                        c = o1.getPathronymic().getTitle().compareTo(o2.getPathronymic().getTitle());
                    }
                    return c;
                }
            }
        });
View Full Code Here

TOP

Related Classes of beans.user.client.entity.Client

Copyright © 2018 www.massapicom. 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.