Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CDEK Development
tariff-calculator
Commits
a9f31418
Commit
a9f31418
authored
8 years ago
by
procenko
Browse files
Options
Download
Email Patches
Plain Diff
добавлен класс для построения графа и расчёта стоимости по кратчайшему пути
parent
e85cbb38
temp_calculation
calculation-algorithm
demo6
demo6-p18
develop
personal-contract
sabina-scope22
scope2
scope2.2-base-add-service
scope2.2-calculation
scope2.2-calculation-merge
scope2.2-vat
scope2.2-view-discount-list
scope22develop
temp
No related merge requests found
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/calculator-api/src/main/java/com/cdek/tcalculator/model/GraphBuilder.java
+418
-415
...rc/main/java/com/cdek/tcalculator/model/GraphBuilder.java
backend/calculator-calculation/src/main/java/com/cdek/tcalculator/service/impl/CalculationServiceImpl.java
+6
-4
...cdek/tcalculator/service/impl/CalculationServiceImpl.java
with
424 additions
and
419 deletions
+424
-419
backend/calculator-api/src/main/java/com/cdek/tcalculator/model/GraphBuilder.java
View file @
a9f31418
This diff is collapsed.
Click to expand it.
backend/calculator-calculation/src/main/java/com/cdek/tcalculator/service/impl/CalculationServiceImpl.java
View file @
a9f31418
...
...
@@ -29,13 +29,15 @@ public class CalculationServiceImpl implements CalculationService {
fakeQuery
.
setTargetCurrencyCode
(
parsedCalculationData
.
getPersonalTariff
().
getCurrencyCode
());
else
//если нет персонального тарифа и валюты одновременно - ставим валюту по умолчанию //todo уточнить, считать ли в валюте по умолчанию или кидать эксэпшен
fakeQuery
.
setTargetCurrencyCode
(
"1"
);
// BigDecimal cost = parsedCalculationData.calculate(fakeQuery);
// LOG.info("Final cost: ", cost);
GraphBuilder
graphBuilder
=
new
GraphBuilder
(
parsedCalculationData
);
BigDecimal
cost
=
graphBuilder
.
calculate
(
fakeQuery
);
LOG
.
info
(
"Final cost: "
,
cost
);
long
endTime
=
System
.
currentTimeMillis
();
long
parseTime
=
endTime
-
startTime
;
LOG
.
info
(
"parsed by: "
+
parseTime
);
//
return cost;
return
null
;
return
cost
;
//
return null;
/
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help