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
d5e24e94
Commit
d5e24e94
authored
Jun 04, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加小程序
parent
140fbf34
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
247 additions
and
2 deletions
+247
-2
UserBiz.java
...n/java/com/github/wxiaoqi/security/admin/biz/UserBiz.java
+4
-2
BaseUserRelation.java
...ithub/wxiaoqi/security/admin/entity/BaseUserRelation.java
+131
-0
BaseUserRelationMapper.java
...wxiaoqi/security/admin/mapper/BaseUserRelationMapper.java
+15
-0
UserMapper.java
.../com/github/wxiaoqi/security/admin/mapper/UserMapper.java
+1
-0
PublicController.java
.../github/wxiaoqi/security/admin/rest/PublicController.java
+13
-0
UserMapper.xml
...odules/ace-admin/src/main/resources/mapper/UserMapper.xml
+7
-0
UserFeign.java
...va/com/xinxincaravan/caravan/vehicle/feign/UserFeign.java
+2
-0
VehicleActiveController.java
...caravan/caravan/vehicle/rest/VehicleActiveController.java
+37
-0
VehicleController.java
...xinxincaravan/caravan/vehicle/rest/VehicleController.java
+20
-0
VehicleDepartureController.java
...avan/caravan/vehicle/rest/VehicleDepartureController.java
+17
-0
No files found.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBiz.java
View file @
d5e24e94
...
@@ -18,8 +18,6 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
...
@@ -18,8 +18,6 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.lang.reflect.ParameterizedType
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -110,4 +108,8 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
...
@@ -110,4 +108,8 @@ public class UserBiz extends BaseBiz<UserMapper,User> {
user
.
setUsername
(
username
);
user
.
setUsername
(
username
);
return
mapper
.
select
(
user
);
return
mapper
.
select
(
user
);
}
}
public
User
getUserByUid
(
Integer
toUid
){
return
mapper
.
getUserByUid
(
toUid
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/entity/BaseUserRelation.java
0 → 100644
View file @
d5e24e94
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
java.io.Serializable
;
import
javax.persistence.*
;
/**
* 用户关系表
*
* @author Mr.AG
* @email 463540703@qq.com
* @date 2019-06-04 14:29:29
*/
@Table
(
name
=
"base_user_relation"
)
public
class
BaseUserRelation
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
//主键id
@Id
private
Integer
id
;
//用户id
@Column
(
name
=
"user_id"
)
private
Integer
userId
;
//小程序用户id
@Column
(
name
=
"to_uid"
)
private
Integer
toUid
;
//是否有效;0-有效;1-无效
@Column
(
name
=
"staus"
)
private
Integer
staus
;
//创建时间
@Column
(
name
=
"crt_time"
)
private
Long
crtTime
;
//更新时间
@Column
(
name
=
"upd_time"
)
private
Long
updTime
;
//是否删除;0-正常;1-删除
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
/**
* 设置:主键id
*/
public
void
setId
(
Integer
id
)
{
this
.
id
=
id
;
}
/**
* 获取:主键id
*/
public
Integer
getId
()
{
return
id
;
}
/**
* 设置:用户id
*/
public
void
setUserId
(
Integer
userId
)
{
this
.
userId
=
userId
;
}
/**
* 获取:用户id
*/
public
Integer
getUserId
()
{
return
userId
;
}
/**
* 设置:小程序用户id
*/
public
void
setToUid
(
Integer
toUid
)
{
this
.
toUid
=
toUid
;
}
/**
* 获取:小程序用户id
*/
public
Integer
getToUid
()
{
return
toUid
;
}
/**
* 设置:是否有效;0-有效;1-无效
*/
public
void
setStaus
(
Integer
staus
)
{
this
.
staus
=
staus
;
}
/**
* 获取:是否有效;0-有效;1-无效
*/
public
Integer
getStaus
()
{
return
staus
;
}
/**
* 设置:创建时间
*/
public
void
setCrtTime
(
Long
crtTime
)
{
this
.
crtTime
=
crtTime
;
}
/**
* 获取:创建时间
*/
public
Long
getCrtTime
()
{
return
crtTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdTime
(
Long
updTime
)
{
this
.
updTime
=
updTime
;
}
/**
* 获取:更新时间
*/
public
Long
getUpdTime
()
{
return
updTime
;
}
/**
* 设置:是否删除;0-正常;1-删除
*/
public
void
setIsDel
(
Integer
isDel
)
{
this
.
isDel
=
isDel
;
}
/**
* 获取:是否删除;0-正常;1-删除
*/
public
Integer
getIsDel
()
{
return
isDel
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/BaseUserRelationMapper.java
0 → 100644
View file @
d5e24e94
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserRelation
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 用户关系表
*
* @author Mr.AG
* @email 463540703@qq.com
* @date 2019-06-04 14:29:29
*/
public
interface
BaseUserRelationMapper
extends
Mapper
<
BaseUserRelation
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/UserMapper.java
View file @
d5e24e94
...
@@ -10,4 +10,5 @@ public interface UserMapper extends Mapper<User> {
...
@@ -10,4 +10,5 @@ public interface UserMapper extends Mapper<User> {
public
List
<
User
>
selectMemberByGroupId
(
@Param
(
"groupId"
)
int
groupId
);
public
List
<
User
>
selectMemberByGroupId
(
@Param
(
"groupId"
)
int
groupId
);
public
List
<
User
>
selectLeaderByGroupId
(
@Param
(
"groupId"
)
int
groupId
);
public
List
<
User
>
selectLeaderByGroupId
(
@Param
(
"groupId"
)
int
groupId
);
// public List<User> userPage(@Param("groupId") String name);
// public List<User> userPage(@Param("groupId") String name);
User
getUserByUid
(
@Param
(
"to_uid"
)
Integer
to_uid
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/PublicController.java
View file @
d5e24e94
...
@@ -48,4 +48,17 @@ public class PublicController {
...
@@ -48,4 +48,17 @@ public class PublicController {
}
}
return
new
ObjectRestResponse
<
User
>().
rel
(
true
).
data
(
user
);
return
new
ObjectRestResponse
<
User
>().
rel
(
true
).
data
(
user
);
}
}
@RequestMapping
(
value
=
"/userinfo-by-uid"
,
method
=
RequestMethod
.
GET
)
public
@ResponseBody
ObjectRestResponse
userinfoByUid
(
Integer
uid
)
throws
Exception
{
if
(
uid
==
null
||
uid
==
0
)
{
throw
new
Exception
();
}
User
user
=
userBiz
.
getUserByUid
(
uid
);
if
(
user
==
null
)
{
throw
new
Exception
();
}
return
new
ObjectRestResponse
<
User
>().
rel
(
true
).
data
(
user
);
}
}
}
ace-modules/ace-admin/src/main/resources/mapper/UserMapper.xml
View file @
d5e24e94
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
<result
column=
"upd_user"
jdbcType=
"VARCHAR"
property=
"updUser"
/>
<result
column=
"upd_user"
jdbcType=
"VARCHAR"
property=
"updUser"
/>
<result
column=
"upd_name"
jdbcType=
"VARCHAR"
property=
"updName"
/>
<result
column=
"upd_name"
jdbcType=
"VARCHAR"
property=
"updName"
/>
<result
column=
"upd_host"
jdbcType=
"VARCHAR"
property=
"updHost"
/>
<result
column=
"upd_host"
jdbcType=
"VARCHAR"
property=
"updHost"
/>
<result
column=
"data_all"
jdbcType=
"SMALLINT"
property=
"dataAll"
/>
<result
column=
"attr1"
jdbcType=
"VARCHAR"
property=
"attr1"
/>
<result
column=
"attr1"
jdbcType=
"VARCHAR"
property=
"attr1"
/>
<result
column=
"attr2"
jdbcType=
"VARCHAR"
property=
"attr2"
/>
<result
column=
"attr2"
jdbcType=
"VARCHAR"
property=
"attr2"
/>
<result
column=
"attr3"
jdbcType=
"VARCHAR"
property=
"attr3"
/>
<result
column=
"attr3"
jdbcType=
"VARCHAR"
property=
"attr3"
/>
...
@@ -48,6 +49,12 @@
...
@@ -48,6 +49,12 @@
on gm.user_id = u.id where gm.group_id = #{groupId}
on gm.user_id = u.id where gm.group_id = #{groupId}
</select>
</select>
<select
id=
"getUserByUid"
resultMap=
"BaseResultMap"
>
select u.* from base_user u
left join base_user_relation r
on r.user_id = u.id where r.to_uid = #{to_uid} limit 1
</select>
<!-- <select id="userPage" resultMap="BaseResultMap">-->
<!-- <select id="userPage" resultMap="BaseResultMap">-->
<!-- select u.* from base_user u-->
<!-- select u.* from base_user u-->
<!-- left join base_group_leader gm-->
<!-- left join base_group_leader gm-->
...
...
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/feign/UserFeign.java
View file @
d5e24e94
...
@@ -14,5 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -14,5 +14,7 @@ import org.springframework.web.bind.annotation.RequestParam;
public
interface
UserFeign
{
public
interface
UserFeign
{
@RequestMapping
(
value
=
"/public/userinfo-by-token"
)
@RequestMapping
(
value
=
"/public/userinfo-by-token"
)
public
ObjectRestResponse
<
UserDTO
>
userinfoByToken
(
@RequestParam
(
"token"
)
String
token
);
public
ObjectRestResponse
<
UserDTO
>
userinfoByToken
(
@RequestParam
(
"token"
)
String
token
);
@RequestMapping
(
value
=
"/public/userinfo-by-uid"
)
public
ObjectRestResponse
<
UserDTO
>
userinfoByUid
(
@RequestParam
(
"uid"
)
Integer
uid
);
}
}
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/rest/VehicleActiveController.java
View file @
d5e24e94
package
com
.
xinxincaravan
.
caravan
.
vehicle
.
rest
;
package
com
.
xinxincaravan
.
caravan
.
vehicle
.
rest
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.xinxincaravan.caravan.vehicle.biz.VehicleActiveService
;
import
com.xinxincaravan.caravan.vehicle.biz.VehicleActiveService
;
import
com.xinxincaravan.caravan.vehicle.common.RestResponse
;
import
com.xinxincaravan.caravan.vehicle.common.RestResponse
;
import
com.xinxincaravan.caravan.vehicle.constant.ResCode.ResCode
;
import
com.xinxincaravan.caravan.vehicle.constant.ResCode.ResCode
;
...
@@ -37,6 +38,42 @@ public class VehicleActiveController {
...
@@ -37,6 +38,42 @@ public class VehicleActiveController {
return
RestResponse
.
suc
();
return
RestResponse
.
suc
();
}
}
/**
* 发车
*
* @return
*/
@PostMapping
(
"small/departure"
)
@IgnoreUserToken
public
RestResponse
departureBySmall
(
@RequestBody
VehicleDepartureVo
departureVo
)
{
if
(
departureVo
==
null
||
departureVo
.
getVehicleId
()
==
null
||
departureVo
.
getMileage
()
==
null
||
departureVo
.
getDepartureBranchCompanyId
()
==
null
||
departureVo
.
getExpectArrivalBranchCompanyId
()
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
vehicleActiveService
.
departure
(
departureVo
);
return
RestResponse
.
suc
();
}
/**
* 还车
*
* @param arrivalVo
* @return
*/
@PostMapping
(
"small/arrival"
)
public
RestResponse
arrivalBySmall
(
@RequestBody
VehicleArrivalVo
arrivalVo
)
{
if
(
arrivalVo
==
null
||
arrivalVo
.
getVehicleId
()
==
null
||
arrivalVo
.
getMileage
()
==
null
)
{
return
RestResponse
.
codeAndMessage
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
(),
ResCode
.
INVALID_REST_REQ_PARAM
.
getDesc
());
}
vehicleActiveService
.
arrival
(
arrivalVo
);
return
RestResponse
.
suc
();
}
/**
/**
* 还车
* 还车
*
*
...
...
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/rest/VehicleController.java
View file @
d5e24e94
...
@@ -104,7 +104,27 @@ public class VehicleController extends BaseController<VehicleBiz> {
...
@@ -104,7 +104,27 @@ public class VehicleController extends BaseController<VehicleBiz> {
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
}
}
}
@RequestMapping
(
value
=
"/small/page"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
RestResponse
<
PageDataVo
<
QueryVehicleVo
>>
getByPageBySmall
(
@RequestParam
String
vehiclePageQueryVoJson
,
@RequestParam
Integer
uid
)
throws
Exception
{
VehiclePageQueryVo
vehiclePageQueryVo
=
null
;
try
{
vehiclePageQueryVo
=
JSON
.
parseObject
(
vehiclePageQueryVoJson
,
VehiclePageQueryVo
.
class
);
UserDTO
userDTO
=
userFeign
.
userinfoByUid
(
uid
).
getData
();
if
(
userDTO
!=
null
)
{
if
(
userDTO
.
getDataAll
()
==
2
)
{
List
<
Integer
>
companyList
=
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
return
RestResponse
.
data
(
baseBiz
.
getByPageNotAllData
(
vehiclePageQueryVo
,
companyList
));
}
}
return
RestResponse
.
data
(
baseBiz
.
getByPage
(
vehiclePageQueryVo
));
}
catch
(
JSONException
ex
)
{
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
catch
(
CustomIllegalParamException
ex
)
{
return
RestResponse
.
code
(
ResCode
.
INVALID_REST_REQ_PARAM
.
getCode
());
}
}
@RequestMapping
(
value
=
"/upload/drivingLicense"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/upload/drivingLicense"
,
method
=
RequestMethod
.
POST
)
public
RestResponse
uploadDrivingLicense
(
@RequestParam
(
"file"
)
MultipartFile
file
)
public
RestResponse
uploadDrivingLicense
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
Exception
{
throws
Exception
{
...
...
vehicle/src/main/java/com/xinxincaravan/caravan/vehicle/rest/VehicleDepartureController.java
View file @
d5e24e94
package
com
.
xinxincaravan
.
caravan
.
vehicle
.
rest
;
package
com
.
xinxincaravan
.
caravan
.
vehicle
.
rest
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreClientToken
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.xinxincaravan.caravan.vehicle.biz.VehicleBiz
;
import
com.xinxincaravan.caravan.vehicle.biz.VehicleBiz
;
import
com.xinxincaravan.caravan.vehicle.biz.VehicleDepartureService
;
import
com.xinxincaravan.caravan.vehicle.biz.VehicleDepartureService
;
...
@@ -48,6 +49,22 @@ public class VehicleDepartureController {
...
@@ -48,6 +49,22 @@ public class VehicleDepartureController {
}
}
return
RestResponse
.
suc
(
vehicleDepartureService
.
page
(
numberPlate
,
time
,
page
,
limit
));
return
RestResponse
.
suc
(
vehicleDepartureService
.
page
(
numberPlate
,
time
,
page
,
limit
));
}
}
@GetMapping
(
"small/page"
)
@IgnoreUserToken
public
RestResponse
pageBySmall
(
String
numberPlate
,
String
time
,
Integer
page
,
Integer
limit
,
Integer
uid
,
HttpServletRequest
request
)
{
if
(
page
==
null
||
limit
==
null
)
{
page
=
1
;
limit
=
10
;
}
UserDTO
userDTO
=
userFeign
.
userinfoByUid
(
uid
).
getData
();
if
(
userDTO
!=
null
)
{
if
(
userDTO
.
getDataAll
()
==
2
)
{
List
<
Integer
>
companyList
=
vehicleBiz
.
dataCompany
(
userDTO
.
getDataZone
(),
userDTO
.
getDataCompany
());
return
RestResponse
.
data
(
vehicleDepartureService
.
pageNotAllData
(
numberPlate
,
time
,
page
,
limit
,
companyList
));
}
}
return
RestResponse
.
suc
(
vehicleDepartureService
.
page
(
numberPlate
,
time
,
page
,
limit
));
}
@GetMapping
(
"findByVehicle"
)
@GetMapping
(
"findByVehicle"
)
public
RestResponse
findByVehicle
(
String
vehicleId
,
Integer
page
,
Integer
limit
)
{
public
RestResponse
findByVehicle
(
String
vehicleId
,
Integer
page
,
Integer
limit
)
{
...
...
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