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
250deac0
Commit
250deac0
authored
Aug 08, 2022
by
墨竹
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:联系我定时任务,判断是否有权限
parent
8403edf3
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
72 additions
and
21 deletions
+72
-21
WxEnterpriseDTO.java
...n/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
+10
-0
WxEnterpriseMapper.java
.../haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
+11
-0
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+14
-4
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+11
-12
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+13
-5
WxEnterpriseMapper.xml
...-service/src/main/resources/mapper/WxEnterpriseMapper.xml
+13
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/WxEnterpriseDTO.java
View file @
250deac0
...
...
@@ -105,6 +105,8 @@ public class WxEnterpriseDTO implements Serializable {
*/
private
Integer
useridFlag
;
private
String
enterpriseId
;
public
String
getMemberSecret
()
{
return
memberSecret
;
}
...
...
@@ -448,4 +450,12 @@ public class WxEnterpriseDTO implements Serializable {
public
void
setUseridFlag
(
Integer
useridFlag
)
{
this
.
useridFlag
=
useridFlag
;
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/WxEnterpriseMapper.java
View file @
250deac0
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.github.pagehelper.Page
;
import
org.apache.ibatis.annotations.Param
;
...
...
@@ -72,4 +73,13 @@ public interface WxEnterpriseMapper {
int
updateUseridFlagById
(
@Param
(
"useridFlag"
)
Integer
useridFlag
,
@Param
(
"corpid"
)
String
corpid
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
/**
* 列出所有wx企业(与gic关联)
*
* @return {@link List }<{@link WxEnterpriseDTO }>
* @author mozhu
* @date 2022-08-08 13:45:30
*/
List
<
WxEnterpriseDTO
>
listAllWxEnterprise
();
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
250deac0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
;
import
java.util.List
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
java.util.List
;
public
interface
WxEnterpriseService
{
String
add
(
WxEnterpriseDTO
wxDTO
);
...
...
@@ -57,6 +57,16 @@ public interface WxEnterpriseService {
*/
List
<
TabHaobanWxEnterprise
>
listAll
();
/**
* 列出所有wx企业(已关联gic企业)
*
* @return {@link List }<{@link WxEnterpriseDTO }>
* @author mozhu
* @date 2022-08-08 13:38:31
*/
List
<
WxEnterpriseDTO
>
listAllWxEnterprise
();
/**
* 更新userid
*
...
...
@@ -68,7 +78,7 @@ public interface WxEnterpriseService {
* @date 2022-06-30 18:49:31
*/
int
updateUseridFlagById
(
Integer
useridFlag
,
String
corpid
,
String
wxEnterpriseId
);
void
stopHaoban
(
String
enterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
250deac0
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
impl
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.common.utils.DingUtils
;
...
...
@@ -25,6 +13,13 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxApplication;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
@Service
public
class
WxEnterpriseServiceImpl
implements
WxEnterpriseService
{
...
...
@@ -137,6 +132,10 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
return
mapper
.
listAll
();
}
@Override
public
List
<
WxEnterpriseDTO
>
listAllWxEnterprise
()
{
return
mapper
.
listAllWxEnterprise
();
}
@Override
public
int
updateUseridFlagById
(
Integer
useridFlag
,
String
corpid
,
String
wxEnterpriseId
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
250deac0
...
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.RightService
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.enterprise.api.dto.StoreDTO
;
...
...
@@ -25,7 +26,6 @@ import com.gic.haoban.manage.api.enums.hm.HmWelcomeReferType;
import
com.gic.haoban.manage.api.service.hm.HmQrcodeApiService
;
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.pojo.bo.hm.*
;
import
com.gic.haoban.manage.service.pojo.bo.welcome.WelcomeDetailBO
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
...
...
@@ -100,6 +100,8 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
private
MemberTagApiService
memberTagApiService
;
@Autowired
private
WelcomeService
welcomeService
;
@Autowired
private
RightService
rightService
;
@GicLogRecord
(
value
=
"新增员工活码-${#logContent}"
,
category
=
GicLogRecordCategoryEnum
.
HUOMA
,
...
...
@@ -714,12 +716,18 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
@Override
public
void
checkStaffOpenContact
(
String
param
)
{
logger
.
info
(
"检查员工是否开启联系我,定时任务,start"
);
List
<
TabHaobanWxEnterprise
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAll
();
for
(
TabHaobanWxEnterprise
tabHaobanWxEnterpris
:
tabHaobanWxEnterprises
)
{
List
<
WxEnterpriseDTO
>
tabHaobanWxEnterprises
=
wxEnterpriseService
.
listAllWxEnterprise
();
for
(
WxEnterpriseDTO
wxEnterpriseDTO
:
tabHaobanWxEnterprises
)
{
String
enterpriseId
=
wxEnterpriseDTO
.
getEnterpriseId
();
//查询出所有正常的导购
String
wxEnterpriseId
=
tabHaobanWxEnterpris
.
getWxEnterpriseId
();
String
wxEnterpriseId
=
wxEnterpriseDTO
.
getWxEnterpriseId
();
boolean
flag
=
rightService
.
hasRightForAdmin
(
enterpriseId
,
"hb_m0206"
);
if
(!
flag
)
{
logger
.
info
(
"该企业未与gic关联,无需开启:enterpriseId:{},wxEnterpriseId:{}"
,
enterpriseId
,
wxEnterpriseId
);
continue
;
}
//企微已经开启联系我
List
<
String
>
wxUserIdsList
=
qywxUserApiService
.
listCorpExternalUser
(
tabHaobanWxEnterpris
.
getCorpid
(),
config
.
getWxSuiteid
());
List
<
String
>
wxUserIdsList
=
qywxUserApiService
.
listCorpExternalUser
(
wxEnterpriseDTO
.
getCorpid
(),
config
.
getWxSuiteid
());
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listIdsByWxOpenUserIds
(
wxUserIdsList
,
wxEnterpriseId
);
if
(
CollectionUtils
.
isEmpty
(
staffClerkRelationDTOS
))
{
logger
.
error
(
"无导购关联数据"
);
...
...
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseMapper.xml
View file @
250deac0
...
...
@@ -497,4 +497,16 @@
where wx_enterprise_id = #{wxEnterpriseId}
</update>
<select
id=
"listAllWxEnterprise"
resultType=
"com.gic.haoban.manage.api.dto.WxEnterpriseDTO"
>
select
a.wx_enterprise_id wxEnterpriseId,
a.corpid corpid,
a.corp_name corpName,
b.enterprise_id enterpriseId
from tab_haoban_wx_enterprise a
join tab_haoban_wx_enterprise_related b on a.wx_enterprise_id = b.wx_enterprise_id
where a.status_flag = 1 and b.status_flag = 1
group by a.wx_enterprise_id
</select>
</mapper>
\ No newline at end of file
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