import binascii
import http
import json
import threading
if 82 - 82: Iii1i
from flask import Blueprint , render_template , request , g , redirect , url_for , flash
from sqlalchemy import text , or_ , and_ , distinct , func
from exts import db
from decorators import login_required
from forms . wgcommform import AddControllerForm , AddUserForm
from models . iccard import *
from vwAppConfig import WGTools , wgMjControllerConfigure
from vwAppConfigParam import vwAppConfigParam
import vwAppConfig
if 87 - 87: Ii % i1i1i1111I . Oo / OooOoo * I1Ii1I1 - I1I
__all__ = [
 "bp" ,
 "WGControllerPri2023" ,
 "uploadDeletePrivilegeByThread" ,
 "web_console_uploadpri_list" ,
 "web_console_uploadpri_selected" ,
 "web_pri_list" ,

"web_pri_edit" ,
 "web_pri_listpage" ,
 "web_pri_allowselected" ,
 "web_pri_allowselected_all" ,
"web_pri_clearall" ,
 "web_pri_disallowselected" ,
 "web_pri_disallowselected_all" ,
"WGControllerPri2023" ,
 "uploadSingleConfigure" ,
 "web_pri_editUserPrivilege" ,
 "web_pri_edit_usercopy" ,
"web_pri_allowselected_usercopy" ,
 "web_pri_allowselected_doorcopy" ,
 "web_pri_edit_doorcopy" ,
 "web_pri_edit_page" ,
"web_pri_edit_usercopy_src_page" ,
"web_pri_edit_usercopy_page" ,
]
bp = Blueprint ( 'wgcomm_pri' , __name__ , url_prefix = '/' )
if 81 - 81: i1 + ooOOO / oOo0O00 * i1iiIII111 * IiIIii11Ii
if 84 - 84: ooo000 - Ooo0Ooo + iI1iII1I1I1i . IIiIIiIi11I1
class WGControllerPri2023 :
 def __init__ ( self ) :
  if 98 - 98: I11iiIi11i1I % oOO
  if 31 - 31: i1I
  if 9 - 9: IiI11Ii111 / oOo0O00 / IiIIii11Ii - I11iiIi11i1I - iI1iII1I1I1i
  self . uploadedSNOK = [ ]
  self . uploadedSNFailed = [ ]
  self . uploadedSN = [ ]
  self . uploadedSNConnectedOK = [ ]
  if 16 - 16: i1i1i1111I / i1iiIII111
  self . uploadedIdConnectedOK = [ ]
  self . uploadedSNOK_Delete = [ ]
  if 3 - 3: i1 % i1 % i1i1i1111I . Ii * i1
  self . uploadedSNFailed_Delete = [ ]
  self . uploadedSN_Delete = [ ]
  self . recvsnpri = [ ]
  self . uploadedSNReply = [ ]
  if 9 - 9: i1iiIII111
  self . selectedUser4Face = None
  self . faceOpertateMode = 0
  if 10 - 10: ooOOO / IIiIIiIi11I1 * oOO / i1I / i1I
  if 61 - 61: Ooo0Ooo - I1I
@ bp . route ( '/pri_list' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_list ( ) :
 if 13 - 13: Ooo0Ooo
 if 46 - 46: iI1iII1I1I1i - Ii * Oo * Ii
 if 52 - 52: Oo + I1I / oOO / OooOoo - I1Ii1I1 - ooOOO
 if 60 - 60: iI1iII1I1I1i . oOO
 if 13 - 13: oOO
 if 2 - 2: i1
 if 22 - 22: IIiIIiIi11I1 - ooo000 / I1Ii1I1 . ooo000
 if 1 - 1: iI1iII1I1I1i + Ooo0Ooo + oOO * IIiIIiIi11I1
 if 20 - 20: I1I + Ii
 if 75 - 75: Ii % i1iiIII111 * Ii . IIiIIiIi11I1 % I11iiIi11i1I % I1Ii1I1
 if 8 - 8: I1Ii1I1 . IiI11Ii111 . i1 . Oo - i1I
 if 32 - 32: Ii % i1i1i1111I % i1I - I11iiIi11i1I % i1iiIII111
 if 34 - 34: i1iiIII111 * i1
 if 34 - 34: oOo0O00 / i1iiIII111 - Iii1i . iI1iII1I1I1i
 if 80 - 80: i1i1i1111I . I1I % ooOOO % IiIIii11Ii / i1i1i1111I
 if 32 - 32: I1Ii1I1 + oOO - oOo0O00
 if 79 - 79: Iii1i % oOO * Oo + ooOOO / Oo . oOO
 if 20 - 20: IiI11Ii111 + i1iiIII111 / I1I
 Ooo0OO = {
 "objlist" : [ ] ,
 }
 return render_template ( "wgcomm/pri-list.html" , ** Ooo0OO )
 if 6 - 6: i1iiIII111
 if 99 - 99: ooOOO * I1Ii1I1
@ bp . route ( '/pri_listpage' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_listpage ( ) :
 if request . method == 'GET' :
  Oooo0o0oO0 = int ( request . args . get ( 'draw' ) )
  IiII = int ( request . args . get ( 'length' ) )
  I1i1i = int ( request . args . get ( 'start' ) )
  O0ooooOoo0O = request . args . get ( 'search[value]' )
 else :
  Oooo0o0oO0 = int ( request . form . get ( 'draw' ) )
  IiII = int ( request . form . get ( 'length' ) )
  I1i1i = int ( request . form . get ( 'start' ) )
  O0ooooOoo0O = request . form . get ( 'search[value]' )
 oo0oOo = [ ]
 vwAppConfig . wglog ( 'pagesize={},start={},search={}' . format ( IiII , I1i1i , O0ooooOoo0O ) )
 vwAppConfig . WriteLine ( 'pagesize={},start={},search={}' . format ( IiII , I1i1i , O0ooooOoo0O ) )
 if 61 - 61: iI1iII1I1I1i / IiIIii11Ii
 if 40 - 40: Iii1i / I1I
 if 52 - 52: i1i1i1111I + IiIIii11Ii + I11iiIi11i1I
 if 52 - 52: i1iiIII111 % Oo . I1Ii1I1 + ooOOO % Oo . IiI11Ii111
 if 56 - 56: i1iiIII111 * IiI11Ii111 - I11iiIi11i1I
 if 15 - 15: I1I % Ii + Ooo0Ooo * Iii1i
 if 67 - 67: I1I * Ooo0Ooo + i1iiIII111 . i1iiIII111 % Oo
 if not vwAppConfigParam . extfunc5678_timeprofile > 0 :
  OOOO0O0ooO0O = db . session . query ( TDPrivilege . f_PrivilegeRecID ,
 TBDoor . f_DoorName , TBConsumer . f_ConsumerNO , TBConsumer . f_ConsumerName ,
 TBConsumer . f_CardNO , TBGroup . f_GroupName ) . join ( TBDoor ,
 TDPrivilege . f_DoorID == TBDoor . f_DoorID ) . join (
 TBConsumer , TDPrivilege . f_ConsumerID == TBConsumer . f_ConsumerID ) . join ( TBGroup ,
 TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True )
 else :
  OOOO0O0ooO0O = db . session . query ( TDPrivilege . f_PrivilegeRecID ,
 TBDoor . f_DoorName , TBConsumer . f_ConsumerNO , TBConsumer . f_ConsumerName ,
 TBConsumer . f_CardNO , TBGroup . f_GroupName , TDPrivilege . f_ControlSegID ,
 TBControlseg . f_ControlSegName ) . join ( TBDoor ,
 TDPrivilege . f_DoorID == TBDoor . f_DoorID ) . join (
 TBConsumer , TDPrivilege . f_ConsumerID == TBConsumer . f_ConsumerID ) . join ( TBGroup ,
 TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True ) . join ( TBControlseg ,
 TDPrivilege . f_ControlSegID == TBControlseg . f_ControlSegID ,
 isouter = True )
 if not vwAppConfigParam . bPrivilegeNumOver10w :
  I1iIIiI1 = OOOO0O0ooO0O . count ( )
  vwAppConfigParam . bPrivilegeNumOver10w = I1iIIiI1 > 10 ** 5
  if 78 - 78: iI1iII1I1I1i + iI1iII1I1I1i - I1I * IIiIIiIi11I1 % I1Ii1I1 * i1i1i1111I
 if O0ooooOoo0O :
  O0ooooOoo0O = O0ooooOoo0O . strip ( )
  Oo0 = O0ooooOoo0O . split ( ' ' )
  if len ( Oo0 ) >= 1 :
   ooooo = and_ ( 1 > 0 )
   for oO00o00OO in Oo0 :
    o00o = or_ ( TBConsumer . f_ConsumerNO . like ( "%%%s%%" % oO00o00OO ) ,
 TBConsumer . f_ConsumerName . like ( "%%%s%%" % oO00o00OO ) ,
 TBGroup . f_GroupName . like ( "%%%s%%" % oO00o00OO ) ,
 TBDoor . f_DoorName . like ( "%%%s%%" % oO00o00OO ) )
    if vwAppConfig . parseInt ( oO00o00OO ) > 0 :
     Ii11I = vwAppConfig . parseInt ( oO00o00OO )
     o00o = or_ ( TBConsumer . f_CardNO == Ii11I , o00o )
    ooooo = and_ ( ooooo , o00o )
   o00o = ooooo
   OOOO0O0ooO0O = OOOO0O0ooO0O . filter ( o00o )
   if 7 - 7: Oo / OooOoo - I11iiIi11i1I - IiI11Ii111 % i1iiIII111
   if 97 - 97: I11iiIi11i1I % oOO - I1Ii1I1 - IIiIIiIi11I1
   if 58 - 58: ooOOO / IIiIIiIi11I1 % i1
   if 36 - 36: oOo0O00 . ooOOO / i1iiIII111 + oOO
   if 11 - 11: i1 / ooo000
 iII = OOOO0O0ooO0O . count ( )
 vwAppConfig . WriteLine ( "message_num={0}" . format ( iII ) )
 if 43 - 43: Ooo0Ooo - I1I . ooo000 - Iii1i % i1I
 if 49 - 49: IiIIii11Ii . ooo000 + oOO - oOO
 if 78 - 78: i1 - ooOOO
 if vwAppConfigParam . bPrivilegeNumOver10w :
  OO = OOOO0O0ooO0O . offset ( I1i1i ) . limit ( IiII ) . all ( )
 else :
  OO = OOOO0O0ooO0O . order_by ( TBConsumer . f_ConsumerNO ) . offset ( I1i1i ) . limit ( IiII ) . all ( )
  if 44 - 44: ooo000 * I1Ii1I1 * OooOoo - oOO % ooo000 . i1I
 vwAppConfig . WriteLine ( "objlist={0}" . format ( len ( OO ) ) )
 if 73 - 73: i1i1i1111I . Ooo0Ooo * iI1iII1I1I1i / Ii / ooo000 + i1iiIII111
 if 28 - 28: i1iiIII111 + ooOOO - ooOOO - i1i1i1111I
 if 61 - 61: oOO
 if 7 - 7: i1i1i1111I / Ii * Iii1i
 for i1iI1i in OO :
  IIIi1111iiIi1 = vwAppConfig . getStrNoneToSpace ( i1iI1i . f_ConsumerNO )
  I1II1ii111i = vwAppConfig . getStrNoneToSpace ( i1iI1i . f_ConsumerName )
  I1i1iI1I1Ii1 = vwAppConfig . getStrNoneToSpace ( i1iI1i . f_GroupName )
  if not vwAppConfigParam . extfunc5678_timeprofile > 0 :
   oOoOO0O0 = [ i1iI1i . f_DoorName , IIIi1111iiIi1 , I1II1ii111i , i1iI1i . f_CardNO , I1i1iI1I1Ii1 ]
  else :
   if i1iI1i . f_ControlSegID == 1 :
    I111 = "Time Profile#{}-{}" . format ( '1' , 'Free Time' )
   else :
    I111 = "Time Profile#{}-{}" . format ( vwAppConfig . getStrNoneToSpace ( i1iI1i . f_ControlSegID ) ,
 vwAppConfig . getStrNoneToSpace ( i1iI1i . f_ControlSegName ) )
   oOoOO0O0 = [ i1iI1i . f_DoorName , IIIi1111iiIi1 , I1II1ii111i , i1iI1i . f_CardNO , I1i1iI1I1Ii1 , I111 ]
  oo0oOo . append ( oOoOO0O0 )
 vwAppConfig . WriteLine ( "message={0}" . format ( len ( oo0oOo ) ) )
 OO00OOooO = {
 "draw" : Oooo0o0oO0 ,
 "recordsTotal" : iII ,
 "recordsFiltered" : iII ,
 "data" : oo0oOo
 }
 if 58 - 58: i1I - IiI11Ii111
 return json . dumps ( OO00OOooO )
 if 86 - 86: Iii1i + i1iiIII111 - IIiIIiIi11I1 / I1I
 if 46 - 46: ooOOO + ooOOO % oOO
 if 2 - 2: i1i1i1111I / Ooo0Ooo / oOO - IIiIIiIi11I1 / IIiIIiIi11I1
 if 58 - 58: i1i1i1111I
 if 38 - 38: i1 - oOo0O00
 if 85 - 85: IIiIIiIi11I1 + I11iiIi11i1I % Ooo0Ooo + oOO * i1iiIII111
 if 46 - 46: ooOOO - ooOOO + Oo / I1I * Oo + oOO
 if 98 - 98: I1I / IIiIIiIi11I1 / i1I + IiI11Ii111 % Oo + I1I
 if 38 - 38: I1Ii1I1 + oOo0O00
 if 2 - 2: OooOoo % Ii + oOO . OooOoo + IIiIIiIi11I1 * Oo
 if 2 - 2: IIiIIiIi11I1 + iI1iII1I1I1i - I1Ii1I1 + ooOOO . IIiIIiIi11I1
 if 15 - 15: ooo000
 if 63 - 63: i1I
 if 81 - 81: OooOoo . i1I / i1i1i1111I + Oo / Ooo0Ooo % IiI11Ii111
 if 77 - 77: I11iiIi11i1I / iI1iII1I1I1i - oOo0O00 - Ooo0Ooo % oOo0O00
 if 73 - 73: IiI11Ii111 . Oo * I1I / i1i1i1111I + I1Ii1I1
 if 31 - 31: i1i1i1111I % I1Ii1I1
 if 1 - 1: IiI11Ii111 - oOo0O00 - i1 . oOo0O00
 if 91 - 91: iI1iII1I1I1i * i1 . ooOOO
@ bp . route ( '/pri_disallowselected' , methods = [ 'POST' ] )
@ login_required
def web_pri_disallowselected ( ) :
 I1i = request . form . get ( "selecteddoor" )
 Iiii = request . form . get ( "selecteduser" )
 if 40 - 40: i1I * iI1iII1I1I1i + iI1iII1I1I1i . oOo0O00 * ooo000
 if 35 - 35: IIiIIiIi11I1 % i1i1i1111I - Ii % i1iiIII111 - IiI11Ii111
 if len ( I1i ) == 0 or len ( Iiii ) == 0 :
  return "OK"
  if 33 - 33: i1i1i1111I
 I1i = I1i . split ( "," )
 I1i = [ int ( x ) for x in I1i ]
 I1i . sort ( )
 Iiii = Iiii . split ( "," )
 Iiii = [ int ( x ) for x in Iiii ]
 Iiii . sort ( )
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Prohibited from passing Doors={}-Users={}" . format ( len ( I1i ) ,
 len ( Iiii ) ) ) )
 if 30 - 30: i1I % ooOOO . Ii % IIiIIiIi11I1 / iI1iII1I1I1i % ooOOO
 IIiIIIII1iiI ( doorDst = I1i , userDst = Iiii , opMode = 'disallowselected_Click' , opMessage = 'Forbidden' )
 O0O0oO = IIiI1i ( doorDst = I1i , userDst = Iiii , opMode = 'disallowselected_Click' )
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """Permissions modification completed,
but this upload update was unsuccessful [due to communication failure with some controllers].
Please re-upload from the main console later."""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
 return "OK"
 if 4 - 4: i1 % I1Ii1I1 * oOO + oOO . i1i1i1111I - i1
 if 15 - 15: OooOoo . oOo0O00 - ooOOO % Ooo0Ooo
 if 62 - 62: iI1iII1I1I1i / OooOoo % I1I - IiI11Ii111
 if 66 - 66: i1i1i1111I / Ooo0Ooo + I11iiIi11i1I + Iii1i + oOo0O00 + i1I
 if 75 - 75: OooOoo - oOO - IiIIii11Ii - oOO + ooo000 % iI1iII1I1I1i
 if 42 - 42: i1 * i1I
 if 50 - 50: Ii - i1iiIII111
 if 96 - 96: ooo000 * OooOoo - Ii - OooOoo
 if 65 - 65: Oo + Oo - iI1iII1I1I1i % OooOoo . Ooo0Ooo
 if 84 - 84: IIiIIiIi11I1 . ooOOO
 if 44 - 44: ooo000 * i1i1i1111I * oOO + i1iiIII111 - IIiIIiIi11I1
 if 70 - 70: IiI11Ii111
 if 9 - 9: oOo0O00 * i1
 if 96 - 96: Ooo0Ooo
 if 13 - 13: Oo * I1Ii1I1 - oOo0O00 * Ii . Ii + oOo0O00
 if 46 - 46: OooOoo - I11iiIi11i1I / Ooo0Ooo
 if 73 - 73: I1Ii1I1 / i1i1i1111I / ooo000 % i1 % i1I - OooOoo
 if 30 - 30: ooOOO * ooOOO - Iii1i * iI1iII1I1I1i
 if 37 - 37: I1Ii1I1 % iI1iII1I1I1i . i1I + Ooo0Ooo + ooOOO * iI1iII1I1I1i
 if 39 - 39: IIiIIiIi11I1 - Oo
 if 31 - 31: IiIIii11Ii % oOo0O00 % oOo0O00 * Iii1i
 if 85 - 85: Iii1i + Ii % IIiIIiIi11I1 % oOo0O00
 if 100 - 100: IiIIii11Ii % i1
 if 82 - 82: ooOOO % OooOoo
 if 81 - 81: Ii
 if 40 - 40: i1I . OooOoo + oOo0O00 . i1iiIII111
 if 96 - 96: I1I / oOO / I11iiIi11i1I + I11iiIi11i1I
 if 35 - 35: IIiIIiIi11I1 + oOo0O00
 if 96 - 96: iI1iII1I1I1i . OooOoo . i1
 if 87 - 87: ooo000 * IiIIii11Ii % ooo000 . ooOOO . Oo % iI1iII1I1I1i
 if 48 - 48: ooOOO * ooo000 % IiIIii11Ii * i1 . Iii1i - IiI11Ii111
 if 72 - 72: i1 % i1i1i1111I * iI1iII1I1I1i
 if 90 - 90: Ooo0Ooo * OooOoo . Ii
 if 5 - 5: Oo - i1 . oOO
 if 18 - 18: IiIIii11Ii - oOO * i1I - OooOoo
 if 54 - 54: IIiIIiIi11I1 . Ooo0Ooo % Ii + IiIIii11Ii * iI1iII1I1I1i / iI1iII1I1I1i
 if 31 - 31: IiIIii11Ii . IiIIii11Ii % Ii
 if 51 - 51: Oo / i1i1i1111I - I1I
 if 83 - 83: Iii1i % i1iiIII111 . OooOoo / I1I % oOO . I1I
 if 76 - 76: i1iiIII111 / OooOoo
 if 77 - 77: ooOOO
 if 19 - 19: ooOOO % I1Ii1I1
 if 15 - 15: OooOoo . IiIIii11Ii . i1I / Iii1i + ooOOO / Ii
 if 17 - 17: I11iiIi11i1I - i1i1i1111I . iI1iII1I1I1i - I11iiIi11i1I + Oo % iI1iII1I1I1i
 if 65 - 65: Ii % I11iiIi11i1I
 if 39 - 39: Iii1i * IIiIIiIi11I1 . Ooo0Ooo - Oo
 if 63 - 63: i1i1i1111I - i1iiIII111 . OooOoo % OooOoo . IiI11Ii111 + i1I
 if 71 - 71: ooo000 + I11iiIi11i1I % iI1iII1I1I1i + IiI11Ii111 % Oo - Oo
 if 84 - 84: I1I % iI1iII1I1I1i - Ooo0Ooo / iI1iII1I1I1i + Ooo0Ooo - Oo
 if 41 - 41: ooOOO + OooOoo + IIiIIiIi11I1 * i1i1i1111I
 if 12 - 12: i1i1i1111I
 if 56 - 56: IiIIii11Ii
 if 17 - 17: i1I . oOO % Oo + IiIIii11Ii - Ooo0Ooo
 if 93 - 93: oOo0O00
 if 77 - 77: Oo + I11iiIi11i1I % I1I
 if 20 - 20: i1 - IiIIii11Ii . IiIIii11Ii % ooOOO . i1 % Ooo0Ooo
 if 72 - 72: oOO % IiI11Ii111 . ooOOO * I1Ii1I1 . ooOOO
 if 90 - 90: IiIIii11Ii + I1Ii1I1 . OooOoo
 if 73 - 73: i1i1i1111I - Iii1i / I11iiIi11i1I . ooo000 / iI1iII1I1I1i - i1iiIII111
 if 21 - 21: i1iiIII111 + IiI11Ii111 % i1i1i1111I
 if 7 - 7: IiI11Ii111 / Ii
 if 87 - 87: ooOOO
 if 57 - 57: IIiIIiIi11I1 - iI1iII1I1I1i % ooOOO - I11iiIi11i1I / IiIIii11Ii . Ooo0Ooo
 if 15 - 15: i1I * I11iiIi11i1I - oOo0O00
 if 6 - 6: IiI11Ii111 - Ii
 if 1 - 1: I1I + OooOoo
 if 98 - 98: i1iiIII111 + Iii1i . IIiIIiIi11I1
 if 96 - 96: OooOoo / oOO - i1 * I11iiIi11i1I
 if 72 - 72: i1i1i1111I + Ii - Iii1i - i1i1i1111I - i1I + Ooo0Ooo
@ bp . route ( '/pri_disallowselected_all' , methods = [ 'POST' ] )
@ login_required
def web_pri_disallowselected_all ( ) :
 I1i = request . form . get ( "selecteddoor" )
 O0ooooOoo0O = Iiii = request . form . get ( "selecteduser" )
 if len ( I1i ) == 0 :
  return "OK"
  if 74 - 74: Ooo0Ooo * Oo + Iii1i - i1iiIII111
  if 22 - 22: IiIIii11Ii - Ooo0Ooo . i1 . i1I - ooo000
  if 68 - 68: ooo000
  if 40 - 40: i1 + I1Ii1I1 + I11iiIi11i1I . Oo * I11iiIi11i1I % I1I
  if 100 - 100: OooOoo + Oo / OooOoo
  if 33 - 33: IiI11Ii111 / OooOoo
  if 98 - 98: I1Ii1I1 . IIiIIiIi11I1 * i1I - iI1iII1I1I1i % i1I * IiI11Ii111
  if 42 - 42: OooOoo + i1i1i1111I - iI1iII1I1I1i - oOo0O00 * i1I + Ii
 OOOO0O0ooO0O = db . session . query ( TBConsumer . f_ConsumerID ) . join ( TBGroup , TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True )
 if 46 - 46: oOo0O00 . iI1iII1I1I1i - Ii . oOo0O00 + i1i1i1111I
 if 83 - 83: IiI11Ii111
 if 77 - 77: iI1iII1I1I1i - oOO % Ii * i1I - I1I
 if 42 - 42: I11iiIi11i1I - Ii / Oo - i1i1i1111I + I11iiIi11i1I
 i1II1 = True
 if O0ooooOoo0O :
  O0ooooOoo0O = O0ooooOoo0O . strip ( )
  Oo0 = O0ooooOoo0O . split ( ' ' )
  if len ( Oo0 ) >= 1 :
   ooooo = and_ ( 1 > 0 )
   for oO00o00OO in Oo0 :
    o00o = or_ ( TBConsumer . f_ConsumerNO . like ( "%%%s%%" % oO00o00OO ) ,
 TBConsumer . f_ConsumerName . like ( "%%%s%%" % oO00o00OO ) ,
 TBGroup . f_GroupName . like ( "%%%s%%" % oO00o00OO ) )
    if vwAppConfig . parseInt ( oO00o00OO ) > 0 :
     Ii11I = vwAppConfig . parseInt ( oO00o00OO )
     o00o = or_ ( TBConsumer . f_CardNO == Ii11I , o00o )
    ooooo = and_ ( ooooo , o00o )
    i1II1 = False
   o00o = ooooo
   OOOO0O0ooO0O = OOOO0O0ooO0O . filter ( o00o )
 if i1II1 :
  I1i = I1i . split ( "," )
  I1i = [ int ( x ) for x in I1i ]
  I1i . sort ( )
  IIIII11 = TBConsumer . query . count ( )
  if 7 - 7: i1iiIII111 * i1iiIII111 . oOO . ooo000 * ooOOO + IiI11Ii111
  vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Prohibited from passing Doors={}-Users={}" . format ( len ( I1i ) ,
 IIIII11 ) ) )
  if 20 - 20: i1I . OooOoo * IiIIii11Ii
  if 40 - 40: ooo000 * IiI11Ii111 / i1i1i1111I * oOO + i1iiIII111 - OooOoo
  IIiIIIII1iiI ( doorDst = I1i , userDst = Iiii , opMode = 'disallowselected_Click' , opMessage = 'Forbidden' )
  O0O0oO = IIiI1i ( doorDst = I1i , userDst = Iiii , bUploadAllUser = True ,
 opMode = 'disallowselected_Click' )
 else :
  OO = OOOO0O0ooO0O . all ( )
  I1i = I1i . split ( "," )
  I1i = [ int ( x ) for x in I1i ]
  I1i . sort ( )
  if 86 - 86: I11iiIi11i1I * Ooo0Ooo . IiIIii11Ii % IiIIii11Ii . I1Ii1I1 + I1I
  Iiii = [ x [ 0 ] for x in OO ]
  Iiii . sort ( )
  vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Prohibited from passing Doors={}-Users={}" . format ( len ( I1i ) ,
 len ( Iiii ) ) ) )
  if 44 - 44: i1 / OooOoo / oOo0O00 . Oo
  IIiIIIII1iiI ( doorDst = I1i , userDst = Iiii , opMode = 'disallowselected_Click' , opMessage = 'Forbidden' )
  O0O0oO = IIiI1i ( doorDst = I1i , userDst = Iiii , opMode = 'disallowselected_Click' )
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """Permissions modification completed,
but this upload update was unsuccessful [due to communication failure with some controllers].
Please re-upload from the main console later."""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "OK" , "Prohibited from passing" ) )
 return "OK"
 if 65 - 65: I11iiIi11i1I * i1iiIII111 . OooOoo % ooo000 % OooOoo
 if 21 - 21: IiI11Ii111 * I1Ii1I1
@ bp . route ( '/pri_allowselected' , methods = [ 'POST' ] )
@ login_required
def web_pri_allowselected ( ) :
 if 93 - 93: Ooo0Ooo . i1 + IiI11Ii111 - oOo0O00
 if 97 - 97: i1 - i1 % IIiIIiIi11I1 + IiIIii11Ii / i1I * iI1iII1I1I1i
 if 60 - 60: I11iiIi11i1I - Ooo0Ooo % I1Ii1I1
 I1i = request . form . get ( "selecteddoor" )
 if 26 - 26: ooOOO / IIiIIiIi11I1 . oOO + I11iiIi11i1I . Oo
 Iiii = request . form . get ( "selecteduser" )
 if 37 - 37: I1Ii1I1
 OoOooOOoOo = request . form . get ( "timeprofileid" )
 if 51 - 51: i1 + i1i1i1111I - i1 + i1iiIII111 . Oo
 if 92 - 92: OooOoo + Ii / IIiIIiIi11I1 + OooOoo * IIiIIiIi11I1 * iI1iII1I1I1i
 if len ( I1i ) == 0 or len ( Iiii ) == 0 :
  return "OK"
  if 79 - 79: i1i1i1111I
 I1i = I1i . split ( "," )
 I1i = [ int ( x ) for x in I1i ]
 I1i . sort ( )
 Iiii = Iiii . split ( "," )
 Iiii = [ int ( x ) for x in Iiii ]
 Iiii . sort ( )
 if 3 - 3: OooOoo / IiI11Ii111 % I11iiIi11i1I
 if 55 - 55: oOo0O00
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Doors={}-Users={}" . format ( len ( I1i ) ,
 len ( Iiii ) ) ) )
 if 31 - 31: Ii . Ooo0Ooo / IiI11Ii111
 if 59 - 59: Oo
 IIiIIIII1iiI ( doorDst = I1i , userDst = Iiii , opMode = 'btnAddPass_Click' , opMessage = 'Allow' ,
 controltimeseg = OoOooOOoOo )
 O0O0oO = IIiI1i ( doorDst = I1i , userDst = Iiii , opMode = 'btnAddPass_Click' )
 if 64 - 64: Iii1i % I11iiIi11i1I * i1 % OooOoo * oOo0O00
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """Permissions modification completed,
but this upload update was unsuccessful [due to communication failure with some controllers].
Please re-upload from the main console later."""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
  if 55 - 55: IiI11Ii111
 return "OK"
 if 46 - 46: Ooo0Ooo % I1Ii1I1
 if 86 - 86: I11iiIi11i1I . i1i1i1111I + oOO % I11iiIi11i1I % Iii1i % ooo000
 if 61 - 61: ooo000
 if 48 - 48: Iii1i * i1i1i1111I + IiIIii11Ii
 if 31 - 31: Oo * i1iiIII111 % Ii / oOO + I1Ii1I1 + iI1iII1I1I1i
 if 90 - 90: I1Ii1I1 * i1i1i1111I / iI1iII1I1I1i * Ii
 if 38 - 38: I1I . Ii
 if 41 - 41: ooo000 % IIiIIiIi11I1 % ooOOO
 if 5 - 5: oOo0O00 / Ii + i1iiIII111 * Oo + Ooo0Ooo + ooo000
 if 96 - 96: i1iiIII111 - IIiIIiIi11I1 / IIiIIiIi11I1 * IiIIii11Ii
 if 67 - 67: Ooo0Ooo . Ooo0Ooo . IiI11Ii111
 if 24 - 24: i1iiIII111 + i1i1i1111I . oOo0O00 + iI1iII1I1I1i + IiI11Ii111
 if 92 - 92: iI1iII1I1I1i / iI1iII1I1I1i + IiIIii11Ii . IiI11Ii111
 if 56 - 56: Ii * ooo000 . IiIIii11Ii
 if 66 - 66: I1Ii1I1 * OooOoo . iI1iII1I1I1i % OooOoo . i1 . IiIIii11Ii
 if 47 - 47: Ii % OooOoo % iI1iII1I1I1i * IiIIii11Ii
 if 48 - 48: i1I . I11iiIi11i1I / ooo000 + i1iiIII111
 if 84 - 84: Oo / I1Ii1I1 . IIiIIiIi11I1
 if 67 - 67: Oo % ooOOO + iI1iII1I1I1i * I1I
 if 79 - 79: IIiIIiIi11I1 * Oo / OooOoo
 if 10 - 10: iI1iII1I1I1i / i1iiIII111 . IiIIii11Ii * i1i1i1111I
 if 71 - 71: oOo0O00 + I1Ii1I1 / I11iiIi11i1I + Oo / I1I
 if 18 - 18: Iii1i - IiIIii11Ii
 if 71 - 71: iI1iII1I1I1i + OooOoo % i1i1i1111I % oOo0O00 . ooo000
 if 92 - 92: I11iiIi11i1I - Ooo0Ooo - i1i1i1111I % i1iiIII111 / i1i1i1111I * iI1iII1I1I1i
 if 60 - 60: IiIIii11Ii % oOO / i1I * OooOoo / I11iiIi11i1I - Ii
 if 16 - 16: oOo0O00 / I1Ii1I1 / i1 + I11iiIi11i1I + oOo0O00
 if 11 - 11: oOO / OooOoo + oOo0O00
 if 79 - 79: I11iiIi11i1I . I1Ii1I1 * i1I % I1Ii1I1 / IiI11Ii111
 if 93 - 93: i1I + Iii1i . Ii . i1I * ooOOO
 if 84 - 84: Ooo0Ooo % IiI11Ii111
 if 82 - 82: IIiIIiIi11I1
 if 81 - 81: oOo0O00 + i1 - ooo000 * iI1iII1I1I1i + i1i1i1111I
 if 89 - 89: I1Ii1I1
 if 57 - 57: iI1iII1I1I1i - i1iiIII111 / OooOoo % i1iiIII111
 if 92 - 92: IiIIii11Ii * OooOoo - IiIIii11Ii
 if 66 - 66: i1iiIII111 . iI1iII1I1I1i / ooOOO . i1 - OooOoo
 if 13 - 13: oOo0O00
 if 50 - 50: i1 - i1iiIII111 / i1iiIII111 % I1Ii1I1 / IIiIIiIi11I1
 if 66 - 66: oOo0O00 - Iii1i - ooo000 . I11iiIi11i1I
 if 59 - 59: i1I / IiIIii11Ii
 if 7 - 7: oOo0O00
 if 64 - 64: IIiIIiIi11I1 * oOO + Oo . OooOoo - ooOOO
 if 94 - 94: IiIIii11Ii - ooo000 . Ii
 if 73 - 73: IiIIii11Ii / oOo0O00 % ooo000 . iI1iII1I1I1i % oOO
 if 36 - 36: IiI11Ii111 * OooOoo . ooo000 . i1iiIII111 + oOO
 if 47 - 47: IiI11Ii111 / I11iiIi11i1I
 if 52 - 52: Ii . OooOoo . i1iiIII111 * I11iiIi11i1I - iI1iII1I1I1i
 if 20 - 20: OooOoo % IiI11Ii111 + I1Ii1I1 + IiI11Ii111 - oOo0O00
 if 76 - 76: I11iiIi11i1I % IIiIIiIi11I1 % i1I
 if 39 - 39: IiIIii11Ii . Oo + i1I - oOo0O00
 if 93 - 93: Iii1i * IIiIIiIi11I1 % i1I + i1 % Ii * i1I
 if 62 - 62: IiI11Ii111 % ooo000
 if 19 - 19: Ii / Oo % Iii1i / i1iiIII111 - OooOoo - Ooo0Ooo
 if 89 - 89: I11iiIi11i1I - IiI11Ii111
 if 61 - 61: Ii * OooOoo * I1I % i1iiIII111 % IIiIIiIi11I1 * I11iiIi11i1I
 if 49 - 49: iI1iII1I1I1i / i1iiIII111 % oOO
 if 46 - 46: ooOOO * IIiIIiIi11I1 % i1 / oOO + i1 + oOo0O00
 if 99 - 99: I1I * IIiIIiIi11I1 * i1iiIII111
 if 62 - 62: ooOOO % Oo + i1I
 if 87 - 87: ooo000 - OooOoo + Ii + i1i1i1111I + IiIIii11Ii
 if 57 - 57: IIiIIiIi11I1 + I1I / ooOOO % ooOOO % Oo / IiI11Ii111
 if 95 - 95: i1 / I11iiIi11i1I . i1 / Oo . Ooo0Ooo
 if 43 - 43: Oo - OooOoo * oOO . Ooo0Ooo / IIiIIiIi11I1 * IIiIIiIi11I1
 if 84 - 84: i1iiIII111 + oOo0O00
 if 83 - 83: i1i1i1111I
 if 84 - 84: oOO / Ii * Ooo0Ooo / Ii / ooo000
 if 64 - 64: oOo0O00 * Ii
 if 2 - 2: IiI11Ii111 % i1iiIII111 . oOo0O00
 if 59 - 59: I11iiIi11i1I % OooOoo - iI1iII1I1I1i % I1I + i1iiIII111 . I1Ii1I1
 if 94 - 94: ooOOO * I1Ii1I1 * i1iiIII111 . oOo0O00
 if 73 - 73: I1Ii1I1 / ooo000 % I11iiIi11i1I - i1i1i1111I + Oo - I1Ii1I1
