{:from PyQt4 import QtGui} {:from library.Utils import forceDateTime, formatDateTime, forceString, forceInt} {:from library.DateEdit import CDateEdit} {:from library.crbcombobox import CRBComboBox} {def: checkValue()} {if: edtIntInput.value()} {:buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(True)} {else:} {:buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False)} {end:} {end:} {:dialog = QtGui.QDialog()} {:buttonBox = QtGui.QDialogButtonBox(dialog)} {:buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Ok|QtGui.QDialogButtonBox.Cancel)} {:buttonBox.accepted.connect(dialog.accept)} {:buttonBox.rejected.connect(dialog.reject)} {:buttonBox.button(QtGui.QDialogButtonBox.Ok).setEnabled(False)} {:edtIntInput = QtGui.QSpinBox(dialog)} {:edtIntInput.setMinimum(0)} {:edtIntInput.setMaximum(2147483647)} {:edtIntInput.setSingleStep(1)} {:edtIntInput.setMinimumWidth(100)} {:edtIntInput.valueChanged.connect(checkValue)} {:edtBool1 = QtGui.QCheckBox(dialog)} {:edtBool2 = QtGui.QCheckBox(dialog)} {:layout = QtGui.QGridLayout(dialog)} {:layout.addWidget(QtGui.QLabel(u'Идентификатор события'), 0, 0)} {:layout.addWidget(edtIntInput, 0, 1)} {: edtBool1.setText(u'Выгружать повторно')} {:layout.addWidget(edtBool1, 1, 0)} {: edtBool2.setText(u'Отобразить детальный лог выгрузки')} {:layout.addWidget(edtBool2, 2, 0)} {:layout.setRowStretch(3, 1)} {:layout.addWidget(buttonBox, 4, 0, 1, 2)} {:dialog.setWindowTitle(u'Параметры экспорта')} {if: not dialog.exec_()} {:exit()} {end:} {:event_id = edtIntInput.value()} {:db = QtGui.qApp.db} {:exportE = db.getRecordEx('Event_Export', '*', 'master_id = %d' % (event_id))} {if: exportE} {:dateTime = forceDateTime(exportE.value('dateTime'))} {:modifyDatetime = forceDateTime(exportE.value('masterDatetime'))} {end:} {if: dateTime and modifyDatetime} {if: dateTime >= modifyDatetime and edtBool1.isChecked()} {:QtGui.qApp.db.query('UPDATE Event_Export SET masterDatetime=DATE_SUB(masterDatetime, INTERVAL 1 MINUTE),dateTime=masterDatetime WHERE master_id = %d' % (event_id))} {end:} {end:} {:exportCase = readUrl("http://"+dbServerName+"/exportCasesManually/exportCasesManually.php?eventId=%i"%(event_id), timeout=300)} {:exportE = db.getRecordEx('Event_Export', '*', 'master_id = %d' % (event_id))} {if: exportE} {:dateTime = forceDateTime(exportE.value('dateTime'))} {if: len(exportCase.strip()) == 0 and exportE.value('success').toBool()}

Выгрузка завершилась без ошибок (экспортирован {formatDateTime(dateTime)})

{if:forceString(exportE.value('note'))}
Примечание: {forceString(exportE.value('note'))} {end:} {elif: len(exportCase.strip()) == 0 and not exportE.value('success').toBool()}

Выгрузка завершилась с ошибкой (экспортирован {formatDateTime(dateTime)})

{if:forceString(exportE.value('note'))}
Примечание: {forceString(exportE.value('note'))} {end:} {end:} {end:} {if: u'В данный момент осуществляется автовыгрузка' in exportCase}

Обнаружен работающий экземпляр модуля выгрузки в ИЭМК.


Параллельная ручная выгрузка невозможна. Повторите попытку позднее. {elif: len(exportCase.strip()) > 0}

Во время выгрузки возникли ошибки:


{exportCase} {if: exportE} {if: forceString(exportE.value('note'))}
Примечание: {forceString(exportE.value('note'))} {end:} {end:} {end:} {if: not exportE and len(exportCase.strip()) == 0}

Выгрузка не выполнена. Проверьте сообщение лога или обратитесь в отдел сопровождения МИС.

{end:} {if: edtBool2.isChecked()} {try:} {:log = readUrl("http://"+dbServerName+"/showlog")} {except: Exception as e} {end:} {if: not e and len(log.strip()) != 0}

Лог выгрузки

{:log = readUrl("http://"+dbServerName+"/showlog")} {log} {elif: e}

Лог выгрузки

{e} {elif: exportE and len(exportCase.strip()) == 0 and len(log.strip()) == 0}

Лог выгрузки

Отображаются сведения о предшествующей выгрузке. Новая выгрузка не выполнялась. {end:} {end:}