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
09adea94
Commit
09adea94
authored
Nov 04, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
eddbdd1c
a67f9e67
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
202 additions
and
139 deletions
+202
-139
OrderAccountBiz.java
...ain/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
+21
-3
OrderVehicleCrosstownBiz.java
...com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
+9
-3
OrderCancelBiz.java
...ava/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
+4
-3
RentDepositJobHandler.java
...xxfc/platform/order/jobhandler/RentDepositJobHandler.java
+2
-3
OrderRefundController.java
...a/com/xxfc/platform/order/rest/OrderRefundController.java
+1
-1
OrderPay.java
...ain/java/com/xxfc/platform/universal/entity/OrderPay.java
+11
-4
OrderPayVo.java
.../main/java/com/xxfc/platform/universal/vo/OrderPayVo.java
+6
-4
OrderRefundVo.java
...in/java/com/xxfc/platform/universal/vo/OrderRefundVo.java
+8
-0
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+76
-83
OrderRefundBiz.java
.../java/com/xxfc/platform/universal/biz/OrderRefundBiz.java
+23
-18
Vehicle.java
...c/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
+11
-0
AddOrUpdateVehicleVo.java
.../com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
+3
-0
VehiclePageQueryVo.java
...va/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
+2
-0
VehicleActiveService.java
...a/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
+13
-6
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+5
-5
BranchCompanyMapper.xml
...-server/src/main/resources/mapper/BranchCompanyMapper.xml
+1
-1
VehicleBookRecordMapper.xml
...ver/src/main/resources/mapper/VehicleBookRecordMapper.xml
+1
-1
VehicleMapper.xml
...ehicle-server/src/main/resources/mapper/VehicleMapper.xml
+5
-4
No files found.
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderAccountBiz.java
View file @
09adea94
...
@@ -155,6 +155,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -155,6 +155,9 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
if
(
null
!=
orderViolateCoverAmount
)
{
if
(
null
!=
orderViolateCoverAmount
)
{
depositDeductAmount
=
orderViolateCoverAmount
;
depositDeductAmount
=
orderViolateCoverAmount
;
}
}
if
(
null
!=
depositViolateCoverAmount
)
{
depositDeductAmount
=
depositViolateCoverAmount
;
}
if
(
topAmount
.
compareTo
(
depositDeductAmount
)
>
0
)
{
if
(
topAmount
.
compareTo
(
depositDeductAmount
)
>
0
)
{
totalDeductAmount
=
totalDeductAmount
.
add
(
depositDeductAmount
);
totalDeductAmount
=
totalDeductAmount
.
add
(
depositDeductAmount
);
topAmount
=
topAmount
.
subtract
(
depositDeductAmount
);
topAmount
=
topAmount
.
subtract
(
depositDeductAmount
);
...
@@ -214,6 +217,23 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -214,6 +217,23 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
orv
.
setOrderNo
(
baseOrder
.
getNo
());
orv
.
setOrderNo
(
baseOrder
.
getNo
());
orv
.
setRefundDesc
(
refundDesc
+
refundAmount
.
toString
());
orv
.
setRefundDesc
(
refundDesc
+
refundAmount
.
toString
());
orv
.
setRefundAmount
(
refundAmount
.
multiply
(
new
BigDecimal
(
"100"
)).
intValue
());
orv
.
setRefundAmount
(
refundAmount
.
multiply
(
new
BigDecimal
(
"100"
)).
intValue
());
// originalRefundAmount - refundAmount
Integer
freeze2PayAmount
=
originalRefundAmount
.
subtract
(
refundAmount
).
multiply
(
new
BigDecimal
(
"100"
)).
intValue
();
if
(
AccountTypeEnum
.
OUT_PART_DEPOSIT
.
getCode
().
equals
(
refundType
))
{
// freeze2PayAmount - 违章保证金
for
(
OrderAccountDeduction
deduction
:
oad
.
getDeductions
())
{
if
(
DeductionTypeEnum
.
VIOLATE_TRAFFIC_KEEP
.
getCode
().
equals
(
deduction
.
getType
()))
{
freeze2PayAmount
-=
deduction
.
getAmount
().
multiply
(
new
BigDecimal
(
"100"
)).
intValue
();
break
;
}
}
}
orv
.
setFreeze2PayAmount
(
freeze2PayAmount
);
orv
.
setFreeze2PayDesc
(
""
);
ObjectRestResponse
<
String
>
result
=
thirdFeign
.
refund
(
orv
);
ObjectRestResponse
<
String
>
result
=
thirdFeign
.
refund
(
orv
);
refundTradeNo
=
result
.
getData
();
refundTradeNo
=
result
.
getData
();
if
(
null
==
refundTradeNo
)
{
if
(
null
==
refundTradeNo
)
{
...
@@ -398,9 +418,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
...
@@ -398,9 +418,7 @@ public class OrderAccountBiz extends BaseBiz<OrderAccountMapper,OrderAccount> {
BigDecimal
originalRefundAmount
=
oad
.
getOriginDepositAmount
().
add
(
oad
.
getOriginOrderAmount
());
BigDecimal
originalRefundAmount
=
oad
.
getOriginDepositAmount
().
add
(
oad
.
getOriginOrderAmount
());
//crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve);
//crosstown.getRestDeposit().add(crosstown.getDeductionCost()).subtract(illegalReserve);
String
refundDesc
=
"退还押金:"
+
refundAmont
.
toString
()+
"(已扣除 违章预备金:"
+
illegalReserve
.
toString
();
String
refundDesc
=
"退还车辆押金:"
+
refundAmont
.
toString
();
refundDesc
+=
handleDedRefundDesc
;
refundDesc
+=
")"
;
//还车扣除款 剩余的 钱,再减去违章预备金
//还车扣除款 剩余的 钱,再减去违章预备金
oad
.
getDeductions
().
add
(
oad
.
getDeductions
().
add
(
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/OrderVehicleCrosstownBiz.java
View file @
09adea94
...
@@ -170,7 +170,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -170,7 +170,7 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
OrderRentVehicleDetail
orderRentVehicleDetail
=
orderRentVehicleBiz
.
selectById
(
baseOrder
.
getDetailId
());
if
(
orderVehicleCrosstownDto
.
getType
()
==
CrosstownTypeEnum
.
DEPARTURE
.
getCode
())
{
if
(
orderVehicleCrosstownDto
.
getType
()
==
CrosstownTypeEnum
.
DEPARTURE
.
getCode
())
{
boolean
flag
=
getTodayTime
(
orderRentVehicleDetail
.
getStartTime
());
boolean
flag
=
getTodayTime
(
orderRentVehicleDetail
.
getStartTime
()
,
orderRentVehicleDetail
.
getEndTime
()
);
if
(!
flag
)
{
if
(!
flag
)
{
return
ObjectRestResponse
.
createFailedResult
(
3502
,
"已超过预定还车时间,不能进行交车操作!"
);
return
ObjectRestResponse
.
createFailedResult
(
3502
,
"已超过预定还车时间,不能进行交车操作!"
);
}
}
...
@@ -438,9 +438,15 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
...
@@ -438,9 +438,15 @@ public class OrderVehicleCrosstownBiz extends BaseBiz<OrderVehicaleCrosstownMapp
return
illegalReserve
;
return
illegalReserve
;
}
}
public
boolean
getTodayTime
(
Long
time
)
{
/**
* 当前时间大于预定开始时间当天0点,小于结束时间当天时间24点 2019.11.04
* @param startTime
* @param endTime
* @return
*/
public
boolean
getTodayTime
(
Long
startTime
,
Long
endTime
)
{
long
current
=
System
.
currentTimeMillis
();
long
current
=
System
.
currentTimeMillis
();
if
(
current
<=
(
getDayStart
(
time
)
+
24
*
60
*
60
*
1000
-
1
)
&&
current
>=
getDayStart
(
time
)
)
{
if
(
getDayStart
(
startTime
)
<=
(
current
)
&&
current
<=
getDayStart
(
endTime
)
+
1000
*
3600
*
24
-
1
)
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/biz/inner/OrderCancelBiz.java
View file @
09adea94
...
@@ -3,8 +3,6 @@ package com.xxfc.platform.order.biz.inner;
...
@@ -3,8 +3,6 @@ package com.xxfc.platform.order.biz.inner;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.convert.Convert
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.ArrayUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.UserFeign
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
...
@@ -32,7 +30,6 @@ import org.springframework.stereotype.Service;
...
@@ -32,7 +30,6 @@ import org.springframework.stereotype.Service;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -199,6 +196,10 @@ public class OrderCancelBiz {
...
@@ -199,6 +196,10 @@ public class OrderCancelBiz {
//违约金封顶 租车身份价 * 2天
//违约金封顶 租车身份价 * 2天
BigDecimal
topAmount
=
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
(
2
+
""
));
BigDecimal
topAmount
=
orderItem
.
getUnitPrice
().
multiply
(
new
BigDecimal
(
2
+
""
));
//判断是否修改违约金
if
(
null
!=
changeViolateAmount
)
{
oad
.
changeCancelViolate
(
changeViolateAmount
);
}
//退款流程
//退款流程
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
BigDecimal
.
ZERO
,
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
orderItem
.
getBuyAmount
(),
oad
,
topAmount
,
null
,
changeViolateAmount
);
orderAccountBiz
.
rentRefundProcessCancel
(
baseOrder
,
BigDecimal
.
ZERO
,
timeLag
,
APP_ORDER
+
"_"
+
RENT_REFUND
,
orvd
.
getDeposit
(),
orderItem
.
getBuyAmount
(),
oad
,
topAmount
,
null
,
changeViolateAmount
);
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/jobhandler/RentDepositJobHandler.java
View file @
09adea94
...
@@ -110,7 +110,7 @@ public class RentDepositJobHandler extends IJobHandler {
...
@@ -110,7 +110,7 @@ public class RentDepositJobHandler extends IJobHandler {
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
OrderAccountDetail
oad
=
new
OrderAccountDetail
();
String
refundDesc
=
"退还押金:"
;
String
refundDesc
=
"退还
违章
押金:"
;
BigDecimal
refundAmont
;
BigDecimal
refundAmont
;
if
(
null
!=
orderViolation
)
{
if
(
null
!=
orderViolation
)
{
//设置扣款项
//设置扣款项
...
@@ -120,8 +120,7 @@ public class RentDepositJobHandler extends IJobHandler {
...
@@ -120,8 +120,7 @@ public class RentDepositJobHandler extends IJobHandler {
//还车扣除款 剩余的 钱,再减去违章预备金
//还车扣除款 剩余的 钱,再减去违章预备金
refundAmont
=
orvd
.
getReturnPayResidue
().
subtract
(
orderViolation
.
getPrice
());
refundAmont
=
orvd
.
getReturnPayResidue
().
subtract
(
orderViolation
.
getPrice
());
refundDesc
+=
refundAmont
.
toString
()+
"(已扣除 违章扣款:"
+
refundAmont
.
toString
();
refundDesc
+=
refundAmont
.
toString
();
refundDesc
+=
")"
;
}
else
{
}
else
{
refundAmont
=
orvd
.
getReturnPayResidue
();
refundAmont
=
orvd
.
getReturnPayResidue
();
refundDesc
+=
refundAmont
.
toString
();
refundDesc
+=
refundAmont
.
toString
();
...
...
xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderRefundController.java
View file @
09adea94
...
@@ -74,7 +74,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
...
@@ -74,7 +74,7 @@ public class OrderRefundController extends BaseController<OrderRefundBiz,OrderRe
@ResponseBody
@ResponseBody
@IgnoreClientToken
@IgnoreClientToken
public
ObjectRestResponse
<
BigDecimal
>
getViolatePrice
(
@PathVariable
(
value
=
"no"
)
String
no
)
{
public
ObjectRestResponse
<
BigDecimal
>
getViolatePrice
(
@PathVariable
(
value
=
"no"
)
String
no
)
{
checkA
pp
User
();
checkA
dmin
User
();
OrderPageVO
orderPageVO
=
baseOrderBiz
.
pageByParm
(
new
Query
(
new
PageParam
(){{
OrderPageVO
orderPageVO
=
baseOrderBiz
.
pageByParm
(
new
Query
(
new
PageParam
(){{
setLimit
(
1
);
setLimit
(
1
);
setPage
(
1
);
setPage
(
1
);
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/entity/OrderPay.java
View file @
09adea94
package
com
.
xxfc
.
platform
.
universal
.
entity
;
package
com
.
xxfc
.
platform
.
universal
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
import
javax.persistence.*
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
/**
/**
* 订单支付
* 订单支付
...
@@ -44,7 +47,11 @@ public class OrderPay implements Serializable {
...
@@ -44,7 +47,11 @@ public class OrderPay implements Serializable {
@Column
(
name
=
"pay_way"
)
@Column
(
name
=
"pay_way"
)
@ApiModelProperty
(
value
=
"1:微信公众号支付 2.支付宝即时到账,3,银联"
)
@ApiModelProperty
(
value
=
"1:微信公众号支付 2.支付宝即时到账,3,银联"
)
private
Integer
payWay
;
private
Integer
payWay
;
@Column
(
name
=
"pay_type"
)
@ApiModelProperty
(
value
=
"1:支付宝APP支付,2:支付宝预授权支付"
)
private
Integer
payType
;
//渠道:1-租车;2-旅游
//渠道:1-租车;2-旅游
@Column
(
name
=
"channel"
)
@Column
(
name
=
"channel"
)
@ApiModelProperty
(
value
=
"渠道:1-租车;2-旅游"
)
@ApiModelProperty
(
value
=
"渠道:1-租车;2-旅游"
)
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/vo/OrderPayVo.java
View file @
09adea94
...
@@ -4,10 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
...
@@ -4,10 +4,6 @@ import io.swagger.annotations.ApiModelProperty;
import
lombok.Data
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
/**
/**
...
@@ -69,5 +65,11 @@ public class OrderPayVo{
...
@@ -69,5 +65,11 @@ public class OrderPayVo{
private
String
tradeNo
;
private
String
tradeNo
;
//支付接口返回的流水号
@Column
(
name
=
"serial_number"
)
@ApiModelProperty
(
value
=
"支付接口返回的流水号"
)
private
String
serialNumber
;
@ApiModelProperty
(
value
=
"1:支付宝APP支付,2:支付宝预授权支付"
)
private
Integer
payType
;
}
}
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/vo/OrderRefundVo.java
View file @
09adea94
...
@@ -8,6 +8,7 @@ import javax.persistence.GeneratedValue;
...
@@ -8,6 +8,7 @@ import javax.persistence.GeneratedValue;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
/**
...
@@ -37,5 +38,12 @@ public class OrderRefundVo{
...
@@ -37,5 +38,12 @@ public class OrderRefundVo{
@ApiModelProperty
(
value
=
"退款描述"
)
@ApiModelProperty
(
value
=
"退款描述"
)
private
String
refundDesc
;
private
String
refundDesc
;
//冻结转支付描述 只用于预支付相关
@ApiModelProperty
(
value
=
"冻结转支付描述"
)
private
String
freeze2PayDesc
;
//冻结转支付金额 只用于预支付相关
@ApiModelProperty
(
value
=
"冻结转支付金额"
)
private
Integer
freeze2PayAmount
;
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
09adea94
...
@@ -71,7 +71,6 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -71,7 +71,6 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
private
String
wy_secret
;
private
String
wy_secret
;
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
public
JSONObject
preparepay
(
OrderPayVo
orderPayVo
)
{
if
(
null
==
orderPayVo
)
{
if
(
null
==
orderPayVo
)
{
log
.
error
(
"-----参数为空-----------"
);
log
.
error
(
"-----参数为空-----------"
);
...
@@ -115,6 +114,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -115,6 +114,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
jsParam
=
WXPay
.
apppay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
jsParam
=
WXPay
.
apppay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
}
else
if
(
type
==
1
&&
payWay
==
2
)
{
}
else
if
(
type
==
1
&&
payWay
==
2
)
{
sellerAccount
=
SystemConfig
.
ALIPAY_PID
;
sellerAccount
=
SystemConfig
.
ALIPAY_PID
;
orderPayVo
.
setPayType
(
2
);
jsParam
=
generateAliPayment
(
orderPayVo
,
notifyUrl
);
jsParam
=
generateAliPayment
(
orderPayVo
,
notifyUrl
);
}
else
if
(
type
==
3
&&
payWay
==
1
){
}
else
if
(
type
==
3
&&
payWay
==
1
){
sellerAccount
=
SystemConfig
.
APP_PARTNER
;
sellerAccount
=
SystemConfig
.
APP_PARTNER
;
...
@@ -218,22 +218,10 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -218,22 +218,10 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
valueStr
=
(
i
==
values
.
length
-
1
)
?
valueStr
+
values
[
i
]
valueStr
=
(
i
==
values
.
length
-
1
)
?
valueStr
+
values
[
i
]
:
valueStr
+
values
[
i
]
+
","
;
:
valueStr
+
values
[
i
]
+
","
;
}
}
log
.
info
(
valueStr
);
//乱码解决,这段代码在出现乱码时使用。
//valueStr = new String(valueStr.getBytes("ISO-8859-1"), "utf-8");
params
.
put
(
name
,
valueStr
);
params
.
put
(
name
,
valueStr
);
}
}
String
msg
=
JSONObject
.
toJSONString
(
params
);
String
msg
=
JSONObject
.
toJSONString
(
params
);
log
.
info
(
"alipay notify message={}"
,
msg
);
log
.
info
(
"alipay notify message={}"
,
msg
);
//添加回调记录
// PaymentCallbackLog callbackLog = new PaymentCallbackLog();
// callbackLog.setPayCode(rstradeNo);
// callbackLog.setPayType(SystemConstant.PayType.ALIPAY);
// callbackLog.setOrderCode(rsOrderCode);
// callbackLog.setMessage(msg);
// paymentCallbackLogRepository.save(callbackLog);
// 切记alipaypublickey是支付宝的公钥,请去open.alipay.com对应应用下查看。
// boolean AlipaySignature.rsaCheckV1(Map<String, String> params, String publicKey, String charset, String sign_type)
//支付宝回调验签
//支付宝回调验签
try
{
try
{
boolean
flag
=
AlipaySignature
.
rsaCheckV1
(
params
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
CHARSET_UTF8
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
boolean
flag
=
AlipaySignature
.
rsaCheckV1
(
params
,
SystemConfig
.
ALIPAY_PUBLIC_KEY
,
AlipayConstants
.
CHARSET_UTF8
,
AlipayConstants
.
SIGN_TYPE_RSA2
);
...
@@ -242,36 +230,26 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -242,36 +230,26 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
}
}
String
rsTradeStatus
=
params
.
get
(
"trade_status"
);
String
rsTradeStatus
=
params
.
get
(
"trade_status"
);
if
(!
SystemConfig
.
ALIPAY_TRADE_FINISHED
.
equals
(
rsTradeStatus
)
&&
!
SystemConfig
.
ALIPAY_TRADE_SUCCESS
.
equals
(
rsTradeStatus
))
{
if
(
StringUtils
.
isBlank
(
rsTradeStatus
))
{
//订单预授权支付回调
String
status
=
params
.
get
(
"status"
);
if
(!
status
.
equals
(
"SUCCESS"
))
{
log
.
info
(
"alipay order trade_status has problem, result={}"
,
msg
);
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
}
//订单APP支付回调
}
else
if
(!
SystemConfig
.
ALIPAY_TRADE_FINISHED
.
equals
(
rsTradeStatus
)
&&
!
SystemConfig
.
ALIPAY_TRADE_SUCCESS
.
equals
(
rsTradeStatus
))
{
log
.
info
(
"alipay order trade_status has problem, result={}"
,
msg
);
log
.
info
(
"alipay order trade_status has problem, result={}"
,
msg
);
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
return
ObjectRestResponse
.
createDefaultFail
().
getMessage
();
}
}
//String rsSellerId = params.get("seller_id");
//
// PaymentRecord paymentRecord = paymentRecordRepository.findOneByOrderCode(rsOrderCode);
// //验证付款信息
// if (paymentRecord == null || !paymentRecord.getAmount().toString().equals(rsAmount)
// || !aliPayConfig.getAppId().equals(rsAppId)) {
// log.info("alipay order notify fail, result={}", msg);
// return Response.FAILURE.getHeader().getMessage();
// }
// //重复回调
// if (paymentRecord.getStatus().intValue() != 1) {
// log.info("alipay order repeat notify, result={}", msg);
// return Response.SUCCESS().getHeader().getMessage();
// }
//
// paymentRecord.setPayCode(rstradeNo);
// paymentRecord.setStatus(2);
// paymentRecordRepository.save(paymentRecord);
// Map<String, Object> sendMap = DataUtils.objectToMap(paymentRecord);
// sendMap.put("amount", new BigDecimal(rsAmount).multiply(new BigDecimal(100)).intValue());
// sendMsgToOrder(JSONObject.toJSONString(sendMap));
String
tradeNo
=
params
.
get
(
"out_trade_no"
);
String
tradeNo
=
params
.
get
(
"out_trade_no"
);
if
(
StringUtils
.
isBlank
(
tradeNo
))
{
tradeNo
=
params
.
get
(
"out_request_no"
);
}
String
operationId
=
params
.
get
(
"trade_no"
);
String
operationId
=
params
.
get
(
"trade_no"
);
if
(
StringUtils
.
isBlank
(
operationId
))
{
operationId
=
params
.
get
(
"auth_no"
);
}
notice
(
tradeNo
,
operationId
);
notice
(
tradeNo
,
operationId
);
return
ObjectRestResponse
.
succ
().
getMessage
();
return
ObjectRestResponse
.
succ
().
getMessage
();
}
catch
(
AlipayApiException
e
)
{
}
catch
(
AlipayApiException
e
)
{
...
@@ -291,7 +269,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -291,7 +269,7 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
AlipayClient
alipayClient
=
getAlipayClient
();
AlipayClient
alipayClient
=
getAlipayClient
();
//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
//实例化具体API对应的request类,类名称和接口名称对应,当前调用接口名称:alipay.trade.app.pay
try
{
try
{
return
appOrderPay
(
alipayClient
,
orderPayVo
,
notifyUrl
);
return
fundAuthOrderAppFreeze
(
alipayClient
,
orderPayVo
,
notifyUrl
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -349,13 +327,10 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -349,13 +327,10 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
//预授权冻结
//预授权冻结
public
String
fundAuthOrderAppFreeze
(
AlipayClient
alipayClient
,
OrderPayVo
orderPayVo
,
String
notifyUrl
)
throws
AlipayApiException
{
public
String
fundAuthOrderAppFreeze
(
AlipayClient
alipayClient
,
OrderPayVo
orderPayVo
,
String
notifyUrl
)
throws
AlipayApiException
{
AlipayFundAuthOrderAppFreezeRequest
request
=
new
AlipayFundAuthOrderAppFreezeRequest
();
AlipayFundAuthOrderAppFreezeRequest
request
=
new
AlipayFundAuthOrderAppFreezeRequest
();
AlipayFundAuthOrderAppFreezeModel
model
=
new
AlipayFundAuthOrderAppFreezeModel
();
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
BigDecimal
realAmount
=
new
BigDecimal
(
orderPayVo
.
getAmount
().
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
request
.
setBizContent
(
"{"
+
request
.
setBizContent
(
"{"
+
"\"auth_code\":\""
+
orderPayVo
.
getTradeNo
()
+
"\","
+
"\"out_order_no\":\""
+
orderPayVo
.
getTradeNo
()
+
"\","
+
"\"auth_code_type\":\"bar_code\","
+
"\"out_request_no\":\""
+
orderPayVo
.
getTradeNo
()
+
"\","
+
"\"out_order_no\":\""
+
orderPayVo
.
getOrderNo
()
+
"\","
+
"\"out_request_no\":\""
+
orderPayVo
.
getOrderNo
()
+
"\","
+
"\"order_title\":\""
+
orderPayVo
.
getSubject
()
+
"\","
+
"\"order_title\":\""
+
orderPayVo
.
getSubject
()
+
"\","
+
"\"product_code\":\"PRE_AUTH_ONLINE\","
+
"\"product_code\":\"PRE_AUTH_ONLINE\","
+
"\"pay_timeout\":\"1d\","
+
"\"pay_timeout\":\"1d\","
+
...
@@ -449,80 +424,88 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -449,80 +424,88 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
//解冻预授权
//解冻预授权
public
void
fundAuthOrderUnFreeze
(
AlipayClient
alipayClient
)
throws
AlipayApiException
{
public
boolean
fundAuthOrderUnFreeze
(
String
outTradeNo
,
String
serialNumber
,
Integer
refundAmount
,
String
refundReason
)
throws
AlipayApiException
{
String
notifyUrl
=
weixinHost
+
"/api/universal/pay/app/unauth/notify/alipay"
;
AlipayClient
alipayClient
=
getAlipayClient
();
BigDecimal
realAmount
=
new
BigDecimal
(
refundAmount
.
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
AlipayFundAuthOrderUnfreezeRequest
request
=
new
AlipayFundAuthOrderUnfreezeRequest
();
AlipayFundAuthOrderUnfreezeRequest
request
=
new
AlipayFundAuthOrderUnfreezeRequest
();
AlipayFundAuthOrderUnfreezeModel
model
=
new
AlipayFundAuthOrderUnfreezeModel
();
AlipayFundAuthOrderUnfreezeModel
model
=
new
AlipayFundAuthOrderUnfreezeModel
();
model
.
setAuthNo
(
"2017120410002001390208978986"
);
// 支付宝资金授权订单号,在授权冻结成功时返回需要入库保存
model
.
setAuthNo
(
serialNumber
);
// 支付宝资金授权订单号,在授权冻结成功时返回需要入库保存
model
.
setOutRequestNo
(
"UnfreezeRequestNo000003"
);
//同一商户每次不同的资金操作请求,商户请求流水号不能重复,且与冻结流水号不同
model
.
setOutRequestNo
(
outTradeNo
);
//同一商户每次不同的资金操作请求,商户请求流水号不能重复,且与冻结流水号不同
model
.
setAmount
(
"0.01"
);
// 本次操作解冻的金额,单位为:元(人民币),精确到小数点后两位
model
.
setAmount
(
realAmount
.
toString
()
);
// 本次操作解冻的金额,单位为:元(人民币),精确到小数点后两位
model
.
setRemark
(
"预授权解冻"
);
// 商户对本次解冻操作的附言描述,长度不超过100个字母或50个汉字
model
.
setRemark
(
refundReason
);
// 商户对本次解冻操作的附言描述,长度不超过100个字母或50个汉字
//选填字段,信用授权订单,针对信用全免订单,传入该值完结信用订单,形成芝麻履约记录
//选填字段,信用授权订单,针对信用全免订单,传入该值完结信用订单,形成芝麻履约记录
// model.setExtraParam("{\"unfreezeBizInfo\":\"{\\\"bizComplete\\\":\\\"true\\\"}\"}");
// model.setExtraParam("{\"unfreezeBizInfo\":\"{\\\"bizComplete\\\":\\\"true\\\"}\"}");
request
.
setBizModel
(
model
);
request
.
setBizModel
(
model
);
request
.
setNotifyUrl
(
""
);
//异步通知地址,必填,该接口只通过该参数进行异步通知
request
.
setNotifyUrl
(
notifyUrl
);
//异步通知地址,必填,该接口只通过该参数进行异步通知
AlipayFundAuthOrderUnfreezeResponse
response
=
alipayClient
.
execute
(
request
);
AlipayFundAuthOrderUnfreezeResponse
response
=
alipayClient
.
execute
(
request
);
log
.
info
(
"response: {}"
+
response
.
getBody
());
log
.
info
(
"response: {}"
+
response
.
getBody
());
if
(
response
.
isSuccess
())
{
log
.
info
(
"调用成功"
);
log
.
info
(
"response: {}"
+
response
.
getBody
());
//签名后的参数,直接入参到
return
true
;
}
else
{
log
.
info
(
"调用失败"
);
return
false
;
}
}
}
//取消预授权
//取消预授权
public
void
fundAuthCancel
()
throws
AlipayApiException
{
public
String
fundAuthCancel
(
String
outTradeNo
,
String
serialNumber
,
String
refundReason
)
throws
AlipayApiException
{
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
"https://openapi.alipay.com/gateway.do"
,
"app_id"
,
"your private_key"
,
"json"
,
"GBK"
,
"alipay_public_key"
,
"RSA2"
);
AlipayClient
alipayClient
=
getAlipayClient
();
String
notifyUrl
=
weixinHost
+
"/api/universal/pay/app/unauth/notify/alipay"
;
AlipayFundAuthOperationCancelRequest
request
=
new
AlipayFundAuthOperationCancelRequest
();
AlipayFundAuthOperationCancelRequest
request
=
new
AlipayFundAuthOperationCancelRequest
();
AlipayFundAuthOperationCancelModel
model
=
new
AlipayFundAuthOperationCancelModel
();
AlipayFundAuthOperationCancelModel
model
=
new
AlipayFundAuthOperationCancelModel
();
//model.setAuthNo("2017120110002001390206804295"
); // 支付宝资金授权订单号,在授权冻结成功时返回参数中获得
model
.
setAuthNo
(
outTradeNo
);
// 支付宝资金授权订单号,在授权冻结成功时返回参数中获得
model
.
setOutOrderNo
(
"orderFreeze000005"
);
//商户的授权资金订单号,与支付宝的授权资金订单号不能同时为空
//model.setOutOrderNo(orderPayVo.getOrderNo()
); //商户的授权资金订单号,与支付宝的授权资金订单号不能同时为空
//model.setOperationId("20171201317348823902"); //支付宝的授权资金操作流水号
//model.setOperationId("20171201317348823902"); //支付宝的授权资金操作流水号
model
.
setOutRequestNo
(
"requestNo000005"
);
//与支付宝的授权资金操作流水号不能同时为空,与冻结流水号相同
model
.
setOutRequestNo
(
serialNumber
);
//与支付宝的授权资金操作流水号不能同时为空,与冻结流水号相同
model
.
setRemark
(
"预授权撤销"
);
// 商户对本次撤销操作的附言描述,长度不超过100个字母或50个汉字
model
.
setRemark
(
refundReason
);
// 商户对本次撤销操作的附言描述,长度不超过100个字母或50个汉字
request
.
setBizModel
(
model
);
request
.
setBizModel
(
model
);
request
.
setNotifyUrl
(
""
);
//异步通知地址,必填,该接口只通过该参数进行异步通知
request
.
setNotifyUrl
(
notifyUrl
);
//异步通知地址,必填,该接口只通过该参数进行异步通知
AlipayFundAuthOperationCancelResponse
response
=
alipayClient
.
execute
(
request
);
AlipayFundAuthOperationCancelResponse
response
=
alipayClient
.
execute
(
request
);
log
.
info
(
"response: {}"
+
response
.
getBody
());
log
.
info
(
"response: {}"
+
response
.
getBody
());
if
(
response
.
isSuccess
())
{
log
.
info
(
"调用成功"
);
log
.
info
(
"response: {}"
+
response
.
getBody
());
//签名后的参数,直接入参到
return
response
.
getBody
();
}
else
{
log
.
info
(
"调用失败"
);
return
null
;
}
}
}
//预授权转支付
//预授权转支付
public
void
tradePay
()
throws
AlipayApiException
{
public
boolean
tradePay
(
String
outTradeNo
,
String
serialNumber
,
Integer
refundAmount
,
String
refundReason
,
String
subject
)
throws
AlipayApiException
{
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
"https://openapi.alipay.com/gateway.do"
,
"app_id"
,
"your private_key"
,
"json"
,
"utf-8"
,
"alipay_public_key"
,
"RSA2"
);
String
notifyUrl
=
weixinHost
+
"/api/universal/pay/app/unauth/notify/alipay"
;
AlipayClient
alipayClient
=
getAlipayClient
();
BigDecimal
realAmount
=
new
BigDecimal
(
refundAmount
.
toString
()).
divide
(
new
BigDecimal
(
"100"
),
2
,
BigDecimal
.
ROUND_UP
);
AlipayTradePayRequest
request
=
new
AlipayTradePayRequest
();
AlipayTradePayRequest
request
=
new
AlipayTradePayRequest
();
AlipayTradePayModel
model
=
new
AlipayTradePayModel
();
AlipayTradePayModel
model
=
new
AlipayTradePayModel
();
model
.
setOutTradeNo
(
"20180412100020088982"
);
// 预授权转支付商户订单号,为新的商户交易流水号;如果重试发起扣款,商户订单号不要变;
model
.
setOutTradeNo
(
outTradeNo
);
// 预授权转支付商户订单号,为新的商户交易流水号;如果重试发起扣款,商户订单号不要变;
model
.
setProductCode
(
"PRE_AUTH_ONLINE"
);
// 固定值PRE_AUTH_ONLINE
model
.
setProductCode
(
"PRE_AUTH_ONLINE"
);
// 固定值PRE_AUTH_ONLINE
model
.
setAuthNo
(
"2018041210002001660228733635"
);
// 填写预授权冻结交易号
model
.
setAuthNo
(
serialNumber
);
// 填写预授权冻结交易号
model
.
setSubject
(
"预授权转支付测试"
);
// 解冻转支付标题,用于展示在支付宝账单中
model
.
setSubject
(
subject
);
// 解冻转支付标题,用于展示在支付宝账单中
model
.
setTotalAmount
(
"0.01"
);
// 结算支付金额
model
.
setTotalAmount
(
realAmount
.
toString
()
);
// 结算支付金额
model
.
setSellerId
(
SystemConfig
.
ALIPAY_PID
);
// 填写卖家支付宝账户pid
model
.
setSellerId
(
SystemConfig
.
ALIPAY_PID
);
// 填写卖家支付宝账户pid
model
.
setBuyerId
(
SystemConfig
.
ALIPAY_APPID
);
// 填写预授权用户uid,通过预授权冻结接口返回的payer_user_id字段获取
model
.
setBuyerId
(
SystemConfig
.
ALIPAY_APPID
);
// 填写预授权用户uid,通过预授权冻结接口返回的payer_user_id字段获取
model
.
setStoreId
(
"test_store_id"
);
// 填写实际交易发生的终端编号,与预授权的outStoreCode保持一致即可
model
.
setBody
(
refundReason
);
// 可填写备注信息
model
.
setBody
(
"预授权解冻转支付测试"
);
// 可填写备注信息
//如果需要从一笔授权中完成多笔订单支付,保持auth_no不变,不同订单根据outTradeNo进行标识,此时auth_confirm_mode不传或者传入NOT_COMPLETE;进行到最后一笔转支付时,auth_confirm_mode传入COMPLETE由支付宝完成剩余金额自动解冻,或者商户自行调用解冻接口将剩余金额解冻。
//如果需要从一笔授权中完成多笔订单支付,保持auth_no不变,不同订单根据outTradeNo进行标识,此时auth_confirm_mode不传或者传入NOT_COMPLETE;进行到最后一笔转支付时,auth_confirm_mode传入COMPLETE由支付宝完成剩余金额自动解冻,或者商户自行调用解冻接口将剩余金额解冻。
model
.
setAuthConfirmMode
(
"NOT_COMPLETE"
);
//传入该值用户剩余金额不会自动解冻
model
.
setAuthConfirmMode
(
"NOT_COMPLETE"
);
//传入该值用户剩余金额不会自动解冻
request
.
setBizModel
(
model
);
request
.
setBizModel
(
model
);
request
.
setNotifyUrl
(
""
);
//异步通知地址,必填,该接口只通过该参数进行异步通知
request
.
setNotifyUrl
(
notifyUrl
);
//异步通知地址,必填,该接口只通过该参数进行异步通知
AlipayTradePayResponse
response
=
alipayClient
.
execute
(
request
);
AlipayTradePayResponse
response
=
alipayClient
.
execute
(
request
);
if
(
response
.
isSuccess
())
{
if
(
response
.
isSuccess
())
{
System
.
out
.
println
(
"调用成功"
);
log
.
info
(
"response: {}"
+
response
.
getBody
());
log
.
info
(
"response: {}"
+
response
.
getBody
());
return
true
;
}
else
{
}
else
{
System
.
out
.
println
(
"调用失败"
);
log
.
info
(
"调用失败"
);
return
false
;
}
}
}
}
//退款
public
void
testTradeRefund
()
throws
Exception
{
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
"https://openapi.alipay.com/gateway.do"
,
"app_id"
,
"your private_key"
,
"json"
,
"GBK"
,
"alipay_public_key"
,
"RSA2"
);
AlipayTradeRefundModel
model
=
new
AlipayTradeRefundModel
();
model
.
setOutTradeNo
(
"tradePay000002"
);
//与预授权转支付商户订单号相同,代表对该笔交易退款
model
.
setRefundAmount
(
"0.01"
);
model
.
setRefundReason
(
"预授权退款测试"
);
model
.
setOutRequestNo
(
"refund0000001"
);
//标识一次退款请求,同一笔交易多次退款需要保证唯一,如部分退款则此参数必传。
AlipayTradeRefundRequest
request
=
new
AlipayTradeRefundRequest
();
request
.
setBizModel
(
model
);
AlipayTradeRefundResponse
response
=
alipayClient
.
execute
(
request
);
log
.
info
(
"response: {}"
+
response
.
getBody
());
}
/**
/**
* APP支付退款
* APP支付退款
*
*
...
@@ -561,8 +544,18 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
...
@@ -561,8 +544,18 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper, OrderPay> {
return
false
;
return
false
;
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
throws
AlipayApiException
{
OrderPayBiz
orderPayBiz
=
new
OrderPayBiz
();
OrderPayBiz
orderPayBiz
=
new
OrderPayBiz
();
orderPayBiz
.
alipayOrderRefund
(
"20190806134440000001"
,
"2019080622001421530542309594"
,
3
,
"xxxx"
,
""
);
OrderPayVo
orderPayVo
=
new
OrderPayVo
();
orderPayVo
.
setOrderNo
(
"20191024153859000003"
);
orderPayVo
.
setTradeNo
(
"2019102410002001530572359246"
);
orderPayVo
.
setSerialNumber
(
"2019102410002001530572351411"
);
orderPayVo
.
setAmount
(
3
);
orderPayVo
.
setBody
(
"扣除租车订单费用"
);
orderPayVo
.
setSubject
(
"租车订单交易费用"
);
//orderPayBiz.fundAuthOrderUnFreeze(orderPayVo, "");
//orderPayBiz.alipayOrderRefund("20191024153859000003","2019102422001421530513773694", 2, "xxxx", "");
//orderPayBiz.tradePay(orderPayVo, "");
//orderPayBiz.fundAuthCancel(orderPayVo, "");
}
}
}
}
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderRefundBiz.java
View file @
09adea94
...
@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -5,7 +5,6 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.process.SystemConfig
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
com.xxfc.platform.universal.entity.Dictionary
;
import
com.xxfc.platform.universal.entity.OrderPay
;
import
com.xxfc.platform.universal.entity.OrderPay
;
import
com.xxfc.platform.universal.entity.OrderRefund
;
import
com.xxfc.platform.universal.entity.OrderRefund
;
import
com.xxfc.platform.universal.mapper.OrderRefundMapper
;
import
com.xxfc.platform.universal.mapper.OrderRefundMapper
;
...
@@ -21,10 +20,6 @@ import org.springframework.stereotype.Service;
...
@@ -21,10 +20,6 @@ import org.springframework.stereotype.Service;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
PAY_DEMOTION
;
import
static
com
.
xxfc
.
platform
.
universal
.
constant
.
DictionaryKey
.
UNIVERSAL_PAY
;
/**
/**
* 订单支付退款表
* 订单支付退款表
...
@@ -59,17 +54,17 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
...
@@ -59,17 +54,17 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
Integer
refundAmount
=
orderRefundVo
.
getRefundAmount
();
Integer
refundAmount
=
orderRefundVo
.
getRefundAmount
();
//临时处理
//临时处理
Map
<
String
,
Dictionary
>
dictionaryMap
=
dictionaryBiz
.
getAll4Map
();
//
Map<String, Dictionary> dictionaryMap = dictionaryBiz.getAll4Map();
Integer
demotion
=
Integer
.
valueOf
(
dictionaryMap
.
get
(
UNIVERSAL_PAY
+
"_"
+
PAY_DEMOTION
).
getDetail
());
//
Integer demotion = Integer.valueOf(dictionaryMap.get(UNIVERSAL_PAY + "_" + PAY_DEMOTION).getDetail());
payAmount
=
payAmount
/
demotion
;
//
payAmount = payAmount / demotion;
if
(
payAmount
<=
0
)
{
//
if (payAmount <= 0) {
payAmount
=
1
;
//
payAmount = 1;
}
//
}
//
refundAmount
=
refundAmount
/
demotion
;
//
refundAmount = refundAmount / demotion;
if
(
refundAmount
<=
0
)
{
//
if (refundAmount <= 0) {
refundAmount
=
1
;
//
refundAmount = 1;
}
//
}
String
refundDesc
=
StringUtils
.
isNotBlank
(
orderRefundVo
.
getRefundDesc
())
?
orderRefundVo
.
getRefundDesc
()
:
"审核通过,退款"
;
String
refundDesc
=
StringUtils
.
isNotBlank
(
orderRefundVo
.
getRefundDesc
())
?
orderRefundVo
.
getRefundDesc
()
:
"审核通过,退款"
;
String
out_refund_no
=
Snowflake
.
build
()
+
""
;
String
out_refund_no
=
Snowflake
.
build
()
+
""
;
...
@@ -89,9 +84,19 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
...
@@ -89,9 +84,19 @@ public class OrderRefundBiz extends BaseBiz<OrderRefundMapper, OrderRefund> {
OrderPay
orderPay
=
list
.
get
(
0
);
OrderPay
orderPay
=
list
.
get
(
0
);
String
out_trade_no
=
orderPay
.
getTradeNo
();
String
out_trade_no
=
orderPay
.
getTradeNo
();
boolean
flag
=
false
;
boolean
flag
=
false
;
if
(
orderPay
.
getPayWay
()
==
2
)
{
if
(
orderPay
.
getPayWay
()
==
2
&&
orderPay
.
getPayType
()
==
1
)
{
log
.
info
(
"======支付宝退款中==========="
);
log
.
info
(
"======支付宝
APP支付
退款中==========="
);
flag
=
payBiz
.
alipayOrderRefund
(
out_trade_no
,
orderPay
.
getSerialNumber
(),
refundAmount
,
refundDesc
,
out_trade_no
+
System
.
currentTimeMillis
());
flag
=
payBiz
.
alipayOrderRefund
(
out_trade_no
,
orderPay
.
getSerialNumber
(),
refundAmount
,
refundDesc
,
out_trade_no
+
System
.
currentTimeMillis
());
}
else
if
(
orderPay
.
getPayWay
()
==
2
&&
orderPay
.
getPayType
()
==
2
)
{
log
.
info
(
"======支付宝预授权支付退款中==========="
);
//需要根据实际传过来的参数类型来进行解冻或者预授权转支付
if
(
orderRefundVo
.
getRefundAmount
()
!=
0
)
{
//解冻金额
flag
=
payBiz
.
fundAuthOrderUnFreeze
(
orderPay
.
getTradeNo
()
+
System
.
currentTimeMillis
(),
orderPay
.
getSerialNumber
(),
orderRefundVo
.
getRefundAmount
(),
orderRefundVo
.
getRefundDesc
());
}
//预授权转支付
if
(
orderRefundVo
.
getFreeze2PayAmount
()
!=
0
)
{
flag
=
payBiz
.
tradePay
(
orderPay
.
getTradeNo
()
+
System
.
currentTimeMillis
(),
orderPay
.
getSerialNumber
(),
orderRefundVo
.
getFreeze2PayAmount
(),
orderRefundVo
.
getFreeze2PayDesc
(),
orderRefundVo
.
getFreeze2PayDesc
());
}
}
else
if
(
orderPay
.
getPayWay
()
==
1
){
}
else
if
(
orderPay
.
getPayWay
()
==
1
){
log
.
info
(
"======微信退款中==========="
);
log
.
info
(
"======微信退款中==========="
);
flag
=
WxPayRefundUtils
.
refund
(
appid
,
mchId
,
partnerKey
,
out_trade_no
,
out_refund_no
,
payAmount
+
""
,
flag
=
WxPayRefundUtils
.
refund
(
appid
,
mchId
,
partnerKey
,
out_trade_no
,
out_refund_no
,
payAmount
+
""
,
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/entity/Vehicle.java
View file @
09adea94
...
@@ -64,11 +64,17 @@ public class Vehicle {
...
@@ -64,11 +64,17 @@ public class Vehicle {
*/
*/
private
Integer
insuranceCompany
;
private
Integer
insuranceCompany
;
private
Integer
strongInsuranceCompany
;
/**
/**
* 保险单号
* 保险单号
*/
*/
private
String
insuranceNo
;
private
String
insuranceNo
;
/**
* 强险单号
*/
private
String
strongInsuranceNo
;
/**
/**
* 保险开始时间
* 保险开始时间
...
@@ -80,6 +86,11 @@ public class Vehicle {
...
@@ -80,6 +86,11 @@ public class Vehicle {
*/
*/
private
Date
insuranceEndDate
;
private
Date
insuranceEndDate
;
/**
* 强险的结束时间
*/
private
Date
strongInsuranceEndDate
;
/**
/**
* 年审时间
* 年审时间
*/
*/
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/AddOrUpdateVehicleVo.java
View file @
09adea94
...
@@ -68,12 +68,14 @@ public class AddOrUpdateVehicleVo {
...
@@ -68,12 +68,14 @@ public class AddOrUpdateVehicleVo {
* 保险公司,见常量表
* 保险公司,见常量表
*/
*/
private
Integer
insuranceCompany
;
private
Integer
insuranceCompany
;
private
Integer
strongInsuranceCompany
;
/**
/**
* 保险单号
* 保险单号
*/
*/
private
String
insuranceNo
;
private
String
insuranceNo
;
private
String
strongInsuranceNo
;
/**
/**
* 保险开始时间
* 保险开始时间
...
@@ -84,6 +86,7 @@ public class AddOrUpdateVehicleVo {
...
@@ -84,6 +86,7 @@ public class AddOrUpdateVehicleVo {
* 保险结束时间
* 保险结束时间
*/
*/
private
Date
insuranceEndDate
;
private
Date
insuranceEndDate
;
private
Date
strongInsuranceEndDate
;
/**
/**
* 年审时间
* 年审时间
...
...
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/VehiclePageQueryVo.java
View file @
09adea94
...
@@ -138,4 +138,6 @@ public class VehiclePageQueryVo {
...
@@ -138,4 +138,6 @@ public class VehiclePageQueryVo {
*/
*/
private
Integer
modelId
;
private
Integer
modelId
;
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleActiveService.java
View file @
09adea94
...
@@ -85,8 +85,12 @@ public class VehicleActiveService {
...
@@ -85,8 +85,12 @@ public class VehicleActiveService {
// 写入车辆公里数,预计目的地
// 写入车辆公里数,预计目的地
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
vehicle
.
setMileageLastUpdate
(
MileageLift1
);
// 修改车辆状态,确认是空闲状态
// 修改车辆状态,确认是空闲状态
int
result
=
vehicleMapper
.
updateStatusByIdAndStatus
(
departureVo
.
getVehicleId
(),
VehicleStatus
.
DEPARTURE
.
getCode
(),
if
(
vehicle
.
getStatus
().
equals
(
VehicleStatus
.
NORMAL
.
getCode
()))
{
VehicleStatus
.
NORMAL
.
getCode
());
vehicle
.
setStatus
(
VehicleStatus
.
DEPARTURE
.
getCode
());
}
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
//修改预约记录状态
//修改预约记录状态
VehicleBookRecord
vehicleBookRecord
=
null
;
VehicleBookRecord
vehicleBookRecord
=
null
;
...
@@ -211,7 +215,10 @@ public class VehicleActiveService {
...
@@ -211,7 +215,10 @@ public class VehicleActiveService {
}
}
// 写入车辆公里数,还车分公司id
// 写入车辆公里数,还车分公司id
vehicle
.
setMileageLastUpdate
(
MileageRest1
);
vehicle
.
setMileageLastUpdate
(
MileageRest1
);
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
if
(
vehicleBookRecord
!=
null
)
{
vehicle
.
setParkBranchCompanyId
(
vehicleBookRecord
.
getRetCompany
());
}
// 出车记录
// 出车记录
VehicleDepartureLogVo
departureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
arrivalVo
.
getBookRecordId
());
VehicleDepartureLogVo
departureLogVo
=
vehicleDepartureLogMapper
.
selectByBookRecordId
(
arrivalVo
.
getBookRecordId
());
...
@@ -230,13 +237,13 @@ public class VehicleActiveService {
...
@@ -230,13 +237,13 @@ public class VehicleActiveService {
}
}
}
}
if
(
flag
)
{
//如果此条记录后面还有未收车记录,就不修改车辆状态
if
(
flag
)
{
//如果此条记录后面还有未收车记录,就不修改车辆状态
int
result
=
vehicleMapper
.
updateStatus
(
arrivalVo
.
getVehicleId
(),
VehicleStatus
.
NORMAL
.
getCode
());
vehicle
.
setStatus
(
VehicleStatus
.
NORMAL
.
getCode
());
// if (result == 0) {
// if (result == 0) {
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(),
// throw new BaseException(ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getDesc(),
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// ResCode.VEHICLE_DEPARTURE_VEHICLE_UNDEPARTURE.getCode());
// }
// }
}
}
vehicleMapper
.
updateByPrimaryKeySelective
(
vehicle
);
DateTime
arrivalDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
DateTime
arrivalDate
=
new
DateTime
(
vehicleBookRecord
.
getBookEndDate
());
DateTime
actualArrivalDate
=
new
DateTime
(
new
Date
());
DateTime
actualArrivalDate
=
new
DateTime
(
new
Date
());
//提前还车处理
//提前还车处理
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
09adea94
...
@@ -1173,7 +1173,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1173,7 +1173,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
public
PageDataVO
<
UsableVehicleModelVO
>
searchUsableModel
(
UsableVeicleDTO
dto
)
{
public
PageDataVO
<
UsableVehicleModelVO
>
searchUsableModel
(
UsableVeicleDTO
dto
)
{
Map
<
String
,
Object
>
params
=
BeanUtil
.
beanToMap
(
dto
);
Map
<
String
,
Object
>
params
=
BeanUtil
.
beanToMap
(
dto
);
if
(
StrUtil
.
isNotBlank
(
dto
.
getStartDate
())
&&
StrUtil
.
isNotBlank
(
dto
.
getEndDate
()))
{
if
(
StrUtil
.
isNotBlank
(
dto
.
getStartDate
())
&&
StrUtil
.
isNotBlank
(
dto
.
getEndDate
()))
{
initBookSearchParam
(
dto
,
params
,
Boolean
.
TRU
E
);
initBookSearchParam
(
dto
,
params
,
Boolean
.
FALS
E
);
}
}
return
PageDataVO
.
pageInfo
(
dto
.
getPage
(),
dto
.
getLimit
(),
()
->
mapper
.
searchUsableModel
(
params
));
return
PageDataVO
.
pageInfo
(
dto
.
getPage
(),
dto
.
getLimit
(),
()
->
mapper
.
searchUsableModel
(
params
));
}
}
...
@@ -1233,10 +1233,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1233,10 +1233,10 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
List
<
String
>
notBookedDates
=
Lists
.
newArrayList
();
List
<
String
>
notBookedDates
=
Lists
.
newArrayList
();
if
(
StringUtils
.
isNotBlank
(
dto
.
getBookEndDate
())
&&
if
(
StringUtils
.
isNotBlank
(
dto
.
getBookEndDate
())
&&
StringUtils
.
isNotBlank
(
dto
.
getBookEndDate
()))
{
StringUtils
.
isNotBlank
(
dto
.
getBookEndDate
()))
{
//
notBookedDates = convertDatePeriod2List(dto.getBookStartDate(),
notBookedDates
=
convertDatePeriod2List
(
dto
.
getBookStartDate
(),
//
dto.getBookEndDate());
dto
.
getBookEndDate
());
notBookedDates
=
convertDatePeriod2List
(
dto
.
getStartDateExtend
(),
//
notBookedDates = convertDatePeriod2List(dto.getStartDateExtend(),
dto
.
getEndDateExtend
());
//
dto.getEndDateExtend());
}
}
//若传入预定信息查询条件,则查询对应月份预定信息查询条件(不超过3个月)
//若传入预定信息查询条件,则查询对应月份预定信息查询条件(不超过3个月)
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/BranchCompanyMapper.xml
View file @
09adea94
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
from branch_company
from branch_company
<where>
<where>
<if
test=
"addrCity != null"
>
<if
test=
"addrCity != null"
>
and
addr_city = #{addrCity}
and
(addr_city = #{addrCity} or addr_province = #{addrCity} or addr_town = #{addrCity})
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
and longitude is not null and latitude is not null
and longitude is not null and latitude is not null
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleBookRecordMapper.xml
View file @
09adea94
...
@@ -487,7 +487,7 @@
...
@@ -487,7 +487,7 @@
and (v3.number_plate like concat('%', #{keywords}, '%') or v3.code like concat('%', #{keywords}, '%'))
and (v3.number_plate like concat('%', #{keywords}, '%') or v3.code like concat('%', #{keywords}, '%'))
</if>
</if>
<if
test=
"zoneId != null"
>
<if
test=
"zoneId != null"
>
and bc
3
.zone_id = #{zoneId}
and bc
1
.zone_id = #{zoneId}
</if>
</if>
<if
test=
"companyIds != null and companyIds.size > 0"
>
<if
test=
"companyIds != null and companyIds.size > 0"
>
and (v1.lift_company in
and (v1.lift_company in
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleMapper.xml
View file @
09adea94
...
@@ -123,7 +123,7 @@
...
@@ -123,7 +123,7 @@
and v.belong_to_name like concat('%',#{belongToName},'%')
and v.belong_to_name like concat('%',#{belongToName},'%')
</if>
</if>
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin
= #{vin}
and v.vin
like CONCAT('%',#{vin},'%')
</if>
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
...
@@ -532,7 +532,7 @@
...
@@ -532,7 +532,7 @@
and v.belong_to_name like concat('%',#{belongToName},'%')
and v.belong_to_name like concat('%',#{belongToName},'%')
</if>
</if>
<if
test=
"vin !=null and vin != ''"
>
<if
test=
"vin !=null and vin != ''"
>
and v.vin
= #{vin}
and v.vin
like CONCAT('%',#{vin},'%')
</if>
</if>
<!-- <if test="subordinateBranch !=null">-->
<!-- <if test="subordinateBranch !=null">-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
<!-- and v.subordinate_branch = #{subordinateBranch}-->
...
@@ -807,14 +807,14 @@
...
@@ -807,14 +807,14 @@
</if>
</if>
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<!-- yearNo4Where 标识时间参数不用于where条件,用于select部分 -->
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
<if
test=
" yearMonthAndParam !=null and yearNo4Where != null and yearNo4Where == true"
>
,(max(
,(
ifnull(
max(
vbi.bit_str = #{yearMonthAndParamBitStr}
vbi.bit_str = #{yearMonthAndParamBitStr}
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<!-- 租车列表 不过滤前后预约记录不符的车辆 但是合并标示车型是否有车 即 hasVehicle-->
<if
test=
"withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "
>
<if
test=
"withoutRecordWhere != null and withoutRecordWhere = 1 and startCompanyId != null and endCompanyId != null "
>
and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and (abr.to_lift_company is null or abr.to_lift_company = #{startCompanyId})
and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
and (abr.to_return_company is null or abr.to_return_company = #{endCompanyId})
</if>
</if>
)
)
, 1)
) as hasVehicle
) as hasVehicle
</if>
</if>
<if
test=
"lon != null and lat != null"
>
<if
test=
"lon != null and lat != null"
>
...
@@ -825,6 +825,7 @@
...
@@ -825,6 +825,7 @@
and vm.id is not null
and vm.id is not null
and vm.status = 1
and vm.status = 1
and vm.isdel = 0
and vm.isdel = 0
and vm.app_show = 1
and bc.id is not null
and bc.id is not null
GROUP BY model_id, company_id
GROUP BY model_id, company_id
<if
test=
"lon != null and lat != null"
>
, distance
</if>
<if
test=
"lon != null and lat != null"
>
, distance
</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