Package clips.directory

Source Code of clips.directory.PanelDirectoryAdmin

/*
* PanelDirectoryAdmin.java
*
* Created on 13 �?юнь 2008 г., 11:10
*/

package clips.directory;

import beans.contract.search.ContractFilter;
import beans.directory.mkb10.MkbItem;
import beans.doctor.disease.updater.UpdaterStattalonBean;
import beans.doctor.disease.updater.UpdaterStattalonBeanRemote;
import beans.user.client.updater.UpdaterClientBean;
import beans.user.client.updater.UpdaterClientBeanRemote;
import cli_fmw.delegate.AuditList;
import clips.delegate.contract.ContractLocal;
import clips.delegate.directory.complex.DirectoryDoctorAction;
import cli_fmw.delegate.directory.complex.DirectoryIntelliWriter;
import cli_fmw.delegate.directory.complex.DirectoryLocator;
import clips.delegate.directory.complex.DirectoryMKB10;
import clips.delegate.directory.complex.DirectoryServicesGroup;
import clips.delegate.directory.complex.DirectoryVidalAtcItem;
import clips.delegate.directory.complex.DirectoryVidalFarm;
import clips.delegate.directory.filtered.DirectoryService;
import cli_fmw.delegate.DelegateLine2;
import cli_fmw.delegate.SharedBean;
import cli_fmw.main.ClipsException;
import cli_fmw.directory.editors.kladr.DBaseParser;
import clips.delegate.directory.ro.DirectoryCollaboratorItem;
import clips.directory.editors.mkb10.MahonParser;
import clips.directory.editors.serviceGroup.ServiceParser;
import clips.directory.editors.vidalAtc.AtcParser;
import clips.directory.editors.vidalFarm.FarmParser;
import cli_fmw.directory.editors.writer.IntellWriterParser;
import cli_fmw.main.PageContainer;
import cli_fmw.main.PageGeneric;
import cli_fmw.utils.MessageBox;
import cli_fmw.utils.table_config_states.StateSaver;
import clips.Main;
import clips.delegate.client.ClientSearchLocal;
import clips.delegate.client.CollaboratorLocal;
import clips.delegate.contract.ContractFactoryLocal;
import clips.delegate.directory.ro.DirectoryCollaborator;
import clips.directory.editors.mkb10.TxtParser;
import clips.directory.tempMapper.PanelTempMapperEditor;
import clips.login.UserInfo;
import clips.main.ClipsConfig;
import framework.beans.ModificationInfo;
import framework.utils.ROList;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JFileChooser;
import org.jfree.ui.ExtensionFileFilter;

/**
*
* @author  vip
*/
public class PanelDirectoryAdmin extends PageGeneric {
   
    /** Creates new form PanelDirectoryAdmin */
    public PanelDirectoryAdmin(PageContainer container) throws ClipsException {
        super(container);
        initComponents();
        uploadATC.setVisible(/*Main.DEVELOPED_ON*/false);
        //uploadMahon.setVisible(/*Main.DEVELOPED_ON*/false);
        uploadFarm.setVisible(/*Main.DEVELOPED_ON*/false);
        btSetDistrict.setVisible(Main.DEVELOPED_ON);
        StateSaver.attachTo(this);
    }
   
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        right = new javax.swing.JPanel();
        uploadMahon = new javax.swing.JButton();
        btTempMapperEditor = new javax.swing.JButton();
        btUnionPolis = new javax.swing.JButton();
        btUploadCLADR = new javax.swing.JButton();
        btUploadActions = new javax.swing.JButton();
        updateMKB10 = new javax.swing.JButton();
        btValidateMKB10 = new javax.swing.JButton();
        uploadATC = new javax.swing.JButton();
        uploadFarm = new javax.swing.JButton();
        btUploadIntelWriter = new javax.swing.JButton();
        btUploadServices = new javax.swing.JButton();
        jButton1 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jButton2 = new javax.swing.JButton();
        btTestDisease = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        btSetDistrict = new javax.swing.JButton();
        btGeneratePhones = new javax.swing.JButton();
        btGenerateAddressCashe = new javax.swing.JButton();
        btGenerateUUID = new javax.swing.JButton();

        setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
        setLayout(new java.awt.GridLayout(1, 0, 10, 0));

        right.setLayout(new java.awt.GridLayout(13, 1, 0, 5));

