Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
90201fee
提交
90201fee
authored
8月 14, 2024
作者:
刘海泉
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/test' into test
Former-commit-id:
9f0483bb
上级
264f697a
a1e98175
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
77 行增加
和
15 行删除
+77
-15
InvoiceDataListener.java
...m/clx/performance/listener/excel/InvoiceDataListener.java
+16
-0
OrderCancelServiceImpl.java
.../clx/performance/service/impl/OrderCancelServiceImpl.java
+3
-1
OrderChildServiceImpl.java
...m/clx/performance/service/impl/OrderChildServiceImpl.java
+13
-9
OrderChildBrokerMqHandlerServiceImpl.java
...ice/impl/broker/OrderChildBrokerMqHandlerServiceImpl.java
+33
-0
SettlementDriverServiceImpl.java
...ance/service/impl/settle/SettlementDriverServiceImpl.java
+5
-5
SettlementMqHandlerServiceImpl.java
...e/service/impl/settle/SettlementMqHandlerServiceImpl.java
+3
-0
SettlementOrderChildRiskServiceImpl.java
...vice/impl/settle/SettlementOrderChildRiskServiceImpl.java
+2
-0
OrderChildSqlProvider.java
...om/clx/performance/sqlProvider/OrderChildSqlProvider.java
+2
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/listener/excel/InvoiceDataListener.java
浏览文件 @
90201fee
...
...
@@ -7,12 +7,15 @@ import com.clx.performance.dao.settle.SettlementOwnerDetailDao;
import
com.clx.performance.dto.excel.InvoiceData
;
import
com.clx.performance.model.settle.SettlementOwnerDetail
;
import
com.clx.performance.param.pc.owner.PageInvoiceOwnerSettlementOwnerDetailParam
;
import
com.msl.common.exception.ServiceSystemException
;
import
lombok.AllArgsConstructor
;
import
org.springframework.util.CollectionUtils
;
import
java.math.BigDecimal
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
clx
.
performance
.
enums
.
PerformanceResultEnum
.
DATA_NOT_FIND
;
import
static
com
.
clx
.
performance
.
enums
.
settle
.
SettlementOwnerDetailEnum
.
InvoiceStatus
.
NO
;
import
static
com
.
clx
.
performance
.
enums
.
settle
.
SettlementOwnerEnum
.
InvoiceType
.
ORDINARY
;
...
...
@@ -49,5 +52,18 @@ public class InvoiceDataListener extends AnalysisEventListener<InvoiceData> {
// 解析完成后调用
// 可在此进行后续操作,如保存数据到数据库
}
@Override
public
void
invokeHeadMap
(
Map
<
Integer
,
String
>
headMap
,
AnalysisContext
context
)
{
// 解析表头时调用
// 可在此进行表头校验等操作
//模板有3列,模板第1列是运单编号,第2列是开票标识,第3列是开票金额,校验上传的Excel是否是这个模板
if
(
headMap
.
size
()
!=
3
)
{
throw
new
ServiceSystemException
(
DATA_NOT_FIND
,
"上传文件格式错误"
);
}
if
(!
headMap
.
get
(
0
).
equals
(
"运单编号"
)
||
!
headMap
.
get
(
1
).
equals
(
"开票标识"
)
||
!
headMap
.
get
(
2
).
equals
(
"开票金额"
))
{
throw
new
ServiceSystemException
(
DATA_NOT_FIND
,
"上传文件格式错误"
);
}
}
}
performance-web/src/main/java/com/clx/performance/service/impl/OrderCancelServiceImpl.java
浏览文件 @
90201fee
...
...
@@ -579,6 +579,7 @@ public class OrderCancelServiceImpl implements OrderCancelService {
}
@Override
// todo :jiangwujie 事务判断 ,其他也检查一下
public
void
removeLoadLimit
(
ArtificialCancelOrderParam
param
)
{
OrderChild
orderChild
=
orderChildDao
.
getByChildNo
(
param
.
getOrderChildNo
()).
orElseThrow
(
PerformanceResultEnum
.
ORDER_CHILD_NO_FOUND
);
//判断运单状态【已接单】【前往货源地】【到达货源地】时可对该运单解除装车限制,否则toast:不可操作
...
...
@@ -586,7 +587,8 @@ public class OrderCancelServiceImpl implements OrderCancelService {
OrderChildEnum
.
Status
.
GO_TO_SEND
.
getCode
(),
OrderChildEnum
.
Status
.
ARRIVE_SEND
.
getCode
())
.
contains
(
orderChild
.
getStatus
()))
{
log
.
error
(
"运单:{} 状态:{}不在【已接单】【前往货源地】【到达货源地】范围中,不允许解除装车限制"
,
param
.
getOrderChildNo
(),
orderChild
.
getStatus
());
//todo log.error 检查一下
log
.
info
(
"运单:{} 状态:{}不在【已接单】【前往货源地】【到达货源地】范围中,不允许解除装车限制"
,
param
.
getOrderChildNo
(),
orderChild
.
getStatus
());
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
ORDER_CHILD_CANCEL_FORBID
,
"不可操作"
);
}
...
...
performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java
浏览文件 @
90201fee
...
...
@@ -1778,6 +1778,7 @@ public class OrderChildServiceImpl implements OrderChildService {
}
/**
* todo 要改成两个
* 获取监装
* @param orderNo
* @param childNo
...
...
@@ -3235,11 +3236,6 @@ public class OrderChildServiceImpl implements OrderChildService {
String
childNo
=
child
.
getChildNo
();
String
truckNo
=
child
.
getTruckNo
();
Long
driverUserNo
=
child
.
getDriverUserNo
();
//解除监装限制的不进行处理
if
(
Objects
.
equals
(
child
.
getRemoveLoadLimitStatus
(),
OrderChildEnum
.
RemoveLoadLimitStatus
.
REMOVED
.
getCode
()))
{
log
.
info
(
"运单:{},卡车:{} 已解除监装限制"
,
childNo
,
truckNo
);
return
;
}
//获取卡车的位置
TruckTraceDTO
truckTraceDTO
=
truckTraceMap
.
get
(
truckNo
);
BigDecimal
truckLongitudeX
=
null
;
...
...
@@ -3259,18 +3255,21 @@ public class OrderChildServiceImpl implements OrderChildService {
OrderGoods
orderGoods
=
orderGoodsDao
.
getByOrderGoodsNo
(
orderGoodsNo
).
get
();
BigDecimal
siteLongitudeX
=
orderGoods
.
getSendLongitude
();
BigDecimal
siteLatitudeY
=
orderGoods
.
getSendLatitude
();
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{}"
,
orderGoodsNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
);
//调高德获取距离
if
(
Objects
.
nonNull
(
truckLongitudeX
)
&&
Objects
.
nonNull
(
truckLatitudeY
))
{
Integer
distance
=
getGdRoute
(
truckNo
,
orderGoods
.
getSendLongitude
(),
orderGoods
.
getSendLatitude
(),
siteLongitudeX
,
siteLatitudeY
);
if
(
distance
==
null
)
{
log
.
error
(
"高德获取卡车与货源地位置距离失败,orderGoodsNo:{},orderChildNo:{},truckNo:{}"
,
orderGoodsNo
,
childNo
,
truckNo
);
return
;
log
.
info
(
"高德获取卡车与货源地位置距离失败,orderGoodsNo:{},orderChildNo:{},truckNo:{}"
,
orderGoodsNo
,
childNo
,
truckNo
);
continue
;
}
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{}"
,
orderGoodsNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
// 超出货源地+通知触发距离
if
(
distance
>
driverNoticeConfigVO
.
getNoticeTriggerDistanceMeter
())
{
if
(
Objects
.
equals
(
child
.
getExitNoticeStatus
(),
OrderChildEnum
.
ExitNoticeStatus
.
NOT_NOTIFIED
.
getCode
())
)
{
// todo :jiangwujie 增加短信次数限制
//超出货源地x公里范围了,且通知状态为未通知
// 到达货源地
if
(
Objects
.
equals
(
child
.
getStatus
(),
OrderChildEnum
.
Status
.
ARRIVE_SEND
.
getCode
()))
{
...
...
@@ -3280,7 +3279,9 @@ public class OrderChildServiceImpl implements OrderChildService {
// 已装货
if
(
Objects
.
equals
(
child
.
getStatus
(),
OrderChildEnum
.
Status
.
LOAD
.
getCode
()))
{
Object
[]
superviseInfo
=
getSuperviseInfo
(
child
.
getOrderNo
(),
child
.
getChildNo
());
log
.
info
(
"运单号:{},卡车:{},监装信息{}"
,
childNo
,
truckNo
,
superviseInfo
);
if
(
superviseInfo
!=
null
)
{
log
.
info
(
"{}超出货源地x公里范围了,运单{}为装货成功状态,发送短信"
,
truckNo
,
childNo
);
sendSupervisionSms
(
child
.
getDriverMobile
(),
child
.
getTruckNo
(),
child
.
getChildNo
(),
(
String
)
superviseInfo
[
2
]);
}
}
...
...
@@ -3289,11 +3290,14 @@ public class OrderChildServiceImpl implements OrderChildService {
child
.
setEnterExitSendStatus
(
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_OUT
.
getCode
());
orderChildDao
.
updateEntityByKey
(
child
);
}
}
else
if
(
distance
<=
1000
){
}
else
if
(
distance
<=
1000
)
{
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{} 距离小于1km"
,
orderGoodsNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
// 这里的1km的距离是产品需求写死的,不使用通知配置范围
// 未超出货源地+通知触发距离
// 驶入货源地+通知触发距离范围内了
if
(
Objects
.
equals
(
child
.
getEnterExitSendStatus
(),
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_OUT
.
getCode
()))
{
if
(
Objects
.
equals
(
child
.
getEnterExitSendStatus
(),
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_OUT
.
getCode
())
||
Objects
.
equals
(
child
.
getEnterExitSendStatus
(),
OrderChildEnum
.
EnterExitSendStatus
.
INIT
.
getCode
())
)
{
//驶入货源地x公里范围了,且通知状态为已通知
// 修改 通知状态 为未通知
child
.
setExitNoticeStatus
(
OrderChildEnum
.
ExitNoticeStatus
.
NOT_NOTIFIED
.
getCode
());
...
...
performance-web/src/main/java/com/clx/performance/service/impl/broker/OrderChildBrokerMqHandlerServiceImpl.java
浏览文件 @
90201fee
...
...
@@ -3,12 +3,15 @@ package com.clx.performance.service.impl.broker;
import
com.clx.performance.dao.OrderChildDao
;
import
com.clx.performance.dao.OrderGoodsDao
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.dao.settle.SettlementOrderChildRiskDao
;
import
com.clx.performance.dao.settle.SettlementOwnerDetailDao
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.settle.SettlementOrderChildRiskEnum
;
import
com.clx.performance.enums.settle.SettlementOwnerDetailEnum
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.OrderGoods
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.model.settle.SettlementOrderChildRisk
;
import
com.clx.performance.model.settle.SettlementOwnerDetail
;
import
com.clx.performance.service.broker.OrderChildBrokerMqHandlerService
;
import
com.clx.performance.service.broker.OrderChildBrokerMqService
;
...
...
@@ -19,6 +22,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.Objects
;
...
...
@@ -40,9 +44,38 @@ public class OrderChildBrokerMqHandlerServiceImpl implements OrderChildBrokerMqH
private
OrderChildBrokerService
orderChildBrokerService
;
@Autowired
private
OrderChildBrokerMqService
orderChildBrokerMqService
;
@Autowired
private
SettlementOrderChildRiskDao
settlementOrderChildRiskDao
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
orderChildSync
(
BrokerOrderChildSyncMqParam
mq
)
{
try
{
doOrderChildSync
(
mq
);
}
catch
(
Exception
e
){
log
.
info
(
"无车承运-运单同步 失败,msg:{}"
,
ExceptionUtils
.
getStackTrace
(
e
));
OrderChild
orderChild
=
orderChildDao
.
getByChildNo
(
mq
.
getChildNo
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
SettlementOwnerDetail
settlementOwnerDetail
=
settlementOwnerDetailDao
.
getByChildNo
(
orderChild
.
getChildNo
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
SettlementOrderChildRisk
settlementOrderChildRisk
=
new
SettlementOrderChildRisk
();
settlementOrderChildRisk
.
setChildNo
(
orderChild
.
getChildNo
());
settlementOrderChildRisk
.
setTruckNo
(
orderChild
.
getTruckNo
());
settlementOrderChildRisk
.
setDriverName
(
orderChild
.
getDriverName
());
settlementOrderChildRisk
.
setDriverMobile
(
orderChild
.
getDriverMobile
());
settlementOrderChildRisk
.
setGoodsName
(
orderChild
.
getGoodsName
());
settlementOrderChildRisk
.
setInvoiceType
(
settlementOwnerDetail
.
getInvoiceType
());
settlementOrderChildRisk
.
setPoundAuditTime
(
settlementOwnerDetail
.
getPoundAuditTime
());
settlementOrderChildRisk
.
setRiskType
(
SettlementOrderChildRiskEnum
.
RiskType
.
SETTLE_FAIL
.
getCode
());
settlementOrderChildRisk
.
setRiskRemark
(
"同步无车承运异常"
);
settlementOrderChildRiskDao
.
saveEntity
(
settlementOrderChildRisk
);
}
}
public
void
doOrderChildSync
(
BrokerOrderChildSyncMqParam
mq
){
String
childNo
=
mq
.
getChildNo
();
Integer
invoiceType
=
mq
.
getInvoiceType
();
...
...
performance-web/src/main/java/com/clx/performance/service/impl/settle/SettlementDriverServiceImpl.java
浏览文件 @
90201fee
...
...
@@ -139,13 +139,13 @@ public class SettlementDriverServiceImpl implements SettlementDriverService {
rowData
.
add
(
new
ExcelData
(
vo
.
getTruckNo
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getInvoiceType
()==
null
?
null
:
SettlementDriverEnum
.
InvoiceType
.
getMsgByCode
(
vo
.
getInvoiceType
())));
rowData
.
add
(
new
ExcelData
(
vo
.
getWeight
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getFreightPrice
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getFreightPrice
()
==
null
?
null
:
vo
.
getFreightPrice
().
movePointLeft
(
2
)
));
rowData
.
add
(
new
ExcelData
(
vo
.
getFreight
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getLossPrice
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getFreight
()
==
null
?
null
:
vo
.
getFreight
().
movePointLeft
(
2
)
));
rowData
.
add
(
new
ExcelData
(
vo
.
getLossPrice
()
==
null
?
null
:
vo
.
getLossPrice
().
movePointLeft
(
2
)
));
rowData
.
add
(
new
ExcelData
(
vo
.
getLossWeight
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getLossFreight
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getSettlementFreight
()));
rowData
.
add
(
new
ExcelData
(
vo
.
getLossFreight
()
==
null
?
null
:
vo
.
getLossFreight
().
movePointLeft
(
2
)
));
rowData
.
add
(
new
ExcelData
(
vo
.
getSettlementFreight
()
==
null
?
null
:
vo
.
getSettlementFreight
().
movePointLeft
(
2
)
));
rowData
.
add
(
new
ExcelData
(
SettlementDriverEnum
.
Status
.
getMsgByCode
(
vo
.
getStatus
())));
rowData
.
add
(
new
ExcelData
(
"-"
));
...
...
performance-web/src/main/java/com/clx/performance/service/impl/settle/SettlementMqHandlerServiceImpl.java
浏览文件 @
90201fee
...
...
@@ -843,6 +843,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
return
uniqueOrderNumService
.
getUniqueOrderNum
(
com
.
msl
.
common
.
utils
.
LocalDateTimeUtils
.
convertLocalDateTimeToString
(
LocalDateTime
.
now
(),
com
.
msl
.
common
.
utils
.
LocalDateTimeUtils
.
DATE_DAY
));
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
riskProcess
(
SettlementOrderChildRiskProcessMqParam
mq
)
{
SettlementOrderChildRisk
settlementOrderChildRisk
=
settlementOrderChildRiskDao
.
getById
(
mq
.
getId
()).
orElseThrow
(
ResultEnum
.
DATA_NOT_FIND
);
...
...
@@ -865,6 +866,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
invoiceCompanyUpdate
(
SettlementOwnerDetialInvoiceCompanyUpdateMqParam
mq
)
{
...
...
@@ -943,6 +945,7 @@ public class SettlementMqHandlerServiceImpl implements SettlementMqHandlerServic
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
settlementPlatformAutoConfirm
(
SettlementPlatformAutoConfirmMqParam
mq
)
{
SettlementOwner
settlementOwner
=
settlementOwnerDao
...
...
performance-web/src/main/java/com/clx/performance/service/impl/settle/SettlementOrderChildRiskServiceImpl.java
浏览文件 @
90201fee
...
...
@@ -30,6 +30,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.poi.xssf.streaming.SXSSFWorkbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
...
...
@@ -52,6 +53,7 @@ public class SettlementOrderChildRiskServiceImpl implements SettlementOrderChild
@Autowired
private
SettlementMqService
settlementMqService
;
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
updateRiskProcess
(
OwnerSettlementOrderChildRiskProcessUpdateParam
param
)
{
UserSessionData
loginUserInfo
=
TokenUtil
.
getLoginUserInfo
();
...
...
performance-web/src/main/java/com/clx/performance/sqlProvider/OrderChildSqlProvider.java
浏览文件 @
90201fee
...
...
@@ -182,6 +182,7 @@ public class OrderChildSqlProvider {
}
public
String
findArtificialCancelOrder
(
@Param
(
"param"
)
ArtificialCancelOrderQueryParam
param
)
{
//todo jiangwujie 改成 new SQL()形式
StringBuilder
sql
=
new
StringBuilder
();
sql
.
append
(
"SELECT child_no, goods_name, freight_price, order_no, "
);
sql
.
append
(
"send_address, receive_address, "
);
...
...
@@ -201,6 +202,7 @@ public class OrderChildSqlProvider {
if
(
StringUtils
.
isNotBlank
(
param
.
getTruckNo
()))
{
conditions
.
add
(
"truck_no = #{param.truckNo}"
);
}
//todo :jiangwujie 支付状态 可以忽略 ,还是使用<= >=
List
<
Integer
>
statuses
=
Arrays
.
asList
(
OrderChildEnum
.
Status
.
CREATED
.
getCode
(),
OrderChildEnum
.
Status
.
GO_TO_SEND
.
getCode
(),
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论