@ bp . route ( '/pri_allowselected_all' , methods = [ 'POST' ] )
@ login_required
def web_pri_allowselected_all ( ) :
 if 18 - 18: i1 + ooOOO . i1 - iI1iII1I1I1i
 if 97 - 97: oOo0O00 + i1I % Iii1i
 if 34 - 34: i1 + Oo . oOo0O00 - ooo000 / I11iiIi11i1I * oOo0O00
 I1i = request . form . get ( "selecteddoor" )
 if 89 - 89: oOo0O00
 O0ooooOoo0O = Iiii = request . form . get ( "selecteduser" )
 if 48 - 48: i1 / IIiIIiIi11I1 / iI1iII1I1I1i / IiI11Ii111 * IiIIii11Ii
 OoOooOOoOo = request . form . get ( "timeprofileid" )
 if 54 - 54: IIiIIiIi11I1 % I1I % IiI11Ii111 / I11iiIi11i1I . I11iiIi11i1I - IiIIii11Ii
 if 10 - 10: Ii . I11iiIi11i1I % i1I / OooOoo % I1Ii1I1
 if 42 - 42: Oo - I1I * i1I * i1i1i1111I - I11iiIi11i1I
 if 58 - 58: iI1iII1I1I1i
 if len ( I1i ) == 0 :
  return "OK"
  if 17 - 17: iI1iII1I1I1i - Ii % iI1iII1I1I1i % oOo0O00 * Iii1i
  if 51 - 51: I1I . i1i1i1111I % Ii
  if 55 - 55: i1i1i1111I * Ii % i1i1i1111I
  if 61 - 61: oOo0O00
  if 53 - 53: Ooo0Ooo / IiIIii11Ii
  if 49 - 49: ooo000 - oOO . IiIIii11Ii / Oo
  if 23 - 23: I11iiIi11i1I - i1 / Iii1i . iI1iII1I1I1i + oOO
  if 55 - 55: i1 - iI1iII1I1I1i / OooOoo + I1I + Oo
 OOOO0O0ooO0O = db . session . query ( TBConsumer . f_ConsumerID ) . join ( TBGroup , TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True )
 if 5 - 5: IiI11Ii111 - i1 . i1i1i1111I / IiI11Ii111 . iI1iII1I1I1i . IiI11Ii111
 if 87 - 87: i1 . Ii * iI1iII1I1I1i - oOO / Ii / OooOoo
 if 65 - 65: i1I / i1I + IiI11Ii111
 if 99 - 99: i1 + OooOoo + I11iiIi11i1I * Ooo0Ooo / ooOOO + Ii
 i1II1 = True
 if O0ooooOoo0O :
  O0ooooOoo0O = O0ooooOoo0O . strip ( )
  Oo0 = O0ooooOoo0O . split ( ' ' )
  if len ( Oo0 ) >= 1 :
   ooooo = and_ ( 1 > 0 )
   for oO00o00OO in Oo0 :
    o00o = or_ ( TBConsumer . f_ConsumerNO . like ( "%%%s%%" % oO00o00OO ) ,
 TBConsumer . f_ConsumerName . like ( "%%%s%%" % oO00o00OO ) ,
 TBGroup . f_GroupName . like ( "%%%s%%" % oO00o00OO ) )
    if vwAppConfig . parseInt ( oO00o00OO ) > 0 :
     Ii11I = vwAppConfig . parseInt ( oO00o00OO )
     o00o = or_ ( TBConsumer . f_CardNO == Ii11I , o00o )
    ooooo = and_ ( ooooo , o00o )
    i1II1 = False
   o00o = ooooo
   OOOO0O0ooO0O = OOOO0O0ooO0O . filter ( o00o )
 if i1II1 :
  I1i = I1i . split ( "," )
  I1i = [ int ( x ) for x in I1i ]
  I1i . sort ( )
  IIIII11 = TBConsumer . query . count ( )
  if 72 - 72: I1Ii1I1 * Ooo0Ooo * IIiIIiIi11I1 % IiIIii11Ii . ooo000
  vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Doors={}-Users={}" . format ( len ( I1i ) ,
 IIIII11 ) ) )
  if 68 - 68: Ooo0Ooo * OooOoo - oOo0O00
  if 49 - 49: IIiIIiIi11I1 % i1
  IIiIIIII1iiI ( doorDst = I1i , userDst = Iiii , opMode = 'btnAddPass_Click' , opMessage = 'Allow' ,
 controltimeseg = OoOooOOoOo )
  O0O0oO = IIiI1i ( doorDst = I1i , userDst = Iiii , bUploadAllUser = True , opMode = 'btnAddPass_Click' )
 else :
  OO = OOOO0O0ooO0O . all ( )
  if 29 - 29: OooOoo * Ii - oOO
  I1i = I1i . split ( "," )
  I1i = [ int ( x ) for x in I1i ]
  I1i . sort ( )
  if 53 - 53: I11iiIi11i1I % ooo000 / ooOOO / I1I
  Iiii = [ x [ 0 ] for x in OO ]
  Iiii . sort ( )
  if 43 - 43: iI1iII1I1I1i . i1i1i1111I + I1I % ooOOO . IiI11Ii111 - IiI11Ii111
  if 6 - 6: I1I
  vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Doors={}-Users={}" . format ( len ( I1i ) ,
 len ( Iiii ) ) ) )
  if 98 - 98: oOO * IIiIIiIi11I1 / i1iiIII111 / Iii1i + I1I
  if 25 - 25: IIiIIiIi11I1 . IiI11Ii111 / I1I * i1 - i1iiIII111 % oOo0O00
  IIiIIIII1iiI ( doorDst = I1i , userDst = Iiii , opMode = 'btnAddPass_Click' , opMessage = 'Allow' ,
 controltimeseg = OoOooOOoOo )
  O0O0oO = IIiI1i ( doorDst = I1i , userDst = Iiii , opMode = 'btnAddPass_Click' )
  if 49 - 49: IiIIii11Ii % ooOOO + I11iiIi11i1I + IIiIIiIi11I1
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """Permissions modification completed,
but this upload update was unsuccessful [due to communication failure with some controllers].
Please re-upload from the main console later."""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
  if 60 - 60: IIiIIiIi11I1
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "OK" , "Allowed to pass" ) )
 if 98 - 98: IiIIii11Ii / Ooo0Ooo + Ii
 return "OK"
 if 73 - 73: OooOoo * Iii1i
 if 34 - 34: i1I % Ooo0Ooo * OooOoo + i1iiIII111 / i1
@ bp . route ( '/pri_clearall' , methods = [ 'POST' ] )
@ login_required
def web_pri_clearall ( ) :
 if 49 - 49: IIiIIiIi11I1 / i1iiIII111 % IIiIIiIi11I1 + IIiIIiIi11I1 * iI1iII1I1I1i
 if 22 - 22: I1Ii1I1 + oOO / I1Ii1I1 - Ii % Ii % i1i1i1111I
 db . session . execute ( text ( vwAppConfig . cleartable ( "t_d_privilege" ) ) )
 db . session . commit ( )
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Prohibit all users from passing through all doors!" . format ( ) ) )
 if 86 - 86: Iii1i
 if 53 - 53: i1 * i1i1i1111I
 O0O0oO = i1IIi ( )
 if 80 - 80: IiI11Ii111 * IIiIIiIi11I1 - Iii1i . oOO % Iii1i - Iii1i
 if 68 - 68: oOO + Iii1i + Ooo0Ooo % Oo / I11iiIi11i1I . OooOoo
 print ( O0O0oO )
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """权限已清空Finished
        但此次上传更新不 Successfully [原因有些控制器Communication failure.]
        请稍后在总控制台重新上传"""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
 return "OK"
 if 31 - 31: I11iiIi11i1I % ooOOO
 if 46 - 46: i1i1i1111I - ooo000 + iI1iII1I1I1i
@ bp . route ( '/pri_edit' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_edit ( ) :
 i1i11i = 1001
 i1i11i = 3000
 i1i11i = 0
 if 12 - 12: ooo000 - IIiIIiIi11I1 % Iii1i . I1Ii1I1
 OO = [ ]
 iII = 0
 if i1i11i > 0 :
  OOOO0O0ooO0O = db . session . query ( TBConsumer . f_ConsumerID , TBConsumer . f_ConsumerNO , TBConsumer . f_ConsumerName ,
 TBConsumer . f_CardNO , TBConsumer . f_BeginYMD ,
 TBConsumer . f_EndYMD , TBGroup . f_GroupName ) . join ( TBGroup ,
 TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True ) . order_by (
 TBConsumer . f_ConsumerNO )
  iII = TBConsumer . query . count ( )
  if 11 - 11: i1iiIII111 - Oo % Ii % i1
  if iII < i1i11i :
   OO = OOOO0O0ooO0O . all ( )
   if 28 - 28: IIiIIiIi11I1 % Ii + ooOOO . i1I % Ii * I1Ii1I1
   if 41 - 41: I1I
   if 76 - 76: ooo000 * i1i1i1111I
   if 39 - 39: i1 % i1I
   if 50 - 50: i1iiIII111 % OooOoo - i1i1i1111I * IiIIii11Ii % Oo . Ooo0Ooo
 OOOO0O0ooO0O = db . session . query ( TBDoor . f_DoorID , TBDoor . f_DoorName , TBDoor . f_DoorNO ,
 TBController . f_ControllerSN , TBDoor . f_DoorEnabled ) . filter_by ( f_DoorEnabled = True ) . join (
 TBController ,
 TBController . f_ControllerID == TBDoor . f_ControllerID ,
 isouter = False ) . filter ( ~ TBController . f_ControllerSN . between ( 170123456 , 180123456 ) ) . order_by (
 TBDoor . f_DoorName )
 i111IIi = OOOO0O0ooO0O . all ( )
 if 82 - 82: IIiIIiIi11I1 - IiIIii11Ii / oOO
 OOOO0O0ooO0O = db . session . query ( TBControlseg . f_ControlSegID , TBControlseg . f_ControlSegName ) . order_by (
 TBControlseg . f_ControlSegID )
 O000 = OOOO0O0ooO0O . all ( )
 if 49 - 49: IiI11Ii111
 if 38 - 38: i1i1i1111I * i1i1i1111I
 if 35 - 35: OooOoo - ooo000
 if 41 - 41: i1i1i1111I . oOo0O00 . iI1iII1I1I1i
 Ooo0OO = {
 "objlist" : OO ,
 "objlistDoor" : i111IIi ,
 "deleteUrl" : "/user_del" ,
 "losecardUrl" : "/user_losecard" ,
 "timeprofiles" : O000
 }
 if iII >= i1i11i :
  return render_template ( "wgcomm/pri-edit-morepages.html" , ** Ooo0OO )
 return render_template ( "wgcomm/pri-edit.html" , ** Ooo0OO )
 if 47 - 47: OooOoo . I1Ii1I1 . Ooo0Ooo
 if 58 - 58: I11iiIi11i1I % Oo - i1i1i1111I . oOO + i1i1i1111I
@ bp . route ( '/pri_edit_page' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_edit_page ( ) :
 OOO00 = ''
 if request . method == 'GET' :
  Oooo0o0oO0 = int ( request . args . get ( 'draw' ) )
  IiII = int ( request . args . get ( 'length' ) )
  I1i1i = int ( request . args . get ( 'start' ) )
  O0ooooOoo0O = request . args . get ( 'search[value]' )
 else :
  Oooo0o0oO0 = int ( request . form . get ( 'draw' ) )
  IiII = int ( request . form . get ( 'length' ) )
  I1i1i = int ( request . form . get ( 'start' ) )
  O0ooooOoo0O = request . form . get ( 'search[value]' )
  OOO00 = request . form . get ( 'csrf_token' )
 oo0oOo = [ ]
 if 32 - 32: I1Ii1I1 % ooo000 * OooOoo / oOo0O00 + ooOOO
 if 64 - 64: I1Ii1I1 . Ooo0Ooo
 if 36 - 36: IIiIIiIi11I1 + IiIIii11Ii . i1 + IIiIIiIi11I1
 if 77 - 77: iI1iII1I1I1i / OooOoo . Iii1i + i1iiIII111 - IiI11Ii111
 if 49 - 49: i1iiIII111 - IiI11Ii111 - OooOoo
 if 39 - 39: I1I % i1iiIII111 - I1Ii1I1
 OOOO0O0ooO0O = db . session . query ( TBConsumer . f_ConsumerID , TBConsumer . f_ConsumerNO , TBConsumer . f_ConsumerName ,
 TBConsumer . f_CardNO , TBConsumer . f_BeginYMD ,
 TBConsumer . f_EndYMD , TBGroup . f_GroupName ) . join ( TBGroup ,
 TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True ) . order_by (
 TBConsumer . f_ConsumerNO )
 if 51 - 51: IIiIIiIi11I1 + i1 % i1iiIII111
 if IiII == - 1 :
  I1i1i = 0
  IiII = 2147483647
  if 49 - 49: IiIIii11Ii - i1I . I1I
 if O0ooooOoo0O :
  O0ooooOoo0O = O0ooooOoo0O . strip ( )
  Oo0 = O0ooooOoo0O . split ( ' ' )
  if len ( Oo0 ) >= 1 :
   ooooo = and_ ( 1 > 0 )
   for oO00o00OO in Oo0 :
    o00o = or_ ( TBConsumer . f_ConsumerNO . like ( "%%%s%%" % oO00o00OO ) ,
 TBConsumer . f_ConsumerName . like ( "%%%s%%" % oO00o00OO ) ,
 TBGroup . f_GroupName . like ( "%%%s%%" % oO00o00OO ) )
    if vwAppConfig . parseInt ( oO00o00OO ) > 0 :
     Ii11I = vwAppConfig . parseInt ( oO00o00OO )
     o00o = or_ ( TBConsumer . f_CardNO == Ii11I , o00o )
    ooooo = and_ ( ooooo , o00o )
   o00o = ooooo
   OOOO0O0ooO0O = OOOO0O0ooO0O . filter ( o00o )
   iII = OOOO0O0ooO0O . count ( )
  else :
   iII = TBConsumer . query . count ( )
 else :
  iII = TBConsumer . query . count ( )
  if 76 - 76: oOO / iI1iII1I1I1i . I1I * oOo0O00 - i1i1i1111I
  if 53 - 53: OooOoo - oOo0O00 * ooOOO / OooOoo * Ooo0Ooo * ooo000
 II1I111I1iI = I1i1i
 if I1i1i <= iII :
  OO = OOOO0O0ooO0O . order_by ( TBConsumer . f_ConsumerNO ) . offset ( I1i1i ) . limit ( IiII ) . all ( )
  II1I111I1iI = I1i1i + IiII
 else :
  OO = OOOO0O0ooO0O . order_by ( TBConsumer . f_ConsumerNO ) . offset ( 0 ) . limit ( IiII ) . all ( )
  II1I111I1iI = 1
  if 90 - 90: i1i1i1111I % i1 . IiIIii11Ii * IiI11Ii111 / Ii
 for i1iI1i in OO :
  OoooOo00 = """                                                                            <div class="custom-checkbox custom-control">
                                                                                <input type="checkbox"
                                                                                       data-bs-checkboxes="mygroup"
                                                                                       class="custom-control-input call-checkbox"
                                                                                       id="chk{0}">
                                                                                <label for="chk{1}"
                                                                                       class="custom-control-label"></label>
                                                                            </div>""" . format ( i1iI1i . f_ConsumerID , i1iI1i . f_ConsumerID )
  if 67 - 67: i1I % iI1iII1I1I1i / ooo000 + i1I - I11iiIi11i1I
  II = i1iI1i . f_CardNO
  if II is None or II == 0 :
   II = ''
  else :
   if 14 - 14: i1i1i1111I - OooOoo . IiIIii11Ii
   II = '<text id="cardno-{}" >{}</text>' . format ( i1iI1i . f_ConsumerID , II )
  I1i1iI1I1Ii1 = i1iI1i . f_GroupName
  if I1i1iI1I1Ii1 is None :
   I1i1iI1I1Ii1 = ''
   if 40 - 40: I1I - IIiIIiIi11I1 % IiIIii11Ii
   if 61 - 61: iI1iII1I1I1i
   if 93 - 93: i1iiIII111 - oOo0O00 . Oo . i1iiIII111 . Oo * I1Ii1I1
  oOoOO0O0 = [ OoooOo00 , i1iI1i . f_ConsumerNO , i1iI1i . f_ConsumerName ,
 II , I1i1iI1I1Ii1 ]
  oo0oOo . append ( oOoOO0O0 )
  if 95 - 95: I1Ii1I1 % oOO
 OO00OOooO = {
 "draw" : Oooo0o0oO0 ,
 "recordsTotal" : iII ,
 "recordsFiltered" : iII ,
 "data" : oo0oOo ,
 'start' : II1I111I1iI
 }
 return json . dumps ( OO00OOooO )
 if 21 - 21: Ooo0Ooo % i1 - ooo000
 if 81 - 81: Ooo0Ooo / ooo000
@ bp . route ( '/pri_edit_usercopy' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_edit_usercopy ( ) :
 if 4 - 4: I1I % i1I - ooo000 - I1I . ooOOO / i1i1i1111I
 if 74 - 74: oOO
 if 24 - 24: I1I + Oo - ooOOO
 if 86 - 86: i1iiIII111 % ooo000 % ooo000 % i1I
 if 15 - 15: iI1iII1I1I1i + I1Ii1I1 % oOo0O00
 if 79 - 79: OooOoo . Oo + oOo0O00 / I1Ii1I1 . IiIIii11Ii
 if 89 - 89: ooo000 % Ooo0Ooo
 if 77 - 77: ooo000 % Ooo0Ooo
 if 24 - 24: oOO * I1Ii1I1 * I1Ii1I1 % IIiIIiIi11I1
 OO = [ ]
 if 37 - 37: i1iiIII111 / iI1iII1I1I1i
 if 80 - 80: IiIIii11Ii
 if 2 - 2: I1I / oOO - IIiIIiIi11I1 % Ooo0Ooo
 if 88 - 88: iI1iII1I1I1i - I1Ii1I1 - i1I . Iii1i
 if 98 - 98: Ii + ooOOO
 if 29 - 29: I1Ii1I1 + i1I - IIiIIiIi11I1 * I11iiIi11i1I % Oo
 if 74 - 74: ooOOO
 if 100 - 100: oOO + iI1iII1I1I1i . I1I % Oo - i1
 if 39 - 39: iI1iII1I1I1i
 if 34 - 34: iI1iII1I1I1i . i1 . I1I
 if 95 - 95: IiIIii11Ii * IiI11Ii111 * Ooo0Ooo * IiI11Ii111 / OooOoo
 if 27 - 27: i1I . IiIIii11Ii
 if 69 - 69: oOO % i1iiIII111 / oOo0O00
 if 38 - 38: I11iiIi11i1I + Oo * Ooo0Ooo / ooOOO . OooOoo
 if 90 - 90: OooOoo / i1iiIII111
 if 32 - 32: IIiIIiIi11I1 - i1I / ooOOO * Ooo0Ooo * iI1iII1I1I1i - i1i1i1111I
 if 82 - 82: ooo000
 if 66 - 66: IiIIii11Ii + IIiIIiIi11I1 - i1I + i1i1i1111I . iI1iII1I1I1i * IiIIii11Ii
 if 9 - 9: I1I - I1I - ooOOO - oOo0O00 + i1iiIII111
 Ooo0OO = {
 "objlist" : OO ,

 "deleteUrl" : "/user_del" ,
 "losecardUrl" : "/user_losecard" ,

 }
 return render_template ( "wgcomm/pri-edit-usercopy.html" , ** Ooo0OO )
 if 71 - 71: i1I / i1iiIII111 - Ii * Oo . iI1iII1I1I1i
 if 3 - 3: I1Ii1I1
@ bp . route ( '/pri_edit_usercopy_page' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_edit_usercopy_page ( ) :
 OOO00 = ''
 if request . method == 'GET' :
  Oooo0o0oO0 = int ( request . args . get ( 'draw' ) )
  IiII = int ( request . args . get ( 'length' ) )
  I1i1i = int ( request . args . get ( 'start' ) )
  O0ooooOoo0O = request . args . get ( 'search[value]' )
 else :
  Oooo0o0oO0 = int ( request . form . get ( 'draw' ) )
  IiII = int ( request . form . get ( 'length' ) )
  I1i1i = int ( request . form . get ( 'start' ) )
  O0ooooOoo0O = request . form . get ( 'search[value]' )
  OOO00 = request . form . get ( 'csrf_token' )
 oo0oOo = [ ]
 OOOO0O0ooO0O = db . session . query ( TBConsumer . f_ConsumerID , TBConsumer . f_ConsumerNO , TBConsumer . f_ConsumerName ,
 TBConsumer . f_CardNO , TBConsumer . f_BeginYMD ,
 TBConsumer . f_EndYMD , TBGroup . f_GroupName ) . join ( TBGroup ,
 TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True ) . order_by (
 TBConsumer . f_ConsumerNO )
 if 57 - 57: Ooo0Ooo . OooOoo / oOo0O00 * I1Ii1I1
 if IiII == - 1 :
  I1i1i = 0
  IiII = 2147483647
  if 36 - 36: IiIIii11Ii
 if O0ooooOoo0O :
  O0ooooOoo0O = O0ooooOoo0O . strip ( )
  Oo0 = O0ooooOoo0O . split ( ' ' )
  if len ( Oo0 ) >= 1 :
   ooooo = and_ ( 1 > 0 )
   for oO00o00OO in Oo0 :
    o00o = or_ ( TBConsumer . f_ConsumerNO . like ( "%%%s%%" % oO00o00OO ) ,
 TBConsumer . f_ConsumerName . like ( "%%%s%%" % oO00o00OO ) ,
 TBGroup . f_GroupName . like ( "%%%s%%" % oO00o00OO ) )
    if vwAppConfig . parseInt ( oO00o00OO ) > 0 :
     Ii11I = vwAppConfig . parseInt ( oO00o00OO )
     o00o = or_ ( TBConsumer . f_CardNO == Ii11I , o00o )
    ooooo = and_ ( ooooo , o00o )
   o00o = ooooo
   OOOO0O0ooO0O = OOOO0O0ooO0O . filter ( o00o )
   iII = OOOO0O0ooO0O . count ( )
  else :
   iII = TBConsumer . query . count ( )
 else :
  iII = TBConsumer . query . count ( )
  if 33 - 33: IiIIii11Ii
  if 86 - 86: Ii / oOo0O00 - i1 * i1i1i1111I - Oo * Iii1i
 II1I111I1iI = I1i1i
 if I1i1i <= iII :
  OO = OOOO0O0ooO0O . order_by ( TBConsumer . f_ConsumerNO ) . offset ( I1i1i ) . limit ( IiII ) . all ( )
  II1I111I1iI = I1i1i + IiII
 else :
  OO = OOOO0O0ooO0O . order_by ( TBConsumer . f_ConsumerNO ) . offset ( 0 ) . limit ( IiII ) . all ( )
  II1I111I1iI = 1
  if 28 - 28: OooOoo . i1 % iI1iII1I1I1i % Iii1i
 for i1iI1i in OO :
  OoooOo00 = """ <div class="custom-checkbox custom-control">
                   <input type="checkbox"
                   data-bs-checkboxes="mygroup"
                   class="custom-control-input call-checkbox"
                    id="chk{0}">
                     <label for="chk{1}"
                      class="custom-control-label"></label>
                   </div>""" . format ( i1iI1i . f_ConsumerID , i1iI1i . f_ConsumerID )
  if 2 - 2: Oo + OooOoo - i1i1i1111I - ooo000 / Oo . Oo
  II = i1iI1i . f_CardNO
  if II is None or II == 0 :
   II = ''
  else :
   if 41 - 41: OooOoo + OooOoo - OooOoo
   II = '<text id="cardno-{}" >{}</text>' . format ( i1iI1i . f_ConsumerID , II )
  I1i1iI1I1Ii1 = i1iI1i . f_GroupName
  if I1i1iI1I1Ii1 is None :
   I1i1iI1I1Ii1 = ''
   if 9 - 9: Iii1i % I1Ii1I1 % IiIIii11Ii - I1I * OooOoo
   if 53 - 53: iI1iII1I1I1i * i1i1i1111I / OooOoo . i1I . ooo000
   if 45 - 45: OooOoo + ooOOO / i1i1i1111I * i1
  oOoOO0O0 = [ OoooOo00 , i1iI1i . f_ConsumerNO , i1iI1i . f_ConsumerName ,
 II , I1i1iI1I1Ii1 ]
  oOoOO0O0 = [ OoooOo00 , i1iI1i . f_ConsumerNO , i1iI1i . f_ConsumerName ,
 I1i1iI1I1Ii1 ]
  oo0oOo . append ( oOoOO0O0 )
  if 71 - 71: IiI11Ii111 % Iii1i + oOo0O00 * I11iiIi11i1I / IiI11Ii111
 OO00OOooO = {
 "draw" : Oooo0o0oO0 ,
 "recordsTotal" : iII ,
 "recordsFiltered" : iII ,
 "data" : oo0oOo ,
 'start' : II1I111I1iI
 }
 return json . dumps ( OO00OOooO )
 if 66 - 66: ooo000 * oOo0O00
 if 83 - 83: i1
@ bp . route ( '/pri_edit_usercopy_src_page' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_edit_usercopy_src_page ( ) :
 OOO00 = ''
 if request . method == 'GET' :
  Oooo0o0oO0 = int ( request . args . get ( 'draw' ) )
  IiII = int ( request . args . get ( 'length' ) )
  I1i1i = int ( request . args . get ( 'start' ) )
  O0ooooOoo0O = request . args . get ( 'search[value]' )
 else :
  Oooo0o0oO0 = int ( request . form . get ( 'draw' ) )
  IiII = int ( request . form . get ( 'length' ) )
  I1i1i = int ( request . form . get ( 'start' ) )
  O0ooooOoo0O = request . form . get ( 'search[value]' )
  OOO00 = request . form . get ( 'csrf_token' )
 oo0oOo = [ ]
 OOOO0O0ooO0O = db . session . query ( TBConsumer . f_ConsumerID , TBConsumer . f_ConsumerNO , TBConsumer . f_ConsumerName ,
 TBConsumer . f_CardNO , TBConsumer . f_BeginYMD ,
 TBConsumer . f_EndYMD , TBGroup . f_GroupName ) . join ( TBGroup ,
 TBConsumer . f_GroupID == TBGroup . f_GroupID ,
 isouter = True ) . order_by (
 TBConsumer . f_ConsumerNO )
 if 64 - 64: i1 . IiI11Ii111 - I11iiIi11i1I . Iii1i
 if IiII == - 1 :
  I1i1i = 0
  IiII = 2147483647
  if 47 - 47: ooo000 / Ooo0Ooo % IiIIii11Ii
 if O0ooooOoo0O :
  O0ooooOoo0O = O0ooooOoo0O . strip ( )
  Oo0 = O0ooooOoo0O . split ( ' ' )
  if len ( Oo0 ) >= 1 :
   ooooo = and_ ( 1 > 0 )
   for oO00o00OO in Oo0 :
    o00o = or_ ( TBConsumer . f_ConsumerNO . like ( "%%%s%%" % oO00o00OO ) ,
 TBConsumer . f_ConsumerName . like ( "%%%s%%" % oO00o00OO ) ,
 TBGroup . f_GroupName . like ( "%%%s%%" % oO00o00OO ) )
    if vwAppConfig . parseInt ( oO00o00OO ) > 0 :
     Ii11I = vwAppConfig . parseInt ( oO00o00OO )
     o00o = or_ ( TBConsumer . f_CardNO == Ii11I , o00o )
    ooooo = and_ ( ooooo , o00o )
   o00o = ooooo
   OOOO0O0ooO0O = OOOO0O0ooO0O . filter ( o00o )
   iII = OOOO0O0ooO0O . count ( )
  else :
   iII = TBConsumer . query . count ( )
 else :
  iII = TBConsumer . query . count ( )
  if 70 - 70: IIiIIiIi11I1 / Iii1i . i1i1i1111I % ooOOO . Ii / Ii
  if 51 - 51: I11iiIi11i1I + Ooo0Ooo - ooo000 * oOO . oOO
 II1I111I1iI = I1i1i
 if I1i1i <= iII :
  OO = OOOO0O0ooO0O . order_by ( TBConsumer . f_ConsumerNO ) . offset ( I1i1i ) . limit ( IiII ) . all ( )
  II1I111I1iI = I1i1i + IiII
 else :
  OO = OOOO0O0ooO0O . order_by ( TBConsumer . f_ConsumerNO ) . offset ( 0 ) . limit ( IiII ) . all ( )
  II1I111I1iI = 1
  if 79 - 79: i1i1i1111I + oOo0O00
 for i1iI1i in OO :
  OoooOo00 = """                                                                            <div class="custom-checkbox custom-control">
                                                                                    <input type="checkbox"
                                                                                           data-bs-checkboxes="mygroup"
                                                                                           class="custom-control-input call-checkbox"
                                                                                           id="chk{0}-src">
                                                                                    <label for="chk{1}-src"
                                                                                           class="custom-control-label"></label>
                                                                                </div>""" . format ( i1iI1i . f_ConsumerID , i1iI1i . f_ConsumerID )
  if 11 - 11: OooOoo / i1iiIII111 % i1I - i1i1i1111I * oOo0O00
  II = i1iI1i . f_CardNO
  if II is None or II == 0 :
   II = ''
  else :
   if 90 - 90: i1 * i1 . Ooo0Ooo . Oo
   II = '<text id="cardno-{}" >{}</text>' . format ( i1iI1i . f_ConsumerID , II )
  I1i1iI1I1Ii1 = i1iI1i . f_GroupName
  if I1i1iI1I1Ii1 is None :
   I1i1iI1I1Ii1 = ''
   if 59 - 59: Ii % I1Ii1I1 + Iii1i . OooOoo * Iii1i
   if 21 - 21: I11iiIi11i1I + ooOOO % IiIIii11Ii / OooOoo
   if 96 - 96: Oo * i1iiIII111 . Ooo0Ooo
  oOoOO0O0 = [ OoooOo00 , i1iI1i . f_ConsumerNO , i1iI1i . f_ConsumerName ,
 II , I1i1iI1I1Ii1 ]
  oOoOO0O0 = [ OoooOo00 , i1iI1i . f_ConsumerNO , i1iI1i . f_ConsumerName ,
 I1i1iI1I1Ii1 ]
  oo0oOo . append ( oOoOO0O0 )
  if 35 - 35: ooOOO . i1I * i1i1i1111I * iI1iII1I1I1i - I11iiIi11i1I
 OO00OOooO = {
 "draw" : Oooo0o0oO0 ,
 "recordsTotal" : iII ,
 "recordsFiltered" : iII ,
 "data" : oo0oOo ,
 'start' : II1I111I1iI
 }
 return json . dumps ( OO00OOooO )
 if 47 - 47: IIiIIiIi11I1
 if 73 - 73: I1Ii1I1 + ooOOO
@ bp . route ( '/pri_edit_doorcopy' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_pri_edit_doorcopy ( ) :
 OOOO0O0ooO0O = db . session . query ( TBDoor . f_DoorID , TBDoor . f_DoorName , TBDoor . f_DoorNO ,
 TBController . f_ControllerSN , TBDoor . f_DoorEnabled ) . filter_by ( f_DoorEnabled = True ) . join (
 TBController ,
 TBController . f_ControllerID == TBDoor . f_ControllerID ,
 isouter = False ) . filter ( ~ TBController . f_ControllerSN . between ( 170123456 , 180123456 ) ) . order_by (
 TBDoor . f_DoorName )
 i111IIi = OOOO0O0ooO0O . all ( )
 Ooo0OO = {

 "objlistDoor" : i111IIi ,
 "deleteUrl" : "/user_del" ,
 "losecardUrl" : "/user_losecard" ,

 }
 return render_template ( "wgcomm/pri-edit-doorcopy.html" , ** Ooo0OO )
 if 99 - 99: i1I
 if 87 - 87: i1 . I11iiIi11i1I * Ii . i1 . IIiIIiIi11I1 . IiIIii11Ii
@ bp . route ( '/pri_allowselected_usercopy' , methods = [ 'POST' ] )
@ login_required
def web_pri_allowselected_usercopy ( ) :
 if 50 - 50: Ii / oOO
 if 92 - 92: Ooo0Ooo * i1iiIII111 / Ooo0Ooo / i1iiIII111 * i1i1i1111I + i1I
 if 48 - 48: I11iiIi11i1I
 if 87 - 87: I1Ii1I1
 if 29 - 29: ooo000 . iI1iII1I1I1i . oOo0O00 + i1i1i1111I + oOO
 ooO0O00 = request . form . get ( "selecteduser_src" )
 I1Ii11i = request . form . get ( "selecteduser" )
 if 20 - 20: Ooo0Ooo
 if 4 - 4: IiIIii11Ii % Iii1i
 if 43 - 43: ooo000
 if 95 - 95: Oo + I11iiIi11i1I / Ooo0Ooo / Ii - ooOOO / i1i1i1111I
 if len ( ooO0O00 ) == 0 or len ( I1Ii11i ) == 0 :
  return "OK"
  if 6 - 6: Ooo0Ooo % IiIIii11Ii
 oo0o0Oo00oO = ooO0O00 . split ( "," )
 oo0o0Oo00oO = [ int ( x ) for x in oo0o0Oo00oO ]
 oo0o0Oo00oO . sort ( )
 Iiii = I1Ii11i . split ( "," )
 Iiii = [ int ( x ) for x in Iiii if int ( x ) not in oo0o0Oo00oO ]
 Iiii . sort ( )
 if len ( oo0o0Oo00oO ) == 0 or len ( Iiii ) == 0 :
  return "Please select users first (users selected in the source that also exist in the target users will not be updated)."
  if 85 - 85: oOo0O00 / ooOOO
  if 41 - 41: i1iiIII111 * iI1iII1I1I1i + i1 + i1i1i1111I
  if 26 - 26: Oo % OooOoo
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Source users count={}-Target users count={}" . format ( len ( oo0o0Oo00oO ) ,
 len ( Iiii ) ) ) )
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Source users={}-Target users={}" . format ( ( ooO0O00 ) ,
 ( I1Ii11i ) ) ) )
 if 14 - 14: iI1iII1I1I1i - i1iiIII111
 if 53 - 53: oOO
 oOOOooo0O = db . session . query (
 TDPrivilege . f_DoorID ,
 TDPrivilege . f_ControlSegID ,
 TDPrivilege . f_ControllerID ,
 TDPrivilege . f_DoorNO ,
 TBConsumer . f_ConsumerNO ,
 func . row_number ( ) . over (
 partition_by = TDPrivilege . f_DoorID ,
 order_by = TBConsumer . f_ConsumerNO
 ) . label ( 'row_num' )
 ) . join ( TBConsumer , TBConsumer . f_ConsumerID == TDPrivilege . f_ConsumerID ) . filter (
 TDPrivilege . f_ConsumerID . in_ ( oo0o0Oo00oO )
 ) . subquery ( )
 if 91 - 91: Ii % i1iiIII111 / i1i1i1111I / i1 * ooo000 + I11iiIi11i1I
 IiiII1 = db . session . query (
 oOOOooo0O . c . f_DoorID ,
 oOOOooo0O . c . f_ControlSegID ,
 oOOOooo0O . c . f_ControllerID ,
 oOOOooo0O . c . f_DoorNO
 ) . filter ( oOOOooo0O . c . row_num == 1 ) . all ( )
 if 96 - 96: Oo / Oo - Oo / Ii . i1
 iI111i11 = "DELETE FROM  t_d_Privilege  WHERE f_ConsumerID IN ({}) " . format ( vwAppConfig . getStrFromArray ( Iiii ) )
 db . session . execute ( text ( iI111i11 ) )
 db . session . commit ( )
 if 34 - 34: Iii1i
 if 9 - 9: iI1iII1I1I1i * OooOoo
 if 12 - 12: Ii . Ii - I1Ii1I1
 for OoO0OoOoo in Iiii :
  for i1iI1i in IiiII1 :
   iI111i11 = "INSERT INTO t_d_Privilege (f_ConsumerID, f_DoorID ,f_ControllerID, f_DoorNO, f_ControlSegID)"
   iI111i11 += " values ({0},{1},{2},{3},{4})" . format ( OoO0OoOoo , i1iI1i . f_DoorID , i1iI1i . f_ControllerID , i1iI1i . f_DoorNO , i1iI1i . f_ControlSegID )
   db . session . execute ( text ( iI111i11 ) )
 db . session . commit ( )
 if 36 - 36: OooOoo - IiI11Ii111 . IiI11Ii111
 if 79 - 79: oOo0O00 * IIiIIiIi11I1
 OOOO0O0ooO0O = db . session . query ( TBDoor . f_DoorID , TBDoor . f_DoorName , TBDoor . f_DoorNO ,
 TBController . f_ControllerSN , TBDoor . f_DoorEnabled ) . filter_by ( f_DoorEnabled = True ) . join (
 TBController ,
 TBController . f_ControllerID == TBDoor . f_ControllerID ,
 isouter = False ) . filter ( ~ TBController . f_ControllerSN . between ( 170123456 , 180123456 ) ) . order_by (
 TBDoor . f_DoorName )
 i111IIi = OOOO0O0ooO0O . all ( )
 I1i = [ x . f_DoorID for x in i111IIi ]
 O0O0oO = IIiI1i ( doorDst = I1i , userDst = Iiii , opMode = 'btnAddPass_Click' )
 if 53 - 53: Ii - ooOOO . OooOoo - I1I - I11iiIi11i1I
 if 32 - 32: Iii1i % IiIIii11Ii - oOO - IiIIii11Ii - I11iiIi11i1I % i1iiIII111
 if 50 - 50: Iii1i / IiI11Ii111 + i1
 if 4 - 4: IIiIIiIi11I1 . IiIIii11Ii % i1I
 if 30 - 30: i1 . i1
 if 35 - 35: Ii * i1I / IiIIii11Ii - I1Ii1I1 / i1
 if 76 - 76: IiIIii11Ii * Iii1i % IiIIii11Ii
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """User permissions copy completed.
        但此次上传更新不 Successfully [原因有些控制器Communication failure.]
        请稍后在总控制台重新上传"""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
  if 73 - 73: i1I / IIiIIiIi11I1 / oOo0O00 % IIiIIiIi11I1 / Ii
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "OK" , "User permissions copy completed." ) )
 if 12 - 12: i1
 return "OK"
 if 78 - 78: I11iiIi11i1I . IIiIIiIi11I1
 if 1 - 1: I1I % i1iiIII111 / I1Ii1I1
@ bp . route ( '/pri_allowselected_doorcopy' , methods = [ 'POST' ] )
@ login_required
def web_pri_allowselected_doorcopy ( ) :
 if 42 - 42: Iii1i
 if 19 - 19: OooOoo * I11iiIi11i1I . i1i1i1111I + ooo000 + i1I
 if 13 - 13: i1iiIII111 + I1Ii1I1 / Ooo0Ooo
 if 82 - 82: i1iiIII111 * oOO / IiI11Ii111 * IiIIii11Ii
 iI11Iii1 = request . form . get ( "selecteddoor_src" )
 Iii1I1i11iI = request . form . get ( "selecteddoor" )
 if 19 - 19: i1i1i1111I * IiIIii11Ii / i1iiIII111
 if 22 - 22: i1iiIII111 . Iii1i - I1I + i1i1i1111I / ooOOO + Oo
 if 93 - 93: Ii
 if 50 - 50: Ooo0Ooo * Ooo0Ooo / ooo000 - IiIIii11Ii
 if len ( iI11Iii1 ) == 0 or len ( Iii1I1i11iI ) == 0 :
  return "OK"
  if 70 - 70: IIiIIiIi11I1 . i1 % iI1iII1I1I1i / i1i1i1111I
 IIoOo = iI11Iii1 . split ( "," )
 IIoOo = [ int ( x ) for x in IIoOo ]
 IIoOo . sort ( )
 I1i = Iii1I1i11iI . split ( "," )
 I1i = [ int ( x ) for x in I1i if int ( x ) not in IIoOo ]
 I1i . sort ( )
 if len ( IIoOo ) == 0 or len ( I1i ) == 0 :
  return "Please select doors first (doors selected in the source that also exist in the target doors will not be updated)."
  if 49 - 49: i1i1i1111I * oOO
  if 12 - 12: IiI11Ii111 % Iii1i - Ooo0Ooo
  if 84 - 84: Ooo0Ooo % I1Ii1I1
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Source doors count={}-Target doors count={}" . format ( len ( IIoOo ) ,
 len ( I1i ) ) ) )
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Source doors={}-Target doors={}" . format ( iI11Iii1 ,
 Iii1I1i11iI ) ) )
 if 7 - 7: i1iiIII111
 if 27 - 27: oOO - oOO
 oOOOooo0O = db . session . query (

 TDPrivilege . f_ConsumerID ,
 TDPrivilege . f_ControlSegID ,

 # oOo0O00 * i1 + Oo
 TBDoor . f_DoorName ,
 func . row_number ( ) . over (
 partition_by = TDPrivilege . f_ConsumerID ,
 order_by = TBDoor . f_DoorName
 ) . label ( 'row_num' )
 ) . join ( TBDoor , TBDoor . f_DoorID == TDPrivilege . f_DoorID ) . filter (
 TDPrivilege . f_DoorID . in_ ( IIoOo )
 ) . subquery ( )
 if 7 - 7: oOO % OooOoo - IiIIii11Ii . Iii1i
 IiiII1 = db . session . query (
 oOOOooo0O . c . f_ConsumerID ,
 oOOOooo0O . c . f_ControlSegID ,

 # oOo0O00 . IiI11Ii111 * I1I - Oo
 ) . filter ( oOOOooo0O . c . row_num == 1 ) . all ( )
 if 4 - 4: oOo0O00 / i1i1i1111I
 iI111i11 = "DELETE FROM  t_d_Privilege  WHERE f_DoorID IN ({}) " . format ( vwAppConfig . getStrFromArray ( I1i ) )
 db . session . execute ( text ( iI111i11 ) )
 db . session . commit ( )
 if 61 - 61: oOo0O00
 if 51 - 51: ooOOO - oOO . I1Ii1I1 - IiIIii11Ii
 if 49 - 49: iI1iII1I1I1i / ooOOO . iI1iII1I1I1i
 for OO0oo in I1i :
  iI1I1i1iI1I1 = TBDoor . query . filter_by ( f_DoorID = OO0oo ) . first ( )
  for i1iI1i in IiiII1 :
   iI111i11 = "INSERT INTO t_d_Privilege (f_ConsumerID, f_DoorID ,f_ControllerID, f_DoorNO, f_ControlSegID)"
   iI111i11 += " values ({0},{1},{2},{3},{4})" . format ( i1iI1i . f_ConsumerID , iI1I1i1iI1I1 . f_DoorID , iI1I1i1iI1I1 . f_ControllerID , iI1I1i1iI1I1 . f_DoorNO , i1iI1i . f_ControlSegID )
   db . session . execute ( text ( iI111i11 ) )
 db . session . commit ( )
 if 88 - 88: i1 % oOo0O00 - ooo000 . Ii
 if 65 - 65: i1I % IiI11Ii111 * Oo / I1Ii1I1 - I1Ii1I1
 if 28 - 28: Ii / Ooo0Ooo
 if 11 - 11: I1I - OooOoo * ooOOO % i1i1i1111I + ooo000 . oOO
 if 51 - 51: ooOOO + iI1iII1I1I1i % IiI11Ii111 . I11iiIi11i1I % Ooo0Ooo
 if 15 - 15: OooOoo / i1I % Oo % Oo
 if 73 - 73: oOo0O00
 if 69 - 69: ooOOO - IIiIIiIi11I1 - i1I
 if 78 - 78: I1Ii1I1 . ooo000 + IiI11Ii111 / IiI11Ii111
 if 88 - 88: Ii - i1iiIII111 - i1 * IIiIIiIi11I1 . IiIIii11Ii + Iii1i
 O0O0oO = IIiI1i ( doorDst = I1i , userDst = [ ] , opMode = 'btnAddPass_Click' ,
 bUploadAllUser = True )
 if 44 - 44: ooOOO + Oo - i1
 if 18 - 18: iI1iII1I1I1i * ooOOO + Ooo0Ooo
 if 78 - 78: I1I . I1I - IIiIIiIi11I1 - IiIIii11Ii % I11iiIi11i1I . I1Ii1I1
 if 9 - 9: I11iiIi11i1I * OooOoo - I11iiIi11i1I
 if 73 - 73: I1Ii1I1
 if 25 - 25: i1 . Ii
 if 59 - 59: IiIIii11Ii
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """Door permissions copy completed.
        但此次上传更新不 Successfully [原因有些控制器Communication failure.]
        请稍后在总控制台重新上传"""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
  if 91 - 91: IiIIii11Ii + iI1iII1I1I1i
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "OK" , "Door permissions copy completed." ) )
 if 65 - 65: Oo * Iii1i * IiIIii11Ii / IIiIIiIi11I1
 return "OK"
 if 77 - 77: IIiIIiIi11I1 / oOO % IiIIii11Ii + I1Ii1I1
 if 34 - 34: i1i1i1111I * Iii1i + Ii - i1I / i1 / i1
