TAS:Pokročilé/Pluginy/TashaCL - příkazová řádka/Automatický update KPI statistik/en: Porovnání verzí

Z Solvertech
Skočit na navigaci Skočit na vyhledávání
(založena nová stránka s textem „<code>$SOLVEDATE = ((get-date).AddDays($DAYOFFSET)).ToString("yyyy-MM-dd")</code><br /> <code>$SAVESTAMP = "C:\SFTPImport\EXP_TASHA_DAY_"</code><br /> <code>$SAVESTAMP = $SAVESTAMP+$SOLVEDATE+$FORMAT</code><br />“)
 
 
Řádek 1: Řádek 1:
<languages />  
<languages />
First, we specify the identifiers for processing, in this case clientdepo1 and clientdepo2
First, we specify the identifiers for processing, in this case clientdepo1 and clientdepo2



Aktuální verze z 30. 8. 2022, 14:55

Jiné jazyky:

First, we specify the identifiers for processing, in this case clientdepo1 and clientdepo2

$DBNAMES = @("clientdepo1", "clientdepo2")


Determine the number of days from the start date of the statistics to today's date. Can be found at e.g. https://kolikdni.3tecky.cz/

In this example, we will count 330 days, which will be entered as negative because they are days in the past.

$DAYSBACK = -330


Determine the input file format

$FORMAT = ".csv"


We can set the level of message output, see. Command line options

$LOGLEVEL = 1


We can use the command cls ' to clear the command line

cls


Then we create a cycle that will iterate from the value that determines the number of days until the beginning of the statistics to 0 that determines today's day. For the 1st iteration in our example, we set $DAYOFFSET = - 330

For ($DAYOFFSET=$DAYSBACK; $DAYOFFSET -le 0; $DAYOFFSET++)


In our case, the customer data is named for example EXP_TASHA_2019_02_20.csv, so the input format is .csv and we need to get the planning date in the appropriate format yyyy-MM-dd and the beginning of the name, which we set statically. Then we get the full address of the file and store it in the $SAVESTAMP variable

$SOLVEDATE = ((get-date).AddDays($DAYOFFSET)).ToString("yyyy-MM-dd")
$SAVESTAMP = "C:\SFTPImport\EXP_TASHA_DAY_"
$SAVESTAMP = $SAVESTAMP+$SOLVEDATE+$FORMAT


For Tasha you also need to get the planning date in the format dd.MM.yyyy, e.g. 20.02.2019.

$PLANNINGDATE = ((get-date).AddDays($DAYOFFSET)).ToString("dd.MM.yyyy")


Sets the location of the parent folder to the folder that contains Tasha_CL.exe

Set-Location -Path "C:\CL_folder"


Create a cycle that iterates through all DBs contained in $DBNAMES.

ForEach ($DBNAME In $DBNAMES)


Chaining can be used to list the information by writing the variable to a string.

"Database: $DBNAME - Scenario name: $SOLVEDATE - Planning date: $PLANNINGDATE"
"Import"


Start the import using the necessary variables, e.g. $DBNAME, $LOGLEVEL, $SOLVEDATE, $SAVESTAMP, $PLANNINGDATE.

TashaCL\TashaCl.exe -s SQLServer -c "SERVER = TS3\SQLEXPRESS; DATABASE = $DBNAME;Integrated Security=SSPI;"
--logginglevel $LOGLEVEL --Mode import --PluginName SolverTech.Tasha.Plugins.IO.Tasha
--inputscenarioname $SOLVEDATE --ImportFile $SAVESTAMP --PlanningDate $PLANNINGDATE
--PluginSettings "C:\CL_folder\TashaCL\Plugins\IMPORTERSETTINGS\$DBNAME.config"


By default, the import, geocoding and distance calculation is performed within the previous command.

But they can also be run individually using the following commands:

TashaCL\TashaCl.exe -s SQLServer -c "SERVER = TS3\SQLEXPRESS; DATABASE = $DBNAME;Integrated Security=SSPI;"
--logginglevel $LOGLEVEL --Mode geocoding --PluginName SolverTech.Tasha.Plugins.Geocoding.Ruian
--inputscenarioname $SOLVEDATE

TashaCL\TashaCl.exe -s SQLServer -c "SERVER = TS3\SQLEXPRESS; DATABASE = $DBNAME;Integrated Security=SSPI;"
--logginglevel $LOGLEVEL --Mode distance --PluginName SolverTech.Tasha.Plugins.UpdateDistance.Here
--inputscenarioname $SOLVEDATE


Continue by running the solution using the necessary variables, e.g. $DBNAME, $LOGLEVEL, $SOLVEDATE

TashaCL\TashaCl.exe -s SQLServer -c "SERVER = TS3\SQLEXPRESS; DATABASE = $DBNAME;Integrated Security=SSPI;"
--logginglevel $LOGLEVEL --Mode solve --inputscenarioname $SOLVEDATE -i30000 -tMediumHigh -z10 -ay --MaxProcessorCount 20 --RestartPhasesCount 5 --RestartPhasesPercentage 50


We then import the vehicle tracking data using the necessary variables.

TashaCL\TashaCl.exe -s SQLServer -c "SERVER = TS3\SQLEXPRESS; DATABASE = $DBNAME;Integrated Security=SSPI;"
--logginglevel $LOGLEVEL --Mode command --PluginName SolverTech.Tasha.Plugins.Tracking.Webdispecink --CommandName UpdateTrackingDistances
--inputscenarioname $SOLVEDATE --TrackingCompany Company --TrackingLogin Name --TrackingPassword Heslo1111


Make an input to the KPI database.

TashaCL\TashaCl.exe -s SQLServer -c "SERVER = TS3\SQLEXPRESS; DATABASE = $DBNAME;Integrated Security=SSPI;"
--logginglevel $LOGLEVEL --Mode command --PluginName SolverTech.Tasha.Plugins.Statistics.Kpi --PluginSettings "C:\CL_folder\TashaCL\Plugins\KPISETTINGS\$DBNAME.config" --CommandName UpdateKPIs