        uploadMahon.setText("Загрузить MKB10 из CSV");
        uploadMahon.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                uploadMahonActionPerformed(evt);
            }
        });
        right.add(uploadMahon);

        btTempMapperEditor.setText("Редактор TempMapper");
        btTempMapperEditor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTempMapperEditorActionPerformed(evt);
            }
        });
        right.add(btTempMapperEditor);

        btUnionPolis.setText("Объединение полисов");
        btUnionPolis.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUnionPolisActionPerformed(evt);
            }
        });
        right.add(btUnionPolis);

        btUploadCLADR.setText("Загрузить КЛАДР");
        btUploadCLADR.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUploadCLADRActionPerformed(evt);
            }
        });
        right.add(btUploadCLADR);

        btUploadActions.setText("Загрузить действия врача");
        btUploadActions.setEnabled(false);
        btUploadActions.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUploadActionsActionPerformed(evt);
            }
        });
        right.add(btUploadActions);

        updateMKB10.setText("Апдейт МКБ10 из txt");
        updateMKB10.setEnabled(false);
        updateMKB10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                updateMKB10ActionPerformed(evt);
            }
        });
        right.add(updateMKB10);

        btValidateMKB10.setText("Проверка MKB10 на ошибки");
        btValidateMKB10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btValidateMKB10ActionPerformed(evt);
            }
        });
        right.add(btValidateMKB10);

        uploadATC.setText("Загрузить АТХ из TXT");
        uploadATC.setEnabled(false);
        uploadATC.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                uploadATCActionPerformed(evt);
            }
        });
        right.add(uploadATC);

        uploadFarm.setText("Загрузить К.-Ф. У из TXT");
        uploadFarm.setEnabled(false);
        uploadFarm.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                uploadFarmActionPerformed(evt);
            }
        });
        right.add(uploadFarm);

        btUploadIntelWriter.setText("Загрузить Intell Writer");
        btUploadIntelWriter.setEnabled(false);
        btUploadIntelWriter.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUploadIntelWriterActionPerformed(evt);
            }
        });
        right.add(btUploadIntelWriter);

        btUploadServices.setText("Загрузить услуги и группы");
        btUploadServices.setEnabled(false);
        btUploadServices.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btUploadServicesActionPerformed(evt);
            }
        });
        right.add(btUploadServices);

        jButton1.setText("Связ услуги и действия");
        jButton1.setEnabled(false);
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });
        right.add(jButton1);

        add(right);

        jPanel1.setLayout(new java.awt.GridLayout(13, 1, 0, 5));

        jButton2.setText("Объединение пациентов");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton2);

        btTestDisease.setText("Проверка диагнозов заболеваний");
        btTestDisease.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btTestDiseaseActionPerformed(evt);
            }
        });
        jPanel1.add(btTestDisease);

        jButton3.setText("Раздать сертификаты");
        jButton3.setEnabled(false);
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });
        jPanel1.add(jButton3);

        btSetDistrict.setText("Распределить участки");
        btSetDistrict.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btSetDistrictActionPerformed(evt);
            }
        });
        jPanel1.add(btSetDistrict);

        btGeneratePhones.setText("Сгенерировать телефоны");
        btGeneratePhones.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btGeneratePhonesActionPerformed(evt);
            }
        });
        jPanel1.add(btGeneratePhones);

        btGenerateAddressCashe.setText("Сгенерировать кеш адресов");
        btGenerateAddressCashe.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btGenerateAddressCasheActionPerformed(evt);
            }
        });
        jPanel1.add(btGenerateAddressCashe);

        btGenerateUUID.setText("Сгенерировать UUIDы");
        btGenerateUUID.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btGenerateUUIDActionPerformed(evt);
            }
        });
        jPanel1.add(btGenerateUUID);

        add(jPanel1);
    }// </editor-fold>//GEN-END:initComponents

    //простые справочники
