Package beans.user.client.facilityClient

Examples of beans.user.client.facilityClient.FacilityDocument


        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


        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>() {

            @Override
            public int compare(FacilityDocument o1, FacilityDocument o2) {
                if (o1.getGspEnd()==null) {
                    return 1;
                }
                if (o2.getGspEnd()==null) {
                    return -1;
                }
                return o1.getGspEnd().compareTo(o2.getGspEnd());

            }
        });

        for (int i = 0; i < docList.size(); i++) {
            doc = docList.get(i);
            if (doc.getExcemption() != null) {
                int ex = doc.getExcemption().getId();
                if ((!both && ex == res.exempId)
                        || (both && (ex == ex1 || ex == ex2))
                        || (ex1 + ex2 == 0)) {
                    res.docName = doc.getDocumentName();
                    res.docSN = doc.getDocumentSN();
                    res.gspBegin = doc.getGspBegin();
                    res.gspEnd = doc.getGspEnd();
                    res.exempId = ex;
                }
            }
        }
View Full Code Here

TOP

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

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.