import time
if 87 - 87: Ooo0Ooo + I11iiIi11i1I
if 3 - 3: IIiIIiIi11I1 . I1Ii1I1 / Iii1i % ooOOO / oOo0O00 % ooOOO
if 55 - 55: iI1iII1I1I1i + I1I + oOo0O00 - I11iiIi11i1I
if 80 - 80: Oo % I11iiIi11i1I . IiIIii11Ii * oOO
if 83 - 83: oOo0O00 % Oo + i1i1i1111I - ooOOO + i1iiIII111
if 36 - 36: oOo0O00 * OooOoo / I11iiIi11i1I
if 98 - 98: IiI11Ii111 . ooo000
if 85 - 85: OooOoo * Iii1i * IIiIIiIi11I1
if 38 - 38: ooo000 - Ii - i1I
if 91 - 91: i1iiIII111 / i1 * oOO * IIiIIiIi11I1 * IiIIii11Ii
if 65 - 65: oOO / oOo0O00 / Oo
if 61 - 61: ooOOO * oOO
if 98 - 98: i1iiIII111 * i1i1i1111I
if 29 - 29: oOo0O00 / i1iiIII111 - IiIIii11Ii
if 34 - 34: iI1iII1I1I1i + IIiIIiIi11I1 . i1I . IiI11Ii111 % i1i1i1111I
if 61 - 61: Oo % ooo000
if 68 - 68: Ii - OooOoo / I1I
if 44 - 44: iI1iII1I1I1i % i1iiIII111 / I1Ii1I1 * i1i1i1111I
if 63 - 63: I1Ii1I1 * Ii + Iii1i
if 58 - 58: I1Ii1I1 / I1Ii1I1 % IIiIIiIi11I1
if 98 - 98: OooOoo
if 79 - 79: Ooo0Ooo * Ooo0Ooo - ooo000 - Iii1i
if 5 - 5: IiIIii11Ii / i1iiIII111 . I1I % Iii1i . i1
if 29 - 29: oOo0O00 + Oo / I11iiIi11i1I - oOo0O00 % i1i1i1111I / Ii
if 39 - 39: I11iiIi11i1I - I11iiIi11i1I % i1iiIII111
if 56 - 56: i1iiIII111 / IiIIii11Ii - I1Ii1I1 / Iii1i - i1 / OooOoo
if 28 - 28: i1I . I1Ii1I1 % IiIIii11Ii . Ii * ooOOO - oOO
if 80 - 80: IiI11Ii111
if 7 - 7: Iii1i . Oo . iI1iII1I1I1i - Oo - ooOOO % IIiIIiIi11I1
if 90 - 90: Iii1i / oOo0O00
if 54 - 54: I11iiIi11i1I . IiI11Ii111 + OooOoo % Oo - IiI11Ii111 % Oo
if 37 - 37: Oo
if 64 - 64: I1I % ooOOO
if 67 - 67: Ooo0Ooo + oOo0O00
if 21 - 21: oOO
if 64 - 64: IIiIIiIi11I1 * i1iiIII111
if 31 - 31: Iii1i
if 86 - 86: Oo
if 74 - 74: OooOoo - I11iiIi11i1I . Oo . i1 + oOo0O00 - ooOOO
if 60 - 60: Oo
if 23 - 23: oOo0O00
if 47 - 47: Ooo0Ooo + Oo * Ii . OooOoo . I1Ii1I1 * i1iiIII111
if 46 - 46: ooOOO % i1i1i1111I * i1iiIII111 + I1Ii1I1
if 15 - 15: iI1iII1I1I1i - ooo000 + IIiIIiIi11I1 * Ooo0Ooo
if 84 - 84: OooOoo . Ii
if 21 - 21: Ooo0Ooo
if 76 - 76: iI1iII1I1I1i % IiI11Ii111 / IiIIii11Ii - IiI11Ii111
if 4 - 4: OooOoo * IIiIIiIi11I1 - Ooo0Ooo . Ii - ooOOO . i1iiIII111
if 2 - 2: I11iiIi11i1I * i1I * i1I * i1iiIII111 / I11iiIi11i1I % IiI11Ii111
if 13 - 13: i1 * IiIIii11Ii - ooo000 * OooOoo
if 72 - 72: Iii1i . I1Ii1I1 * IIiIIiIi11I1 % I1Ii1I1 - i1i1i1111I
if 97 - 97: i1 + ooOOO + I11iiIi11i1I . i1
if 71 - 71: ooo000 - i1i1i1111I / iI1iII1I1I1i - iI1iII1I1I1i % IIiIIiIi11I1 . iI1iII1I1I1i
if 41 - 41: IIiIIiIi11I1
if 96 - 96: Oo . Ooo0Ooo - oOO . Iii1i % IiI11Ii111 . IiI11Ii111
if 82 - 82: oOO % iI1iII1I1I1i / i1iiIII111
if 47 - 47: i1
if 59 - 59: IiI11Ii111 % IIiIIiIi11I1 % IiIIii11Ii
if 92 - 92: Oo . i1 * i1iiIII111 . IiIIii11Ii
if 82 - 82: I11iiIi11i1I % Oo + Ii
if 22 - 22: Ooo0Ooo / ooOOO . I1I % I1I
if 16 - 16: iI1iII1I1I1i / i1iiIII111 / Ooo0Ooo . Ii
if 82 - 82: Oo % iI1iII1I1I1i - i1I * OooOoo % Iii1i - I11iiIi11i1I
if 95 - 95: oOO
if 56 - 56: I11iiIi11i1I - i1I / OooOoo / ooo000 . IiI11Ii111
if 78 - 78: ooo000 % IiI11Ii111 - i1
if 36 - 36: oOo0O00 + OooOoo - Ooo0Ooo / IiI11Ii111
if 90 - 90: oOo0O00 % oOO * oOO + I1I * I1I / IiI11Ii111
if 92 - 92: IiIIii11Ii * OooOoo * I1Ii1I1
if 65 - 65: i1iiIII111 * Oo * oOO + i1I - i1I
if 86 - 86: oOO - Ooo0Ooo + I11iiIi11i1I . Iii1i . OooOoo - Ii
if 86 - 86: I1I
if 35 - 35: ooOOO + OooOoo
if 8 - 8: I1I + Ii % iI1iII1I1I1i + IiI11Ii111 . oOO * i1
if 96 - 96: ooo000 % I11iiIi11i1I / oOo0O00 * Ii * ooo000 - Ooo0Ooo
if 88 - 88: Ii % ooOOO . I1I
if 80 - 80: IiIIii11Ii / oOO % IiI11Ii111 * I1I
if 100 - 100: oOo0O00 / I1Ii1I1 - i1i1i1111I * I1Ii1I1 / I11iiIi11i1I * Oo
if 49 - 49: Ooo0Ooo
if 36 - 36: OooOoo + i1I / Iii1i + iI1iII1I1I1i + OooOoo
if 6 - 6: IiI11Ii111 + Ii
if 100 - 100: oOo0O00 % i1I - IiIIii11Ii % i1iiIII111 . i1 % I1Ii1I1
if 67 - 67: I11iiIi11i1I
if 21 - 21: oOO % i1i1i1111I - i1 + I1I
if 85 - 85: IiIIii11Ii + I1I + IiI11Ii111
if 68 - 68: Iii1i % IiIIii11Ii . i1 - IiI11Ii111
if 80 - 80: i1iiIII111 . ooo000
if 15 - 15: oOO + oOo0O00 * I11iiIi11i1I . IiIIii11Ii
if 66 - 66: IIiIIiIi11I1 - oOo0O00 . I1I * I11iiIi11i1I + i1i1i1111I
if 13 - 13: oOO % Iii1i
if 81 - 81: I1I
if 86 - 86: Ooo0Ooo / I1I . Ooo0Ooo % i1i1i1111I * OooOoo * Iii1i
if 59 - 59: Ii + i1i1i1111I . I1Ii1I1 . oOO + i1I . i1
if 34 - 34: iI1iII1I1I1i - ooo000 * i1iiIII111 - Iii1i
if 50 - 50: oOO . IiI11Ii111 . i1I . i1i1i1111I . I11iiIi11i1I + Oo
if 38 - 38: IiI11Ii111 + oOo0O00 . ooo000 - Iii1i - I1Ii1I1 - oOO
if 29 - 29: ooo000 * oOO
if 38 - 38: oOo0O00 / IiIIii11Ii * oOO . OooOoo % Ii . Iii1i
if 74 - 74: oOO - i1i1i1111I % I1I + IiIIii11Ii * I1I
if 53 - 53: OooOoo % I1Ii1I1 / IiI11Ii111 / I1I + I1Ii1I1 . i1I
if 7 - 7: oOO - oOo0O00 . i1i1i1111I * Oo + I1I
if 93 - 93: i1iiIII111 - OooOoo + i1 * oOo0O00 . IiI11Ii111
if 9 - 9: IIiIIiIi11I1 + iI1iII1I1I1i
if 43 - 43: oOo0O00 * i1I * i1I / IiIIii11Ii % i1iiIII111
if 55 - 55: i1iiIII111 . i1
if 29 - 29: Ooo0Ooo * IiIIii11Ii + i1iiIII111 / iI1iII1I1I1i - IiIIii11Ii - oOo0O00
if 63 - 63: I1Ii1I1 . IiI11Ii111 * ooOOO . oOO / I1I
if 34 - 34: i1i1i1111I * i1i1i1111I * I11iiIi11i1I . Iii1i * i1I % ooo000
if 99 - 99: Ii / ooOOO % oOO % OooOoo - IiIIii11Ii
if 51 - 51: oOo0O00 % OooOoo
if 60 - 60: i1i1i1111I % IiIIii11Ii - Iii1i % i1 * IiI11Ii111
if 88 - 88: OooOoo % iI1iII1I1I1i
if 21 - 21: i1I % OooOoo
if 95 - 95: IiIIii11Ii - i1 . i1 - ooOOO . i1 + Ii
if 86 - 86: IiIIii11Ii % ooo000
if 61 - 61: Ii . i1iiIII111 * I11iiIi11i1I . ooOOO
if 95 - 95: oOO % I1Ii1I1 % ooo000
if 84 - 84: i1I + i1i1i1111I * ooOOO % ooo000
if 29 - 29: IiIIii11Ii - IIiIIiIi11I1 + IiI11Ii111 - I11iiIi11i1I . OooOoo
if 57 - 57: i1i1i1111I / I11iiIi11i1I
if 83 - 83: OooOoo / I1Ii1I1 / IiIIii11Ii
if 78 - 78: i1 . i1iiIII111 - Oo * IIiIIiIi11I1 - I1I - i1I
if 21 - 21: Iii1i - Ii / i1I / I1Ii1I1 % I11iiIi11i1I / Ii
if 74 - 74: I1Ii1I1 . ooOOO
if 24 - 24: IiI11Ii111 - Iii1i % oOo0O00 * I1I . iI1iII1I1I1i
if 78 - 78: I1Ii1I1 - Ooo0Ooo / OooOoo % i1I
if 99 - 99: I11iiIi11i1I % ooOOO
if 22 - 22: i1iiIII111 * IiI11Ii111 - i1i1i1111I % ooo000 / OooOoo - Oo
if 3 - 3: I11iiIi11i1I % Ooo0Ooo
if 20 - 20: I1Ii1I1 . IiI11Ii111 - Ii % I11iiIi11i1I % Oo
if 12 - 12: OooOoo * oOO % Ooo0Ooo . I11iiIi11i1I
if 54 - 54: I11iiIi11i1I . i1 - IIiIIiIi11I1
if 99 - 99: i1I + i1I * Ooo0Ooo . OooOoo
if 33 - 33: i1i1i1111I / IiI11Ii111 + Ooo0Ooo % ooOOO
if 25 - 25: Iii1i
if 74 - 74: I11iiIi11i1I . ooo000 . I1I * i1iiIII111 * Ooo0Ooo
if 47 - 47: OooOoo
if 55 - 55: ooOOO % oOO + i1I - IiI11Ii111 + ooo000 + I1I
if 53 - 53: IIiIIiIi11I1 % IiIIii11Ii / oOO % ooOOO - oOo0O00
if 74 - 74: ooo000 * OooOoo * Oo
if 96 - 96: I1Ii1I1 - Oo
if 28 - 28: i1iiIII111 - IiI11Ii111 % Ii * ooo000 / Iii1i
if 12 - 12: IiI11Ii111 - Ooo0Ooo
if 12 - 12: ooOOO
if 29 - 29: IiI11Ii111 . ooo000 . ooo000
if 79 - 79: oOo0O00 % IiI11Ii111 * I1Ii1I1 . IIiIIiIi11I1 * Iii1i - I1I
if 85 - 85: I1I + IiI11Ii111 . I11iiIi11i1I % i1 * IiI11Ii111
if 22 - 22: IiIIii11Ii . Iii1i / i1i1i1111I / ooo000 + ooo000 + ooo000
if 76 - 76: Iii1i % i1i1i1111I
if 12 - 12: oOO + IiIIii11Ii % ooOOO + IiI11Ii111 / I1I
if 59 - 59: Iii1i % I1Ii1I1 + I11iiIi11i1I - Oo
if 72 - 72: I11iiIi11i1I
if 38 - 38: I11iiIi11i1I . oOO + i1I
if 33 - 33: ooo000 - IIiIIiIi11I1 % i1iiIII111 / iI1iII1I1I1i - Iii1i % IIiIIiIi11I1
if 15 - 15: ooo000 . i1 * i1
if 41 - 41: I11iiIi11i1I + Iii1i % ooOOO * i1
if 37 - 37: ooo000
if 87 - 87: i1i1i1111I + I1Ii1I1 % i1iiIII111 - I1I + ooOOO % I1Ii1I1
if 96 - 96: IIiIIiIi11I1 / I1I * i1 / I1I + I1I / i1
if 80 - 80: Oo / i1i1i1111I . IIiIIiIi11I1
if 79 - 79: oOO
if 6 - 6: IiI11Ii111 + IIiIIiIi11I1 + ooOOO % IIiIIiIi11I1
if 24 - 24: ooo000 + i1I / Ii / Ooo0Ooo % IIiIIiIi11I1
if 70 - 70: I11iiIi11i1I
if 45 - 45: I1Ii1I1 * Oo - I11iiIi11i1I * iI1iII1I1I1i
if 41 - 41: Iii1i . I1I * i1I - i1iiIII111 . IiI11Ii111 + ooOOO
if 24 - 24: i1 + IIiIIiIi11I1 + i1iiIII111 % I1Ii1I1 + IIiIIiIi11I1
if 55 - 55: IiIIii11Ii - IiIIii11Ii
if 52 - 52: I1Ii1I1 - OooOoo % i1I
if 88 - 88: ooOOO . i1
if 72 - 72: I1I - OooOoo / Iii1i - I1Ii1I1
if 54 - 54: I11iiIi11i1I / i1iiIII111 % oOo0O00 - ooOOO
if 72 - 72: ooo000 . I1Ii1I1 . I1I . IIiIIiIi11I1 + Oo
if 58 - 58: ooOOO + IiIIii11Ii + oOO % IiIIii11Ii + Ooo0Ooo . Oo
if 45 - 45: I1I % i1I % oOO * oOo0O00 / i1iiIII111 + I11iiIi11i1I
if 63 - 63: i1i1i1111I - IiI11Ii111 - iI1iII1I1I1i + OooOoo * i1iiIII111 / Ooo0Ooo
if 81 - 81: ooo000 % i1i1i1111I . i1iiIII111 / i1iiIII111 / i1iiIII111
if 84 - 84: ooOOO * ooo000 % ooOOO
if 57 - 57: i1I * iI1iII1I1I1i % Ooo0Ooo
if 22 - 22: OooOoo . i1
if 85 - 85: i1i1i1111I * I1Ii1I1 / ooo000
if 14 - 14: i1i1i1111I
if 61 - 61: Iii1i . I11iiIi11i1I - Oo . IiI11Ii111 + OooOoo
if 11 - 11: oOo0O00 - i1 / oOo0O00 * OooOoo - I11iiIi11i1I / I1Ii1I1
if 4 - 4: IiIIii11Ii
if 42 - 42: oOO - oOO + OooOoo - oOO
if 23 - 23: iI1iII1I1I1i % i1I * I11iiIi11i1I - oOO * oOo0O00
if 45 - 45: i1 % iI1iII1I1I1i . IiIIii11Ii + Ooo0Ooo
if 34 - 34: Iii1i + Iii1i
if 67 - 67: oOo0O00 + IIiIIiIi11I1
if 69 - 69: IIiIIiIi11I1
if 97 - 97: Iii1i + oOo0O00 - i1 % Iii1i
if 71 - 71: Ooo0Ooo / Ooo0Ooo % ooo000
if 32 - 32: ooo000 * ooo000
if 29 - 29: Ooo0Ooo . i1 * I11iiIi11i1I
if 98 - 98: ooOOO * oOO + Ooo0Ooo + i1i1i1111I / I1Ii1I1
if 18 - 18: iI1iII1I1I1i . iI1iII1I1I1i % ooOOO
if 90 - 90: I1I - Iii1i + Ii / Iii1i % I1Ii1I1
if 14 - 14: OooOoo + iI1iII1I1I1i * Iii1i
if 30 - 30: OooOoo
if 2 - 2: i1iiIII111 / oOo0O00 - IiIIii11Ii - iI1iII1I1I1i
if 90 - 90: i1iiIII111
if 11 - 11: ooOOO . ooo000
if 10 - 10: I1Ii1I1 - ooOOO / Iii1i - i1 . ooo000
if 99 - 99: Ii / iI1iII1I1I1i / Oo * I11iiIi11i1I
if 86 - 86: ooo000 - oOo0O00
if 42 - 42: Ii * oOO
if 67 - 67: ooOOO
if 62 - 62: I1I + Ii + I1I * i1 . Ooo0Ooo * i1iiIII111
if 2 - 2: i1I + Oo
if 51 - 51: Ii . i1I
if 89 - 89: IiI11Ii111 * IiIIii11Ii / i1 . I1Ii1I1
if 64 - 64: IiI11Ii111
if 44 - 44: Ii . OooOoo + oOO * OooOoo . i1 - i1iiIII111
if 72 - 72: iI1iII1I1I1i + I1I * ooo000 . OooOoo + Ii + IIiIIiIi11I1
if 91 - 91: oOo0O00 % IIiIIiIi11I1 % i1I / I1Ii1I1
if 70 - 70: iI1iII1I1I1i + IiI11Ii111 + oOO
if 21 - 21: I11iiIi11i1I
if 20 - 20: ooOOO + IiIIii11Ii % Iii1i - I11iiIi11i1I
if 49 - 49: Iii1i / IiIIii11Ii % i1 % i1i1i1111I + oOO * ooo000
if 25 - 25: IIiIIiIi11I1 * OooOoo % oOo0O00 % Ooo0Ooo + i1iiIII111
if 15 - 15: I11iiIi11i1I
if 85 - 85: Ii
if 17 - 17: I1I . Oo
if 63 - 63: Ii . i1I
if 83 - 83: IIiIIiIi11I1 * IiI11Ii111 % i1I * ooOOO
if 7 - 7: IiI11Ii111 / i1i1i1111I * Iii1i
if 27 - 27: i1i1i1111I - Ii - oOO + Ooo0Ooo * Ii + IiI11Ii111
if 35 - 35: i1i1i1111I . i1i1i1111I + I11iiIi11i1I / Oo . i1
def IIiIIIII1iiI ( doorDst , userDst , opMode , opMessage , controltimeseg = 1 ) :
 if 69 - 69: I1I / i1 % I1Ii1I1 % oOO
 if 96 - 96: Oo - i1I * iI1iII1I1I1i + Ooo0Ooo * Oo
 if 22 - 22: ooo000 % I11iiIi11i1I
 if 44 - 44: oOO / iI1iII1I1I1i % i1iiIII111 + i1iiIII111 % Ooo0Ooo + Ooo0Ooo
 if 93 - 93: i1 % oOO % I1I
 vwAppConfig . WriteLine ( "{}:  {} Start" . format ( opMode , opMessage ) )
 if 49 - 49: ooOOO * iI1iII1I1I1i + ooo000 - Ii . oOo0O00
 if 77 - 77: I11iiIi11i1I
 if 18 - 18: oOo0O00 . I1I / i1iiIII111
 if 3 - 3: oOO + oOO % i1I % Oo / iI1iII1I1I1i . IiIIii11Ii
 if 20 - 20: IiIIii11Ii + i1I
 if 32 - 32: oOo0O00 + i1i1i1111I
 if 74 - 74: I1I % i1i1i1111I * i1iiIII111 * IIiIIiIi11I1
 if 23 - 23: i1I * IiI11Ii111 . oOo0O00 * Ii
 if 94 - 94: i1i1i1111I - i1iiIII111 . Ooo0Ooo + Oo - i1
 if 96 - 96: Iii1i % ooo000 * oOo0O00 . Ii % oOO + i1I
 if 20 - 20: i1 % Ii / ooo000
 if 58 - 58: I11iiIi11i1I % i1 . oOo0O00 - OooOoo - OooOoo
 if 44 - 44: IIiIIiIi11I1
 if 74 - 74: oOO . ooOOO - ooo000 . Ooo0Ooo % OooOoo * OooOoo
 oO00o0000 = vwAppConfig . getStrFromArray ( doorDst )
 iIIo0O = vwAppConfig . getStrFromArray ( userDst )
 if 55 - 55: I1I + IiIIii11Ii + IiI11Ii111
 if 84 - 84: oOo0O00
 if 22 - 22: iI1iII1I1I1i % OooOoo % iI1iII1I1I1i
 if 6 - 6: IiIIii11Ii / OooOoo
 if 97 - 97: Oo . Ii * IiI11Ii111 / oOo0O00 / i1iiIII111 . Oo
 if 40 - 40: Iii1i - I1I + oOO * I1I
 II11i111iI = TBDoor . query . count ( )
 IIIII11 = TBConsumer . query . count ( )
 if 75 - 75: Ii % I1Ii1I1 + oOo0O00 . IiI11Ii111 / Ii + iI1iII1I1I1i
 if 84 - 84: i1i1i1111I
 O0OooO0OoO00 = ( II11i111iI == len ( doorDst ) )
 I11iii1I1 = ( IIIII11 == len ( userDst ) )
 if len ( userDst ) == 0 :
  I11iii1I1 = True
  if 92 - 92: Ii
  if 32 - 32: i1iiIII111 + ooo000 - I1Ii1I1 * IiIIii11Ii . IiIIii11Ii
  if 46 - 46: i1 + ooOOO % ooOOO . Iii1i - ooOOO % i1
  if 20 - 20: OooOoo - ooo000 . I11iiIi11i1I
  if 87 - 87: i1 * i1 - OooOoo % oOo0O00 - IiI11Ii111
  if 43 - 43: OooOoo % OooOoo / oOO % I1I
  if 18 - 18: I11iiIi11i1I * Ooo0Ooo / OooOoo
  if 84 - 84: i1iiIII111 / oOO . Oo % i1iiIII111 / OooOoo
  if 94 - 94: i1iiIII111
  if 53 - 53: iI1iII1I1I1i + ooOOO * I1I / Oo
  if 17 - 17: IiI11Ii111 . IiI11Ii111
  if 35 - 35: IiI11Ii111 % IiI11Ii111 / i1 / Iii1i * IiIIii11Ii
 if O0OooO0OoO00 and I11iii1I1 :
  if 11 - 11: OooOoo - IiI11Ii111 % IiIIii11Ii - ooo000 / IIiIIiIi11I1 - OooOoo
  iI111i11 = vwAppConfig . cleartable ( "t_d_Privilege" )
 else :
  if O0OooO0OoO00 :
   iI111i11 = "DELETE FROM  t_d_Privilege  WHERE f_ConsumerID IN ({})" . format ( iIIo0O )
  elif I11iii1I1 :
   iI111i11 = "DELETE FROM  t_d_Privilege  WHERE f_DoorID in ({})  " . format ( oO00o0000 )
  else :
   iI111i11 = "DELETE FROM  t_d_Privilege  WHERE f_ConsumerID IN ({}) and  f_DoorID in ({})  " . format ( iIIo0O ,
 oO00o0000 )
 db . session . execute ( text ( iI111i11 ) )
 db . session . commit ( )
 vwAppConfig . WriteLine ( "DELETE FROM  t_d_Privilege End" )
 if 21 - 21: Ii / Ooo0Ooo
 if opMode in ( 'btnAddPassAndUpload_Click' , 'btnAddPass_Click' ) :
  vwAppConfig . WriteLine ( "INSERT INTO t_d_Privilege Start" )
  iI111i11 = "INSERT INTO t_d_Privilege (f_ConsumerID, f_DoorID ,f_ControllerID, f_DoorNO, f_ControlSegID)"
  iI111i11 += " SELECT t_b_Consumer.f_ConsumerID, t_b_Door.f_DoorID, t_b_Door.f_ControllerID ,t_b_Door.f_DoorNO, " + str ( controltimeseg ) + " AS f_ControlSegID  "
  if 98 - 98: ooOOO
  iI111i11 += " FROM t_b_Consumer, t_b_Door "
  iI111i11 += " WHERE  t_b_Consumer.f_DoorEnabled=1 "
  if 53 - 53: I1I * I1I
  if not I11iii1I1 :
   iI111i11 += " AND f_ConsumerID IN (" + iIIo0O + " ) " ;
  if not O0OooO0OoO00 :
   iI111i11 += " AND   " + " f_DoorID IN (" + oO00o0000 + " ) " + " " ;
  db . session . execute ( text ( iI111i11 ) )
  db . session . commit ( )
  if 9 - 9: IiI11Ii111 - IIiIIiIi11I1
  vwAppConfig . WriteLine ( "INSERT INTO t_d_Privilege End" )
  if 89 - 89: i1 - ooo000 - Ii
  if 78 - 78: i1iiIII111 - IiI11Ii111 - i1I * oOO % Ii % I11iiIi11i1I
  if 14 - 14: Ii - I11iiIi11i1I / ooo000 % Ii
 if opMode not in ( 'btnAddPassAndUpload_Click' , 'btnDeletePassAndUpload_Click' ) :
  return True
 pass
 return True
 if 72 - 72: Ii % oOo0O00 / ooo000 - oOo0O00
 if 100 - 100: I1Ii1I1 - oOo0O00 - IiI11Ii111
 if 7 - 7: OooOoo % iI1iII1I1I1i - I11iiIi11i1I . I1Ii1I1 . oOO % OooOoo
 if 51 - 51: iI1iII1I1I1i + I1Ii1I1 . i1I - I1I
 if 59 - 59: ooOOO
 if 42 - 42: I1Ii1I1 * Oo * Oo . iI1iII1I1I1i * IiIIii11Ii * i1i1i1111I
 if 68 - 68: I11iiIi11i1I - I1Ii1I1 % oOO - Ii - i1iiIII111 / i1I
 if 85 - 85: OooOoo / I1Ii1I1
 if 99 - 99: Ooo0Ooo . oOo0O00 + iI1iII1I1I1i * I1Ii1I1 + OooOoo . I1I
 if 1 - 1: Iii1i + IIiIIiIi11I1 - oOO - IiI11Ii111 . IIiIIiIi11I1
 if 31 - 31: IIiIIiIi11I1 % iI1iII1I1I1i
 if 53 - 53: IiI11Ii111 . Iii1i % oOO / ooOOO
 if 80 - 80: I1I % I1Ii1I1 . Ii / IiIIii11Ii * OooOoo . Ii
 if 86 - 86: oOo0O00 % i1i1i1111I + Oo . I1Ii1I1 - I1Ii1I1
 if 87 - 87: IiI11Ii111 % oOO % I1Ii1I1
 if 59 - 59: IiIIii11Ii % i1i1i1111I . i1iiIII111 + ooo000 + Ooo0Ooo . oOO
 if 9 - 9: OooOoo - ooOOO . i1iiIII111
 if 68 - 68: I1I % I1I * Ii % Oo
 if 74 - 74: I11iiIi11i1I * IIiIIiIi11I1 . IiI11Ii111 * oOo0O00 * IiI11Ii111 - i1iiIII111
 if 34 - 34: IiI11Ii111 % OooOoo + i1I % I11iiIi11i1I - IIiIIiIi11I1
 if 64 - 64: i1 % oOo0O00
 if 25 - 25: Oo
 if 4 - 4: Oo * I1I * Ooo0Ooo % Ooo0Ooo
 if 6 - 6: oOO + I1I * Iii1i
 if 82 - 82: oOo0O00 * ooOOO
 if 9 - 9: I11iiIi11i1I + i1iiIII111 % Iii1i
 if 15 - 15: i1iiIII111 + i1I - Iii1i % I1I / i1iiIII111 + IIiIIiIi11I1
 if 61 - 61: OooOoo
 if 62 - 62: iI1iII1I1I1i * oOO
 if 43 - 43: Ii - oOo0O00 % i1iiIII111 % oOO
 if 69 - 69: I1I
 if 74 - 74: IiIIii11Ii + OooOoo . Iii1i + ooo000 + oOO * I1Ii1I1
 if 74 - 74: I1Ii1I1 - Oo % i1iiIII111 + Ii * ooOOO
 if 53 - 53: IIiIIiIi11I1
 if 31 - 31: oOo0O00 - I11iiIi11i1I / oOo0O00
 if 23 - 23: IiIIii11Ii
 if 5 - 5: iI1iII1I1I1i . I11iiIi11i1I
 if 4 - 4: OooOoo % i1iiIII111 / I11iiIi11i1I - oOo0O00
 if 100 - 100: Oo / OooOoo % I1I
 if 93 - 93: iI1iII1I1I1i
 if 50 - 50: Oo % oOo0O00 . IiI11Ii111 . i1iiIII111 . Ii - Oo
 if 67 - 67: oOo0O00 * i1I . I1I + I1I + oOo0O00 / ooOOO
 if 69 - 69: Oo - OooOoo + I1Ii1I1
 if 36 - 36: Iii1i
 if 80 - 80: Oo % oOO / oOO + ooOOO + OooOoo
 if 91 - 91: i1 % i1i1i1111I / oOo0O00
 if 79 - 79: iI1iII1I1I1i % OooOoo . Iii1i
 if 61 - 61: Oo . Ii - Ooo0Ooo . I1Ii1I1 - IiI11Ii111 * i1I
 if 81 - 81: iI1iII1I1I1i * IiIIii11Ii % i1iiIII111 + oOO / iI1iII1I1I1i . i1I
 if 17 - 17: iI1iII1I1I1i
 if 13 - 13: iI1iII1I1I1i + i1 - OooOoo / IiI11Ii111
 if 34 - 34: I1Ii1I1 - i1iiIII111 * i1iiIII111
 if 59 - 59: i1i1i1111I . Oo - IIiIIiIi11I1 + iI1iII1I1I1i
 if 22 - 22: IiI11Ii111 + OooOoo % I11iiIi11i1I
 if 14 - 14: Oo * oOO + i1i1i1111I * oOo0O00
 if 69 - 69: i1I - i1 - i1 % oOO
 if 21 - 21: i1i1i1111I - I1I + i1I * Ooo0Ooo
 if 56 - 56: oOO + i1 * i1i1i1111I / i1I * IIiIIiIi11I1
 if 15 - 15: iI1iII1I1I1i % oOO + iI1iII1I1I1i . oOo0O00 / ooo000
 if 9 - 9: IiI11Ii111 . i1iiIII111 - Ii - I1I . OooOoo
 if 75 - 75: OooOoo . OooOoo * oOO - ooo000 + i1I % iI1iII1I1I1i
 if 26 - 26: i1iiIII111 * oOo0O00
 if 73 - 73: Ooo0Ooo + IiIIii11Ii * i1I . IiI11Ii111 . ooo000 % OooOoo
 if 38 - 38: IiIIii11Ii
 if 71 - 71: Iii1i
 if 91 - 91: Oo + Iii1i + Ooo0Ooo / i1I * ooo000
 if 81 - 81: ooo000 * ooo000 - Ooo0Ooo
 if 70 - 70: I1Ii1I1 * IIiIIiIi11I1
 if 18 - 18: ooo000 % IiIIii11Ii
 if 54 - 54: OooOoo + OooOoo
 if 2 - 2: Iii1i
 if 19 - 19: Ooo0Ooo - i1i1i1111I / Ooo0Ooo / IiI11Ii111 - IiI11Ii111 - I1Ii1I1
 if 59 - 59: oOO - ooo000 - i1 + Ooo0Ooo / IiI11Ii111
 if 1 - 1: i1 - I11iiIi11i1I * Ooo0Ooo + i1I % IiIIii11Ii
 if 5 - 5: i1I
 if 62 - 62: Oo + IIiIIiIi11I1 % i1i1i1111I * I11iiIi11i1I / iI1iII1I1I1i + I11iiIi11i1I
 if 11 - 11: i1i1i1111I % IIiIIiIi11I1 / i1i1i1111I * oOO * i1I
 if 40 - 40: i1iiIII111 . Iii1i % iI1iII1I1I1i - IIiIIiIi11I1 % i1I
 if 94 - 94: IiIIii11Ii - oOo0O00 + I1Ii1I1
 if 5 - 5: oOo0O00 % i1I * Ii + IIiIIiIi11I1 * I1Ii1I1 % i1I
 if 7 - 7: IiI11Ii111 + oOo0O00 . i1i1i1111I - I11iiIi11i1I / ooOOO . ooOOO
 if 17 - 17: ooOOO + Iii1i + Oo * I1Ii1I1 % i1I
 if 95 - 95: iI1iII1I1I1i * IiIIii11Ii
 if 23 - 23: i1 * I1Ii1I1 - I11iiIi11i1I
 if 5 - 5: OooOoo . OooOoo % IIiIIiIi11I1
 if 97 - 97: i1 - iI1iII1I1I1i * I1Ii1I1 * I1I
 if 74 - 74: Ii + ooOOO * Ii . iI1iII1I1I1i / IIiIIiIi11I1 - oOo0O00
 if 61 - 61: i1 % ooo000 - ooOOO - I11iiIi11i1I / Iii1i - oOo0O00
 if 58 - 58: i1iiIII111 * Ii % oOO . IiIIii11Ii
 if 56 - 56: ooOOO * ooOOO + Oo + i1I + ooo000
 if 60 - 60: i1 * i1I * I11iiIi11i1I / I1Ii1I1 + oOO + Iii1i
 if 87 - 87: i1i1i1111I
 if 2 - 2: I11iiIi11i1I . iI1iII1I1I1i . i1 + oOo0O00
 if 33 - 33: Iii1i . IiI11Ii111
 if 12 - 12: IiI11Ii111
 if 85 - 85: Oo % Oo
 if 12 - 12: ooo000 / i1I * Oo / I1Ii1I1 * ooOOO
 if 38 - 38: i1i1i1111I * iI1iII1I1I1i * Ooo0Ooo + i1iiIII111
 if 33 - 33: ooOOO . Ii
 if 49 - 49: Ii + ooOOO + iI1iII1I1I1i / i1i1i1111I
 if 63 - 63: ooo000 % I1Ii1I1
 if 83 - 83: OooOoo . Ooo0Ooo % IiI11Ii111 / Oo
 if 57 - 57: Oo + i1i1i1111I . i1I . ooOOO * Iii1i - IIiIIiIi11I1
 if 20 - 20: Iii1i * ooo000 . OooOoo + i1iiIII111 * i1I - Iii1i
 if 66 - 66: IIiIIiIi11I1 - ooo000 - i1i1i1111I * i1 % ooo000 . IIiIIiIi11I1
 if 16 - 16: IiIIii11Ii % oOo0O00 + Ii - i1i1i1111I * IiIIii11Ii
 if 69 - 69: iI1iII1I1I1i . I1I + I1Ii1I1
 if 71 - 71: ooo000
 if 85 - 85: ooo000 + Oo
 if 81 - 81: IIiIIiIi11I1 + iI1iII1I1I1i . I1I * Ii / Iii1i / i1I
 if 31 - 31: i1i1i1111I - oOo0O00 % oOO - iI1iII1I1I1i
 if 3 - 3: i1iiIII111
 if 8 - 8: Ii * Oo - I1I
 if 84 - 84: iI1iII1I1I1i % oOO * i1I / i1i1i1111I / OooOoo . IIiIIiIi11I1
 if 84 - 84: IIiIIiIi11I1
 if 80 - 80: i1
 if 90 - 90: Iii1i / Ii / Oo + IiI11Ii111 - i1I / i1i1i1111I
 if 14 - 14: IIiIIiIi11I1
 if 77 - 77: i1i1i1111I / Ooo0Ooo / ooo000 + Oo + i1I
 if 70 - 70: I1I + Ii
 if 76 - 76: i1i1i1111I + Oo
 if 36 - 36: I1Ii1I1 - IiIIii11Ii
 if 71 - 71: i1 - i1I
 if 6 - 6: IiI11Ii111 . ooo000
 if 100 - 100: IIiIIiIi11I1 . i1i1i1111I
 if 1 - 1: I1Ii1I1
 if 12 - 12: i1I * Ooo0Ooo + IIiIIiIi11I1 * OooOoo * OooOoo / ooOOO
 if 67 - 67: i1 - IiI11Ii111 / Ii * IiI11Ii111
 if 24 - 24: IiI11Ii111 - oOo0O00 . Ooo0Ooo + oOO . I1I / Oo
 if 68 - 68: IiI11Ii111
 if 47 - 47: i1 % I1I - Ii + Oo / OooOoo
 if 88 - 88: I1Ii1I1 - Ii / IiIIii11Ii . oOo0O00
 if 27 - 27: i1iiIII111 + iI1iII1I1I1i % Oo . Ii
 if 69 - 69: Iii1i / IIiIIiIi11I1
 if 66 - 66: i1i1i1111I
 if 31 - 31: i1I - i1iiIII111 % I1I - i1iiIII111 * Oo / i1iiIII111
 if 30 - 30: i1
 if 95 - 95: ooo000 / i1i1i1111I / i1I - IIiIIiIi11I1
 if 7 - 7: I1I / iI1iII1I1I1i % ooo000 / IiIIii11Ii
 if 18 - 18: I1I * IiIIii11Ii * I1I + i1iiIII111
 if 17 - 17: i1I
 if 8 - 8: Oo / iI1iII1I1I1i - Ooo0Ooo
