Package framework.beans.directory.simple.entities

Examples of framework.beans.directory.simple.entities.Surname


        Query query = manager.createQuery(sql);
        List<Object[]> list = query.getResultList();
        for (Object[] line: list) {
            DloClientUnique dcu = new DloClientUnique();
            Integer clientID = (Integer) line[0];
            Surname surname = (Surname) line[1];
            Name name = (Name) line[2];
            Patronymic pathronymic = (Patronymic) line[3];

            dcu.surnameID = surname == null ? 0 : surname.getId();
            dcu.nameID = name == null ? 0 : name.getId();
            dcu.pathronID = pathronymic == null ? 0 : pathronymic.getId();
            dcu.dateBorn = (Date) line[4];
            dcu.snils = line[5] != null ? ((String) line[5]).trim() : "";
            clientMap.put(dcu, clientID);
        }

        for (FacilityClient fc : facClientList) {
            Surname surname = fc.getSurname();
            Name name = fc.getName();
            Patronymic patronymic = fc.getPathronymic();
            Date born = fc.getBorn();
            String snils = fc.getSnils();

            DloClientUnique dcu = new DloClientUnique();
            dcu.surnameID = surname == null ? 0 : surname.getId();
            dcu.nameID = name == null ? 0 : name.getId();
            dcu.pathronID = patronymic == null ? 0 : patronymic.getId();
            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) {
View Full Code Here


        @SuppressWarnings("unchecked")
        List<Object[]> list = query.getResultList();
        for (Object[] line: list) {
            ClientUniq cu = new ClientUniq();
            Integer emcID = (Integer) line[0];
            Surname surname = (Surname) line[1];
            Name name = (Name) line[2];
            Patronymic pathronymic = (Patronymic) line[3];

            cu.surnameID = surname == null ? 0 : surname.getId();
            cu.nameID = name == null ? 0 : name.getId();
            cu.pathronID = pathronymic == null ? 0 : pathronymic.getId();
            cu.dateBorn = (Date) line[4];
            mapEmc.put(cu, emcID);
        }
View Full Code Here

    @Override
    public void updateSurnames(HashSet<String> famList) {
        HashSet<String> set = loadDirectory(Surname.class);
        for (String fam : famList) {
            if (!set.contains(fam)) {
                Surname surname = new Surname();
                surname.setTitle(fam);
                surname.setDirty(false);
                manager.persist(surname);
                set.add(surname.getTitle());
            }
        }
    }
View Full Code Here

                System.out.println("Start Mapping Clients");
                int i = 0;
                for (Object[] line: list) {
                    ClientUniq cu = new ClientUniq();
                    Integer clientID = (Integer) line[0];
                    Surname surname = (Surname) line[1];
                    Name name = (Name) line[2];
                    Patronymic pathronymic = (Patronymic) line[3];

                    cu.surnameID = surname == null ? 0 : surname.getId();
                    cu.nameID = name == null ? 0 : name.getId();
                    cu.pathronID = pathronymic == null ? 0 : pathronymic.getId();
                    cu.dateBorn = (Date) line[4];
                    mapClient.put(cu, clientID);
                }
View Full Code Here

   */
    private String generateTitle() {
        if (getClient() == null) {
            return "ФИО не указано";
        }
        Surname surname = getClient().getSurname();
        Name name = getClient().getName();
        Patronymic pat = getClient().getPathronymic();

        String collaborator = (surname == null) ? "?????????" : surname.getTitle();
        collaborator += " ";
        collaborator += (name == null) ? "?." : name.getTitle().substring(0, 1);
        collaborator += (pat == null) ? "?." : pat.getTitle().substring(0, 1);
        return collaborator;
    }
View Full Code Here

TOP

Related Classes of framework.beans.directory.simple.entities.Surname

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.