Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
36b3f719
提交
36b3f719
authored
5月 11, 2024
作者:
刘海泉
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交通过位置自动更改运单状态的逻辑
上级
0f1937be
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
74 行增加
和
14 行删除
+74
-14
OrderChildServiceImpl.java
...m/clx/performance/service/impl/OrderChildServiceImpl.java
+26
-14
DriverTraceStruct.java
...a/com/clx/performance/struct/trace/DriverTraceStruct.java
+25
-0
TruckTraceStruct.java
...va/com/clx/performance/struct/trace/TruckTraceStruct.java
+23
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/service/impl/OrderChildServiceImpl.java
浏览文件 @
36b3f719
...
@@ -579,19 +579,11 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -579,19 +579,11 @@ public class OrderChildServiceImpl implements OrderChildService {
PerformanceResultEnum
.
DATA_NOT_FIND
);
PerformanceResultEnum
.
DATA_NOT_FIND
);
OrderGoods
orderGoods
=
orderGoodsDao
.
getByOrderGoodsNo
(
orderChild
.
getOrderGoodsNo
()).
orElseThrow
(
OrderGoods
orderGoods
=
orderGoodsDao
.
getByOrderGoodsNo
(
orderChild
.
getOrderGoodsNo
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
PerformanceResultEnum
.
DATA_NOT_FIND
);
double
longitude
;
double
latitude
;
//首先获取中交的车来那个经纬度信息,不存在则使用app传过来的经纬度
double
[]
currentTruckPosition
=
getCurrentTruckPosition
(
orderChild
.
getTruckNo
(),
param
);
BigDecimal
[]
currentTruckPosition
=
truckTraceService
.
getCurrentTruckPosition
(
orderChild
.
getTruckNo
());
if
(
ArrayUtils
.
isNotEmpty
(
currentTruckPosition
)){
longitude
=
currentTruckPosition
[
0
].
doubleValue
();
latitude
=
currentTruckPosition
[
1
].
doubleValue
();
}
else
{
longitude
=
param
.
getLongitude
().
doubleValue
();
latitude
=
param
.
getLatitude
().
doubleValue
();
}
double
distance
=
GpsUtil
.
distance
(
orderGoods
.
getSendLongitude
().
doubleValue
(),
double
distance
=
GpsUtil
.
distance
(
orderGoods
.
getSendLongitude
().
doubleValue
(),
orderGoods
.
getSendLatitude
().
doubleValue
(),
longitude
,
latitude
)
/
1000
;
orderGoods
.
getSendLatitude
().
doubleValue
(),
currentTruckPosition
[
0
],
currentTruckPosition
[
1
]
)
/
1000
;
if
(
distance
>
orderInfo
.
getSendDriverArriveRange
().
doubleValue
())
{
if
(
distance
>
orderInfo
.
getSendDriverArriveRange
().
doubleValue
())
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
ORDER_CHILD_ARRIVE_SEND_ADDRESS_DISTANCE_ERROR
);
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
ORDER_CHILD_ARRIVE_SEND_ADDRESS_DISTANCE_ERROR
);
}
}
...
@@ -607,6 +599,22 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -607,6 +599,22 @@ public class OrderChildServiceImpl implements OrderChildService {
orderChildMqService
.
orderChildArriveSendAddress
(
orderChild
.
getChildNo
());
orderChildMqService
.
orderChildArriveSendAddress
(
orderChild
.
getChildNo
());
}
}
//首先获取中交的车来那个经纬度信息,不存在则使用app传过来的经纬度
private
double
[]
getCurrentTruckPosition
(
String
truckNo
,
PositionParam
param
)
{
double
longitude
;
double
latitude
;
//首先获取中交的车来那个经纬度信息,不存在则使用app传过来的经纬度
BigDecimal
[]
currentTruckPosition
=
truckTraceService
.
getCurrentTruckPosition
(
truckNo
);
if
(
ArrayUtils
.
isNotEmpty
(
currentTruckPosition
)){
longitude
=
currentTruckPosition
[
0
].
doubleValue
();
latitude
=
currentTruckPosition
[
1
].
doubleValue
();
}
else
{
longitude
=
param
.
getLongitude
().
doubleValue
();
latitude
=
param
.
getLatitude
().
doubleValue
();
}
return
new
double
[]{
longitude
,
latitude
};
}
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -669,9 +677,13 @@ public class OrderChildServiceImpl implements OrderChildService {
...
@@ -669,9 +677,13 @@ public class OrderChildServiceImpl implements OrderChildService {
PerformanceResultEnum
.
DATA_NOT_FIND
);
PerformanceResultEnum
.
DATA_NOT_FIND
);
OrderGoods
orderGoods
=
orderGoodsDao
.
getByOrderGoodsNo
(
orderChild
.
getOrderGoodsNo
()).
orElseThrow
(
OrderGoods
orderGoods
=
orderGoodsDao
.
getByOrderGoodsNo
(
orderChild
.
getOrderGoodsNo
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
PerformanceResultEnum
.
DATA_NOT_FIND
);
double
[]
currentTruckPosition
=
getCurrentTruckPosition
(
orderChild
.
getTruckNo
(),
param
);
double
distance
=
GpsUtil
.
distance
(
orderGoods
.
getReceiveLongitude
().
doubleValue
(),
double
distance
=
GpsUtil
.
distance
(
orderGoods
.
getReceiveLongitude
().
doubleValue
(),
orderGoods
.
getReceiveLatitude
().
doubleValue
(),
param
.
getLongitude
().
doubleValue
()
,
orderGoods
.
getReceiveLatitude
().
doubleValue
(),
currentTruckPosition
[
0
]
,
param
.
getLatitude
().
doubleValue
()
)
/
1000
;
currentTruckPosition
[
1
]
)
/
1000
;
if
(
distance
>
orderInfo
.
getReveiveDriverArriveRange
().
doubleValue
())
{
if
(
distance
>
orderInfo
.
getReveiveDriverArriveRange
().
doubleValue
())
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
ORDER_CHILD_ARRIVE_RECEIVE_ADDRESS_DISTANCE_ERROR
);
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
ORDER_CHILD_ARRIVE_RECEIVE_ADDRESS_DISTANCE_ERROR
);
}
}
...
...
performance-web/src/main/java/com/clx/performance/struct/trace/DriverTraceStruct.java
0 → 100644
浏览文件 @
36b3f719
package
com
.
clx
.
performance
.
struct
.
trace
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.esplus.model.DriverTraceESPlus
;
import
com.clx.performance.vo.pc.trace.DriverTraceVO
;
import
com.msl.common.utils.DateStructUtil
;
import
com.msl.common.utils.DateUtils
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
java.math.BigDecimal
;
import
java.util.List
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
DateStructUtil
.
class
,
imports
=
{
DateUtils
.
class
,
BigDecimal
.
class
})
public
interface
DriverTraceStruct
{
@Mapping
(
target
=
"longitude"
,
expression
=
"java(item.getLocation()[0])"
)
@Mapping
(
target
=
"latitude"
,
expression
=
"java(item.getLocation()[1])"
)
@Mapping
(
target
=
"gpsTime"
,
source
=
"positionTime"
)
DriverTraceVO
convert
(
DriverTraceESPlus
item
);
List
<
DriverTraceVO
>
convert
(
List
<
DriverTraceESPlus
>
list
);
Page
<
DriverTraceVO
>
convertPage
(
IPage
<
DriverTraceESPlus
>
page
);
}
performance-web/src/main/java/com/clx/performance/struct/trace/TruckTraceStruct.java
0 → 100644
浏览文件 @
36b3f719
package
com
.
clx
.
performance
.
struct
.
trace
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.esplus.model.TruckTraceESPlus
;
import
com.clx.performance.vo.pc.trace.DriverTruckTraceVO
;
import
com.msl.common.utils.DateStructUtil
;
import
com.msl.common.utils.DateUtils
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
java.util.List
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
DateStructUtil
.
class
,
imports
=
{
DateUtils
.
class
})
public
interface
TruckTraceStruct
{
@Mapping
(
target
=
"longitude"
,
expression
=
"java(item.getLocation()[0])"
)
@Mapping
(
target
=
"latitude"
,
expression
=
"java(item.getLocation()[1])"
)
DriverTruckTraceVO
convert
(
TruckTraceESPlus
item
);
List
<
DriverTruckTraceVO
>
convert
(
List
<
TruckTraceESPlus
>
list
);
Page
<
DriverTruckTraceVO
>
convertPage
(
IPage
<
TruckTraceESPlus
>
page
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论