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
7c9db5db
Commit
7c9db5db
authored
Jun 08, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
许可账号总数实时统计
parent
8ed958a7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
105 additions
and
61 deletions
+105
-61
WxEnterpriseActiveDataService.java
...manage/service/service/WxEnterpriseActiveDataService.java
+3
-0
WxEnterpriseActiveDataServiceImpl.java
...rvice/service/impl/WxEnterpriseActiveDataServiceImpl.java
+9
-0
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+15
-14
LicenceOrderApiServiceImpl.java
.../service/out/impl/licence/LicenceOrderApiServiceImpl.java
+78
-47
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseActiveDataService.java
View file @
7c9db5db
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
com.gic.haoban.manage.api.dto.StaffActiveDataDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseActiveData
;
/**
* @description: 通讯录数据总览内部service
...
...
@@ -19,4 +20,6 @@ public interface WxEnterpriseActiveDataService {
StaffActiveDataDTO
getWxEnterpriseActiveDataByWxEnterpriseId
(
String
wxEnterpriseId
);
void
updateByStaffActiveDataDTO
(
StaffActiveDataDTO
dto
);
void
insert
(
TabHaobanWxEnterpriseActiveData
data
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseActiveDataServiceImpl.java
View file @
7c9db5db
...
...
@@ -133,4 +133,13 @@ public class WxEnterpriseActiveDataServiceImpl implements WxEnterpriseActiveData
TabHaobanWxEnterpriseActiveData
tabHaobanWxEnterpriseActiveData
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanWxEnterpriseActiveData
.
class
,
dto
);
tabHaobanWxEnterpriseActiveDataMapper
.
updateActiveDataByWxEnterpriseId
(
tabHaobanWxEnterpriseActiveData
);
}
@Override
public
void
insert
(
TabHaobanWxEnterpriseActiveData
data
)
{
if
(
null
==
data
){
log
.
info
(
"新增许可账号统计参数不能为空!"
);
return
;
}
tabHaobanWxEnterpriseActiveDataMapper
.
insert
(
data
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
7c9db5db
...
...
@@ -1169,21 +1169,22 @@ public class StaffApiServiceImpl implements StaffApiService {
staffMapper
.
updateActiveStatusById
(
staffId
,
timeStampDate
,
expireTimeDate
,
activeCode
);
StaffActiveDataDTO
activeDataDTO
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
wxEnterprise
.
getWxEnterpriseId
());
if
(
null
==
activeDataDTO
){
logger
.
info
(
"查询不到企业的许可账号统计信息!"
);
}
//已使用的加1,已激活的加1,未激活的减1
Integer
used
=
activeDataDTO
.
getUsed
();
Integer
inactive
=
activeDataDTO
.
getInactive
();
Integer
activated
=
activeDataDTO
.
getActivated
();
used
++;
activated
++;
if
(
null
!=
inactive
&&
inactive
>
0
){
inactive
--;
logger
.
info
(
"查询不到企业微信id->{}的许可账号统计信息!"
,
wxEnterprise
.
getWxEnterpriseId
());
}
else
{
//已使用的加1,已激活的加1,未激活的减1
Integer
used
=
activeDataDTO
.
getUsed
();
Integer
inactive
=
activeDataDTO
.
getInactive
();
Integer
activated
=
activeDataDTO
.
getActivated
();
used
++;
activated
++;
if
(
null
!=
inactive
&&
inactive
>
0
){
inactive
--;
}
activeDataDTO
.
setUsed
(
used
);
activeDataDTO
.
setInactive
(
inactive
);
activeDataDTO
.
setActivated
(
activated
);
wxEnterpriseActiveDataService
.
updateByStaffActiveDataDTO
(
activeDataDTO
);
}
activeDataDTO
.
setUsed
(
used
);
activeDataDTO
.
setInactive
(
inactive
);
activeDataDTO
.
setActivated
(
activated
);
wxEnterpriseActiveDataService
.
updateByStaffActiveDataDTO
(
activeDataDTO
);
}
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
true
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/licence/LicenceOrderApiServiceImpl.java
View file @
7c9db5db
...
...
@@ -9,6 +9,7 @@ import com.gic.api.base.commons.Page;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.haoban.manage.api.dto.StaffActiveDataDTO
;
...
...
@@ -22,13 +23,12 @@ import com.gic.haoban.manage.api.dto.qdto.licence.LicenceOrderQDTO;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.api.service.licence.LicenceOrderApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.entity.
fee.TabHaobanQywxFeeOrder
;
import
com.gic.haoban.manage.service.entity.
TabHaobanWxEnterpriseActiveData
;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrder
;
import
com.gic.haoban.manage.service.entity.licence.TabHaobanLicenceOrderProgress
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseActiveDataService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderService
;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderProgressService
;
import
com.gic.haoban.manage.service.service.licence.LicenceOrderService
;
import
com.gic.haoban.manage.service.util.DingUtils
;
...
...
@@ -44,7 +44,6 @@ import com.gic.wechat.api.service.qywx.QywxOrderApiService;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.redisson.client.RedisClient
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -151,14 +150,14 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
//查询订单详情,获取订单金额
FeeOrderDeatilResponseDTO
dto
=
qywxUserApiService
.
getOrder
(
openCorpid
,
serviceCorpid
,
qywxOrderId
);
logger
.
info
(
"查询企业微信订单详情返回信息:{}"
,
JSON
.
toJSONString
(
dto
));
if
(
null
!=
dto
&&
0
==
dto
.
getErrcode
()){
if
(
null
!=
dto
&&
0
==
dto
.
getErrcode
())
{
Integer
price
=
dto
.
getOrder
().
getPrice
();
licenceOrderQDTO
.
setQywxOrderId
(
qywxOrderId
);
licenceOrderQDTO
.
setPrice
(
price
);
String
s
=
licenceOrderService
.
saveOrUpdateLicenceOrder
(
licenceOrderQDTO
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"orderId"
,
s
);
jsonObject
.
put
(
"price"
,
price
);
jsonObject
.
put
(
"orderId"
,
s
);
jsonObject
.
put
(
"price"
,
price
);
return
ServiceResponse
.
success
(
JSON
.
toJSONString
(
jsonObject
));
}
return
ServiceResponse
.
failure
(
String
.
valueOf
(
dto
.
getErrcode
()),
dto
.
getErrmsg
());
...
...
@@ -170,19 +169,19 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
public
ServiceResponse
<
Page
<
LicenceOrderPageDTO
>>
getLicenceOrderPage
(
LicenceOrderPageQDTO
licenceOrderPageQDTO
)
{
Page
<
LicenceOrderPageDTO
>
licenceOrderPage
=
licenceOrderService
.
getLicenceOrderPage
(
licenceOrderPageQDTO
);
List
<
LicenceOrderPageDTO
>
list
=
licenceOrderPage
.
getResult
();
if
(
CollUtil
.
isNotEmpty
(
list
)){
if
(
CollUtil
.
isNotEmpty
(
list
))
{
//判断订单状态,支付时间已过的订单的需要更改订单状态为已过期
for
(
LicenceOrderPageDTO
dto
:
list
){
for
(
LicenceOrderPageDTO
dto
:
list
)
{
Date
now
=
new
Date
();
if
(
null
!=
dto
.
getExpireTime
()
&&
dto
.
getExpireTime
().
before
(
now
)
&&
dto
.
getOrderStatus
()
==
0
)
{
if
(
null
!=
dto
.
getExpireTime
()
&&
dto
.
getExpireTime
().
before
(
now
)
&&
dto
.
getOrderStatus
()
==
0
)
{
dto
.
setOrderStatus
(
3
);
updateLicenceOrderType
(
dto
.
getOrderId
(),
3
,
dto
.
getEnterpriseId
(),
dto
.
getWxEnterpriseId
(),
"系统"
,
1
);
updateLicenceOrderType
(
dto
.
getOrderId
(),
3
,
dto
.
getEnterpriseId
(),
dto
.
getWxEnterpriseId
(),
"系统"
,
1
);
//取消企业微信订单
cancelQywxOrder
(
dto
.
getOrderId
());
}
if
(
null
!=
dto
.
getQywxExpireTime
()
&&
dto
.
getQywxExpireTime
().
before
(
now
)
&&
dto
.
getQywxOrderStatus
()
==
0
)
{
if
(
null
!=
dto
.
getQywxExpireTime
()
&&
dto
.
getQywxExpireTime
().
before
(
now
)
&&
dto
.
getQywxOrderStatus
()
==
0
)
{
dto
.
setQywxOrderStatus
(
3
);
updateLicenceOrderType
(
dto
.
getOrderId
(),
3
,
dto
.
getEnterpriseId
(),
dto
.
getWxEnterpriseId
(),
"系统"
,
0
);
updateLicenceOrderType
(
dto
.
getOrderId
(),
3
,
dto
.
getEnterpriseId
(),
dto
.
getWxEnterpriseId
(),
"系统"
,
0
);
}
}
licenceOrderPage
.
setResult
(
list
);
...
...
@@ -200,7 +199,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
@Override
public
ServiceResponse
<
Boolean
>
uploadLicenceOrderVoucher
(
Long
orderId
,
String
voucher
,
String
enterpriseId
,
String
wxEnterpriseId
,
String
creatorName
)
{
ServiceResponse
<
Boolean
>
response
=
checkQywxOrderStatus
(
orderId
);
if
(
response
.
isSuccess
()){
if
(
response
.
isSuccess
())
{
licenceOrderService
.
uploadLicenceOrderVoucher
(
orderId
,
voucher
,
enterpriseId
,
wxEnterpriseId
,
creatorName
);
}
return
response
;
...
...
@@ -221,7 +220,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
//需要先判断是否已经下单,且订单失效的话重新下单
if
(
null
!=
order
.
getQywxOrderId
())
{
FeeOrderDeatilResponseDTO
dto
=
qywxUserApiService
.
getOrder
(
openCorpid
,
serviceCorpid
,
order
.
getQywxOrderId
());
if
(
null
!=
dto
&&
null
!=
dto
.
getOrder
()
&&
dto
.
getOrder
().
getOrderStatus
()
!=
3
){
if
(
null
!=
dto
&&
null
!=
dto
.
getOrder
()
&&
dto
.
getOrder
().
getOrderStatus
()
!=
3
)
{
//企业微信订单有效,无需重复创建
return
ServiceResponse
.
success
(
order
.
getQywxOrderId
());
}
...
...
@@ -252,7 +251,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
order
.
getWxEnterpriseId
(),
"系统"
,
0
);
//企业微信订单过期时间更新,默认10天有效
Date
qywxExpireTime
=
DateUtil
.
addDay
(
new
Date
(),
10
);
licenceOrderService
.
saveQywxOrderId
(
order
.
getOrderId
(),
result
.
getOrderId
(),
qywxExpireTime
);
licenceOrderService
.
saveQywxOrderId
(
order
.
getOrderId
(),
result
.
getOrderId
(),
qywxExpireTime
);
return
ServiceResponse
.
success
(
result
.
getOrderId
());
}
return
ServiceResponse
.
failure
(
newOrder
.
getCode
(),
newOrder
.
getMessage
());
...
...
@@ -277,8 +276,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String
transactionId
=
object
.
getString
(
"transactionId"
);
String
timeEnd
=
object
.
getString
(
"timeEnd"
);
//对同一笔订单上锁
String
key
=
"haoban_wx_licence_order_+"
+
transactionId
;
RedisUtil
.
lock
(
key
,
2L
);
String
key
=
"haoban_wx_licence_order_+"
+
transactionId
;
RedisUtil
.
lock
(
key
,
2L
);
TabHaobanLicenceOrder
licenceOrder
=
licenceOrderService
.
selectByTransactionId
(
orderId
);
if
(
licenceOrder
==
null
)
{
logger
.
info
(
"微信回调的订单编号:{}异常!!"
,
orderId
);
...
...
@@ -291,11 +290,11 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
RedisUtil
.
unlock
(
key
);
return
ServiceResponse
.
success
(
false
);
}
Date
payTime
=
DateUtil
.
strToDate
(
timeEnd
,
DateUtil
.
FORMAT_DATETIME_14
);
Date
payTime
=
DateUtil
.
strToDate
(
timeEnd
,
DateUtil
.
FORMAT_DATETIME_14
);
//更新订单状态
licenceOrderService
.
updateLicenceOrderType
(
licenceOrder
.
getOrderId
(),
1
,
licenceOrder
.
getEnterpriseId
(),
licenceOrder
.
getWxEnterpriseId
(),
"系统"
,
1
);
//保存微信订单id
licenceOrderService
.
saveTransactionCode
(
licenceOrder
.
getOrderId
(),
null
,
null
,
transactionId
,
payTime
,
null
);
licenceOrderService
.
saveTransactionCode
(
licenceOrder
.
getOrderId
(),
null
,
null
,
transactionId
,
payTime
,
null
);
RedisUtil
.
unlock
(
key
);
//查询gic品牌名称
String
enterpriseName
=
""
;
...
...
@@ -338,8 +337,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String
timeStamp
=
object
.
getString
(
"timeStamp"
);
Integer
orderStatus
=
object
.
getInteger
(
"orderStatus"
);
//对同一笔订单上锁
String
key
=
"haoban_qywx_licence_order_+"
+
orderId
;
RedisUtil
.
lock
(
key
,
2L
);
String
key
=
"haoban_qywx_licence_order_+"
+
orderId
;
RedisUtil
.
lock
(
key
,
2L
);
TabHaobanLicenceOrder
order
=
licenceOrderService
.
selectByQywxOrderId
(
orderId
);
//将秒级时间戳转换位Date类型
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
DateUtil
.
FORMAT_DATETIME_19
);
...
...
@@ -361,6 +360,28 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
licenceOrderService
.
updateLicenceOrderType
(
order
.
getOrderId
(),
1
,
order
.
getEnterpriseId
(),
order
.
getWxEnterpriseId
(),
"系统"
,
0
);
//记录支付时间
licenceOrderService
.
saveCallBackTime
(
order
.
getOrderId
(),
2
,
date
);
//实时统计购买企业微信许可总数
StaffActiveDataDTO
activeDataDTO
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
order
.
getWxEnterpriseId
());
if
(
null
==
activeDataDTO
)
{
logger
.
info
(
"查询不到企业微信id->{}的许可账号统计信息!"
,
order
.
getWxEnterpriseId
());
//新增一条记录,默认未激活
TabHaobanWxEnterpriseActiveData
activeData
=
new
TabHaobanWxEnterpriseActiveData
();
activeData
.
setId
(
UniqueIdUtils
.
uniqueLong
());
activeData
.
setWxEnterpriseId
(
order
.
getWxEnterpriseId
());
activeData
.
setActivated
(
0
);
activeData
.
setPurchased
(
order
.
getExternalContactCount
());
activeData
.
setInactive
(
0
);
activeData
.
setUsed
(
0
);
activeData
.
setExpired
(
0
);
activeData
.
setTransfer
(
0
);
activeData
.
setMerged
(
0
);
wxEnterpriseActiveDataService
.
insert
(
activeData
);
}
else
{
Integer
purchased
=
activeDataDTO
.
getPurchased
();
purchased
+=
order
.
getExternalContactCount
();
activeDataDTO
.
setPurchased
(
purchased
);
wxEnterpriseActiveDataService
.
updateByStaffActiveDataDTO
(
activeDataDTO
);
}
}
if
(
"license_refund"
.
equals
(
infoType
))
{
if
(
order
.
getQywxRefundTime
()
!=
null
)
{
...
...
@@ -375,6 +396,16 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
//记录退款时间
licenceOrderService
.
saveCallBackTime
(
order
.
getOrderId
(),
3
,
date
);
wxRefund
(
order
.
getOrderId
());
//实时统计购买企业微信许可总数
StaffActiveDataDTO
activeDataDTO
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
order
.
getWxEnterpriseId
());
if
(
null
==
activeDataDTO
)
{
logger
.
info
(
"查询不到企业微信id->{}的许可账号统计信息!"
,
order
.
getWxEnterpriseId
());
}
else
{
Integer
purchased
=
activeDataDTO
.
getPurchased
();
purchased
-=
order
.
getExternalContactCount
();
activeDataDTO
.
setPurchased
(
0
>
purchased
?
0
:
purchased
);
wxEnterpriseActiveDataService
.
updateByStaffActiveDataDTO
(
activeDataDTO
);
}
}
else
if
(
orderStatus
==
2
)
{
licenceOrderService
.
updateLicenceOrderType
(
order
.
getOrderId
(),
5
,
order
.
getEnterpriseId
(),
order
.
getWxEnterpriseId
(),
"系统"
,
0
);
...
...
@@ -387,8 +418,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
}
@Override
public
ServiceResponse
<
Boolean
>
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
,
Date
payTime
,
String
wxUrl
)
{
licenceOrderService
.
saveTransactionCode
(
orderId
,
transactionCode
,
prepayId
,
wxOrderId
,
payTime
,
wxUrl
);
public
ServiceResponse
<
Boolean
>
saveTransactionCode
(
Long
orderId
,
String
transactionCode
,
String
prepayId
,
String
wxOrderId
,
Date
payTime
,
String
wxUrl
)
{
licenceOrderService
.
saveTransactionCode
(
orderId
,
transactionCode
,
prepayId
,
wxOrderId
,
payTime
,
wxUrl
);
return
ServiceResponse
.
success
(
true
);
}
...
...
@@ -399,7 +430,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
@Override
public
ServiceResponse
<
Boolean
>
checkLicenceOrder
(
Long
orderId
,
Integer
flag
,
String
reason
,
String
creatorName
)
{
licenceOrderService
.
checkLicenceOrder
(
orderId
,
flag
,
reason
,
creatorName
);
licenceOrderService
.
checkLicenceOrder
(
orderId
,
flag
,
reason
,
creatorName
);
return
ServiceResponse
.
success
(
true
);
}
...
...
@@ -414,13 +445,13 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
licenceOrderService
.
updateLicenceOrderType
(
order
.
getOrderId
(),
4
,
order
.
getEnterpriseId
(),
order
.
getWxEnterpriseId
(),
"系统"
,
1
);
return
ServiceResponse
.
success
(
true
);
}
if
(
1
!=
order
.
getOrderStatus
()){
if
(
1
!=
order
.
getOrderStatus
())
{
return
ServiceResponse
.
failure
(
"-9999"
,
"该笔订单不是已支付状态!"
);
}
RefundReqDataDTO
reqData
=
new
RefundReqDataDTO
(
order
.
getWxOrderId
(),
null
,
null
,
String
.
valueOf
(
orderId
),
order
.
getPrice
(),
order
.
getPrice
(),
null
,
null
);
RefundResDataDTO
refund
=
pay4WXService
.
refund
(
reqData
);
logger
.
info
(
"微信订单退款返回信息:{}"
,
JSON
.
toJSONString
(
refund
));
logger
.
info
(
"微信订单退款返回信息:{}"
,
JSON
.
toJSONString
(
refund
));
if
(
refund
!=
null
&&
(
"FAIL"
.
equals
(
refund
.
getReturn_code
())
||
"FAIL"
.
equals
(
refund
.
getResult_code
())))
{
//微信退款失败,钉钉通知财务人员
//查询gic品牌名称
...
...
@@ -444,8 +475,8 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
int
secondLastIndex
=
host
.
lastIndexOf
(
"/"
,
lastIndex
-
1
);
String
subHost
=
host
.
substring
(
0
,
secondLastIndex
+
1
);
String
url
=
subHost
+
"enterprise-operation/#/finance-config/wx-order-detail?tabId=wx_account_order&orderId="
+
order
.
getOrderId
();
String
msg
=
"标题:企微账号许可通知\n品牌名称:"
+
enterpriseName
+
"\n"
+
"企业名称:"
+
wxEnterpriseName
+
"\n"
+
"消息内容:订单编号:"
+
order
.
getOrderNumber
()
+
",申请微信退款失败,请查看原因并处理!\n"
+
"失败原因:"
+
refund
.
getErr_code_des
()+
"\n"
+
url
;
String
msg
=
"标题:企微账号许可通知\n品牌名称:"
+
enterpriseName
+
"\n"
+
"企业名称:"
+
wxEnterpriseName
+
"\n"
+
"消息内容:订单编号:"
+
order
.
getOrderNumber
()
+
",申请微信退款失败,请查看原因并处理!\n"
+
"失败原因:"
+
refund
.
getErr_code_des
()
+
"\n"
+
url
;
DingUtils
.
send
(
msg
,
dingUrl
,
false
);
return
ServiceResponse
.
failure
(
refund
.
getResult_code
(),
refund
.
getErr_code_des
());
}
...
...
@@ -459,9 +490,9 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
@Override
public
ServiceResponse
<
HashMap
<
String
,
String
>>
getAccountInfo
()
{
HashMap
<
String
,
String
>
result
=
new
HashMap
<>(
8
);
result
.
put
(
"accountName"
,
config
.
getAccountName
());
result
.
put
(
"accountNumber"
,
config
.
getAccountNumber
());
result
.
put
(
"bankName"
,
config
.
getBankName
());
result
.
put
(
"accountName"
,
config
.
getAccountName
());
result
.
put
(
"accountNumber"
,
config
.
getAccountNumber
());
result
.
put
(
"bankName"
,
config
.
getBankName
());
return
ServiceResponse
.
success
(
result
);
}
...
...
@@ -481,38 +512,38 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String
openCorpid
=
wxEnterpriseDTO
.
getOpenCorpid
();
String
serviceCorpid
=
config
.
getCorpid
();
ServiceResponse
<
QywxResponseDTO
>
response
=
qywxOrderApiService
.
cancelOrder
(
serviceCorpid
,
openCorpid
,
order
.
getQywxOrderId
());
logger
.
info
(
"企业微信订单取消返回信息:{}"
,
JSON
.
toJSONString
(
response
));
if
(
response
.
isSuccess
()){
logger
.
info
(
"企业微信订单取消返回信息:{}"
,
JSON
.
toJSONString
(
response
));
if
(
response
.
isSuccess
())
{
//更新企业微信订单状态
updateLicenceOrderType
(
orderId
,
2
,
order
.
getEnterpriseId
(),
order
.
getWxEnterpriseId
(),
order
.
getCreatorName
(),
0
);
return
ServiceResponse
.
success
(
true
);
}
return
ServiceResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
return
ServiceResponse
.
failure
(
response
.
getCode
(),
response
.
getMessage
());
}
@Override
public
ServiceResponse
<
HashMap
<
String
,
Integer
>>
hasPopup
(
String
wxEnterpriseId
)
{
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
)
;
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
wxEnterpriseId
);
HashMap
<
String
,
Integer
>
map
=
new
HashMap
<>();
map
.
put
(
"hasPopup"
,
0
);
map
.
put
(
"count"
,
0
);
if
(
qwDTO
.
isSelf
())
{
map
.
put
(
"hasPopup"
,
0
);
map
.
put
(
"count"
,
0
);
if
(
qwDTO
.
isSelf
())
{
return
ServiceResponse
.
success
(
map
);
}
List
<
String
>
list
=
staffClerkRelationService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollUtil
.
isEmpty
(
list
)){
if
(
CollUtil
.
isEmpty
(
list
))
{
return
ServiceResponse
.
success
(
map
);
}
//去重
list
=
list
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
Integer
count
=
licenceOrderService
.
selectCountByWxEnterpriseId
(
wxEnterpriseId
);
if
(
count
==
0
)
{
StaffActiveDataDTO
dto
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
wxEnterpriseId
);
if
(
null
!=
dto
&&
dto
.
getPurchased
()
!=
null
&&
dto
.
getPurchased
()
>
0
)
{
if
(
count
==
0
)
{
StaffActiveDataDTO
dto
=
wxEnterpriseActiveDataService
.
getWxEnterpriseActiveDataByWxEnterpriseId
(
wxEnterpriseId
);
if
(
null
!=
dto
&&
dto
.
getPurchased
()
!=
null
&&
dto
.
getPurchased
()
>
0
)
{
return
ServiceResponse
.
success
(
map
);
}
map
.
put
(
"hasPopup"
,
1
);
map
.
put
(
"count"
,
list
.
size
());
map
.
put
(
"hasPopup"
,
1
);
map
.
put
(
"count"
,
list
.
size
());
return
ServiceResponse
.
success
(
map
);
}
return
ServiceResponse
.
success
(
map
);
...
...
@@ -522,7 +553,7 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
public
ServiceResponse
<
Boolean
>
checkQywxOrderStatus
(
Long
orderId
)
{
//查询企业微信订单状态是否过期,过期则不能上传订单支付凭证
TabHaobanLicenceOrder
order
=
licenceOrderService
.
getLicenceOrderDetail
(
orderId
);
if
(
null
==
order
){
if
(
null
==
order
)
{
return
ServiceResponse
.
failure
(
"9999"
,
"订单不存在!!"
);
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
order
.
getWxEnterpriseId
());
...
...
@@ -532,13 +563,13 @@ public class LicenceOrderApiServiceImpl implements LicenceOrderApiService {
String
openCorpid
=
wxEnterpriseDTO
.
getOpenCorpid
();
String
serviceCorpid
=
config
.
getCorpid
();
FeeOrderDeatilResponseDTO
dto
=
qywxUserApiService
.
getOrder
(
openCorpid
,
serviceCorpid
,
order
.
getQywxOrderId
());
if
(
null
!=
dto
&&
null
!=
dto
.
getOrder
()
&&
dto
.
getOrder
().
getOrderStatus
()
==
3
){
if
(
null
!=
dto
&&
null
!=
dto
.
getOrder
()
&&
dto
.
getOrder
().
getOrderStatus
()
==
3
)
{
//订单失效,记录订单状态
licenceOrderService
.
updateLicenceOrderType
(
order
.
getOrderId
(),
3
,
order
.
getEnterpriseId
(),
order
.
getWxEnterpriseId
(),
"系统"
,
0
);
licenceOrderService
.
updateLicenceOrderType
(
order
.
getOrderId
(),
2
,
order
.
getEnterpriseId
(),
order
.
getWxEnterpriseId
(),
"系统"
,
1
);
return
ServiceResponse
.
failure
(
"-9999"
,
"企业微信订单已过期!"
);
return
ServiceResponse
.
failure
(
"-9999"
,
"企业微信订单已过期!"
);
}
return
ServiceResponse
.
success
();
}
...
...
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