//типы анализов и осмотров
  private void uploadMahonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadMahonActionPerformed
    JFileChooser    dlg = new JFileChooser();
    ClipsConfig      cfg = ClipsConfig.getInstance();
    dlg.setCurrentDirectory(cfg.getLastOpenDialogPath());
    dlg.setFileFilter(new ExtensionFileFilter("Файлы CSV (*.csv)", "csv"));
    int          res = dlg.showOpenDialog(this);
    if (res == JFileChooser.APPROVE_OPTION){
      cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
      try {
        File csv = dlg.getSelectedFile();
        MahonParser parser = new MahonParser(csv);
        ArrayList<MkbItem>    list = parser.read();
        DirectoryMKB10      dir = (DirectoryMKB10) DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
        dir.synchronize(list);
        DirectoryLocator.getDirectory(DirectoryMKB10.class, true);
      } catch (FileNotFoundException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (IOException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (Exception ex) {
        MessageBox.showExceptionOnly(ex);
      }
    }
  }//GEN-LAST:event_uploadMahonActionPerformed

  @Deprecated
  private void uploadATCActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadATCActionPerformed
    JFileChooser dlg = new JFileChooser();
    ClipsConfig cfg = ClipsConfig.getInstance();
    dlg.setCurrentDirectory(cfg.getLastOpenDialogPath());
    dlg.setFileFilter(new ExtensionFileFilter("Файлы TXT (*.txt)", "txt"));
    int          res = dlg.showOpenDialog(this);
    if (res == JFileChooser.APPROVE_OPTION){
      cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
      try {
        File htm = dlg.getSelectedFile();
        AtcParser parser = new AtcParser(htm);
        ArrayList<DirectoryVidalAtcItem> list = parser.read();
       
      } catch (FileNotFoundException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (IOException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (Exception ex) {
        MessageBox.showExceptionOnly(ex);
      }
    }
  }//GEN-LAST:event_uploadATCActionPerformed

  @Deprecated
  private void uploadFarmActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_uploadFarmActionPerformed
    JFileChooser    dlg = new JFileChooser();
    ClipsConfig      cfg = ClipsConfig.getInstance();
    dlg.setCurrentDirectory(cfg.getLastOpenDialogPath());
    dlg.setFileFilter(new ExtensionFileFilter("Файлы TXT (*.txt)", "txt"));
    int          res = dlg.showOpenDialog(this);
    if (res == JFileChooser.APPROVE_OPTION){
      cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
      try {
        File farmFile = dlg.getSelectedFile();
        FarmParser parser = new FarmParser(farmFile);
                parser.read();
        DirectoryLocator.getDirectory(DirectoryVidalFarm.class, true);
      } catch (FileNotFoundException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (IOException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (Exception ex) {
        MessageBox.showExceptionOnly(ex);
      }
    }
  }//GEN-LAST:event_uploadFarmActionPerformed

  private void btUploadIntelWriterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUploadIntelWriterActionPerformed
      DirectoryIntelliWriter writer;
      try {
          IntellWriterParser writerParser = new IntellWriterParser();
          writerParser.read();
          writer = DirectoryLocator.getDirectory(DirectoryIntelliWriter.class, true);
      } catch (FileNotFoundException ex) {
          MessageBox.showException(ex);
      } catch (IOException ex) {
          MessageBox.showException(ex);
      } catch (ClipsException ex) {
          MessageBox.showException(ex);
      }
  }//GEN-LAST:event_btUploadIntelWriterActionPerformed

  private void btUploadServicesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUploadServicesActionPerformed
      JFileChooser    dlg = new JFileChooser();
      ClipsConfig      cfg = ClipsConfig.getInstance();
      dlg.setCurrentDirectory(cfg.getLastOpenDialogPath());
      dlg.setFileFilter(new ExtensionFileFilter("Файлы TXT (*.txt)", "txt"));
      int          res = dlg.showOpenDialog(this);
      if (res == JFileChooser.APPROVE_OPTION){
          cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
          try {
              File servicesFile = dlg.getSelectedFile();
              ServiceParser parser = new ServiceParser(servicesFile);
              parser.uploadService();
              DirectoryLocator.getDirectory(DirectoryService.class, true);
              DirectoryLocator.getDirectory(DirectoryServicesGroup.class, true);
          } catch (FileNotFoundException ex) {
              MessageBox.showExceptionOnly(ex);
          } catch (IOException ex) {
              MessageBox.showExceptionOnly(ex);
          } catch (Exception ex) {
              MessageBox.showExceptionOnly(ex);
          }
      }
  }//GEN-LAST:event_btUploadServicesActionPerformed

  private void btUploadActionsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUploadActionsActionPerformed
      JFileChooser    dlg = new JFileChooser();
      ClipsConfig      cfg = ClipsConfig.getInstance();
      dlg.setCurrentDirectory(cfg.getLastOpenDialogPath());
      dlg.setFileFilter(new ExtensionFileFilter("Файлы TXT (*.txt)", "txt"));
      int          res = dlg.showOpenDialog(this);
      if (res == JFileChooser.APPROVE_OPTION){
          cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
          try {
              File servicesFile = dlg.getSelectedFile();
              ServiceParser parser = new ServiceParser(servicesFile);
              parser.uploadDoctorAction();
              DirectoryLocator.getDirectory(DirectoryDoctorAction.class, true);
          } catch (FileNotFoundException ex) {
              MessageBox.showExceptionOnly(ex);
          } catch (IOException ex) {
              MessageBox.showExceptionOnly(ex);
          } catch (Exception ex) {
              MessageBox.showExceptionOnly(ex);
          }
      }
  }//GEN-LAST:event_btUploadActionsActionPerformed

  private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
      JFileChooser    dlg = new JFileChooser();
      ClipsConfig      cfg = ClipsConfig.getInstance();
      dlg.setCurrentDirectory(cfg.getLastOpenDialogPath());
      dlg.setFileFilter(new ExtensionFileFilter("Файлы TXT (*.txt)", "txt"));
      int          res = dlg.showOpenDialog(this);
      if (res == JFileChooser.APPROVE_OPTION){
          cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
          try {
              File servicesFile = dlg.getSelectedFile();
              ServiceParser parser = new ServiceParser(servicesFile);
              parser.uploadServiceActions();
          } catch (FileNotFoundException ex) {
              MessageBox.showExceptionOnly(ex);
          } catch (IOException ex) {
              MessageBox.showExceptionOnly(ex);
          } catch (Exception ex) {
              MessageBox.showExceptionOnly(ex);
          }
      }
    }//GEN-LAST:event_jButton1ActionPerformed

  private void btUploadCLADRActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUploadCLADRActionPerformed
      JFileChooser fcChooseFolder = new JFileChooser();
      ClipsConfig cfg = ClipsConfig.getInstance();
      fcChooseFolder.setCurrentDirectory(cfg.getLastOpenDialogPath());
      fcChooseFolder.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
