Package beans.user.client.entity

Examples of beans.user.client.entity.Client


        sortResult(resultList);
        List<RegisterData> target = new ArrayList<RegisterData>(resultList.size());
        for (ServiceRender sr : resultList) {
            RegisterData rd = new RegisterData();
            Client client = sr.getPolis().getClient();
            Address address = sr.getPolis().getAddress();
            if (address == null) {
                address = client.getAddress();
            }
            rd.id = sr.getId();
            rd.uuid = sr.getUuid();
            //rd.depart = sr.getFunctions().getReceptionType().getId();
            rd.history = sr.getDisease().getEmc().getNumber();
            if (rd.history == null) {
                rd.history = "";
            }
            rd.fam = client.getSurname() == null ? 0 : client.getSurname().getId();
            rd.nam = client.getName() == null ? 0 : client.getName().getId();
            rd.fnam = client.getPathronymic() == null ? 0 : client.getPathronymic().getId();
            rd.bday = client.getBorn();
            rd.sex = client.getSex().getId();
            rd.status = client.getSocialStatus() == null ? 0 : client.getSocialStatus().getId();
            Client representative = null;
            if (sr.getPolis().getNumber().equals(Polis.FICTIVE_POLIS_NUMBER)) {
                representative = client.getRepresentative();
            }

            ClientDocument doc;
            Polis polis;
            if (representative != null) {
                rd.p_status = client.getRepresentativeStatus().getId();
                rd.p_fam = representative.getSurname() == null ? 0 : representative.getSurname().getId();
                rd.p_nam = representative.getName() == null ? 0 : representative.getName().getId();
                rd.p_fnam = representative.getPathronymic() == null ? 0 : representative.getPathronymic().getId();
                rd.pred = 1;
                doc = representative.getClientDocument();
                polis = ClientBean.findPolisOMI(representative, manager);
            } else {
                rd.p_status = 0;
                rd.p_fam = 0;
                rd.p_nam = 0;
View Full Code Here


        System.out.println("Сортировка результатов выгрузки реестра...");
        Collections.sort(resultList, new Comparator<ServiceRender>() {

            @Override
            public int compare(ServiceRender sr1, ServiceRender sr2) {
                Client c1 = sr1.getPolis().getClient();
                Client c2 = sr2.getPolis().getClient();

                //по фамилии
                String fam1 = c1.getSurname() == null ? "" : c1.getSurname().getTitle();
                String fam2 = c2.getSurname() == null ? "" : c2.getSurname().getTitle();
                int r = fam1.compareTo(fam2);
                if (r != 0) return r;

                //по имени
                String nam1 = c1.getName() == null ? "" : c1.getName().getTitle();
                String nam2 = c2.getName() == null ? "" : c2.getName().getTitle();
                r = nam1.compareTo(nam2);
                if (r != 0) return r;

                //по отчеству
                String ot1 = c1.getPathronymic() == null ? "" : c1.getPathronymic().getTitle();
                String ot2 = c2.getPathronymic() == null ? "" : c2.getPathronymic().getTitle();
                r = ot1.compareTo(ot2);
                if (r != 0) return r;

                //По дате оказания
                return sr1.getRenderedDate().compareTo(sr2.getRenderedDate());
View Full Code Here

        List<Medexam> ml = findEntityList(Medexam.class, fields);
       
        ArrayList<MedexamClientChunk> res = new ArrayList<MedexamClientChunk>();
        for (int j = 0; j < ml.size(); j++) {
            Medexam medexam = ml.get(j);
            Client client = medexam.getDisease().getEmc().getClient();
            res.add(new MedexamClientChunk(medexam.getDetails(this), client.getDetails(this)));
        }
        return res;         
    }
View Full Code Here

            CommitteeReason commReason = findEntity(CommitteeReason.class, comReasonID);
            field = new Field("committeeReason", commReason);
            f[pos++] = field;
        }
        if (clientID != 0) {
            Client client = findEntity(Client.class, clientID);
            field = new Field("serviceRender.disease.emc.client", client);
            f[pos++] = field;
        }
        if (from != null) {           
            field = new Field("date", from, Field.OPERATOR_EQUAL_OR_MORE);
View Full Code Here

    private void replaceSurname(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Client
        List entityList = findEntityList(Client.class, "surname", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Client client = (Client)entityList.get(i);
            client.setSurname((Surname) entityWith);
            manager.merge(client);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

    private void replaceName(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Client
        List entityList = findEntityList(Client.class, "name", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Client client = (Client)entityList.get(i);
            client.setName((Name) entityWith);
            manager.merge(client);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

    private void replacePatronymic(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Client
        List entityList = findEntityList(Client.class, "pathronymic", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Client client = (Client) entityList.get(i);
            client.setPathronymic((Patronymic) entityWith);
            manager.merge(client);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

    private void replaceSocialStatus(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Client
        List entityList = findEntityList(Client.class, "socialStatus", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Client client = (Client) entityList.get(i);
            client.setSocialStatus((SocialStatus) entityWith);
            manager.merge(client);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

    private void replaceUserGroup(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
        //Client
        List entityList = findEntityList(Client.class, "userGroup", entityWhat);
        for (int i = 0; i < entityList.size(); i++) {
            Client c = (Client) entityList.get(i);
            c.setUserGroup((UserGroup) entityWith);
            manager.merge(c);
        }
        removeEntity(entityWhat);
        manager.flush();
    }
View Full Code Here

            dcu.dateBorn = born;
            dcu.snils = snils != null ? snils.trim() : "";

            Integer id = clientMap.get(dcu);
            if (id != null) {
                Client client = findEntity(Client.class, id);

                PersonalData data = new PersonalData();
                data.id = id;
                data.snils = snils;

                Polis polisOMI = ClientBean.findPolisOMI(client, manager);
                if (polisOMI != null) {
                    clientPolisMap.put(client.getId(), polisOMI);

                    String polisSN ="";
                    if (polisOMI.getSeries() != null) {
                        polisSN = polisOMI.getSeries();
                    }
                    if (polisOMI.getNumber() != null) {
                        polisSN = polisSN + " " + polisOMI.getNumber();
                    }
                    data.polisSN = polisSN.trim();

                    String code = polisOMI.getRegionCode().getTitle();
                    code += "00000000000000000";
                    Field[] f = new Field[]{new Field("kladrCode", code)};
                    List<AddressObject> adrs = findEntityList(AddressObject.class, f);
                    if (!adrs.isEmpty()) {
                        String okatoS = Long.toString(adrs.get(0).getOkato());
                        if (okatoS.length() > 5) {
                            okatoS = okatoS.substring(0, 5);
                        }
                        int okatoI = Integer.parseInt(okatoS);
                        data.okatoOMC = okatoI;
                    }
                    else {
                        data.okatoOMC = Integer.MIN_VALUE;
                    }

                    //TODO ОГРН СМО
                }

                data.surname = surname != null ? surname.getTitle() : null;
                data.name = name != null ? name.getTitle() : null;
                data.pathronymic = patronymic != null ? patronymic.getTitle() : null;

                Sex sex = client.getSex();
                if (sex != null) {
                    data.sex = client.getSex().getId() == Sex.CLIENT_SEX_MALE ? 'М' : 'Ж';
                }
                else {
                    data.sex = Character.MIN_VALUE;
                }
                data.bornDate = born;

                Excemption ex = fc.getExcemption1();
                if (ex == null) {
                    ex = fc.getExcemption2();
                }
                if (ex != null) {
                    data.exemptionID = ex.getExtKey();
                }

                ClientDocument doc = client.getClientDocument();
                if (doc != null) {
                    ClientDocumentType type = doc.getDoctype();
                    if (type != null) {
                        data.docTypeID = type.getExtKey();
                    }
                    String docSN ="";
                    if (doc.getSeries() != null) {
                        docSN = doc.getSeries();
                    }
                    if (doc.getNumber() != null) {
                        docSN = docSN + " " + doc.getNumber();
                    }
                    data.docSN = docSN.trim();
                }
                else {
                    ClientDocumentType type = fc.getDocumentType();
                    if (type != null) {
                        data.docTypeID = type.getExtKey();
                    }
                    data.docSN = fc.getDocumentSN();
                }

                Address add = client.getAddress();
                if (add != null) {
                    AddressObject aObj = add.getAddressObject();
                    String okatoS = Long.toString(aObj.getOkato());
                    if (okatoS.length() > 5) {
                        okatoS = okatoS.substring(0, 5);
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.