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
1a4d47f7
Commit
1a4d47f7
authored
Sep 20, 2019
by
周健威
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改部分bug
parent
ae656f5b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
BaseOrderBiz.java
...c/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
+11
-2
BaseOrderController.java
...ava/com/xxfc/platform/order/rest/BaseOrderController.java
+20
-0
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/BaseOrderBiz.java
View file @
1a4d47f7
...
...
@@ -215,7 +215,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
return
ObjectRestResponse
.
succ
(
orderPageVo
);
}
//获取两个日期之间的天数
//获取两个日期之间的天数
(不包含头尾)
public
int
getDaysBetweenDateTime
(
DateTime
startDay
,
DateTime
endDay
)
{
int
a
=
0
;
for
(
DateTime
curDate
=
startDay
.
plusDays
(
1
);
curDate
.
compareTo
(
endDay
)
<
0
;
curDate
=
curDate
.
plusDays
(
1
))
{
...
...
@@ -224,6 +224,15 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
return
a
;
}
//获取两个日期之间的天数(包含头尾)
public
int
getDaysBetweenDateTimeHasStartEnd
(
DateTime
startDay
,
DateTime
endDay
)
{
int
a
=
0
;
for
(
DateTime
curDate
=
startDay
;
curDate
.
compareTo
(
endDay
)
<=
0
;
curDate
=
curDate
.
plusDays
(
1
))
{
a
++;
}
return
a
;
}
public
void
updateCrossRefund
(
OrderPageVO
orderPageVO
)
{
//计算延期费用
DedDetailDTO
dedDetailDTO
=
new
DedDetailDTO
();
...
...
@@ -233,7 +242,7 @@ public class BaseOrderBiz extends BaseBiz<BaseOrderMapper, BaseOrder> {
DateTime
startTime
=
DateTime
.
parse
(
new
DateTime
(
orderPageVO
.
getOrderRentVehicleDetail
().
getStartTime
()).
toString
(
DEFAULT_DATE_TIME_FORMATTER
),
DEFAULT_DATE_TIME_FORMATTER
);
//设置使用天数
int
userUsedDay
=
getDaysBetweenDateTime
(
startTime
,
nowTime
);
int
userUsedDay
=
getDaysBetweenDateTime
HasStartEnd
(
startTime
,
nowTime
);
orderPageVO
.
getOrderRentVehicleDetail
().
setUsedDay
(
userUsedDay
);
orderRentVehicleBiz
.
updateSelectiveById
(
orderPageVO
.
getOrderRentVehicleDetail
());
//实际预定的天数
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/BaseOrderController.java
View file @
1a4d47f7
...
...
@@ -35,6 +35,7 @@ import com.xxfc.platform.universal.constant.DictionaryKey;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
import
com.xxfc.platform.universal.vo.OrderPayVo
;
import
com.xxfc.platform.universal.vo.OrderRefundVo
;
import
com.xxfc.platform.vehicle.feign.VehicleFeign
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
...
...
@@ -332,4 +333,23 @@ public class BaseOrderController extends CommonBaseController implements UserRes
List
<
Integer
>
companyIds
;
}
@RequestMapping
(
value
=
"/app/unauth/refund/{no}/{refundAmount}"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ApiOperation
(
value
=
"退款"
)
@IgnoreClientToken
@IgnoreUserToken
public
ObjectRestResponse
refundAmount
(
@PathVariable
(
"no"
)
String
no
,
@PathVariable
(
"refundAmount"
)
BigDecimal
refundAmount
)
{
OrderRefundVo
orv
=
new
OrderRefundVo
();
BaseOrder
baseOrder
=
baseOrderBiz
.
selectOne
(
new
BaseOrder
(){{
setNo
(
no
);
}});
orv
.
setAmount
(
baseOrder
.
getRealAmount
().
multiply
(
new
BigDecimal
(
"100"
)).
intValue
());
orv
.
setOrderNo
(
baseOrder
.
getNo
());
orv
.
setRefundDesc
(
""
);
orv
.
setRefundAmount
(
refundAmount
.
multiply
(
new
BigDecimal
(
"100"
)).
intValue
());
ObjectRestResponse
<
String
>
result
=
thirdFeign
.
refund
(
orv
);
return
ObjectRestResponse
.
succ
(
result
);
}
}
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