Package beans.user.client.facilityClient

Examples of beans.user.client.facilityClient.FacilityClient


        String sql = "DELETE a FROM FacilityClient a";
        Query query = manager.createQuery(sql);
        query.executeUpdate();
        for (int i = 0; i < list.size(); i++) {
            FacilityClientDetails d = list.get(i);
            FacilityClient entity = new FacilityClient();

            entity.setSnils(d.snils);
            entity.setPolisSN(d.polisSN);
            entity.setSurname(d.surnameId == 0 ? null : findEntity(Surname.class, d.surnameId));
            entity.setName(d.nameId == 0 ? null : findEntity(Name.class, d.nameId));
            entity.setPathronymic(d.pathronId == 0 ? null : findEntity(Patronymic.class, d.pathronId));
            entity.setSex(findEntity(Sex.class, d.sexId));
            entity.setBorn(d.bornDate);
            entity.setDocumentType(d.docTypeId == 0 ? null : findEntity(ClientDocumentType.class, d.docTypeId));
            entity.setDocumentSN(d.docSN);
            entity.setAddress(d.address);
            entity.setBuilding(d.building);
            entity.setCorpus(d.corpus);
            entity.setFlat(d.flat);
            entity.setOkatoReg(d.okatoReg);
            entity.setFlagNSU(d.flagNSU);
            entity.setNsuBegin(d.nsuBegin);
            entity.setNsuEnd(d.nsuEnd);
            entity.setExcemption1(d.exemp1Id == 0 ? null : findEntity(Excemption.class, d.exemp1Id));
            entity.setExcemption2(d.exemp2Id == 0 ? null : findEntity(Excemption.class, d.exemp2Id));
            entity.setRegBegin(d.regBegin);
            entity.setRegEnd(d.regEnd);
            entity.setuType(d.uType);
            entity.setdType(d.dType);
            entity.setcReg(d.c_reg);
            saveEntity(entity);
        }

        sql = "DELETE a FROM FacilityDocument a";
        query = manager.createQuery(sql);
        query.executeUpdate();
        for (int i = 0; i < docList.size(); i++) {
            FacilityDocumentDetails d = docList.get(i);
            FacilityDocument entity = new FacilityDocument();
            entity.setSnils(d.snils);
            entity.setExcemption(d.exempId == 0 ? null : findEntity(Excemption.class, d.exempId));
            entity.setDocumentName(d.docType);
            entity.setDocumentSN(d.docSN);
            entity.setGspBegin(d.gspBegin);
            entity.setGspEnd(d.gspEnd);
            saveEntity(entity);
        }
    }
View Full Code Here


        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);

        int ex1 = facClient.getExcemption1() != null ? facClient.getExcemption1().getId() : 0;
        int ex2 = facClient.getExcemption2() != null ? facClient.getExcemption2().getId() : 0;
       
        if (!both) {
            res.exempId = ex1 + ex2;
        }
        else {
            res.exempId = ex1;
        }

        res.nsuBegin = facClient.getNsuBegin();
        res.nsuEnd = facClient.getNsuEnd();

        res.nsuFlag = facClient.getFlagNSU();

        res.regBegin = facClient.getRegBegin();
        res.regEnd = facClient.getRegEnd();

        FacilityDocument doc = null;
        List<FacilityDocument> docList =
                findEntityList(FacilityDocument.class, new Field[]{new Field("snils", facClient.getSnils())});
        if (docList.isEmpty()) {
            return res;
        }

        Collections.sort(docList, new Comparator<FacilityDocument>() {
View Full Code Here

            query.setParameter("name", cl.getName());
            query.setParameter("pathronymic", cl.getPathronymic());
            query.setParameter("snils", cl.getSnils());
            List<FacilityClient> fcList = query.getResultList();
            if (!fcList.isEmpty()) {
                FacilityClient fc = fcList.get(0);
                Excemption ex = fc.getExcemption1();
                if (ex == null) {
                    ex = fc.getExcemption2();
                }
                if (ex != null) {
                    data.exemptionID = ex.getExtKey();
                }
            }
View Full Code Here

TOP

Related Classes of beans.user.client.facilityClient.FacilityClient

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.