Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
travel-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cloud
travel-cloud
Commits
bd94a9c0
提交
bd94a9c0
authored
11月 20, 2024
作者:
hzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
150165cc
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
215 行增加
和
2 行删除
+215
-2
IVehiclesService.java
.../java/org/dromara/common/ys/service/IVehiclesService.java
+75
-2
VehiclesServiceImpl.java
...g/dromara/common/ys/service/impl/VehiclesServiceImpl.java
+140
-0
没有找到文件。
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/IVehiclesService.java
浏览文件 @
bd94a9c0
package
org
.
dromara
.
common
.
ys
.
service
;
import
org.dromara.common.ys.model.req.vehicles.EstimateJsycPriceModel
;
import
org.dromara.common.ys.model.req.vehicles.EstimateYyycPriceModel
;
import
org.dromara.common.ys.common.PageInfo
;
import
org.dromara.common.ys.model.req.vehicles.*
;
import
java.util.List
;
/**
* @author wenhe
...
...
@@ -27,4 +29,75 @@ public interface IVehiclesService {
*/
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateYyycPriceModel
estimateYyycPrice
(
String
userId
,
EstimateYyycPriceModel
model
);
/**
* 订单详情
*
* @param userId 用户id
* @param model 订单详情查询参数
* @return 订单详情
*/
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
OrderDetailModel
detail
(
String
userId
,
OrderDetailModel
model
);
/**
* 订单列表
*
* @param userId 用户id
* @param model 订单列表查询参数
* @return 订单列表
*/
PageInfo
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
OrderListModel
>
list
(
String
userId
,
OrderListModel
model
);
/**
* 即时用车下单
*
* @param userId 用户id
* @param model 即时用车下单参数
* @return 订单id
*/
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
OrderBookJsycModel
bookJsyc
(
String
userId
,
OrderBookJsycModel
model
);
/**
* 预约用车下单
*
* @param userId 用户id
* @param model 预约用车下单参数
* @return 订单id
*/
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
OrderBookYyycModel
bookYyyc
(
String
userId
,
OrderBookYyycModel
model
);
/**
* 获取司机位置
*
* @param userId 用户id
* @param model 获取司机位置参数
* @return 司机位置
*/
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
DriverLocationModel
getDriverLocation
(
String
userId
,
DriverLocationModel
model
);
/**
* 获取罚金
*
* @param userId 用户id
* @param model 获取罚金参数
* @return 罚金
*/
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
CancelFeeModel
getCancelFee
(
String
userId
,
CancelFeeModel
model
);
/**
* 取消订单
*
* @param userId 用户id
* @param model 取消订单参数
* @return 结果
*/
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
OrderCancelModel
cancel
(
String
userId
,
OrderCancelModel
model
);
/**
* 获取取消原因列表
*
* @param userId 用户id
* @return 取消原因列表
*/
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
OrderGetQxyyModel
>
getCancelReasonList
(
String
userId
);
}
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/impl/VehiclesServiceImpl.java
浏览文件 @
bd94a9c0
...
...
@@ -5,13 +5,18 @@ import com.alibaba.fastjson.JSON;
import
org.dromara.common.ys.Api
;
import
org.dromara.common.ys.common.ApiHttpResponse
;
import
org.dromara.common.ys.common.Code
;
import
org.dromara.common.ys.common.PageInfo
;
import
org.dromara.common.ys.enums.DomainEnum
;
import
org.dromara.common.ys.enums.vehicles.VehiclesApiEnum
;
import
org.dromara.common.ys.model.req.vehicles.EstimateJsycPriceModel
;
import
org.dromara.common.ys.model.req.vehicles.EstimateYyycPriceModel
;
import
org.dromara.common.ys.model.res.vehicles.*
;
import
org.dromara.common.ys.service.IVehiclesService
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.List
;
/**
* @author hzh
* @date 2024-10-22
...
...
@@ -50,4 +55,139 @@ public class VehiclesServiceImpl implements IVehiclesService {
}
return
JSON
.
parseObject
(
res
.
getData
(),
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateJsycPriceModel
.
class
);
}
@Override
public
OrderDetailModel
detail
(
String
userId
,
org
.
dromara
.
common
.
ys
.
model
.
req
.
vehicles
.
OrderDetailModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
QUERY_DETAIL
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
OrderDetailModel
.
class
);
}
@Override
public
PageInfo
<
OrderListModel
>
list
(
String
userId
,
org
.
dromara
.
common
.
ys
.
model
.
req
.
vehicles
.
OrderListModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
QUERY_LIST
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
PageInfo
pageInfo
=
JSON
.
parseObject
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"orderList"
),
PageInfo
.
class
);
return
PageInfo
.
builder
().
build
()
.
setCount
(
pageInfo
.
getCount
())
.
setMap
(
pageInfo
.
getMap
())
.
setPageNum
(
pageInfo
.
getPageNum
())
.
setPages
(
pageInfo
.
getPages
())
.
setTotal
(
pageInfo
.
getTotal
())
.
setList
(
JSON
.
parseArray
(
JSON
.
toJSONString
(
pageInfo
.
getList
()),
OrderListModel
.
class
));
}
@Override
public
OrderBookJsycModel
bookJsyc
(
String
userId
,
org
.
dromara
.
common
.
ys
.
model
.
req
.
vehicles
.
OrderBookJsycModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
BOOK_JSYC
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
OrderBookJsycModel
.
class
);
}
@Override
public
OrderBookYyycModel
bookYyyc
(
String
userId
,
org
.
dromara
.
common
.
ys
.
model
.
req
.
vehicles
.
OrderBookYyycModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
BOOK_YYYC
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
OrderBookYyycModel
.
class
);
}
@Override
public
DriverLocationModel
getDriverLocation
(
String
userId
,
org
.
dromara
.
common
.
ys
.
model
.
req
.
vehicles
.
DriverLocationModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
GET_DRIVER_LOCATION
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
DriverLocationModel
.
class
);
}
@Override
public
CancelFeeModel
getCancelFee
(
String
userId
,
org
.
dromara
.
common
.
ys
.
model
.
req
.
vehicles
.
CancelFeeModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
GET_CANCEL_FEE
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
CancelFeeModel
.
class
);
}
@Override
public
OrderCancelModel
cancel
(
String
userId
,
org
.
dromara
.
common
.
ys
.
model
.
req
.
vehicles
.
OrderCancelModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
CANCEL
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
OrderCancelModel
.
class
);
}
@Override
public
List
<
OrderGetQxyyModel
>
getCancelReasonList
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
CANCEL
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
new
HashMap
<>(
8
))
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"qxyyList"
),
OrderGetQxyyModel
.
class
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论