from helper.mongod import Mongodb from helper.excel import Excel from helper.jaccs import Config from helper.common import Common try: mongodb = Mongodb("worldfone4xs") _mongodb = Mongodb("_worldfone4xs") excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = config.base_url() now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'SBV') url = '/var/www/html/worldfone4xs_ibm/cronjob/python/Loan/ZACCF_header.xlsx' filename = 'ZACCF_header.xlsx' filenameExtension = filename.split('.') if (filenameExtension[1] == 'csv'): inputDataRaw = excel.getDataCSV(file_path=url, sep=',', header=0, low_memory=False) else: inputDataRaw = excel.getDataExcel(file_path=url, header=0) inputData = inputDataRaw.to_dict('records') importData = []
try: excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) log = open( base_url + "cronjob/python/Loan/log/importListOfAccountInCollection.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Trial_balance_report') modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] today = date.today() yesterday = today - timedelta(days=1) # today = datetime.strptime('20/11/2019', "%d/%m/%Y").date() day = today.day
from helper.jaccs import Config from helper.common import Common mongodb = Mongodb("worldfone4xs") _mongodb = Mongodb("_worldfone4xs") excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = config.base_url() log = open( base_url + "cronjob/python/Loan/log/importListOfAccountInCollection.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'List_of_account_in_collection') try: modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] # today = date.today() today = datetime.strptime('20/11/2019', "%d/%m/%Y").date() day = today.day
from helper.excel import Excel from helper.jaccs import Config from helper.common import Common excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) log = open(base_url + "cronjob/python/Loan/log/importSiteResult.txt","a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Site_result') try: modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] total = 0 complete = 0 today = date.today()
from helper.excel import Excel from helper.jaccs import Config from helper.common import Common excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) log = open(base_url + "cronjob/python/Loan/log/importLawsuit.txt","a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Lawsuit') try: modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] total = 0 complete = 0 today = date.today()
from datetime import datetime from datetime import date from datetime import timedelta from pprint import pprint from bson import ObjectId from helper.common import Common import pandas as pd common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) now = datetime.now() subUserType = 'LO' account_collection = common.getSubUser(subUserType, 'List_of_account_in_collection') sbv_collection = common.getSubUser(subUserType, 'SBV') collection = common.getSubUser(subUserType, 'Group_card') due_date_collection = common.getSubUser(subUserType, 'Report_due_date') log = open(base_url + "cronjob/python/Loan/log/groupCard_log.txt", "a") try: data = [] insertData = [] updateDate = [] day = now.strftime("%d/%m/%Y") day = common.convertTimestamp(value=day) result_due_date = mongodb.getOne(MONGO_COLLECTION=due_date_collection, WHERE={'due_date_add_1': day}) # log.write(now.strftime("%d/%m/%Y, %H:%M:%S") + ': Start Log' + '\n')
from helper.common import Common from helper.mongodbaggregate import Mongodbaggregate from math import ceil excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) # log = open(base_url + "cronjob/python/Loan/log/importSBV.txt","a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'First_time_payment_delinqunecy') lnjc05_collection = 'LNJC05' zaccf_collection = 'ZACCF_report' try: today = date.today() # today = datetime.strptime('31/03/2020', "%d/%m/%Y").date() yesterday = today - timedelta(days=1) day = today.day month = today.month year = today.year weekday = today.weekday() lastDayOfMonth = calendar.monthrange(year, month)[1] insertData = [] todayString = today.strftime("%d/%m/%Y") todayTimeStamp = int(
from helper.mongod import Mongodb from helper.excel import Excel from helper.jaccs import Config from helper.common import Common mongodb = Mongodb("worldfone4xs") _mongodb = Mongodb("_worldfone4xs") excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = config.base_url() log = open(base_url + "cronjob/python/Loan/log/importlnjc05.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'LNJC05') try: modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] ftpInfo = mongodb.getOne(MONGO_COLLECTION=common.getSubUser( subUserType, 'ftp_config'),
from bson import ObjectId from helper.ftp import Ftp from helper.mongod import Mongodb from helper.excel import Excel from helper.jaccs import Config from helper.common import Common from helper.mongodbaggregate import Mongodbaggregate common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) subUserType = 'LO' collection = common.getSubUser(subUserType, 'Daily_prod_each_group') lnjc05_collection = common.getSubUser(subUserType, 'LNJC05') ln3206_collection = common.getSubUser(subUserType, 'LN3206F') product_collection = common.getSubUser(subUserType, 'Product') sbv_collection = common.getSubUser(subUserType, 'SBV') store_collection = common.getSubUser(subUserType, 'SBV_Stored') account_collection = common.getSubUser(subUserType, 'List_of_account_in_collection') payment_of_card_collection = common.getSubUser(subUserType, 'Report_input_payment_of_card') jsondata_collection = common.getSubUser(subUserType, 'Jsondata') report_due_date_collection = common.getSubUser(subUserType, 'Report_due_date') due_date_next_date_collection = common.getSubUser(subUserType, 'Due_date_next_date') log = open(base_url + "cronjob/python/Loan/log/dailyEachDueDateEachGroup_log.txt","a") now = datetime.now() log.write(now.strftime("%d/%m/%Y, %H:%M:%S") + ': Start Import' + '\n')
from bson import ObjectId from helper.common import Common import pandas as pd from helper.jaccs import Config import xlsxwriter import traceback common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Daily_assignment_report') log = open(base_url + "cronjob/python/Loan/log/exportDailyAssignment_log.txt", "a") log.write(now.strftime("%d/%m/%Y, %H:%M:%S") + ': Start Import' + '\n') # fileOutput = "C:\\Users\\DELL\\Desktop\\temp-excel.xlsx" try: data = [] insertData = [] resultData = [] errorData = [] today = date.today() # today = datetime.strptime('25/03/2020', "%d/%m/%Y").date() day = today.day
excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) log = open( base_url + "cronjob/python/Loan/log/importReportInputPaymentOfCard.txt", "a") logCheckTime = open( base_url + "cronjob/python/Loan/log/importcheckTime.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Report_input_payment_of_card') logCheckTime.write(str(time.time())) modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] total = 0 complete = 0 today = date.today()
from pprint import pprint from bson import ObjectId from helper.common import Common import pandas as pd from helper.jaccs import Config import xlsxwriter common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Master_data_report') log = open(base_url + "cronjob/python/Loan/log/exportMasterData_log.txt", "a") try: data = [] insertData = [] resultData = [] errorData = [] today = date.today() # today = datetime.strptime('06/02/2020', "%d/%m/%Y").date() day = today.day month = today.month year = today.year weekday = today.weekday()
from xlsxwriter.utility import xl_rowcol_to_cell import pandas as pd from helper.jaccs import Config import xlsxwriter import traceback common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) log = open(base_url + "cronjob/python/Loan/log/saveTendencyDelinquent.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'First_time_payment_delinqunecy') collection_column = common.getSubUser( subUserType, 'First_time_payment_delinqunecy_columns') try: today = date.today() # today = datetime.strptime('18/01/2020', "%d/%m/%Y").date() yesterday = today - timedelta(days=1) day = today.day month = today.month year = today.year year_two_digit = today.strftime("%y") weekday = today.weekday() lastDayOfMonth = calendar.monthrange(year, month)[1] insertData = [] todayString = today.strftime("%d/%m/%Y")
from helper.common import Common excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) log = open( base_url + "cronjob/python/Loan/log/importListOfCusAssignedToPartner.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Cus_assigned_partner') try: modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] today = date.today() today = datetime.strptime('31/03/2020', "%d/%m/%Y").date() yesterday = today - timedelta(days=1)
from helper.excel import Excel from helper.jaccs import Config from helper.common import Common excel = Excel() config = Config() ftp = Ftp() common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) log = open(base_url + "cronjob/python/Loan/log/importWoAllProd.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Wo_all_prod') try: modelColumns = [] modelConverters = {} modelConverters1 = [] modelPosition = {} modelPosition1 = [] modelFormat = {} modelFormat1 = [] converters = {} insertData = [] errorData = [] today = date.today() # today = datetime.strptime('20/11/2019', "%d/%m/%Y").date() yesterday = today - timedelta(days=1)
from helper.mongod import Mongodb from datetime import datetime from datetime import date, timedelta from pprint import pprint from bson import ObjectId from helper.common import Common import pandas as pd common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Daily_payment_report') log = open(base_url + "cronjob/python/Loan/log/exportDailyPayment_log.txt","a") try: data = [] insertData = [] resultData = [] errorData = [] today = date.today() # today = datetime.strptime('13/02/2020', "%d/%m/%Y").date() day = today.day month = today.month year = today.year weekday = today.weekday()
from datetime import date from pprint import pprint from bson import ObjectId from helper.common import Common from helper.jaccs import Config import pandas as pd import xlsxwriter common = Common() base_url = common.base_url() wff_env = common.wff_env(base_url) mongodb = Mongodb(MONGODB="worldfone4xs", WFF_ENV=wff_env) _mongodb = Mongodb(MONGODB="_worldfone4xs", WFF_ENV=wff_env) now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Master_data_report') lnjc05_collection = common.getSubUser(subUserType, 'LNJC05') account_collection = common.getSubUser(subUserType, 'List_of_account_in_collection') zaccf_collection = common.getSubUser(subUserType, 'ZACCF_report') customer_collection = common.getSubUser(subUserType, 'Cus_assigned_partner') product_collection = common.getSubUser(subUserType, 'Product') release_sale_collection = common.getSubUser(subUserType, 'Report_release_sale') investigation_collection = common.getSubUser(subUserType, 'Investigation_file') sbv_collection = common.getSubUser(subUserType, 'SBV') trialBalance_collection = common.getSubUser(subUserType, 'Trial_balance_report') wo_monthly_collection = common.getSubUser(subUserType, 'WO_monthly') diallistDetail_collection = common.getSubUser(subUserType, 'Diallist_detail') diallist_collection = common.getSubUser(subUserType, 'Diallist') user_collection = common.getSubUser(subUserType, 'User')
from helper.common import Common from helper.mongodbaggregate import Mongodbaggregate mongodb = Mongodb("worldfone4xs") _mongodb = Mongodb("_worldfone4xs") excel = Excel() config = Config() ftp = Ftp() common = Common() mongodbaggregate = Mongodbaggregate("worldfone4xs") base_url = config.base_url() log = open(base_url + "cronjob/python/Loan/log/saveDailyProdWorkingDays.txt", "a") now = datetime.now() subUserType = 'LO' collection = common.getSubUser(subUserType, 'Daily_prod_working_days_report') try: insertData = [] updateData = [] listDebtGroup = [] # today = date.today() today = datetime.strptime('21/11/2019', "%d/%m/%Y").date() day = today.day month = today.month year = today.year weekday = today.weekday() lastDayOfMonth = calendar.monthrange(year, month)[1] todayString = today.strftime("%d/%m/%Y")