//      fcChooseFolder.setFileFilter(new ExtensionFileFilter("Файлы DBASE (*.DBF)", "*.DBF"));
      int res = fcChooseFolder.showOpenDialog(this);
      if (res == JFileChooser.APPROVE_OPTION) {
          cfg.setLastOpenDialogPath(fcChooseFolder.getCurrentDirectory());
          try {
 
              DBaseParser dbParser = new DBaseParser(fcChooseFolder.getSelectedFile());
              dbParser.run();
 
          } catch (ClipsException ex) {
              MessageBox.showException(ex);
          }
      }
  }//GEN-LAST:event_btUploadCLADRActionPerformed

  private void updateMKB10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_updateMKB10ActionPerformed
    JFileChooser    dlg = new JFileChooser();
    ClipsConfig      cfg = ClipsConfig.getInstance();
    dlg.setCurrentDirectory(cfg.getLastOpenDialogPath());
    dlg.setFileFilter(new ExtensionFileFilter("Файлы TXT (*.txt)", "txt"));
    int          res = dlg.showOpenDialog(this);
    if (res == JFileChooser.APPROVE_OPTION){
      cfg.setLastOpenDialogPath(dlg.getCurrentDirectory());
      try {
        File txt = dlg.getSelectedFile();
        TxtParser parser = new TxtParser(txt);
        ArrayList<MkbItem>    list = parser.read();
        DirectoryMKB10      dir = (DirectoryMKB10) DirectoryLocator.getDirectory(DirectoryMKB10.class, false);
                dir.updateTitle(list);
                MessageBox.showInfo("Обновление прошло удачно");
      } catch (FileNotFoundException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (IOException ex) {
        MessageBox.showExceptionOnly(ex);
      } catch (Exception ex) {
        MessageBox.showExceptionOnly(ex);
      }
    }
  }//GEN-LAST:event_updateMKB10ActionPerformed

  private void btValidateMKB10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btValidateMKB10ActionPerformed
    try {
      DirectoryMKB10 dir = DirectoryLocator.getDirectory(DirectoryMKB10.class);
      dir.validate();
    }
    catch (ParseException ex) {
      MessageBox.showExceptionOnly(ex);
    }
    catch (ClipsException ex) {
      MessageBox.showException(ex);
    }

  }//GEN-LAST:event_btValidateMKB10ActionPerformed

  private void btUnionPolisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btUnionPolisActionPerformed
        try {
            ContractFactoryLocal cf = new ContractFactoryLocal(getAuditManager());
            ContractFilter contractFilter = new ContractFilter();
            contractFilter.index = "";
            contractFilter.enterpriseId = -1;
            contractFilter.lpuID = UserInfo.get().getCollaborator().getLpu().getID();
            ArrayList<ContractLocal> contractList = cf.findContractList(contractFilter);
            System.out.println("Найдено " + contractList.size() + " контрактов");
            for (int i = 0; i < contractList.size(); i++) {
                ContractLocal contractLocal = contractList.get(i);
                System.out.println("Обработка контракта № " + (i+1) + " (" + contractLocal + ")");
                contractLocal.unionPolises();
            }
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }

  }//GEN-LAST:event_btUnionPolisActionPerformed

  private void btTempMapperEditorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTempMapperEditorActionPerformed
        try {
            PanelTempMapperEditor panel = new PanelTempMapperEditor(getContainer());
            PageGeneric page = getContainer().addNewPage((PageGeneric) panel, null);
            getContainer().activatePage(page);
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
  }//GEN-LAST:event_btTempMapperEditorActionPerformed

  private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        try {
            ClientSearchLocal csl = new ClientSearchLocal(getAuditManager());
            ModificationInfo mi = csl.unionPacients();
            getAuditManager().needDSA(new AuditList(mi.getAudit()));
        } catch (ClipsException ex) {
            MessageBox.showException(ex);
        }
  }//GEN-LAST:event_jButton2ActionPerformed

    private void btTestDiseaseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btTestDiseaseActionPerformed
        SharedBean<UpdaterStattalonBeanRemote> bean = new SharedBean<UpdaterStattalonBeanRemote>(UpdaterStattalonBean.class.getSimpleName());
        try {
            Set<String> clientList = bean.get().checkDiseaseDiagnosys();
            if (clientList.size() == 0) {
                MessageBox.showInfo("Ошибок не найдено");
                return;
            }
            int counter = 0;
            String message = "Ошибки в заболеваниях найдены у следующих пациентов (" + clientList.size() + " человек) :\n";
            for (String client : clientList) {
                message = message + client + "\n";
                counter ++;
                if (counter > 20) {
                    break;
                }
            }
            MessageBox.showInfo(message);
        } catch (Exception ex) {
            bean.clear();
            MessageBox.showException(ex);
        }
    }//GEN-LAST:event_btTestDiseaseActionPerformed

    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);
        }
    }//GEN-LAST:event_jButton3ActionPerformed

    private void btSetDistrictActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btSetDistrictActionPerformed
        SharedBean<UpdaterClientBeanRemote> bean = new SharedBean<UpdaterClientBeanRemote>(UpdaterClientBean.class.getSimpleName());
        try {
            bean.get().setDistricts();
        } catch (Exception ex) {
            bean.clear();
            MessageBox.showException(ex);
        }
    }//GEN-LAST:event_btSetDistrictActionPerformed

    private void btGeneratePhonesActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btGeneratePhonesActionPerformed
        SharedBean<UpdaterClientBeanRemote> bean = new SharedBean<UpdaterClientBeanRemote>(UpdaterClientBean.class.getSimpleName());
        try {
            bean.get().generatePhones();
        } catch (Exception ex) {
            bean.clear();
            MessageBox.showException(ex);
        }
    }//GEN-LAST:event_btGeneratePhonesActionPerformed

    private void btGenerateAddressCasheActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btGenerateAddressCasheActionPerformed
        SharedBean<UpdaterClientBeanRemote> bean = new SharedBean<UpdaterClientBeanRemote>(UpdaterClientBean.class.getSimpleName());
        try {
            bean.get().generateAddressCashe();
        } catch (Exception ex) {
            bean.clear();
            MessageBox.showException(ex);
        }
    }//GEN-LAST:event_btGenerateAddressCasheActionPerformed

    private void btGenerateUUIDActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btGenerateUUIDActionPerformed
        SharedBean<UpdaterClientBeanRemote> bean = new SharedBean<UpdaterClientBeanRemote>(UpdaterClientBean.class.getSimpleName());
        try {
            bean.get().generateUUID();
        } catch (Exception ex) {
            bean.clear();
            MessageBox.showException(ex);
        }
    }//GEN-LAST:event_btGenerateUUIDActionPerformed

    @Override
    public String getPageTitle() {
        return "Обновления и настройки";
    }
   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btGenerateAddressCashe;
    private javax.swing.JButton btGeneratePhones;
    private javax.swing.JButton btGenerateUUID;
    private javax.swing.JButton btSetDistrict;
    private javax.swing.JButton btTempMapperEditor;
    private javax.swing.JButton btTestDisease;
    private javax.swing.JButton btUnionPolis;
    private javax.swing.JButton btUploadActions;
    private javax.swing.JButton btUploadCLADR;
    private javax.swing.JButton btUploadIntelWriter;
    private javax.swing.JButton btUploadServices;
    private javax.swing.JButton btValidateMKB10;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel right;
    private javax.swing.JButton updateMKB10;
    private javax.swing.JButton uploadATC;
    private javax.swing.JButton uploadFarm;
    private javax.swing.JButton uploadMahon;
    // End of variables declaration//GEN-END:variables

    @Override
    public DelegateLine2 getDelegate() {
        return null;
    }
}
TOP

Related Classes of clips.directory.PanelDirectoryAdmin

TOP
Copyright © 2018 www.massapi.com. 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.