def i1IIi ( ) :
 II1i1 = WGControllerPri2023 ( )
 OOOO0O0ooO0O = db . session . query ( TBController . f_ControllerSN ) . filter ( TBController . f_Enabled >= 1 ) . order_by (
 TBController . f_ControllerSN )
 OO = OOOO0O0ooO0O . all ( )
 if 79 - 79: oOO % i1
 IIi1IIIi1I = "uploadClearPrivilege"
 for iI1i1i1 in OO :
  Iio0OO0oOO = iI1i1i1 . f_ControllerSN
  ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "PrivilegeClear" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO
 }
 ] ,
 "id" : 4004
 } )
  i1Ii1I111 = threading . Thread ( target = Ii1IiI1I1 , args = ( Iio0OO0oOO , ii11IiiIIi , II1i1 ) )
  i1Ii1I111 . start ( )
  if 82 - 82: i1i1i1111I
 OoOOO0000o = time . time ( ) + 10
 while time . time ( ) < OoOOO0000o :
  if len ( II1i1 . uploadedSNOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) :
   break
  time . sleep ( 0.1 )
 return { "updateConOK" : II1i1 . uploadedSNOK , "updateConFailed" : II1i1 . uploadedSNFailed }
 if 88 - 88: IiI11Ii111
 if 43 - 43: I11iiIi11i1I . IiIIii11Ii * Oo . IiIIii11Ii - IiI11Ii111 - Ii
def uploadDeletePrivilegeByThread ( cardNO ) :
 II1i1 = WGControllerPri2023 ( )
 if 47 - 47: oOO / i1i1i1111I * oOO
 OOOO0O0ooO0O = db . session . query ( distinct ( TBController . f_ControllerSN ) ) . join ( TDPrivilege ,
 TBController . f_ControllerID == TDPrivilege . f_ControllerID ) . filter (
 TBController . f_Enabled >= 1 ) . order_by (
 TBController . f_ControllerSN )
 OO = OOOO0O0ooO0O . all ( )
 if OO is None :
  return { "updateConOK" : [ ] , "updateConFailed" : [ ] }
 IIi1IIIi1I = "uploadDeletePrivilege"
 for iI1i1i1 in OO :
  Iio0OO0oOO = iI1i1i1 [ 0 ]
  ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "DeletePrivilege" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO ,
 "Privilege" : [ { "CardNO" : [ cardNO ] } ]
 }
 ] ,
 "id" : 4002
 } )
  i1Ii1I111 = threading . Thread ( target = Ii1IiI1I1 , args = ( Iio0OO0oOO , ii11IiiIIi , II1i1 ) )
  i1Ii1I111 . start ( )
  if 91 - 91: i1iiIII111 / i1
  if 70 - 70: IIiIIiIi11I1
 OoOOO0000o = time . time ( ) + 3
 while time . time ( ) < OoOOO0000o :
  if len ( II1i1 . uploadedSNOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) :
   break
  time . sleep ( 0.1 )
 return { "updateConOK" : II1i1 . uploadedSNOK , "updateConFailed" : II1i1 . uploadedSNFailed }
 if 95 - 95: I1I * i1 * IiIIii11Ii + I11iiIi11i1I + Ooo0Ooo
 if 36 - 36: i1i1i1111I
 if 48 - 48: IIiIIiIi11I1 - I11iiIi11i1I % Oo
 if 61 - 61: oOO % iI1iII1I1I1i + IiIIii11Ii % i1i1i1111I * iI1iII1I1I1i / i1i1i1111I
 if 11 - 11: oOo0O00 / Oo . ooOOO / Oo
 if 90 - 90: OooOoo - I1I
 if 67 - 67: oOo0O00 . oOO - IIiIIiIi11I1 / Ooo0Ooo + Iii1i - oOo0O00
 if 25 - 25: Iii1i
 if 30 - 30: i1iiIII111 * i1I - i1iiIII111 + i1I - I11iiIi11i1I
def O0oOoO ( buploadAll , conid , userDst , sn , maxprilen , selectedCardNO ,
 wgcondata ) :
 if buploadAll :
  OOOO0O0ooO0O = db . session . query ( TBConsumer . f_CardNO , TBFloor . f_FloorNO ,
 TBUserfloor . f_ControlSegID ,
 TBConsumer . f_BeginYMD , TBConsumer . f_EndYMD ,
 TBConsumer . f_PIN , TBConsumer . f_ConsumerID , TBDoor . f_DoorID ,
 TBController . f_ControllerID ) . join (
 TBFloor , TBUserfloor . f_FloorId == TBFloor . f_FloorId ) . join (
 TBDoor , TBFloor . f_DoorID == TBDoor . f_DoorID ) . join (
 TBController , TBController . f_ControllerID == TBDoor . f_ControllerID ) . join (
 TBConsumer , TBUserfloor . f_ConsumerID == TBConsumer . f_ConsumerID ) . filter (
 TBConsumer . f_CardNO . isnot ( None ) ) . filter ( TBController . f_ControllerID == conid ) . order_by (
 TBConsumer . f_CardNO )
  OO = OOOO0O0ooO0O . all ( )
 else :
  if 30 - 30: oOo0O00 + OooOoo . oOo0O00 + iI1iII1I1I1i
  if 22 - 22: oOO / I1Ii1I1 + OooOoo / i1 / Oo
  if 6 - 6: OooOoo % ooOOO - IiIIii11Ii
  if 24 - 24: Ii % i1iiIII111
  if 45 - 45: iI1iII1I1I1i + oOO
  if 21 - 21: Oo + ooo000 . OooOoo - i1iiIII111 - OooOoo
  if 1 - 1: I11iiIi11i1I % oOo0O00 + oOo0O00 - OooOoo % iI1iII1I1I1i % i1iiIII111
  if 89 - 89: IIiIIiIi11I1
  if 6 - 6: oOO * Oo
  if 40 - 40: ooo000
  if 80 - 80: IiIIii11Ii - i1i1i1111I
  if 42 - 42: IiI11Ii111
  if 83 - 83: I11iiIi11i1I % i1
  if 99 - 99: Iii1i / oOO . iI1iII1I1I1i
  III11 = [ ]
  if 66 - 66: IiIIii11Ii
  if 51 - 51: Ooo0Ooo * IiIIii11Ii
  if 50 - 50: oOo0O00 . IiIIii11Ii + oOo0O00
  o0O0O = userDst
  O0O0 = vwAppConfigParam . sql_in_batch_size
  if 54 - 54: IiI11Ii111 % i1i1i1111I
  for iI1Ii1 in range ( 0 , len ( o0O0O ) , O0O0 ) :
   oO = o0O0O [ iI1Ii1 : iI1Ii1 + O0O0 ]
   OOOO0O0ooO0O = db . session . query ( TBConsumer . f_CardNO , TBFloor . f_FloorNO ,
 TBUserfloor . f_ControlSegID ,
 TBConsumer . f_BeginYMD , TBConsumer . f_EndYMD ,
 TBConsumer . f_PIN , TBConsumer . f_ConsumerID , TBDoor . f_DoorID ,
 TBController . f_ControllerID ) . filter (
 TBUserfloor . f_ConsumerID . in_ ( oO ) ) . join (
 TBFloor , TBUserfloor . f_FloorId == TBFloor . f_FloorId ) . join (
 TBDoor , TBFloor . f_DoorID == TBDoor . f_DoorID ) . join (
 TBController , TBController . f_ControllerID == TBDoor . f_ControllerID ) . join (
 TBConsumer , TBUserfloor . f_ConsumerID == TBConsumer . f_ConsumerID ) . filter (
 TBConsumer . f_CardNO . isnot ( None ) ) . filter ( TBController . f_ControllerID == conid ) . order_by (
 TBConsumer . f_CardNO )
   O0O0iII1 = OOOO0O0ooO0O . all ( )
   III11 . extend ( O0O0iII1 )
  OO = III11
  if 63 - 63: oOo0O00
  if 75 - 75: oOO - iI1iII1I1I1i * i1
 IIi1IIIi1I = "uploadEditPrivilege"
 if 4 - 4: OooOoo
 O0Oo00OOoO00 = [ ]
 iIIII1II11I1iI = [ ]
 I1ii , OoOooOOO0OoOO , iii1i1II1II1 = 0 , None , None
 o0Oooo0OOO = [ 0 , 0 , 0 , 0 ]
 Oooo = [ 0 , 0 , 0 , 0 ]
 if 65 - 65: oOO / IiI11Ii111
 if 89 - 89: oOO % Oo * iI1iII1I1I1i - Oo . OooOoo
 II1IiI1 = 0
 oOo0ooo0o0oOo = 1
 iI1 = [ ]
 if len ( OO ) > 0 :
  for iI1i1i1 in OO :
   if I1ii != iI1i1i1 . f_CardNO :
    if I1ii > 0 :
     iIIII1II11I1iI . append ( I1ii )
     iI = {
 "CardNO" : [
 I1ii
 ] ,
 "BeginDateTime" : OoOooOOO0OoOO ,
 "EndDateTime" : iii1i1II1II1 ,
 "Door1TimeProfileID" : oOo0ooo0o0oOo ,
 "AllowFloorsNO" : iI1 ,
 "UserPassword" : II1IiI1
 }
     if 97 - 97: I1I . Ii . I11iiIi11i1I * i1I
     if 8 - 8: ooOOO . i1i1i1111I . Iii1i + Oo
     O0Oo00OOoO00 . append ( iI )
     iI1 . clear ( )
     if 16 - 16: i1I / I1Ii1I1 / IiIIii11Ii * i1i1i1111I . OooOoo
    I1ii = iI1i1i1 . f_CardNO
    II1IiI1 = iI1i1i1 . f_PIN
    if 96 - 96: IiIIii11Ii % I1Ii1I1 + I11iiIi11i1I
    if 100 - 100: i1 % i1I % Oo . Iii1i % I1I % I1I
    if 37 - 37: Iii1i % Oo
    if 28 - 28: IIiIIiIi11I1 * i1I + iI1iII1I1I1i / Oo * I1Ii1I1
    OoOooOOO0OoOO = vwAppConfig . getStrOfDatetime ( vwAppConfig . strtotime ( iI1i1i1 . f_BeginYMD ) )
    iii1i1II1II1 = vwAppConfig . getStrOfDatetime ( vwAppConfig . strtotime ( iI1i1i1 . f_EndYMD ) )
    if 46 - 46: I1I - i1 % Oo - i1iiIII111
    if 16 - 16: I11iiIi11i1I . IIiIIiIi11I1 / oOo0O00 + oOO
   oOo0ooo0o0oOo = iI1i1i1 . f_ControlSegID
   iI1 . append ( iI1i1i1 . f_FloorNO )
   if not vwAppConfigParam . extfunc5678_timeprofile > 0 :
    if oOo0ooo0o0oOo > 1 :
     oOo0ooo0o0oOo = 1
     if 93 - 93: i1i1i1111I
     if 42 - 42: ooo000 . iI1iII1I1I1i + oOo0O00 % iI1iII1I1I1i
     if 29 - 29: oOo0O00 - I1I - IIiIIiIi11I1 . IiIIii11Ii * I1Ii1I1
     if 2 - 2: Oo - iI1iII1I1I1i - i1i1i1111I % OooOoo . ooo000 - i1I
     if 14 - 14: i1i1i1111I / I1I + I1I + ooo000 % i1 . Ooo0Ooo
     if 93 - 93: i1I + ooOOO % ooo000 * IiIIii11Ii
     if 61 - 61: ooo000 % I11iiIi11i1I - OooOoo + Oo - ooOOO . IIiIIiIi11I1
     if 64 - 64: OooOoo * Iii1i
     if 13 - 13: i1i1i1111I . Iii1i - ooo000 / i1iiIII111 % oOo0O00 / IiI11Ii111
  if sn > 0 :
   iIIII1II11I1iI . append ( I1ii )
   iI = {
 "CardNO" : [
 I1ii
 ] ,
 "BeginDateTime" : OoOooOOO0OoOO ,
 "EndDateTime" : iii1i1II1II1 ,
 "Door1TimeProfileID" : oOo0ooo0o0oOo ,
 "AllowFloorsNO" : iI1 ,
 "UserPassword" : II1IiI1
 }
   if 80 - 80: i1i1i1111I
   if 85 - 85: iI1iII1I1I1i - oOo0O00 / IIiIIiIi11I1 * I11iiIi11i1I - ooOOO
   O0Oo00OOoO00 . append ( iI )
   if 70 - 70: oOO % Ii . Ooo0Ooo
   if buploadAll :
    ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "UploadAllPrivileges" ,
 "params" : [
 {
 "ControllerSN" : sn ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4004
 } )
   else :
    ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "AddEditPrivilege" ,
 "params" : [
 {
 "ControllerSN" : sn ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4001
 } )
   if maxprilen < len ( O0Oo00OOoO00 ) :
    maxprilen = len ( O0Oo00OOoO00 )
    if 16 - 16: i1iiIII111 - iI1iII1I1I1i - Ii - Ii
   i1Ii1I111 = threading . Thread ( target = IiIIiI1IIi11I ,
 args = ( sn , ii11IiiIIi , len ( O0Oo00OOoO00 ) , wgcondata ) )
   i1Ii1I111 . start ( )
   if 85 - 85: oOO * IIiIIiIi11I1 % oOO - I11iiIi11i1I / Ii
   if 51 - 51: i1I - IiI11Ii111 - IiIIii11Ii
   if len ( selectedCardNO ) > len ( iIIII1II11I1iI ) and not buploadAll :
    if 99 - 99: Ii + i1I . Ii
    O0Oo00OOoO00 . clear ( )
    if 17 - 17: i1I + i1iiIII111 . ooo000
    for i1iI1i in selectedCardNO :
     if i1iI1i . f_CardNO not in iIIII1II11I1iI :
      O0Oo00OOoO00 . append ( {
 "CardNO" : [
 i1iI1i . f_CardNO
 ] ,
 } )
    ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "DeletePrivilege" ,
 "params" : [
 {
 "ControllerSN" : sn ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4002
 } )
    wgcondata . uploadedSN_Delete . append ( sn )
    if maxprilen < len ( O0Oo00OOoO00 ) :
     maxprilen = len ( O0Oo00OOoO00 )
    i1Ii1I111 = threading . Thread ( target = IIIIi1i ,
 args = ( sn , ii11IiiIIi , len ( O0Oo00OOoO00 ) , wgcondata ) )
    i1Ii1I111 . start ( )
 else :
  wgcondata . uploadedSNOK . append ( sn )
  if ( buploadAll ) :
   ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "PrivilegeClear" ,
 "params" : [
 {
 "ControllerSN" : sn
 }
 ] ,
 "id" : 4004
 } )
   wgcondata . uploadedSN_Delete . append ( sn )
   if maxprilen < len ( O0Oo00OOoO00 ) :
    maxprilen = len ( O0Oo00OOoO00 )
   i1Ii1I111 = threading . Thread ( target = IIIIi1i ,
 args = ( sn , ii11IiiIIi , len ( O0Oo00OOoO00 ) , wgcondata ) )
   i1Ii1I111 . start ( )
  if len ( selectedCardNO ) > 0 and not buploadAll :
   if 32 - 32: oOo0O00 * i1I
   O0Oo00OOoO00 . clear ( )
   for i1iI1i in selectedCardNO :
    O0Oo00OOoO00 . append ( {
 "CardNO" : [
 i1iI1i . f_CardNO
 ] ,
 } )
   ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "DeletePrivilege" ,
 "params" : [
 {
 "ControllerSN" : sn ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4002
 } )
   wgcondata . uploadedSN_Delete . append ( sn )
   if maxprilen < len ( O0Oo00OOoO00 ) :
    maxprilen = len ( O0Oo00OOoO00 )
   i1Ii1I111 = threading . Thread ( target = IIIIi1i ,
 args = ( sn , ii11IiiIIi , len ( O0Oo00OOoO00 ) , wgcondata ) )
   i1Ii1I111 . start ( )
   if 11 - 11: oOo0O00 . i1iiIII111 . Iii1i / i1iiIII111 % iI1iII1I1I1i . Ooo0Ooo
   if 73 - 73: ooOOO - IIiIIiIi11I1 . Iii1i % ooo000 + i1I
def OoOo00oOO00 ( userDst ) :
 if 44 - 44: oOo0O00 % IiIIii11Ii
 if 56 - 56: i1i1i1111I - oOO
 IiI1Ii = [ ]
 try :
  if 80 - 80: i1I . i1I . ooOOO + i1I . IIiIIiIi11I1 % Ooo0Ooo
  if 27 - 27: oOo0O00 . oOo0O00 % Ooo0Ooo
  if 85 - 85: I1I + ooo000 - IiI11Ii111 + iI1iII1I1I1i % oOO
  if 24 - 24: I11iiIi11i1I
  III11 = [ ]
  if 24 - 24: I1I - iI1iII1I1I1i * oOO + Ooo0Ooo % i1I
  if 94 - 94: I11iiIi11i1I . IiIIii11Ii / OooOoo - OooOoo / oOo0O00 * Ooo0Ooo
  if 53 - 53: I1I . ooOOO - oOo0O00
  o0O0O = userDst
  O0O0 = vwAppConfigParam . sql_in_batch_size
  if 83 - 83: IiI11Ii111 + i1
  for iI1Ii1 in range ( 0 , len ( o0O0O ) , O0O0 ) :
   oO = o0O0O [ iI1Ii1 : iI1Ii1 + O0O0 ]
   OOOO0O0ooO0O = db . session . query ( TBConsumer . f_CardNO ) . filter ( TBConsumer . f_CardNO . isnot ( None ) ) . filter (
 TBConsumer . f_ConsumerID . in_ ( oO ) )
   O0O0iII1 = OOOO0O0ooO0O . all ( )
   III11 . extend ( O0O0iII1 )
  IiI1Ii = III11
 except Exception as ooo :
  print ( ooo )
  pass
  if 4 - 4: iI1iII1I1I1i + IIiIIiIi11I1
 return IiI1Ii
 if 72 - 72: Ii - I1Ii1I1 / OooOoo + Iii1i
 if 34 - 34: oOO * Ii / IIiIIiIi11I1
 if 3 - 3: i1i1i1111I
 if 41 - 41: i1i1i1111I + IiIIii11Ii - i1i1i1111I * OooOoo - i1
