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
d2cfcea9
Commit
d2cfcea9
authored
Jun 27, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改车辆和公司相关bug
parent
d31de4a9
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
74 additions
and
17 deletions
+74
-17
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
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+8
-9
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/exception/BaseException.java
View file @
d2cfcea9
...
...
@@ -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.util.process.ResultCode
;
import
java.util.Map
;
/**
* Created by ace on 2017/9/8.
*/
...
...
@@ -50,4 +52,9 @@ public class BaseException extends RuntimeException {
super
(
ResultCode
.
getMsg
(
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 @
d2cfcea9
...
...
@@ -40,7 +40,12 @@ public class EntityUtils {
* @author 王浩彬
*/
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
name
=
""
;
String
id
=
""
;
...
...
@@ -81,7 +86,12 @@ public class EntityUtils {
* @author 王浩彬
*/
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
name
=
""
;
String
id
=
""
;
...
...
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/process/ResultCode.java
View file @
d2cfcea9
...
...
@@ -5,6 +5,10 @@ import com.github.wxiaoqi.security.common.util.SystemProperty;
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"
));
// 操作失败
...
...
ace-common/src/main/resources/properties/resultcod.properties
View file @
d2cfcea9
...
...
@@ -32,6 +32,14 @@ RSTOKEN_NULL_CODE=1007
DB_OPERATION_FAIL_CODE
=
1008
1008
=
数据库操作失败
#参数非法
PARAM_ILLEGAL_CODE
=
1011
1011
=
参数非法,请修改
#参数时效已过时
PARAM_EXPIRE_CODE
=
1010
1010
=
参数时效已过时,不能使用
#请求微信接口失败
WXAPI_CODE
=
2001
#微信用不不存在
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/pojo/AddRentVehicleDTO.java
View file @
d2cfcea9
...
...
@@ -91,8 +91,16 @@ public class AddRentVehicleDTO{
/**
* 是否使用出租免费天数
*/
@ApiModelProperty
(
value
=
"是否使用出租免费天数"
)
private
Integer
rentFreeDay
;
/**
* 优惠券ids
*/
@ApiModelProperty
(
value
=
"优惠券ids"
)
private
String
couponIds
;
public
void
setStartTime
(
Long
startTime
)
{
this
.
startTime
=
startTime
;
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 @
d2cfcea9
...
...
@@ -68,4 +68,10 @@ public class AddTourDTO {
@Column
(
name
=
"has_insure"
)
@ApiModelProperty
(
value
=
"是否保险标记 1--要保险;0--不需要"
)
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 @
d2cfcea9
...
...
@@ -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
()))
{
OrderRentVehicleDetail
orvd
=
orderRentVehicleBiz
.
selectOne
(
new
OrderRentVehicleDetail
(){{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/config/RabbitUserConfig.java
View file @
d2cfcea9
package
com
.
xxfc
.
platform
.
order
.
config
;
import
org.springframework.amqp.core.Binding
;
import
org.springframework.amqp.core.BindingBuilder
;
import
org.springframework.amqp.core.CustomExchange
;
import
org.springframework.amqp.core.Queue
;
import
org.springframework.amqp.core.*
;
import
org.springframework.amqp.rabbit.config.SimpleRabbitListenerContainerFactory
;
import
org.springframework.amqp.rabbit.connection.ConnectionFactory
;
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.Configuration
;
...
...
@@ -52,5 +53,14 @@ public class RabbitUserConfig {
public
Binding
cfgDelayBinding
(
Queue
cfgDelayQueue
,
CustomExchange
cfgUserDelayExchange
){
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 @
d2cfcea9
...
...
@@ -117,7 +117,10 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
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
())
{
freeDayNum
=
dto
.
getRentFreeDays
();
}
else
{
...
...
@@ -128,6 +131,8 @@ public class OrderRentVehicleService extends AbstractOrderHandle<OrderRentVehicl
vehicleDayNum
=
detail
.
getDayNum
();
}
detail
.
setFreeDays
(
freeDayNum
);
//计算价格
//计算车辆费用
VehicleModel
vehicleModel
=
vehicleFeign
.
get
(
detail
.
getModelId
()).
getData
();
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
d2cfcea9
...
...
@@ -24,15 +24,14 @@
, st_distance_sphere(point(#{lon}, #{lat}), point(longitude, latitude)) as distance
</if>
from branch_company
<
trim
prefix=
"where"
suffixOverrides=
"and"
>
<
where
>
<if
test=
"addrCity != null"
>
addr_city = #{addrCity}
and
addr_city = #{addrCity}
</if>
<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>
</trim>
</where>
<if
test=
"lon != null and lat != null"
>
order by distance asc
</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