Перед началом работы в системе электронного обучения с применением дистанционных технологий
на факультете дополнительного профессионального образования Российского национального исследовательского медицинского
университета имени Н. И. Пирогова (ФДПО), пожалуйста, ознакомьтесь с соответствующей инструкцией.
''', settings)
properties = ''''''
if mzlink[1] is not None:
properties += mzlink[1]
if lprops is not None:
properties += lprops
properties = properties.replace('', '')
res = JythonDTO(bttable, properties)
return res
def checkPinMZ(sid):
u'''Проверяем, имеет ли данный sid pin для доступа к Минздраву.'''
jdbc_url_psql_rgmu = "jdbc:sqlserver://172.16.1.155\\FUV"
jdbc_url_psql_local = "jdbc:sqlserver://172.16.1.155\\FUV"
propspsql = Properties()
propspsql.put('user', "sa")
propspsql.put('password', "F708420Dx")
import com.microsoft.sqlserver.jdbc.SQLServerDriver as DriverMSSQL
try:
db1 = DriverMSSQL().connect(jdbc_url_psql_local, propspsql)
except:
db1 = DriverMSSQL().connect(jdbc_url_psql_rgmu, propspsql)
c1 = db1.createStatement()
usersselect = c1.executeQuery("select u.uid, u.login, u.pinmz, r.name, r.surname, r.patronymic from dbVector.authserver.users_auth_server u inner join dbVector.journals.reg_data r on u.sid=r.sid where u.sid='" + sid + "'")
haspinmz = False
while usersselect.next():
useruid = usersselect.getString('uid')
#login = usersselect.getString('login')
pinmz = usersselect.getString('pinmz')
surname = usersselect.getString('surname') if usersselect.getString('surname') is not None else ''
name = usersselect.getString('name') if usersselect.getString('name') is not None else ''
patronymic = usersselect.getString('patronymic') if usersselect.getString('patronymic') is not None else ''
#raise Exception(name, surname, patronymic)
if pinmz is not None:
haspinmz = True
link = u"'http://www.sovetnmo.ru/cgi-bin/unishell/?usr_data=navigate(index)&seamless-access=%s&user_id=%s&salutation=%s&familyname=%s&nameandfname=%s&pin=%s'" % ('2-med.ru', useruid, u'Уважаемый коллега.', surname,
u'%s %s' % (name, patronymic), pinmz)
btn = u'''
''' % elementId
properties = u'''current'''
return [btn, properties]
c1.close()
db1.close()
def userOnMZCycles(sid):
u'''Проверяем, являеться ли пользователь слушателем на циклах МЗ.'''
jdbc_url_psql_rgmu = "jdbc:sqlserver://172.16.1.155\\FUV"
jdbc_url_psql_local = "jdbc:sqlserver://172.16.1.155\\FUV"
propspsql = Properties()
propspsql.put('user', "sa")
propspsql.put('password', "F708420Dx")
import com.microsoft.sqlserver.jdbc.SQLServerDriver as DriverMSSQL
try:
db1 = DriverMSSQL().connect(jdbc_url_psql_local, propspsql)
except:
db1 = DriverMSSQL().connect(jdbc_url_psql_rgmu, propspsql)
c1 = db1.createStatement()
countuser = c1.executeQuery("select count(*) from dbVector.journals.requests where sid='" + sid + "' and cycle_event_id in ('f4ad0490-7ce9-11e3-b756-f3e7cbea0fad','214750dc-7cea-11e3-945c-8f09fc08d85c') and status_id='bcb486fa-7c79-11e3-916e-93eeee940426'")
countuser.next()
numrows_1 = countuser.getInt(1)
c1.close()
c2=db1.createStatement()
countuser=c2.executeQuery("""select count(*) from dbVector.fuved.person_cycleAsEvent_eok pce inner join dbVector.dbo.usersAuthServerFUV uaf on uaf.personUid=pce.personid where uaf.uid='""" + sid + """' and cycleid in ('f4ad0490-7ce9-11e3-b756-f3e7cbea0fad','214750dc-7cea-11e3-945c-8f09fc08d85c')""")
countuser.next()
numrows_2=countuser.getInt(1)
c2.close()
db1.close()
if numrows_1 > 0 or numrows_2 > 0:
return True
else:
return False
def userOnAnyCycle(sid):
u'''Проверяем, является ли пользователь зачисленным на какой-либо цикл.'''
jdbc_url_psql_rgmu = "jdbc:sqlserver://172.16.1.155\\FUV"
jdbc_url_psql_local = "jdbc:sqlserver://172.16.1.155\\FUV"
propspsql = Properties()
propspsql.put('user', "sa")
propspsql.put('password', "F708420Dx")
import com.microsoft.sqlserver.jdbc.SQLServerDriver as DriverMSSQL
try:
db1 = DriverMSSQL().connect(jdbc_url_psql_local, propspsql)
except:
db1 = DriverMSSQL().connect(jdbc_url_psql_rgmu, propspsql)
c1 = db1.createStatement()
countuser = c1.executeQuery("select count(*) from dbVector.journals.requests where sid='" + sid + "' and status_id='bcb486fa-7c79-11e3-916e-93eeee940426'")
countuser.next()
numrows_1 = countuser.getInt(1)
c1.close()
c2 = db1.createStatement()
countuser = c2.executeQuery("select count(*) from dbVector.fuved.person_cycleAsEvent_eok pce inner join dbVector.dbo.usersAuthServerFUV uaf on uaf.personUid=pce.personid where uaf.uid='" + sid + "' and pce.roleid = 'listener' ")
countuser.next()
numrows_2 = countuser.getInt(1)
c2.close()
db1.close()
if numrows_1 > 0 or numrows_2 > 0:
return True
else:
return False
def userOnFreeCycle(sid):
u'''Проверяем, заполнил ли пользователь мин. рег. данные для доступа к свободному циклу.'''
jdbc_url_psql_rgmu = "jdbc:sqlserver://172.16.1.155\\FUV"
jdbc_url_psql_local = "jdbc:sqlserver://172.16.1.155\\FUV"
propspsql = Properties()
propspsql.put('user', "sa")
propspsql.put('password', "F708420Dx")
import com.microsoft.sqlserver.jdbc.SQLServerDriver as DriverMSSQL
try:
db1 = DriverMSSQL().connect(jdbc_url_psql_local, propspsql)
except:
db1 = DriverMSSQL().connect(jdbc_url_psql_rgmu, propspsql)
c1 = db1.createStatement()
#countuser = c1.executeQuery("select count(*) from journals.reg_data rd inner join journals.education ed ON rd.uid=ed.reg_data_id inner join journals.job j ON j.reg_data_id=rd.uid where rd.sid='" + sid + "' and rd.surname IS NOT NULL and rd.name IS NOT NULL and rd.patronymic IS NOT NULL and rd.birth_year IS NOT NULL and rd.sex IS NOT NULL and j.speciality_id IS NOT NULL and ed.series IS NOT NULL and ed.number IS NOT NULL and ed.name IS NOT NULL")
regdata = c1.executeQuery("select uid from dbVector.journals.reg_data rd where rd.sid='" + sid + "' and rd.surname IS NOT NULL and rd.name IS NOT NULL and rd.patronymic IS NOT NULL and rd.birth_year IS NOT NULL and rd.sex IS NOT NULL")
if regdata.next():
regdata_id = regdata.getObject('uid')
c2 = db1.createStatement()
eddata = c2.executeQuery("select count(*) from dbVector.journals.education ed where ed.reg_data_id='" + regdata_id + "' and ed.certificate_type_id='91d87cda-9141-11e2-aff1-078732cdf002' and ed.name IS NOT NULL and ed.number IS NOT NULL and ed.series IS NOT NULL")
eddata.next()
numrows = eddata.getInt(1)
c2.close()
if numrows > 0:
eddata_ok = True
else:
return False
c3 = db1.createStatement()
jobdata = c3.executeQuery("select count(*) from dbVector.journals.job j where j.reg_data_id='" + regdata_id + "' and j.speciality_id IS NOT NULL")
jobdata.next()
numrows = jobdata.getInt(1)
if numrows > 0:
jobdata_ok = True
else:
return False
if eddata_ok and jobdata_ok:
return True
else:
return False
c1.close()
db1.close()
def learningButton(sid):
u'''Кнопка Обучение имеет три режима: Обучение на цикла, Свободные материалы, Пройти упрощенную регистрацию
для доступа к свободным материалам.'''
if userOnAnyCycle(sid):
# Пользователь зачислен на какой-либо цикл
lcab = u'''
'''
return [lcab, '']
elif userOnFreeCycle(sid) and not userOnAnyCycle(sid):
# Пользователь на свободном цикле, а на обычный цикл не зачислен
lcab = u'''
'''
return [lcab, '']
else:
lcab = ''
properties = u''''''
# Пользователь еще не имеет доступа ни к свободному циклу, ни к обычным
# lcab = u'''