Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
f2cfcf90
提交
f2cfcf90
authored
8月 14, 2024
作者:
jiangwujie
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'v21.1_jianzhuang_20240807' into test
上级
56a61901
b0e9d0cb
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
106 行增加
和
66 行删除
+106
-66
OrderChildServiceImpl.java
...m/clx/performance/service/impl/OrderChildServiceImpl.java
+106
-66
没有找到文件。
performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java
浏览文件 @
f2cfcf90
...
@@ -99,7 +99,9 @@ import com.tencentcloudapi.ocr.v20181119.models.ItemInfo;
...
@@ -99,7 +99,9 @@ import com.tencentcloudapi.ocr.v20181119.models.ItemInfo;
import
com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Request
;
import
com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Request
;
import
com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Response
;
import
com.tencentcloudapi.ocr.v20181119.models.SmartStructuralOCRV2Response
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.NoArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.lang.exception.ExceptionUtils
;
import
org.apache.commons.lang.exception.ExceptionUtils
;
...
@@ -1745,9 +1747,9 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -1745,9 +1747,9 @@ public class OrderChildServiceImpl implements OrderChildService {
result
.
setSendSamplingPic
(
orderInfoFeign
.
getSendSamplingPic
());
result
.
setSendSamplingPic
(
orderInfoFeign
.
getSendSamplingPic
());
result
.
setSendQualityPosition
(
orderInfoFeign
.
getSendQualityPosition
());
result
.
setSendQualityPosition
(
orderInfoFeign
.
getSendQualityPosition
());
result
.
setSendSamplingVideo
(
orderInfoFeign
.
getSendSamplingVideo
());
result
.
setSendSamplingVideo
(
orderInfoFeign
.
getSendSamplingVideo
());
Object
[]
superviseInfo
=
getSuperviseInfo
(
orderChild
.
getOrderNo
(),
orderChild
.
getChildNo
());
SuperviseInfo
superviseInfo
=
getSuperviseInfo
(
orderChild
.
getOrderNo
(),
orderChild
.
getChildNo
());
result
.
setSuperviseContacts
(
superviseInfo
!=
null
?
(
String
)
superviseInfo
[
0
]
:
null
);
result
.
setSuperviseContacts
(
superviseInfo
!=
null
?
superviseInfo
.
getSuperviseContacts
()
:
null
);
result
.
setSuperviseMobile
(
superviseInfo
!=
null
?
(
String
)
superviseInfo
[
1
]
:
null
);
result
.
setSuperviseMobile
(
superviseInfo
!=
null
?
superviseInfo
.
getSuperviseMobile
()
:
null
);
//查询结算信息
//查询结算信息
Optional
<
SettlementOwnerDetail
>
optional
=
settlementOwnerDetailDao
.
getByChildNo
(
childNo
);
Optional
<
SettlementOwnerDetail
>
optional
=
settlementOwnerDetailDao
.
getByChildNo
(
childNo
);
...
@@ -1777,6 +1779,15 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -1777,6 +1779,15 @@ public class OrderChildServiceImpl implements OrderChildService {
return
result
;
return
result
;
}
}
@Data
@AllArgsConstructor
@NoArgsConstructor
static
class
SuperviseInfo
{
private
String
superviseContacts
;
private
String
superviseMobile
;
private
String
taskAddress
;
}
/**
/**
* todo 要改成两个
* todo 要改成两个
* 获取监装
* 获取监装
...
@@ -1784,7 +1795,7 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -1784,7 +1795,7 @@ public class OrderChildServiceImpl implements OrderChildService {
* @param childNo
* @param childNo
* @return
* @return
*/
*/
private
Object
[]
getSuperviseInfo
(
String
orderNo
,
String
childNo
)
{
private
SuperviseInfo
getSuperviseInfo
(
String
orderNo
,
String
childNo
)
{
NeedAlertSuperviseInfoResultVO
result
=
new
NeedAlertSuperviseInfoResultVO
();
NeedAlertSuperviseInfoResultVO
result
=
new
NeedAlertSuperviseInfoResultVO
();
App
app
=
appConfig
.
getPurchaseManageApp
();
//对接马上来供应链配置信息
App
app
=
appConfig
.
getPurchaseManageApp
();
//对接马上来供应链配置信息
//组装配置信息
//组装配置信息
...
@@ -1801,24 +1812,52 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -1801,24 +1812,52 @@ public class OrderChildServiceImpl implements OrderChildService {
return
null
;
return
null
;
}
}
SupervisionLoadInfoDto
supervisionLoadInfo
=
supervisionLoadInfoDto
.
getData
();
//监装信息
SupervisionLoadInfoDto
supervisionLoadInfo
=
supervisionLoadInfoDto
.
getData
();
//监装信息
if
(
Objects
.
nonNull
(
supervisionLoadInfo
))
{
//有监装信息
if
(
Objects
.
isNull
(
supervisionLoadInfo
))
{
//有监装信息
//通过运单号查询监装监卸子任务状态
return
null
;
SupplyChainSupervisionLoadTruckAction
truckAction
=
new
SupplyChainSupervisionLoadTruckAction
();
}
truckAction
.
setChildNo
(
childNo
);
//通过运单号查询监装监卸子任务状态
truckAction
.
setType
(
OrderChildEnum
.
SuperviseTypeEnum
.
SUPERVISE_LOAD
.
getCode
());
return
new
SuperviseInfo
(
supervisionLoadInfo
.
getTaskContracts
(),
supervisionLoadInfo
.
getTaskMobile
(),
supervisionLoadInfo
.
getTaskAddress
());
Result
<
SupervisionLoadTruckInfoDto
>
supervisionLoadTruckInfoDto
=
OpenClient
.
doAction
(
config
,
truckAction
);
}
if
(!
supervisionLoadTruckInfoDto
.
succeed
())
{
//接口调用失败
return
null
;
}
SupervisionLoadTruckInfoDto
supervisionLoadTruckInfo
=
supervisionLoadTruckInfoDto
.
getData
();
if
(
Objects
.
nonNull
(
supervisionLoadTruckInfo
))
{
if
(
supervisionLoadTruckInfo
.
getLoadStatus
())
{
return
new
Object
[]{
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
;
}
}
return
null
;
SupervisionLoadInfoDto
supervisionLoadInfo
=
supervisionLoadInfoDto
.
getData
();
//监装信息
if
(
Objects
.
isNull
(
supervisionLoadInfo
))
{
//有监装信息
return
null
;
}
//通过运单号查询监装监卸子任务状态
SupplyChainSupervisionLoadTruckAction
truckAction
=
new
SupplyChainSupervisionLoadTruckAction
();
truckAction
.
setChildNo
(
childNo
);
truckAction
.
setType
(
OrderChildEnum
.
SuperviseTypeEnum
.
SUPERVISE_LOAD
.
getCode
());
Result
<
SupervisionLoadTruckInfoDto
>
supervisionLoadTruckInfoDto
=
OpenClient
.
doAction
(
config
,
truckAction
);
if
(!
supervisionLoadTruckInfoDto
.
succeed
())
{
//接口调用失败
return
null
;
}
SupervisionLoadTruckInfoDto
supervisionLoadTruckInfo
=
supervisionLoadTruckInfoDto
.
getData
();
if
(
Objects
.
isNull
(
supervisionLoadTruckInfo
)
||
!
supervisionLoadTruckInfo
.
getLoadStatus
())
{
return
null
;
}
return
new
SuperviseInfo
(
supervisionLoadInfo
.
getTaskContracts
(),
supervisionLoadInfo
.
getTaskMobile
(),
supervisionLoadInfo
.
getTaskAddress
());
}
}
//查看运单车辆是否开启了中交兴路
//查看运单车辆是否开启了中交兴路
...
@@ -3248,8 +3287,8 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -3248,8 +3287,8 @@ public class OrderChildServiceImpl implements OrderChildService {
truckLatitudeY
=
truckTraceDTO
.
getLocation
()[
1
];
truckLatitudeY
=
truckTraceDTO
.
getLocation
()[
1
];
}
}
if
(
truckLongitudeX
==
null
||
truckLatitudeY
==
null
)
{
if
(
truckLongitudeX
==
null
||
truckLatitudeY
==
null
)
{
log
.
info
(
"运单号:{},卡车:{},卡车经纬度:{}"
,
childNo
,
truckNo
,
truckTraceDTO
);
BigDecimal
[]
location
=
truckTraceService
.
getCurrentPosition
(
truckNo
,
driverUserNo
);
BigDecimal
[]
location
=
truckTraceService
.
getCurrentPosition
(
truckNo
,
driverUserNo
);
log
.
info
(
"运单号:{},卡车:{},卡车经纬度:{}"
,
childNo
,
truckNo
,
location
);
if
(
location
!=
null
&&
location
.
length
>
2
)
{
if
(
location
!=
null
&&
location
.
length
>
2
)
{
truckLongitudeX
=
location
[
0
];
truckLongitudeX
=
location
[
0
];
truckLatitudeY
=
location
[
1
];
truckLatitudeY
=
location
[
1
];
...
@@ -3262,54 +3301,55 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -3262,54 +3301,55 @@ public class OrderChildServiceImpl implements OrderChildService {
BigDecimal
siteLatitudeY
=
orderGoods
.
getSendLatitude
();
BigDecimal
siteLatitudeY
=
orderGoods
.
getSendLatitude
();
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{}"
,
childNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
);
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
))
{
Integer
distance
=
getGdRoute
(
truckNo
,
orderGoods
.
getSendLongitude
(),
orderGoods
.
getSendLatitude
(),
siteLongitudeX
,
continue
;
siteLatitudeY
);
}
if
(
distance
==
null
)
{
Integer
distance
=
getGdRoute
(
truckNo
,
orderGoods
.
getSendLongitude
(),
orderGoods
.
getSendLatitude
(),
siteLongitudeX
,
log
.
info
(
"高德获取卡车与货源地位置距离失败,orderGoodsNo:{},orderChildNo:{},truckNo:{}"
,
orderGoodsNo
,
childNo
,
truckNo
);
siteLatitudeY
);
continue
;
if
(
distance
==
null
)
{
}
log
.
info
(
"高德获取卡车与货源地位置距离失败,orderGoodsNo:{},orderChildNo:{},truckNo:{}"
,
orderGoodsNo
,
childNo
,
truckNo
);
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{}"
,
orderGoodsNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
continue
;
// 超出货源地+通知触发距离
}
if
(
distance
>
driverNoticeConfigVO
.
getNoticeTriggerDistanceMeter
())
{
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{}"
,
orderGoodsNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
if
(
Objects
.
equals
(
child
.
getExitNoticeStatus
(),
OrderChildEnum
.
ExitNoticeStatus
.
NOT_NOTIFIED
.
getCode
())
// 超出货源地+通知触发距离
)
{
if
(
distance
>
driverNoticeConfigVO
.
getNoticeTriggerDistanceMeter
())
{
// todo :jiangwujie 增加短信次数限制
if
(
Objects
.
equals
(
child
.
getExitNoticeStatus
(),
OrderChildEnum
.
ExitNoticeStatus
.
NOT_NOTIFIED
.
getCode
())
//超出货源地x公里范围了,且通知状态为未通知
)
{
// 到达货源地
// todo :jiangwujie 增加短信次数限制
if
(
Objects
.
equals
(
child
.
getStatus
(),
OrderChildEnum
.
Status
.
ARRIVE_SEND
.
getCode
()))
{
//超出货源地x公里范围了,且通知状态为未通知
log
.
info
(
"{}超出货源地x公里范围了,运单{}为到达货源地状态,发送短信"
,
truckNo
,
childNo
);
// 到达货源地
sendLoadSms
(
child
.
getDriverMobile
(),
child
.
getTruckNo
(),
child
.
getChildNo
());
if
(
Objects
.
equals
(
child
.
getStatus
(),
OrderChildEnum
.
Status
.
ARRIVE_SEND
.
getCode
()))
{
}
log
.
info
(
"{}超出货源地x公里范围了,运单{}为到达货源地状态,发送短信"
,
truckNo
,
childNo
);
// 已装货
sendLoadSms
(
child
.
getDriverMobile
(),
child
.
getTruckNo
(),
child
.
getChildNo
());
if
(
Objects
.
equals
(
child
.
getStatus
(),
OrderChildEnum
.
Status
.
LOAD
.
getCode
()))
{
}
Object
[]
superviseInfo
=
getSuperviseInfo
(
child
.
getOrderNo
(),
child
.
getChildNo
());
// 已装货
log
.
info
(
"运单号:{},卡车:{},监装信息{}"
,
childNo
,
truckNo
,
superviseInfo
);
if
(
Objects
.
equals
(
child
.
getStatus
(),
OrderChildEnum
.
Status
.
LOAD
.
getCode
()))
{
if
(
superviseInfo
!=
null
)
{
SuperviseInfo
superviseInfo
=
getSuperviseInfoWithSubStatus
(
child
.
getOrderNo
(),
child
.
getChildNo
());
log
.
info
(
"{}超出货源地x公里范围了,运单{}为装货成功状态,发送短信"
,
truckNo
,
childNo
);
log
.
info
(
"运单号:{},卡车:{},监装信息{}"
,
childNo
,
truckNo
,
superviseInfo
);
sendSupervisionSms
(
child
.
getDriverMobile
(),
child
.
getTruckNo
(),
child
.
getChildNo
(),
(
String
)
superviseInfo
[
2
]);
if
(
superviseInfo
!=
null
)
{
}
log
.
info
(
"{}超出货源地x公里范围了,运单{}为装货成功状态,发送短信"
,
truckNo
,
childNo
);
sendSupervisionSms
(
child
.
getDriverMobile
(),
child
.
getTruckNo
(),
child
.
getChildNo
(),
superviseInfo
.
getTaskAddress
());
}
}
// 修改 通知状态 为已通知
child
.
setExitNoticeStatus
(
OrderChildEnum
.
ExitNoticeStatus
.
NOTIFIED
.
getCode
());
child
.
setEnterExitSendStatus
(
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_OUT
.
getCode
());
orderChildDao
.
updateEntityByKey
(
child
);
}
}
}
else
if
(
distance
<=
1000
)
{
// 修改 通知状态 为已通知
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{} 距离小于1km"
,
orderGoodsNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
child
.
setExitNoticeStatus
(
OrderChildEnum
.
ExitNoticeStatus
.
NOTIFIED
.
getCode
());
// 这里的1km的距离是产品需求写死的,不使用通知配置范围
child
.
setEnterExitSendStatus
(
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_OUT
.
getCode
());
// 未超出货源地+通知触发距离
orderChildDao
.
updateEntityByKey
(
child
);
// 驶入货源地+通知触发距离范围内了
}
if
(
Objects
.
equals
(
child
.
getEnterExitSendStatus
(),
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_OUT
.
getCode
())
}
else
if
(
distance
<=
1000
)
{
log
.
info
(
"运单号:{},卡车:{},status:{},站点经度:{},站点纬度:{},卡车经度:{},卡车纬度:{},距离:{} 距离小于1km"
,
childNo
,
truckNo
,
child
.
getStatus
(),
siteLongitudeX
,
siteLatitudeY
,
truckLongitudeX
,
truckLatitudeY
,
distance
);
// 这里的1km的距离是产品需求写死的,不使用通知配置范围
// 未超出货源地+通知触发距离
// 驶入货源地+通知触发距离范围内了
if
(
Objects
.
equals
(
child
.
getEnterExitSendStatus
(),
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_OUT
.
getCode
())
||
Objects
.
equals
(
child
.
getEnterExitSendStatus
(),
OrderChildEnum
.
EnterExitSendStatus
.
INIT
.
getCode
())
||
Objects
.
equals
(
child
.
getEnterExitSendStatus
(),
OrderChildEnum
.
EnterExitSendStatus
.
INIT
.
getCode
())
)
{
)
{
//驶入货源地x公里范围了,且通知状态为已通知
//驶入货源地x公里范围了,且通知状态为已通知
// 修改 通知状态 为未通知
// 修改 通知状态 为未通知
child
.
setExitNoticeStatus
(
OrderChildEnum
.
ExitNoticeStatus
.
NOT_NOTIFIED
.
getCode
());
child
.
setExitNoticeStatus
(
OrderChildEnum
.
ExitNoticeStatus
.
NOT_NOTIFIED
.
getCode
());
// 状态改为驶入货源地
// 状态改为驶入货源地
child
.
setEnterExitSendStatus
(
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_IN
.
getCode
());
child
.
setEnterExitSendStatus
(
OrderChildEnum
.
EnterExitSendStatus
.
DRIVE_IN
.
getCode
());
orderChildDao
.
updateEntityByKey
(
child
);
orderChildDao
.
updateEntityByKey
(
child
);
}
}
}
}
}
}
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论