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
a6f5939d
Commit
a6f5939d
authored
Sep 03, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改获取用户id相关
parent
013741c4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
4 deletions
+34
-4
CommonBaseController.java
...ub/wxiaoqi/security/common/rest/CommonBaseController.java
+8
-0
BaseController.java
...java/com/xxfc/platform/vehicle/common/BaseController.java
+21
-0
VehicleController.java
...ava/com/xxfc/platform/vehicle/rest/VehicleController.java
+3
-2
VehicleHolidayPriceInfoController.java
...tform/vehicle/rest/VehicleHolidayPriceInfoController.java
+2
-2
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/CommonBaseController.java
View file @
a6f5939d
...
...
@@ -35,4 +35,12 @@ public class CommonBaseController {
public
String
getCurrentUserId
(){
return
BaseContextHandler
.
getUserID
();
}
public
Integer
getCurrentUserIdInt
(){
if
(
null
!=
BaseContextHandler
.
getUserID
())
{
return
Integer
.
valueOf
(
BaseContextHandler
.
getUserID
());
}
else
{
return
null
;
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/common/BaseController.java
View file @
a6f5939d
package
com
.
xxfc
.
platform
.
vehicle
.
common
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.context.BaseContextHandler
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -12,4 +13,24 @@ public class BaseController<Biz extends BaseBiz> {
protected
HttpServletRequest
request
;
@Autowired
protected
Biz
baseBiz
;
public
HttpServletRequest
getRequest
()
{
return
request
;
}
public
String
getCurrentUserName
(){
return
BaseContextHandler
.
getUsername
();
}
public
String
getCurrentUserId
(){
return
BaseContextHandler
.
getUserID
();
}
public
Integer
getCurrentUserIdInt
(){
if
(
null
!=
BaseContextHandler
.
getUserID
())
{
return
Integer
.
valueOf
(
BaseContextHandler
.
getUserID
());
}
else
{
return
null
;
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleController.java
View file @
a6f5939d
...
...
@@ -646,6 +646,7 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
@RequestMapping
(
value
=
"/app/unauth/findById"
,
method
=
RequestMethod
.
GET
)
@IgnoreUserToken
public
RestResponse
<
VehicleVO
>
appFindById
(
String
id
,
String
priceStartDate
,
String
priceEndDate
)
{
Integer
userId
=
getCurrentUserIdInt
();
Vehicle
vehicle
=
baseBiz
.
get
(
id
);
VehicleVO
vehicleVO
=
BeanUtil
.
toBean
(
vehicle
,
VehicleVO
.
class
);
vehicleVO
.
setVehicleModel
(
vehicleModelBiz
.
selectById
(
vehicleVO
.
getModelId
()));
...
...
@@ -661,9 +662,9 @@ public class VehicleController extends BaseController<VehicleBiz> implements Use
}
if
(
StrUtil
.
isNotBlank
(
priceStartDate
)
&&
StrUtil
.
isNotBlank
(
priceEndDate
))
{
vehicleVO
.
setPriceDTOS
(
vehicleHolidayPriceInfoBiz
.
getSynthesizePrice
(
vehicleVO
.
getId
(),
priceStartDate
,
priceEndDate
,
null
,
vehicleVO
.
getSubordinateBranch
()));
vehicleVO
.
setPriceDTOS
(
vehicleHolidayPriceInfoBiz
.
getSynthesizePrice
(
vehicleVO
.
getId
(),
priceStartDate
,
priceEndDate
,
userId
,
vehicleVO
.
getSubordinateBranch
()));
}
else
{
vehicleVO
.
setPriceDTOS
(
vehicleHolidayPriceInfoBiz
.
getSynthesizePrice
(
vehicleVO
.
getId
(),
DateUtil
.
today
(),
DateUtil
.
offsetDay
(
DateUtil
.
date
(),
6
).
toDateStr
(),
null
,
vehicleVO
.
getSubordinateBranch
()));
vehicleVO
.
setPriceDTOS
(
vehicleHolidayPriceInfoBiz
.
getSynthesizePrice
(
vehicleVO
.
getId
(),
DateUtil
.
today
(),
DateUtil
.
offsetDay
(
DateUtil
.
date
(),
6
).
toDateStr
(),
userId
,
vehicleVO
.
getSubordinateBranch
()));
}
return
RestResponse
.
data
(
vehicleVO
);
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/VehicleHolidayPriceInfoController.java
View file @
a6f5939d
...
...
@@ -53,10 +53,10 @@ public class VehicleHolidayPriceInfoController extends BaseController<VehicleHol
return
baseBiz
.
deleteByVehicleId
(
vehicleId
,
festivalId
);
}
@GetMapping
(
value
=
"multiCalendarPrice"
)
@GetMapping
(
value
=
"
/app/unauth/
multiCalendarPrice"
)
@IgnoreUserToken
public
ObjectRestResponse
<
List
<
VehicleVO
>>
multiCalendarPrice
(
String
vehicleIds
,
String
startDate
,
String
endDate
)
{
Integer
userId
=
Integer
.
valueOf
(
getCurrentUserId
()
);
Integer
userId
=
getCurrentUserIdInt
(
);
List
<
VehicleVO
>
vehicleVOS
=
CollUtil
.
newArrayList
();
if
(
StrUtil
.
isNotBlank
(
vehicleIds
))
{
...
...
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