def IIiI1i ( doorDst , userDst , opMode , bUploadAllUser = False , needupateControllers = None ) :
 print ( "uploadSelectedPrivilege" )
 II1i1 = WGControllerPri2023 ( )
 i111IIii1i = [ ]
 if needupateControllers :
  i111IIii1i = needupateControllers
  if 99 - 99: i1I + ooo000 * i1
 oO00o0000 = ""
 for i1iI1i in doorDst :
  oO00o0000 += str ( i1iI1i ) + ","
 oO00o0000 += '0'
 if 55 - 55: Oo / I1Ii1I1
 if 28 - 28: Ooo0Ooo - i1I + Ii
 if 63 - 63: Oo + oOO + IIiIIiIi11I1 - i1 * ooOOO
 if 19 - 19: IiIIii11Ii - Iii1i + IiI11Ii111
 if 5 - 5: Ii * i1 * oOO + oOo0O00 - IiIIii11Ii * Oo
 if 69 - 69: ooo000 - Iii1i
 I11iii1I1 = False
 if bUploadAllUser :
  I11iii1I1 = True
 else :
  IIIII11 = TBConsumer . query . count ( )
  I11iii1I1 = ( IIIII11 == len ( userDst ) )
  if 51 - 51: i1i1i1111I + oOo0O00 / I1I
  if 21 - 21: i1iiIII111 * Ooo0Ooo * ooOOO . i1i1i1111I
  if 100 - 100: Ooo0Ooo - Ooo0Ooo + I1Ii1I1 . ooOOO
  if 65 - 65: IiIIii11Ii
  if 54 - 54: oOO * i1iiIII111 * Iii1i - I1Ii1I1 . iI1iII1I1I1i
  if 83 - 83: ooo000 . I1I
  if 81 - 81: i1I + Oo . I1Ii1I1
  if 32 - 32: OooOoo * Ooo0Ooo % iI1iII1I1I1i + OooOoo - ooOOO
  if 23 - 23: i1iiIII111 % I1I + Ooo0Ooo . I1Ii1I1 + ooo000 - i1I
  if 29 - 29: Iii1i
  if 72 - 72: i1 % iI1iII1I1I1i . ooOOO / I1Ii1I1 * ooo000 . IiI11Ii111
  if 55 - 55: OooOoo + IiIIii11Ii . i1I / Iii1i . I11iiIi11i1I
  if 56 - 56: IIiIIiIi11I1 * i1 . I1I * I1I
  if 35 - 35: IIiIIiIi11I1 * OooOoo - Ooo0Ooo
 if I11iii1I1 :
  IiI1Ii = [ ]
 else :
  IiI1Ii = OoOo00oOO00 ( userDst )
  if 27 - 27: oOo0O00 / I1I * I1Ii1I1 - OooOoo - Iii1i
  if 38 - 38: IiI11Ii111 / i1 - IiIIii11Ii
  if 75 - 75: iI1iII1I1I1i * Iii1i . OooOoo - ooo000 + I1I * ooo000
  if 91 - 91: IiI11Ii111 * i1i1i1111I + oOO . Ii
 OOOO0O0ooO0O = db . session . query ( TBController . f_ControllerID , TBController . f_ControllerSN ) . join ( TBDoor ,
 TBDoor . f_ControllerID == TBController . f_ControllerID ) . filter (
 TBDoor . f_DoorID . in_ ( doorDst ) )
 OO = OOOO0O0ooO0O . all ( )
 for i1iI1i in OO :
  Iio0OO0oOO = i1iI1i . f_ControllerSN
  if Iio0OO0oOO not in II1i1 . uploadedSN :
   III11i11III = i1iI1i . f_ControllerID
   II1i1 . uploadedSN . append ( Iio0OO0oOO )
   i1Ii1I111 = threading . Thread ( target = oo0oOo0OOO , args = ( Iio0OO0oOO , III11i11III , II1i1 ) )
   i1Ii1I111 . start ( )
 if len ( i111IIii1i ) > 0 :
  OO = TBController . query . all ( )
  for i1iI1i in OO :
   if i1iI1i . f_ControllerID in i111IIii1i :
    Iio0OO0oOO = i1iI1i . f_ControllerSN
    if Iio0OO0oOO not in II1i1 . uploadedSN :
     III11i11III = i1iI1i . f_ControllerID
     II1i1 . uploadedSN . append ( Iio0OO0oOO )
     i1Ii1I111 = threading . Thread ( target = oo0oOo0OOO , args = ( Iio0OO0oOO , III11i11III , II1i1 ) )
     i1Ii1I111 . start ( )
 i11IiIi = time . time ( )
 while time . time ( ) < i11IiIi + 10 :
  if len ( II1i1 . uploadedSNConnectedOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) :
   break
  time . sleep ( 0.1 )
 print ( "uploadedSNConnectedOK" )
 print ( II1i1 . uploadedSNConnectedOK )
 oOO0 = 0
 OO0O0O = False
 if len ( userDst ) > 10 :
  OO0O0O = True
 if bUploadAllUser :
  OO0O0O = True
 if len ( II1i1 . uploadedSNConnectedOK ) > 0 :
  for o0Oo000 in range ( len ( II1i1 . uploadedSNConnectedOK ) ) :
   III11i11III = II1i1 . uploadedIdConnectedOK [ o0Oo000 ]
   Iio0OO0oOO = II1i1 . uploadedSNConnectedOK [ o0Oo000 ]
   if vwAppConfig . checkElevator ( Iio0OO0oOO ) :
    O0oOoO ( OO0O0O , III11i11III , userDst , Iio0OO0oOO , oOO0 , IiI1Ii , II1i1 )
    continue
   if OO0O0O :
    OOOO0O0ooO0O = db . session . query ( TBConsumer . f_CardNO , TDPrivilege . f_DoorNO ,
 TDPrivilege . f_ControlSegID ,
 TBConsumer . f_BeginYMD , TBConsumer . f_EndYMD ,
 TBConsumer . f_PIN , TBConsumer . f_ConsumerID , TDPrivilege . f_DoorID ) . join (
 TBConsumer , TDPrivilege . f_ConsumerID == TBConsumer . f_ConsumerID ) . filter (
 TBConsumer . f_CardNO . isnot ( None ) ) . filter ( TDPrivilege . f_ControllerID == III11i11III ) . order_by (
 TBConsumer . f_CardNO )
    OO = OOOO0O0ooO0O . all ( )
   else :
    if 57 - 57: I1I
    if 20 - 20: i1
    if 24 - 24: IIiIIiIi11I1
    if 34 - 34: iI1iII1I1I1i * Ooo0Ooo
    if 15 - 15: iI1iII1I1I1i . oOO + iI1iII1I1I1i - IIiIIiIi11I1
    if 15 - 15: Oo / i1i1i1111I + oOo0O00 / I1Ii1I1 / I11iiIi11i1I * ooOOO
    if 73 - 73: I1I % Iii1i % i1I % Ooo0Ooo / i1 . IIiIIiIi11I1
    if 87 - 87: i1iiIII111
    if 4 - 4: Oo * IiIIii11Ii - i1I
    if 14 - 14: Iii1i / iI1iII1I1I1i . IIiIIiIi11I1
    if 59 - 59: IiI11Ii111 + Iii1i * Ii + IiI11Ii111 * i1iiIII111 - i1I
    if 17 - 17: oOo0O00 . i1iiIII111
    if 8 - 8: oOO . ooo000 % ooo000 . I1Ii1I1 + ooo000 / i1i1i1111I
    if 3 - 3: ooo000 / ooo000
    if 37 - 37: OooOoo * oOo0O00 . Ooo0Ooo - oOo0O00 * IiI11Ii111 * OooOoo
    if 46 - 46: IiIIii11Ii . I1I % iI1iII1I1I1i - IIiIIiIi11I1 - i1I + IiI11Ii111
    if 55 - 55: Ooo0Ooo
    if 48 - 48: Ooo0Ooo / Ooo0Ooo * Ii . i1iiIII111 % iI1iII1I1I1i
    if 87 - 87: OooOoo * IIiIIiIi11I1
    if 68 - 68: I11iiIi11i1I * oOo0O00 . Ooo0Ooo - IIiIIiIi11I1 . OooOoo + OooOoo
    if 88 - 88: I11iiIi11i1I / oOo0O00 - i1I
    if 7 - 7: Ii . Oo % Ooo0Ooo % Oo - iI1iII1I1I1i
    if 85 - 85: ooOOO % ooOOO + i1i1i1111I % Iii1i % iI1iII1I1I1i . I1Ii1I1
    if 24 - 24: i1i1i1111I . oOo0O00 - i1I + iI1iII1I1I1i
    if 97 - 97: IiI11Ii111 - i1iiIII111 + I1I / i1i1i1111I / IiI11Ii111 * ooOOO
    if 87 - 87: Ooo0Ooo
    if 69 - 69: Iii1i
    if 51 - 51: Iii1i
    if 22 - 22: iI1iII1I1I1i - ooo000 * IiI11Ii111 * IIiIIiIi11I1 * IiI11Ii111 + IiI11Ii111
    III11 = [ ]
    if 47 - 47: ooo000 * i1i1i1111I + OooOoo / I1I . Iii1i . I1I
    if 4 - 4: OooOoo - i1
    if 56 - 56: I1I % oOo0O00 . OooOoo - Ooo0Ooo - Oo . I1Ii1I1
    o0O0O = userDst
    O0O0 = vwAppConfigParam . sql_in_batch_size
    if 20 - 20: iI1iII1I1I1i * IIiIIiIi11I1 - iI1iII1I1I1i . i1 % oOo0O00 / i1I
    for iI1Ii1 in range ( 0 , len ( o0O0O ) , O0O0 ) :
     oO = o0O0O [ iI1Ii1 : iI1Ii1 + O0O0 ]
     OOOO0O0ooO0O = db . session . query ( TBConsumer . f_CardNO , TDPrivilege . f_DoorNO ,
 TDPrivilege . f_ControlSegID ,
 TBConsumer . f_BeginYMD , TBConsumer . f_EndYMD ,

     TBConsumer . f_PIN , TBConsumer . f_ConsumerID ,
 TDPrivilege . f_DoorID ) . filter (
 TDPrivilege . f_ConsumerID . in_ ( oO ) ) . join (
 TBConsumer , TDPrivilege . f_ConsumerID == TBConsumer . f_ConsumerID ) . filter (

     TBConsumer . f_CardNO . isnot ( None ) ) . filter ( TDPrivilege . f_ControllerID == III11i11III ) . filter (
 TBConsumer . f_DoorEnabled == 1 ) . order_by (
 TBConsumer . f_CardNO )
     O0O0iII1 = OOOO0O0ooO0O . all ( )
     III11 . extend ( O0O0iII1 )
    OO = III11
    if 51 - 51: i1iiIII111
    if 2 - 2: Ooo0Ooo
    if 54 - 54: i1I * oOO % Ii + IIiIIiIi11I1
   IIi1IIIi1I = "uploadEditPrivilege"
   if 52 - 52: i1I % IiI11Ii111 * IIiIIiIi11I1 * i1
   O0Oo00OOoO00 = [ ]
   iIIII1II11I1iI = [ ]
   I1ii , OoOooOOO0OoOO , iii1i1II1II1 = 0 , None , None
   o0Oooo0OOO = [ 0 , 0 , 0 , 0 ]
   Oooo = [ 0 , 0 , 0 , 0 ]
   if 92 - 92: I11iiIi11i1I
   if 3 - 3: i1iiIII111 % i1i1i1111I % Ooo0Ooo + IIiIIiIi11I1
   II1IiI1 = 0
   if len ( OO ) > 0 :
    for iI1i1i1 in OO :
     if I1ii != iI1i1i1 . f_CardNO :
      if I1ii > 0 :
       if 15 - 15: IiIIii11Ii % Ooo0Ooo - I1Ii1I1 . oOo0O00
       if 93 - 93: IiIIii11Ii - iI1iII1I1I1i
       if 30 - 30: i1I / i1iiIII111 * iI1iII1I1I1i % oOo0O00 / ooo000
       if 54 - 54: IiIIii11Ii * I1Ii1I1 - I1I % i1i1i1111I + IIiIIiIi11I1 * OooOoo
       if 23 - 23: IiI11Ii111 / IIiIIiIi11I1
       if 13 - 13: oOo0O00 - I1I / Ii % Iii1i
       if 46 - 46: I1Ii1I1 + I11iiIi11i1I / Ii
       if 9 - 9: Oo - i1 % Oo
       if 72 - 72: ooOOO - i1iiIII111
       if 46 - 46: oOO
       if 35 - 35: I11iiIi11i1I * IiI11Ii111
       if 86 - 86: Ii
       if 57 - 57: Oo . IiI11Ii111 % oOO . Ii
       if 65 - 65: I1Ii1I1
       iIIII1II11I1iI . append ( I1ii )
       iI = {
 "CardNO" : [
 I1ii
 ] ,
 "BeginDateTime" : OoOooOOO0OoOO ,
 "EndDateTime" : iii1i1II1II1 ,
 "Door1TimeProfileID" : o0Oooo0OOO [ 0 ] ,
 "Door2TimeProfileID" : o0Oooo0OOO [ 1 ] ,
 "Door3TimeProfileID" : o0Oooo0OOO [ 2 ] ,
 "Door4TimeProfileID" : o0Oooo0OOO [ 3 ] ,
 "UserPassword" : II1IiI1
 }
       if vwAppConfigParam . extfunc5678_multi_card > 0 and vwAppConfigParam . extfunc5678_multi_card_group_active > 0 :
        iI [ "moreCardGroupIndex" ] = Oooo
       O0Oo00OOoO00 . append ( iI )
       if 81 - 81: I1I
      I1ii = iI1i1i1 . f_CardNO
      II1IiI1 = iI1i1i1 . f_PIN
      if 47 - 47: oOo0O00 * iI1iII1I1I1i
      if 98 - 98: Oo - IiIIii11Ii / OooOoo + I1I . iI1iII1I1I1i
      if 54 - 54: i1
      if 61 - 61: I11iiIi11i1I + i1i1i1111I / ooOOO
      OoOooOOO0OoOO = vwAppConfig . getStrOfDatetime ( vwAppConfig . strtotime ( iI1i1i1 . f_BeginYMD ) )
      iii1i1II1II1 = vwAppConfig . getStrOfDatetime ( vwAppConfig . strtotime ( iI1i1i1 . f_EndYMD ) )
      if 48 - 48: IiIIii11Ii - i1 * I11iiIi11i1I / i1 - Ooo0Ooo / Ooo0Ooo
     O0OoOoo00o = iI1i1i1 . f_DoorNO
     o0Oooo0OOO [ O0OoOoo00o - 1 ] = iI1i1i1 . f_ControlSegID
     if not vwAppConfigParam . extfunc5678_timeprofile > 0 :
      if o0Oooo0OOO [ O0OoOoo00o - 1 ] > 1 :
       o0Oooo0OOO [ O0OoOoo00o - 1 ] = 1
     if vwAppConfigParam . extfunc5678_multi_card > 0 and vwAppConfigParam . extfunc5678_multi_card_group_active > 0 :
      Oooo [ O0OoOoo00o - 1 ] = 0
      IIiIiIi = iI1i1i1 . f_ConsumerID
      i111III111I1 = iI1i1i1 . f_DoorID
      i1iI1i = TDDoormorecardsuser . query . filter_by ( f_ConsumerID = IIiIiIi ) . filter_by (
 f_DoorID = i111III111I1 ) . first ( )
      if i1iI1i :
       Oooo [ O0OoOoo00o - 1 ] = i1iI1i . f_MoreCards_GrpID
       if 96 - 96: Iii1i + I11iiIi11i1I + IiI11Ii111
    if Iio0OO0oOO > 0 :
     iIIII1II11I1iI . append ( I1ii )
     iI = {
 "CardNO" : [
 I1ii
 ] ,
 "BeginDateTime" : OoOooOOO0OoOO ,
 "EndDateTime" : iii1i1II1II1 ,
 "Door1TimeProfileID" : o0Oooo0OOO [ 0 ] ,
 "Door2TimeProfileID" : o0Oooo0OOO [ 1 ] ,
 "Door3TimeProfileID" : o0Oooo0OOO [ 2 ] ,
 "Door4TimeProfileID" : o0Oooo0OOO [ 3 ] ,
 "UserPassword" : II1IiI1
 }
     if vwAppConfigParam . extfunc5678_multi_card > 0 and vwAppConfigParam . extfunc5678_multi_card_group_active > 0 :
      iI [ "moreCardGroupIndex" ] = Oooo
     O0Oo00OOoO00 . append ( iI )
     if 19 - 19: iI1iII1I1I1i - I1I * IiI11Ii111 % iI1iII1I1I1i % IiIIii11Ii * ooo000
     if OO0O0O :
      ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "UploadAllPrivileges" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4004
 } )
     else :
      ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "AddEditPrivilege" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4001
 } )
     if oOO0 < len ( O0Oo00OOoO00 ) :
      oOO0 = len ( O0Oo00OOoO00 )
      if 100 - 100: i1i1i1111I + Ii
     i1Ii1I111 = threading . Thread ( target = IiIIiI1IIi11I ,
 args = ( Iio0OO0oOO , ii11IiiIIi , len ( O0Oo00OOoO00 ) , II1i1 ) )
     i1Ii1I111 . start ( )
     if 69 - 69: OooOoo - oOO % oOo0O00
     if 28 - 28: I11iiIi11i1I
     if len ( IiI1Ii ) > len ( iIIII1II11I1iI ) and not OO0O0O :
      if 71 - 71: i1iiIII111 % I1Ii1I1 * Iii1i
      O0Oo00OOoO00 . clear ( )
      if 4 - 4: ooOOO % oOo0O00 / Ooo0Ooo * Oo % Ii
      for i1iI1i in IiI1Ii :
       if i1iI1i . f_CardNO not in iIIII1II11I1iI :
        O0Oo00OOoO00 . append ( {
 "CardNO" : [
 i1iI1i . f_CardNO
 ] ,
 } )
      ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "DeletePrivilege" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4002
 } )
      II1i1 . uploadedSN_Delete . append ( Iio0OO0oOO )
      if oOO0 < len ( O0Oo00OOoO00 ) :
       oOO0 = len ( O0Oo00OOoO00 )
      i1Ii1I111 = threading . Thread ( target = IIIIi1i ,
 args = ( Iio0OO0oOO , ii11IiiIIi , len ( O0Oo00OOoO00 ) , II1i1 ) )
      i1Ii1I111 . start ( )
   else :
    II1i1 . uploadedSNOK . append ( Iio0OO0oOO )
    if ( OO0O0O ) :
     ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "PrivilegeClear" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO
 }
 ] ,
 "id" : 4004
 } )
     II1i1 . uploadedSN_Delete . append ( Iio0OO0oOO )
     if oOO0 < len ( O0Oo00OOoO00 ) :
      oOO0 = len ( O0Oo00OOoO00 )
     i1Ii1I111 = threading . Thread ( target = IIIIi1i ,
 args = ( Iio0OO0oOO , ii11IiiIIi , len ( O0Oo00OOoO00 ) , II1i1 ) )
     i1Ii1I111 . start ( )
    if len ( IiI1Ii ) > 0 and not OO0O0O :
     if 48 - 48: I11iiIi11i1I * Oo + Ii
     O0Oo00OOoO00 . clear ( )
     for i1iI1i in IiI1Ii :
      O0Oo00OOoO00 . append ( {
 "CardNO" : [
 i1iI1i . f_CardNO
 ] ,
 } )
     ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "DeletePrivilege" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4002
 } )
     II1i1 . uploadedSN_Delete . append ( Iio0OO0oOO )
     if oOO0 < len ( O0Oo00OOoO00 ) :
      oOO0 = len ( O0Oo00OOoO00 )
     i1Ii1I111 = threading . Thread ( target = IIIIi1i ,
 args = ( Iio0OO0oOO , ii11IiiIIi , len ( O0Oo00OOoO00 ) , II1i1 ) )
     i1Ii1I111 . start ( )
     if 97 - 97: iI1iII1I1I1i . i1I + Iii1i * i1iiIII111 - i1I / i1I
     if 92 - 92: oOO * i1 % oOo0O00 + i1I + OooOoo * ooo000
     if 67 - 67: Oo / I11iiIi11i1I + I1I % iI1iII1I1I1i + OooOoo . Ooo0Ooo
     if 53 - 53: i1i1i1111I
     if 8 - 8: IIiIIiIi11I1 / iI1iII1I1I1i / IiIIii11Ii . I11iiIi11i1I
     if 52 - 52: I11iiIi11i1I % ooOOO - IIiIIiIi11I1 % Ooo0Ooo * iI1iII1I1I1i
     if 89 - 89: Ooo0Ooo * OooOoo / OooOoo % IIiIIiIi11I1
     if 92 - 92: I11iiIi11i1I / Oo % I1I * iI1iII1I1I1i
     if 61 - 61: I1Ii1I1
 OoOOO0000o = time . time ( ) + vwAppConfigParam . uploadpri_timeout_second + ( oOO0 / 1000 ) * 2
 while time . time ( ) < OoOOO0000o :
  if len ( II1i1 . recvsnpri ) > 0 :
   II1i1 . recvsnpri . clear ( )
   if 72 - 72: IiI11Ii111 . Oo - Oo
   O0 = time . time ( ) + vwAppConfigParam . uploadpri_timeout_second
   if O0 > OoOOO0000o :
    OoOOO0000o = O0
  if len ( II1i1 . uploadedSNOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) and len (
 II1i1 . uploadedSNOK_Delete ) + len (
 II1i1 . uploadedSNFailed_Delete ) == len ( II1i1 . uploadedSN_Delete ) :
   break
   if 20 - 20: IiIIii11Ii
 OOOO0O0ooO0O = db . session . query ( TBController . f_ControllerID , TBController . f_ControllerSN , TBDoor . f_DoorNO ,
 TBDoor . f_DoorID ) . join ( TBDoor ,
 TBDoor . f_ControllerID == TBController . f_ControllerID )
 OOOooo = OOOO0O0ooO0O . all ( )
 if 76 - 76: oOo0O00 . I1I + IIiIIiIi11I1 / Iii1i
 IiI = [ ]
 OOOOO00oo00 = [ ]
 OOo0Oo000OOo = [ ]
 Oo0O0O0oo0 = [ ]
 for I1i11ii111 in doorDst :
  oO00o0000 += str ( I1i11ii111 ) + ","
  for i1iI1i in OOOooo :
   Iio0OO0oOO = i1iI1i . f_ControllerSN
   if 97 - 97: i1I
   if 67 - 67: I11iiIi11i1I - Iii1i
   if I1i11ii111 == i1iI1i . f_DoorID :
    iIi1Ii11II1iIiI = - 1
    try :
     iIi1Ii11II1iIiI = II1i1 . uploadedSNOK . index ( Iio0OO0oOO )
    except :
     iIi1Ii11II1iIiI = - 1
     if 56 - 56: Iii1i - I11iiIi11i1I
    if iIi1Ii11II1iIiI >= 0 :
     IiI . append ( I1i11ii111 )
     if 41 - 41: i1i1i1111I + Oo . I1Ii1I1 % oOo0O00
    else :
     try :
      iIi1Ii11II1iIiI = II1i1 . uploadedSNConnectedOK . index ( Iio0OO0oOO )
     except :
      iIi1Ii11II1iIiI = - 1
     if iIi1Ii11II1iIiI < 0 :
      OOo0Oo000OOo . append ( I1i11ii111 )
     else :
      Oo0O0O0oo0 . append ( I1i11ii111 )
      if 19 - 19: i1i1i1111I + OooOoo
 return { "updateConOK" : II1i1 . uploadedSNOK , "updateConFailed" : II1i1 . uploadedSNFailed ,
 "doorID_OK" : IiI ,
 "doorID_NotConnected" : OOo0Oo000OOo , "doorID_Fail" : Oo0O0O0oo0 }
 if 40 - 40: I1Ii1I1 * IiI11Ii111 . I1Ii1I1 + Iii1i
 if 92 - 92: oOo0O00
 if 50 - 50: i1iiIII111
 if 19 - 19: ooOOO + Oo - I1I . i1
 if 97 - 97: i1 % I11iiIi11i1I - ooo000 % ooOOO . Ii
 if 41 - 41: Ooo0Ooo % IIiIIiIi11I1 . Ooo0Ooo . i1
 if 3 - 3: i1I % Oo * i1
 if 98 - 98: OooOoo * i1I + iI1iII1I1I1i - I11iiIi11i1I . I1I
 if 19 - 19: I1Ii1I1 % oOO / Ooo0Ooo
 if 72 - 72: Iii1i . IiI11Ii111 - I1Ii1I1 + Iii1i
 if 8 - 8: IiI11Ii111 + ooo000 + I1I + i1I
 if 66 - 66: I1Ii1I1 . oOO * i1I
 if 9 - 9: ooo000 . Oo * OooOoo
 if 93 - 93: Ooo0Ooo + IiI11Ii111 / i1iiIII111 % i1iiIII111 * ooOOO
 if 97 - 97: ooOOO - i1iiIII111 / I1I + IiI11Ii111 - Iii1i + OooOoo
 if 83 - 83: IiI11Ii111
 if 61 - 61: Iii1i
 if 87 - 87: oOO - IIiIIiIi11I1
 if 98 - 98: i1i1i1111I % i1i1i1111I * Iii1i % iI1iII1I1I1i
 if 87 - 87: IiIIii11Ii
 if 49 - 49: ooo000 + Iii1i / iI1iII1I1I1i . I1I + iI1iII1I1I1i
 if 2 - 2: Iii1i * ooOOO
 if 88 - 88: I1I + IiI11Ii111 . oOo0O00 * i1 * IIiIIiIi11I1 / IiIIii11Ii
 if 5 - 5: IiI11Ii111 - Iii1i / I1I
 if 82 - 82: ooOOO . I11iiIi11i1I % I1Ii1I1 - oOO
 if 25 - 25: i1I * IiI11Ii111 * I1Ii1I1 % i1I . i1i1i1111I / OooOoo
 if 34 - 34: I11iiIi11i1I / ooOOO * Iii1i / oOO * IiI11Ii111
 if 33 - 33: iI1iII1I1I1i % Ooo0Ooo . Ii * Ooo0Ooo + ooOOO - Oo
 if 88 - 88: IIiIIiIi11I1 - I11iiIi11i1I + i1 . ooOOO . Ooo0Ooo
 if 69 - 69: Iii1i + I1I - i1i1i1111I + i1I
 if 4 - 4: Ooo0Ooo / i1 . I1Ii1I1 / oOo0O00 + Oo . Iii1i
 if 62 - 62: i1I . i1iiIII111 * i1 + Oo
 if 61 - 61: Ii + i1iiIII111
 if 67 - 67: IiI11Ii111 . IiI11Ii111
 if 57 - 57: iI1iII1I1I1i
 if 75 - 75: i1i1i1111I
 if 8 - 8: ooo000
 if 41 - 41: OooOoo . iI1iII1I1I1i . oOo0O00 . Ooo0Ooo % Oo . Ii
 if 72 - 72: oOo0O00
 if 49 - 49: IiI11Ii111 . i1 - IiI11Ii111 % Iii1i
 if 59 - 59: Ooo0Ooo - IiI11Ii111 % i1iiIII111 . Iii1i
 if 59 - 59: i1I + Oo / Iii1i . i1i1i1111I % i1I
 if 25 - 25: I11iiIi11i1I / IiIIii11Ii + IIiIIiIi11I1 - IiI11Ii111 * iI1iII1I1I1i
 if 24 - 24: Ii / Ii
 if 17 - 17: Ooo0Ooo % IiIIii11Ii % oOo0O00
 if 75 - 75: OooOoo / oOo0O00 - i1iiIII111 % IiIIii11Ii + Iii1i
 if 67 - 67: OooOoo * i1 . oOO % Ooo0Ooo . IiIIii11Ii
 if 26 - 26: I1I * i1i1i1111I
 if 44 - 44: IIiIIiIi11I1 * iI1iII1I1I1i
 if 77 - 77: i1I + i1iiIII111 % oOo0O00 % i1iiIII111 - Oo / iI1iII1I1I1i
 if 6 - 6: Iii1i / i1 * i1 * iI1iII1I1I1i
 if 80 - 80: IIiIIiIi11I1 / i1iiIII111
 if 95 - 95: ooo000 / Iii1i / Iii1i + i1i1i1111I
 if 46 - 46: oOO
 if 15 - 15: iI1iII1I1I1i + I1I
 if 81 - 81: Ii + I1I . oOo0O00 / i1 / ooOOO
 if 93 - 93: oOO + i1
 if 23 - 23: I1Ii1I1 . ooOOO
 if 13 - 13: OooOoo
 if 49 - 49: i1iiIII111 . oOo0O00 / i1 - IiIIii11Ii + I1Ii1I1 * I11iiIi11i1I
 if 80 - 80: i1i1i1111I * OooOoo . I1I / I1I
 if 69 - 69: IiIIii11Ii * IiI11Ii111 + i1 - Ii
 if 98 - 98: I1I % oOo0O00 % i1iiIII111 / Ii / ooOOO
 if 17 - 17: IIiIIiIi11I1 % i1i1i1111I / IiI11Ii111 - I1Ii1I1 . I11iiIi11i1I
 if 50 - 50: IiIIii11Ii % I11iiIi11i1I - I1Ii1I1 - IiIIii11Ii + IIiIIiIi11I1 % IIiIIiIi11I1
 if 61 - 61: ooo000 % i1I * Ii
 if 27 - 27: iI1iII1I1I1i / i1
 if 51 - 51: Ooo0Ooo + ooo000
 if 74 - 74: ooOOO + oOO
 if 11 - 11: oOo0O00 . iI1iII1I1I1i
 if 67 - 67: i1I / iI1iII1I1I1i . I11iiIi11i1I
 if 80 - 80: iI1iII1I1I1i - Ooo0Ooo - Ooo0Ooo
 if 48 - 48: ooOOO + Iii1i - iI1iII1I1I1i / i1
 if 34 - 34: IiIIii11Ii . oOo0O00 . I11iiIi11i1I % i1i1i1111I % i1 + Oo
 if 16 - 16: IiIIii11Ii
 if 5 - 5: i1iiIII111 / i1iiIII111 / oOo0O00 + ooOOO * I1I
 if 91 - 91: oOO / Iii1i + oOo0O00 + ooo000 + ooo000
 if 75 - 75: IIiIIiIi11I1 . I11iiIi11i1I * ooo000 / i1 / I1I * IIiIIiIi11I1
 if 30 - 30: oOO % iI1iII1I1I1i - i1i1i1111I + I1I + Ooo0Ooo
 if 99 - 99: I1I - iI1iII1I1I1i - Iii1i % OooOoo + OooOoo % oOo0O00
 if 95 - 95: IIiIIiIi11I1
 if 85 - 85: i1 + Ooo0Ooo - ooo000
 if 98 - 98: oOo0O00 % i1I + i1I . OooOoo . i1iiIII111 / i1I
 if 81 - 81: i1I % ooo000 - ooo000 / oOO . ooo000
 if 25 - 25: i1iiIII111 . iI1iII1I1I1i % oOo0O00 * i1i1i1111I
 if 22 - 22: oOO
 if 23 - 23: IiI11Ii111
 if 63 - 63: I1Ii1I1
 if 26 - 26: ooo000
 if 37 - 37: oOo0O00 / I11iiIi11i1I
 if 9 - 9: IiIIii11Ii . Iii1i % i1iiIII111 / Ooo0Ooo
 if 51 - 51: OooOoo . oOO
 if 54 - 54: i1i1i1111I * I1I - I1I / oOo0O00
 if 56 - 56: IIiIIiIi11I1 * IiI11Ii111 / oOo0O00 % I1I % iI1iII1I1I1i % ooOOO
 if 26 - 26: OooOoo
 if 58 - 58: ooo000
 if 78 - 78: i1iiIII111 % i1I
 if 63 - 63: i1I - i1i1i1111I . iI1iII1I1I1i + IiIIii11Ii
 if 90 - 90: ooo000 + I1Ii1I1 % i1 - IiI11Ii111 / Ooo0Ooo * iI1iII1I1I1i
 if 50 - 50: i1I / ooo000 . Ii * I1Ii1I1 / oOO + oOo0O00
 if 86 - 86: I1I
 if 64 - 64: Oo % i1i1i1111I + I11iiIi11i1I . i1iiIII111
 if 53 - 53: ooOOO / I11iiIi11i1I / iI1iII1I1I1i . Iii1i
 if 10 - 10: iI1iII1I1I1i * i1iiIII111 - ooo000 * ooo000 / Iii1i . ooOOO
 if 15 - 15: i1iiIII111 / iI1iII1I1I1i * iI1iII1I1I1i - i1i1i1111I . i1 % iI1iII1I1I1i
 if 18 - 18: I1Ii1I1 + Iii1i / Oo % I1Ii1I1
 if 38 - 38: oOO
 if 95 - 95: i1i1i1111I / Iii1i * ooOOO * OooOoo
 if 57 - 57: I1I / Ii * oOO
 if 28 - 28: Ii * I11iiIi11i1I * Oo * ooo000
 if 89 - 89: Ii - Iii1i % Ii
 if 99 - 99: i1 / i1 + i1i1i1111I / Iii1i
 if 54 - 54: Iii1i
 if 44 - 44: i1i1i1111I * i1
 if 13 - 13: I1Ii1I1 / Ooo0Ooo . Oo % i1iiIII111 + I1I % IiI11Ii111
 if 27 - 27: Ooo0Ooo - i1 . Oo / i1iiIII111 + I1Ii1I1
 if 2 - 2: i1iiIII111 * ooo000 . iI1iII1I1I1i / i1
 if 9 - 9: IiI11Ii111 + Ii + I1I . oOo0O00 - IIiIIiIi11I1 % Oo
 if 92 - 92: I1Ii1I1 % Oo + i1iiIII111 % ooo000 * OooOoo
 if 43 - 43: i1iiIII111 * IIiIIiIi11I1
 if 9 - 9: IiI11Ii111 . iI1iII1I1I1i % ooo000
 if 66 - 66: i1 * i1I % Iii1i * Iii1i / Oo % oOo0O00
 if 31 - 31: i1 - i1i1i1111I % OooOoo . IIiIIiIi11I1 + I1I + OooOoo
 if 49 - 49: Ii * i1
 if 93 - 93: i1iiIII111 - ooOOO / Ii + Ooo0Ooo % oOo0O00
 if 97 - 97: i1
 if 94 - 94: i1 + oOO / Ii
 if 86 - 86: i1 * IiI11Ii111
 if 49 - 49: I1Ii1I1 + Iii1i - IIiIIiIi11I1 . I1I . Ii
 if 82 - 82: OooOoo / i1i1i1111I
 if 23 - 23: I1I % I11iiIi11i1I / Ooo0Ooo . iI1iII1I1I1i * oOo0O00
 if 22 - 22: i1 / I1Ii1I1 - i1 % oOo0O00 + iI1iII1I1I1i % I1I
 if 35 - 35: IiIIii11Ii . ooo000 - IIiIIiIi11I1 / iI1iII1I1I1i
 if 55 - 55: Ooo0Ooo % IIiIIiIi11I1 / ooo000 . i1i1i1111I - oOo0O00
 if 77 - 77: oOO / I1Ii1I1 * ooo000 + oOo0O00 - iI1iII1I1I1i
 if 37 - 37: IiI11Ii111 % i1i1i1111I - OooOoo + IIiIIiIi11I1
 if 26 - 26: Iii1i / Iii1i
 if 65 - 65: IiIIii11Ii * ooo000 - ooo000 - IiIIii11Ii * IIiIIiIi11I1 - oOo0O00
 if 83 - 83: Ooo0Ooo . Oo . i1I - I1I / Ooo0Ooo
 if 33 - 33: I11iiIi11i1I + IIiIIiIi11I1 * IiIIii11Ii * Ii * ooo000 * Ooo0Ooo
 if 95 - 95: IIiIIiIi11I1 / Ii
 if 47 - 47: Iii1i * OooOoo * IiI11Ii111 + OooOoo - i1 + IiI11Ii111
 if 75 - 75: Iii1i / i1i1i1111I . ooo000 * i1I - I11iiIi11i1I . I1I
 if 55 - 55: ooOOO - oOo0O00
 if 65 - 65: ooo000 * oOo0O00 % Ooo0Ooo * i1i1i1111I * Oo
 if 82 - 82: OooOoo + I1I + ooo000 * oOo0O00 * Iii1i
 if 22 - 22: Oo . Ooo0Ooo . Ooo0Ooo % oOo0O00
 if 94 - 94: I1Ii1I1 / I1Ii1I1 + OooOoo * I1I
 if 63 - 63: Oo % iI1iII1I1I1i
 if 73 - 73: I1I / Ii
 if 96 - 96: ooOOO / Ooo0Ooo
 if 57 - 57: Oo % I1Ii1I1 * oOo0O00 . ooo000 . ooOOO . i1i1i1111I
 if 44 - 44: i1I
 if 31 - 31: Oo - Ii . Iii1i + i1I
 if 6 - 6: I1I
 if 67 - 67: ooo000
 if 78 - 78: IIiIIiIi11I1 + i1iiIII111 - Ooo0Ooo % IiIIii11Ii + i1iiIII111
 if 41 - 41: ooo000 + ooo000
 if 79 - 79: IiIIii11Ii
 if 43 - 43: Iii1i
 if 59 - 59: OooOoo - IiI11Ii111 . I11iiIi11i1I . i1 + iI1iII1I1I1i + IiI11Ii111
 if 88 - 88: I11iiIi11i1I - I1I - i1iiIII111 . IiIIii11Ii . i1iiIII111 . iI1iII1I1I1i
 if 30 - 30: ooo000 - IiI11Ii111 * IiIIii11Ii . IIiIIiIi11I1 - Oo
 if 94 - 94: IiI11Ii111 + OooOoo / i1I % I11iiIi11i1I
 if 5 - 5: i1i1i1111I - oOo0O00
 if 87 - 87: I1Ii1I1 - Oo - oOO - i1 / I1I
 if 22 - 22: i1i1i1111I * Ooo0Ooo . Iii1i * i1iiIII111 / ooOOO - i1
 if 93 - 93: IIiIIiIi11I1 * Oo * OooOoo
 if 69 - 69: IIiIIiIi11I1 * i1iiIII111 . i1I / i1i1i1111I % i1iiIII111 * ooo000
 if 92 - 92: ooo000 * oOO * i1 - ooOOO / oOo0O00 . i1i1i1111I
 if 15 - 15: i1iiIII111
 if 95 - 95: Oo / IiIIii11Ii % i1iiIII111 / i1I - Iii1i
 if 40 - 40: i1I
 if 69 - 69: Ooo0Ooo - i1iiIII111
 if 99 - 99: OooOoo * IiI11Ii111 % i1I
 if 29 - 29: ooo000
 if 2 - 2: i1iiIII111 - oOo0O00 / IIiIIiIi11I1 / iI1iII1I1I1i * OooOoo
 if 77 - 77: Ii / i1iiIII111 % oOo0O00
 if 65 - 65: ooOOO . i1I * I1I - oOo0O00 - ooo000 * Ii
 if 43 - 43: I1I * i1
 if 90 - 90: I1Ii1I1 . ooo000 - I1Ii1I1 + oOO . i1iiIII111 - Ooo0Ooo
 if 87 - 87: ooo000 + i1i1i1111I - oOo0O00 % oOo0O00
 if 90 - 90: oOO * ooo000
 if 13 - 13: i1I + Ii
 if 91 - 91: I1Ii1I1 - OooOoo % iI1iII1I1I1i
 if 90 - 90: OooOoo + I1I / I1I * Iii1i
 if 47 - 47: Oo % OooOoo * Ooo0Ooo - I1Ii1I1 * Oo . IiIIii11Ii
 if 61 - 61: Oo . I11iiIi11i1I
 if 84 - 84: Ooo0Ooo % ooo000 / i1
 if 5 - 5: i1
 if 51 - 51: IiI11Ii111 + ooo000 / i1i1i1111I * iI1iII1I1I1i
 if 84 - 84: iI1iII1I1I1i + Iii1i + Oo . i1i1i1111I
 if 16 - 16: I11iiIi11i1I * Iii1i / i1I % i1I
 if 62 - 62: Oo * I1Ii1I1 % ooo000
 if 62 - 62: Ooo0Ooo * i1I + Oo / i1i1i1111I + oOO * I1Ii1I1
 if 52 - 52: ooo000 . oOO % IIiIIiIi11I1 % I11iiIi11i1I . oOO % Oo
 if 97 - 97: Oo * I1Ii1I1
 if 77 - 77: Iii1i / iI1iII1I1I1i % Oo + OooOoo . I1I % I1Ii1I1
 if 12 - 12: Ii + Oo . oOo0O00 % oOO + I1Ii1I1
 if 55 - 55: i1 . Ii + oOo0O00 % oOO * OooOoo - i1I
 if 63 - 63: I11iiIi11i1I + IiI11Ii111 + I11iiIi11i1I % Oo / Ii * i1
 if 5 - 5: oOo0O00 / I1I
 if 18 - 18: I1I % IiIIii11Ii % OooOoo + IiI11Ii111 * Ooo0Ooo
 if 10 - 10: ooOOO + I1Ii1I1 - iI1iII1I1I1i - ooOOO . Ooo0Ooo
 if 89 - 89: I1I % i1i1i1111I
 if 81 - 81: I1I + IiIIii11Ii * I11iiIi11i1I % I1Ii1I1 % OooOoo - i1iiIII111
 if 56 - 56: IiI11Ii111 . i1i1i1111I / Oo + oOO
 if 15 - 15: Ooo0Ooo % i1iiIII111 . i1i1i1111I * i1iiIII111 + OooOoo + i1
 if 36 - 36: Oo
 if 49 - 49: Oo - Oo
 if 23 - 23: oOo0O00 * IIiIIiIi11I1 % I11iiIi11i1I . i1I + oOo0O00
 if 71 - 71: Oo % I1Ii1I1 . i1iiIII111
 if 97 - 97: IiIIii11Ii / oOO * IiI11Ii111 % ooo000
 if 62 - 62: ooOOO / I11iiIi11i1I . OooOoo * OooOoo * OooOoo
 if 49 - 49: ooOOO * IiIIii11Ii . i1 * IiI11Ii111 * Ooo0Ooo
 if 91 - 91: iI1iII1I1I1i / iI1iII1I1I1i + oOo0O00 % ooOOO
 if 55 - 55: i1 * i1i1i1111I + Ooo0Ooo + i1i1i1111I + i1i1i1111I
 if 10 - 10: i1i1i1111I / i1I / i1i1i1111I . oOo0O00 * IIiIIiIi11I1 % Iii1i
 if 55 - 55: OooOoo % IIiIIiIi11I1 - oOO % Oo * Iii1i - IiI11Ii111
 if 25 - 25: Ooo0Ooo . oOO * IiIIii11Ii * I11iiIi11i1I / IiI11Ii111 * Ii
 if 78 - 78: I11iiIi11i1I / I1Ii1I1 / IiIIii11Ii . OooOoo
 if 66 - 66: Ooo0Ooo . ooo000 - I1Ii1I1
 if 48 - 48: i1iiIII111
 if 87 - 87: Oo % oOo0O00
 if 39 - 39: ooOOO + Iii1i / i1I * ooo000
 if 28 - 28: I11iiIi11i1I * iI1iII1I1I1i . IiI11Ii111
 if 63 - 63: IiIIii11Ii
 if 1 - 1: i1iiIII111 - IiIIii11Ii + Iii1i . I1Ii1I1 + ooo000
 if 46 - 46: Oo
 if 56 - 56: i1i1i1111I / I11iiIi11i1I % Ooo0Ooo / Oo
 if 63 - 63: OooOoo
 if 99 - 99: i1 + ooo000 - oOo0O00 + Ooo0Ooo + oOO / ooOOO
 if 14 - 14: iI1iII1I1I1i * OooOoo / Ooo0Ooo + Iii1i
 if 46 - 46: Oo / oOo0O00 / OooOoo . Ooo0Ooo - i1iiIII111 * Ii
 if 21 - 21: IIiIIiIi11I1 / ooOOO * Ooo0Ooo . oOO - OooOoo - i1iiIII111
 if 97 - 97: ooo000 % Oo / Iii1i . OooOoo
 if 20 - 20: Iii1i % i1 * Ii
 if 87 - 87: IiI11Ii111 - Iii1i * Ooo0Ooo
 if 62 - 62: IIiIIiIi11I1 + Ooo0Ooo . i1
 if 80 - 80: I11iiIi11i1I * I1Ii1I1
 if 32 - 32: ooOOO . i1 * Ooo0Ooo
 if 26 - 26: Oo * I11iiIi11i1I * I1Ii1I1 % I1I
 if 76 - 76: OooOoo * Oo / ooo000 / ooOOO . OooOoo / Ooo0Ooo
 if 3 - 3: i1i1i1111I / ooo000 . I11iiIi11i1I - i1 + i1
 if 44 - 44: Ii - Ooo0Ooo % Ii * oOo0O00
 if 15 - 15: ooOOO + Ooo0Ooo + i1
 if 41 - 41: I1Ii1I1
 if 6 - 6: Ii
 if 85 - 85: I1I + IIiIIiIi11I1 + IiI11Ii111 + Ooo0Ooo . ooOOO / IIiIIiIi11I1
 if 47 - 47: Oo + Iii1i . oOO
 if 99 - 99: IiIIii11Ii + IiIIii11Ii
 if 96 - 96: IiI11Ii111 % i1 + ooOOO * i1I / ooo000
 if 12 - 12: OooOoo
 if 81 - 81: Oo % i1I . I1I * iI1iII1I1I1i / i1i1i1111I . oOO
 if 80 - 80: IIiIIiIi11I1 + oOO / OooOoo
 if 6 - 6: Ooo0Ooo / oOO
 if 92 - 92: IiIIii11Ii % iI1iII1I1I1i + Oo
 if 56 - 56: IIiIIiIi11I1
 if 54 - 54: Iii1i % IiI11Ii111 / OooOoo + Ii + i1I
 if 8 - 8: ooo000 / oOO - i1i1i1111I % iI1iII1I1I1i / ooo000 % oOO
 if 100 - 100: IiI11Ii111 - I1I + Iii1i / I1Ii1I1
 if 74 - 74: Iii1i % I11iiIi11i1I
 if 59 - 59: I11iiIi11i1I * oOo0O00 + oOo0O00 / ooOOO * oOO
 if 16 - 16: Ii / oOO
 if 31 - 31: OooOoo . OooOoo + ooOOO
 if 7 - 7: I1I / Oo % IiIIii11Ii . IiI11Ii111 * i1iiIII111 + i1i1i1111I
 if 91 - 91: OooOoo + IiI11Ii111 - i1iiIII111 + Iii1i . IiIIii11Ii
 if 29 - 29: I1Ii1I1 + Iii1i + i1I % ooo000 . ooOOO * IiI11Ii111
 if 71 - 71: i1 - i1iiIII111
 if 35 - 35: ooo000 % OooOoo
 if 58 - 58: Ooo0Ooo * IiIIii11Ii
 if 19 - 19: IIiIIiIi11I1 . iI1iII1I1I1i / I1Ii1I1 / I1I
 if 73 - 73: I1Ii1I1 * oOo0O00 * oOo0O00 . I1Ii1I1
 if 23 - 23: IiI11Ii111 * i1i1i1111I / i1i1i1111I / Ooo0Ooo
 if 32 - 32: ooo000 * I11iiIi11i1I . Iii1i / IiI11Ii111
 if 13 - 13: Iii1i - Iii1i . Ii * OooOoo
 if 32 - 32: ooOOO
 if 19 - 19: Iii1i % Oo . i1iiIII111 % i1i1i1111I * OooOoo / IIiIIiIi11I1
 if 98 - 98: I1Ii1I1 - i1iiIII111 + OooOoo - Ii / oOO
 if 89 - 89: oOO * Iii1i . Ii
 if 14 - 14: Oo + Ooo0Ooo % Iii1i / Iii1i / i1
 if 55 - 55: IiIIii11Ii / oOo0O00 * ooo000 / Oo
 if 63 - 63: i1 . Oo
 if 37 - 37: IiI11Ii111 . Oo + IiIIii11Ii
 if 11 - 11: IiI11Ii111
 if 20 - 20: I11iiIi11i1I - i1iiIII111
 if 77 - 77: Ooo0Ooo * OooOoo
 if 86 - 86: IiI11Ii111 + IiIIii11Ii + ooOOO . IiIIii11Ii - i1i1i1111I + Iii1i
 if 20 - 20: i1iiIII111 / ooo000 / IIiIIiIi11I1 - Oo . Ooo0Ooo % ooOOO
 if 19 - 19: i1iiIII111
 if 17 - 17: IiIIii11Ii - i1iiIII111
 if 64 - 64: Ooo0Ooo - i1iiIII111 % i1 / ooo000
 if 54 - 54: oOO - IIiIIiIi11I1 % oOO % ooo000 / i1i1i1111I
 if 75 - 75: I11iiIi11i1I - i1 % i1i1i1111I * IiIIii11Ii / I1I . Iii1i
 if 47 - 47: OooOoo - Ii . IiIIii11Ii + oOo0O00 / iI1iII1I1I1i
 if 19 - 19: i1 - i1 / OooOoo . OooOoo . ooo000
 if 94 - 94: Ooo0Ooo
 if 48 - 48: Oo
 if 85 - 85: IIiIIiIi11I1 . I1Ii1I1 % OooOoo . OooOoo + i1i1i1111I
 if 32 - 32: Iii1i
 if 73 - 73: I1Ii1I1 / OooOoo - I11iiIi11i1I * oOo0O00
 if 61 - 61: i1iiIII111 * Iii1i - Oo + OooOoo
 if 8 - 8: IiI11Ii111 . I11iiIi11i1I / Iii1i / Ooo0Ooo - iI1iII1I1I1i * oOO
 if 92 - 92: I11iiIi11i1I % i1 + Ooo0Ooo
 if 21 - 21: I11iiIi11i1I . OooOoo - I1I
 if 52 - 52: i1 . I1Ii1I1 - oOO * i1i1i1111I % iI1iII1I1I1i
 if 62 - 62: ooo000 * I1Ii1I1 - Ii
 if 48 - 48: I1I - Oo + i1i1i1111I . IiI11Ii111 + Iii1i + i1
 if 37 - 37: Oo % i1i1i1111I
 if 28 - 28: oOo0O00 . oOO / Ii / ooOOO / i1i1i1111I
 if 73 - 73: i1I . Ii - i1iiIII111 . oOo0O00 . Iii1i
 if 46 - 46: I11iiIi11i1I - i1iiIII111 / ooo000
 if 93 - 93: Oo / Ooo0Ooo + I11iiIi11i1I
 if 13 - 13: Iii1i / ooo000 % i1I - oOo0O00 . I1Ii1I1
 if 20 - 20: i1i1i1111I - i1i1i1111I * i1 * OooOoo / I1Ii1I1 * I11iiIi11i1I
 if 67 - 67: I11iiIi11i1I % iI1iII1I1I1i + i1iiIII111 / IiIIii11Ii + Ooo0Ooo % Ii
 if 92 - 92: i1 - IiI11Ii111 / i1i1i1111I % i1I / IIiIIiIi11I1 * Oo
 if 2 - 2: oOO + i1i1i1111I
 if 64 - 64: iI1iII1I1I1i
 if 41 - 41: I1Ii1I1 + i1i1i1111I
 if 36 - 36: IiIIii11Ii + i1i1i1111I . iI1iII1I1I1i / IIiIIiIi11I1 + ooOOO
 if 98 - 98: OooOoo * i1I . Ii - IiIIii11Ii
 if 37 - 37: IiI11Ii111 - OooOoo * IiIIii11Ii - I11iiIi11i1I
 if 80 - 80: i1i1i1111I + Ooo0Ooo * I11iiIi11i1I
 if 58 - 58: Ii * Ii % i1
 if 90 - 90: OooOoo . oOo0O00 . I1Ii1I1 - ooo000 % i1i1i1111I
 if 29 - 29: i1i1i1111I - iI1iII1I1I1i + oOO - iI1iII1I1I1i
 if 14 - 14: I1Ii1I1
 if 94 - 94: ooo000
 if 99 - 99: ooo000 / i1i1i1111I + i1iiIII111 + IiI11Ii111
 if 63 - 63: IIiIIiIi11I1 * Oo
 if 36 - 36: oOO . IIiIIiIi11I1 / I1I / i1iiIII111
 if 73 - 73: IiI11Ii111
 if 100 - 100: IiIIii11Ii . IIiIIiIi11I1 - Ii / I1I
 if 3 - 3: ooOOO - I1Ii1I1 + OooOoo . ooOOO . i1i1i1111I - oOo0O00
 if 92 - 92: I11iiIi11i1I - ooOOO / Ii / i1i1i1111I
 if 55 - 55: I1Ii1I1 + IiIIii11Ii / Ooo0Ooo
 if 62 - 62: I1Ii1I1 % Ooo0Ooo * i1I + ooo000
 if 2 - 2: I1I % i1I . OooOoo % i1iiIII111 + Iii1i
 if 20 - 20: IIiIIiIi11I1 / Oo + Ooo0Ooo * ooOOO
 if 67 - 67: iI1iII1I1I1i . iI1iII1I1I1i / i1I * Ii . I1I / Ooo0Ooo
 if 90 - 90: IiI11Ii111 / I1I - I1I + i1I / Iii1i
 if 48 - 48: oOo0O00 . I11iiIi11i1I + Oo
 if 90 - 90: iI1iII1I1I1i * Ooo0Ooo - IiIIii11Ii + oOO
 if 55 - 55: Oo + iI1iII1I1I1i / IiIIii11Ii - oOO / IiI11Ii111
 if 21 - 21: ooo000 - Ooo0Ooo + oOo0O00 * IiI11Ii111 * Oo
 if 12 - 12: i1i1i1111I
 if 84 - 84: IiI11Ii111
 if 53 - 53: IIiIIiIi11I1
 if 96 - 96: Oo % iI1iII1I1I1i * i1I % oOo0O00 . Ooo0Ooo
 if 28 - 28: oOO - ooo000
 if 15 - 15: Oo - IiIIii11Ii
def O00OoOo0OO0O ( arrinfo , timeoutSec = 3 ) :
 OooOooooO000 = None
 try :
  O0Oo = vwAppConfigParam . server1001_ip
  o0Oo0Oo0O0o = vwAppConfigParam . server1001_webport
  OoOoo0o0o0 = http . client . HTTPConnection ( host = O0Oo , port = o0Oo0Oo0O0o , timeout = 3 )
  if 74 - 74: ooOOO * I1Ii1I1 % I1I + i1i1i1111I
  ii11ii11 = bytes ( json . dumps ( arrinfo , sort_keys = False , indent = 4 ) , encoding = 'utf8' )
  if 70 - 70: i1I
  if 49 - 49: OooOoo
  Oo0o = { "Content-type" : "application/json" , "Accept" : "application/json" }
  OoOoo0o0o0 . timeout = timeoutSec
  if 39 - 39: i1 % ooo000
  OoOoo0o0o0 . request ( "POST" , O0Oo , ii11ii11 , Oo0o )
  ooo0o0 = OoOoo0o0o0 . getresponse ( )
  if 75 - 75: Oo
  ooO = ooo0o0 . read ( )
  if 34 - 34: i1i1i1111I . IIiIIiIi11I1
  if 47 - 47: Oo - IIiIIiIi11I1
  if 3 - 3: IIiIIiIi11I1 . i1i1i1111I * Ooo0Ooo / ooo000
  OoOoo0o0o0 . close ( )
  try :
   if 41 - 41: I1Ii1I1 - oOo0O00 / I1Ii1I1 . i1I * IiI11Ii111 * Ii
   if 16 - 16: IIiIIiIi11I1 + IiI11Ii111 % oOO
   i1Iii1i1i1 = json . loads ( ooO . decode ( "utf-8" ) )
   if 66 - 66: IiIIii11Ii / Oo
   if i1Iii1i1i1 [ 'result' ] [ 'success' ] :
    OooOooooO000 = "OK"
   else :
    OooOooooO000 = i1Iii1i1i1 [ 'result' ] [ 'msg' ]
    if 28 - 28: i1iiIII111
  except :
   if 18 - 18: OooOoo . ooOOO
   if 36 - 36: i1i1i1111I / oOO + oOo0O00 * iI1iII1I1I1i
   if 96 - 96: I11iiIi11i1I - I1I - I1Ii1I1 + I1I
   OooOooooO000 = None
   return OooOooooO000
   if 88 - 88: ooo000 + i1I . oOo0O00 % I1I / IIiIIiIi11I1 * Ooo0Ooo
   if 58 - 58: ooOOO % IiI11Ii111 + IiI11Ii111 . ooo000
  return OooOooooO000
 except Exception as oOO0oOoo0O0 :
  pass
  print ( oOO0oOoo0O0 )
  if 53 - 53: I11iiIi11i1I % ooo000 + Iii1i
  if 15 - 15: Ooo0Ooo + I1Ii1I1
 return None
 if 46 - 46: I1I . IiIIii11Ii
 if 48 - 48: Oo + Iii1i
