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
048026ec
Commit
048026ec
authored
Sep 16, 2019
by
libin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
ba09ed09
fa7245cd
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
153 additions
and
62 deletions
+153
-62
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
+11
-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
+6
-1
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/feign/UserFeign.java
View file @
048026ec
...
...
@@ -118,6 +118,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 @
048026ec
...
...
@@ -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
());
...
...
@@ -83,13 +91,14 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
executorService
.
execute
(
new
Runnable
()
{
@Override
public
void
run
()
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AppUserLogin
appUserLogin
:
list
)
{
if
(
list
!=
null
&&
list
.
size
()
>
0
)
{
for
(
AppUserLogin
appUserLogin
:
list
)
{
try
{
Thread
.
sleep
(
3000
);
}
catch
(
Exception
e
){}
}
catch
(
Exception
e
)
{
}
IdInformation
idInformation
=
thirdFeign
.
getOneByUserId
(
appUserLogin
.
getId
());
if
(
idInformation
!=
null
)
{
//实名认证
if
(
idInformation
!=
null
)
{
//实名认证
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserLogin
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"CRETIFICATION"
);
...
...
@@ -98,7 +107,8 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
}
try
{
Thread
.
sleep
(
3000
);
}
catch
(
Exception
e
){}
}
catch
(
Exception
e
)
{
}
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"userId"
,
appUserLogin
.
getId
());
jsonObject
.
put
(
"integralRuleCode"
,
"REGISTER"
);
...
...
@@ -228,9 +238,9 @@ 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
)){
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
;
...
...
@@ -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,12 +283,13 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
mapper
.
updateByPrimaryKeySelective
(
appUserLogin
);
}
public
List
<
Integer
>
findAllExistUserIds
(){
public
List
<
Integer
>
findAllExistUserIds
()
{
return
mapper
.
selectAllExistUserIds
();
}
/**
* 检查第三方是否绑定
*
* @param wxOpenId
* @param wxUnionId
* @param openId
...
...
@@ -293,19 +304,26 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
}
@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
)){
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 @
048026ec
...
...
@@ -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 @
048026ec
...
...
@@ -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 @
048026ec
...
...
@@ -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 @
048026ec
...
...
@@ -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 @
048026ec
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 @
048026ec
...
...
@@ -309,8 +309,19 @@ public class BaseOrderController extends CommonBaseController implements UserRes
private
String
phone
;
/**
* 后台搜索条件:真实姓名
*/
private
String
realName
;
/**
* 后台搜索条件:车辆编号
*/
private
String
vehicleCode
;
private
List
<
String
>
vehicleIds
;
//订单用户ID列表
private
List
<
Integer
>
userIds
;
//订单用户手机号或订单用户真实姓名
...
...
xx-order/xx-order-server/src/main/resources/mapper/BaseOrderMapper.xml
View file @
048026ec
...
...
@@ -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 @
048026ec
...
...
@@ -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 @
048026ec
...
...
@@ -1474,4 +1474,24 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
int
count
=
mapper
.
selectCountByExample
(
example
);
return
count
>
0
;
}
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 @
048026ec
...
...
@@ -519,7 +519,7 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
}
@GetMapping
(
"/findwith_plate_number"
)
public
List
<
String
>
findbyPlateNumber
(
@RequestParam
(
value
=
"plateNumber"
)
String
plateNumber
){
List
<
String
>
findbyPlateNumber
(
@RequestParam
(
value
=
"plateNumber"
)
String
plateNumber
){
return
vehicleBiz
.
findVehicleIdsByPlateNumber
(
plateNumber
);
}
...
...
@@ -529,4 +529,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
return
ObjectRestResponse
.
succ
(
exist
);
}
@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