DavidD003 commited on
Commit
afb9f7b
·
1 Parent(s): 39289f1

Update SchedBuilderUtyModule.py

Browse files
Files changed (1) hide show
  1. SchedBuilderUtyModule.py +10 -18
SchedBuilderUtyModule.py CHANGED
@@ -315,16 +315,18 @@ def makeEEdict(ftInfoTbl,tempInfoTbl,wkHrs=40,tp='id'):
315
  for row in dtaTbl:
316
  # if row[1].lower().strip() in ['wwf','bud','blue','rock','silver','gold','student']: #Omit people not in packaging, or off, vacation etc
317
  if row[2] not in list(eeDict.keys()): #Double check ee hasn't already been generated... why Cory would include an ee on temp table with crew reading 'fulltime' is beyond me but there you go
318
- eeSkills=viewTBL('sklMtx',['trnNm'],filterOn=[('EEID',row[2])])
319
- eeSkills=[trnToDisp(nm[0]) for nm in eeSkills] #Gather display names for skills trained on, reducing lists within list to spread elements
320
- sk=[] #Create empty to accumulate all skills present within sublists of eeSkills
321
- for s in eeSkills:
322
- sk.extend(s)
323
- sen=viewTBL('senRef',fields=['sen'],filterOn=[('id',str(row[2]))])[0][0]
324
- anEE=ee(sen,row[1].lower().strip(),int(row[2]),row[3],row[4],row[5],row[8]+wkHrs,skills=sk) #Pull info from Refusals sheet
325
  if tp=='id':
 
 
 
 
 
 
 
326
  eeDict[anEE.eeID]=anEE
327
  elif tp=='nm':
 
 
328
  eeDict[anEE.dispNm().lower().replace(' ','-')]=anEE
329
  return eeDict
330
 
@@ -365,17 +367,7 @@ def getEEinfo(FtBook,TempBook): #Need to make volunteer shift data puller
365
 
366
  addTBL("FTinfo",fields=['sen','crew','id','last','first','ytd','totref','totchrg','wtdOT'],data=a,addOn=False)
367
  addTBL("TempInfo",fields=['sen','crew','id','last','first','ytd','totref','totchrg','wtdOT'],data=c,addOn=False)
368
- addTBL("sklMtx",fields=["EEID","trnNm"],data=b,addOn=False) #Overwrite all training data and populate FT ops, then append temps for a master table
369
- addTBL("sklMtx",fields=["EEID","trnNm"],data=d,addOn=True)
370
- #Generate a master seniority table.. following replaces hire date with integers for temps
371
- senHiLoTemps=viewTBL('TempInfo',sortBy=[('sen','ASC')]) #First retrieve list of temps, most senior to least
372
- i=100000 #Start new seniority number at arbitrarily high value not to interfere with full timer
373
- for row in senHiLoTemps:
374
- row[0]=i
375
- i+=1
376
- #Overwrite/make new master sen ref table. Then append the Temp data with integerized values
377
- addTBL("senRef",fields=['sen','crew','id','last','first','ytd','totref','totchrg','wtdOT'],data=a,addOn=False)
378
- addTBL("senRef",fields=['sen','crew','id','last','first','ytd','totref','totchrg','wtdOT'],data=senHiLoTemps,addOn=True)
379
  return a,c
380
 
381
  def addRecs(flNm,shNm,tblNm,data):
 
315
  for row in dtaTbl:
316
  # if row[1].lower().strip() in ['wwf','bud','blue','rock','silver','gold','student']: #Omit people not in packaging, or off, vacation etc
317
  if row[2] not in list(eeDict.keys()): #Double check ee hasn't already been generated... why Cory would include an ee on temp table with crew reading 'fulltime' is beyond me but there you go
 
 
 
 
 
 
 
318
  if tp=='id':
319
+ eeSkills=viewTBL('sklMtx',['trnNm'],filterOn=[('EEID',row[2])])
320
+ eeSkills=[trnToDisp(nm[0]) for nm in eeSkills] #Gather display names for skills trained on, reducing lists within list to spread elements
321
+ sk=[] #Create empty to accumulate all skills present within sublists of eeSkills
322
+ for s in eeSkills:
323
+ sk.extend(s)
324
+ sen=viewTBL('senRef',fields=['sen'],filterOn=[('id',str(row[2]))])[0][0]
325
+ anEE=ee(sen,row[1].lower().strip(),int(row[2]),row[3],row[4],row[5],row[8]+wkHrs,skills=sk) #Pull info from Refusals sheet
326
  eeDict[anEE.eeID]=anEE
327
  elif tp=='nm':
328
+ #Just need peoples names and EEID's linked from this.. enter dummy data for seniority, training, etc
329
+ anEE=ee(1,row[1].lower().strip(),int(row[2]),row[3],row[4],row[5],row[8]+wkHrs,skills=[])
330
  eeDict[anEE.dispNm().lower().replace(' ','-')]=anEE
331
  return eeDict
332
 
 
367
 
368
  addTBL("FTinfo",fields=['sen','crew','id','last','first','ytd','totref','totchrg','wtdOT'],data=a,addOn=False)
369
  addTBL("TempInfo",fields=['sen','crew','id','last','first','ytd','totref','totchrg','wtdOT'],data=c,addOn=False)
370
+
 
 
 
 
 
 
 
 
 
 
371
  return a,c
372
 
373
  def addRecs(flNm,shNm,tblNm,data):