Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
c86ecbfe
提交
c86ecbfe
authored
6月 24, 2024
作者:
胡宁宁
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
平衡运费可以平衡为负数
上级
8812d158
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
73 行增加
和
8 行删除
+73
-8
OrderChildDaoImpl.java
.../java/com/clx/performance/dao/impl/OrderChildDaoImpl.java
+1
-0
OrderChildPoundAuditServiceImpl.java
...ormance/service/impl/OrderChildPoundAuditServiceImpl.java
+70
-6
OrderChildServiceImpl.java
...m/clx/performance/service/impl/OrderChildServiceImpl.java
+2
-2
没有找到文件。
performance-web/src/main/java/com/clx/performance/dao/impl/OrderChildDaoImpl.java
浏览文件 @
c86ecbfe
...
@@ -125,6 +125,7 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
...
@@ -125,6 +125,7 @@ public class OrderChildDaoImpl extends BaseDaoImpl<OrderChildMapper, OrderChild,
.
set
(
OrderChild:
:
getUnloadTare
,
item
.
getUnloadTare
())
.
set
(
OrderChild:
:
getUnloadTare
,
item
.
getUnloadTare
())
.
set
(
OrderChild:
:
getWeight
,
item
.
getWeight
())
.
set
(
OrderChild:
:
getWeight
,
item
.
getWeight
())
.
set
(
OrderChild:
:
getFreight
,
item
.
getFreight
())
.
set
(
OrderChild:
:
getFreight
,
item
.
getFreight
())
.
set
(
OrderChild:
:
getPlatformServiceFee
,
item
.
getPlatformServiceFee
())
);
);
}
}
...
...
performance-web/src/main/java/com/clx/performance/service/impl/OrderChildPoundAuditServiceImpl.java
浏览文件 @
c86ecbfe
package
com
.
clx
.
performance
.
service
.
impl
;
package
com
.
clx
.
performance
.
service
.
impl
;
import
com.clx.order.enums.QuotationEnum
;
import
com.clx.performance.dao.*
;
import
com.clx.performance.dao.*
;
import
com.clx.performance.dto.payment.PaymentDTO
;
import
com.clx.performance.enums.*
;
import
com.clx.performance.enums.*
;
import
com.clx.performance.enums.settle.SettlementWayEnum
;
import
com.clx.performance.model.*
;
import
com.clx.performance.model.*
;
import
com.clx.performance.param.pc.PoundAuditParam
;
import
com.clx.performance.param.pc.PoundAuditParam
;
import
com.clx.performance.service.OrderChildLogService
;
import
com.clx.performance.param.pc.payment.PayPlatformFeeParam
;
import
com.clx.performance.service.OrderChildPoundAuditService
;
import
com.clx.performance.service.*
;
import
com.clx.performance.service.OrderChildService
;
import
com.clx.performance.service.OrderGoodsService
;
import
com.clx.performance.vo.pc.OrderChildPoundAuditDetailVO
;
import
com.clx.performance.vo.pc.OrderChildPoundAuditDetailVO
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.data.UserSessionData
;
import
com.msl.user.utils.TokenUtil
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -48,7 +50,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
...
@@ -48,7 +50,7 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
private
final
OrderChildLogService
orderChildLogService
;
private
final
OrderChildLogService
orderChildLogService
;
private
final
OrderChildService
orderChildService
;
private
final
OrderChildService
orderChildService
;
private
final
PaymentService
paymentService
;
@Override
@Override
public
OrderChildPoundAuditDetailVO
getPoundAuditDetail
(
String
childNo
)
{
public
OrderChildPoundAuditDetailVO
getPoundAuditDetail
(
String
childNo
)
{
...
@@ -128,6 +130,13 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
...
@@ -128,6 +130,13 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
orderChild
.
setWeight
(
orderChildWeightCalc
(
orderChild
));
orderChild
.
setWeight
(
orderChildWeightCalc
(
orderChild
));
orderChild
.
setFreight
(
orderChildFreightCalc
(
orderChild
));
orderChild
.
setFreight
(
orderChildFreightCalc
(
orderChild
));
//计算司机保证金
PaymentDTO
paymentDTO
=
getPaymentDTO
(
orderChild
);
if
(
Objects
.
nonNull
(
paymentDTO
.
getPlatformServiceFeeNew
())
&&
paymentDTO
.
getPlatformServiceFeeNew
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
orderChild
.
setPlatformServiceFee
(
paymentDTO
.
getPlatformServiceFeeNew
());
}
// 更新装车净重
// 更新装车净重
updateOrderGoodsAmountLoad
(
orderGoods
,
orderChild
.
getChildNo
(),
dif
);
updateOrderGoodsAmountLoad
(
orderGoods
,
orderChild
.
getChildNo
(),
dif
);
...
@@ -144,13 +153,29 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
...
@@ -144,13 +153,29 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
//保存磅单审核日志数据
//保存磅单审核日志数据
orderChildPoundLogDao
.
saveEntity
(
poundLog
);
orderChildPoundLogDao
.
saveEntity
(
poundLog
);
//判断是否平衡冻结金额
if
(
Objects
.
nonNull
(
paymentDTO
.
getChangeDeposit
())
&&
paymentDTO
.
getChangeDeposit
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
){
paymentChangePlatformFee
(
orderChild
.
getChildNo
(),
paymentDTO
.
getChangeDeposit
());
}
//保存运单日志数据
//保存运单日志数据
orderChildLogService
.
saveOrderChildLog
(
param
.
getChildNo
(),
type
,
OrderChildLogEnum
.
Type
.
getByCode
(
type
).
isPresent
()
?
OrderChildLogEnum
.
Type
.
getByCode
(
type
).
get
().
getMsg
()
:
""
,
orderChildLogService
.
saveOrderChildLog
(
param
.
getChildNo
(),
type
,
OrderChildLogEnum
.
Type
.
getByCode
(
type
).
isPresent
()
?
OrderChildLogEnum
.
Type
.
getByCode
(
type
).
get
().
getMsg
()
:
""
,
OrderChildLogEnum
.
CreateType
.
PLATFORM
.
getCode
(),
loginUserInfo
.
getUserNo
(),
loginUserInfo
.
getUserName
());
OrderChildLogEnum
.
CreateType
.
PLATFORM
.
getCode
(),
loginUserInfo
.
getUserNo
(),
loginUserInfo
.
getUserName
());
}
}
/***
* 平衡司机冻结保证金
*/
public
void
paymentChangePlatformFee
(
String
childNo
,
BigDecimal
changeDeposite
){
if
(
changeDeposite
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
){
PayPlatformFeeParam
payPlatformFeeParam
=
new
PayPlatformFeeParam
();
payPlatformFeeParam
.
setTradeNo
(
childNo
);
payPlatformFeeParam
.
setFigure
(
changeDeposite
.
intValue
());
//冻结司机押金
paymentService
.
paymentChangePlatformFee
(
payPlatformFeeParam
);
}
}
/**
/**
* 装车补偿
* 装车补偿
*/
*/
...
@@ -185,4 +210,43 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
...
@@ -185,4 +210,43 @@ public class OrderChildPoundAuditServiceImpl implements OrderChildPoundAuditSer
return
totalFreight
.
setScale
(
0
,
RoundingMode
.
HALF_UP
);
return
totalFreight
.
setScale
(
0
,
RoundingMode
.
HALF_UP
);
}
}
/***
* 获取最新的保证金金额和本次调增的金额
*/
public
PaymentDTO
getPaymentDTO
(
OrderChild
orderChild
){
//计算司机保证金
BigDecimal
freightPrice
=
orderChild
.
getFreightPrice
();
BigDecimal
deposit
=
orderChild
.
getDeposit
();
BigDecimal
platformServiceFeeRate
=
orderChild
.
getPlatformServiceFeeRate
();
BigDecimal
platformServiceFee
=
orderChild
.
getPlatformServiceFee
();
//平台服务费
BigDecimal
freight
=
orderChild
.
getFreight
();
//本次调整金额
BigDecimal
changeDeposit
=
BigDecimal
.
ZERO
;
//本次调整金额
BigDecimal
platformServiceFeeNew
=
BigDecimal
.
ZERO
;
log
.
info
(
"运单号 {} ,原始冻结金额 {} "
,
orderChild
.
getChildNo
(),
platformServiceFee
);
/**
* 如果之前未冻结保证金,本次不调整
* 如果 平台服务费率 为0 本次不处理
* 如果 本次吨数为 0 本次不处理
* 如果 本次调整金额为 0 本次不处理
* **/
if
(
Objects
.
nonNull
(
deposit
)
&&
deposit
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
&&
Objects
.
nonNull
(
platformServiceFee
)
&&
platformServiceFee
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
&&
Objects
.
nonNull
(
platformServiceFeeRate
)
&&
platformServiceFeeRate
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
&&
Objects
.
nonNull
(
freight
)
&&
freight
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
platformServiceFeeNew
=
freight
//平台服务费率 * 100
.
multiply
(
platformServiceFeeRate
).
movePointLeft
(
2
).
setScale
(
2
,
RoundingMode
.
HALF_UP
);
changeDeposit
=
platformServiceFeeNew
.
subtract
(
platformServiceFee
);
log
.
info
(
"运单号 {} ,原始冻结金额 {} ,最新冻结金额 {},运费差 {} 运费价格{},费率 {}"
,
orderChild
.
getChildNo
(),
platformServiceFee
,
platformServiceFeeNew
,
changeDeposit
,
freightPrice
,
platformServiceFeeRate
);
}
return
PaymentDTO
.
builder
().
changeDeposit
(
changeDeposit
).
platformServiceFeeNew
(
platformServiceFeeNew
).
build
();
}
}
}
performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java
浏览文件 @
c86ecbfe
...
@@ -1001,7 +1001,7 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -1001,7 +1001,7 @@ public class OrderChildServiceImpl implements OrderChildService {
if
(
orderChild
.
getUnloadTime
()
==
null
&&
if
(
orderChild
.
getUnloadTime
()
==
null
&&
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
ARRIVE_RECEIVE
.
getCode
()))
{
Objects
.
equals
(
orderChild
.
getStatus
(),
OrderChildEnum
.
Status
.
ARRIVE_RECEIVE
.
getCode
()))
{
//计算司机保证金
//计算司机保证金
BigDecimal
net
=
param
.
getUnloadRough
().
subtract
(
param
.
getUnloadTare
()
);
BigDecimal
net
=
orderChild
.
getLoadNet
(
);
PaymentDTO
paymentDTO
=
getPaymentDTO
(
net
,
orderChild
);
PaymentDTO
paymentDTO
=
getPaymentDTO
(
net
,
orderChild
);
if
(
Objects
.
nonNull
(
paymentDTO
.
getPlatformServiceFeeNew
())
&&
if
(
Objects
.
nonNull
(
paymentDTO
.
getPlatformServiceFeeNew
())
&&
paymentDTO
.
getPlatformServiceFeeNew
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentDTO
.
getPlatformServiceFeeNew
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
...
@@ -1022,7 +1022,7 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -1022,7 +1022,7 @@ public class OrderChildServiceImpl implements OrderChildService {
}
}
}
else
{
}
else
{
//计算司机保证金
//计算司机保证金
BigDecimal
net
=
param
.
getUnloadRough
().
subtract
(
param
.
getUnloadTare
()
);
BigDecimal
net
=
orderChild
.
getLoadNet
(
);
PaymentDTO
paymentDTO
=
getPaymentDTO
(
net
,
orderChild
);
PaymentDTO
paymentDTO
=
getPaymentDTO
(
net
,
orderChild
);
if
(
Objects
.
nonNull
(
paymentDTO
.
getPlatformServiceFeeNew
())
&&
if
(
Objects
.
nonNull
(
paymentDTO
.
getPlatformServiceFeeNew
())
&&
paymentDTO
.
getPlatformServiceFeeNew
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
paymentDTO
.
getPlatformServiceFeeNew
().
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论