Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
youjj
cloud-platform
Commits
66a4b194
Commit
66a4b194
authored
Sep 16, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车辆订单后台管相关接口
parent
74599b1e
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
148 additions
and
61 deletions
+148
-61
UserFeign.java
...va/com/github/wxiaoqi/security/admin/feign/UserFeign.java
+2
-0
AppUserLoginBiz.java
...om/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
+69
-51
AppUserLoginMapper.java
...hub/wxiaoqi/security/admin/mapper/AppUserLoginMapper.java
+3
-0
AppUserController.java
...github/wxiaoqi/security/admin/rest/AppUserController.java
+9
-0
AppUserLoginMapper.xml
...ce-admin/src/main/resources/mapper/AppUserLoginMapper.xml
+13
-2
OrderListVo.java
.../java/com/xxfc/platform/order/pojo/order/OrderListVo.java
+1
-0
BackStageOrderController.java
...om/xxfc/platform/order/rest/BackStageOrderController.java
+10
-6
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+7
-0
BaseOrderMapper.xml
...rder-server/src/main/resources/mapper/BaseOrderMapper.xml
+6
-2
VehicleFeign.java
...in/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
+3
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+20
-0
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+5
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/UserFeign.java
View file @
66a4b194
...
...
@@ -115,6 +115,8 @@ public interface UserFeign {
@GetMapping
(
"/app/user/one"
)
public
AppUserLogin
one
(
@RequestParam
(
value
=
"username"
)
String
username
);
@GetMapping
(
"/app/user/getOne"
)
public
List
<
AppUserLogin
>
getOne
(
@RequestParam
(
value
=
"username"
)
String
username
,
@RequestParam
(
value
=
"realName"
)
String
realName
);
@GetMapping
(
"/api/app/imi/{imiId}"
)
ImiVo
findUserInfoByImiId
(
@PathVariable
(
value
=
"imiId"
)
Integer
imiId
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
View file @
66a4b194
...
...
@@ -2,16 +2,21 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.alibaba.druid.sql.visitor.functions.If
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.entity.AppUserDetail
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserLoginMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.github.wxiaoqi.security.common.constant.UserConstant
;
import
com.google.common.collect.Lists
;
import
com.xxfc.platform.im.utils.StringUtil
;
import
com.xxfc.platform.universal.entity.IdInformation
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.stereotype.Service
;
...
...
@@ -38,15 +43,18 @@ import java.util.stream.Collectors;
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
class
AppUserLoginBiz
extends
BaseBiz
<
AppUserLoginMapper
,
AppUserLogin
>
{
private
static
final
String
WX_TYPE
=
"wx"
;
private
static
final
String
QQ_TYPE
=
"q"
;
private
static
final
String
WX_TYPE
=
"wx"
;
private
static
final
String
QQ_TYPE
=
"q"
;
@Autowired
ThirdFeign
thirdFeign
;
@Autowired
MQSenderFeign
mqSenderFeign
;
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Autowired
AppUserDetailBiz
appUserDetailBiz
;
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Override
public
void
insertSelective
(
AppUserLogin
entity
)
{
String
password
=
new
BCryptPasswordEncoder
(
UserConstant
.
PW_ENCORDER_SALT
).
encode
(
entity
.
getPassword
());
...
...
@@ -62,7 +70,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
@CacheClear
(
pre
=
"user{1.username}"
)
public
int
bindOpenid
(
AppUserLogin
entity
)
{
return
mapper
.
bindOpenId
(
entity
);
return
mapper
.
bindOpenId
(
entity
);
}
@CacheClear
(
pre
=
"user{1.username}"
)
...
...
@@ -81,33 +89,35 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
List
<
AppUserLogin
>
list
=
mapper
.
selectAll
();
ExecutorService
executorService
=
Executors
.
newCachedThreadPool
();
executorService
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AppUserLogin
appUserLogin
:
list
)
{
try
{
Thread
.
sleep
(
3000
);
}
catch
(
Exception
e
){}
IdInformation
idInformation
=
thirdFeign
.
getOneByUserId
(
appUserLogin
.
getId
());
if
(
idInformation
!=
null
)
{
//实名认证
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserLogin
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"CRETIFICATION"
);
jsonObject
.
put
(
"channelId"
,
idInformation
.
getId
());
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitConstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
}
try
{
Thread
.
sleep
(
3000
);
}
catch
(
Exception
e
){}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserLogin
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"REGISTER"
);
jsonObject
.
put
(
"channelId"
,
appUserLogin
.
getId
());
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitConstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
}
}
}
@Override
public
void
run
()
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AppUserLogin
appUserLogin
:
list
)
{
try
{
Thread
.
sleep
(
3000
);
}
catch
(
Exception
e
)
{
}
IdInformation
idInformation
=
thirdFeign
.
getOneByUserId
(
appUserLogin
.
getId
());
if
(
idInformation
!=
null
)
{
//实名认证
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserLogin
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"CRETIFICATION"
);
jsonObject
.
put
(
"channelId"
,
idInformation
.
getId
());
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitConstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
}
try
{
Thread
.
sleep
(
3000
);
}
catch
(
Exception
e
)
{
}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserLogin
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"REGISTER"
);
jsonObject
.
put
(
"channelId"
,
appUserLogin
.
getId
());
mqSenderFeign
.
sendMessage
(
RabbitConstant
.
INTEGRAL_TOPIC
,
RabbitConstant
.
INTEGRAL_ROUTING_KEY
,
jsonObject
.
toJSONString
());
}
}
}
});
}
...
...
@@ -228,10 +238,10 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
}
public
Map
<
Integer
,
AppUserLogin
>
findUserIdAndUserLoginMapByMemberIds
(
List
<
Integer
>
memberIds
)
{
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
new
HashMap
<>();
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
new
HashMap
<>();
List
<
AppUserLogin
>
appUserLogins
=
mapper
.
selectByIdList
(
memberIds
);
if
(
CollectionUtils
.
isNotEmpty
(
appUserLogins
)){
userIdAndAppUserLoginMap
=
appUserLogins
.
stream
().
collect
(
Collectors
.
toMap
(
AppUserLogin:
:
getId
,
Function
.
identity
()));
if
(
CollectionUtils
.
isNotEmpty
(
appUserLogins
))
{
userIdAndAppUserLoginMap
=
appUserLogins
.
stream
().
collect
(
Collectors
.
toMap
(
AppUserLogin:
:
getId
,
Function
.
identity
()));
}
return
userIdAndAppUserLoginMap
;
}
...
...
@@ -239,9 +249,9 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
public
AppUserLogin
findUserByImiId
(
Integer
imiId
)
{
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"imUserid"
,
imiId
);
criteria
.
andEqualTo
(
"imUserid"
,
imiId
);
List
<
AppUserLogin
>
appUserLogins
=
mapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isNotEmpty
(
appUserLogins
)){
if
(
CollectionUtils
.
isNotEmpty
(
appUserLogins
))
{
return
appUserLogins
.
get
(
0
);
}
return
null
;
...
...
@@ -249,7 +259,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
@CacheClear
(
pre
=
"user{1.id}"
)
public
void
disable
(
AppUserLogin
appUserLogin
)
{
mapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
mapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
}
@CacheClear
(
pre
=
"user{1.id}"
)
...
...
@@ -260,7 +270,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
public
void
deleteByPhones
(
List
<
String
>
phons
)
{
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andIn
(
"username"
,
phons
);
criteria
.
andIn
(
"username"
,
phons
);
mapper
.
deleteByExample
(
example
);
}
...
...
@@ -273,39 +283,47 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
mapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
}
public
List
<
Integer
>
findAllExistUserIds
(){
return
mapper
.
selectAllExistUserIds
();
public
List
<
Integer
>
findAllExistUserIds
()
{
return
mapper
.
selectAllExistUserIds
();
}
/**
* 检查第三方是否绑定
*
* @param wxOpenId
* @param wxUnionId
* @param openId
* @return
*/
public
boolean
checkThirdPartyBindingState
(
String
wxOpenId
,
String
wxUnionId
,
String
openId
)
{
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
appUserLogin
.
setWxOpenid
(
wxOpenId
);
appUserLogin
.
setUnionid
(
wxUnionId
);
appUserLogin
.
setOpenid
(
openId
);
return
mapper
.
selectOne
(
appUserLogin
)
!=
null
;
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
appUserLogin
.
setWxOpenid
(
wxOpenId
);
appUserLogin
.
setUnionid
(
wxUnionId
);
appUserLogin
.
setOpenid
(
openId
);
return
mapper
.
selectOne
(
appUserLogin
)
!=
null
;
}
@CacheClear
(
pre
=
"user{2}"
)
public
void
unBindThirdPartyByType
(
String
type
,
String
username
,
Integer
userId
)
{
public
void
unBindThirdPartyByType
(
String
type
,
String
username
,
Integer
userId
)
{
AppUserLogin
appUserLogin
=
new
AppUserLogin
();
appUserLogin
.
setId
(
userId
);
//微信解绑
if
(
WX_TYPE
.
equals
(
type
)){
if
(
WX_TYPE
.
equals
(
type
))
{
appUserLogin
.
setWxOpenid
(
""
);
appUserLogin
.
setUnionid
(
""
);
mapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
}
//qq解绑
if
(
QQ_TYPE
.
equals
(
type
)){
appUserLogin
.
setOpenid
(
""
);
mapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
//qq解绑
if
(
QQ_TYPE
.
equals
(
type
))
{
appUserLogin
.
setOpenid
(
""
);
mapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
}
}
public
List
<
AppUserLogin
>
getUserByUsernameAndRealName
(
String
username
,
String
realName
)
{
return
mapper
.
getUserByUsernameAndRealName
(
username
,
realName
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserLoginMapper.java
View file @
66a4b194
...
...
@@ -28,4 +28,7 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin>, SelectByIdList
List
<
Integer
>
selectAllExistUserIds
();
List
<
AppUserLogin
>
getUserByUsernameAndRealName
(
@Param
(
"username"
)
String
username
,
@Param
(
"realName"
)
String
realName
);
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserController.java
View file @
66a4b194
...
...
@@ -262,6 +262,15 @@ public class AppUserController extends CommonBaseController{
return
appUserLoginBiz
.
getUserByUsername
(
username
);
}
/**
* 根据用户真实姓名和手机号模糊查询寻用户
* @param username
* @return
*/
@GetMapping
(
"/getOne"
)
public
List
<
AppUserLogin
>
getOne
(
@RequestParam
(
value
=
"username"
,
required
=
false
)
String
username
,
@RequestParam
(
value
=
"realName"
,
required
=
false
)
String
realName
){
return
appUserLoginBiz
.
getUserByUsernameAndRealName
(
username
,
realName
);
}
@GetMapping
(
"/findusersByIds"
)
public
Map
<
Integer
,
AppUserLogin
>
findAppUsersByUserIds
(
@RequestParam
(
value
=
"userIds"
)
List
<
Integer
>
userIds
){
return
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
userIds
);
...
...
ace-modules/ace-admin/src/main/resources/mapper/AppUserLoginMapper.xml
View file @
66a4b194
...
...
@@ -5,10 +5,10 @@
<select
id=
"selectbyPhones"
resultType=
"com.github.wxiaoqi.security.admin.entity.AppUserLogin"
>
select `id`,`username` from `app_user_login` where `username` in
<foreach
collection=
"phones"
item=
"phone"
open=
"("
close=
")"
separator=
","
>
#{phone}
#{phone}
</foreach>
</select>
<update
id=
"bindOpenId"
parameterType=
"com.github.wxiaoqi.security.admin.entity.AppUserLogin"
>
UPDATE app_user_login SET wx_openid=#{wxOpenid},unionid=#{unionid},openid=#{openid} where id=#{id}
</update>
...
...
@@ -16,4 +16,15 @@
<select
id=
"selectAllExistUserIds"
resultType=
"integer"
>
SELECT `id` FROM `app_user_login` WHERE `isdel`=0;
</select>
<select
id=
"getUserByUsernameAndRealName"
resultType=
"com.github.wxiaoqi.security.admin.entity.AppUserLogin"
>
select l.* from app_user_login l left join app_user_detail d on l.id=d.userid where 1=1
<if
test=
"username!=null "
>
and l.username like concat('%',#{username},'%')
</if>
<if
test=
"realName !=null"
>
and d.realname like concat('%',#{realName},'%')
</if>
</select>
</mapper>
\ No newline at end of file
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/order/OrderListVo.java
View file @
66a4b194
...
...
@@ -30,6 +30,7 @@ public class OrderListVo extends BaseOrder {
private
String
endCompanyName
;
private
String
realName
;
/**
* 是否是用户匹配公司
*/
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BackStageOrderController.java
View file @
66a4b194
package
com
.
xxfc
.
platform
.
order
.
rest
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
...
...
@@ -48,6 +49,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.web.bind.annotation.*
;
import
javax.annotation.Resource
;
import
java.lang.reflect.Array
;
import
java.time.Instant
;
import
java.time.LocalDateTime
;
import
java.time.ZoneOffset
;
...
...
@@ -103,10 +105,11 @@ public class BackStageOrderController extends CommonBaseController implements Us
dto
.
setEndTime
(
new
Date
().
getTime
());
}
}
if
(
StringUtils
.
isNotBlank
(
dto
.
getPhone
()))
{
AppUserLogin
appUserLogin
=
userFeign
.
one
(
dto
.
getPhone
());
if
(
appUserLogin
!=
null
)
{
dto
.
setUserId
(
appUserLogin
.
getId
());
if
(
StringUtils
.
isNotBlank
(
dto
.
getPhone
())||
StringUtils
.
isNotBlank
(
dto
.
getRealName
()))
{
List
<
AppUserLogin
>
appUserLoins
=
userFeign
.
getOne
(
dto
.
getPhone
(),
dto
.
getRealName
());
if
(
CollectionUtil
.
isNotEmpty
(
appUserLoins
))
{
List
<
Integer
>
collect
=
appUserLoins
.
parallelStream
().
map
(
AppUserLogin:
:
getId
).
collect
(
Collectors
.
toList
());
dto
.
setUserIds
(
collect
);
}
else
{
return
ObjectRestResponse
.
succ
(
new
PageDataVO
<>());
}
...
...
@@ -121,8 +124,8 @@ public class BackStageOrderController extends CommonBaseController implements Us
dto
.
setCompanyIds
(
companyIds
);
}
if
(
StringUtils
.
isNotEmpty
(
dto
.
getPlateNumber
())){
List
<
String
>
vehicleIds
=
vehicleFeign
.
findbyPlateNumber
(
dto
.
getPlateNumber
().
trim
());
if
(
StringUtils
.
isNotEmpty
(
dto
.
getPlateNumber
())
||
StringUtils
.
isNotEmpty
(
dto
.
getVehicleCode
())
){
List
<
String
>
vehicleIds
=
vehicleFeign
.
findbyPlateNumber
AndVehicleCod
(
dto
.
getPlateNumber
(),
dto
.
getVehicleCode
());
dto
.
setVehicleIds
(
vehicleIds
);
}
...
...
@@ -148,6 +151,7 @@ public class BackStageOrderController extends CommonBaseController implements Us
if
(
appUserVo
!=
null
)
{
orderPageVO
.
setTelephone
(
appUserVo
.
getUsername
());
orderPageVO
.
setUsername
(
appUserVo
.
getNickname
());
orderPageVO
.
setRealName
(
appUserVo
.
getRealname
());
}
if
(
orderPageVO
.
getOrderRentVehicleDetail
()
!=
null
&&
orderPageVO
.
getOrderRentVehicleDetail
().
getVehicleId
()
!=
null
)
{
RestResponse
<
Vehicle
>
restResponse
=
vehicleFeign
.
findById
(
orderPageVO
.
getOrderRentVehicleDetail
().
getVehicleId
());
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
66a4b194
...
...
@@ -309,8 +309,15 @@ public class BaseOrderController extends CommonBaseController implements UserRes
private
String
phone
;
private
String
realName
;
private
String
vehicleCode
;
private
List
<
Integer
>
userIds
;
private
List
<
String
>
vehicleIds
;
/**
* 车牌号
*/
...
...
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
66a4b194
...
...
@@ -120,8 +120,12 @@
<if
test=
"crtUser != null"
>
and b.crt_user = #{crtUser}
</if>
<if
test=
"userId != null"
>
and b.user_id = #{userId}
<if
test=
"userIds != null and userIds.size() > 0"
>
and b.user_id in
<foreach
collection=
"userIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
<if
test=
"status != null"
>
and b.status = #{status}
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
View file @
66a4b194
...
...
@@ -152,4 +152,7 @@ public interface VehicleFeign {
@GetMapping
(
"/vehicleInfo/findwith_plate_number"
)
List
<
String
>
findbyPlateNumber
(
@RequestParam
(
value
=
"plateNumber"
)
String
plateNumber
);
@GetMapping
(
"/vehicleInfo/findVehicleIds"
)
List
<
String
>
findbyPlateNumberAndVehicleCod
(
@RequestParam
(
value
=
"plateNumber"
)
String
plateNumber
,
@RequestParam
(
value
=
"vehicleCode"
)
String
vehicleCode
);
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
66a4b194
...
...
@@ -1458,4 +1458,24 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
}
return
vehicles
.
stream
().
map
(
Vehicle:
:
getId
).
collect
(
Collectors
.
toList
());
}
public
List
<
String
>
findbyPlateNumberAndVehicleCod
(
String
plateNumber
,
String
vehicleCode
)
{
List
<
String
>
vehicleIds
=
Lists
.
newArrayList
();
Example
example
=
new
Example
(
Vehicle
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
StringUtils
.
isNotBlank
(
plateNumber
))
{
criteria
.
andLike
(
"numberPlate"
,
String
.
format
(
"%%%s%%"
,
plateNumber
.
trim
()));
}
if
(
StringUtils
.
isNotBlank
(
vehicleCode
))
{
criteria
.
andLike
(
"code"
,
String
.
format
(
"%%%s%%"
,
vehicleCode
.
trim
()));
}
List
<
Vehicle
>
vehicles
=
mapper
.
selectByExample
(
example
);
if
(
CollectionUtils
.
isEmpty
(
vehicles
)){
return
vehicleIds
;
}
return
vehicles
.
stream
().
map
(
Vehicle:
:
getId
).
collect
(
Collectors
.
toList
());
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
66a4b194
...
...
@@ -522,4 +522,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
List
<
String
>
findbyPlateNumber
(
@RequestParam
(
value
=
"plateNumber"
)
String
plateNumber
){
return
vehicleBiz
.
findVehicleIdsByPlateNumber
(
plateNumber
);
}
@GetMapping
(
"/findVehicleIds"
)
public
List
<
String
>
findbyPlateNumberAndVehicleCod
(
@RequestParam
(
value
=
"plateNumber"
,
required
=
false
)
String
plateNumber
,
@RequestParam
(
value
=
"vehicleCode"
,
required
=
false
)
String
vehicleCode
){
return
vehicleBiz
.
findbyPlateNumberAndVehicleCod
(
plateNumber
,
vehicleCode
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment