Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
85c08429
Commit
85c08429
authored
Sep 24, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master-modify-cutAmount' into dev
parents
3fa8b690
62f0a822
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
26 deletions
+25
-26
OrderViolateEnum.java
...fc/platform/order/contant/enumerate/OrderViolateEnum.java
+0
-1
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+18
-13
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+7
-12
No files found.
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/contant/enumerate/OrderViolateEnum.java
View file @
85c08429
...
...
@@ -7,7 +7,6 @@ import java.util.Map;
public
enum
OrderViolateEnum
{
BEFORE
(
1
,
"提前"
),
AFTER
(
2
,
"延期"
),
EXCESS
(
3
,
"消费超额金"
)
;
/**
* 编码
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
85c08429
...
...
@@ -435,19 +435,12 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
private
void
handleCrosstownDetail
(
OrderVehicleCrosstown
crosstown
,
OrderAccountDetail
oad
)
{
try
{
if
(
null
!=
crosstown
.
getViolateDetail
())
{
List
<
DedDetailDTO
>
dddList
=
JSONUtil
.
toList
(
JSONUtil
.
parseArray
(
crosstown
.
getViolateDetail
()),
DedDetailDTO
.
class
);
for
(
DedDetailDTO
vio
:
dddList
)
{
if
(
OrderViolateEnum
.
BEFORE
.
getCode
().
equals
(
vio
.
getType
()))
{
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
if
(
DeductionTypeEnum
.
VIOLATE_ADVANCE
.
getCode
().
equals
(
deduction
.
getType
()))
{
deduction
.
setName
(
vio
.
getDeductions
());
BigDecimal
diff
=
vio
.
getCost
().
subtract
(
deduction
.
getAmount
());
//修改归还押金金额
oad
.
setDepositAmount
(
oad
.
getDepositAmount
().
subtract
(
diff
));
deduction
.
setAmount
(
vio
.
getCost
());
}
}
}
DedDetailDTO
vio
=
JSONUtil
.
toBean
(
crosstown
.
getViolateDetail
(),
DedDetailDTO
.
class
);
if
(
OrderViolateEnum
.
BEFORE
.
getCode
().
equals
(
vio
.
getType
()))
{
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_ADVANCE
,
oad
,
vio
);
}
else
if
(
OrderViolateEnum
.
AFTER
.
getCode
().
equals
(
vio
.
getType
()))
{
handleViolateDetail
(
DeductionTypeEnum
.
VIOLATE_DELAY
,
oad
,
vio
);
}
}
}
catch
(
Exception
e
)
{
...
...
@@ -455,6 +448,18 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
}
}
private
void
handleViolateDetail
(
DeductionTypeEnum
dte
,
OrderAccountDetail
oad
,
DedDetailDTO
vio
)
{
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
if
(
dte
.
getCode
().
equals
(
deduction
.
getType
()))
{
deduction
.
setName
(
vio
.
getDeductions
());
BigDecimal
diff
=
vio
.
getCost
().
subtract
(
deduction
.
getAmount
());
//修改归还押金金额
oad
.
setDepositAmount
(
oad
.
getDepositAmount
().
subtract
(
diff
));
deduction
.
setAmount
(
vio
.
getCost
());
}
}
}
/**
* 获取每日订单账目,用于统计
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
85c08429
...
...
@@ -261,18 +261,13 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
}
//延期扣除费用
if
(
StringUtils
.
isNotBlank
(
orderVehicleCrosstownDto
.
getViolateDetail
()))
{
JSONArray
jsonArray
=
JSONArray
.
parseArray
(
orderVehicleCrosstownDto
.
getViolateDetail
());
if
(
jsonArray
!=
null
&&
jsonArray
.
size
()
>
0
)
{
for
(
int
i
=
0
;
i
<
jsonArray
.
size
();
i
++)
{
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonArray
.
get
(
i
).
toString
());
if
(
jsonObject
!=
null
)
{
if
(
jsonObject
.
getString
(
"cost"
)
!=
null
)
{
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"cost"
));
}
if
(
jsonObject
.
getString
(
"excessCost"
)
!=
null
)
{
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"excessCost"
));
}
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
orderVehicleCrosstownDto
.
getViolateDetail
());
if
(
jsonObject
!=
null
)
{
if
(
jsonObject
.
getString
(
"cost"
)
!=
null
)
{
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"cost"
));
}
if
(
jsonObject
.
getString
(
"excessCost"
)
!=
null
)
{
cost
+=
Double
.
parseDouble
(
jsonObject
.
getString
(
"excessCost"
));
}
}
}
...
...
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