def oOoO0Oo0oOO0o ( ) :
 print ( "uploadAllPrivilegeByThread" )
 II1i1 = WGControllerPri2023 ( )
 if 68 - 68: oOO . ooOOO
 OOOO0O0ooO0O = TBController . query . filter ( TBController . f_Enabled == 1 ) . order_by ( TBController . f_ControllerSN )
 OO = OOOO0O0ooO0O . all ( )
 for i1iI1i in OO :
  Iio0OO0oOO = i1iI1i . f_ControllerSN
  III11i11III = i1iI1i . f_ControllerID
  if 92 - 92: i1i1i1111I * Ooo0Ooo % Ooo0Ooo * i1iiIII111 + I1I
  if 26 - 26: IIiIIiIi11I1
  if 64 - 64: ooOOO
  if 54 - 54: Oo
  II1i1 . uploadedSN . append ( Iio0OO0oOO )
  if 58 - 58: i1iiIII111 % i1I
  i1Ii1I111 = threading . Thread ( target = oo0oOo0OOO , args = ( Iio0OO0oOO , III11i11III , II1i1 ) )
  i1Ii1I111 . start ( )
 i11IiIi = time . time ( )
 if 50 - 50: Iii1i % oOo0O00
 while time . time ( ) < i11IiIi + 10 :
  if len ( II1i1 . uploadedSNConnectedOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) :
   break
  time . sleep ( 0.1 )
 print ( "uploadedSNConnectedOK" )
 print ( II1i1 . uploadedSNConnectedOK )
 oOO0 = 0
 if len ( II1i1 . uploadedSNConnectedOK ) > 0 :
  if 3 - 3: Iii1i % oOo0O00 - ooo000 / oOO . Ii % i1iiIII111
  for o0Oo000 in range ( len ( II1i1 . uploadedSNConnectedOK ) ) :
   if 83 - 83: i1i1i1111I
   if 61 - 61: Ooo0Ooo
   if 93 - 93: i1iiIII111 + ooo000 + i1i1i1111I
   III11i11III = II1i1 . uploadedIdConnectedOK [ o0Oo000 ]
   Iio0OO0oOO = II1i1 . uploadedSNConnectedOK [ o0Oo000 ]
   if 72 - 72: IiI11Ii111 - ooo000 . oOo0O00
   if 90 - 90: Oo - IiI11Ii111 + Iii1i . i1
   if 7 - 7: OooOoo
   if 14 - 14: Ooo0Ooo * I1Ii1I1 / i1i1i1111I
   if 25 - 25: oOO + Ii . Ii + Ii . i1i1i1111I + ooOOO
   if 43 - 43: ooo000 % I1Ii1I1 + i1I / Oo - i1iiIII111 / OooOoo
   if 97 - 97: iI1iII1I1I1i - Oo * I11iiIi11i1I % i1I / IIiIIiIi11I1
   OOOO0O0ooO0O = db . session . query ( TBConsumer . f_CardNO , TDPrivilege . f_DoorNO ,
 TDPrivilege . f_ControlSegID ,
 TBConsumer . f_BeginYMD , TBConsumer . f_EndYMD ,
 TBConsumer . f_PIN , TBConsumer . f_ConsumerID , TDPrivilege . f_DoorID ) . join (
 TBConsumer , TDPrivilege . f_ConsumerID == TBConsumer . f_ConsumerID ) . filter (
 TBConsumer . f_CardNO . isnot ( None ) ) . filter ( TDPrivilege . f_ControllerID == III11i11III ) . order_by (
 TBConsumer . f_CardNO )
   OO = OOOO0O0ooO0O . all ( )
   if 85 - 85: i1iiIII111 + IIiIIiIi11I1 * i1i1i1111I / ooOOO
   IIi1IIIi1I = "uploadEditPrivilege"
   if 99 - 99: i1i1i1111I * oOO + i1
   O0Oo00OOoO00 = [ ]
   I1ii , OoOooOOO0OoOO , iii1i1II1II1 = 0 , None , None
   o0Oooo0OOO = [ 0 , 0 , 0 , 0 ]
   II1IiI1 = 0
   Oooo = [ 0 , 0 , 0 , 0 ]
   if 85 - 85: I1I * i1i1i1111I * IIiIIiIi11I1 . I1I . I1I . iI1iII1I1I1i
   if 50 - 50: Oo - i1iiIII111
   if len ( OO ) > 0 :
    for iI1i1i1 in OO :
     if I1ii != iI1i1i1 . f_CardNO :
      if I1ii > 0 :
       if 27 - 27: I11iiIi11i1I % oOo0O00 + iI1iII1I1I1i * OooOoo * I11iiIi11i1I
       if 14 - 14: IiIIii11Ii / ooo000
       if 58 - 58: I1I % I1I - ooOOO . I1Ii1I1 - oOo0O00
       if 74 - 74: OooOoo . Oo - Oo * Iii1i / I1Ii1I1 - ooOOO
       if 4 - 4: I11iiIi11i1I * IiIIii11Ii - Oo + oOO
       if 11 - 11: I1I - ooo000 / I11iiIi11i1I
       if 56 - 56: Ii + ooOOO - Oo + ooo000 . Ooo0Ooo
       if 25 - 25: ooo000 / IiI11Ii111 / ooOOO
       if 68 - 68: I11iiIi11i1I - Oo - Ii * i1 * Oo
       if 29 - 29: Ii
       if 5 - 5: i1 + oOO . ooOOO . IiI11Ii111 / ooo000
       if 51 - 51: i1 . ooOOO * I1I - I1Ii1I1
       iI = {
 "CardNO" : [
 I1ii
 ] ,
 "BeginDateTime" : OoOooOOO0OoOO ,
 "EndDateTime" : iii1i1II1II1 ,
 "Door1TimeProfileID" : o0Oooo0OOO [ 0 ] ,
 "Door2TimeProfileID" : o0Oooo0OOO [ 1 ] ,
 "Door3TimeProfileID" : o0Oooo0OOO [ 2 ] ,
 "Door4TimeProfileID" : o0Oooo0OOO [ 3 ] ,
 "UserPassword" : II1IiI1
 }
       if 27 - 27: oOo0O00 * IiI11Ii111 * oOo0O00
       if vwAppConfigParam . extfunc5678_multi_card > 0 and vwAppConfigParam . extfunc5678_multi_card_group_active > 0 :
        iI [ "moreCardGroupIndex" ] = Oooo
        if 94 - 94: Oo
       O0Oo00OOoO00 . append ( iI )
       if 24 - 24: IiI11Ii111 * oOo0O00 - i1 * i1iiIII111 / i1i1i1111I
      I1ii = iI1i1i1 . f_CardNO
      II1IiI1 = iI1i1i1 . f_PIN
      if 22 - 22: iI1iII1I1I1i + OooOoo
      if 2 - 2: Ooo0Ooo - Iii1i + ooOOO / I1Ii1I1 . Iii1i * IiI11Ii111
      OoOooOOO0OoOO = iI1i1i1 . f_BeginYMD . strftime ( '%Y-%m-%d %H:%M:%S' )
      iii1i1II1II1 = iI1i1i1 . f_EndYMD . strftime ( '%Y-%m-%d %H:%M:%S' )
      if 46 - 46: Iii1i % i1 - Oo - Ii
     O0OoOoo00o = iI1i1i1 . f_DoorNO
     o0Oooo0OOO [ O0OoOoo00o - 1 ] = iI1i1i1 . f_ControlSegID
     if not vwAppConfigParam . extfunc5678_timeprofile > 0 :
      if o0Oooo0OOO [ O0OoOoo00o - 1 ] > 1 :
       o0Oooo0OOO [ O0OoOoo00o - 1 ] = 1
     if vwAppConfigParam . extfunc5678_multi_card > 0 and vwAppConfigParam . extfunc5678_multi_card_group_active > 0 :
      Oooo [ O0OoOoo00o - 1 ] = 0
      IIiIiIi = iI1i1i1 . f_ConsumerID
      i111III111I1 = iI1i1i1 . f_DoorID
      i1iI1i = TDDoormorecardsuser . query . filter_by ( f_ConsumerID = IIiIiIi ) . filter_by (
 f_DoorID = i111III111I1 ) . first ( )
      if i1iI1i :
       Oooo [ O0OoOoo00o - 1 ] = i1iI1i . f_MoreCards_GrpID
       if 3 - 3: oOo0O00 * I11iiIi11i1I / I1Ii1I1 % Oo / Oo
    if Iio0OO0oOO > 0 :
     if 39 - 39: iI1iII1I1I1i + IiIIii11Ii - ooOOO % IIiIIiIi11I1 * IiIIii11Ii + iI1iII1I1I1i
     if 2 - 2: i1iiIII111 + IiI11Ii111 % IIiIIiIi11I1
     if 15 - 15: I11iiIi11i1I * Iii1i * OooOoo
     if 53 - 53: OooOoo * IiIIii11Ii
     if 64 - 64: i1
     if 74 - 74: Ooo0Ooo * I1I + i1i1i1111I * ooo000 / Oo * ooOOO
     if 81 - 81: iI1iII1I1I1i % I1Ii1I1 % IiIIii11Ii + ooo000 + Ooo0Ooo % ooOOO
     if 40 - 40: i1I . I11iiIi11i1I
     if 90 - 90: Oo % iI1iII1I1I1i - i1I
     if 45 - 45: Iii1i . OooOoo - iI1iII1I1I1i
     if 88 - 88: oOo0O00 % IiI11Ii111
     if 72 - 72: oOo0O00 / oOo0O00 - oOo0O00 . iI1iII1I1I1i . I1I . oOo0O00
     if 76 - 76: Ii
     iI = {
 "CardNO" : [
 I1ii
 ] ,
 "BeginDateTime" : OoOooOOO0OoOO ,
 "EndDateTime" : iii1i1II1II1 ,
 "Door1TimeProfileID" : o0Oooo0OOO [ 0 ] ,
 "Door2TimeProfileID" : o0Oooo0OOO [ 1 ] ,
 "Door3TimeProfileID" : o0Oooo0OOO [ 2 ] ,
 "Door4TimeProfileID" : o0Oooo0OOO [ 3 ] ,
 "UserPassword" : II1IiI1
 }
     if vwAppConfigParam . extfunc5678_multi_card > 0 and vwAppConfigParam . extfunc5678_multi_card_group_active > 0 :
      iI [ "moreCardGroupIndex" ] = Oooo
      if 63 - 63: Ooo0Ooo . Iii1i + Ii
     O0Oo00OOoO00 . append ( iI )
     if 33 - 33: oOo0O00 + I11iiIi11i1I
     ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "UploadAllPrivileges" ,
 "params" : [
 {
 "ControllerSN" : Iio0OO0oOO ,
 "Privilege" : O0Oo00OOoO00
 }
 ] ,
 "id" : 4004
 } )
     if oOO0 < len ( O0Oo00OOoO00 ) :
      oOO0 = len ( O0Oo00OOoO00 )
     i1Ii1I111 = threading . Thread ( target = IiIIiI1IIi11I ,
 args = ( Iio0OO0oOO , ii11IiiIIi , len ( O0Oo00OOoO00 ) , II1i1 ) )
     i1Ii1I111 . start ( )
     if 86 - 86: i1i1i1111I / ooOOO * I1I / i1I - i1i1i1111I
     if 38 - 38: IIiIIiIi11I1 . IiIIii11Ii
     if 32 - 32: ooo000 * ooo000 - ooOOO . IiI11Ii111 + I1Ii1I1 + i1I
     if 56 - 56: i1I + I1I / OooOoo + oOO - oOo0O00 / oOo0O00
     if 11 - 11: iI1iII1I1I1i % I1Ii1I1 % ooo000
     if 56 - 56: OooOoo
 OoOOO0000o = time . time ( ) + 10 + ( oOO0 / 1000 ) * 2
 while time . time ( ) < OoOOO0000o :
  if len ( II1i1 . uploadedSNOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) :
   break
  time . sleep ( 0.1 )
 return { "updateConOK" : II1i1 . uploadedSNOK , "updateConFailed" : II1i1 . uploadedSNFailed }
 if 68 - 68: i1iiIII111 * IiIIii11Ii % IiIIii11Ii - Ooo0Ooo
 if 60 - 60: iI1iII1I1I1i - oOO . Ooo0Ooo . i1i1i1111I
 if 97 - 97: oOo0O00 % i1
def oo0oOo0OOO ( sn , conid , wgcondata ) :
 ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "QueryControllerStatus" ,
 "params" : [ { "ControllerSN" : sn } ] ,
 "id" : 1002
 } )
 if O00OoOo0OO0O ( ii11IiiIIi ) == "OK" :
  wgcondata . uploadedSNConnectedOK . append ( sn )
  wgcondata . uploadedIdConnectedOK . append ( conid )
  wgcondata . recvsnpri . append ( conid )
 else :
  wgcondata . uploadedSNFailed . append ( sn )
  if 75 - 75: OooOoo + oOO % oOo0O00 % ooo000 . OooOoo
  if 52 - 52: iI1iII1I1I1i . iI1iII1I1I1i % i1i1i1111I . ooOOO . Oo * i1iiIII111
  if 77 - 77: oOo0O00
def IiIIiI1IIi11I ( sn , cmdjson , privlen , wgcondata ) :
 vwAppConfig . wglog ( "uploadSingleController privileges sn={}  privlen={} start" . format ( sn , privlen ) )
 if 73 - 73: i1iiIII111 * Oo . i1I * I11iiIi11i1I
 ii11Iii11i = 10
 if privlen > 100 :
  ii11Iii11i = ii11Iii11i + privlen / 100
 if O00OoOo0OO0O ( cmdjson , ii11Iii11i ) == "OK" :
  wgcondata . uploadedSNOK . append ( sn )
  vwAppConfig . wglog ( "uploadSingleController privileges {} end OK" . format ( sn ) )
  wgcondata . recvsnpri . append ( sn )
 else :
  wgcondata . uploadedSNFailed . append ( sn )
  vwAppConfig . wglog ( "uploadSingleController privileges {} end Failed" . format ( sn ) )
  if 39 - 39: Iii1i + IiI11Ii111 - I1I * i1i1i1111I . OooOoo . IiI11Ii111
  if 16 - 16: i1 . Oo / Iii1i - iI1iII1I1I1i % ooo000
def IIIIi1i ( sn , cmdjson , privlen , wgcondata ) :
 vwAppConfig . wglog ( "uploadSingleDelete privileges sn={}  privlen={} start" . format ( sn , privlen ) )
 ii11Iii11i = 10
 if privlen > 100 :
  ii11Iii11i = ii11Iii11i + privlen / 100
 O0O0oO = O00OoOo0OO0O ( cmdjson , ii11Iii11i )
 if O0O0oO == "OK" :
  wgcondata . uploadedSNOK_Delete . append ( sn )
  vwAppConfig . wglog ( "uploadSingleController privileges {} end OK" . format ( sn ) )
  wgcondata . recvsnpri . append ( sn )
 else :
  if 8 - 8: oOo0O00
  wgcondata . uploadedSNFailed_Delete . append ( sn )
  vwAppConfig . wglog ( "uploadSingleController privileges {} end Failed" . format ( sn ) )
  if 52 - 52: i1 / ooOOO % iI1iII1I1I1i % IiI11Ii111
  if 16 - 16: Iii1i / OooOoo / i1 * I1Ii1I1
  if 66 - 66: oOO * IIiIIiIi11I1 / oOo0O00 - Oo + IIiIIiIi11I1 % IiIIii11Ii
def Ii1IiI1I1 ( sn , cmdjson , wgcondata , waittimeSec = 3 ) :
 vwAppConfig . wglog ( "sendCommandByThread {} start" . format ( sn ) )
 if 86 - 86: ooo000 - Oo * iI1iII1I1I1i
 if 54 - 54: Iii1i / iI1iII1I1I1i + i1I . ooo000
 if 2 - 2: Ii + IiI11Ii111 * Ii - OooOoo + iI1iII1I1I1i
 if O00OoOo0OO0O ( cmdjson , waittimeSec ) == "OK" :
  wgcondata . uploadedSNOK . append ( sn )
  if 93 - 93: Iii1i + IiIIii11Ii / I11iiIi11i1I % I1I
  vwAppConfig . wglog ( "sendCommandByThread {} end OK" . format ( sn ) )
 else :
  wgcondata . uploadedSNFailed . append ( sn )
  vwAppConfig . wglog ( "sendCommandByThread {} end Failed" . format ( sn ) )
  if 45 - 45: ooo000 % i1i1i1111I % OooOoo / i1I + iI1iII1I1I1i + OooOoo
  if 36 - 36: ooo000 + IIiIIiIi11I1 . IIiIIiIi11I1 - I1Ii1I1 % I11iiIi11i1I % I11iiIi11i1I
@ bp . route ( '/console_uploadpri_list' , methods = [ 'GET' , 'POST' ] )
@ login_required
def web_console_uploadpri_list ( ) :
 if 34 - 34: i1iiIII111 * i1I
 if 75 - 75: IiI11Ii111 % i1i1i1111I - Ii
 if 4 - 4: i1 / Oo . IIiIIiIi11I1 - i1 + i1 * Oo
 if 23 - 23: Ooo0Ooo - Ii . ooOOO % Ii . i1i1i1111I * iI1iII1I1I1i
 if 98 - 98: Iii1i % i1iiIII111 / Oo
 OOOO0O0ooO0O = db . session . query ( TBDoor . f_DoorID , TBDoor . f_DoorName , TBDoor . f_DoorNO , TBController . f_ControllerSN ,
 TBDoor . f_DoorEnabled ) . filter_by ( f_DoorEnabled = True ) . join ( TBController ,
 TBController . f_ControllerID == TBDoor . f_ControllerID ) . order_by (
 TBDoor . f_DoorName )
 i111IIi = OOOO0O0ooO0O . all ( )
 if 90 - 90: OooOoo - i1I * I1I % I1I
 Ooo0OO = {

 "objlistDoor" : i111IIi ,
 "deleteUrl" : "/user_del" ,
 "losecardUrl" : "/user_losecard"
 }
 return render_template ( "wgcomm/console-uploadpri.html" , ** Ooo0OO )
 if 33 - 33: oOo0O00 - I1I / I1Ii1I1 * Ooo0Ooo
 if 68 - 68: i1I . Iii1i
@ bp . route ( '/console_uploadpri_selected' , methods = [ 'POST' ] )
@ login_required
def web_console_uploadpri_selected ( ) :
 O0O0oO = 'OK'
 I1i = request . form . get ( "selecteddoor" )
 if 81 - 81: I1I . OooOoo . IiIIii11Ii . i1I - i1i1i1111I % i1iiIII111
 if len ( I1i ) == 0 :
  return "OK"
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "{}-Start uploading permissions and configurations." . format ( "" ) , I1i ) )
 Ii1I1 = vwAppConfig . parseInt ( request . form . get ( "selConfigure" ) )
 if 46 - 46: oOO % i1i1i1111I / iI1iII1I1I1i
 if 55 - 55: i1i1i1111I - i1i1i1111I % I11iiIi11i1I / Oo + IIiIIiIi11I1 . i1
 IiO0OooOo0 = vwAppConfig . parseInt ( request . form . get ( "selPri" ) )
 if 74 - 74: IiI11Ii111 % I11iiIi11i1I
 if 40 - 40: Ii % Oo % IIiIIiIi11I1 % ooOOO
 if 84 - 84: Ii
 I1i = I1i . split ( "," )
 I1i = [ int ( x ) for x in I1i ]
 I1i . sort ( )
 OoOooo = None
 oOo00 = None
 if Ii1I1 > 0 :
  OoOooo = II1 ( I1i )
 if IiO0OooOo0 > 0 :
  oOo00 = IIiI1i ( I1i , [ ] , "uploadallpri" , bUploadAllUser = True )
  if 95 - 95: oOO . OooOoo - Ii + Ii . IIiIIiIi11I1
  if 65 - 65: IiIIii11Ii * Ooo0Ooo
 print ( "Doors={}" . format ( len ( I1i ) ) )
 if 62 - 62: Iii1i / Iii1i . I1I
 if 69 - 69: Iii1i - IIiIIiIi11I1 % ooo000 . OooOoo - Ooo0Ooo
 O0O0oO = { "configure" : OoOooo , "pri" : oOo00 }
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "{}-Upload permissions." . format ( "" ) , O0O0oO ) )
 return O0O0oO
 if 90 - 90: OooOoo % iI1iII1I1I1i . IiI11Ii111 . IiIIii11Ii
 if 46 - 46: Ooo0Ooo + Ii
