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
a7f06c4c
Commit
a7f06c4c
authored
Aug 17, 2023
by
jinxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分配许可账号
parent
b94f74b1
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
128 additions
and
9 deletions
+128
-9
StaffActiveAllocationDTO.java
...m/gic/haoban/manage/api/dto/StaffActiveAllocationDTO.java
+37
-0
StaffApiService.java
...va/com/gic/haoban/manage/api/service/StaffApiService.java
+2
-0
TabHaobanQywxFeeOrderAccountMapper.java
...ce/dao/mapper/fee/TabHaobanQywxFeeOrderAccountMapper.java
+5
-4
HaobanQywxFeeOrderAccountService.java
...service/service/fee/HaobanQywxFeeOrderAccountService.java
+6
-2
HaobanQywxFeeOrderAccountServiceImpl.java
...ervice/fee/impl/HaobanQywxFeeOrderAccountServiceImpl.java
+12
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+52
-0
TabHaobanQywxFeeOrderAccountMapper.xml
...sources/mapper/fee/TabHaobanQywxFeeOrderAccountMapper.xml
+14
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffActiveAllocationDTO.java
0 → 100644
View file @
a7f06c4c
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
/**
* @description:
* @Author: wenhua
* @Date: 2023/8/16 10:08
*/
public
class
StaffActiveAllocationDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 失败个数
*/
private
Integer
nums
;
/**
* 失败原因
*/
private
String
errMessage
;
public
Integer
getNums
()
{
return
nums
;
}
public
void
setNums
(
Integer
nums
)
{
this
.
nums
=
nums
;
}
public
String
getErrMessage
()
{
return
errMessage
;
}
public
void
setErrMessage
(
String
errMessage
)
{
this
.
errMessage
=
errMessage
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffApiService.java
View file @
a7f06c4c
...
@@ -356,4 +356,6 @@ public interface StaffApiService {
...
@@ -356,4 +356,6 @@ public interface StaffApiService {
*/
*/
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
Boolean
>
syncQywxStaffList
(
String
params
)
;
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
Boolean
>
syncQywxStaffList
(
String
params
)
;
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
StaffActiveAllocationDTO
>
staffActiveAllocation
(
String
wxEnterpriseId
,
String
staffIds
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/fee/TabHaobanQywxFeeOrderAccountMapper.java
View file @
a7f06c4c
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
.
fee
;
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
.
fee
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
...
@@ -53,5 +50,9 @@ public interface TabHaobanQywxFeeOrderAccountMapper {
...
@@ -53,5 +50,9 @@ public interface TabHaobanQywxFeeOrderAccountMapper {
int
countOrderAccountStatus
(
@Param
(
"status"
)
Integer
status
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
int
countOrderAccountStatus
(
@Param
(
"status"
)
Integer
status
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
HashMap
<
String
,
Integer
>>
countStatusByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
HashMap
<
String
,
Integer
>>
countStatusByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanQywxFeeOrderAccount
>
selectByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
void
updateByActiveCode
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"activeCode"
)
String
activeCode
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/HaobanQywxFeeOrderAccountService.java
View file @
a7f06c4c
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
fee
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
fee
;
import
java.util.List
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
java.util.List
;
/**
/**
* 企业微信收费订单账号(激活码)(TabHaobanQywxFeeOrderAccount)表服务接口
* 企业微信收费订单账号(激活码)(TabHaobanQywxFeeOrderAccount)表服务接口
*
*
...
@@ -31,4 +31,8 @@ public interface HaobanQywxFeeOrderAccountService {
...
@@ -31,4 +31,8 @@ public interface HaobanQywxFeeOrderAccountService {
*/
*/
int
countOrderAccountStatus
(
Integer
status
,
String
wxEnterpriseId
);
int
countOrderAccountStatus
(
Integer
status
,
String
wxEnterpriseId
);
List
<
TabHaobanQywxFeeOrderAccount
>
selectByWxEnterpriseId
(
String
wxEnterpriseId
);
void
updateByActiveCode
(
String
wxEnterpriseId
,
String
activeCode
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/fee/impl/HaobanQywxFeeOrderAccountServiceImpl.java
View file @
a7f06c4c
...
@@ -4,12 +4,11 @@ import com.gic.commons.util.UniqueIdUtils;
...
@@ -4,12 +4,11 @@ import com.gic.commons.util.UniqueIdUtils;
import
com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeOrderAccountMapper
;
import
com.gic.haoban.manage.service.dao.mapper.fee.TabHaobanQywxFeeOrderAccountMapper
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
/**
* 企业微信收费订单账号(激活码)(TabHaobanQywxFeeOrderAccount)表服务实现类
* 企业微信收费订单账号(激活码)(TabHaobanQywxFeeOrderAccount)表服务实现类
*
*
...
@@ -48,4 +47,14 @@ public class HaobanQywxFeeOrderAccountServiceImpl implements HaobanQywxFeeOrderA
...
@@ -48,4 +47,14 @@ public class HaobanQywxFeeOrderAccountServiceImpl implements HaobanQywxFeeOrderA
return
tabHaobanQywxFeeOrderAccountMapper
.
countOrderAccountStatus
(
status
,
wxEnterpriseId
);
return
tabHaobanQywxFeeOrderAccountMapper
.
countOrderAccountStatus
(
status
,
wxEnterpriseId
);
}
}
@Override
public
List
<
TabHaobanQywxFeeOrderAccount
>
selectByWxEnterpriseId
(
String
wxEnterpriseId
)
{
return
tabHaobanQywxFeeOrderAccountMapper
.
selectByWxEnterpriseId
(
wxEnterpriseId
);
}
@Override
public
void
updateByActiveCode
(
String
wxEnterpriseId
,
String
activeCode
)
{
tabHaobanQywxFeeOrderAccountMapper
.
updateByActiveCode
(
wxEnterpriseId
,
activeCode
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
a7f06c4c
...
@@ -37,10 +37,12 @@ import com.gic.haoban.manage.service.config.Config;
...
@@ -37,10 +37,12 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffDepartmentRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.entity.fee.TabHaobanQywxFeeOrderAccount
;
import
com.gic.haoban.manage.service.errorcode.QywxErrCode
;
import
com.gic.haoban.manage.service.errorcode.QywxErrCode
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.gic.haoban.manage.service.pojo.bo.StaffListBO
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.service.chat.GroupChatService
;
import
com.gic.haoban.manage.service.service.fee.HaobanQywxFeeOrderAccountService
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.thirdparty.cloudfile.CloudFileUtil
;
import
com.gic.thirdparty.cloudfile.CloudFileUtil
;
...
@@ -50,6 +52,7 @@ import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
...
@@ -50,6 +52,7 @@ import com.gic.thirdparty.cloudfile.pojo.CloudFileInfo;
import
com.gic.wechat.api.dto.qywx.QywxNewUseridDTO
;
import
com.gic.wechat.api.dto.qywx.QywxNewUseridDTO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.dto.qywx.UserDTO
;
import
com.gic.wechat.api.dto.qywx.fee.AccountTransferUserDTO
;
import
com.gic.wechat.api.dto.qywx.fee.AccountTransferUserDTO
;
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
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
...
@@ -121,6 +124,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -121,6 +124,8 @@ public class StaffApiServiceImpl implements StaffApiService {
private
ExternalClerkRelatedService
externalClerkRelatedService
;
private
ExternalClerkRelatedService
externalClerkRelatedService
;
@Autowired
@Autowired
private
WxEnterpriseActiveDataService
wxEnterpriseActiveDataService
;
private
WxEnterpriseActiveDataService
wxEnterpriseActiveDataService
;
@Autowired
private
HaobanQywxFeeOrderAccountService
haobanQywxFeeOrderAccountService
;
@Override
@Override
public
StaffDTO
selectById
(
String
staffId
)
{
public
StaffDTO
selectById
(
String
staffId
)
{
...
@@ -1215,6 +1220,9 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1215,6 +1220,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
staffMapper
.
updateActiveStatusById
(
staffId
,
timeStampDate
,
expireTimeDate
,
activeCode
);
staffMapper
.
updateActiveStatusById
(
staffId
,
timeStampDate
,
expireTimeDate
,
activeCode
);
groupChatService
.
initStaffGroupChat
(
staffId
);
groupChatService
.
initStaffGroupChat
(
staffId
);
//更新好办激活码许可表
haobanQywxFeeOrderAccountService
.
updateByActiveCode
(
wxEnterprise
.
getWxEnterpriseId
(),
activeCode
);
}
}
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
true
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
true
);
}
}
...
@@ -1283,4 +1291,48 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -1283,4 +1291,48 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
return
null
;
return
null
;
}
}
@Override
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
StaffActiveAllocationDTO
>
staffActiveAllocation
(
String
wxEnterpriseId
,
String
staffIds
)
{
StaffActiveAllocationDTO
result
=
new
StaffActiveAllocationDTO
();
if
(
StrUtil
.
isBlank
(
staffIds
)){
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"-9999"
,
"参数不能为空"
);
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
if
(
wxEnterpriseDTO
==
null
)
{
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"-9999"
,
"企业微信不存在!!"
);
}
String
openCorpid
=
wxEnterpriseDTO
.
getOpenCorpid
();
String
serviceCorpid
=
config
.
getCorpid
();
List
<
String
>
staffIdList
=
Arrays
.
asList
(
staffIds
.
split
(
","
));
List
<
TabHaobanStaff
>
haobanStaffs
=
staffMapper
.
listByIds
(
staffIdList
);
List
<
TabHaobanQywxFeeOrderAccount
>
accounts
=
haobanQywxFeeOrderAccountService
.
selectByWxEnterpriseId
(
wxEnterpriseId
);
if
(
CollUtil
.
isEmpty
(
accounts
)
||
accounts
.
size
()
<
haobanStaffs
.
size
()){
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"-9999"
,
"剩余可用许可数量小于激活成员数量"
);
}
if
(
CollUtil
.
isNotEmpty
(
haobanStaffs
)){
int
num
=
0
;
String
errMessage
=
null
;
for
(
int
i
=
0
;
i
<
haobanStaffs
.
size
();
i
++){
JSONObject
object
=
new
JSONObject
();
object
.
put
(
"active_code"
,
accounts
.
get
(
i
).
getActiveCode
());
object
.
put
(
"corpid"
,
openCorpid
);
String
wxUserId
=
haobanStaffs
.
get
(
i
).
getWxUserId
();
if
(
StrUtil
.
isBlank
(
wxUserId
)){
wxUserId
=
haobanStaffs
.
get
(
i
).
getWxOpenUseId
();
}
object
.
put
(
"userid"
,
wxUserId
);
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
QywxResponseDTO
>
response
=
qywxOrderApiService
.
activeAccount
(
serviceCorpid
,
JSON
.
toJSONString
(
object
));
if
(!
response
.
isSuccess
()){
num
++;
errMessage
=
"许可账号分配失败,复制链接查看失败原因:https://developer.work.weixin.qq.com/devtool/query?e="
+
response
.
getCode
();
}
}
result
.
setNums
(
num
);
result
.
setErrMessage
(
errMessage
);
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
result
);
}
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"-9999"
,
"成员不存在"
);
}
}
}
haoban-manage3-service/src/main/resources/mapper/fee/TabHaobanQywxFeeOrderAccountMapper.xml
View file @
a7f06c4c
...
@@ -87,5 +87,19 @@
...
@@ -87,5 +87,19 @@
where wx_enterprise_id = #{wxEnterpriseId} GROUP BY STATUS
where wx_enterprise_id = #{wxEnterpriseId} GROUP BY STATUS
</select>
</select>
<select
id=
"selectByWxEnterpriseId"
resultMap=
"TabHaobanQywxFeeOrderAccountMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_qywx_fee_order_account
where wx_enterprise_id = #{wxEnterpriseId}
and status in (1,4)
</select>
<update
id=
"updateByActiveCode"
>
update tab_haoban_qywx_fee_order_account
set status = 2,update_time = NOW()
where wx_enterprise_id = #{wxEnterpriseId} and active_code = #{activeCode}
</update>
</mapper>
</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