Bladeren bron

ZEUS、DAITO対応

master
sosuke.iwabuchi 1 jaar geleden
bovenliggende
commit
af75389fb9
10 gewijzigde bestanden met toevoegingen van 47 en 36 verwijderingen
  1. +2
    -2
      CSVDownloader.sln
  2. +2
    -4
      CSVDownloader/CSVDownloader.csproj
  3. +11
    -9
      CSVDownloader/Program.cs
  4. +7
    -0
      CSVDownloader/Properties/launchSettings.json
  5. +2
    -1
      CSVDownloader/Store/CreditCSVData/DaitoCreitDataStore.cs
  6. +1
    -1
      CSVDownloader/Store/ElectricMoneyCSVData/DaitoElectronicMoneyDataStore.cs
  7. +1
    -1
      CSVDownloader/Store/QRCSVData/DaitoQRDataStore.cs
  8. +9
    -2
      CSVDownloader/Web/DriverFactory.cs
  9. +12
    -16
      CSVDownloader/Web/ZeusController.cs
  10. BIN
      CSVDownloader/chromedriver.exe

+ 2
- 2
CSVDownloader.sln Bestand weergeven

@@ -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


+ 2
- 4
CSVDownloader/CSVDownloader.csproj Bestand weergeven

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
@@ -23,6 +23,7 @@
<PackageReference Include="Selenium.Support" Version="3.141.0" />
<PackageReference Include="Selenium.WebDriver" Version="3.141.0" />
<PackageReference Include="System.Data.SQLite.Core" Version="1.0.113.7" />
<PackageReference Include="WebDriverManager" Version="2.17.4" />
</ItemGroup>

<ItemGroup>
@@ -41,9 +42,6 @@
</ItemGroup>

<ItemGroup>
<None Update="chromedriver.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="log4net.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>


+ 11
- 9
CSVDownloader/Program.cs Bestand weergeven

@@ -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;
}


+ 7
- 0
CSVDownloader/Properties/launchSettings.json Bestand weergeven

@@ -0,0 +1,7 @@
{
"profiles": {
"CSVDownloader": {
"commandName": "Project"
}
}
}

+ 2
- 1
CSVDownloader/Store/CreditCSVData/DaitoCreitDataStore.cs Bestand weergeven

@@ -27,8 +27,9 @@ namespace CSVDownloader.Store.CreditCSVData {
Developer,
AdjustType,
FeeType,
ReceptionDatetime,
ReceptionDatetime = 6,
Amount,
ReceiptNo,
ReceptionNo,
ResponseNo,
ErrorCode1,


+ 1
- 1
CSVDownloader/Store/ElectricMoneyCSVData/DaitoElectronicMoneyDataStore.cs Bestand weergeven

@@ -20,7 +20,7 @@ namespace CSVDownloader.Store.ElectronicMoneyDataStore {
public enum ColName {
SpotID = 100,
ParkingName = 0,
ReceptionDatetime,
ReceptionDatetime = 3,
AdjustType,
Amount,
TradeID,


+ 1
- 1
CSVDownloader/Store/QRCSVData/DaitoQRDataStore.cs Bestand weergeven

@@ -22,7 +22,7 @@ namespace CSVDownloader.Store.QRCSVData {
SpotID = 100,
ParkingName = 0,
Developer,
ReceptionDatetime,
ReceptionDatetime = 4,
Company,
Amount,
AdjustNo,


+ 9
- 2
CSVDownloader/Web/DriverFactory.cs Bestand weergeven

@@ -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));



+ 12
- 16
CSVDownloader/Web/ZeusController.cs Bestand weergeven

@@ -226,25 +226,21 @@ namespace CSVDownloader.Web {
continue;
}


if (failed_flg) {
if (failed_flg) {
var error_list = new List<Store.ParkingCreditCardAgenciesSpotIDError>();
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<Store.ParkingCreditCardAgenciesSpotIDError>();
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;
}



BIN
CSVDownloader/chromedriver.exe Bestand weergeven


Laden…
Annuleren
Opslaan