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
7c4b3d15
Commit
7c4b3d15
authored
Jun 27, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://10.5.52.3/youjj/cloud-platform
into base-modify
parents
d2454e1c
420232d1
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
82 additions
and
25 deletions
+82
-25
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+3
-3
BaseException.java
...thub/wxiaoqi/security/common/exception/BaseException.java
+7
-0
EntityUtils.java
.../com/github/wxiaoqi/security/common/util/EntityUtils.java
+12
-2
ResultCode.java
...thub/wxiaoqi/security/common/util/process/ResultCode.java
+4
-0
resultcod.properties
...common/src/main/resources/properties/resultcod.properties
+8
-0
AddRentVehicleDTO.java
.../java/com/xxfc/platform/order/pojo/AddRentVehicleDTO.java
+8
-0
AddTourDTO.java
...rc/main/java/com/xxfc/platform/order/pojo/AddTourDTO.java
+6
-0
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+1
-1
RabbitUserConfig.java
...java/com/xxfc/platform/order/config/RabbitUserConfig.java
+14
-4
OrderRentVehicleService.java
.../xxfc/platform/order/service/OrderRentVehicleService.java
+6
-1
TourTagBannerBiz.java
...ain/java/com/xxfc/platform/tour/biz/TourTagBannerBiz.java
+4
-4
TourTagBiz.java
.../src/main/java/com/xxfc/platform/tour/biz/TourTagBiz.java
+1
-1
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+8
-9
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
7c4b3d15
...
@@ -102,7 +102,7 @@ public class AuthController {
...
@@ -102,7 +102,7 @@ public class AuthController {
if
(
result
==
null
){
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
data
.
put
(
"status"
,
1001
);
}
else
{
}
else
{
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
i
d"
));
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
I
d"
));
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
}
}
}
}
...
@@ -122,7 +122,7 @@ public class AuthController {
...
@@ -122,7 +122,7 @@ public class AuthController {
if
(
result
==
null
){
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
data
.
put
(
"status"
,
1001
);
}
else
{
}
else
{
String
token
=
appAuthService
.
getToken
(
result
.
getString
(
"username"
),
result
.
getInteger
(
"user
i
d"
));
String
token
=
appAuthService
.
getToken
(
result
.
getString
(
"username"
),
result
.
getInteger
(
"user
I
d"
));
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
}
}
}
}
...
@@ -141,7 +141,7 @@ public class AuthController {
...
@@ -141,7 +141,7 @@ public class AuthController {
if
(
result
==
null
){
if
(
result
==
null
){
data
.
put
(
"status"
,
1001
);
data
.
put
(
"status"
,
1001
);
}
else
{
}
else
{
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
i
d"
));
String
token
=
appAuthService
.
getToken
(
username
,
result
.
getInteger
(
"user
I
d"
));
data
.
put
(
"token"
,
token
);
data
.
put
(
"token"
,
token
);
}
}
}
}
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/BaseException.java
View file @
7c4b3d15
...
@@ -3,6 +3,8 @@ package com.github.wxiaoqi.security.common.exception;
...
@@ -3,6 +3,8 @@ package com.github.wxiaoqi.security.common.exception;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.constant.RestCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
java.util.Map
;
/**
/**
* Created by ace on 2017/9/8.
* Created by ace on 2017/9/8.
*/
*/
...
@@ -50,4 +52,9 @@ public class BaseException extends RuntimeException {
...
@@ -50,4 +52,9 @@ public class BaseException extends RuntimeException {
super
(
ResultCode
.
getMsg
(
code
));
super
(
ResultCode
.
getMsg
(
code
));
this
.
status
=
code
;
this
.
status
=
code
;
}
}
public
BaseException
(
int
code
,
Map
<
String
,
Object
>
map
)
{
super
(
ResultCode
.
getMsg
(
code
));
this
.
status
=
code
;
}
}
}
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/EntityUtils.java
View file @
7c4b3d15
...
@@ -40,7 +40,12 @@ public class EntityUtils {
...
@@ -40,7 +40,12 @@ public class EntityUtils {
* @author 王浩彬
* @author 王浩彬
*/
*/
public
static
<
T
>
void
setCreateInfo
(
T
entity
){
public
static
<
T
>
void
setCreateInfo
(
T
entity
){
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
;
try
{
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
}
catch
(
Exception
e
)
{
request
=
null
;
}
String
hostIp
=
""
;
String
hostIp
=
""
;
String
name
=
""
;
String
name
=
""
;
String
id
=
""
;
String
id
=
""
;
...
@@ -81,7 +86,12 @@ public class EntityUtils {
...
@@ -81,7 +86,12 @@ public class EntityUtils {
* @author 王浩彬
* @author 王浩彬
*/
*/
public
static
<
T
>
void
setUpdatedInfo
(
T
entity
){
public
static
<
T
>
void
setUpdatedInfo
(
T
entity
){
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
HttpServletRequest
request
;
try
{
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
}
catch
(
Exception
e
)
{
request
=
null
;
}
String
hostIp
=
""
;
String
hostIp
=
""
;
String
name
=
""
;
String
name
=
""
;
String
id
=
""
;
String
id
=
""
;
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/process/ResultCode.java
View file @
7c4b3d15
...
@@ -5,6 +5,10 @@ import com.github.wxiaoqi.security.common.util.SystemProperty;
...
@@ -5,6 +5,10 @@ import com.github.wxiaoqi.security.common.util.SystemProperty;
public
class
ResultCode
{
public
class
ResultCode
{
////////////////////////////参数相关///////////////////////////
public
static
int
PARAM_ILLEGAL_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"PARAM_ILLEGAL_CODE"
));
public
static
int
PARAM_EXPIRE_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"PARAM_EXPIRE_CODE"
));
// 操作成功
// 操作成功
public
static
int
SUCCESS_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"SUCCESS_CODE"
));
public
static
int
SUCCESS_CODE
=
Integer
.
valueOf
(
SystemProperty
.
getResultConfig
(
"SUCCESS_CODE"
));
// 操作失败
// 操作失败
...
...
ace-common/src/main/resources/properties/resultcod.properties
View file @
7c4b3d15
...
@@ -32,6 +32,14 @@ RSTOKEN_NULL_CODE=1007
...
@@ -32,6 +32,14 @@ RSTOKEN_NULL_CODE=1007
DB_OPERATION_FAIL_CODE
=
1008
DB_OPERATION_FAIL_CODE
=
1008
1008
=
数据库操作失败
1008
=
数据库操作失败
#参数非法
PARAM_ILLEGAL_CODE
=
1011
1011
=
参数非法,请修改
#参数时效已过时
PARAM_EXPIRE_CODE
=
1010
1010
=
参数时效已过时,不能使用
#请求微信接口失败
#请求微信接口失败
WXAPI_CODE
=
2001
WXAPI_CODE
=
2001
#微信用不不存在
#微信用不不存在
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/AddRentVehicleDTO.java
View file @
7c4b3d15
...
@@ -91,8 +91,16 @@ public class AddRentVehicleDTO{
...
@@ -91,8 +91,16 @@ public class AddRentVehicleDTO{
/**
/**
* 是否使用出租免费天数
* 是否使用出租免费天数
*/
*/
@ApiModelProperty
(
value
=
"是否使用出租免费天数"
)
private
Integer
rentFreeDay
;
private
Integer
rentFreeDay
;
/**
* 优惠券ids
*/
@ApiModelProperty
(
value
=
"优惠券ids"
)
private
String
couponIds
;
public
void
setStartTime
(
Long
startTime
)
{
public
void
setStartTime
(
Long
startTime
)
{
this
.
startTime
=
startTime
;
this
.
startTime
=
startTime
;
this
.
bookStartDate
=
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startTime
),
ZoneOffset
.
ofHours
(
8
)));
this
.
bookStartDate
=
DEFAULT_DATE_TIME_FORMATTER
.
format
(
LocalDateTime
.
ofInstant
(
Instant
.
ofEpochMilli
(
startTime
),
ZoneOffset
.
ofHours
(
8
)));
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/AddTourDTO.java
View file @
7c4b3d15
...
@@ -68,4 +68,10 @@ public class AddTourDTO {
...
@@ -68,4 +68,10 @@ public class AddTourDTO {
@Column
(
name
=
"has_insure"
)
@Column
(
name
=
"has_insure"
)
@ApiModelProperty
(
value
=
"是否保险标记 1--要保险;0--不需要"
)
@ApiModelProperty
(
value
=
"是否保险标记 1--要保险;0--不需要"
)
Integer
hasInsure
;
Integer
hasInsure
;
/**
* 优惠券ids
*/
@ApiModelProperty
(
value
=
"优惠券ids"
)
private
String
couponIds
;
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
7c4b3d15
...
@@ -144,7 +144,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
...
@@ -144,7 +144,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper,BaseOrder> {
//触发退款流程
//触发退款流程
//判断是否已支付
//判断是否已支付
if
(
baseOrder
.
getHasPay
().
equals
(
SYS_TRUE
))
{
if
(
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
()
))
{
//判断订单类型
//判断订单类型
if
(
OrderTypeEnum
.
RentVehicle
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
if
(
OrderTypeEnum
.
RentVehicle
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/config/RabbitUserConfig.java
View file @
7c4b3d15
package
com
.
xxfc
.
platform
.
order
.
config
;
package
com
.
xxfc
.
platform
.
order
.
config
;
import
org.springframework.amqp.core.Binding
;
import
org.springframework.amqp.core.*
;
import
org.springframework.amqp.core.BindingBuilder
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.core.CustomExchange
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
import
org.springframework.amqp.core.Queue
;
import
org.springframework.amqp.rabbit.listener.RabbitListenerContainerFactory
;
import
org.springframework.amqp.support.converter.Jackson2JsonMessageConverter
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -52,5 +53,14 @@ public class RabbitUserConfig {
...
@@ -52,5 +53,14 @@ public class RabbitUserConfig {
public
Binding
cfgDelayBinding
(
Queue
cfgDelayQueue
,
CustomExchange
cfgUserDelayExchange
){
public
Binding
cfgDelayBinding
(
Queue
cfgDelayQueue
,
CustomExchange
cfgUserDelayExchange
){
return
BindingBuilder
.
bind
(
cfgDelayQueue
).
to
(
cfgUserDelayExchange
).
with
(
ORDER_CANCEL_KEY
).
noargs
();
return
BindingBuilder
.
bind
(
cfgDelayQueue
).
to
(
cfgUserDelayExchange
).
with
(
ORDER_CANCEL_KEY
).
noargs
();
}
}
// @Bean
// public RabbitListenerContainerFactory<?> rabbitListenerContainerFactory(ConnectionFactory connectionFactory){
// SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
// factory.setConnectionFactory(connectionFactory);
//// factory.setMessageConverter(new Jackson2JsonMessageConverter());
// factory.setAcknowledgeMode(AcknowledgeMode.MANUAL);
// return factory;
// }
}
}
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/service/OrderRentVehicleService.java
View file @
7c4b3d15
...
@@ -117,7 +117,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -117,7 +117,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
AppUserDTO
dto
=
detail
.
getAppUserDTO
();
AppUserDTO
dto
=
detail
.
getAppUserDTO
();
//如果用户存在,并且为会员,并且车辆有优惠价
//如果用户存在,并且为会员,并且车辆有优惠价
if
(
null
!=
dto
&&
null
!=
detail
.
getRentFreeDay
()
&&
detail
.
getRentFreeDay
()
>
0
&&
dto
.
getRentFreeDays
()
>
0
)
{
if
(
null
!=
dto
&&
null
!=
detail
.
getRentFreeDay
()
&&
detail
.
getRentFreeDay
()
>
0
)
{
if
(
dto
.
getRentFreeDays
()
<=
0
)
{
throw
new
BaseException
(
ResultCode
.
PARAM_EXPIRE_CODE
);
}
if
(
detail
.
getDayNum
()
>
dto
.
getRentFreeDays
())
{
if
(
detail
.
getDayNum
()
>
dto
.
getRentFreeDays
())
{
freeDayNum
=
dto
.
getRentFreeDays
();
freeDayNum
=
dto
.
getRentFreeDays
();
}
else
{
}
else
{
...
@@ -128,6 +131,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
...
@@ -128,6 +131,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
vehicleDayNum
=
detail
.
getDayNum
();
vehicleDayNum
=
detail
.
getDayNum
();
}
}
detail
.
setFreeDays
(
freeDayNum
);
//计算价格
//计算价格
//计算车辆费用
//计算车辆费用
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourTagBannerBiz.java
View file @
7c4b3d15
...
@@ -127,13 +127,13 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
...
@@ -127,13 +127,13 @@ public class TourTagBannerBiz extends BaseBiz<TourTagBannerMapper,TourTagBanner>
* @param tourTagBannerDTOS
* @param tourTagBannerDTOS
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateTourBannerByBatch
(
List
<
TourTagBannerDTO
>
tourTagBannerDTOS
,
UserDTO
userDTO
)
{
public
void
updateTourBannerByBatch
(
List
<
TourTagBannerDTO
>
tourTagBannerDTOS
,
Integer
tagId
,
UserDTO
userDTO
)
{
List
<
Long
>
tourTagBannerIds
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
nonNull
(
tourTagBannerDTO
.
getId
())).
map
(
TourTagBannerDTO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Long
>
tourTagBannerIds
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
nonNull
(
tourTagBannerDTO
.
getId
())).
map
(
TourTagBannerDTO:
:
getId
).
collect
(
Collectors
.
toList
());
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerIds
)){
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerIds
)){
mapper
.
updateTourBannerStatusByTagannerIdsAndTagId
(
tourTagBannerIds
,
t
ourTagBannerDTOS
.
get
(
0
).
getTagId
()
,
1
);
mapper
.
updateTourBannerStatusByTagannerIdsAndTagId
(
tourTagBannerIds
,
t
agId
,
1
);
}
else
{
}
else
{
if
(
CollectionUtils
.
is
Not
Empty
(
tourTagBannerDTOS
)){
if
(
CollectionUtils
.
isEmpty
(
tourTagBannerDTOS
)){
mapper
.
updateTourTagBannerStatusByTagId
(
t
ourTagBannerDTOS
.
get
(
0
).
getTagId
()
,
1
,
Instant
.
now
().
toEpochMilli
());
mapper
.
updateTourTagBannerStatusByTagId
(
t
agId
,
1
,
Instant
.
now
().
toEpochMilli
());
}
}
}
}
List
<
TourTagBannerDTO
>
tagBannerDTOS
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getId
())).
collect
(
Collectors
.
toList
());
List
<
TourTagBannerDTO
>
tagBannerDTOS
=
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getId
())).
collect
(
Collectors
.
toList
());
...
...
xx-tour/xx-tour-server/src/main/java/com/xxfc/platform/tour/biz/TourTagBiz.java
View file @
7c4b3d15
...
@@ -210,7 +210,7 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
...
@@ -210,7 +210,7 @@ public class TourTagBiz extends BaseBiz<TourTagMapper,TourTag> {
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerDTOS
)){
if
(
CollectionUtils
.
isNotEmpty
(
tourTagBannerDTOS
)){
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getTagId
())).
peek
(
tourTagBannerDTO
->
tourTagBannerDTO
.
setTagId
(
tourTagDTO
.
getId
())).
count
();
tourTagBannerDTOS
.
stream
().
filter
(
tourTagBannerDTO
->
Objects
.
isNull
(
tourTagBannerDTO
.
getTagId
())).
peek
(
tourTagBannerDTO
->
tourTagBannerDTO
.
setTagId
(
tourTagDTO
.
getId
())).
count
();
}
}
tourTagBannerBiz
.
updateTourBannerByBatch
(
tourTagBannerDTOS
,
userDTO
);
tourTagBannerBiz
.
updateTourBannerByBatch
(
tourTagBannerDTOS
,
tourTagAndBannerDTO
.
getTourTagDTO
().
getId
(),
userDTO
);
return
effrows
;
return
effrows
;
}
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
7c4b3d15
...
@@ -24,15 +24,14 @@
...
@@ -24,15 +24,14 @@
, st_distance_sphere(point(#{lon}, #{lat}), point(longitude, latitude)) as distance
, st_distance_sphere(point(#{lon}, #{lat}), point(longitude, latitude)) as distance
</if>
</if>
from branch_company
from branch_company
<trim
prefix=
"where"
suffixOverrides=
"and"
>
<where>
<if
test=
"addrCity != null"
>
<if
test=
"addrCity != null"
>
addr_city = #{addrCity}
and addr_city = #{addrCity}
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
longitude is not null and latitude is not null
and longitude is not null and latitude is not null
</if>
</if>
</trim>
</where>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
order by distance asc
order by distance asc
</if>
</if>
...
...
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