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
c1801f2b
Commit
c1801f2b
authored
Aug 08, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:企微收费修改
parent
aa925a7c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
79 additions
and
24 deletions
+79
-24
TabHaobanQywxFeeAccountStaffMapper.java
...ce/dao/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.java
+19
-0
HaobanQywxFeeAccountStaffService.java
...service/service/fee/HaobanQywxFeeAccountStaffService.java
+11
-0
HaobanQywxFeeAccountStaffServiceImpl.java
...ervice/fee/impl/HaobanQywxFeeAccountStaffServiceImpl.java
+11
-1
HaobanQywxFeeOrderAccountServiceImpl.java
...ervice/fee/impl/HaobanQywxFeeOrderAccountServiceImpl.java
+1
-0
HaobanQywxFeeApiServiceImpl.java
...ice/service/out/impl/fee/HaobanQywxFeeApiServiceImpl.java
+19
-22
TabHaobanQywxFeeAccountStaffMapper.xml
...sources/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.xml
+18
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.java
View file @
c1801f2b
...
...
@@ -5,6 +5,7 @@ import com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.data.domain.Pageable
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -73,5 +74,23 @@ public interface TabHaobanQywxFeeAccountStaffMapper {
* @date 2022-08-05 15:40:09
*/
List
<
HaobanQywxFeeDetailDTO
>
feeDetail
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
/**
* 获取最新的过期时间
* @param wxEnterpriseId
* @return
*/
Date
lastFeeInterceptTime
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
/**
* 最后费用过期拦截数
*
* @param wxEnterpriseId wx企业标识
* @return int
* @author mozhu
* @date 2022-08-08 15:53:32
*/
int
lastFeeInterceptCount
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/HaobanQywxFeeAccountStaffService.java
View file @
c1801f2b
...
...
@@ -56,4 +56,15 @@ public interface HaobanQywxFeeAccountStaffService {
*/
List
<
HaobanQywxFeeDetailDTO
>
feeDetail
(
String
wxEnterpriseId
);
/**
* 费用详细拦截
*
* @param wxEnterpriseId wx企业标识
* @return {@link HaobanQywxFeeDetailDTO }
* @author mozhu
* @date 2022-08-08 15:46:21
*/
HaobanQywxFeeDetailDTO
feeIntercept
(
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/impl/HaobanQywxFeeAccountStaffServiceImpl.java
View file @
c1801f2b
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
fee
.
impl
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO
;
import
com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeAccountStaffMapper
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff
;
...
...
@@ -7,6 +6,7 @@ import com.gic.haoban.manage.service.service.fee.HaobanQywxFeeAccountStaffServic
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
/**
...
...
@@ -71,4 +71,14 @@ public class HaobanQywxFeeAccountStaffServiceImpl implements HaobanQywxFeeAccoun
public
List
<
HaobanQywxFeeDetailDTO
>
feeDetail
(
String
wxEnterpriseId
)
{
return
tabHaobanQywxFeeAccountStaffMapper
.
feeDetail
(
wxEnterpriseId
);
}
@Override
public
HaobanQywxFeeDetailDTO
feeIntercept
(
String
wxEnterpriseId
)
{
Date
lastFeeInterceptTime
=
tabHaobanQywxFeeAccountStaffMapper
.
lastFeeInterceptTime
(
wxEnterpriseId
);
int
count
=
tabHaobanQywxFeeAccountStaffMapper
.
lastFeeInterceptCount
(
wxEnterpriseId
);
HaobanQywxFeeDetailDTO
haobanQywxFeeDetailDTO
=
new
HaobanQywxFeeDetailDTO
();
haobanQywxFeeDetailDTO
.
setInterceptTime
(
lastFeeInterceptTime
);
haobanQywxFeeDetailDTO
.
setInterceptUserNum
(
count
);
return
haobanQywxFeeDetailDTO
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/impl/HaobanQywxFeeOrderAccountServiceImpl.java
View file @
c1801f2b
...
...
@@ -68,4 +68,5 @@ public class HaobanQywxFeeOrderAccountServiceImpl implements HaobanQywxFeeOrderA
public
int
countOrderAccountStatus
(
Integer
status
,
String
wxEnterpriseId
)
{
return
tabHaobanQywxFeeOrderAccountMapper
.
countOrderAccountStatus
(
status
,
wxEnterpriseId
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/fee/HaobanQywxFeeApiServiceImpl.java
View file @
c1801f2b
...
...
@@ -5,13 +5,13 @@ import com.gic.api.base.commons.Page;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.constants.Manage3Constants
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDTO
;
import
com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO
;
import
com.gic.haoban.manage.api.dto.qdto.QywxFeeListQDTO
;
import
com.gic.haoban.manage.api.service.fee.HaobanQywxFeeApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFee
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeAccountStaff
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrder
;
...
...
@@ -61,11 +61,11 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
@Override
public
void
insert
(
String
param
)
{
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAll
();
List
<
WxEnterpriseDTO
>
wxEnterpriseDTOS
=
wxEnterpriseService
.
listAllWxEnterprise
();
String
serviceCorpid
=
config
.
getCorpid
();
for
(
TabHaobanWxEnterprise
tabHaobanWxEnterpris
:
tabHaobanWxEnterprises
)
{
String
corpid
=
tabHaobanWxEnterpris
.
getCorpid
();
String
wxEnterpriseId
=
tabHaobanWxEnterpris
.
getWxEnterpriseId
();
for
(
WxEnterpriseDTO
wxEnterpriseDTO
:
wxEnterpriseDTOS
)
{
String
corpid
=
wxEnterpriseDTO
.
getCorpid
();
String
wxEnterpriseId
=
wxEnterpriseDTO
.
getWxEnterpriseId
();
String
autoActiveStatus
=
qywxUserApiService
.
getAutoActiveStatus
(
corpid
,
serviceCorpid
);
if
(!
"1"
.
equals
(
autoActiveStatus
))
{
logger
.
info
(
"未开启自动激活:{}"
,
corpid
);
...
...
@@ -218,25 +218,22 @@ public class HaobanQywxFeeApiServiceImpl implements HaobanQywxFeeApiService {
//更新企微状态
wxEnterpriseService
.
updateAutoActiveFlagById
(
1
,
wxEnterpriseId
);
// TODO: 2022/8/5 收费接口算法还未明确
//更新收费
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
tabHaobanWxEnterpris
.
getCorpName
());
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
//tabHaobanQywxFee.setInterceptTime();
//
//tabHaobanQywxFee.setInterceptUserNum();
tabHaobanQywxFee
.
setPermissionUserNum
(
haobanQywxFeeOrderAccountService
.
countOrderAccountStatus
(
1
,
wxEnterpriseId
));
tabHaobanQywxFee
.
setBuyPermissionUserNum
(
haobanQywxFeeOrderService
.
countExternalContactCount
(
wxEnterpriseId
));
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
HaobanQywxFeeDetailDTO
haobanQywxFeeDetailDTO
=
haobanQywxFeeAccountStaffService
.
feeIntercept
(
wxEnterpriseId
);
if
(
haobanQywxFeeDetailDTO
!=
null
)
{
TabHaobanQywxFee
tabHaobanQywxFee
=
new
TabHaobanQywxFee
();
tabHaobanQywxFee
.
setQwFeeId
(
UniqueIdUtils
.
uniqueLong
());
tabHaobanQywxFee
.
setCorpName
(
wxEnterpriseDTO
.
getCorpName
());
tabHaobanQywxFee
.
setCorpId
(
corpid
);
tabHaobanQywxFee
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabHaobanQywxFee
.
setInterceptTime
(
haobanQywxFeeDetailDTO
.
getInterceptTime
());
tabHaobanQywxFee
.
setInterceptUserNum
(
haobanQywxFeeDetailDTO
.
getInterceptUserNum
());
tabHaobanQywxFee
.
setPermissionUserNum
(
haobanQywxFeeOrderAccountService
.
countOrderAccountStatus
(
1
,
wxEnterpriseId
));
tabHaobanQywxFee
.
setBuyPermissionUserNum
(
haobanQywxFeeOrderService
.
countExternalContactCount
(
wxEnterpriseId
));
tabHaobanQywxFee
.
setInterceptFlag
(
0
);
haobanQywxFeeService
.
insert
(
tabHaobanQywxFee
);
}
}
}
...
...
haoban-manage3-service/src/main/resources/mapper/fee/TabHaobanQywxFeeAccountStaffMapper.xml
View file @
c1801f2b
...
...
@@ -133,12 +133,29 @@
<select
id=
"feeDetail"
resultType=
"com.gic.haoban.manage.api.dto.fee.HaobanQywxFeeDetailDTO"
>
select
sum(staff_id) interceptUserNum,
sum(
distinct
staff_id) interceptUserNum,
expire_time interceptTime
from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId}
and DATE_SUB(CURDATE(), INTERVAL 30 DAY)
<![CDATA[ <= ]]>
date(expire_time)
</select>
<select
id=
"lastFeeInterceptTime"
resultType=
"java.util.Date"
>
select
expire_time expireTime
from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId}
and DATE_SUB(CURDATE(), INTERVAL 30 DAY)
<![CDATA[ <= ]]>
date(expire_time)
order by expire_time desc limit 1
</select>
<select
id=
"lastFeeInterceptCount"
resultType=
"java.lang.Integer"
>
select
sum(distinct staff_id)
from tab_haoban_qywx_fee_account_staff
where wx_enterprise_id = #{wxEnterpriseId}
and DATE_SUB(CURDATE(), INTERVAL 30 DAY)
<![CDATA[ <= ]]>
date(expire_time)
</select>
</mapper>
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