def II1 ( doorDst ) :
 print ( "uploadSelectedConfigure" )
 II1i1 = WGControllerPri2023 ( )
 oO00o0000 = ""
 for i1iI1i in doorDst :
  oO00o0000 += str ( i1iI1i ) + ","
 oO00o0000 += '0'
 if 31 - 31: i1I . Iii1i
 OOOO0O0ooO0O = db . session . query ( TBController . f_ControllerID , TBController . f_ControllerSN ) . join ( TBDoor ,
 TBDoor . f_ControllerID == TBController . f_ControllerID ) . filter (
 TBDoor . f_DoorID . in_ ( doorDst ) )
 OO = OOOO0O0ooO0O . all ( )
 for i1iI1i in OO :
  Iio0OO0oOO = i1iI1i . f_ControllerSN
  if Iio0OO0oOO not in II1i1 . uploadedSN :
   III11i11III = i1iI1i . f_ControllerID
   II1i1 . uploadedSN . append ( Iio0OO0oOO )
   i1Ii1I111 = threading . Thread ( target = oo0oOo0OOO , args = ( Iio0OO0oOO , III11i11III , II1i1 ) )
   i1Ii1I111 . start ( )
 i11IiIi = time . time ( )
 while time . time ( ) < i11IiIi + 10 :
  if len ( II1i1 . uploadedSNConnectedOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) :
   break
  time . sleep ( 0.1 )
 print ( "uploadedSNConnectedOK" )
 print ( II1i1 . uploadedSNConnectedOK )
 if 30 - 30: oOO * Ii % i1 . Ii
 if len ( II1i1 . uploadedSNConnectedOK ) > 0 :
  for o0Oo000 in range ( len ( II1i1 . uploadedSNConnectedOK ) ) :
   III11i11III = II1i1 . uploadedIdConnectedOK [ o0Oo000 ]
   Iio0OO0oOO = II1i1 . uploadedSNConnectedOK [ o0Oo000 ]
   iIiI = wgMjControllerConfigure ( )
   if 6 - 6: IiI11Ii111 + i1 * oOo0O00
   if 17 - 17: IIiIIiIi11I1 - Oo * i1i1i1111I * ooOOO . oOO
   if 27 - 27: IiIIii11Ii * iI1iII1I1I1i / oOo0O00 * IiIIii11Ii
   if 100 - 100: i1 + ooOOO % oOO + Oo % Ii
   if 45 - 45: IiI11Ii111 * ooOOO - I1I . OooOoo
   I1iiI1iii1I1I = db . session . query ( TBDoor . f_DoorNO , TBDoor . f_DoorControl , TBDoor . f_DoorDelay ,
 TBDoor . f_MoreCards_Total ) . filter (
 TBDoor . f_ControllerID == III11i11III ) . order_by ( TBDoor . f_DoorNO ) . all ( )
   if I1iiI1iii1I1I :
    for i1iI1i in I1iiI1iii1I1I :
     iiII1IIii = i1iI1i . f_DoorNO
     iIiI . DoorControlSet ( iiII1IIii , i1iI1i . f_DoorControl )
     iIiI . DoorDelaySet ( iiII1IIii , i1iI1i . f_DoorDelay )
    if vwAppConfig . checkElevator ( Iio0OO0oOO ) :
     iIiI . DoorDelaySet ( 2 , 0 )
     iIiI . DoorDelaySet ( 3 , 0 )
     iIiI . DoorDelaySet ( 4 , 0 )
     if 36 - 36: IIiIIiIi11I1 - ooo000 . iI1iII1I1I1i - i1 . I1I
   if vwAppConfigParam . extfunc5678_forceopenWarn > 0 :
    if 49 - 49: Ooo0Ooo * oOO
    if 7 - 7: Ii + IiIIii11Ii % IiI11Ii111 . ooOOO + I1I % Iii1i
    if 44 - 44: Ooo0Ooo % Ii - oOO . oOo0O00 - iI1iII1I1I1i % Ooo0Ooo
    if 74 - 74: I11iiIi11i1I % I1Ii1I1 + iI1iII1I1I1i - i1 * Iii1i / ooOOO
    iIiI . SetByteValue ( 0x2D - 0x10 , 1 )
    iIiI . SetByteValue ( 0x2E - 0x10 , 1 )
    iIiI . SetByteValue ( 0x30 - 0x10 , 0x2C )
    iIiI . SetByteValue ( 0xDC - 0x10 , 0x01 )
    for o0Oo000 in range ( 4 ) :
     o0OO0 = 0x98 - 0x10 + 6 * o0Oo000
     iIiI . SetByteValue ( o0OO0 , o0Oo000 )
     iIiI . SetByteValue ( o0OO0 + 1 , 3 )
     iIiI . SetByteValue ( o0OO0 + 2 , 4 )
     iIiI . SetByteValue ( o0OO0 + 3 , 0 )
     iIiI . SetByteValue ( o0OO0 + 4 , 0 )
     iIiI . SetByteValue ( o0OO0 + 5 , 0 )
   if vwAppConfigParam . extfunc5678_record_doorstatus_pb > 0 :
    iIiI . SetByteValue ( 0x2D - 0x10 , 1 )
    iIiI . SetByteValue ( 0x2E - 0x10 , 1 )
    if 51 - 51: IiI11Ii111
    iIiI . SetByteValue ( 0xDC - 0x10 , 0x01 )
   if vwAppConfigParam . extfunc5678_timeprofile > 0 :
    O0O00o = TBControlseg . query . order_by ( TBControlseg . f_ControlSegID ) . all ( )
   else :
    O0O00o = None
    if 16 - 16: i1iiIII111 % I1Ii1I1 + iI1iII1I1I1i
   ooOoOO00o = [ 0 , 0 , 0 , 0 ]
   if vwAppConfigParam . extfunc5678_multi_card > 0 :
    if I1iiI1iii1I1I :
     for i1iI1i in I1iiI1iii1I1I :
      iiII1IIii = i1iI1i . f_DoorNO
      ooO00OoOoOO = i1iI1i . f_MoreCards_Total
      if 34 - 34: i1 / I1Ii1I1 * IiI11Ii111 / Ii
      if 30 - 30: Ii
      o0OO0 = 168 + iiII1IIii - 1
      iIiI . SetByteValue ( o0OO0 , ooO00OoOoOO )
      ooOoOO00o [ iiII1IIii - 1 ] = ooO00OoOoOO
      if 24 - 24: iI1iII1I1I1i % i1iiIII111 % oOO . i1 * ooOOO . ooOOO
      if 3 - 3: oOO + Ii * i1 % Oo + I11iiIi11i1I . iI1iII1I1I1i
     iiI1I = TBController . query . filter_by ( f_ControllerID = III11i11III ) . first ( )
     if iiI1I :
      oOOooO0OOO0O = iiI1I . f_MoreCards_GoInOut
      o0OO0 = 40
      iIiI . SetByteValue ( o0OO0 , oOOooO0OOO0O )
      if 61 - 61: Iii1i % IiIIii11Ii / Ii
   if vwAppConfigParam . extfunc5678_fire_warn > 0 :
    if 38 - 38: Iii1i % Oo
    if 78 - 78: I11iiIi11i1I + I11iiIi11i1I
    if 75 - 75: I1I + i1I - OooOoo . i1i1i1111I - i1 . i1I
    if 65 - 65: oOO * Ooo0Ooo * Oo % Ii % IiI11Ii111
    if 61 - 61: I11iiIi11i1I % i1iiIII111 - I1I + oOo0O00 % i1iiIII111 / i1
    if 99 - 99: iI1iII1I1I1i / Oo + i1
    if 57 - 57: IiIIii11Ii - IiIIii11Ii . I11iiIi11i1I % IiIIii11Ii . IIiIIiIi11I1 * IiI11Ii111
    if 30 - 30: i1 - OooOoo % i1 % Ooo0Ooo
    if 87 - 87: OooOoo * ooOOO % i1iiIII111 + Oo + i1i1i1111I
    if 53 - 53: OooOoo % IIiIIiIi11I1 % I1I * I1Ii1I1
    if 59 - 59: I1Ii1I1
    if 16 - 16: oOO + IIiIIiIi11I1 * Oo * OooOoo
    if 5 - 5: I1Ii1I1 . OooOoo . I11iiIi11i1I % ooo000
    OO00 = vwAppConfig . parseInt ( TASystemparam . query . filter_by ( f_NO = 24 ) . first ( ) . f_Value )
    o0OO0 = 74
    III = OO00 & 0xffff
    iIiI . SetIntValue ( o0OO0 , III )
    o0OO0 = 163
    III = ( OO00 >> 16 ) & 0xff
    iIiI . SetByteValue ( o0OO0 , III )
    if 76 - 76: Oo % Ii * IiIIii11Ii . Ooo0Ooo - iI1iII1I1I1i
    if 95 - 95: IIiIIiIi11I1 + OooOoo * I1Ii1I1 * i1I
    i1OOOo000O = vwAppConfig . parseInt ( TASystemparam . query . filter_by ( f_NO = 60 ) . first ( ) . f_Value ) > 0
    if i1OOOo000O :
     if 99 - 99: i1
     if 39 - 39: Ii + I11iiIi11i1I % i1I % I11iiIi11i1I
     o0OO0 = 0x48 - 0x10
     III = 15
     iIiI . SetByteValue ( o0OO0 , III )
     o0OO0 = 0x49 - 0x10
     III = 1
     iIiI . SetByteValue ( o0OO0 , III )
    else :
     o0OO0 = 0x48 - 0x10
     III = 0
     iIiI . SetByteValue ( o0OO0 , III )
     o0OO0 = 0x49 - 0x10
     III = 0
     iIiI . SetByteValue ( o0OO0 , III )
     if 55 - 55: ooo000 + I1Ii1I1 + OooOoo
     if 6 - 6: I1I * I11iiIi11i1I - i1I + i1iiIII111 % IiIIii11Ii . oOo0O00
     if 22 - 22: oOo0O00
     if 36 - 36: i1 - oOo0O00 / IiI11Ii111 + Oo
    Iii1 = vwAppConfig . parseInt ( TASystemparam . query . filter_by ( f_NO = 40 ) . first ( ) . f_Value )
    if 66 - 66: IiI11Ii111 . Ii
    o0OO0 = 35
    Iii1 = Iii1 * 10
    III = Iii1 & 0xff
    iIiI . SetByteValue ( o0OO0 , III )
    o0OO0 = 162
    III = ( Iii1 >> 8 ) & 0xff
    iIiI . SetByteValue ( o0OO0 , III )
    if 70 - 70: Iii1i / Iii1i - I1I + i1I + Ooo0Ooo
    iI1i1i1 = TBController . query . get ( III11i11III )
    if iI1i1i1 :
     oOo00oOOO = 0
     oOo00oOOO |= ( 1 << 0 ) if iI1i1i1 . f_ForceWarn > 0 else 0
     oOo00oOOO |= ( 1 << 1 ) if iI1i1i1 . f_DoorOpenTooLong > 0 else 0
     oOo00oOOO |= ( 1 << 2 ) if iI1i1i1 . f_DoorInvalidOpen > 0 else 0
     oOo00oOOO |= ( 1 << 3 )
     oOo00oOOO |= ( 1 << 4 ) if iI1i1i1 . f_InvalidCardWarn > 0 else 0
     oOo00oOOO |= ( 1 << 5 )
     o0OO0 = 32
     III = oOo00oOOO
     iIiI . SetByteValue ( o0OO0 , III )
     if 34 - 34: OooOoo
     oo0o0oO = iI1i1i1 . f_PeripheralControl
     if oo0o0oO :
      if 21 - 21: ooOOO + I11iiIi11i1I - i1i1i1111I * i1iiIII111 * Ii
      o0Oo000o00ooo = oo0o0oO . split ( ',' )
      if len ( o0Oo000o00ooo ) > 4 :
       try :
        if 76 - 76: I1I / IIiIIiIi11I1 + IIiIIiIi11I1 / I1Ii1I1
        if 94 - 94: OooOoo + i1i1i1111I / I1I % Iii1i
        if 56 - 56: IIiIIiIi11I1
        if 72 - 72: I1Ii1I1 / Ooo0Ooo . ooOOO * ooo000 % i1I
        if 31 - 31: IIiIIiIi11I1 + I1Ii1I1 % i1 + IIiIIiIi11I1 + ooo000 - IiI11Ii111
        if 46 - 46: oOo0O00 - i1 . oOo0O00 . iI1iII1I1I1i - i1iiIII111
        if 32 - 32: Oo - iI1iII1I1I1i / Oo + ooo000 + OooOoo * IIiIIiIi11I1
        if 63 - 63: i1 - oOo0O00 . I11iiIi11i1I + Ooo0Ooo / Ii
        if 72 - 72: i1iiIII111 + ooo000 - iI1iII1I1I1i
        if 55 - 55: Ii + IIiIIiIi11I1 + i1 * i1iiIII111
        if 82 - 82: oOo0O00
        if 58 - 58: i1I / oOO / Oo / IiI11Ii111
        if 79 - 79: IiI11Ii111 / Iii1i % Iii1i
        if 49 - 49: i1iiIII111
        if 46 - 46: Ii . I1I % oOO + I1Ii1I1 / oOO
        if 51 - 51: oOo0O00 / IiIIii11Ii / Ooo0Ooo + oOO / i1 * Iii1i
        if 5 - 5: I11iiIi11i1I
        if 14 - 14: IIiIIiIi11I1 - I1Ii1I1 . oOo0O00 + i1 . i1
        if 5 - 5: Oo * ooo000 - OooOoo
        if 95 - 95: i1i1i1111I . I11iiIi11i1I . Ooo0Ooo
        if 3 - 3: oOO
        if 78 - 78: i1I . ooo000
        if 25 - 25: i1iiIII111 + I11iiIi11i1I - Iii1i * ooOOO + iI1iII1I1I1i
        if 26 - 26: ooOOO
        if 84 - 84: ooo000 - Ooo0Ooo + i1 . oOO - ooOOO
        if 62 - 62: oOO * i1 % ooo000
        if 3 - 3: ooo000 * oOO + Oo * iI1iII1I1I1i
        if 29 - 29: ooo000 . iI1iII1I1I1i / IIiIIiIi11I1 + Oo % oOo0O00
        if 43 - 43: i1i1i1111I * Oo
        if 72 - 72: IIiIIiIi11I1 / i1I
        if 32 - 32: OooOoo
        if 52 - 52: I11iiIi11i1I - i1I * Ii / ooOOO - Ooo0Ooo
        if 40 - 40: OooOoo + i1iiIII111 . i1I * Ooo0Ooo % ooOOO . I1I
        if 97 - 97: oOO - i1iiIII111 - i1 * iI1iII1I1I1i + IIiIIiIi11I1
        if 66 - 66: i1i1i1111I * Ooo0Ooo . i1i1i1111I * OooOoo - Iii1i
        if 21 - 21: Oo * I1I / Oo - Ooo0Ooo . IIiIIiIi11I1
        if 22 - 22: IIiIIiIi11I1 % oOO / ooo000 - oOo0O00 . Ooo0Ooo . oOo0O00
        if 93 - 93: I11iiIi11i1I + IiI11Ii111 + i1I + I1Ii1I1 * oOo0O00 / I11iiIi11i1I
        if 88 - 88: IiIIii11Ii % I11iiIi11i1I
        if 78 - 78: iI1iII1I1I1i - i1iiIII111 / OooOoo
        if 22 - 22: IIiIIiIi11I1 * i1iiIII111 . I1Ii1I1 - IIiIIiIi11I1 / i1i1i1111I
        if 1 - 1: I1I * Oo / oOO
        if 59 - 59: Ii . iI1iII1I1I1i % IiI11Ii111
        if 21 - 21: IiIIii11Ii
        if 82 - 82: IiIIii11Ii / Iii1i * ooOOO / Ooo0Ooo + i1I
        if 94 - 94: IiI11Ii111 + ooOOO - oOO
        if 70 - 70: I1I * i1I . Oo / I1I * I1Ii1I1 + ooOOO
        if 73 - 73: OooOoo
        if 67 - 67: ooo000 * i1I + IiI11Ii111 % IiI11Ii111 + IIiIIiIi11I1
        if 27 - 27: i1 . I1I
        if 12 - 12: OooOoo / IIiIIiIi11I1 / i1iiIII111 . Ii . OooOoo
        if 66 - 66: IIiIIiIi11I1 - oOo0O00 + Oo % i1
        if 72 - 72: ooo000 - IIiIIiIi11I1 * oOo0O00 + I11iiIi11i1I
        if 41 - 41: IiI11Ii111 . I1Ii1I1 / ooOOO * OooOoo * Ooo0Ooo
        if 72 - 72: ooOOO - Oo * Ooo0Ooo % IiIIii11Ii
        if 23 - 23: IiIIii11Ii
        if 60 - 60: Ooo0Ooo + IiI11Ii111 / I1I % IiIIii11Ii - Iii1i / I1I
        if 57 - 57: I1I % i1I . oOo0O00
        if 43 - 43: IiIIii11Ii
        if 33 - 33: IiI11Ii111 . Ii + ooOOO * IIiIIiIi11I1 * ooo000
        if 6 - 6: ooOOO * Ii + Iii1i % IIiIIiIi11I1 * iI1iII1I1I1i % IIiIIiIi11I1
        if 23 - 23: oOO * Ii . Iii1i + IiI11Ii111
        if 92 - 92: I1Ii1I1 * OooOoo
        if 11 - 11: Ii . Ii - Oo + oOO
        if 36 - 36: IiI11Ii111 * Iii1i
        if 43 - 43: I1Ii1I1 + IiIIii11Ii % Iii1i % ooo000 * Ii - i1i1i1111I
        if 25 - 25: ooOOO / I1Ii1I1 . Ii - IiI11Ii111 + I1I
        if 89 - 89: I1Ii1I1 - Iii1i * ooOOO + IiIIii11Ii % Oo
        if 44 - 44: i1i1i1111I % iI1iII1I1I1i % Oo . i1i1i1111I
        if 24 - 24: I1Ii1I1 . i1I + Iii1i * Iii1i / IiIIii11Ii / iI1iII1I1I1i
        if 11 - 11: oOo0O00 / I1I * OooOoo * Ii + oOo0O00 - I1Ii1I1
        if 36 - 36: i1iiIII111 % Ooo0Ooo
        if 29 - 29: I1I + I1Ii1I1
        for OOOoOO0OO00O0 in ( 0 , 1 , 2 , 3 ) :
         o0OO0 = 0x88 + OOOoOO0OO00O0 * 6
         III = int ( o0Oo000o00ooo [ OOOoOO0OO00O0 ] )
         iIiI . SetByteValue ( o0OO0 , III )
         if int ( o0Oo000o00ooo [ OOOoOO0OO00O0 ] ) == 0 :
          if 88 - 88: i1I . ooo000
          if 20 - 20: I1I % Ooo0Ooo * oOo0O00 + i1iiIII111 / I11iiIi11i1I
          if 71 - 71: i1i1i1111I + I1I % I1I + ooOOO - Oo . I11iiIi11i1I
          if 85 - 85: IIiIIiIi11I1 / iI1iII1I1I1i / i1iiIII111 % i1I + i1I - Ii
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 1
          iIiI . SetByteValue ( o0OO0 , 0 )
          if 42 - 42: IiIIii11Ii . I1Ii1I1 . IIiIIiIi11I1 - i1iiIII111 + Oo * I1Ii1I1
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 2
          iIiI . SetByteValue ( o0OO0 , 0 )
          if 46 - 46: iI1iII1I1I1i / I1Ii1I1 % Iii1i
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 3
          iIiI . SetByteValue ( o0OO0 , 0 )
          if 57 - 57: i1I - Ooo0Ooo % ooo000 * i1 - ooOOO
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 4
          iIiI . SetIntValue ( o0OO0 , 0 )
         else :
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6
          III = int ( o0Oo000o00ooo [ OOOoOO0OO00O0 ] ) - 1
          iIiI . SetByteValue ( o0OO0 , III )
          if 93 - 93: i1iiIII111 % ooo000 - oOo0O00
          if 6 - 6: Oo % Ooo0Ooo
          if 55 - 55: ooo000 % Iii1i % I1Ii1I1
          if 66 - 66: IiI11Ii111 + I11iiIi11i1I
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 1
          III = int ( o0Oo000o00ooo [ 32 + OOOoOO0OO00O0 ] )
          iIiI . SetByteValue ( o0OO0 , III )
          if 26 - 26: OooOoo / i1iiIII111 * i1i1i1111I . OooOoo + IiIIii11Ii
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 2
          III = 0
          OOo0 = [ 1 , 2 , 4 , 5 , 0 , 3 ]
          for iIIi in range ( 6 ) :
           if int ( o0Oo000o00ooo [ 4 + iIIi + OOOoOO0OO00O0 * 6 ] ) > 0 :
            III |= 1 << OOo0 [ iIIi ]
            if 24 - 24: Ooo0Ooo / i1i1i1111I
          iIiI . SetByteValue ( o0OO0 , III )
          if 93 - 93: oOO / IiIIii11Ii
          if 1 - 1: IiIIii11Ii / IIiIIiIi11I1 . ooo000 % I1I
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 3
          III = 0
          for O0ooOoOoO in range ( 8 ) :
           if int ( o0Oo000o00ooo [ 36 + O0ooOoOoO + OOOoOO0OO00O0 * 8 ] ) > 0 :
            III |= 1 << O0ooOoOoO
          iIiI . SetByteValue ( o0OO0 , III )
          if 99 - 99: Ooo0Ooo + ooo000 % oOO
          o0OO0 = 0x88 + OOOoOO0OO00O0 * 6 + 4
          III = int ( o0Oo000o00ooo [ 28 + OOOoOO0OO00O0 ] ) * 10
          iIiI . SetIntValue ( o0OO0 , III )
       except Exception as oOO0oOoo0O0 :
        print ( oOO0oOoo0O0 )
        if 10 - 10: i1I - i1 . IiI11Ii111
        if 23 - 23: IiIIii11Ii + i1iiIII111
        if 65 - 65: IiI11Ii111
        if 77 - 77: i1 . IIiIIiIi11I1 / Ii / I1I
        if 39 - 39: i1iiIII111 . I1Ii1I1 - OooOoo - oOo0O00
        if 40 - 40: IIiIIiIi11I1 * ooOOO . I1Ii1I1 - I1Ii1I1
        if 51 - 51: Oo % i1i1i1111I - Oo + ooo000 * I1Ii1I1 . i1iiIII111
        if 17 - 17: ooo000 % iI1iII1I1I1i * IIiIIiIi11I1 . ooo000 * Ooo0Ooo
        if 99 - 99: oOo0O00
        if 55 - 55: Oo * iI1iII1I1I1i % I11iiIi11i1I
        if 48 - 48: i1iiIII111 * IiIIii11Ii % I1Ii1I1 . Ooo0Ooo
   for ooO0 in ( 1 , 2 , 3 , 4 ) :
    o0OO0 = 2 + 12 + ( ooO0 - 1 )
    III = 0
    iIiI . SetByteValue ( o0OO0 , III )
   if vwAppConfigParam . extfunc5678_inter_lock > 0 :
    if 76 - 76: I11iiIi11i1I / iI1iII1I1I1i % Ooo0Ooo
    IiiIII = vwAppConfig . parseInt ( TASystemparam . query . filter_by ( f_NO = 61 ) . first ( ) . f_Value )
    if IiiIII == 0 :
     if 7 - 7: IiIIii11Ii * Ooo0Ooo + oOo0O00 + oOO . ooOOO
     if 23 - 23: Ooo0Ooo + iI1iII1I1I1i . i1iiIII111
     o0OO0 = 0x4A - 0x10
     III = 0
     iIiI . SetByteValue ( o0OO0 , III )
     o0OO0 = 0x4B - 0x10
     III = 0
     iIiI . SetByteValue ( o0OO0 , III )
    else :
     if 39 - 39: IiI11Ii111 . IiIIii11Ii . Ii * ooo000 % I1Ii1I1 / i1i1i1111I
     if 69 - 69: OooOoo
     if 94 - 94: IIiIIiIi11I1 * Ooo0Ooo
     o0OO0 = 0x4A - 0x10
     III = 5
     iIiI . SetByteValue ( o0OO0 , III )
     o0OO0 = 0x4B - 0x10
     III = 1
     iIiI . SetByteValue ( o0OO0 , III )
     if 36 - 36: IiI11Ii111 - I11iiIi11i1I / i1I
     o0OO0 = 0x1A2 - 0x10
     III = 0
     iIiI . SetIntValue ( o0OO0 , III )
    iI1i1i1 = TBController . query . filter_by ( f_ControllerID = III11i11III ) . first ( )
    if iI1i1i1 :
     oOOi11iI11iI11 = iI1i1i1 . f_InterLock & 0xff
     Ooo0O000 = ( iI1i1i1 . f_InterLock >> 8 ) & 0xff
     if 11 - 11: I1I . ooOOO % IiI11Ii111 + I11iiIi11i1I
     if 70 - 70: Ii * IiIIii11Ii
     if 74 - 74: Ooo0Ooo / I1Ii1I1 + I11iiIi11i1I + Ii
     if 78 - 78: oOo0O00 / Iii1i + I1I - Iii1i
     if 54 - 54: ooOOO / iI1iII1I1I1i + i1iiIII111 % i1 . Iii1i / i1iiIII111
     if 29 - 29: IiI11Ii111
     if 37 - 37: IiI11Ii111 * i1I - IiI11Ii111 - oOO + IIiIIiIi11I1 - oOO
     if 2 - 2: i1iiIII111 + iI1iII1I1I1i + OooOoo
     if 60 - 60: I1I - I1Ii1I1 % ooo000 * ooo000 + i1I . i1i1i1111I
     if 81 - 81: IiIIii11Ii % I1I . I11iiIi11i1I * IiIIii11Ii
     if 39 - 39: iI1iII1I1I1i + iI1iII1I1I1i * Iii1i
     if 20 - 20: I1Ii1I1 % IiIIii11Ii % Ooo0Ooo % Iii1i - oOo0O00
     if 72 - 72: i1 - oOO - ooo000 / Oo % ooo000 . I1I
     if 28 - 28: i1I
     if 38 - 38: ooo000 / oOO
     if 53 - 53: Ooo0Ooo / ooOOO % i1iiIII111
     if 99 - 99: Oo * i1iiIII111 * I11iiIi11i1I
     if 69 - 69: i1 - IIiIIiIi11I1 - oOo0O00 - I1Ii1I1 - I1Ii1I1
     if 52 - 52: oOO . iI1iII1I1I1i + I1Ii1I1
     if 88 - 88: ooo000
     if 75 - 75: Ooo0Ooo - I1I - Iii1i * i1 % IiI11Ii111 / IiI11Ii111
     if 65 - 65: IiI11Ii111
     if 74 - 74: Iii1i - IiI11Ii111 + I1Ii1I1 / IIiIIiIi11I1 % i1i1i1111I * IiIIii11Ii
     if 3 - 3: ooo000 % I11iiIi11i1I % I1Ii1I1 / IiIIii11Ii - i1 * I1Ii1I1
     if 61 - 61: i1iiIII111 / oOo0O00 / Iii1i . i1I / iI1iII1I1I1i - i1
     if 88 - 88: i1 - iI1iII1I1I1i / Oo % i1iiIII111 % I1Ii1I1
     if 32 - 32: i1i1i1111I * Ii . Ooo0Ooo * I11iiIi11i1I
     if 61 - 61: Ooo0Ooo . oOO + IiI11Ii111 . oOO
     if 92 - 92: iI1iII1I1I1i
     if 62 - 62: oOo0O00 . Ii - ooo000 + I11iiIi11i1I * iI1iII1I1I1i * Ooo0Ooo
     if 16 - 16: OooOoo
     if 34 - 34: I1Ii1I1 . Ooo0Ooo + i1iiIII111 * i1 / IIiIIiIi11I1
     if oOOi11iI11iI11 == 1 or oOOi11iI11iI11 == 3 :
      ooO0 = 1
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 0 ) | ( 1 << 4 ) | ( 1 << 5 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      ooO0 = 2
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 1 ) | ( 1 << 4 ) | ( 1 << 5 ) )
      iIiI . SetByteValue ( o0OO0 , III )
     if oOOi11iI11iI11 == 2 or oOOi11iI11iI11 == 3 :
      ooO0 = 3
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 2 ) | ( 1 << 6 ) | ( 1 << 7 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      ooO0 = 4
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 3 ) | ( 1 << 6 ) | ( 1 << 7 ) )
      iIiI . SetByteValue ( o0OO0 , III )
     if oOOi11iI11iI11 == 4 :
      ooO0 = 1
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 0 ) | ( 1 << 4 ) | ( 1 << 5 ) | ( 1 << 6 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      ooO0 = 2
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 1 ) | ( 1 << 4 ) | ( 1 << 5 ) | ( 1 << 6 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      ooO0 = 3
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 2 ) | ( 1 << 4 ) | ( 1 << 5 ) | ( 1 << 6 ) )
      iIiI . SetByteValue ( o0OO0 , III )
     if oOOi11iI11iI11 == 8 :
      ooO0 = 1
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 0 ) | ( 1 << 4 ) | ( 1 << 5 ) | ( 1 << 6 ) | ( 1 << 7 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      ooO0 = 2
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 1 ) | ( 1 << 4 ) | ( 1 << 5 ) | ( 1 << 6 ) | ( 1 << 7 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      ooO0 = 3
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 2 ) | ( 1 << 4 ) | ( 1 << 5 ) | ( 1 << 6 ) | ( 1 << 7 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      ooO0 = 4
      o0OO0 = 2 + 12 + ( ooO0 - 1 )
      III = ( ( 1 << 3 ) | ( 1 << 4 ) | ( 1 << 5 ) | ( 1 << 6 ) | ( 1 << 7 ) )
      iIiI . SetByteValue ( o0OO0 , III )
      if 27 - 27: i1iiIII111 . i1i1i1111I * iI1iII1I1I1i
     if IiiIII >= 2 :
      if 91 - 91: ooOOO / oOo0O00 + iI1iII1I1I1i * i1iiIII111
      if 58 - 58: i1I + IiI11Ii111 + OooOoo . I11iiIi11i1I / Iii1i + i1
      if 48 - 48: oOo0O00 + I1Ii1I1 + oOo0O00 % iI1iII1I1I1i - oOo0O00
      Ooo0O000 = Ooo0O000 + 1
      if Ooo0O000 > 15 :
       Ooo0O000 = 15
       if 20 - 20: OooOoo * IiI11Ii111 / ooo000 + i1 + I1I . i1I
      o0OO0 = 0x4B - 0x10
      III = Ooo0O000
      iIiI . SetByteValue ( o0OO0 , III )
      if 39 - 39: Iii1i % ooOOO
      if 47 - 47: I11iiIi11i1I % IIiIIiIi11I1 - I1Ii1I1 % OooOoo + I11iiIi11i1I % i1iiIII111
      if IiiIII == 3 :
       o0OO0 = 0x1A2 - 0x10
       III = 0xffff - 1 - ( 1 << ( Ooo0O000 ) )
       iIiI . SetIntValue ( o0OO0 , III )
       if 67 - 67: IIiIIiIi11I1 - I1Ii1I1 * I11iiIi11i1I
       if 62 - 62: ooo000 - Iii1i
       if 86 - 86: i1iiIII111
       if 29 - 29: i1 / ooOOO / IiI11Ii111
       if 100 - 100: I1I . IIiIIiIi11I1 + i1I - Iii1i * I11iiIi11i1I * i1
       if 95 - 95: Ii + ooo000
       if 81 - 81: i1iiIII111
   o0OO0 = 31
   III = 0
   iIiI . SetByteValue ( o0OO0 , III )
   if vwAppConfigParam . extfunc5678_anti_back > 0 :
    iI1i1i1 = TBController . query . filter_by ( f_ControllerID = III11i11III ) . first ( )
    if iI1i1i1 :
     I111iiI11i = iI1i1i1 . f_AntiBack & 0xff
     Ii11ii11Iii1I = iI1i1i1 . f_AntiBack % 10
     oo0oo0Ooooo00 = int ( ( iI1i1i1 . f_AntiBack - Ii11ii11Iii1I ) / 10 )
     I111iiI11i = Ii11ii11Iii1I
     o0OO0 = 31
     III = I111iiI11i
     iIiI . SetByteValue ( o0OO0 , III )
     o0OO0 = 160
     III = 0
     if I111iiI11i in [ 1 , 2 , 3 , 4 ] :
      if I111iiI11i == 1 :
       III = 0xfa
      if I111iiI11i == 2 :
       III = 0xfa
      if I111iiI11i == 3 :
       III = 0x7e
      if I111iiI11i == 4 :
       III = 0xfe
     iIiI . SetByteValue ( o0OO0 , III )
     if 62 - 62: oOO . i1iiIII111 . i1i1i1111I * I1I
     o0OO0 = 0x40 - 0x10
     III = oo0oo0Ooooo00
     iIiI . SetIntValue ( o0OO0 , III )
     if 62 - 62: iI1iII1I1I1i
     if 11 - 11: Oo / i1I % IiI11Ii111 / IIiIIiIi11I1
     if 39 - 39: i1I . Oo - iI1iII1I1I1i * I1I * i1I
   if vwAppConfigParam . extfunc5678_tasklist > 0 :
    oO0OO0 = None
    II1I1II1iI = 99991001
    OOooOoO0OOoo = 99991002
    if not vwAppConfig . checkElevator ( Iio0OO0oOO ) :
     iI1i1i1 = TBDoor . query . filter_by ( f_ControllerID = III11i11III ) . order_by ( TBDoor . f_DoorNO ) . all ( )
     if iI1i1i1 :
      IIiII111iiii = [ ]
      III1Ii1I1i = TBControllertasklist4floor . query . filter_by ( f_DoorID = II1I1II1iI ) . order_by (
 TBControllertasklist4floor . f_OperateTime ) . all ( )
      for IiIi in III1Ii1I1i :
       i1I11I1 = IiIi . f_FloorNames . split ( "," )
       for oOOOoO in iI1i1i1 :
        if str ( oOOOoO . f_DoorID ) in i1I11I1 or '0' in i1I11I1 :
         OOOOO0OOoOoOO = 0
         if IiIi . f_DoorControl == 8 :
          OOOOO0OOoOoOO = ooOoOO00o [ oOOOoO . f_DoorNO - 1 ]
         IIiII111iiii . append ( {
 "f_Monday" : IiIi . f_Monday ,
 "f_Tuesday" : IiIi . f_Tuesday ,
 "f_Wednesday" : IiIi . f_Wednesday ,
 "f_Thursday" : IiIi . f_Thursday ,
 "f_Friday" : IiIi . f_Friday ,
 "f_Saturday" : IiIi . f_Saturday ,
 "f_Sunday" : IiIi . f_Sunday ,
 "f_BeginYMD" : IiIi . f_BeginYMD ,
 "f_EndYMD" : IiIi . f_EndYMD ,
 "f_OperateTime" : IiIi . f_OperateTime ,

         "f_DoorControl" : IiIi . f_DoorControl ,
 "f_Optional" : OOOOO0OOoOoOO ,
         "f_DoorNO" : oOOOoO . f_DoorNO
         } )
      if len ( IIiII111iiii ) > 0 :
       oO0OO0 = IIiII111iiii
    else :
     Ii1ii1 = TBDoor . query . filter_by ( f_ControllerID = III11i11III ) . order_by ( TBDoor . f_DoorNO ) . all ( )
     if Ii1ii1 :
      iI1i1i1 = TBFloor . query . filter_by ( f_DoorID = Ii1ii1 [ 0 ] . f_DoorID ) . all ( )
      IIiII111iiii = [ ]
      III1Ii1I1i = TBControllertasklist4floor . query . filter_by ( f_DoorID = OOooOoO0OOoo ) . order_by (
 TBControllertasklist4floor . f_OperateTime ) . order_by (
 TBControllertasklist4floor . f_DoorControl ) . all ( )
      if 92 - 92: IiIIii11Ii + i1iiIII111 . Ooo0Ooo
      if 49 - 49: oOO % I1I * I1I
      Ooo = [ ]
      for IiIi in III1Ii1I1i :
       i1I11I1 = IiIi . f_FloorNames . split ( "," )
       iI1 = [ ]
       for oOOOoO in iI1i1i1 :
        if str ( oOOOoO . f_FloorId ) in i1I11I1 or '0' in i1I11I1 :
         iI1 . append ( oOOOoO . f_FloorNO )
         if 21 - 21: IIiIIiIi11I1 * i1I * IIiIIiIi11I1
         if 6 - 6: IIiIIiIi11I1 - ooOOO / i1I % Ii - Ii . i1iiIII111
       if len ( iI1 ) > 0 :
        IIiII111iiii . append ( {
 "f_Monday" : IiIi . f_Monday ,
 "f_Tuesday" : IiIi . f_Tuesday ,
 "f_Wednesday" : IiIi . f_Wednesday ,
 "f_Thursday" : IiIi . f_Thursday ,
 "f_Friday" : IiIi . f_Friday ,
 "f_Saturday" : IiIi . f_Saturday ,
 "f_Sunday" : IiIi . f_Sunday ,
 "f_BeginYMD" : IiIi . f_BeginYMD ,
 "f_EndYMD" : IiIi . f_EndYMD ,
 "f_OperateTime" : IiIi . f_OperateTime ,

        "f_DoorControl" : IiIi . f_DoorControl ,
 "f_Optional" : 0 ,
        # IiIIii11Ii % oOo0O00 - Oo
        "f_DoorNO" : iI1
        } )
        if 61 - 61: i1i1i1111I * i1iiIII111
        if 100 - 100: OooOoo - i1I / i1I + oOO / iI1iII1I1I1i . i1
        if 42 - 42: ooOOO % I11iiIi11i1I % Iii1i + i1i1i1111I / i1iiIII111
        if 47 - 47: I1I * i1iiIII111 / i1 - iI1iII1I1I1i
        if 47 - 47: ooOOO / IiI11Ii111 + Iii1i
        if 18 - 18: Ooo0Ooo
        if 55 - 55: Ii - Ii % IiIIii11Ii % Iii1i
        if 73 - 73: I11iiIi11i1I . oOO + oOo0O00 - i1I
      if len ( IIiII111iiii ) > 0 :
       oO0OO0 = IIiII111iiii
   else :
    oO0OO0 = None
    if 43 - 43: i1i1i1111I . i1i1i1111I % Oo % I1Ii1I1 % i1i1i1111I % i1I
    if 60 - 60: I1I * Ooo0Ooo . iI1iII1I1I1i + OooOoo - i1iiIII111
   i1Ii1I111 = threading . Thread ( target = uploadSingleConfigure ,
 args = ( Iio0OO0oOO , iIiI , II1i1 , O0O00o , oO0OO0 ) )
   i1Ii1I111 . start ( )
   if 10 - 10: i1I * i1iiIII111
   if 59 - 59: Ooo0Ooo * ooo000 . oOo0O00 % IiI11Ii111 . ooo000
   if 3 - 3: i1
 OoOOO0000o = time . time ( ) + vwAppConfigParam . uploadpri_timeout_second + ( 0 / 1000 ) * 2
 while time . time ( ) < OoOOO0000o :
  if len ( II1i1 . recvsnpri ) > 0 :
   II1i1 . recvsnpri . clear ( )
   if 42 - 42: ooOOO / i1I / i1iiIII111 * oOO
   O0 = time . time ( ) + vwAppConfigParam . uploadpri_timeout_second
   if O0 > OoOOO0000o :
    OoOOO0000o = O0
    if 59 - 59: I1I * IiIIii11Ii % i1I * I1I / I1I / oOo0O00
  if len ( II1i1 . uploadedSNOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) and len (
 II1i1 . uploadedSNOK_Delete ) + len (
 II1i1 . uploadedSNFailed_Delete ) == len ( II1i1 . uploadedSN_Delete ) :
   break
   if 24 - 24: Iii1i
 OOOO0O0ooO0O = db . session . query ( TBController . f_ControllerID , TBController . f_ControllerSN , TBDoor . f_DoorNO ,
 TBDoor . f_DoorID ) . join ( TBDoor ,
 TBDoor . f_ControllerID == TBController . f_ControllerID )
 OOOooo = OOOO0O0ooO0O . all ( )
 if 69 - 69: OooOoo . IiIIii11Ii % i1iiIII111 . i1 + I1I
 IiI = [ ]
 OOOOO00oo00 = [ ]
 OOo0Oo000OOo = [ ]
 Oo0O0O0oo0 = [ ]
 for I1i11ii111 in doorDst :
  oO00o0000 += str ( I1i11ii111 ) + ","
  for i1iI1i in OOOooo :
   Iio0OO0oOO = i1iI1i . f_ControllerSN
   if 26 - 26: Ooo0Ooo / i1 + I1I
   if 99 - 99: OooOoo . Oo - ooo000
   if I1i11ii111 == i1iI1i . f_DoorID :
    iIi1Ii11II1iIiI = - 1
    try :
     iIi1Ii11II1iIiI = II1i1 . uploadedSNOK . index ( Iio0OO0oOO )
    except :
     iIi1Ii11II1iIiI = - 1
     if 4 - 4: I1I * Ii - iI1iII1I1I1i - ooo000
    if iIi1Ii11II1iIiI >= 0 :
     IiI . append ( I1i11ii111 )
     if 26 - 26: i1I - Oo
    else :
     try :
      iIi1Ii11II1iIiI = II1i1 . uploadedSNConnectedOK . index ( Iio0OO0oOO )
     except :
      iIi1Ii11II1iIiI = - 1
     if iIi1Ii11II1iIiI < 0 :
      OOo0Oo000OOo . append ( I1i11ii111 )
     else :
      Oo0O0O0oo0 . append ( I1i11ii111 )
      if 12 - 12: i1I % I11iiIi11i1I
 return { "updateConOK" : II1i1 . uploadedSNOK , "updateConFailed" : II1i1 . uploadedSNFailed ,
 "doorID_OK" : IiI ,
 "doorID_NotConnected" : OOo0Oo000OOo , "doorID_Fail" : Oo0O0O0oo0 }
 if 16 - 16: Oo / IIiIIiIi11I1
 if 95 - 95: i1iiIII111 + I1I - i1i1i1111I / IiIIii11Ii % IIiIIiIi11I1
 if 33 - 33: iI1iII1I1I1i . Iii1i . Ooo0Ooo - Oo - IiIIii11Ii
def uploadSingleConfigure ( sn , controlConfigure , wgcondata , timeprofileinfo , tasklistinfo = None ) :
 vwAppConfig . wglog ( "uploadSingleConfigure sn={}   start" . format ( sn ) )
 if 47 - 47: Ooo0Ooo . oOo0O00 * i1
 ii11Iii11i = 10
 if 90 - 90: ooo000
 if 61 - 61: ooOOO
 if 94 - 94: Ii + i1 / i1I / OooOoo . OooOoo % OooOoo
 if 89 - 89: Ii . I1I % oOo0O00 * IiIIii11Ii
 if 80 - 80: Ooo0Ooo / I1Ii1I1 / OooOoo % I1Ii1I1
 if 47 - 47: I1Ii1I1
 if 4 - 4: oOo0O00 / IiIIii11Ii - IiI11Ii111 + i1iiIII111
 iiIi1iI = [ 0 ] * 1024
 iiIi1iI [ 0 ] = 0x37
 iiIi1iI [ 1 ] = 0xF4
 WGTools . longToByte ( sn , iiIi1iI , 4 , 4 )
 I11iiiiIiiI = int ( time . time ( ) * 1000 )
 WGTools . longToByte ( I11iiiiIiiI , iiIi1iI , 40 , 4 )
 iiIi1iI [ 64 + 4 ] = 0x55
 iiIi1iI [ 65 + 4 ] = 0xaa
 iiIi1iI [ 66 + 4 ] = 0xaa
 iiIi1iI [ 67 + 4 ] = 0x55
 if 9 - 9: IIiIIiIi11I1
 ii11IiiIIi = {
 "jsonrpc" : "2.0" ,
 "method" : "Primit64ByteCommand" ,
 "params" : [ { 'ControllerSN' : sn ,
 'CommandPacket' : WGTools . getHexString ( iiIi1iI )
 } ] ,
 "id" : "1005"
 }
 if 60 - 60: iI1iII1I1I1i % IiI11Ii111 / Iii1i * oOo0O00
 O0O0oO = OoO00O ( ii11IiiIIi )
 if not vwAppConfig . successIsTrue ( O0O0oO ) :
  wgcondata . uploadedSNFailed . append ( sn )
  vwAppConfig . wglog ( "uploadSingleConfigure {} end Failed1" . format ( sn ) )
  return
 wgcondata . recvsnpri . append ( sn )
 if 79 - 79: Oo * IIiIIiIi11I1 - i1I * OooOoo / I11iiIi11i1I / OooOoo
 if 19 - 19: i1i1i1111I * Oo
 OoooOo00OO0 = O0O0oO [ "ReturnPacket" ]
 OOOO = bytearray ( binascii . unhexlify ( OoooOo00OO0 . replace ( " " , "" ) ) )
 iI1iiiii1iiiI = 136
 oOOOo00OOoO = False
 for o0Oo000 in range ( 512 ) :
  if OOOO [ o0Oo000 + iI1iiiii1iiiI ] != controlConfigure . paramData [ o0Oo000 ] :
   if ( controlConfigure . needUpdate [ o0Oo000 // 8 ] & ( 1 << ( o0Oo000 % 8 ) ) ) > 0 :
    oOOOo00OOoO = True
    break
 if oOOOo00OOoO :
  iiIi1iI = [ 0 ] * 1024
  iiIi1iI [ 0 ] = 0x37
  iiIi1iI [ 1 ] = 0xF2
  WGTools . longToByte ( sn , iiIi1iI , 4 , 4 )
  I11iiiiIiiI = int ( time . time ( ) * 1000 )
  WGTools . longToByte ( I11iiiiIiiI , iiIi1iI , 40 , 4 )
  iiIi1iI [ 64 + 4 ] = 0x55
  iiIi1iI [ 65 + 4 ] = 0xaa
  iiIi1iI [ 66 + 4 ] = 0xaa
  iiIi1iI [ 67 + 4 ] = 0x55
  if 80 - 80: iI1iII1I1I1i % ooOOO . I11iiIi11i1I
  if 44 - 44: ooOOO / IIiIIiIi11I1 + oOO
  iiIi1iI [ 72 : ( 72 + 64 ) ] = controlConfigure . needUpdate [ 0 : 64 ]
  iiIi1iI [ 136 : ( 136 + 512 ) ] = controlConfigure . paramData [ 0 : 512 ]
  ii11IiiIIi = {
 "jsonrpc" : "2.0" ,
 "method" : "Primit64ByteCommand" ,
 "params" : [ { 'ControllerSN' : sn ,
 'CommandPacket' : WGTools . getHexString ( iiIi1iI )
 } ] ,
 "id" : "1005"
 }
  O0O0oO = OoO00O ( ii11IiiIIi )
  if 59 - 59: i1iiIII111 . ooOOO % IiIIii11Ii . Iii1i - OooOoo % Oo
 if not vwAppConfig . successIsTrue ( O0O0oO ) :
  wgcondata . uploadedSNFailed . append ( sn )
  vwAppConfig . wglog ( "uploadSingleConfigure {} end Failed2" . format ( sn ) )
  return
 wgcondata . recvsnpri . append ( sn )
 if 30 - 30: Oo . oOo0O00 % IiIIii11Ii / oOo0O00
 if timeprofileinfo :
  Oo0oO0oo0o = [ ]
  for i1iI1i in timeprofileinfo :
   Oo0oO0oo0o . append ( {
 "TimeProfileID" : i1iI1i . f_ControlSegID ,
 "BeginDate" : i1iI1i . f_BeginYMD . strftime ( '%Y-%m-%d' ) ,
 "EndDate" : i1iI1i . f_EndYMD . strftime ( '%Y-%m-%d' ) ,
 "Mon" : i1iI1i . f_Monday ,
 "Tue" : i1iI1i . f_Tuesday ,
 "Wed" : i1iI1i . f_Wednesday ,
 "Thu" : i1iI1i . f_Thursday ,
 "Fri" : i1iI1i . f_Friday ,
 "Sat" : i1iI1i . f_Saturday ,
 "Sun" : i1iI1i . f_Sunday ,
 "TimeZone1BeginTime" : i1iI1i . f_BeginHMS1 . strftime ( '%H:%M' ) ,
 "TimeZone1EndTime" : i1iI1i . f_EndHMS1 . strftime ( '%H:%M' ) ,
 "TimeZone2BeginTime" : i1iI1i . f_BeginHMS2 . strftime ( '%H:%M' ) ,
 "TimeZone2EndTime" : i1iI1i . f_EndHMS2 . strftime ( '%H:%M' ) ,
 "TimeZone3BeginTime" : i1iI1i . f_BeginHMS3 . strftime ( '%H:%M' ) ,
 "TimeZone3EndTime" : i1iI1i . f_EndHMS3 . strftime ( '%H:%M' ) ,
 "NextLinkedTimeProfileID" : i1iI1i . f_ControlSegIDLinked ,
 "HolidayControl" : i1iI1i . f_ControlByHoliday ,
 "LimitedAccessTimesMode" : i1iI1i . f_ReaderCount ,
   "CurrentDayLimitedTimes" : ( i1iI1i . f_LimitedTimesOfDay & 0xff ) ,
   "CurrentMonthLimitedTimes" : ( ( i1iI1i . f_LimitedTimesOfDay >> 8 ) & 0xff ) ,
   "TimeZone1LimitedTimes" : i1iI1i . f_LimitedTimesOfHMS1 ,
   "TimeZone2LimitedTimes" : i1iI1i . f_LimitedTimesOfHMS2 ,
   "TimeZone3LimitedTimes" : i1iI1i . f_LimitedTimesOfHMS3 ,
   } )
  ii11IiiIIi = {
 "jsonrpc" : "2.0" ,
 "method" : "UploadAllTimeProfiles" ,
 "params" : [ { 'ControllerSN' : sn ,
 'TimeProfile' : Oo0oO0oo0o
 } ] ,
 "id" : "4004"
 }
  O0O0oO = OoO00O ( ii11IiiIIi )
  if not vwAppConfig . successIsTrue ( O0O0oO ) :
   wgcondata . uploadedSNFailed . append ( sn )
   vwAppConfig . wglog ( "uploadSingleConfigure {} end Failed3" . format ( sn ) )
   return
   if 100 - 100: I1I
   if 94 - 94: I11iiIi11i1I + OooOoo % I11iiIi11i1I % Ii % IiIIii11Ii % oOO
   if 30 - 30: I1Ii1I1 % I1Ii1I1 + I1Ii1I1 . IiI11Ii111 * OooOoo / oOO
   if 79 - 79: ooOOO / ooo000 . ooo000 + I11iiIi11i1I
   if 54 - 54: i1iiIII111 - oOo0O00 / i1i1i1111I . ooOOO
 if tasklistinfo :
  o00ooOooOooOo = [ ]
  for i1iI1i in tasklistinfo :
   o00ooOooOooOo . append ( {
 "ActionTime" : i1iI1i [ 'f_OperateTime' ] . strftime ( '%H:%M' ) ,
 "DoorControlMode" : i1iI1i [ 'f_DoorControl' ] ,

   "ApplicableDoorNumber" : i1iI1i [ 'f_DoorNO' ] ,
 "BeginDate" : i1iI1i [ 'f_BeginYMD' ] . strftime ( '%Y-%m-%d' ) ,
 "EndDate" : i1iI1i [ 'f_EndYMD' ] . strftime ( '%Y-%m-%d' ) ,
 "Mon" : i1iI1i [ 'f_Monday' ] ,
 "Tue" : i1iI1i [ 'f_Tuesday' ] ,
 "Wed" : i1iI1i [ 'f_Wednesday' ] ,
 "Thu" : i1iI1i [ 'f_Thursday' ] ,
 "Fri" : i1iI1i [ 'f_Friday' ] ,
 "Sat" : i1iI1i [ 'f_Saturday' ] ,
 "Sun" : i1iI1i [ 'f_Sunday' ] ,
 "OptionalParameters" : i1iI1i [ 'f_Optional' ]
 } )
  ii11IiiIIi = {
 "jsonrpc" : "2.0" ,
 "method" : "UploadAllScheduledTasks" ,
 "params" : [ { 'ControllerSN' : sn ,
 'Task' : o00ooOooOooOo
 } ] ,
 "id" : "4004"
 }
  O0O0oO = OoO00O ( ii11IiiIIi )
  if not vwAppConfig . successIsTrue ( O0O0oO ) :
   wgcondata . uploadedSNFailed . append ( sn )
   vwAppConfig . wglog ( "uploadSingleConfigure {} end Failed4" . format ( sn ) )
   return
   if 83 - 83: i1I - i1 / i1i1i1111I + i1
   if 36 - 36: Oo - i1I
 wgcondata . uploadedSNOK . append ( sn )
 vwAppConfig . wglog ( "uploadSingleConfigure {} end OK" . format ( sn ) )
 wgcondata . recvsnpri . append ( sn )
 if 87 - 87: iI1iII1I1I1i / OooOoo
 if 87 - 87: Iii1i + Oo * I11iiIi11i1I
def OoO00O ( arrinfo , timeoutSec = 3 ) :
 OooOooooO000 = None
 try :
  O0Oo = vwAppConfigParam . server1001_ip
  o0Oo0Oo0O0o = vwAppConfigParam . server1001_webport
  OoOoo0o0o0 = http . client . HTTPConnection ( host = O0Oo , port = o0Oo0Oo0O0o , timeout = 3 )
  ii11ii11 = bytes ( json . dumps ( arrinfo , sort_keys = False , indent = 4 ) , encoding = 'utf8' )
  Oo0o = { "Content-type" : "application/json" , "Accept" : "application/json" }
  OoOoo0o0o0 . timeout = timeoutSec
  OoOoo0o0o0 . request ( "POST" , O0Oo , ii11ii11 , Oo0o )
  ooo0o0 = OoOoo0o0o0 . getresponse ( )
  ooO = ooo0o0 . read ( )
  OoOoo0o0o0 . close ( )
  try :
   i1Iii1i1i1 = json . loads ( ooO . decode ( "utf-8" ) )
   OooOooooO000 = i1Iii1i1i1 [ 'result' ]
  except :
   OooOooooO000 = None
   return OooOooooO000
  return OooOooooO000
 except Exception as oOO0oOoo0O0 :
  pass
  print ( oOO0oOoo0O0 )
 return None
 if 40 - 40: IiI11Ii111 . i1 - iI1iII1I1I1i * Oo + oOO
 if 96 - 96: OooOoo - i1iiIII111 . Ii + ooOOO - Oo
@ bp . route ( '/pri_getUserPrivilege' , methods = [ 'POST' ] )
@ login_required
def Oo00OOo0oo0 ( ) :
 I1ii = 0
 IIiIiIi = 0
 I1II1ii111i = ''
 if request . form . get ( 'conID' ) :
  III11i11III = request . form . get ( 'conID' )
  iI1i1i1 = TBConsumer . query . get ( III11i11III )
  if iI1i1i1 :
   IIiIiIi = III11i11III
   if 78 - 78: i1 + IIiIIiIi11I1 * Ooo0Ooo * Ii - Oo
   I1II1ii111i = iI1i1i1 . f_ConsumerName
   I1ii = iI1i1i1 . f_CardNO
   if 99 - 99: ooOOO * I11iiIi11i1I + i1iiIII111
 II1i1 = WGControllerPri2023 ( )
 if 54 - 54: IiIIii11Ii + Iii1i . IIiIIiIi11I1 . i1I / i1 - i1I
 OOOO0O0ooO0O = db . session . query ( TBController . f_ControllerSN , TBController . f_ControllerID ) . filter (
 TBController . f_Enabled >= 1 ) . order_by (
 TBController . f_ControllerSN )
 OO = OOOO0O0ooO0O . all ( )
 if OO is None :
  return { "updateConOK" : [ ] , "updateConFailed" : [ ] }
 IIi1IIIi1I = "pri_getUserPrivilege"
 for iI1i1i1 in OO :
  Iio0OO0oOO = iI1i1i1 [ 0 ]
  III11i11III = iI1i1i1 [ 1 ]
  II1i1 . uploadedSN . append ( Iio0OO0oOO )
  i1Ii1I111 = threading . Thread ( target = O0O , args = ( Iio0OO0oOO , III11i11III , II1i1 , I1ii ) )
  i1Ii1I111 . start ( )
  if 72 - 72: ooo000 % I11iiIi11i1I % ooo000 * IiI11Ii111 . Oo
  if 76 - 76: i1I . Oo . IiIIii11Ii / IiI11Ii111 % ooo000 - Ii
 OoOOO0000o = time . time ( ) + 1
 if 45 - 45: iI1iII1I1I1i - I11iiIi11i1I % ooo000 . Ooo0Ooo * Iii1i * I1I
 iIiIIi1III1I = " SELECT a.f_DoorID, a.f_DoorName ,t_d_Privilege.f_ControlSegID,  b.f_ZoneID, a.f_ControllerID, a.f_DoorNO,b.f_ControllerSN, '' as f_infactSegID "
 iIiIIi1III1I += " FROM t_b_Door a, t_b_Controller b, t_d_Privilege WHERE a.f_DoorEnabled > 0 and b.f_Enabled >0 and a.f_ControllerID=b.f_ControllerID "
 iIiIIi1III1I += " AND ( b.f_ControllerSN < 160000000 OR b.f_ControllerSN > 180000000 ) "
 iIiIIi1III1I += " and t_d_Privilege.f_doorID = a.f_DoorID and t_d_Privilege.f_ConsumerID=  {}" . format ( IIiIiIi )
 iIiIIi1III1I += " ORDER BY  a.f_DoorName "
 OOOO0O0ooO0O = db . session . execute ( text ( iIiIIi1III1I ) )
 oOoOO0 = OOOO0O0ooO0O . fetchall ( )
 if 82 - 82: I1I / oOO % i1iiIII111
 if 95 - 95: I1Ii1I1 + i1i1i1111I - IiIIii11Ii + IiI11Ii111
 if 69 - 69: i1iiIII111 / Oo + i1i1i1111I * ooo000 * IiI11Ii111 + IIiIIiIi11I1
 if 82 - 82: I1I - ooOOO
 if 91 - 91: i1iiIII111 + IiIIii11Ii - I1Ii1I1 / i1iiIII111
 if 3 - 3: I1I
 if 75 - 75: oOO % oOO + oOO
 if 23 - 23: i1i1i1111I % i1i1i1111I / IiI11Ii111 . ooo000
 if 34 - 34: i1iiIII111 * oOO
 if 46 - 46: ooo000 / oOo0O00 . i1I % i1i1i1111I
 if 42 - 42: Ii - i1
 if 71 - 71: ooOOO * Iii1i
 if 64 - 64: i1 * i1
 OOOO0O0ooO0O = db . session . query ( TBControlseg . f_ControlSegID , TBControlseg . f_ControlSegName ) . order_by (
 TBControlseg . f_ControlSegID )
 O000 = OOOO0O0ooO0O . all ( )
 if 29 - 29: I1I * Iii1i / i1 + Iii1i
 while time . time ( ) < OoOOO0000o :
  if len ( II1i1 . uploadedSNOK ) + len ( II1i1 . uploadedSNFailed ) == len ( II1i1 . uploadedSN ) :
   break
  time . sleep ( 0.1 )
  if 79 - 79: Ooo0Ooo - oOO % I1I % Ooo0Ooo
 oo0oOo = [ ]
 if 24 - 24: ooo000 % i1I * ooOOO - IiIIii11Ii * ooOOO
 if 56 - 56: i1 + oOO + IiIIii11Ii
 if 10 - 10: i1iiIII111 / i1 * i1I % Oo / IIiIIiIi11I1 % oOO
 OOOO0O0ooO0O = db . session . query ( TBDoor . f_DoorID , TBDoor . f_DoorName , TBDoor . f_DoorNO , TBController . f_ControllerSN ,
 TBDoor . f_DoorEnabled ) . filter_by ( f_DoorEnabled = True ) . join ( TBController ,
 TBController . f_ControllerID == TBDoor . f_ControllerID ) . order_by (
 TBDoor . f_DoorName )
 if 41 - 41: IiI11Ii111
 i111IIi = OOOO0O0ooO0O . all ( )
 if 30 - 30: oOO + iI1iII1I1I1i / i1I + iI1iII1I1I1i . iI1iII1I1I1i % IIiIIiIi11I1
 if 76 - 76: I1Ii1I1 . oOO . oOO - Ii
 if 45 - 45: OooOoo * IiIIii11Ii . ooOOO . i1I
 if 33 - 33: IiI11Ii111 . Ooo0Ooo - OooOoo * I1I - iI1iII1I1I1i * oOo0O00
 O00Oo = True
 for i1iI1i in i111IIi :
  oo0O0oo0o0O = 'Inconsistent.'
  I111 = 0
  i1iii = ''
  i111III111I1 = i1iI1i . f_DoorID
  oooO000 = i1iI1i . f_DoorName
  O0OoOooO = 0
  oOOOooOOooO00 = 'Not connected.'
  for Ii1Ii1i1i in oOoOO0 :
   if Ii1Ii1i1i . f_DoorID == i1iI1i . f_DoorID :
    I111 = Ii1Ii1i1i . f_ControlSegID
    break
  if I111 == 1 :
   i1iii = "Time Profile#{}-{}" . format ( '1' , 'Free Time' )
  elif I111 > 0 :
   for oo0o in O000 :
    if oo0o . f_ControlSegID == I111 :
     i1iii = "Time Profile#{}-{}" . format ( vwAppConfig . getStrNoneToSpace ( I111 ) ,
 vwAppConfig . getStrNoneToSpace ( oo0o . f_ControlSegName ) )
     break
     if 1 - 1: oOo0O00 - i1I . i1I
  if i1iI1i . f_ControllerSN in II1i1 . uploadedSNConnectedOK :
   try :
    iIi1Ii11II1iIiI = II1i1 . uploadedSNConnectedOK . index ( i1iI1i . f_ControllerSN )
    oo00 = II1i1 . uploadedSNReply [ iIi1Ii11II1iIiI ]
    if 64 - 64: I1I % IiIIii11Ii
    iI1iI1i1iIi = oo00
    iIiI1i = iI1iI1i1iIi [ "Privilege" ] [ 0 ] [ '{}#Door Time Profile' . format ( i1iI1i . f_DoorNO ) ]
    O0OoOooO = iIiI1i
    if iIiI1i == 1 :
     oOOOooOOooO00 = "Time Profile#{}-{}" . format ( '1' , 'Free Time' )
    elif iIiI1i > 0 :
     for oo0o in O000 :
      if oo0o . f_ControlSegID == iIiI1i :
       oOOOooOOooO00 = "Time Profile#{}-{}" . format ( vwAppConfig . getStrNoneToSpace ( iIiI1i ) ,
 vwAppConfig . getStrNoneToSpace ( oo0o . f_ControlSegName ) )
       break
    elif iIiI1i == 0 :
     oOOOooOOooO00 = ''
   except Exception as oOO0oOoo0O0 :
    print ( oOO0oOoo0O0 )
  if oOOOooOOooO00 == 'Not connected.' :
   oo0O0oo0o0O = ''
   O00Oo = False
  elif I111 == O0OoOooO :
   oo0O0oo0o0O = 'Consistent  '
  else :
   O00Oo = False
   if 76 - 76: Oo / I1I - OooOoo % i1iiIII111 % iI1iII1I1I1i
  oOoOO0O0 = { 'f_DoorID' : i111III111I1 , 'f_DoorName' : oooO000 , 'f_ControlSegID' : i1iii ,
 'f_infactSegID' : oOOOooOOooO00 , 'f_compare' : oo0O0oo0o0O }
  oo0oOo . append ( oOoOO0O0 )
 O00 = ''
 if O00Oo :
  O00 = '[Permissions synchronized]  '
 Ooo0OO = {

 "objlistDoor" : oo0oOo ,
 "deleteUrl" : "/user_del" ,
 "losecardUrl" : "/user_losecard" ,
 "username" : I1II1ii111i ,
 'cardNO' : I1ii ,
 'syncinfo' : O00

 }
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "Name: {},CardNO: {}" . format ( I1II1ii111i , I1ii ) ,
 "Permissions: {}..{}  " . format ( O00 , oo0oOo ) ) )
 if 9 - 9: IiIIii11Ii / i1 / IIiIIiIi11I1
 return render_template ( "wgcomm/user-getpri.html" , ** Ooo0OO )
 if 25 - 25: IiIIii11Ii . IIiIIiIi11I1 . i1I * Oo
 if 67 - 67: i1iiIII111
 if 68 - 68: oOO % ooo000 % I1I % i1iiIII111 + OooOoo
def O0O ( sn , conid , wgcondata , cardno ) :
 ii11Iii11i = 1000
 o0OOOO = 0
 ii11IiiIIi = ( {
 "jsonrpc" : "2.0" ,
 "method" : "QueryPrivilege" ,
 "params" : [ { "ControllerSN" : sn ,
 "CardNO" : [
 cardno
 ] } ] ,
 "id" : 4006
 } )
 oo00 = OoO00O ( ii11IiiIIi , ii11Iii11i )
 if 11 - 11: IIiIIiIi11I1 . i1iiIII111 . IIiIIiIi11I1 % IiI11Ii111
 if len ( oo00 ) > 0 :
  wgcondata . uploadedSNConnectedOK . append ( sn )
  wgcondata . uploadedIdConnectedOK . append ( conid )
  wgcondata . recvsnpri . append ( conid )
  wgcondata . uploadedSNReply . append ( oo00 )
 else :
  wgcondata . uploadedSNFailed . append ( sn )
  if 50 - 50: oOo0O00 - Ii * I11iiIi11i1I
  if 6 - 6: oOo0O00 . i1I
def Ii1iiIIiI1i1I ( ) :
 OOOO0O0ooO0O = TBConsumer . query . order_by ( TBConsumer . f_ConsumerNO )
 OO = OOOO0O0ooO0O . all ( )
 I1iiiIii1Ii1 = 0
 if OO :
  for i1iI1i in OO :
   if i1iI1i . f_ConsumerNO . isdigit ( ) :
    if I1iiiIii1Ii1 < int ( i1iI1i . f_ConsumerNO ) :
     I1iiiIii1Ii1 = int ( i1iI1i . f_ConsumerNO )
 if I1iiiIii1Ii1 == 0 :
  I1iiiIii1Ii1 = 10000
 return I1iiiIii1Ii1
 if 27 - 27: i1I / IiI11Ii111 * Ii . ooo000
 if 27 - 27: oOo0O00 . i1 . i1iiIII111 * ooo000 / IiIIii11Ii / ooo000
@ bp . route ( '/pri_allowselected_with_adduser_alldoor' , methods = [ 'POST' ] )
@ login_required
def i1i1 ( ) :
 if 86 - 86: i1I - oOo0O00 * I1I
 if 84 - 84: Ooo0Ooo + Iii1i * Ooo0Ooo - ooOOO - IIiIIiIi11I1 / ooOOO
 if 77 - 77: ooo000
 if 6 - 6: OooOoo - i1 * Oo . I1Ii1I1 . i1i1i1111I - I1Ii1I1
 if 69 - 69: ooOOO / ooo000 * oOo0O00
 Iiii = request . form . get ( "selecteduser" )
 if 69 - 69: i1I + Oo + Oo
 OoOooOOoOo = request . form . get ( "timeprofileid" )
 o0O = request . form . get ( "onlyadduser" )
 iiIIiiiiIi = vwAppConfig . parseInt ( request . form . get ( "selectedSN" ) )
 if 11 - 11: i1 . IiI11Ii111 - iI1iII1I1I1i + OooOoo * IiI11Ii111 - Ii
 if 85 - 85: I1I / i1iiIII111 * i1I . OooOoo . i1iiIII111
 if len ( Iiii ) == 0 :
  return "OK"
  if 33 - 33: iI1iII1I1I1i + I1I
 if iiIIiiiiIi > 0 :
  IiI1iii1 = str ( iiIIiiiiIi )
  O0O0oO = "0"
  if IiI1iii1 [ 0 : 2 ] == "0," :
   IiI1iii1 = IiI1iii1 [ 2 : ]
   if 25 - 25: iI1iII1I1I1i * iI1iII1I1I1i . i1i1i1111I
  if IiI1iii1 == '' :
   return O0O0oO
  Iii1Iii1iI = IiI1iii1 . split ( ',' )
  iIIiii1iiIi1i = AddControllerForm ( )
  iIIiii1iiIi1i . f_ControllerNO . data = 0
  iIIiii1iiIi1i . producttype . data = 0
  iI1i1i1 = TBController . query . order_by ( TBController . f_ControllerNO . desc ( ) ) . first ( )
  o0o00 = 0
  if 10 - 10: IIiIIiIi11I1
  if iI1i1i1 :
   iIIiii1iiIi1i . f_ControllerNO . data = iI1i1i1 . f_ControllerNO
  for Iio0OO0oOO in Iii1Iii1iI :
   O0OO0o0O0OO0 = vwAppConfig . parseInt ( Iio0OO0oOO )
   iiI1I = TBController . query . filter_by ( f_ControllerSN = O0OO0o0O0OO0 ) . first ( )
   if iiI1I :
    continue
   iIIiii1iiIi1i . f_ControllerNO . data = iIIiii1iiIi1i . f_ControllerNO . data + 1
   OO0O = iIIiii1iiIi1i . f_ControllerNO . data
   if 29 - 29: I1Ii1I1 + ooo000
   o0oOOoo = iIIiii1iiIi1i . f_ControllerNO . data
   O0oOo0OoOOOO0 = "{0:0>3d}" . format ( o0oOOoo )
   iIIiii1iiIi1i . f_DoorName1 . data = "m{}-1#" . format ( O0oOo0OoOOOO0 )
   iIIiii1iiIi1i . f_DoorName2 . data = "m{}-2#" . format ( O0oOo0OoOOOO0 )
   iIIiii1iiIi1i . f_DoorName3 . data = "m{}-3#" . format ( O0oOo0OoOOOO0 )
   iIIiii1iiIi1i . f_DoorName4 . data = "m{}-4#" . format ( O0oOo0OoOOOO0 )
   OOOOO0Oo = vwAppConfig . getProductType ( O0OO0o0O0OO0 )
   if 93 - 93: i1 / I1I / I1I % IiI11Ii111 * IiIIii11Ii
   if 60 - 60: IiIIii11Ii - oOo0O00 * ooo000 / IIiIIiIi11I1 / Oo
   if 70 - 70: oOo0O00 - Ooo0Ooo % I1I . i1iiIII111 / I1Ii1I1 % ooo000
   oo0oO00oO = [ iIIiii1iiIi1i . f_DoorName1 . data ]
   if 96 - 96: OooOoo % ooo000 * I1I % Ooo0Ooo / iI1iII1I1I1i + i1
   if OOOOO0Oo > 1 :
    oo0oO00oO . append ( iIIiii1iiIi1i . f_DoorName2 . data )
   if OOOOO0Oo > 2 :
    oo0oO00oO . append ( iIIiii1iiIi1i . f_DoorName3 . data )
    oo0oO00oO . append ( iIIiii1iiIi1i . f_DoorName4 . data )
    if 95 - 95: i1iiIII111 - IiI11Ii111
   iii = TBController ( f_ControllerNO = OO0O , f_ControllerSN = O0OO0o0O0OO0 ,
 f_Enabled = iIIiii1iiIi1i . f_Enabled . data ,
 f_DoorsNames = iIIiii1iiIi1i . f_DoorName1 . data )
   if 2 - 2: i1iiIII111
   if OOOOO0Oo == 2 :
    iii = TBController ( f_ControllerNO = OO0O , f_ControllerSN = O0OO0o0O0OO0 ,
 f_Enabled = iIIiii1iiIi1i . f_Enabled . data ,
 f_DoorsNames = '{},{}' . format ( iIIiii1iiIi1i . f_DoorName1 . data , iIIiii1iiIi1i . f_DoorName2 . data ) )
   if OOOOO0Oo == 4 :
    iii = TBController ( f_ControllerNO = OO0O , f_ControllerSN = O0OO0o0O0OO0 ,
 f_Enabled = iIIiii1iiIi1i . f_Enabled . data ,
 f_DoorsNames = '{},{},{},{}' . format ( iIIiii1iiIi1i . f_DoorName1 . data ,
 iIIiii1iiIi1i . f_DoorName2 . data ,
 iIIiii1iiIi1i . f_DoorName3 . data ,
 iIIiii1iiIi1i . f_DoorName4 . data ) )
   try :
    db . session . add ( iii )
    Ii1iiIi = TBController . query . filter_by ( f_ControllerNO = OO0O ) . first ( )
    if Ii1iiIi :
     OOOO0oOOo0o = Ii1iiIi . f_ControllerID
     ii11Ii11 = 1
     Ooo0oOoooOOOO = TBDoor ( f_ControllerID = OOOO0oOOo0o , f_DoorNO = ii11Ii11 , f_DoorName = iIIiii1iiIi1i . f_DoorName1 . data ,
 f_DoorControl = iIIiii1iiIi1i . f_DoorControl1 . data , f_DoorDelay = iIIiii1iiIi1i . f_DoorDelay1 . data ,
 f_DoorEnabled = iIIiii1iiIi1i . f_DoorEnabled1 . data )
     db . session . add ( Ooo0oOoooOOOO )
     if OOOOO0Oo > 1 :
      ii11Ii11 = 2
      Ooo0oOoooOOOO = TBDoor ( f_ControllerID = OOOO0oOOo0o , f_DoorNO = ii11Ii11 ,
 f_DoorName = iIIiii1iiIi1i . f_DoorName2 . data ,
 f_DoorControl = iIIiii1iiIi1i . f_DoorControl2 . data , f_DoorDelay = iIIiii1iiIi1i . f_DoorDelay2 . data ,
 f_DoorEnabled = iIIiii1iiIi1i . f_DoorEnabled2 . data )
      db . session . add ( Ooo0oOoooOOOO )
     if OOOOO0Oo > 2 :
      ii11Ii11 = 3
      Ooo0oOoooOOOO = TBDoor ( f_ControllerID = OOOO0oOOo0o , f_DoorNO = ii11Ii11 ,
 f_DoorName = iIIiii1iiIi1i . f_DoorName3 . data ,
 f_DoorControl = iIIiii1iiIi1i . f_DoorControl3 . data , f_DoorDelay = iIIiii1iiIi1i . f_DoorDelay3 . data ,
 f_DoorEnabled = iIIiii1iiIi1i . f_DoorEnabled3 . data )
      db . session . add ( Ooo0oOoooOOOO )
      ii11Ii11 = 4
      Ooo0oOoooOOOO = TBDoor ( f_ControllerID = OOOO0oOOo0o , f_DoorNO = ii11Ii11 ,
 f_DoorName = iIIiii1iiIi1i . f_DoorName4 . data ,
 f_DoorControl = iIIiii1iiIi1i . f_DoorControl4 . data , f_DoorDelay = iIIiii1iiIi1i . f_DoorDelay4 . data ,
 f_DoorEnabled = iIIiii1iiIi1i . f_DoorEnabled4 . data )
      db . session . add ( Ooo0oOoooOOOO )
    db . session . commit ( )
    vwAppConfig . setcontrollerdoorChangeTime ( )
    vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 " Controller {} Add Successfully ！" . format (
 O0OO0o0O0OO0 ) ) )
    if 22 - 22: i1I
    if 89 - 89: i1I - I1Ii1I1 % iI1iII1I1I1i
    o0o00 += 1
   except Exception as oOO0oOoo0O0 :
    print ( oOO0oOoo0O0 )
    if 3 - 3: i1I * i1iiIII111 + IiIIii11Ii . i1i1i1111I
  if o0o00 > 0 :
   O0O0oO = str ( o0o00 )
   if 23 - 23: oOo0O00 % ooo000
  pass
  if 20 - 20: I1I
  if 82 - 82: i1i1i1111I + IiI11Ii111 + IIiIIiIi11I1
  if 3 - 3: Ooo0Ooo % IiIIii11Ii / I1I + ooOOO % I11iiIi11i1I
  if 4 - 4: I1Ii1I1 + i1 . oOo0O00 * ooOOO
 OOOO0O0ooO0O = db . session . query ( TBDoor . f_DoorID , TBDoor . f_DoorName , TBDoor . f_DoorNO ,
 TBController . f_ControllerSN ) . join ( TBController ,
 TBController . f_ControllerID == TBDoor . f_ControllerID ,
 isouter = False ) . order_by ( TBDoor . f_DoorName )
 i111IIi = OOOO0O0ooO0O . all ( )
 I1i = [ ]
 for i1iI1i in i111IIi :
  I1i . append ( i1iI1i . f_DoorID )
  if 58 - 58: Ii + iI1iII1I1I1i + i1i1i1111I * i1iiIII111
 Iiii = Iiii . split ( "," )
 Iiii = [ int ( x ) for x in Iiii ]
 Iiii . sort ( )
 if 71 - 71: OooOoo
 if 80 - 80: i1I
 IiIIIi11 = Ii1iiIIiI1i1I ( )
 IiIIIi11 = IiIIIi11 + 1
 IIIi1111iiIi1 = IiIIIi11
 I1II1ii111i = 'N{}' . format ( IiIIIi11 )
 if 35 - 35: i1iiIII111 - I11iiIi11i1I + Ooo0Ooo - i1iiIII111 * IiIIii11Ii / ooOOO
 IIiI1ioo = 0
 iiI = vwAppConfig . getDateTimeFromStr ( "2023-01-01" )
 iiiii1i1I1i = vwAppConfig . getDateTimeFromStr ( "2099-12-31" )
 if 20 - 20: iI1iII1I1I1i * i1iiIII111 * Oo * Oo % Ii
 iiii1iiI1iii1 = [ ]
 for II in Iiii :
  I11iIi1 = TBConsumer . query . filter_by ( f_CardNO = II ) . first ( )
  if I11iIi1 :
   iiii1iiI1iii1 . append ( I11iIi1 . f_ConsumerID )
   pass
  else :
   if 64 - 64: I1Ii1I1 * oOo0O00 - i1I * iI1iII1I1I1i . I1Ii1I1
   iiIi = TBConsumer ( f_ConsumerNO = IIIi1111iiIi1 , f_ConsumerName = I1II1ii111i ,
 f_GroupID = IIiI1ioo ,
 f_CardNO = II , f_BeginYMD = iiI , f_EndYMD = iiiii1i1I1i )
   db . session . add ( iiIi )
   db . session . commit ( )
   vwAppConfig . setusercardChangeTime ( )
   if 70 - 70: Oo / i1i1i1111I * I1Ii1I1 / i1 + I1Ii1I1
   IiIIIi11 = IiIIIi11 + 1
   IIIi1111iiIi1 = IiIIIi11
   I1II1ii111i = 'N{}' . format ( IiIIIi11 )
   I11iIi1 = TBConsumer . query . filter_by ( f_CardNO = II ) . first ( )
   if I11iIi1 :
    iiii1iiI1iii1 . append ( I11iIi1 . f_ConsumerID )
    if 51 - 51: oOo0O00 % Ooo0Ooo % oOo0O00 % Ooo0Ooo / IiIIii11Ii + i1
    if 68 - 68: ooOOO
 vwAppConfig . vwlog ( '{}--{}' . format ( g . user . f_OperatorName ,
 "Allowed to pass Doors={}-Users={}" . format ( len ( I1i ) ,
 len ( iiii1iiI1iii1 ) ) ) )
 if 37 - 37: Ii . i1i1i1111I
 if 64 - 64: Ii * Ooo0Ooo % i1i1i1111I
 IIiIIIII1iiI ( doorDst = I1i , userDst = iiii1iiI1iii1 , opMode = 'btnAddPass_Click' , opMessage = 'Allow' ,
 controltimeseg = OoOooOOoOo )
 if o0O == '1' :
  return "OK"
 O0O0oO = IIiI1i ( doorDst = I1i , userDst = iiii1iiI1iii1 , opMode = 'btnAddPass_Click' )
 if 87 - 87: Iii1i - i1i1i1111I * i1I + IiI11Ii111 + i1i1i1111I * i1I
 if O0O0oO [ "updateConFailed" ] :
  OoOOooO0oOO0Oo = """Permissions modification completed,
but this upload update was unsuccessful [due to communication failure with some controllers].
Please re-upload from the main console later."""
  vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo , O0O0oO [ "updateConFailed" ] ) )
  return OoOOooO0oOO0Oo
  if 34 - 34: iI1iII1I1I1i + IIiIIiIi11I1 + IIiIIiIi11I1 + IIiIIiIi11I1 + oOO + I1I
 return "OK"
 if 30 - 30: Ii / IiIIii11Ii * iI1iII1I1I1i - i1iiIII111 - ooo000
 if 60 - 60: OooOoo - ooo000 / Iii1i - OooOoo
