Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
a3957d9a
提交
a3957d9a
authored
11月 09, 2023
作者:
liruixin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
货主违约金
上级
aa2faa81
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
23 行增加
和
11 行删除
+23
-11
BreakContractSettlementOwnerServiceImpl.java
...reakcontract/BreakContractSettlementOwnerServiceImpl.java
+23
-11
没有找到文件。
performance-web/src/main/java/com/clx/performance/service/impl/breakcontract/BreakContractSettlementOwnerServiceImpl.java
浏览文件 @
a3957d9a
...
@@ -426,13 +426,18 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
...
@@ -426,13 +426,18 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
BreakContractOwnerRuleVO
.
AutoRule
autoRule
=
JSONObject
.
parseObject
(
autoRuleJson
,
BreakContractOwnerRuleVO
.
AutoRule
.
class
);
BreakContractOwnerRuleVO
.
AutoRule
autoRule
=
JSONObject
.
parseObject
(
autoRuleJson
,
BreakContractOwnerRuleVO
.
AutoRule
.
class
);
BreakContractOwnerRuleVO
.
OrderCancelRule
orderCancelRule
=
autoRule
.
getOrderCancelRule
();
//订单取消规则
BreakContractOwnerRuleVO
.
OrderCancelRule
orderCancelRule
=
autoRule
.
getOrderCancelRule
();
//订单取消规则
//运单状态(
不包括
取消)
//运单状态(
包括货主
取消)
List
<
Integer
>
statusList
=
Arrays
.
asList
(
List
<
Integer
>
statusList
=
Arrays
.
asList
(
new
Integer
[]{
OrderChildEnum
.
Status
.
CREATED
.
getCode
(),
OrderChildEnum
.
Status
.
PAY
.
getCode
(),
new
Integer
[]{
OrderChildEnum
.
Status
.
CREATED
.
getCode
(),
OrderChildEnum
.
Status
.
PAY
.
getCode
(),
OrderChildEnum
.
Status
.
GO_TO_SEND
.
getCode
(),
OrderChildEnum
.
Status
.
ARRIVE_SEND
.
getCode
(),
OrderChildEnum
.
Status
.
GO_TO_SEND
.
getCode
(),
OrderChildEnum
.
Status
.
ARRIVE_SEND
.
getCode
(),
OrderChildEnum
.
Status
.
LOAD
.
getCode
(),
OrderChildEnum
.
Status
.
GO_TO_RECEIVE
.
getCode
(),
OrderChildEnum
.
Status
.
LOAD
.
getCode
(),
OrderChildEnum
.
Status
.
GO_TO_RECEIVE
.
getCode
(),
OrderChildEnum
.
Status
.
ARRIVE_RECEIVE
.
getCode
(),
OrderChildEnum
.
Status
.
UNLOAD
.
getCode
(),
OrderChildEnum
.
Status
.
ARRIVE_RECEIVE
.
getCode
(),
OrderChildEnum
.
Status
.
UNLOAD
.
getCode
(),
OrderChildEnum
.
Status
.
OWNER_CANCEL
.
getCode
(),
OrderChildEnum
.
Status
.
UNSETTLE
.
getCode
()});
OrderChildEnum
.
Status
.
UNSETTLE
.
getCode
()});
//由于已经更新了订单状态为货主取消了
if
(
Objects
.
equals
(
cancelType
,
CancelOrderEnum
.
Type
.
NOT_ARRIVE
.
getCode
())){
statusList
.
add
(
OrderChildEnum
.
Status
.
OWNER_CANCEL
.
getCode
());
}
BigDecimal
figure
;
//总费用
BigDecimal
figure
;
//总费用
...
@@ -445,7 +450,6 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
...
@@ -445,7 +450,6 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
List
<
OrderChild
>
orderChilds
=
orderChildDao
.
listOrderChildByOrderNoAndStatus
(
orderNo
,
statusList
);
List
<
OrderChild
>
orderChilds
=
orderChildDao
.
listOrderChildByOrderNoAndStatus
(
orderNo
,
statusList
);
LocalDateTime
now
=
LocalDateTime
.
now
();
//当前时间
//没有司机拉运
//没有司机拉运
if
(
CollectionUtils
.
isEmpty
(
orderChilds
)){
if
(
CollectionUtils
.
isEmpty
(
orderChilds
)){
figure
=
transportWeight
.
multiply
(
validFreightPrice
).
multiply
(
orderCancelRule
.
getAfterRatio
());
figure
=
transportWeight
.
multiply
(
validFreightPrice
).
multiply
(
orderCancelRule
.
getAfterRatio
());
...
@@ -463,25 +467,33 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
...
@@ -463,25 +467,33 @@ public class BreakContractSettlementOwnerServiceImpl implements BreakContractSe
deliveredFreight
=
deliveredFreight
.
add
(
orderChild
.
getOrderFreightPrice
().
multiply
(
orderChild
.
getLoadNet
()));
deliveredFreight
=
deliveredFreight
.
add
(
orderChild
.
getOrderFreightPrice
().
multiply
(
orderChild
.
getLoadNet
()));
}
}
if
(
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
CREATED
.
getCode
())
if
(
Objects
.
equals
(
cancelType
,
CancelOrderEnum
.
Type
.
NOT_ARRIVE
.
getCode
())){
||
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
PAY
.
getCode
())
if
(
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
OWNER_CANCEL
.
getCode
()))
{
||
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
GO_TO_SEND
.
getCode
())
cancelWeight
=
cancelWeight
.
add
(
orderChild
.
getWeight
());
||
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
OWNER_CANCEL
.
getCode
()))
{
seconds
=
seconds
.
add
(
new
BigDecimal
(
LocalDateTimeUtils
.
getSecondsDiff
(
orderChild
.
getPayTime
(),
orderChild
.
getCancelTime
())));
cancelWeight
=
cancelWeight
.
add
(
orderChild
.
getWeight
());
}
seconds
=
seconds
.
add
(
new
BigDecimal
(
LocalDateTimeUtils
.
getSecondsDiff
(
orderChild
.
getPayTime
(),
orderChild
.
getCancelTime
())));
}
else
{
if
(
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
CREATED
.
getCode
())
||
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
PAY
.
getCode
())
||
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
GO_TO_SEND
.
getCode
()))
{
cancelWeight
=
cancelWeight
.
add
(
orderChild
.
getWeight
());
}
}
}
}
}
BigDecimal
noTransitWeight
=
transportWeight
.
subtract
(
deliveredWeight
);
//未拉运的重量
BigDecimal
noTransitWeight
=
transportWeight
.
subtract
(
deliveredWeight
);
//未拉运的重量
BigDecimal
noTransitFreight
=
noTransitWeight
.
multiply
(
validFreightPrice
);
//未拉运的费用
BigDecimal
noTransitFreight
=
noTransitWeight
.
multiply
(
validFreightPrice
);
//未拉运的费用
BigDecimal
totalFreight
=
deliveredFreight
.
add
(
noTransitFreight
);
BigDecimal
totalFreight
=
deliveredFreight
.
add
(
noTransitFreight
);
//总运费
BigDecimal
baseFigure
=
totalFreight
.
multiply
(
orderCancelRule
.
getAfterRatio
()).
multiply
(
cancelWeight
)
BigDecimal
baseFigure
=
totalFreight
.
multiply
(
orderCancelRule
.
getAfterRatio
()).
multiply
(
cancelWeight
)
.
divide
(
transportWeight
,
2
,
BigDecimal
.
ROUND_HALF_UP
);
.
divide
(
transportWeight
,
2
,
BigDecimal
.
ROUND_HALF_UP
);
//基础违约金
//挂单后,车辆违约金
BigDecimal
truckFigure
=
BigDecimal
.
ZERO
;
BigDecimal
truckFigure
=
BigDecimal
.
ZERO
;
if
(
Objects
.
equals
(
cancelType
,
CancelOrderEnum
.
Type
.
NOT_ARRIVE
.
getCode
())){
if
(
Objects
.
equals
(
cancelType
,
CancelOrderEnum
.
Type
.
NOT_ARRIVE
.
getCode
())){
truckFigure
=
seconds
.
multiply
(
orderCancelRule
.
getAfterFigurePerHour
())
truckFigure
=
seconds
.
multiply
(
orderCancelRule
.
getAfterFigurePerHour
())
.
divide
(
new
BigDecimal
(
3600
),
2
,
BigDecimal
.
ROUND_HALF_UP
).
movePointRight
(
2
);
.
divide
(
new
BigDecimal
(
3600
),
2
,
BigDecimal
.
ROUND_HALF_UP
).
movePointRight
(
2
);
}
}
figure
=
baseFigure
.
add
(
truckFigure
);
figure
=
baseFigure
.
add
(
truckFigure
);
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论