Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
travel-cloud
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cloud
travel-cloud
Commits
43674492
提交
43674492
authored
11月 14, 2024
作者:
hzh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码优化
上级
a47b3873
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
173 行增加
和
460 行删除
+173
-460
pom.xml
ruoyi-api/pom.xml
+1
-0
pom.xml
ruoyi-api/ruoyi-api-bom/pom.xml
+7
-0
pom.xml
ruoyi-api/ruoyi-api-server/pom.xml
+28
-0
RemoteServerService.java
...main/java/org/dromara/server/api/RemoteServerService.java
+29
-0
RemoteUser.java
...c/main/java/org/dromara/server/api/domain/RemoteUser.java
+45
-0
AirPortService.java
...in/java/org/dromara/common/ys/service/AirPortService.java
+0
-120
CommonResourceService.java
.../org/dromara/common/ys/service/CommonResourceService.java
+0
-146
InsuranceService.java
.../java/org/dromara/common/ys/service/InsuranceService.java
+0
-36
OrgService.java
...c/main/java/org/dromara/common/ys/service/OrgService.java
+0
-33
TrainService.java
...main/java/org/dromara/common/ys/service/TrainService.java
+0
-55
VehiclesService.java
...n/java/org/dromara/common/ys/service/VehiclesService.java
+0
-49
org.springframework.boot.autoconfigure.AutoConfiguration.imports
...ingframework.boot.autoconfigure.AutoConfiguration.imports
+0
-0
pom.xml
ruoyi-modules/ruoyi-server/pom.xml
+5
-0
AirportController.java
.../dromara/server/controller/airport/AirportController.java
+13
-9
TrainController.java
.../org/dromara/server/controller/train/TrainController.java
+8
-5
VehiclesController.java
...dromara/server/controller/vehicle/VehiclesController.java
+5
-3
RemoteServerServiceImpl.java
...ava/org/dromara/server/dubbo/RemoteServerServiceImpl.java
+28
-0
application.properties
...ual/ruoyi-nacos/src/main/resources/application.properties
+4
-4
没有找到文件。
ruoyi-api/pom.xml
浏览文件 @
43674492
...
...
@@ -13,6 +13,7 @@
<module>
ruoyi-api-system
</module>
<module>
ruoyi-api-resource
</module>
<module>
ruoyi-api-workflow
</module>
<module>
ruoyi-api-server
</module>
</modules>
<artifactId>
ruoyi-api
</artifactId>
...
...
ruoyi-api/ruoyi-api-bom/pom.xml
浏览文件 @
43674492
...
...
@@ -41,6 +41,13 @@
<version>
${revision}
</version>
</dependency>
<!-- 服务接口 -->
<dependency>
<groupId>
org.dromara
</groupId>
<artifactId>
ruoyi-api-server
</artifactId>
<version>
${revision}
</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
ruoyi-api/ruoyi-api-server/pom.xml
0 → 100644
浏览文件 @
43674492
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<parent>
<groupId>
org.dromara
</groupId>
<artifactId>
ruoyi-api
</artifactId>
<version>
${revision}
</version>
</parent>
<modelVersion>
4.0.0
</modelVersion>
<artifactId>
ruoyi-api-server
</artifactId>
<description>
ruoyi-api-server 服务接口模块
</description>
<dependencies>
<!-- RuoYi Common Core-->
<dependency>
<groupId>
org.dromara
</groupId>
<artifactId>
ruoyi-common-core
</artifactId>
</dependency>
</dependencies>
</project>
ruoyi-api/ruoyi-api-server/src/main/java/org/dromara/server/api/RemoteServerService.java
0 → 100644
浏览文件 @
43674492
package
org
.
dromara
.
server
.
api
;
import
org.dromara.server.api.domain.RemoteUser
;
/**
* 云上用户相关操作
*
* @author wenhe
*/
public
interface
RemoteServerService
{
/**
* 保存或更新用户
*
* @param user 用户
* @return true 保存或更新成功 false 失败
*/
boolean
saveOrUpdateUser
(
RemoteUser
user
);
/**
* 根据手机号查询用户
*
* @param tenantId 租户id
* @param phone 用户手机号
* @return 用户信息
*/
RemoteUser
getUserByPhone
(
String
tenantId
,
String
phone
);
}
ruoyi-api/ruoyi-api-server/src/main/java/org/dromara/server/api/domain/RemoteUser.java
0 → 100644
浏览文件 @
43674492
package
org
.
dromara
.
server
.
api
.
domain
;
import
lombok.Data
;
import
java.io.Serial
;
import
java.io.Serializable
;
/**
* @author hzh
* @date 2024-11-14
* @desc 新增用户
**/
@Data
public
class
RemoteUser
implements
Serializable
{
@Serial
private
static
final
long
serialVersionUID
=
1L
;
/**
* 租户编码
*/
private
String
tenantId
;
/**
* 文件名称
*/
private
String
userName
;
/**
* 系统用户id
*/
private
Long
systemUserId
;
/**
* 身份证
*/
private
String
idCard
;
/**
* 手机号
*/
private
String
phoneNumber
;
}
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/AirPortService.java
deleted
100644 → 0
浏览文件 @
a47b3873
package
org
.
dromara
.
common
.
ys
.
service
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.wenhe.base.base.RequestMethodEnum
;
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.airport.AirportApiEnum
;
import
org.dromara.common.ys.model.req.airport.*
;
import
org.dromara.common.ys.model.req.airport.bookOrder.BookOrderModel
;
import
java.util.List
;
/**
* @author hzh
* @date 2024-10-21
* @desc 机票相关接口
**/
public
class
AirPortService
{
public
static
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryFlightModel
queryFlight
(
String
userId
,
QueryFlightModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
AirportApiEnum
.
QUERY_FLIGHT
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryFlightModel
.
class
);
}
public
static
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryFlightMinPriceModel
queryFlightMinPrice
(
String
userId
,
QueryFlightMinPriceModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
AirportApiEnum
.
QUERY_FLIGHT_MIN_PRICE
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryFlightMinPriceModel
.
class
);
}
public
static
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryFlightStopModel
queryFlightStop
(
String
userId
,
QueryFlightStopModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
PROD
.
getDomain
(),
AirportApiEnum
.
QUERY_FLIGHT_STOP
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryFlightStopModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
BookOrderModel
>
bookOrder
(
String
userId
,
BookOrderModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
AirportApiEnum
.
BOOK_ORDER
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"orderList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
BookOrderModel
.
class
);
}
public
static
PageInfo
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
OrderListModel
>
orderList
(
String
userId
,
OrderListModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
AirportApiEnum
.
QUERY_ORDER_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
()),
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
OrderListModel
.
class
));
}
public
static
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryTkOrderModel
detail
(
String
userId
,
QueryTkOrderModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
AirportApiEnum
.
QUERY_TK_ORDER
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
QueryTkOrderModel
.
class
);
}
}
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/CommonResourceService.java
deleted
100644 → 0
浏览文件 @
a47b3873
package
org
.
dromara
.
common
.
ys
.
service
;
import
cn.hutool.core.text.CharSequenceUtil
;
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.enums.DomainEnum
;
import
org.dromara.common.ys.enums.resource.CommonResourceApiEnum
;
import
org.dromara.common.ys.model.req.commonResource.*
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author hzh
* @date 2024-10-18
* @desc 公共资源
**/
public
class
CommonResourceService
{
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
CountryModel
>
getCountryList
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
CommonResourceApiEnum
.
COUNTRY_DATA
.
getUrl
(),
userId
,
JSON
.
toJSONString
(
new
CountryModel
())
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"countryDataList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
CountryModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
ProvinceModel
>
getProvinceList
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
CommonResourceApiEnum
.
PROVINCE_DATA
.
getUrl
(),
userId
,
JSON
.
toJSONString
(
new
ProvinceModel
())
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"provinceDataList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
ProvinceModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
CityModel
>
getCityList
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
CommonResourceApiEnum
.
CITY_DATA
.
getUrl
(),
userId
,
JSON
.
toJSONString
(
new
CityModel
())
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
if
(
res
.
getData
()
==
null
)
{
return
new
ArrayList
<>();
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"cityDataList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
CityModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
AirportModel
>
getAirportList
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
CommonResourceApiEnum
.
AIRPORT_DATA
.
getUrl
(),
userId
,
JSON
.
toJSONString
(
new
AirportModel
())
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
if
(
res
.
getData
()
==
null
)
{
return
new
ArrayList
<>();
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"airportDataList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
AirportModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
StationModel
>
getStationList
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
CommonResourceApiEnum
.
STATION_DATA
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
new
StationModel
())
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
if
(
res
.
getData
()
==
null
)
{
return
new
ArrayList
<>();
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"stationDataList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
StationModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
TrainBaseModel
>
getTrainBaseList
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
CommonResourceApiEnum
.
TRAIN_BASE_DATA
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
new
TrainBaseModel
())
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
if
(
res
.
getData
()
==
null
)
{
return
new
ArrayList
<>();
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"trainBaseDataList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
TrainBaseModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
DictModel
>
getDictList
(
String
userId
,
String
parType
)
{
DictModel
model
=
new
DictModel
().
setParType
(
parType
);
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
CommonResourceApiEnum
.
DICT_DATA
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
if
(
res
.
getData
()
==
null
)
{
return
new
ArrayList
<>();
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"baseDataList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
comomResource
.
DictModel
.
class
);
}
}
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/InsuranceService.java
deleted
100644 → 0
浏览文件 @
a47b3873
package
org
.
dromara
.
common
.
ys
.
service
;
import
cn.hutool.core.text.CharSequenceUtil
;
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.enums.DomainEnum
;
import
org.dromara.common.ys.enums.insurance.InsuranceApiEnum
;
import
org.dromara.common.ys.model.req.insurance.BxcpModel
;
import
java.util.List
;
/**
* @author hzh
* @date 2024-10-24
**/
public
class
InsuranceService
{
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
insurance
.
BxcpModel
>
list
(
String
userId
,
BxcpModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
InsuranceApiEnum
.
GET_BX_CP
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"cpList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
insurance
.
BxcpModel
.
class
);
}
}
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/OrgService.java
deleted
100644 → 0
浏览文件 @
a47b3873
package
org
.
dromara
.
common
.
ys
.
service
;
import
cn.hutool.core.text.CharSequenceUtil
;
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.enums.DomainEnum
;
import
org.dromara.common.ys.enums.org.OrgApiEnum
;
import
org.dromara.common.ys.model.req.org.EditEmployeeModel
;
/**
* @author hzh
* @date 2024-10-23
**/
public
class
OrgService
{
public
static
boolean
saveOrUpdateEmployee
(
String
userId
,
EditEmployeeModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
OrgApiEnum
.
EDIT_EMPLOYEE
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
true
;
}
}
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/TrainService.java
deleted
100644 → 0
浏览文件 @
a47b3873
package
org
.
dromara
.
common
.
ys
.
service
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.util.StrUtil
;
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.enums.DomainEnum
;
import
org.dromara.common.ys.enums.train.TrainApiEnum
;
import
org.dromara.common.ys.model.req.train.AllStationModel
;
import
org.dromara.common.ys.model.req.train.QueryModel
;
import
java.util.Collections
;
import
java.util.List
;
/**
* @author hzh
* @date 2024-10-22
**/
public
class
TrainService
{
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
train
.
QueryModel
>
queryModel
(
String
userId
,
QueryModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
TrainApiEnum
.
QUERY
.
getUrl
(),
userId
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getErrMsg
());
}
if
(
StrUtil
.
isEmpty
(
res
.
getData
()))
{
return
Collections
.
emptyList
();
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"trainList"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
train
.
QueryModel
.
class
);
}
public
static
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
train
.
AllStationModel
>
getAllStation
(
String
userId
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
TrainApiEnum
.
FIND_ALL_STATION
.
getUrl
(),
userId
,
JSON
.
toJSONString
(
new
AllStationModel
())
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseArray
(
JSON
.
parseObject
(
res
.
getData
()).
getString
(
"list"
),
org
.
dromara
.
common
.
ys
.
model
.
res
.
train
.
AllStationModel
.
class
);
}
}
ruoyi-common/ruoyi-common-ys/src/main/java/org/dromara/common/ys/service/VehiclesService.java
deleted
100644 → 0
浏览文件 @
a47b3873
package
org
.
dromara
.
common
.
ys
.
service
;
import
cn.hutool.core.text.CharSequenceUtil
;
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.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
;
/**
* @author hzh
* @date 2024-10-22
**/
public
class
VehiclesService
{
public
static
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateYyycPriceModel
estimateYyycPrice
(
String
userId
,
EstimateYyycPriceModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
ESTIMATE_YYYC_PRICE
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateYyycPriceModel
.
class
);
}
public
static
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateJsycPriceModel
estimateJsycPrice
(
String
userId
,
EstimateJsycPriceModel
model
)
{
ApiHttpResponse
res
=
Api
.
v1
(
com
.
wenhe
.
base
.
base
.
RequestMethodEnum
.
POST
,
DomainEnum
.
TEST
.
getDomain
(),
VehiclesApiEnum
.
ESTIMATE_JSYC_PRICE
.
getUrl
(),
userId
,
null
,
JSON
.
toJSONString
(
model
)
);
if
(!
CharSequenceUtil
.
equals
(
res
.
getErrCode
(),
Code
.
SUCCESS
.
getCode
()))
{
throw
new
RuntimeException
(
res
.
getTips
());
}
return
JSON
.
parseObject
(
res
.
getData
(),
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateJsycPriceModel
.
class
);
}
}
ruoyi-common/ruoyi-common-ys/src/main/resources/META-INF
.
spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
→
ruoyi-common/ruoyi-common-ys/src/main/resources/META-INF
/
spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
浏览文件 @
43674492
File moved
ruoyi-modules/ruoyi-server/pom.xml
浏览文件 @
43674492
...
...
@@ -82,6 +82,11 @@
<artifactId>
ruoyi-common-ys
</artifactId>
</dependency>
<dependency>
<groupId>
org.dromara
</groupId>
<artifactId>
ruoyi-api-server
</artifactId>
</dependency>
</dependencies>
<build>
...
...
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/controller/airport/AirportController.java
浏览文件 @
43674492
...
...
@@ -17,9 +17,9 @@ import org.dromara.common.ys.model.req.insurance.BxcpModel;
import
org.dromara.common.ys.model.res.airport.QueryFlightModel
;
import
org.dromara.common.ys.model.res.airport.QueryTkOrderModel
;
import
org.dromara.common.ys.model.res.comomResource.AirportModel
;
import
org.dromara.common.ys.service.
AirP
ortService
;
import
org.dromara.common.ys.service.CommonResourceService
;
import
org.dromara.common.ys.service.InsuranceService
;
import
org.dromara.common.ys.service.
IAirp
ortService
;
import
org.dromara.common.ys.service.
I
CommonResourceService
;
import
org.dromara.common.ys.service.I
I
nsuranceService
;
import
org.dromara.server.base.BaseController
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -42,6 +42,10 @@ public class AirportController extends BaseController {
private
static
final
String
AIRPORT
=
"airport:ys"
;
private
final
IAirportService
airPortService
;
private
final
ICommonResourceService
commonResourceService
;
private
final
IInsuranceService
insuranceService
;
/**
* 查询航班信息
*/
...
...
@@ -53,7 +57,7 @@ public class AirportController extends BaseController {
model
.
setDepartAirport
(
airPortList
.
stream
().
filter
(
item
->
StringUtils
.
equals
(
model
.
getDepartAirport
(),
item
.
getCityName
())).
map
(
AirportModel:
:
getThreeCode
).
findFirst
().
orElse
(
null
));
model
.
setTripType
(
TripType
.
PUBLIC
.
getCode
());
try
{
return
R
.
ok
(
A
irPortService
.
queryFlight
(
getUserId
(),
model
));
return
R
.
ok
(
a
irPortService
.
queryFlight
(
getUserId
(),
model
));
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
.
getMessage
());
}
...
...
@@ -62,7 +66,7 @@ public class AirportController extends BaseController {
private
List
<
AirportModel
>
getAirPortList
()
{
List
<
AirportModel
>
airPortList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
RedisUtils
.
getCacheObject
(
AIRPORT
)),
AirportModel
.
class
);
if
(
CollectionUtils
.
isEmpty
(
airPortList
))
{
airPortList
=
C
ommonResourceService
.
getAirportList
(
getUserId
());
airPortList
=
c
ommonResourceService
.
getAirportList
(
getUserId
());
RedisUtils
.
setCacheObject
(
AIRPORT
,
airPortList
,
Duration
.
ofMinutes
(
60
*
60
*
24L
));
}
return
airPortList
;
...
...
@@ -74,7 +78,7 @@ public class AirportController extends BaseController {
@GlobalTransactional
(
timeoutMills
=
600000
)
@GetMapping
(
"/insuranceList"
)
public
R
<
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
insurance
.
BxcpModel
>>
insuranceList
()
{
return
R
.
ok
(
I
nsuranceService
.
list
(
getUserId
(),
new
BxcpModel
().
setCplx
(
Cplx
.
DOMESTIC
.
getCode
())));
return
R
.
ok
(
i
nsuranceService
.
list
(
getUserId
(),
new
BxcpModel
().
setCplx
(
Cplx
.
DOMESTIC
.
getCode
())));
}
/**
...
...
@@ -106,7 +110,7 @@ public class AirportController extends BaseController {
@PostMapping
(
"/bookOrder"
)
public
R
<
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
BookOrderModel
>>
bookOrder
(
@RequestBody
BookOrderModel
model
)
{
model
.
setTripType
(
TripType
.
PUBLIC
.
getCode
());
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
BookOrderModel
>
orderList
=
A
irPortService
.
bookOrder
(
getUserId
(),
model
);
List
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
BookOrderModel
>
orderList
=
a
irPortService
.
bookOrder
(
getUserId
(),
model
);
return
R
.
ok
(
orderList
);
}
...
...
@@ -117,7 +121,7 @@ public class AirportController extends BaseController {
@GetMapping
(
"/orderList"
)
public
R
<
PageInfo
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
airport
.
OrderListModel
>>
orderList
(
OrderListModel
model
)
{
model
.
setBookNo
(
getUserId
());
return
R
.
ok
(
A
irPortService
.
orderList
(
getUserId
(),
model
));
return
R
.
ok
(
a
irPortService
.
orderList
(
getUserId
(),
model
));
}
/**
...
...
@@ -126,6 +130,6 @@ public class AirportController extends BaseController {
@GlobalTransactional
(
timeoutMills
=
600000
)
@GetMapping
(
"/orderDetail"
)
public
R
<
QueryTkOrderModel
>
orderDetail
(
org
.
dromara
.
common
.
ys
.
model
.
req
.
airport
.
QueryTkOrderModel
model
)
{
return
R
.
ok
(
A
irPortService
.
detail
(
getUserId
(),
model
));
return
R
.
ok
(
a
irPortService
.
detail
(
getUserId
(),
model
));
}
}
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/controller/train/TrainController.java
浏览文件 @
43674492
...
...
@@ -11,8 +11,8 @@ import org.dromara.common.ys.constant.TripType;
import
org.dromara.common.ys.model.req.train.QueryModel
;
import
org.dromara.common.ys.model.res.comomResource.CityModel
;
import
org.dromara.common.ys.model.res.train.AllStationModel
;
import
org.dromara.common.ys.service.CommonResourceService
;
import
org.dromara.common.ys.service.TrainService
;
import
org.dromara.common.ys.service.
I
CommonResourceService
;
import
org.dromara.common.ys.service.
I
TrainService
;
import
org.dromara.server.base.BaseController
;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -44,6 +44,9 @@ public class TrainController extends BaseController {
private
static
final
String
TRAIN
=
"train:ys"
;
private
static
final
String
CITY
=
"city:ys"
;
private
final
ITrainService
trainService
;
private
final
ICommonResourceService
commonResourceService
;
/**
* 火车站列表
*/
...
...
@@ -73,7 +76,7 @@ public class TrainController extends BaseController {
private
List
<
AllStationModel
>
getStationList
()
{
List
<
AllStationModel
>
stationList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
RedisUtils
.
getCacheObject
(
TRAIN
)),
AllStationModel
.
class
);
if
(
CollectionUtils
.
isEmpty
(
stationList
))
{
stationList
=
T
rainService
.
getAllStation
(
getUserId
());
stationList
=
t
rainService
.
getAllStation
(
getUserId
());
RedisUtils
.
setCacheObject
(
TRAIN
,
stationList
,
Duration
.
ofMinutes
(
60
*
60
*
24L
));
}
return
stationList
;
...
...
@@ -110,7 +113,7 @@ public class TrainController extends BaseController {
.
setFromStationCode
(
fromCode
)
.
setToStationCode
(
toCode
)
.
setTripType
(
TripType
.
PUBLIC
.
getCode
());
return
T
rainService
.
queryModel
(
userId
,
query
);
return
t
rainService
.
queryModel
(
userId
,
query
);
})).
collect
(
Collectors
.
toList
());
...
...
@@ -161,7 +164,7 @@ public class TrainController extends BaseController {
private
List
<
CityModel
>
getCityList
()
{
List
<
CityModel
>
cityList
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
RedisUtils
.
getCacheObject
(
CITY
)),
CityModel
.
class
);
if
(
CollectionUtils
.
isEmpty
(
cityList
))
{
cityList
=
C
ommonResourceService
.
getCityList
(
getUserId
());
cityList
=
c
ommonResourceService
.
getCityList
(
getUserId
());
RedisUtils
.
setCacheObject
(
CITY
,
cityList
,
Duration
.
ofMinutes
(
60
*
60
*
24L
));
}
return
cityList
;
...
...
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/controller/vehicle/VehiclesController.java
浏览文件 @
43674492
...
...
@@ -7,7 +7,7 @@ import org.dromara.common.core.domain.R;
import
org.dromara.common.ys.constant.TripType
;
import
org.dromara.common.ys.model.req.vehicles.EstimateJsycPriceModel
;
import
org.dromara.common.ys.model.req.vehicles.EstimateYyycPriceModel
;
import
org.dromara.common.ys.service.VehiclesService
;
import
org.dromara.common.ys.service.
I
VehiclesService
;
import
org.dromara.server.base.BaseController
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -22,6 +22,8 @@ import org.springframework.web.bind.annotation.RestController;
@RequestMapping
(
"/vehicle/ys"
)
public
class
VehiclesController
extends
BaseController
{
private
final
IVehiclesService
vehiclesService
;
/**
* 即时用车查询
*/
...
...
@@ -29,7 +31,7 @@ public class VehiclesController extends BaseController {
@RequestMapping
(
"/immediate"
)
public
R
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateJsycPriceModel
>
immediate
(
EstimateJsycPriceModel
model
)
{
model
.
setTripType
(
TripType
.
PUBLIC
.
getCode
());
return
R
.
ok
(
V
ehiclesService
.
estimateJsycPrice
(
getUserId
(),
model
));
return
R
.
ok
(
v
ehiclesService
.
estimateJsycPrice
(
getUserId
(),
model
));
}
/**
...
...
@@ -39,7 +41,7 @@ public class VehiclesController extends BaseController {
@RequestMapping
(
"/prebook"
)
public
R
<
org
.
dromara
.
common
.
ys
.
model
.
res
.
vehicles
.
EstimateYyycPriceModel
>
prebook
(
EstimateYyycPriceModel
model
)
{
model
.
setTripType
(
TripType
.
PUBLIC
.
getCode
());
return
R
.
ok
(
V
ehiclesService
.
estimateYyycPrice
(
getUserId
(),
model
));
return
R
.
ok
(
v
ehiclesService
.
estimateYyycPrice
(
getUserId
(),
model
));
}
...
...
ruoyi-modules/ruoyi-server/src/main/java/org/dromara/server/dubbo/RemoteServerServiceImpl.java
0 → 100644
浏览文件 @
43674492
package
org
.
dromara
.
server
.
dubbo
;
import
lombok.RequiredArgsConstructor
;
import
org.apache.dubbo.config.annotation.DubboService
;
import
org.dromara.server.api.RemoteServerService
;
import
org.dromara.server.api.domain.RemoteUser
;
import
org.springframework.stereotype.Service
;
/**
* 云上服务
*
* @author hzh
*/
@RequiredArgsConstructor
@Service
@DubboService
public
class
RemoteServerServiceImpl
implements
RemoteServerService
{
@Override
public
boolean
saveOrUpdateUser
(
RemoteUser
user
)
{
return
false
;
}
@Override
public
RemoteUser
getUserByPhone
(
String
tenantId
,
String
phone
)
{
return
null
;
}
}
ruoyi-visual/ruoyi-nacos/src/main/resources/application.properties
浏览文件 @
43674492
...
...
@@ -40,9 +40,9 @@ spring.sql.init.platform=mysql
db.num
=
1
### Connect URL of DB:
db.url.0
=
jdbc:mysql://
47.101.208.124
:3306/travel_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
db.user.0
=
travel_config
db.password.0
=
DhBfyrN6AYRXrDCX
db.url.0
=
jdbc:mysql://
192.168.8.190
:3306/travel_config?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC&allowPublicKeyRetrieval=true
db.user.0
=
root
db.password.0
=
fed74f4174a0f684
### the maximum retry times for push
nacos.config.push.maxRetryTime
=
50
...
...
@@ -84,7 +84,7 @@ nacos.naming.empty-service.clean.period-time-ms=30000
#*************** Metrics Related Configurations ***************#
# 指向 ruoyi-monitor 监控
spring.boot.admin.client.url
=
http://
47.101.208.124
:9100
spring.boot.admin.client.url
=
http://
localhost
:9100
spring.boot.admin.client.username
=
ruoyi
spring.boot.admin.client.password
=
123456
spring.boot.admin.client.instance.service-host-type
=
IP
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论