Package clips.delegate.client

Examples of clips.delegate.client.CollaboratorLocal


    @Override
    public void fillItems() throws ClipsException {
        if (certificateLocal == null) {
            throw new ClipsException();
        }
        CollaboratorLocal collab = new CollaboratorLocal(certificateLocal.getCollaborator().getID(), null);//NULL AL
        Selector<CollaboratorFunctionsChunk> funcList = collab.getFunctions();
        for (int i = 0; i < funcList.size(); i++) {
            CollaboratorFunctionsChunk function = funcList.get(i);
            if (defaultid == 0) {
                defaultid = function.getId();
            }
View Full Code Here


                String tfLpuCode = fields.get(Col.MCOD).get().trim();
                if (ogrn.equals(lpuOGRN) && tfLpuCode.equals(lpuCode)) {
                    String collCode = fields.get(Col.PCOD).get().trim();
                    DirectoryCollaboratorItem coll = collMap.get(collCode);
                    if (coll != null) {
                        CollaboratorLocal collab = new CollaboratorLocal(coll.getID(), null);//NULL AL
                        Date begin;
                        String begStr = fields.get(Col.DATE_B).get().trim();
                        if (begStr.isEmpty()) {
                            begin = null;
                        }
                        else {
                            begin = ((DateField)fields.get(Col.DATE_B)).getCalendar().getTime();
                        }
                        Date end;
                        String endStr = fields.get(Col.DATE_E).get().trim();
                        if (endStr.isEmpty()) {
                            end = null;
                        }
                        else {
                            end = ((DateField)fields.get(Col.DATE_E)).getCalendar().getTime();
                        }
                        Date cur = TimeLocal.getCurrentTime().getTime();
                        if ((begin != null && begin.before(cur))
                                && (end != null && end.after(cur) || end == null || Comparator.dataEqual(end, nullDate))) {
                            collab.setDlo(true);
                            collab.save1();
                        }
                        else {
                            if (collab.isDlo()) {
                                collab.setDlo(false);
                                collab.save1();
                            }
                        }
                       
                    }
                }
View Full Code Here

    private void saveData() throws ClipsException {
        for (int i = 0; i < colDataList.size(); i++) {
            CollabData cd = colDataList.get(i);
            ColDataKey key = new ColDataKey(cd.surnameID, cd.nameID, cd.pathronID);
            ClientLocal client = colClientMap.get(key).get(0);
            CollaboratorLocal collab = findCollab(client);
            if (collab == null) {
                collab = new CollaboratorLocal(client);
                collab.save1();
                dirCollab = DirectoryLocator.getDirectory(DirectoryCollaborator.class, true);
                System.out.println("Загружен " + i + " " + collab);
            } else {
                System.out.println("Найден " + i + " " + collab + " ID = " + collab.getID());
            }
            CollaboratorFunctionsChunk collFunc = findFunc(collab, cd.specID, cd.receptionTypeID, cd.dvrID, cd.vmuID);
            if (collFunc == null) {
                CollaboratorFunctionsDetails d = new CollaboratorFunctionsDetails();
                d.collaboratorID = collab.getID();
                d.dvrID = cd.dvrID;
                d.firstMedicalAidID = cd.vmuID;
                d.receptionTypeID = cd.receptionTypeID;
                d.specialityID = cd.specID;
                d.external_key = cd.extKey;
                collFunc = new CollaboratorFunctionsChunk(collab, d);
                collab.getFunctions().append(collFunc);
                collab.save1();
            }
        }
    }
View Full Code Here

    private CollaboratorLocal findCollab(ClientLocal client) throws ClipsException {
        collabList = new ArrayList<CollaboratorLocal>();
        DirectoryLpuItem lpu = UserInfo.get().getCollaborator().getLpu();
        List<DirectoryCollaboratorItem> items = dirCollab.getItemsFiltered(lpu, false, false, false);
        for (int i = 0; i < items.size(); i++) {
            CollaboratorLocal collab = new CollaboratorLocal(items.get(i).getID(), am);
            collabList.add(collab);
        }
        for (int i = 0; i < collabList.size(); i++) {
            if (collabList.get(i).getClient().getID() == client.getID()) {
                return collabList.get(i);
View Full Code Here

            collabList = new ArrayList<CollaboratorLocal>();
            DirectoryCollaborator dir = DirectoryLocator.getDirectory(DirectoryCollaborator.class);
            DirectoryLpuItem lpu = UserInfo.get().getCollaborator().getLpu();
            List<DirectoryCollaboratorItem> items = dir.getItemsFiltered(lpu, true, false, false);
            for (int i = 0; i < items.size(); i++) {
                CollaboratorLocal collab = new CollaboratorLocal(items.get(i).getID(), null);//NULL AL
                collabList.add(collab);
            }
        }
        for (int i = 0; i < collabList.size(); i++) {
            CollaboratorLocal collab = collabList.get(i);
            SelectorEditable<CollaboratorFunctionsChunk> functions = collab.getFunctions();
            CollaboratorFunctionsChunk foundedByExtKey = null;
            for (int j = 0; j < functions.size(); j++) {
                CollaboratorFunctionsChunk cfc = functions.get(j);
                if (cfc.getExtKey() != null && cfc.getExtKey().equals(extkey)) {
                    foundedByExtKey = cfc;
                }
                if (foundedByExtKey != null
                        && foundedByExtKey.getFirstMedicalAid() != null
                        && foundedByExtKey.getFirstMedicalAid().getExtKey() != null
                        && foundedByExtKey.getFirstMedicalAid().getExtKey().equals(vmu)) {
                    return foundedByExtKey;
                }
            }
            if (foundedByExtKey != null) {
                //По внешнему ключу нашли, по типу первичной помощи надо создать
                CollaboratorFunctionsDetails d = new CollaboratorFunctionsDetails();
                d.collaboratorID = collab.getID();
                d.dvrID = foundedByExtKey.getDvr().getID();
                d.firstMedicalAidID = dirVmu.getItemFromExtKey(vmu).getID();
                d.receptionTypeID = foundedByExtKey.getReceptionType().getID();
                d.specialityID = foundedByExtKey.getSpeciality().getID();
                d.external_key = foundedByExtKey.getExtKey();
                CollaboratorFunctionsChunk collFunc = new CollaboratorFunctionsChunk(collab, d);
                collab.getFunctions().append(collFunc);
                try {
                    collab.save1();
                } catch (ClipsException ex) {
                    collab.clearBean();
                    collab.save1();
                }
                return collFunc;
            }
        }
        return null;
View Full Code Here

                    if (collabLoc != null && selectedCollaborator.getID() == collabLoc.getID()) {
                        return;
                    }
                    try {
                        spec.setText("");
                        collabLoc = new CollaboratorLocal(selectedCollaborator.getID(), getAuditManager());
                        collabLoc.getDetails();//костыль, иначе детали не прогрузятся
                        collabLoc.addContentStateListener(getContainer());

                        DefaultListModel model = new  DefaultListModel();
                        Enumeration<UserRightsGroup> enu = rightsSet.rightsGroups();
View Full Code Here

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
        try {
            DirectoryCollaborator directory = DirectoryLocator.getDirectory(DirectoryCollaborator.class);
            ROList<DirectoryCollaboratorItem> items = directory.getItemsList();
            for (DirectoryCollaboratorItem directoryCollaboratorItem : items) {
                CollaboratorLocal collaboratorLocal = new CollaboratorLocal(directoryCollaboratorItem.getID(), getAuditManager());
                if (collaboratorLocal.haveCertificate()){
                    collaboratorLocal.addCertificate();
                    System.out.println(collaboratorLocal.toString() + " id: " + collaboratorLocal.getID() + " - сертификат добавлен в базу");
                }else{
                    System.out.println(collaboratorLocal.toString() + " id: " + collaboratorLocal.getID() + " не имеет сертификата");
                }
            }
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
View Full Code Here

                        return;
                    }
                    //попытка найти сотрудника из уже имеющихся
                    Integer collID = dirCollab.getByClientID(pus.getSelectedClient().getID());
                    if (collID == 0) {
                        collabLoc = new CollaboratorLocal(pus.getSelectedClient());
                        panelSelColl.setSelectedCollaborator(null);
                        setState(STATE_CREATING);
                        addListeners();
                        collabToScreen();
                        resetPanel();
                    } else {
                        collabLoc = new CollaboratorLocal(collID, getAuditManager());
                        panelSelColl.setSelectedCollaborator(dirCollab.getItemFromID(collID));
                        setState(STATE_EDITING);
                        addListeners();
                        collabToScreen();
                        resetPanel();
View Full Code Here

     */
    public void chooseDone(int type, int id) throws ChoosePanelComboException {
        if (!isDirty() || collabLoc.isNewlyCreated()) {
            try {
                if (collabLoc == null || !collabLoc.isNewlyCreated()) {
                    collabLoc = new CollaboratorLocal(id, getAuditManager());
                }
                resetPanel();
                ldapModel.setObject(collabLoc);
                codeModel.setObject(collabLoc);
                loginModel.setObject(collabLoc);
View Full Code Here

    @Override
    public void fillItems() throws ClipsException {
        if (certificateLocal == null) {
            throw new ClipsException();
        }
        CollaboratorLocal collab = new CollaboratorLocal(certificateLocal.getCollaborator().getID(), null);//NULL AL
        Selector<CollaboratorFunctionsChunk> funcList = collab.getFunctions();
        for (int i = 0; i < funcList.size(); i++) {
            CollaboratorFunctionsChunk function = funcList.get(i);
            if (defaultid == 0) {
                defaultid = function.getId();
            }
View Full Code Here

TOP

Related Classes of clips.delegate.client.CollaboratorLocal

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.