def __init__(self): self.appId = self.getAppId() self.appName = self.getAppName() self.procLogFileName = self.appId + "_" + StringOperationLib.toString( DateUtilLib.getToday()) + self.logExt self.errLogFileName = self.appId + "_" + StringOperationLib.toString( DateUtilLib.getToday()) + "_Err" + self.logExt
def run(self): targetYear = self.getForm('-year') if targetYear == '': self.writeLog('parameter:-year is not set') return #祝祭日一覧 holidayList = DateUtilLib.getHolidayList( StringOperationLib.toInt(targetYear)) values = [] #BulkInsert処理 for day in holidayList: holidayDate = StringOperationLib.toString(day[0]) holidayMonth = StringOperationLib.toString( holidayDate[0:holidayDate.rfind('-')]) holidayName = DateUtilLib.getHolidayName(day[0]) values.append([holidayDate, holidayMonth, holidayName]) dao = HolidayDao(self.db) dao.addBulkCol(HolidayDao.COL_HOLIDAY_DATE) dao.addBulkCol(HolidayDao.COL_MONTH) dao.addBulkCol(HolidayDao.COL_HOLIDAY_NAME) dao.doBulkInsert(values) self.writeLog(targetYear + '年祝祭日データ登録完了') return
def getDateFormatJapanese(date): year = StringOperationLib.toString(StringOperationLib.left(date, 4)) + '年' month = StringOperationLib.toString( StringOperationLib.toInt(StringOperationLib.mid(date, 6, 2))) + '月' day = StringOperationLib.toString( StringOperationLib.toInt(StringOperationLib.right(date, 2))) + '日' return year + month + day
def run(self): self.writeLog('処理開始') date = self.getForm('-date') if date == '': self.writeLog('parameter:-date is not set') return #前回データを削除 self.deleteLastSessionData() #処理する社員情報を取得 employeeList = self.getEmployeeList() dt = DateUtilLib.toDateTimeDate(date) dt = StringOperationLib.toString(DateUtilLib.getDateIntervalMonth(dt, -1)) targetYm = StringOperationLib.mid(dt, 1, dt.rfind('-')) #ループ内 for i in range(len(employeeList)): userId = StringOperationLib.toString(employeeList[i][EmployeeDao.COL_ID]) name = StringOperationLib.toString(employeeList[i][EmployeeDao.COL_NAME]) loginId = StringOperationLib.toString(employeeList[i][EmployeeDao.COL_LOGIN_ID]) self.writeLog('処理対象社員名 : ' + name) #個人ディレクトリを作成 employeeDir = self.makeEmployeeDir(name) #データを取得 trafficList = self.getExpensesList(userId, targetYm, '1') expensesList = self.getExpensesList(userId, targetYm, '2') #1件でもあれば、精算書を作成 if len(trafficList) > 0: self.makeTrafficExcel(targetYm, trafficList, name, employeeDir) if len(expensesList) > 0: self.makeExpensesExcel(targetYm, expensesList, name, employeeDir) #領収書ファイルがあれば、コピー self.copyReceiptFile(targetYm, loginId, employeeDir) #Zipにまとめる self.makeZipFile() #メール送信 self.sendCostManage(targetYm) self.writeLog('処理完了') return
def copyReceiptFile(self, targetYm, loginId, toPath): year, month = DateUtilLib.splitYm(targetYm) ym = StringOperationLib.toString(year) + StringOperationLib.toString(month) fromPath = FileOperationLib.getFileList(Config.getConf('RECEIPTinfo', 'receipt_file_path') + loginId + '/' + ym + '/') for file in fromPath: if not(StringOperationLib.match(FileOperationLib.getFileName(file), '*.xlsx')): fileName = FileOperationLib.getFileName(file).encode('utf-8', 'surrogateescape').decode('SJIS', 'surrogateescape') FileOperationLib.copyFile(file, toPath + fileName)
def makeExpensesExcel(self, targetYm, expensesList, employeeName, path): expensesName = '経費精算書' year, month = DateUtilLib.splitYm(targetYm) lastDay = DateUtilLib.getLastDay(StringOperationLib.toInt(year), StringOperationLib.toInt(month)) ym = DateUtilLib.getYmFormatJapanese(targetYm) ymd = ym + StringOperationLib.toString(lastDay) + '日' name = StringOperationLib.replace(employeeName, " ", "") excel = PythonExcelLib() excel.setPageA4 excel.setOrientation() excel.rename(expensesName) #タイトル等共通部分 self.setCommon(excel, ym, ymd, name, expensesName) #項目名 self.setExpensesTitle(excel) #データ lastRow = self.setListValue(excel, expensesList) #合計 self.setCostSumValue(excel, lastRow, 'E') #体裁 self.expensesExcelFormat(excel, copy(lastRow)) excel.save(path + expensesName + '.xlsx') #オブジェクト解放 del excel
def mainProc(self, args): try: ''' 実行引数を受け取る ''' for num in range(len(args)): if num > 0: if args[num][0] == '-': key = args[num] value = args[num + 1] self.form[key] = value ''' confファイルを読み込み ''' Config.confLoad('system') ''' ロガーオープン ''' self.logger = BaseLogger(self.procLogFileName) self.logger.fileOpen() self.logger.writeLog( "START_TIME=" + StringOperationLib.toString(DateUtilLib.getTime())) self.logger.writeLog("START_BATCH_NAME=" + self.appName) self.logger.writeLog("PARAM_INFO=" + self.appId + " param:" + " ".join(args)) ''' DB接続 ''' self.db = DbManager() self.db.connect() ''' ロジック実行 ''' logic = self.getLogic(self.db, self.logger, self.form) logic.run() except Exception as e: self.errProc(e) finally: self.db.disConnect() self.logger.writeLog( "END_TIME=" + StringOperationLib.toString(DateUtilLib.getTime()) + '\r\n') self.logger.fileClose()
def trafficExcelFormat(self, excel, lastRow): #列幅 excel.setCellWidth('A', 15) excel.setCellWidth('B', 12) excel.setCellWidth('C', 12) excel.setCellWidth('D', 15) excel.setCellWidth('E', 15) excel.setCellWidth('F', 35) excel.setCellWidth('G', 15) excel.setCellWidth('H', 7) #結合 excel.mergeCell('A1:H1') excel.mergeCell('B2:C2') excel.mergeCell('B3:C3') excel.mergeCell('B4:C4') excel.mergeCell('G2:H2') excel.mergeCell('G3:H4') #フォントサイズ excel.changeSizeMulti('A7:H' + StringOperationLib.toString(lastRow), 9) excel.changeSize('G3', 18) #背景色 excel.changeCellBackColorMulti('A2:A4', 'DBDBDB') excel.changeCellBackColorMulti('A6:H6', 'DBDBDB') excel.changeCellBackColorMulti('G2:H2', 'DBDBDB') #罫線 excel.setBorderMulti('A6:H' + StringOperationLib.toString(lastRow + 1), 'hair') excel.setBorderMulti('A6:H6', 'thin', '000000', 'top') excel.setBorderMulti('H6:H' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'right') excel.setBorderMulti('A' + StringOperationLib.toString(lastRow + 1) + ':H' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'top') excel.setBorderMulti('A' + StringOperationLib.toString(lastRow + 1) + ':H' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'bottom') excel.setBorderMulti('A6:A' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'left') excel.setBorderMulti('A2:C4') excel.setBorderMulti('G2:H4') #位置 excel.setAlignment('A1', 'top', 'center') excel.setAlignment('G2', 'top', 'center') excel.setAlignment('G3', 'center', 'center') excel.setAlignmentMulti('A6:H6', 'center', 'center') excel.setAlignmentMulti('F7:F' + StringOperationLib.toString(lastRow), 'center', 'left', True) #フォーマット excel.setNumberFormat('G3', '#,##0')
def deleteReceiptFile(self, arr): #社員情報を取得 eDao = EmployeeDao(self.db) eDao.addWhereStr(EmployeeDao.COL_LOGIN_ID, Config.getConf('DBinfo', 'admin_user_id'), EmployeeDao.COMP_NOT_EQUAL) #管理者は除外 eList = eDao.doSelectCol(EmployeeDao.COL_LOGIN_ID) self.writeLog('ディレクトリ削除開始:' + StringOperationLib.toString(DateUtilLib.getToday())) for i in range(len(eList)): for j in range(len(arr)): ym = StringOperationLib.toString(StringOperationLib.left(arr[j], 4) + StringOperationLib.right(arr[j], 2)) user_id = StringOperationLib.toString(eList[i]) dirPath = Config.getConf('RECEIPTinfo', 'receipt_file_path') + user_id + '/' + ym if FileOperationLib.existDir(dirPath): FileOperationLib.deleteDir(dirPath) self.writeLog('ディレクトリ削除 ユーザーID: ' + user_id + ' 対象年月: ' + ym) self.writeLog('ディレクトリ削除完了:' + StringOperationLib.toString(DateUtilLib.getToday()))
def setOtherArea(self, excel, lastRow): row = lastRow + 3 #実出勤日数、就業時間数 excel.setValueR1C1(10, row, '実出勤日数') excel.setValueR1C1(12, row, '=COUNTA(E6:E' + StringOperationLib.toString(lastRow) + ') & "日"') row+=1 excel.setValueR1C1(10, row, '就業時間数') excel.setValueR1C1(12, row, '=L' + StringOperationLib.toString(lastRow + 1)) #連絡欄 row+=2 excel.setValueR1C1(1, row, '連絡欄') #押印欄 row+=6 excel.setValueR1C1(9, row, '確認') excel.setValueR1C1(11, row, '承認')
def expensesExcelFormat(self, excel, lastRow): #列幅 excel.setCellWidth('A', 15) excel.setCellWidth('B', 15) excel.setCellWidth('C', 15) excel.setCellWidth('D', 40) excel.setCellWidth('E', 15) excel.setCellWidth('F', 7) #結合 excel.mergeCell('A1:F1') excel.mergeCell('B2:C2') excel.mergeCell('B3:C3') excel.mergeCell('B4:C4') excel.mergeCell('E2:F2') excel.mergeCell('E3:F4') #フォントサイズ excel.changeSizeMulti('A7:H' + StringOperationLib.toString(lastRow), 9) excel.changeSize('E3', 18) #背景色 excel.changeCellBackColorMulti('A2:A4', 'DBDBDB') excel.changeCellBackColorMulti('A6:F6', 'DBDBDB') excel.changeCellBackColorMulti('E2:F2', 'DBDBDB') #罫線 excel.setBorderMulti('A6:F' + StringOperationLib.toString(lastRow + 1), 'hair') excel.setBorderMulti('A6:F6', 'thin', '000000', 'top') excel.setBorderMulti('F6:F' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'right') excel.setBorderMulti('A' + StringOperationLib.toString(lastRow + 1) + ':F' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'top') excel.setBorderMulti('A' + StringOperationLib.toString(lastRow + 1) + ':F' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'bottom') excel.setBorderMulti('A6:A' + StringOperationLib.toString(lastRow + 1), 'thin', '000000', 'left') excel.setBorderMulti('A2:C4') excel.setBorderMulti('E2:F4') #位置 excel.setAlignment('A1', 'top', 'center') excel.setAlignment('E2', 'top', 'center') excel.setAlignment('E3', 'center', 'center') excel.setAlignmentMulti('A6:F6', 'center', 'center') excel.setAlignmentMulti('D7:D' + StringOperationLib.toString(lastRow), 'center', 'left', True) #フォーマット excel.setNumberFormat('E3', '#,##0')
def makeUpdateStatement(self): sql = 'UPDATE ' + self.table + ' SET ' keys = list(self.colValMap.keys()) for i in range(len(keys)): if i > 0: sql += ', ' sql += keys[i] + self.COMP_EQUAL + StringOperationLib.toString( self.colValMap[keys[i]]) return sql
def deleteTimeRecordConfigData(self, ids): dao = TimeRecordConfigDao(self.db) dao.addWhereIn(TimeRecordConfigDao.COL_EMPLOYEE_ID, ids) count = dao.doCount() self.writeLog('勤怠設定データ削除対象件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() return
def deleteWeeklyReportData(self, ids): dao = WeeklyReportDao(self.db) dao.addWhereIn(WeeklyReportDao.COL_REGIST_USER_ID, ids) count = dao.doCount() self.writeLog('週報データ削除対象件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() return
def makeBaseMap(self, dt, holidayList): year, month, _ = DateUtilLib.splitYmd(dt) lastDay = DateUtilLib.getLastDay(StringOperationLib.toInt(year), StringOperationLib.toInt(month)) baseMap = {} hi = DateUtilLib.toDateTimeDate(dt) for x in range(lastDay): weekday = DateUtilLib.getWeekDayName(hi) day = DateUtilLib.getDay(hi) if StringOperationLib.toString(hi) in holidayList: weekday = '祝' baseMap[StringOperationLib.toString(hi)] = [day, weekday, '', '', '', '', '', '', '', '', '', '', ''] hi = DateUtilLib.getDateIntervalDay(hi, 1) return baseMap
def deleteReceiptFile(self, ids): #社員情報を取得 eDao = EmployeeDao(self.db) eDao.addWhereIn(EmployeeDao.COL_ID, ids) eList = eDao.doSelectCol(EmployeeDao.COL_LOGIN_ID) self.writeLog('ディレクトリ削除開始:' + StringOperationLib.toString(DateUtilLib.getToday())) for i in range(len(eList)): user_id = StringOperationLib.toString(eList[i]) dirPath = Config.getConf('RECEIPTinfo', 'receipt_file_path') + user_id #年月は関係なし(ユーザーIDのディレクトリごとまるっと削除する) if FileOperationLib.existDir(dirPath): FileOperationLib.deleteDir(dirPath) self.writeLog('ディレクトリ削除 ユーザーID: ' + user_id) self.writeLog('ディレクトリ削除完了:' + StringOperationLib.toString(DateUtilLib.getToday()))
def deleteNoticeData(self, ids): dao = NoticeDao(self.db) dao.addWhereIn(NoticeDao.COL_ID, ids) count = dao.doCount() self.writeLog('お知らせ削除対象データ件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() return
def deletePresenceData(self, ids): dao = PresenceDao(self.db) dao.addWhereIn(PresenceDao.COL_NOTICE_ID, ids) count = dao.doCount() self.writeLog('出欠状況削除対象データ件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() return
def deleteData(self, dt): self.writeLog('削除基準日:' + dt) dao = ExpensesDao(self.db) dao.addWhereStr(ExpensesDao.COL_REGIST_YM, dt, ExpensesDao.COMP_LESS) count = dao.doCount() self.writeLog('削除対象データ件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() return count
def deleteExpensesData(self, ids): dao = ExpensesDao(self.db) dao.addWhereIn(ExpensesDao.COL_EMPLOYEE_ID, ids) count = dao.doCount() self.writeLog('勤怠データ削除対象件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() #領収書ファイル self.deleteReceiptFile(ids) return
def getTotalList(self, employeeId, fromDt, toDt): dao = TimeRecordDao(self.db) dao.addSelectSumAs(TimeRecordDao.COL_BREAK_TIME, 'total_break_time') dao.addSelectSumAs(TimeRecordDao.COL_PRESCRIBED_TIME, 'total_prescribed_time') dao.addSelectSumAs(TimeRecordDao.COL_OVER_WORK_TIME, 'total_over_work_time') dao.addSelectSumAs(TimeRecordDao.COL_MIDNIGHT_TIME, 'total_midnight_time') dao.addSelectSumAs(TimeRecordDao.COL_MIDNIGHT_BREAK_TIME, 'total_midnight_break_time') dao.addSelectSumAs(TimeRecordDao.COL_MIDNIGHT_OVER_WORK_TIME, 'total_midnight_over_work_time') dao.addSelectSumAs(TimeRecordDao.COL_WORK_TIME, 'total_work_time') dao.addWhere(TimeRecordDao.COL_EMPLOYEE_ID, StringOperationLib.toString(employeeId)) dao.addWhereStr(TimeRecordDao.COL_WORK_DATE, fromDt, TimeRecordDao.COMP_GREATER_EQUAL) dao.addWhereStr(TimeRecordDao.COL_WORK_DATE, toDt, TimeRecordDao.COMP_LESS) dao.addWhereIn(TimeRecordDao.COL_SCENE, [1,3]) #共通と本社用のみ取得してくる return dao.doSelectInfo()
def getDbMap(self, employeeId, fromDt, toDt): dbMap = {} dao = TimeRecordDao(self.db) dao.addSelect(TimeRecordDao.COL_WORK_DATE) dao.addSelect(TimeRecordDao.COL_CLASSIFICATION) dao.addSelect(TimeRecordDao.COL_START_TIME) dao.addSelect(TimeRecordDao.COL_END_TIME) dao.addSelect(TimeRecordDao.COL_BREAK_TIME) dao.addSelect(TimeRecordDao.COL_PRESCRIBED_TIME) dao.addSelect(TimeRecordDao.COL_OVER_WORK_TIME) dao.addSelect(TimeRecordDao.COL_MIDNIGHT_TIME) dao.addSelect(TimeRecordDao.COL_MIDNIGHT_BREAK_TIME) dao.addSelect(TimeRecordDao.COL_MIDNIGHT_OVER_WORK_TIME) dao.addSelect(TimeRecordDao.COL_WORK_TIME) dao.addSelect(TimeRecordDao.COL_REMARK) dao.addWhere(TimeRecordDao.COL_EMPLOYEE_ID, str(employeeId)) dao.addWhereStr(TimeRecordDao.COL_WORK_DATE, fromDt, TimeRecordDao.COMP_GREATER_EQUAL) dao.addWhereStr(TimeRecordDao.COL_WORK_DATE, toDt, TimeRecordDao.COMP_LESS) dao.addWhereIn(TimeRecordDao.COL_SCENE, [1,3]) #共通と本社用のみ取得してくる select = dao.doSelect() for i in range(len(select)): key = StringOperationLib.toString(select[i][TimeRecordDao.COL_WORK_DATE]) clsVal = self.classMap[select[i][TimeRecordDao.COL_CLASSIFICATION]] startTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_START_TIME]) endTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_END_TIME]) breakTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_BREAK_TIME]) prescribedTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_PRESCRIBED_TIME]) overWorkTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_OVER_WORK_TIME]) midnightTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_MIDNIGHT_TIME]) midnightBreakTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_MIDNIGHT_BREAK_TIME]) midnightOverWorkTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_MIDNIGHT_OVER_WORK_TIME]) workTime = DateUtilLib.toHm(select[i][TimeRecordDao.COL_WORK_TIME]) remark = select[i][TimeRecordDao.COL_REMARK] dbMap[key] = [clsVal, startTime, endTime, breakTime, prescribedTime, overWorkTime, midnightTime, midnightBreakTime, midnightOverWorkTime, workTime, remark] return dbMap
def makeInsertStatement(self): sql = 'INSERT INTO ' + self.table + '(' keys = list(self.colValMap.keys()) for i in range(len(keys)): if i > 0: sql += ', ' sql += keys[i] sql += ') VALUES (' values = list(self.colValMap.values()) for i in range(len(values)): if i > 0: sql += ', ' sql += StringOperationLib.toString(values[i]) sql += ');' return sql
def run(self): self.writeLog('処理開始') date = self.getForm('-date') if date == '': self.writeLog('parameter:-date is not set') return #前回処理分を削除 self.deleteLastSessionData() #処理する社員情報を取得 employeeMap = self.getEmployeeMap() dt = DateUtilLib.toDateTimeDate(date) dt = StringOperationLib.toString(DateUtilLib.getDateIntervalMonth(dt, -1)) #祝祭日マスタを取得しておく holidayList = self.getHolidayList(dt, date) #ループ for id, name in employeeMap.items(): self.writeLog('処理対象社員名 : ' + name) #勤怠データを取得 timeRecordMaplist = self.getTimeRecordMapList(id, dt, date, holidayList) totalList = self.getTotalList(id, dt, date) #Excel作成 self.makeExcel(dt, timeRecordMaplist, totalList, name) #作成したExcelをZipにまとめる self.makeZipFile() #メールで送信する self.sendTimeSheet(dt) self.writeLog('処理完了') return
def getExpensesList(self, userId, registYm, inputType): dao = ExpensesDao(self.db) dao.addSelect(ExpensesDao.COL_EXPENSES_YMD) if inputType == '1': #交通費の場合 dao.addSelect(ExpensesDao.COL_ROUND_TRIP_TYPE) dao.addSelect(ExpensesDao.COL_TRANSPORT) dao.addSelect(ExpensesDao.COL_FROM_PLACE) dao.addSelect(ExpensesDao.COL_TO_PLACE) elif inputType == '2': #経費の場合 dao.addSelect(ExpensesDao.COL_PAY_TYPE) dao.addSelect(ExpensesDao.COL_EXPENSES_TYPE) dao.addSelect(ExpensesDao.COL_EXPENSES_DETAIL) dao.addSelect(ExpensesDao.COL_COST) dao.addWhere(ExpensesDao.COL_EMPLOYEE_ID, userId) dao.addWhereStr(ExpensesDao.COL_INPUT_TYPE, inputType) dao.addWhereStr(ExpensesDao.COL_REGIST_YM, registYm) select = dao.doSelect() expensesList = [] for i in range(len(select)): expensesYmd = StringOperationLib.toString(select[i][ExpensesDao.COL_EXPENSES_YMD]) expensesYmd = DateUtilLib.getDateFormatJapanese(expensesYmd) if inputType == '1': roundTrip = '' #交通費 if select[i][ExpensesDao.COL_ROUND_TRIP_TYPE] != None: roundTrip = self.roundTripTypeMap[select[i][ExpensesDao.COL_ROUND_TRIP_TYPE]] expensesList.append([expensesYmd, roundTrip, select[i][ExpensesDao.COL_TRANSPORT], select[i][ExpensesDao.COL_FROM_PLACE], select[i][ExpensesDao.COL_TO_PLACE], select[i][ExpensesDao.COL_EXPENSES_DETAIL], select[i][ExpensesDao.COL_COST]]) elif inputType == '2': #経費(現金、立替金は固定出力) expensesList.append([expensesYmd, '現金', '立替金', select[i][ExpensesDao.COL_EXPENSES_DETAIL], select[i][ExpensesDao.COL_COST]]) return expensesList
def run(self): date = self.getForm('-date') if date == '': self.writeLog('parameter:-date is not set') return #基準日を取得(3ヶ月保持) stdDate = self.getStandardDate(date) #過去データを削除する dao = ConferenceAppointDao(self.db) dao.addWhereStr(ConferenceAppointDao.COL_TARGET_DATE, stdDate, ConferenceAppointDao.COMP_LESS) count = dao.doCount() self.writeLog('削除対象データ件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() return
def run(self): date = self.getForm('-date') interval = int(self.getForm('-interval', 60)) if date == '': self.writeLog('parameter:-date is not set') return targetDate = self.getTargetDate(date, interval) #パス取得 dirPath = Config.getConf('LOGinfo', 'log_file_path') count = 0 for logPath in FileOperationLib.getFileList(dirPath, '*' + targetDate + '*.log'): FileOperationLib.deleteFile(logPath) count += 1 self.writeLog('ログ削除件数:' + StringOperationLib.toString(count) + '件') return
def run(self): date = self.getForm('-date') if date == '': self.writeLog('parameter:-date is not set') return stdDate = self.getStandardDate(date) self.writeLog('削除基準日:' + stdDate) dao = WeeklyReportDao(self.db) dao.addWhereStr(WeeklyReportDao.COL_STANDARD_DATE, stdDate, WeeklyReportDao.COMP_LESS) count = dao.doCount() self.writeLog('削除対象データ件数:' + StringOperationLib.toString(count) + '件') dao.doDelete() return
def run(self): date = self.getForm('-date') if date == '': self.writeLog('parameter:-date is not set') return #掲載期限切れデータの情報を取得 ids = self.getDeleteTargetData(date) if len(ids) == 0: self.writeLog('削除対象データなし') return self.writeLog('データ削除実施日:' + StringOperationLib.toString(date)) #掲載期限切れデータを削除 self.deleteNoticeData(ids) #付随する出欠確認データを削除 self.deletePresenceData(ids) return
def writeErrLog(self, e): self.file.write(StringOperationLib.toString(e) + '\r\n')