Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
haoban3.0
haoban-manage3.0
Commits
a30c86de
Commit
a30c86de
authored
Mar 27, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
微信退款接口开发
parent
c88a05a6
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
178 additions
and
6 deletions
+178
-6
LicenceOrderApiService.java
...an/manage/api/service/licence/LicenceOrderApiService.java
+6
-0
Config.java
...rc/main/java/com/gic/haoban/manage/web/config/Config.java
+87
-0
LicenceOrderController.java
.../haoban/manage/web/controller/LicenceOrderController.java
+23
-2
LicenceOrderPageQO.java
.../gic/haoban/manage/web/qo/licence/LicenceOrderPageQO.java
+8
-0
LicenceOrderPageVO.java
.../gic/haoban/manage/web/vo/licence/LicenceOrderPageVO.java
+13
-0
LicenceOrderVO.java
.../com/gic/haoban/manage/web/vo/licence/LicenceOrderVO.java
+1
-1
TabHaobanLicenceOrderMapper.java
...rvice/dao/mapper/licence/TabHaobanLicenceOrderMapper.java
+1
-1
LicenceOrderApiServiceImpl.java
.../service/out/impl/licence/LicenceOrderApiServiceImpl.java
+31
-1
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+2
-0
TabHaobanLicenceOrderMapper.xml
.../resources/mapper/licence/TabHaobanLicenceOrderMapper.xml
+1
-1
LicenceOrderServiceTest.java
...anage3-service/src/test/java/LicenceOrderServiceTest.java
+5
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/licence/LicenceOrderApiService.java
View file @
a30c86de
...
@@ -124,5 +124,11 @@ public interface LicenceOrderApiService {
...
@@ -124,5 +124,11 @@ public interface LicenceOrderApiService {
*/
*/
ServiceResponse
<
Boolean
>
checkLicenceOrder
(
Long
orderId
,
Integer
flag
,
String
reason
,
String
enterpriseId
,
String
wxEnterpriseId
,
String
creatorName
);
ServiceResponse
<
Boolean
>
checkLicenceOrder
(
Long
orderId
,
Integer
flag
,
String
reason
,
String
enterpriseId
,
String
wxEnterpriseId
,
String
creatorName
);
/**
* 微信退款
* @return
*/
ServiceResponse
<
Boolean
>
wxRefund
(
Long
orderId
);
}
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/config/Config.java
0 → 100644
View file @
a30c86de
package
com
.
gic
.
haoban
.
manage
.
web
.
config
;
import
com.ctrip.framework.apollo.spring.annotation.EnableApolloConfig
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.context.annotation.Configuration
;
/**
* Created by tgs on 2020/2/23.
*/
@Configuration
@EnableApolloConfig
public
class
Config
{
@Value
(
"${corpid}"
)
private
String
corpid
;
@Value
(
"${suiteid}"
)
private
String
suiteId
;
@Value
(
"${host}"
)
private
String
host
;
@Value
(
"${wxSuiteid}"
)
private
String
wxSuiteid
;
/**
* 企业微信许可账号购买信息
*/
@Value
(
"${accountName}"
)
private
String
accountName
;
@Value
(
"${accountNumber}"
)
private
String
accountNumber
;
@Value
(
"${bankName}"
)
private
String
bankName
;
public
String
getAccountName
()
{
return
accountName
;
}
public
void
setAccountName
(
String
accountName
)
{
this
.
accountName
=
accountName
;
}
public
String
getAccountNumber
()
{
return
accountNumber
;
}
public
void
setAccountNumber
(
String
accountNumber
)
{
this
.
accountNumber
=
accountNumber
;
}
public
String
getBankName
()
{
return
bankName
;
}
public
void
setBankName
(
String
bankName
)
{
this
.
bankName
=
bankName
;
}
public
String
getCorpid
()
{
return
corpid
;
}
public
void
setCorpid
(
String
corpid
)
{
this
.
corpid
=
corpid
;
}
public
String
getSuiteId
()
{
return
suiteId
;
}
public
void
setSuiteId
(
String
suiteId
)
{
this
.
suiteId
=
suiteId
;
}
public
String
getHost
()
{
return
host
;
}
public
void
setHost
(
String
host
)
{
this
.
host
=
host
;
}
public
String
getWxSuiteid
()
{
return
wxSuiteid
;
}
public
void
setWxSuiteid
(
String
wxSuiteid
)
{
this
.
wxSuiteid
=
wxSuiteid
;
}
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/LicenceOrderController.java
View file @
a30c86de
...
@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
...
@@ -19,6 +19,7 @@ import com.gic.haoban.manage.api.dto.licence.LicenceOrderPageDTO;
import
com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO
;
import
com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderPageQDTO
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.licence.LicenceOrderApiService
;
import
com.gic.haoban.manage.api.service.licence.LicenceOrderApiService
;
import
com.gic.haoban.manage.web.config.Config
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.licence.LicenceOrderPageQO
;
import
com.gic.haoban.manage.web.qo.licence.LicenceOrderPageQO
;
import
com.gic.haoban.manage.web.vo.licence.LicenceOrderPageVO
;
import
com.gic.haoban.manage.web.vo.licence.LicenceOrderPageVO
;
...
@@ -53,6 +54,8 @@ public class LicenceOrderController {
...
@@ -53,6 +54,8 @@ public class LicenceOrderController {
private
EnterpriseService
enterpriseService
;
private
EnterpriseService
enterpriseService
;
@Autowired
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
Config
config
;
/**
/**
* 查询订单详情
* 查询订单详情
...
@@ -102,8 +105,11 @@ public class LicenceOrderController {
...
@@ -102,8 +105,11 @@ public class LicenceOrderController {
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
loginUser
.
getWxEnterpriseId
();
String
clerkName
=
loginUser
.
getClerkName
();
String
clerkName
=
loginUser
.
getClerkName
();
Boolean
result
=
licenceOrderApiService
.
updateLicenceOrderType
(
orderId
,
2
,
enterpriseId
,
wxEnterpriseId
,
clerkName
,
1
).
getResult
();
Boolean
result
=
licenceOrderApiService
.
updateLicenceOrderType
(
orderId
,
2
,
enterpriseId
,
wxEnterpriseId
,
clerkName
,
1
).
getResult
();
//微信退款 todo
//微信退款
ServiceResponse
<
Boolean
>
response
=
licenceOrderApiService
.
wxRefund
(
orderId
);
if
(!
response
.
isSuccess
()){
return
RestResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
}
return
RestResponse
.
successResult
(
result
);
return
RestResponse
.
successResult
(
result
);
}
}
...
@@ -181,5 +187,20 @@ public class LicenceOrderController {
...
@@ -181,5 +187,20 @@ public class LicenceOrderController {
ServiceResponse
<
List
<
String
>>
orderIdList
=
licenceOrderApiService
.
getOrderIdList
(
param
,
type
,
loginUser
.
getWxEnterpriseId
());
ServiceResponse
<
List
<
String
>>
orderIdList
=
licenceOrderApiService
.
getOrderIdList
(
param
,
type
,
loginUser
.
getWxEnterpriseId
());
return
RestResponse
.
successResult
(
orderIdList
.
getResult
());
return
RestResponse
.
successResult
(
orderIdList
.
getResult
());
}
}
/**
* 查询开户信息
*/
@RequestMapping
(
"get-account-info"
)
public
RestResponse
<
HashMap
<
String
,
String
>>
getAccountInfo
()
{
WebLoginDTO
loginUser
=
AuthWebRequestUtil
.
getLoginUser
();
if
(
loginUser
==
null
||
StringUtils
.
isBlank
(
loginUser
.
getEnterpriseId
()))
{
return
RestResponse
.
failure
(
Convert
.
toStr
(
HaoBanErrCode
.
ERR_4
.
getCode
()),
HaoBanErrCode
.
ERR_4
.
getMsg
());
}
HashMap
<
String
,
String
>
result
=
new
HashMap
<>(
8
);
result
.
put
(
"accountName"
,
config
.
getAccountName
());
result
.
put
(
"accountNumber"
,
config
.
getAccountNumber
());
result
.
put
(
"bankName"
,
config
.
getBankName
());
return
RestResponse
.
successResult
(
result
);
}
}
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/qo/licence/LicenceOrderPageQO.java
View file @
a30c86de
...
@@ -48,5 +48,13 @@ public class LicenceOrderPageQO extends BasePageInfo implements Serializable {
...
@@ -48,5 +48,13 @@ public class LicenceOrderPageQO extends BasePageInfo implements Serializable {
* 订单创建结束时间
* 订单创建结束时间
*/
*/
private
String
endTime
;
private
String
endTime
;
/**
* 支付方式 1在线支付 2对公转账
*/
private
Integer
payType
;
/**
* gic商户Id
*/
private
String
enterpriseId
;
}
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/vo/licence/LicenceOrderPageVO.java
View file @
a30c86de
...
@@ -109,5 +109,18 @@ public class LicenceOrderPageVO implements Serializable {
...
@@ -109,5 +109,18 @@ public class LicenceOrderPageVO implements Serializable {
*/
*/
private
String
creatorName
;
private
String
creatorName
;
/**
* gic品牌名称
*/
private
String
enterpriseName
;
/**
* 企业微信商户名称
*/
private
String
wxEnterpriseName
;
/**
* 企业微信支付时间
*/
private
Date
qywxPayTime
;
}
}
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/vo/licence/LicenceOrderVO.java
View file @
a30c86de
...
@@ -39,7 +39,7 @@ public class LicenceOrderVO implements Serializable {
...
@@ -39,7 +39,7 @@ public class LicenceOrderVO implements Serializable {
*/
*/
private
String
wxEnterpriseId
;
private
String
wxEnterpriseId
;
/**
/**
* 微信商户名称
*
企业
微信商户名称
*/
*/
private
String
wxEnterpriseName
;
private
String
wxEnterpriseName
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/licence/TabHaobanLicenceOrderMapper.java
View file @
a30c86de
...
@@ -61,7 +61,7 @@ public interface TabHaobanLicenceOrderMapper {
...
@@ -61,7 +61,7 @@ public interface TabHaobanLicenceOrderMapper {
Integer
updateQywxOrderType
(
@Param
(
"orderId"
)
Long
orderId
,
@Param
(
"type"
)
Integer
type
);
Integer
updateQywxOrderType
(
@Param
(
"orderId"
)
Long
orderId
,
@Param
(
"type"
)
Integer
type
);
/**
/**
* 上
次
订单支付凭证
* 上
传
订单支付凭证
*
*
* @param orderId
* @param orderId
* @param voucher
* @param voucher
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/licence/LicenceOrderApiServiceImpl.java
View file @
a30c86de
...
@@ -25,8 +25,12 @@ import com.gic.haoban.manage.service.service.WxEnterpriseService;
...
@@ -25,8 +25,12 @@ import com.gic.haoban.manage.service.service.WxEnterpriseService;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService
;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService
;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderService
;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderService
;
import
com.gic.haoban.manage.service.util.DingUtils
;
import
com.gic.haoban.manage.service.util.DingUtils
;
import
com.gic.thirdparty.api.dto.RefundReqDataDTO
;
import
com.gic.thirdparty.api.dto.RefundResDataDTO
;
import
com.gic.thirdparty.api.service.Pay4WXService
;
import
com.gic.wechat.api.dto.qywx.fee.CreateOrderResponseDTO
;
import
com.gic.wechat.api.dto.qywx.fee.CreateOrderResponseDTO
;
import
com.gic.wechat.api.dto.qywx.fee.qdto.CreateOrderQDTO
;
import
com.gic.wechat.api.dto.qywx.fee.qdto.CreateOrderQDTO
;
import
com.gic.wechat.api.dto.qywx.response.QywxResponseDTO
;
import
com.gic.wechat.api.service.qywx.QywxOrderApiService
;
import
com.gic.wechat.api.service.qywx.QywxOrderApiService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
...
@@ -66,6 +70,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -66,6 +70,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
private
Config
config
;
private
Config
config
;
@Autowired
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
Pay4WXService
pay4WXService
;
@Override
@Override
public
ServiceResponse
<
LicenceOrderDTO
>
getLicenceOrderDetail
(
Long
orderId
,
Integer
type
)
{
public
ServiceResponse
<
LicenceOrderDTO
>
getLicenceOrderDetail
(
Long
orderId
,
Integer
type
)
{
...
@@ -285,6 +291,30 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
...
@@ -285,6 +291,30 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
@Override
@Override
public
ServiceResponse
<
Boolean
>
checkLicenceOrder
(
Long
orderId
,
Integer
flag
,
String
reason
,
String
enterpriseId
,
String
wxEnterpriseId
,
String
creatorName
)
{
public
ServiceResponse
<
Boolean
>
checkLicenceOrder
(
Long
orderId
,
Integer
flag
,
String
reason
,
String
enterpriseId
,
String
wxEnterpriseId
,
String
creatorName
)
{
licenceOrderService
.
checkLicenceOrder
(
orderId
,
flag
,
reason
,
enterpriseId
,
wxEnterpriseId
,
creatorName
);
licenceOrderService
.
checkLicenceOrder
(
orderId
,
flag
,
reason
,
enterpriseId
,
wxEnterpriseId
,
creatorName
);
return
null
;
return
ServiceResponse
.
success
(
true
)
;
}
}
@Override
public
ServiceResponse
<
Boolean
>
wxRefund
(
Long
orderId
)
{
TabHaobanLicenceOrder
order
=
licenceOrderService
.
getLicenceOrderDetail
(
orderId
);
if
(
null
==
order
){
return
ServiceResponse
.
failure
(
"-9999"
,
"订单id有误!"
);
}
if
(
2
==
order
.
getPayType
()){
return
ServiceResponse
.
success
(
false
);
}
RefundReqDataDTO
reqData
=
new
RefundReqDataDTO
(
order
.
getWxOrderId
(),
String
.
valueOf
(
orderId
),
null
,
String
.
valueOf
(
orderId
),
1
,
1
,
null
,
null
);
RefundResDataDTO
refund
=
pay4WXService
.
refund
(
reqData
);
if
(
refund
!=
null
&&
"FAIL"
.
equals
(
refund
.
getReturn_code
())){
//微信退款失败
return
ServiceResponse
.
failure
(
refund
.
getReturn_code
(),
refund
.
getReturn_msg
());
}
//更新微信订单状态
licenceOrderService
.
updateLicenceOrderType
(
order
.
getOrderId
(),
4
,
order
.
getEnterpriseId
(),
order
.
getWxEnterpriseId
(),
"系统"
,
1
);
//记录支付时间
licenceOrderService
.
saveCallBackTime
(
order
.
getOrderId
(),
1
,
new
Date
());
return
ServiceResponse
.
success
(
true
);
}
}
}
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
a30c86de
...
@@ -205,5 +205,6 @@
...
@@ -205,5 +205,6 @@
<dubbo:reference
interface=
"com.gic.member.tag.api.service.MemberTagGroupApiService"
id=
"memberTagGroupApiService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.member.tag.api.service.MemberTagGroupApiService"
id=
"memberTagGroupApiService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.ScreeningDetailService"
id=
"screeningDetailService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.ScreeningDetailService"
id=
"screeningDetailService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxOrderApiService"
id=
"qywxOrderApiService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
interface=
"com.gic.wechat.api.service.qywx.QywxOrderApiService"
id=
"qywxOrderApiService"
timeout=
"10000"
retries=
"0"
/>
<dubbo:reference
id=
"pay4WXService"
interface=
"com.gic.thirdparty.api.service.Pay4WXService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
</beans>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/licence/TabHaobanLicenceOrderMapper.xml
View file @
a30c86de
...
@@ -193,7 +193,7 @@
...
@@ -193,7 +193,7 @@
<update
id=
"uploadLicenceOrderVoucher"
>
<update
id=
"uploadLicenceOrderVoucher"
>
UPDATE tab_haoban_licence_order
UPDATE tab_haoban_licence_order
SET voucher = #{voucher} ,update_time = now(),pay_time = now()
SET voucher = #{voucher} ,update_time = now(),pay_time = now()
,order_status=5
WHERE order_id = #{orderId}
WHERE order_id = #{orderId}
and delete_flag = 0
and delete_flag = 0
</update>
</update>
...
...
haoban-manage3-service/src/test/java/LicenceOrderServiceTest.java
View file @
a30c86de
...
@@ -45,4 +45,9 @@ public class LicenceOrderServiceTest {
...
@@ -45,4 +45,9 @@ public class LicenceOrderServiceTest {
public
void
test4
(){
public
void
test4
(){
ServiceResponse
<
Boolean
>
result
=
licenceOrderApiService
.
payLicenceOrder
(
512360219787935783L
,
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
ServiceResponse
<
Boolean
>
result
=
licenceOrderApiService
.
payLicenceOrder
(
512360219787935783L
,
"ca66a01b79474c40b3e7c7f93daf1a3b"
);
}
}
@Test
public
void
test5
(){
ServiceResponse
<
Boolean
>
booleanServiceResponse
=
licenceOrderApiService
.
wxRefund
(
513465761444937732L
);
}
}
}
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