Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
2cf796f9
提交
2cf796f9
authored
8月 15, 2024
作者:
杨启发
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/test' into test
Former-commit-id:
b7467b4a
上级
a8fd0fcd
bc5d0564
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
119 行增加
和
28 行删除
+119
-28
OrderChildServiceImpl.java
...m/clx/performance/service/impl/OrderChildServiceImpl.java
+80
-28
TruckTraceServiceImpl.java
...performance/service/impl/trace/TruckTraceServiceImpl.java
+35
-0
TruckTraceService.java
.../com/clx/performance/service/trace/TruckTraceService.java
+4
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java
浏览文件 @
2cf796f9
...
...
@@ -99,7 +99,9 @@ import com.tencentcloudapi.ocr.v20181119.models.ItemInfo;
import
com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Request
;
import
com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Response
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.exception.ExceptionUtils
;
...
...
@@ -1745,9 +1747,9 @@ public class OrderChildServiceImpl implements OrderChildService {
result
.
setSendSamplingPic
(
orderInfoFeign
.
getSendSamplingPic
());
result
.
setSendQualityPosition
(
orderInfoFeign
.
getSendQualityPosition
());
result
.
setSendSamplingVideo
(
orderInfoFeign
.
getSendSamplingVideo
());
Object
[]
superviseInfo
=
getSuperviseInfo
(
orderChild
.
getOrderNo
(),
orderChild
.
getChildNo
());
result
.
setSuperviseContacts
(
superviseInfo
!=
null
?
(
String
)
superviseInfo
[
0
]
:
null
);
result
.
setSuperviseMobile
(
superviseInfo
!=
null
?
(
String
)
superviseInfo
[
1
]
:
null
);
SuperviseInfo
superviseInfo
=
getSuperviseInfo
(
orderChild
.
getOrderNo
(),
orderChild
.
getChildNo
());
result
.
setSuperviseContacts
(
superviseInfo
!=
null
?
superviseInfo
.
getSuperviseContacts
()
:
null
);
result
.
setSuperviseMobile
(
superviseInfo
!=
null
?
superviseInfo
.
getSuperviseMobile
()
:
null
);
//查询结算信息
Optional
<
SettlementOwnerDetail
>
optional
=
settlementOwnerDetailDao
.
getByChildNo
(
childNo
);
...
...
@@ -1777,6 +1779,15 @@ public class OrderChildServiceImpl implements OrderChildService {
return
result
;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
static
class
SuperviseInfo
{
private
String
superviseContacts
;
private
String
superviseMobile
;
private
String
taskAddress
;
}
/**
* todo 要改成两个
* 获取监装
...
...
@@ -1784,7 +1795,7 @@ public class OrderChildServiceImpl implements OrderChildService {
* @param childNo
* @return
*/
private
Object
[]
getSuperviseInfo
(
String
orderNo
,
String
childNo
)
{
private
SuperviseInfo
getSuperviseInfo
(
String
orderNo
,
String
childNo
)
{
NeedAlertSuperviseInfoResultVO
result
=
new
NeedAlertSuperviseInfoResultVO
();
App
app
=
appConfig
.
getPurchaseManageApp
();
//对接马上来供应链配置信息
//组装配置信息
...
...
@@ -1801,7 +1812,39 @@ public class OrderChildServiceImpl implements OrderChildService {
return
null
;
}
SupervisionLoadInfoDto
supervisionLoadInfo
=
supervisionLoadInfoDto
.
getData
();
//监装信息
if
(
Objects
.
nonNull
(
supervisionLoadInfo
))
{
//有监装信息
if
(
Objects
.
isNull
(
supervisionLoadInfo
))
{
//有监装信息
return
null
;
}
//通过运单号查询监装监卸子任务状态
return
new
SuperviseInfo
(
supervisionLoadInfo
.
getTaskContracts
(),
supervisionLoadInfo
.
getTaskMobile
(),
supervisionLoadInfo
.
getTaskAddress
());
}
/**
* 获取监装
* @param orderNo
* @param childNo
* @return
*/
private
SuperviseInfo
getSuperviseInfoWithSubStatus
(
String
orderNo
,
String
childNo
)
{
NeedAlertSuperviseInfoResultVO
result
=
new
NeedAlertSuperviseInfoResultVO
();
App
app
=
appConfig
.
getPurchaseManageApp
();
//对接马上来供应链配置信息
//组装配置信息
RequestConfig
config
=
new
RequestConfig
()
.
setAppId
(
app
.
getAppNo
())
.
setAppKey
(
app
.
getAppKey
())
.
setGatewayUrl
(
app
.
getCallback
());
//通过订单号查询监装监卸信息
SupplyChainSupervisionLoadAction
action
=
new
SupplyChainSupervisionLoadAction
();
action
.
setOrderNo
(
orderNo
);
action
.
setType
(
OrderChildEnum
.
SuperviseTypeEnum
.
SUPERVISE_LOAD
.
getCode
());
Result
<
SupervisionLoadInfoDto
>
supervisionLoadInfoDto
=
OpenClient
.
doAction
(
config
,
action
);
if
(!
supervisionLoadInfoDto
.
succeed
())
{
//接口调用失败
return
null
;
}
SupervisionLoadInfoDto
supervisionLoadInfo
=
supervisionLoadInfoDto
.
getData
();
//监装信息
if
(
Objects
.
isNull
(
supervisionLoadInfo
))
{
//有监装信息
return
null
;
}
//通过运单号查询监装监卸子任务状态
SupplyChainSupervisionLoadTruckAction
truckAction
=
new
SupplyChainSupervisionLoadTruckAction
();
truckAction
.
setChildNo
(
childNo
);
...
...
@@ -1811,15 +1854,11 @@ public class OrderChildServiceImpl implements OrderChildService {
return
null
;
}
SupervisionLoadTruckInfoDto
supervisionLoadTruckInfo
=
supervisionLoadTruckInfoDto
.
getData
();
if
(
Objects
.
nonNull
(
supervisionLoadTruckInfo
))
{
if
(
supervisionLoadTruckInfo
.
getLoadStatus
())
{
return
new
Object
[]{
supervisionLoadInfo
.
getTaskContracts
(),
supervisionLoadInfo
.
getTaskMobile
(),
supervisionLoadInfo
.
getTaskAddress
()};
}
}
}
if
(
Objects
.
isNull
(
supervisionLoadTruckInfo
)
||
!
supervisionLoadTruckInfo
.
getLoadStatus
())
{
return
null
;
}
return
new
SuperviseInfo
(
supervisionLoadInfo
.
getTaskContracts
(),
supervisionLoadInfo
.
getTaskMobile
(),
supervisionLoadInfo
.
getTaskAddress
());
}
//查看运单车辆是否开启了中交兴路
public
String
isOpenZJXL
(
Integer
orderChildStatus
,
String
truckNo
){
...
...
@@ -3248,9 +3287,9 @@ public class OrderChildServiceImpl implements OrderChildService {
truckLatitudeY
=
truckTraceDTO
.
getLocation
()[
1
];
}
if
(
truckLongitudeX
==
null
||
truckLatitudeY
==
null
)
{
log
.
info
(
"运单号:{},卡车:{},卡车经纬度:{}"
,
childNo
,
truckNo
,
truckTraceDTO
);
BigDecimal
[]
location
=
truckTraceService
.
getCurrentPosition
(
truckNo
,
driverUserNo
);
if
(
location
!=
null
&&
location
.
length
>
2
)
{
BigDecimal
[]
location
=
truckTraceService
.
getTruckCurrentPosition
(
truckNo
);
log
.
info
(
"运单号:{},卡车:{},卡车经纬度:{}"
,
childNo
,
truckNo
,
location
);
if
(
location
!=
null
&&
location
.
length
>
=
2
)
{
truckLongitudeX
=
location
[
0
];
truckLatitudeY
=
location
[
1
];
}
...
...
@@ -3262,7 +3301,9 @@ public class OrderChildServiceImpl implements OrderChildService {
BigDecimal
siteLatitudeY
=
orderGoods
.
getSendLatitude
();
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{}"
,
childNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
);
//调高德获取距离
if
(
Objects
.
nonNull
(
truckLongitudeX
)
&&
Objects
.
nonNull
(
truckLatitudeY
))
{
if
(
Objects
.
isNull
(
truckLongitudeX
)
||
Objects
.
isNull
(
truckLatitudeY
))
{
continue
;
}
Integer
distance
=
getGdRoute
(
truckNo
,
orderGoods
.
getSendLongitude
(),
orderGoods
.
getSendLatitude
(),
siteLongitudeX
,
siteLatitudeY
);
if
(
distance
==
null
)
{
...
...
@@ -3283,11 +3324,11 @@ public class OrderChildServiceImpl implements OrderChildService {
}
// 已装货
if
(
Objects
.
equals
(
child
.
getStatus
(),
OrderChildEnum
.
Status
.
LOAD
.
getCode
()))
{
Object
[]
superviseInfo
=
getSuperviseInfo
(
child
.
getOrderNo
(),
child
.
getChildNo
());
SuperviseInfo
superviseInfo
=
getSuperviseInfoWithSubStatus
(
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
]
);
sendSupervisionSms
(
child
.
getDriverMobile
(),
child
.
getTruckNo
(),
child
.
getChildNo
(),
superviseInfo
.
getTaskAddress
()
);
}
}
// 修改 通知状态 为已通知
...
...
@@ -3296,7 +3337,7 @@ public class OrderChildServiceImpl implements OrderChildService {
orderChildDao
.
updateEntityByKey
(
child
);
}
}
else
if
(
distance
<=
1000
)
{
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{} 距离小于1km"
,
orderGoods
No
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{} 距离小于1km"
,
child
No
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
// 这里的1km的距离是产品需求写死的,不使用通知配置范围
// 未超出货源地+通知触发距离
// 驶入货源地+通知触发距离范围内了
...
...
@@ -3313,7 +3354,6 @@ public class OrderChildServiceImpl implements OrderChildService {
}
}
}
}
/**
* 发送上传装货信息短信
...
...
@@ -3373,26 +3413,38 @@ public class OrderChildServiceImpl implements OrderChildService {
log
.
info
(
"发送发送监装提示短信:【当前车牌号{},运单{}需要进行现场监装,请您前往{}进行配合,如需帮助请联系客服。】,结果:{}"
,
truckNo
,
childNo
,
supervisionAddress
,
result
);
}
private
BigDecimal
[]
getTruckLocation
(
String
truckNo
,
BigDecimal
longitude
,
BigDecimal
latitude
)
{
private
BigDecimal
[]
getTruckLocation
(
String
truckNo
,
BigDecimal
longitude
,
BigDecimal
latitude
)
{
TruckLocationDTO
truckLocationDTO
=
null
;
try
{
truckLocationDTO
=
zjxlGpsService
.
getTruckLastLocation
(
truckNo
);
}
catch
(
Exception
e
)
{
log
.
info
(
"中交兴路获取失败:{}"
,
e
.
getMessage
());
}
//如果中交兴路获取到位置信息,则使用中交,否则用APP传的位置信息
if
(
truckLocationDTO
!=
null
)
{
BigDecimal
[]
location
=
truckLocationDTO
.
getLocation
();
longitude
=
location
[
0
];
latitude
=
location
[
1
];
log
.
info
(
"当前中交兴路获取司机车牌:{},相关位置信息:{}"
,
truckNo
,
JSONUtil
.
parse
(
truckLocationDTO
));
}
else
{
log
.
info
(
"中交兴路获取失败,通过高德获取,truckNo:{}"
,
truckNo
);
return
new
BigDecimal
[]{
longitude
,
latitude
};
}
}
catch
(
Exception
e
)
{
log
.
info
(
"中交兴路获取失败:{}"
,
e
.
getMessage
());
}
//20240815 海泉说中交兴路也可能往缓存中放,也可能往es中放,最新的应该都是使用es,所以缓存中如果取不到,就从es中取一下看看
BigDecimal
[]
truckLocation
=
truckTraceService
.
getCurrentTruckPosition
(
truckNo
);
if
(
truckLocation
!=
null
&&
truckLocation
.
length
>=
2
&&
truckLocation
[
0
]
!=
null
&&
truckLocation
[
1
]
!=
null
)
{
longitude
=
truckLocation
[
0
];
latitude
=
truckLocation
[
1
];
log
.
info
(
"中交兴路es获取司机车牌:{},相关位置信息:{}"
,
truckNo
,
truckLocation
);
return
new
BigDecimal
[]{
longitude
,
latitude
};
}
BigDecimal
[]
result
=
new
BigDecimal
[]{
longitude
,
latitude
};
//如果中交兴路获取到位置信息,则使用中交,否则用APP传的位置信息
log
.
info
(
"中交兴路获取失败,使用app上传位置,truckNo:{},相关位置信息:{}"
,
truckNo
,
result
);
return
result
;
}
@Override
public
OcrRecognitionResultVO
ocrRecognition
(
OcrRecognitionParam
param
)
{
//校验,同一运单同一图片类型只能识别一次
...
...
performance-web/src/main/java/com/clx/performance/service/impl/trace/TruckTraceServiceImpl.java
浏览文件 @
2cf796f9
...
...
@@ -303,6 +303,41 @@ public class TruckTraceServiceImpl implements TruckTraceService {
return
null
;
}
/**
* 获取卡车当前位置 5分钟内的位置
* @param truckNo 卡车车牌号
* @return 位置
*/
@Override
public
BigDecimal
[]
getTruckCurrentPosition
(
String
truckNo
)
{
String
beginTime
=
LocalDateTimeUtils
.
formatTime
(
LocalDateTime
.
now
().
minusMinutes
(
LAST_POSITION_TIME
));
return
getTruckCurrentPosition
(
truckNo
,
beginTime
);
}
/**
* 获取卡车当前位置
* @param truckNo 卡车车牌号
* @param beginTime 开始时间
* @return 位置
*/
@Override
public
BigDecimal
[]
getTruckCurrentPosition
(
String
truckNo
,
String
beginTime
)
{
String
endTime
=
LocalDateTimeUtils
.
formatTime
();
// 车辆
List
<
TruckTraceESPlus
>
list
=
truckTraceESPlusMapper
.
selectList
(
new
LambdaEsQueryWrapper
<
TruckTraceESPlus
>()
.
eq
(
TruckTraceESPlus:
:
getTruckNo
,
truckNo
)
.
ge
(
TruckTraceESPlus:
:
getGpsTime
,
beginTime
)
.
le
(
TruckTraceESPlus:
:
getGpsTime
,
endTime
)
.
orderByDesc
(
"gpsTime"
)
.
limit
(
1
)
);
if
(!
list
.
isEmpty
()){
return
list
.
get
(
0
).
getLocation
();
}
return
null
;
}
@Override
public
int
getParkTime
(
String
truckNo
,
Long
userNo
,
LocalDateTime
beginDateTime
)
{
return
getParkTime
(
truckNo
,
userNo
,
beginDateTime
,
LocalDateTime
.
now
());
...
...
performance-web/src/main/java/com/clx/performance/service/trace/TruckTraceService.java
浏览文件 @
2cf796f9
...
...
@@ -23,6 +23,10 @@ public interface TruckTraceService {
BigDecimal
[]
getCurrentPosition
(
String
truckNo
,
Long
userNo
,
String
beginTime
);
BigDecimal
[]
getTruckCurrentPosition
(
String
truckNo
);
BigDecimal
[]
getTruckCurrentPosition
(
String
truckNo
,
String
beginTime
);
int
getParkTime
(
String
truckNo
,
Long
userNo
,
LocalDateTime
beginDateTime
);
int
getParkTime
(
String
truckNo
,
Long
userNo
,
LocalDateTime
beginTime
,
LocalDateTime
endTime
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论