diff --git a/CSVDownloader.sln b/CSVDownloader.sln index a36db35..89f8687 100644 --- a/CSVDownloader.sln +++ b/CSVDownloader.sln @@ -11,8 +11,8 @@ Global Release|Any CPU = Release|Any CPU EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {ED01BF6B-81D2-46D8-B89D-6570F53C38B8}.Debug|Any CPU.ActiveCfg = Release|Any CPU - {ED01BF6B-81D2-46D8-B89D-6570F53C38B8}.Debug|Any CPU.Build.0 = Release|Any CPU + {ED01BF6B-81D2-46D8-B89D-6570F53C38B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {ED01BF6B-81D2-46D8-B89D-6570F53C38B8}.Debug|Any CPU.Build.0 = Debug|Any CPU {ED01BF6B-81D2-46D8-B89D-6570F53C38B8}.Release|Any CPU.ActiveCfg = Release|Any CPU {ED01BF6B-81D2-46D8-B89D-6570F53C38B8}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection diff --git a/CSVDownloader/CSVDownloader.csproj b/CSVDownloader/CSVDownloader.csproj index 4e6bb1b..61d3210 100644 --- a/CSVDownloader/CSVDownloader.csproj +++ b/CSVDownloader/CSVDownloader.csproj @@ -1,4 +1,4 @@ - + Exe @@ -23,6 +23,7 @@ + @@ -41,9 +42,6 @@ - - PreserveNewest - PreserveNewest diff --git a/CSVDownloader/Program.cs b/CSVDownloader/Program.cs index c309195..f30292a 100644 --- a/CSVDownloader/Program.cs +++ b/CSVDownloader/Program.cs @@ -265,14 +265,14 @@ namespace CSVDownloader { } // HelloTechno(GMO) { - var controller = new GMOController(driver_); - if (!hasParam_ || paramAgentCode_ == controller.GetCreditAgentCode()) { - var dic = parking_credit_card_agencies_spotID_dao_.GetDictionary(controller.GetCreditAgent()); - controller.SetParkingDic(dic); - web_controller_list_.Add(controller); - credit_datastore_map_.Add(controller.GetCreditAgent(), gmo_credit_store_); - electronic_money_datastore_map_.Add(controller.GetCreditAgent(), gmo_electronic_money_store_); - } + //var controller = new GMOController(driver_); + //if (!hasParam_ || paramAgentCode_ == controller.GetCreditAgentCode()) { + // var dic = parking_credit_card_agencies_spotID_dao_.GetDictionary(controller.GetCreditAgent()); + // controller.SetParkingDic(dic); + // web_controller_list_.Add(controller); + // credit_datastore_map_.Add(controller.GetCreditAgent(), gmo_credit_store_); + // electronic_money_datastore_map_.Add(controller.GetCreditAgent(), gmo_electronic_money_store_); + //} } @@ -286,7 +286,9 @@ namespace CSVDownloader { // 実行対象日判定 - if (!web_controller.IsWorkDate()) { + if (hasParam_) { + logger_.Info($"起動引数ありのため実行対象日判定をスキップ"); + } else if (!web_controller.IsWorkDate()) { logger_.Info($"処理対象日外:{ web_controller.GetCreditAgent()}"); return result_code; } diff --git a/CSVDownloader/Properties/launchSettings.json b/CSVDownloader/Properties/launchSettings.json new file mode 100644 index 0000000..8013976 --- /dev/null +++ b/CSVDownloader/Properties/launchSettings.json @@ -0,0 +1,7 @@ +{ + "profiles": { + "CSVDownloader": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/CSVDownloader/Store/CreditCSVData/DaitoCreitDataStore.cs b/CSVDownloader/Store/CreditCSVData/DaitoCreitDataStore.cs index 63c9788..2ca8352 100644 --- a/CSVDownloader/Store/CreditCSVData/DaitoCreitDataStore.cs +++ b/CSVDownloader/Store/CreditCSVData/DaitoCreitDataStore.cs @@ -27,8 +27,9 @@ namespace CSVDownloader.Store.CreditCSVData { Developer, AdjustType, FeeType, - ReceptionDatetime, + ReceptionDatetime = 6, Amount, + ReceiptNo, ReceptionNo, ResponseNo, ErrorCode1, diff --git a/CSVDownloader/Store/ElectricMoneyCSVData/DaitoElectronicMoneyDataStore.cs b/CSVDownloader/Store/ElectricMoneyCSVData/DaitoElectronicMoneyDataStore.cs index b6f611d..3c5da09 100644 --- a/CSVDownloader/Store/ElectricMoneyCSVData/DaitoElectronicMoneyDataStore.cs +++ b/CSVDownloader/Store/ElectricMoneyCSVData/DaitoElectronicMoneyDataStore.cs @@ -20,7 +20,7 @@ namespace CSVDownloader.Store.ElectronicMoneyDataStore { public enum ColName { SpotID = 100, ParkingName = 0, - ReceptionDatetime, + ReceptionDatetime = 3, AdjustType, Amount, TradeID, diff --git a/CSVDownloader/Store/QRCSVData/DaitoQRDataStore.cs b/CSVDownloader/Store/QRCSVData/DaitoQRDataStore.cs index 83ccb2b..d2030dc 100644 --- a/CSVDownloader/Store/QRCSVData/DaitoQRDataStore.cs +++ b/CSVDownloader/Store/QRCSVData/DaitoQRDataStore.cs @@ -22,7 +22,7 @@ namespace CSVDownloader.Store.QRCSVData { SpotID = 100, ParkingName = 0, Developer, - ReceptionDatetime, + ReceptionDatetime = 4, Company, Amount, AdjustNo, diff --git a/CSVDownloader/Web/DriverFactory.cs b/CSVDownloader/Web/DriverFactory.cs index af97803..d609893 100644 --- a/CSVDownloader/Web/DriverFactory.cs +++ b/CSVDownloader/Web/DriverFactory.cs @@ -8,6 +8,9 @@ using OpenQA.Selenium.Chrome; using OpenQA.Selenium.Support.UI; using SeleniumExtras.WaitHelpers; +using WebDriverManager; +using WebDriverManager.DriverConfigs.Impl; + namespace CSVDownloader.Web { class DriverFactory { public static ChromeDriver GetDriver() { @@ -15,10 +18,14 @@ namespace CSVDownloader.Web { var options = new ChromeOptions(); // options.AddArgument("--headless"); - options.BinaryLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\chrome-win64\\chrome.exe"; + //options.BinaryLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\chrome-win64\\chrome.exe"; String download_dir = GetTmpDownloadDir(); options.AddUserProfilePreference("download.default_directory", download_dir); - ChromeDriver driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options); + //ChromeDriver driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options); + + + new DriverManager().SetUpDriver(new ChromeConfig()); + ChromeDriver driver = new ChromeDriver(options); WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(10)); diff --git a/CSVDownloader/Web/ZeusController.cs b/CSVDownloader/Web/ZeusController.cs index 89ad340..fe028aa 100644 --- a/CSVDownloader/Web/ZeusController.cs +++ b/CSVDownloader/Web/ZeusController.cs @@ -226,25 +226,21 @@ namespace CSVDownloader.Web { continue; } - - if (failed_flg) { - if (failed_flg) { - var error_list = new List(); - logger_.Error("失敗駐車場名"); - foreach (var ele in failed_parking_name_hs_table) { - error_list.Add(new Store.ParkingCreditCardAgenciesSpotIDError() { - creditcard_agencies_id = CreditAgenciesMap.GetID(agent_), - creditcard_agencies_spot_name = ele - }); - logger_.Error($"駐車場 \"{ele}\""); - } - - throw new SpotNameNotMatchException(error_list); - } - + } + if (failed_flg) { + var error_list = new List(); + logger_.Error("失敗駐車場名"); + foreach (var ele in failed_parking_name_hs_table) { + error_list.Add(new Store.ParkingCreditCardAgenciesSpotIDError() { + creditcard_agencies_id = CreditAgenciesMap.GetID(agent_), + creditcard_agencies_spot_name = ele + }); + logger_.Error($"駐車場 \"{ele}\""); } + throw new SpotNameNotMatchException(error_list); } + return result_list; } diff --git a/CSVDownloader/chromedriver.exe b/CSVDownloader/chromedriver.exe deleted file mode 100644 index f6cf40f..0000000 Binary files a/CSVDownloader/chromedriver.exe and /dev/null differ