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
f7375d97
Commit
f7375d97
authored
Nov 27, 2020
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
7cfc09de
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
25 deletions
+67
-25
pom.xml
xx-common/xx-common-platform-web/pom.xml
+5
-5
SpecialRent.java
...main/java/com/xxfc/platform/order/entity/SpecialRent.java
+13
-2
KlockConstant.java
...ain/java/com/xxfc/platform/order/redis/KlockConstant.java
+10
-0
pom.xml
xx-order/xx-order-server/pom.xml
+5
-0
SpecialRentBiz.java
...main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
+10
-0
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+21
-18
SpecialRentController.java
...a/com/xxfc/platform/order/rest/SpecialRentController.java
+3
-0
No files found.
xx-common/xx-common-platform-web/pom.xml
View file @
f7375d97
...
...
@@ -144,11 +144,11 @@
</dependency>
<!-- 分布式锁 -->
<dependency
>
<groupId>
org.redisson
</groupId
>
<artifactId>
redisson-spring-boot-starter
</artifactId
>
<version>
3.11.0
</version
>
</dependency
>
<!-- <dependency>--
>
<!-- <groupId>org.redisson</groupId>--
>
<!-- <artifactId>redisson-spring-boot-starter</artifactId>--
>
<!-- <version>3.11.0</version>--
>
<!-- </dependency>--
>
<dependency>
<groupId>
commons-io
</groupId>
...
...
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/entity/SpecialRent.java
View file @
f7375d97
...
...
@@ -55,8 +55,12 @@ public class SpecialRent implements Serializable {
@Column
(
name
=
"status"
)
@ApiModelProperty
(
value
=
"状态 0--删除 1--创建 2--取消 3--等待下单 4--下单成功"
)
private
Integer
status
;
/**
public
void
setStatus
(
Integer
status
)
{
this
.
status
=
status
;
}
/**
* 创建时间
*/
@Column
(
name
=
"crt_time"
)
...
...
@@ -273,4 +277,11 @@ public class SpecialRent implements Serializable {
@Column
(
name
=
"price_type"
)
@ApiModelProperty
(
value
=
"超时时间戳"
,
hidden
=
true
)
private
Integer
priceType
;
/**
* 历史订单号
*/
@Column
(
name
=
"old_order_no"
)
@ApiModelProperty
(
value
=
"历史订单号"
,
hidden
=
true
)
private
String
oldOrderNo
;
}
xx-order/xx-order-api/src/main/java/com/xxfc/platform/order/redis/KlockConstant.java
0 → 100755
View file @
f7375d97
package
com
.
xxfc
.
platform
.
order
.
redis
;
public
class
KlockConstant
{
//头部
public
static
final
String
HEAD_SPECIAL_RENT
=
"klock:specialRent"
;
//功能
public
static
final
String
SPECIAL_RENT_ENTITY
=
HEAD_SPECIAL_RENT
+
":entity"
;
}
xx-order/xx-order-server/pom.xml
View file @
f7375d97
...
...
@@ -51,6 +51,11 @@
<version>
3.2.3.RELEASE
</version>
</dependency>
<dependency>
<groupId>
cn.keking
</groupId>
<artifactId>
spring-boot-klock-starter
</artifactId>
<version>
1.4-RELEASE
</version>
</dependency>
</dependencies>
<build>
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/SpecialRentBiz.java
View file @
f7375d97
...
...
@@ -5,6 +5,7 @@ import cn.hutool.core.date.DateTime;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.ace.cache.annotation.Cache
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.UserDTO
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
...
...
@@ -25,6 +26,7 @@ import com.xxfc.platform.vehicle.pojo.vo.VehicleVO;
import
lombok.extern.slf4j.Slf4j
;
import
org.mockito.internal.util.collections.Sets
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.klock.annotation.Klock
;
import
org.springframework.stereotype.Service
;
import
com.xxfc.platform.order.entity.SpecialRent
;
...
...
@@ -37,6 +39,7 @@ import java.util.List;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
SpecialRent
.
STATUS_CRT
;
import
static
com
.
xxfc
.
platform
.
order
.
redis
.
KlockConstant
.
SPECIAL_RENT_ENTITY
;
import
static
com
.
xxfc
.
platform
.
vehicle
.
entity
.
Vehicle
.
STATE_DOWN
;
/**
...
...
@@ -162,6 +165,7 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
rabbitProduct
.
sendSpecialDelayMessage
(
selectById
(
specialRent
.
getId
()),
delayTime
);
}
@Klock
(
name
=
SPECIAL_RENT_ENTITY
,
keys
=
{
"#specialRent.id"
})
public
Long
handleRent
(
@RequestBody
SpecialRent
specialRent
,
VehicleVO
vehicle
)
{
RentVehicleBO
detail
=
new
RentVehicleBO
();
detail
.
setStartTime
(
specialRent
.
getStartTime
());
...
...
@@ -170,6 +174,12 @@ public class SpecialRentBiz extends BaseBiz<SpecialRentMapper, SpecialRent> {
detail
.
setStartAddr
(
specialRent
.
getStartCompanyName
());
detail
.
setStartCompanyId
(
specialRent
.
getStartCompanyId
());
detail
.
setEndCompanyId
(
specialRent
.
getEndCompanyId
());
if
(
StrUtil
.
isNotBlank
(
specialRent
.
getOrderNo
()))
{
if
(
StrUtil
.
isBlank
(
specialRent
.
getOldOrderNo
()))
{
specialRent
.
setOldOrderNo
(
""
);
}
specialRent
.
setOldOrderNo
(
specialRent
.
getOldOrderNo
()+
","
+
specialRent
.
getOrderNo
());
}
detail
.
setOrder
(
new
BaseOrder
(){{
setNo
(
OrderUtil
.
GetOrderNumber
(
""
,
OrderUtil
.
APP_MID
));}});
detail
.
setRentFreeDay
(
SYS_FALSE
);
detail
.
setBookVehicleVO
(
new
BookVehicleVO
(){{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
f7375d97
...
...
@@ -370,27 +370,23 @@ public class OrderCancelBiz {
//已支付,并且是待出行状态,取消预约
if
(
OrderStatusEnum
.
ORDER_CANCEL
.
getCode
().
equals
(
baseOrder
.
getStatus
())
&&
SYS_TRUE
.
equals
(
baseOrder
.
getHasPay
())){
vehicleFeign
.
rentUnbookVehicle
(
orvd
.
getBookRecordId
());
//特惠租车 恢复排班记录
if
(
BaseOrder
.
ORDER_SIGN_SPECIAL
==
baseOrder
.
getOrderSign
())
{
SpecialRent
specialRent
=
specialRentBiz
.
selectOne
(
new
SpecialRent
(){{
setOrderNo
(
baseOrder
.
getNo
());
}});
VehicleVO
vehicle
=
vehicleFeign
.
getVehicleDetail
(
specialRent
.
getVehicleId
()).
getData
();
Long
delayTime
=
specialRentBiz
.
handleRent
(
specialRent
,
vehicle
);
specialRent
.
setUpdTime
(
null
);
specialRentBiz
.
updateSelectiveById
(
specialRent
);
rabbitProduct
.
sendSpecialDelayMessage
(
specialRentBiz
.
selectById
(
specialRent
.
getId
()),
delayTime
);
}
}
else
{
//非特惠租车 拒绝之前预约
if
(
BaseOrder
.
ORDER_SIGN_SPECIAL
!=
baseOrder
.
getOrderSign
())
{
//未支付,拒绝之前的预约
RestResponse
<
Integer
>
restResponse
=
vehicleFeign
.
rentRejectVehicleBooking
(
orvd
.
getBookRecordId
());
}
//未支付,拒绝之前的预约
RestResponse
<
Integer
>
restResponse
=
vehicleFeign
.
rentRejectVehicleBooking
(
orvd
.
getBookRecordId
());
}
// //特惠租车 恢复排班记录
// if (BaseOrder.ORDER_SIGN_SPECIAL == baseOrder.getOrderSign()) {
// SpecialRent specialRent = specialRentBiz.selectOne(new SpecialRent(){{
// setOrderNo(baseOrder.getNo());
// }});
// VehicleVO vehicle = vehicleFeign.getVehicleDetail(specialRent.getVehicleId()).getData();
// Long delayTime = specialRentBiz.handleRent(specialRent, vehicle);
// specialRent.setUpdTime(null);
// specialRentBiz.updateSelectiveById(specialRent);
// rabbitProduct.sendSpecialDelayMessage(specialRentBiz.selectById(specialRent.getId()), delayTime);
// }
//取消租车免费天数使用
if
(
null
!=
orvd
.
getFreeDays
()
&&
orvd
.
getFreeDays
()
>
0
)
{
Integer
freeDays
=
(
null
==
inProgressVO
)
?
orvd
.
getFreeDays
():
inProgressVO
.
getBackFreeDays
();
...
...
@@ -441,6 +437,13 @@ public class OrderCancelBiz {
setOrderStatus
(
SpecialRent
.
ORDER_STATUS_CANCEL
);
}});
}
//特惠租车 恢复排班记录
VehicleVO
vehicle
=
vehicleFeign
.
getVehicleDetail
(
specialRent
.
getVehicleId
()).
getData
();
Long
delayTime
=
specialRentBiz
.
handleRent
(
specialRent
,
vehicle
);
specialRent
.
setUpdTime
(
null
);
specialRentBiz
.
updateSelectiveById
(
specialRent
);
rabbitProduct
.
sendSpecialDelayMessage
(
specialRentBiz
.
selectById
(
specialRent
.
getId
()),
delayTime
);
}
}
else
if
(
OrderTypeEnum
.
TOUR
.
getCode
().
equals
(
baseOrder
.
getType
()))
{
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/SpecialRentController.java
View file @
f7375d97
...
...
@@ -31,6 +31,7 @@ import io.swagger.annotations.ApiModelProperty;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.autoconfigure.klock.annotation.Klock
;
import
org.springframework.web.bind.annotation.*
;
import
javax.persistence.Column
;
...
...
@@ -38,6 +39,7 @@ import javax.persistence.Column;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_FALSE
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
constant
.
CommonConstants
.
SYS_TRUE
;
import
static
com
.
xxfc
.
platform
.
order
.
entity
.
SpecialRent
.*;
import
static
com
.
xxfc
.
platform
.
order
.
redis
.
KlockConstant
.
SPECIAL_RENT_ENTITY
;
@RestController
@RequestMapping
(
"/chw/specialRent"
)
...
...
@@ -153,6 +155,7 @@ public class SpecialRentController extends BaseController<SpecialRentBiz, Specia
@RequestMapping
(
value
=
"/app/specialOrder"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"特惠租车下单"
)
@Klock
(
name
=
SPECIAL_RENT_ENTITY
,
keys
=
{
"#dto.specialId"
})
public
ObjectRestResponse
specialOrder
(
@RequestBody
SpecialOrderDTO
dto
)
{
//查询列表数据
...
...
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