@ bp . route ( '/pri_editUserPrivilege' , methods = [ 'POST' ] )
@ login_required
def web_pri_editUserPrivilege ( ) :
 OoOOoO0oo0oo = "wgcomm/user-editpri.html"
 iIiIIiiI = "wgcomm.web_user_list"
 I1ii = 0
 IIiIiIi = 0
 I1II1ii111i = ''
 if request . form . get ( 'conID' ) :
  III11i11III = request . form . get ( 'conID' )
  iI1i1i1 = TBConsumer . query . get ( III11i11III )
  if iI1i1i1 :
   IIiIiIi = III11i11III
   if 51 - 51: oOO + ooOOO
   I1II1ii111i = iI1i1i1 . f_ConsumerName
   I1ii = iI1i1i1 . f_CardNO
 else :
  if 30 - 30: IiI11Ii111 - IIiIIiIi11I1
  if request . form . get ( 'f_ConsumerID' ) :
   iIIiii1iiIi1i = AddUserForm ( request . form )
   if 56 - 56: IIiIIiIi11I1 / Ii * Oo + i1i1i1111I
   if 42 - 42: IiI11Ii111 - OooOoo + I11iiIi11i1I / I1I - IIiIIiIi11I1 - Iii1i
   if 40 - 40: i1iiIII111 / oOo0O00 * IiI11Ii111 * IiI11Ii111 - IiI11Ii111 . OooOoo
   if 68 - 68: IiIIii11Ii + OooOoo * IiIIii11Ii
   if iIIiii1iiIi1i . submitcancel . data :
    return redirect ( url_for ( iIiIIiiI ) )
   if 1 > 0 :
    if 73 - 73: Iii1i . IiIIii11Ii - i1 - I1I
    IIiIiIi = iIIiii1iiIi1i . f_ConsumerID . data
    o0OO0O0 = [ IIiIiIi ]
    if 43 - 43: OooOoo / i1I + i1I / i1 % IIiIIiIi11I1 / i1I
    o0oOo0O = [ ]
    I11IiIIiI = 1
    if request . form . get ( 'f_ControlSegID' ) :
     I11IiIIiI = request . form . get ( 'f_ControlSegID' )
    I1II1ii111i = iIIiii1iiIi1i . f_ConsumerName . data
    IIiiII1I1iIIII = request . form
    for i1iI1i in IIiiII1I1iIIII :
     if "ckd" in i1iI1i :
      o0oOo0O . append ( request . form . get ( i1iI1i ) )
      if 78 - 78: I1I / IiI11Ii111 % oOo0O00 . Ii * I1I
      if 68 - 68: i1 + Ooo0Ooo - Iii1i * ooOOO + I1I
      if 19 - 19: Iii1i . Ooo0Ooo * i1i1i1111I
    oO00o0000 = vwAppConfig . getStrFromArray ( o0oOo0O )
    iIIo0O = vwAppConfig . getStrFromArray ( o0OO0O0 )
    if 48 - 48: iI1iII1I1I1i / ooo000 * I1Ii1I1 % IiI11Ii111
    if 57 - 57: ooOOO . ooOOO - I1I
    if 91 - 91: oOo0O00 - i1I / i1iiIII111 / Oo . Ii
    if 42 - 42: IiIIii11Ii - i1iiIII111 / ooo000 * Iii1i % Ooo0Ooo
    if 83 - 83: I1Ii1I1 - IiI11Ii111 + Ii
    if 83 - 83: i1I + Ii % I11iiIi11i1I
    II11i111iI = TBDoor . query . count ( )
    if 8 - 8: OooOoo * i1i1i1111I - OooOoo . Oo / I1Ii1I1 % i1
    if 12 - 12: i1iiIII111 + Ooo0Ooo . i1iiIII111
    if 97 - 97: IIiIIiIi11I1
    if 52 - 52: I11iiIi11i1I . ooo000 - OooOoo * i1i1i1111I % I1I
    if 58 - 58: ooOOO . i1
    if 31 - 31: oOO
    if 4 - 4: i1
    if 62 - 62: Ii
    if 29 - 29: OooOoo / I11iiIi11i1I
    if 41 - 41: ooo000 - I11iiIi11i1I . oOo0O00
    if 64 - 64: Ooo0Ooo
    if 71 - 71: Ii
    if 26 - 26: I1I . i1I / Iii1i - i1i1i1111I + i1I
    ooo0o000 = TDPrivilege . query . filter_by ( f_ConsumerID = IIiIiIi ) . all ( )
    OO0Ooo0OOo = [ ]
    for i1iI1i in ooo0o000 :
     if i1iI1i . f_ControllerID not in OO0Ooo0OOo :
      OO0Ooo0OOo . append ( i1iI1i . f_ControllerID )
      if 42 - 42: Oo - oOo0O00 * iI1iII1I1I1i
    iI111i11 = "DELETE FROM  t_d_Privilege  WHERE f_ConsumerID = {} " . format (
 IIiIiIi )
    db . session . execute ( text ( iI111i11 ) )
    db . session . commit ( )
    vwAppConfig . WriteLine ( "DELETE FROM  t_d_Privilege End" )
    if 4 - 4: I11iiIi11i1I % I1I - Oo / Ii
    if len ( o0oOo0O ) :
     vwAppConfig . WriteLine ( "INSERT INTO t_d_Privilege Start" )
     iI111i11 = "INSERT INTO t_d_Privilege (f_ConsumerID, f_DoorID ,f_ControllerID, f_DoorNO, f_ControlSegID)"
     iI111i11 += " SELECT t_b_Consumer.f_ConsumerID, t_b_Door.f_DoorID, t_b_Door.f_ControllerID ,t_b_Door.f_DoorNO, " + str ( I11IiIIiI ) + " AS f_ControlSegID  "
     if 50 - 50: I1I
     iI111i11 += " FROM t_b_Consumer, t_b_Door "
     iI111i11 += " WHERE  t_b_Consumer.f_DoorEnabled=1 "
     if 26 - 26: oOo0O00 * I1I * oOo0O00 % iI1iII1I1I1i + Ii
     if 83 - 83: i1I / I1I + Iii1i % Iii1i + I1Ii1I1 / i1iiIII111
     if 27 - 27: ooo000 * i1iiIII111 * ooo000 - IiI11Ii111
     iI111i11 += " AND f_ConsumerID = {0} " . format ( IIiIiIi )
     if II11i111iI != len ( o0oOo0O ) :
      iI111i11 += " AND   " + " f_DoorID IN (" + oO00o0000 + " ) " + " "
     db . session . execute ( text ( iI111i11 ) )
     db . session . commit ( )
     if 97 - 97: IIiIIiIi11I1 - oOO
     vwAppConfig . WriteLine ( "INSERT INTO t_d_Privilege End" )
    try :
     db . session . commit ( )
     vwAppConfig . setusercardChangeTime ( )
     if 77 - 77: i1 * IiI11Ii111 . Oo
     O0O0oO = IIiI1i ( doorDst = o0oOo0O , userDst = [ IIiIiIi ] , opMode = 'btnAddPass_Click' ,
 bUploadAllUser = False , needupateControllers = OO0Ooo0OOo )
     if 1 - 1: IiI11Ii111
     if O0O0oO [ "updateConFailed" ] :
      OoOOooO0oOO0Oo = I1II1ii111i + """权限已EditFinished! ..
                        但此次上传更新不 Successfully [原因有些控制器Communication failure.], 
                        请稍后在总控制台重新上传."""
      vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 OoOOooO0oOO0Oo ,
 O0O0oO [ "updateConFailed" ] ) )
      flash ( I1II1ii111i + """ 权限已EditFinished! ..
                        但此次上传更新不 Successfully [原因有些控制器Communication failure.],
                        请稍后在总控制台重新上传.""" )
     else :
      if 7 - 7: ooOOO
      vwAppConfig . vwlog ( '{}--{} ' . format ( g . user . f_OperatorName ,
 "User {} permission modification uploaded successfully!  " . format (
 I1II1ii111i ) ) )
      flash ( "{0} user permission modification uploaded successfully!" . format ( I1II1ii111i ) )
     return redirect ( url_for ( iIiIIiiI ) )
    except Exception as oOO0oOoo0O0 :
     print ( oOO0oOoo0O0 )
     if 1 - 1: ooo000 - i1I * I1Ii1I1
     db . session . rollback ( )
     flash ( "{0} user permission modification failed!" . format ( I1II1ii111i ) )
     vwAppConfig . vwlog ( '{}--{}[{}] ' . format ( g . user . f_OperatorName ,
 " User {} Edit Failed ！" . format (
 I1II1ii111i ) , oOO0oOoo0O0 ) )
     iIIiii1iiIi1i = AddUserForm ( request . form )
     if 13 - 13: IiIIii11Ii
     if 28 - 28: Ooo0Ooo / IiIIii11Ii * ooOOO . Iii1i - Ii + Oo
     if 39 - 39: iI1iII1I1I1i + I1I
     if 16 - 16: Iii1i * I1Ii1I1 - Oo . i1 . i1I - oOO
     if 35 - 35: i1I . i1i1i1111I - OooOoo
     if 28 - 28: ooo000
 oo0oOo = [ ]
 OOOO0O0ooO0O = db . session . query ( TBDoor . f_DoorID , TBDoor . f_DoorName , TBDoor . f_DoorNO , TBController . f_ControllerSN ,
 TBDoor . f_DoorEnabled ) . filter_by ( f_DoorEnabled = True ) . filter (
 ~ TBController . f_ControllerSN . between ( 170123456 , 180123456 ) ) . join ( TBController ,
 TBController . f_ControllerID == TBDoor . f_ControllerID ) . order_by (
 TBDoor . f_DoorName )
 if 87 - 87: Ii . Ooo0Ooo - Ooo0Ooo - I1Ii1I1
 i111IIi = OOOO0O0ooO0O . all ( )
 if 2 - 2: i1i1i1111I . oOo0O00 + IIiIIiIi11I1 * ooOOO / Iii1i
 iIiIIi1III1I = " SELECT a.f_DoorID, a.f_DoorName ,t_d_Privilege.f_ControlSegID,  b.f_ZoneID, a.f_ControllerID, a.f_DoorNO,b.f_ControllerSN, '' as f_infactSegID "
 iIiIIi1III1I += " FROM t_b_Door a, t_b_Controller b, t_d_Privilege WHERE a.f_DoorEnabled > 0 and b.f_Enabled >0 and a.f_ControllerID=b.f_ControllerID "
 iIiIIi1III1I += " AND ( b.f_ControllerSN < 160000000 OR b.f_ControllerSN > 180000000 ) "
 iIiIIi1III1I += " and t_d_Privilege.f_doorID = a.f_DoorID and t_d_Privilege.f_ConsumerID=  {}" . format ( IIiIiIi )
 iIiIIi1III1I += " ORDER BY  a.f_DoorName "
 OOOO0O0ooO0O = db . session . execute ( text ( iIiIIi1III1I ) )
 oOoOO0 = OOOO0O0ooO0O . fetchall ( )
 if 86 - 86: i1 / iI1iII1I1I1i * Iii1i
 OOOO0O0ooO0O = db . session . query ( TBControlseg . f_ControlSegID , TBControlseg . f_ControlSegName ) . order_by (
 TBControlseg . f_ControlSegID )
 O000 = OOOO0O0ooO0O . all ( )
 I1Ii11iIIi = 0
 if 77 - 77: IIiIIiIi11I1 - I1Ii1I1 % IiIIii11Ii
 O00Oo = True
 for i1iI1i in i111IIi :
  oo0O0oo0o0O = 'Inconsistent.'
  I111 = 0
  i1iii = ''
  i111III111I1 = i1iI1i . f_DoorID
  oooO000 = i1iI1i . f_DoorName
  o00OOo0 = 0
  O0OoOooO = 0
  oOOOooOOooO00 = 'Not connected.'
  for Ii1Ii1i1i in oOoOO0 :
   if Ii1Ii1i1i . f_DoorID == i1iI1i . f_DoorID :
    I111 = Ii1Ii1i1i . f_ControlSegID
    o00OOo0 = 1
    break
  if I111 == 1 :
   i1iii = "Time Profile#{}-{}" . format ( '1' , 'Free Time' )
  elif I111 > 0 :
   for oo0o in O000 :
    if oo0o . f_ControlSegID == I111 :
     i1iii = "Time Profile#{}-{}" . format ( vwAppConfig . getStrNoneToSpace ( I111 ) ,
 vwAppConfig . getStrNoneToSpace ( oo0o . f_ControlSegName ) )
     break
  if I1Ii11iIIi == 0 :
   if I111 > 0 :
    I1Ii11iIIi = I111
    if 52 - 52: IiIIii11Ii - OooOoo + IIiIIiIi11I1
    if 87 - 87: IiIIii11Ii - i1i1i1111I - ooOOO % i1iiIII111 / IiIIii11Ii
    if 83 - 83: oOO - I1Ii1I1 * i1iiIII111 . I11iiIi11i1I
    if 81 - 81: i1iiIII111 % oOO
    if 81 - 81: i1I / I1I / ooo000 * Ooo0Ooo . I11iiIi11i1I . oOO
    if 6 - 6: i1I . ooOOO . I1Ii1I1 % i1 * i1iiIII111
    if 63 - 63: i1iiIII111
    if 94 - 94: ooo000 % ooo000 % i1
    if 74 - 74: Ooo0Ooo * Oo * i1
    if 82 - 82: OooOoo - I1I * Iii1i * Oo % OooOoo - i1i1i1111I
    if 89 - 89: ooo000 / I1I + oOO
    if 82 - 82: I1I
    if 4 - 4: Iii1i
    if 38 - 38: I1I
    if 24 - 24: i1i1i1111I . iI1iII1I1I1i + Ooo0Ooo . ooo000 + IiI11Ii111 . oOo0O00
    if 44 - 44: I1I + Ooo0Ooo + i1I % IIiIIiIi11I1
    if 82 - 82: Ii % IIiIIiIi11I1 * IIiIIiIi11I1 . IiIIii11Ii + Iii1i
    if 33 - 33: ooo000 - Oo % i1I - IiIIii11Ii % IIiIIiIi11I1 * Iii1i
    if 49 - 49: IIiIIiIi11I1
    if 98 - 98: IIiIIiIi11I1
    if 33 - 33: i1i1i1111I . Oo / ooo000 - i1iiIII111 * i1
    if 78 - 78: i1iiIII111 . oOO + iI1iII1I1I1i * I1I
    if 79 - 79: Iii1i . OooOoo * Iii1i % I11iiIi11i1I
    if 57 - 57: I11iiIi11i1I
    if 24 - 24: i1I + oOO - Ii * ooOOO
    if 75 - 75: I11iiIi11i1I
    if 63 - 63: oOo0O00 - I1Ii1I1
    if 6 - 6: i1iiIII111 % Oo - OooOoo
    if 10 - 10: IIiIIiIi11I1 - i1
    if 1 - 1: I1Ii1I1 * Ii - I1Ii1I1 + i1
    if 44 - 44: IIiIIiIi11I1 % iI1iII1I1I1i / Oo * I1Ii1I1 . OooOoo / IiI11Ii111
  oOoOO0O0 = { 'f_DoorID' : i111III111I1 , 'f_DoorName' : oooO000 , 'f_ControlSegID' : i1iii ,
 'f_pri_active' : o00OOo0
 }
  oo0oOo . append ( oOoOO0O0 )
 O00 = ''
 if O00Oo :
  O00 = '[Permissions synchronized]  '
  if 73 - 73: iI1iII1I1I1i
 iIIiii1iiIi1i = AddUserForm ( )
 iIIiii1iiIi1i . f_ConsumerID . data = IIiIiIi
 iIIiii1iiIi1i . f_ConsumerName . data = I1II1ii111i
 iIIiii1iiIi1i . f_CardNO . data = I1ii
 Ooo0OO = {

 "wgform" : iIIiii1iiIi1i ,
 "objlistDoor" : oo0oOo ,
 "deleteUrl" : "/user_del" ,
 "losecardUrl" : "/user_losecard" ,
 "username" : I1II1ii111i ,
 'cardNO' : I1ii ,
 'syncinfo' : O00 ,
 "timeprofiles" : O000 ,
 "selectedtimesegment" : I1Ii11iIIi

 }
 vwAppConfig . vwlog ( '{}--{}[{}]' . format ( g . user . f_OperatorName ,
 "Name: {},CardNO: {}" . format ( I1II1ii111i , I1ii ) ,
 "Permissions: {}..{}  " . format ( O00 , oo0oOo ) ) )
 if 64 - 64: Ooo0Ooo * I11iiIi11i1I . IiIIii11Ii
 return render_template ( "wgcomm/user-editpri.html" , ** Ooo0OO )
# dd678faae9ac167bc83abf78e5cb2f3f0688d3a3
