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
93eee90a
Commit
93eee90a
authored
Aug 12, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tab_haoban_staff_clerk_relation的wxuserid废弃
parent
0d1fd3a7
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
132 additions
and
211 deletions
+132
-211
StaffClerkRelationDTO.java
.../com/gic/haoban/manage/api/dto/StaffClerkRelationDTO.java
+19
-20
StaffClerkRelationApiService.java
...oban/manage/api/service/StaffClerkRelationApiService.java
+2
-8
StaffMapper.java
...com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
+0
-30
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+3
-15
TabHaobanStaffClerkRelation.java
...an/manage/service/entity/TabHaobanStaffClerkRelation.java
+0
-10
StaffClerkRelationService.java
...ban/manage/service/service/StaffClerkRelationService.java
+2
-9
StaffClerkRelationServiceImpl.java
...e/service/service/impl/StaffClerkRelationServiceImpl.java
+6
-7
NoticeMessageApiServiceImpl.java
...rvice/service/notify/out/NoticeMessageApiServiceImpl.java
+2
-2
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+0
-1
DealSyncOperationApiServiceImpl.java
...ice/service/out/impl/DealSyncOperationApiServiceImpl.java
+7
-3
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+3
-3
StaffClerkRelationApiServiceImpl.java
...ce/service/out/impl/StaffClerkRelationApiServiceImpl.java
+46
-29
HmQrcodeApiServiceImpl.java
...e/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
+0
-3
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+38
-67
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+1
-1
AuditController.java
...com/gic/haoban/manage/web/controller/AuditController.java
+1
-1
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+2
-2
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffClerkRelationDTO.java
View file @
93eee90a
...
...
@@ -13,8 +13,6 @@ public class StaffClerkRelationDTO implements Serializable {
private
String
wxEnterpriseId
;
private
String
wxUserId
;
private
String
enterpriseId
;
private
String
storeId
;
...
...
@@ -32,9 +30,26 @@ public class StaffClerkRelationDTO implements Serializable {
private
String
storeName
;
private
String
staffName
;
private
String
wxOpenUserId
;
private
Integer
openConcatFlag
;
private
String
qwUserId
;
private
String
openUserId
;
public
String
getQwUserId
()
{
return
qwUserId
;
}
public
String
getOpenUserId
()
{
return
openUserId
;
}
public
void
setQwUserId
(
String
qwUserId
)
{
this
.
qwUserId
=
qwUserId
;
}
public
void
setOpenUserId
(
String
openUserId
)
{
this
.
openUserId
=
openUserId
;
}
public
String
getStaffClerkRelationId
()
{
return
staffClerkRelationId
;
...
...
@@ -60,14 +75,6 @@ public class StaffClerkRelationDTO implements Serializable {
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
==
null
?
null
:
wxUserId
.
trim
();
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
...
...
@@ -140,14 +147,6 @@ public class StaffClerkRelationDTO implements Serializable {
this
.
staffName
=
staffName
;
}
public
String
getWxOpenUserId
()
{
return
wxOpenUserId
;
}
public
void
setWxOpenUserId
(
String
wxOpenUserId
)
{
this
.
wxOpenUserId
=
wxOpenUserId
;
}
public
Integer
getOpenConcatFlag
()
{
if
(
null
==
openConcatFlag
)
{
return
1
;
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/StaffClerkRelationApiService.java
View file @
93eee90a
...
...
@@ -93,6 +93,8 @@ public interface StaffClerkRelationApiService {
* @return
*/
StaffClerkRelationDTO
getByClerkId
(
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdForWxUserId
(
String
clerkId
);
/**
* @param enterpriseId
...
...
@@ -161,14 +163,6 @@ public interface StaffClerkRelationApiService {
Page
<
StaffClerkRelationDTO
>
pageByWxEnterpriseId
(
String
wxEnterpriseId
,
BasePageInfo
pageInfo
);
/**
* 查询状态正常导购
*
* @return
*/
List
<
StaffClerkRelationDTO
>
listAll
();
/**
* 通过员工id列表
*
* @param wxEnterpriseId wx企业标识
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/StaffMapper.java
View file @
93eee90a
...
...
@@ -58,36 +58,18 @@ public interface StaffMapper {
/**
* 通过开放用户id和wx企业id列表
*
* @param openUserIds 开放的用户id
* @param wxEnterpriseId wx企业标识
* @return {@link List<TabHaobanStaff> }
* @author mozhu
* @date 2021-12-21 16:35:35
*/
List
<
TabHaobanStaff
>
listByOpenUserIdsAndWxEnterpriseId
(
@Param
(
"openUserIds"
)
List
<
String
>
openUserIds
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
/**
* 用户id wx企业id列表
*
* @param wxEnterpriseId wx企业标识
* @return {@link List<String> }
* @author mozhu
* @date 2021-12-21 17:05:58
*/
List
<
TabHaobanStaff
>
listUserIdByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
/**
* 更新开放用户id,用户id
*
* @param wxEnterpriseId wx企业标识
* @param wxUserId wx用户id
* @param wxOpenUseId 开放的用户id
* @return int
* @author mozhu
* @date 2021-12-21 17:17:51
*/
int
updateOpenUserIdsByUserId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"wxUserId"
)
String
wxUserId
,
...
...
@@ -95,12 +77,6 @@ public interface StaffMapper {
/**
* 选择通过打开用户id和企业标识
*
* @param wxOpenUseId wx开放使用id
* @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff }
* @author mozhu
* @date 2021-12-21 21:13:56
*/
TabHaobanStaff
selectByOpenUserIdAndEnterpriseId
(
@Param
(
"wxOpenUseId"
)
String
wxOpenUseId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
...
...
@@ -125,12 +101,6 @@ public interface StaffMapper {
/**
* 选择电话号码和企业标识
*
* @param phoneNumber 电话号码
* @param wxEnterpriseId wx企业标识
* @return {@link TabHaobanStaff }
* @author mozhu
* @date 2022-01-12 17:20:16
*/
TabHaobanStaff
selectByPhoneNumberAndEnterpriseId
(
@Param
(
"phoneNumber"
)
String
phoneNumber
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
93eee90a
...
...
@@ -9,15 +9,11 @@ import java.util.List;
import
java.util.Set
;
public
interface
TabHaobanStaffClerkRelationMapper
{
int
deleteByPrimaryKey
(
String
staffClerkRelationId
);
int
insert
(
TabHaobanStaffClerkRelation
record
);
TabHaobanStaffClerkRelation
selectByPrimaryKey
(
String
staffClerkRelationId
);
int
updateByPrimaryKeySelective
(
TabHaobanStaffClerkRelation
record
);
List
<
TabHaobanStaffClerkRelation
>
listBindCode
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"clerkCodeList"
)
Set
<
String
>
clerkCodeList
);
List
<
TabHaobanStaffClerkRelation
>
listBindCodeByStaffId
(
@Param
(
"enterpriseIdList"
)
List
<
String
>
enterpriseIdList
,
@Param
(
"staffId"
)
String
staffId
);
...
...
@@ -82,6 +78,8 @@ public interface TabHaobanStaffClerkRelationMapper {
TabHaobanStaffClerkRelation
getOneBindStoreId
(
@Param
(
"staffId"
)
String
staffId
,
@Param
(
"storeId"
)
String
storeId
);
TabHaobanStaffClerkRelation
getByClerkId
(
@Param
(
"clerkId"
)
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdForWxUserId
(
@Param
(
"clerkId"
)
String
clerkId
);
TabHaobanStaffClerkRelation
getByClerkIdNoStatus
(
@Param
(
"clerkId"
)
String
clerkId
);
...
...
@@ -99,7 +97,7 @@ public interface TabHaobanStaffClerkRelationMapper {
List
<
TabHaobanStaffClerkRelation
>
pageByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanStaffClerkRelation
>
listBindByStoreId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"storeId"
)
String
storeId
);
List
<
StaffClerkRelationDTO
>
listBindByStoreId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"storeId"
)
String
storeId
);
/**
* 授权绑定的列表
...
...
@@ -133,16 +131,6 @@ public interface TabHaobanStaffClerkRelationMapper {
*/
List
<
TabHaobanStaffClerkRelation
>
listBindStoreIdByEnterpriseId
(
String
enterpriseId
);
/**
* 列出所有
*
* @return {@link List<TabHaobanStaffClerkRelation> }
* @author xuwenqian
* @date 2021-07-15 16:24:27
*/
List
<
StaffClerkRelationDTO
>
listAll
();
/**
* 查询有关联的员工id列表
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanStaffClerkRelation.java
View file @
93eee90a
...
...
@@ -12,8 +12,6 @@ public class TabHaobanStaffClerkRelation implements Serializable {
private
String
wxEnterpriseId
;
private
String
wxUserId
;
private
String
enterpriseId
;
private
String
storeId
;
...
...
@@ -54,14 +52,6 @@ public class TabHaobanStaffClerkRelation implements Serializable {
this
.
wxEnterpriseId
=
wxEnterpriseId
==
null
?
null
:
wxEnterpriseId
.
trim
();
}
public
String
getWxUserId
()
{
return
wxUserId
;
}
public
void
setWxUserId
(
String
wxUserId
)
{
this
.
wxUserId
=
wxUserId
==
null
?
null
:
wxUserId
.
trim
();
}
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/StaffClerkRelationService.java
View file @
93eee90a
...
...
@@ -77,6 +77,8 @@ public interface StaffClerkRelationService {
StaffClerkRelationDTO
getOneBindByStoreId
(
String
staffId
,
String
storeId
);
StaffClerkRelationDTO
getByClerkId
(
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdForWxUserId
(
String
clerkId
);
StaffClerkRelationDTO
getByClerkIdNoStatus
(
String
clerkId
);
...
...
@@ -126,15 +128,6 @@ public interface StaffClerkRelationService {
List
<
StaffClerkRelationDTO
>
listBindStoreIdByEnterpriseId
(
String
enterpriseId
);
/**
* 查询所有正常导购
*
* @return {@link List<StaffClerkRelationDTO> }
* @author xuwenqian
* @date 2021-07-15 16:26:17
*/
List
<
StaffClerkRelationDTO
>
listAll
();
/**
* 查询有关联的员工id列表
*
* @param staffIdList 员工id列表
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffClerkRelationServiceImpl.java
View file @
93eee90a
...
...
@@ -249,6 +249,11 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
public
StaffClerkRelationDTO
getByClerkId
(
String
clerkId
)
{
return
EntityUtil
.
changeEntityByJSON
(
StaffClerkRelationDTO
.
class
,
mapper
.
getByClerkId
(
clerkId
));
}
@Override
public
StaffClerkRelationDTO
getByClerkIdForWxUserId
(
String
clerkId
)
{
return
this
.
mapper
.
getByClerkIdForWxUserId
(
clerkId
);
}
@Override
public
StaffClerkRelationDTO
getByClerkIdNoStatus
(
String
clerkId
)
{
...
...
@@ -302,8 +307,7 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
@Override
public
List
<
StaffClerkRelationDTO
>
listBindByStoreId
(
String
wxEnterpriseId
,
String
storeId
)
{
List
<
TabHaobanStaffClerkRelation
>
ret
=
mapper
.
listBindByStoreId
(
wxEnterpriseId
,
storeId
);
return
EntityUtil
.
changeEntityListNew
(
StaffClerkRelationDTO
.
class
,
ret
);
return
mapper
.
listBindByStoreId
(
wxEnterpriseId
,
storeId
);
}
@Override
...
...
@@ -316,11 +320,6 @@ public class StaffClerkRelationServiceImpl implements StaffClerkRelationService
}
@Override
public
List
<
StaffClerkRelationDTO
>
listAll
()
{
return
mapper
.
listAll
();
}
@Override
public
List
<
String
>
listRelationsStaffId
(
Set
<
String
>
staffIdList
)
{
return
mapper
.
listRelationsStaffId
(
staffIdList
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/notify/out/NoticeMessageApiServiceImpl.java
View file @
93eee90a
...
...
@@ -102,13 +102,13 @@ public class NoticeMessageApiServiceImpl implements NoticeMessageApiService {
wxEnterpriseId
=
haobanStaff
!=
null
?
haobanStaff
.
getWxEnterpriseId
()
:
null
;
}
if
(
StringUtils
.
isNotEmpty
(
messageQDTO
.
getClerkId
()))
{
clerkRelationDTO
=
staffClerkRelationService
.
getByClerkId
(
messageQDTO
.
getClerkId
());
clerkRelationDTO
=
staffClerkRelationService
.
getByClerkId
ForWxUserId
(
messageQDTO
.
getClerkId
());
}
if
(
wxUserId
==
null
&&
clerkRelationDTO
==
null
)
{
logger
.
info
(
"没有导购:{}"
,
messageQDTO
.
getClerkId
());
return
;
}
wxUserId
=
(
wxUserId
==
null
?
clerkRelationDTO
.
get
Wx
UserId
()
:
wxUserId
);
wxUserId
=
(
wxUserId
==
null
?
clerkRelationDTO
.
get
Qw
UserId
()
:
wxUserId
);
wxEnterpriseId
=
(
wxEnterpriseId
==
null
?
clerkRelationDTO
.
getWxEnterpriseId
()
:
wxEnterpriseId
);
//消息组装 新增消息
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
93eee90a
...
...
@@ -164,7 +164,6 @@ public class AuditApiServiceImpl implements AuditApiService {
staffClerkRelation
.
setClerkId
(
obj
.
getClerkId
());
staffClerkRelation
.
setStoreId
(
tab
.
getCommitStoreId
());
staffClerkRelation
.
setWxEnterpriseId
(
tab
.
getWxEnterpriseId
());
staffClerkRelation
.
setWxUserId
(
obj
.
getWxUserId
());
staffClerkRelation
.
setStaffId
(
obj
.
getStaffId
());
staffClerkRelationApiService
.
delAndInsert
(
staffClerkRelation
,
optStaffId
,
ChannelCodeEnum
.
AUDIT_BIND
.
getCode
());
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
View file @
93eee90a
...
...
@@ -15,6 +15,7 @@ import com.gic.haoban.common.utils.EntityUtil;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.enums.*
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
import
com.gic.haoban.manage.service.dao.mapper.StaffMapper
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.task.BaseSyncOperation
;
...
...
@@ -63,6 +64,8 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
@Autowired
private
StaffService
staffService
;
@Autowired
private
StaffMapper
staffMapper
;
@Autowired
private
StaffDepartmentRelatedService
staffDepartmentRelatedService
;
...
...
@@ -613,10 +616,11 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
@Override
public
void
dealWxFriendClerk
(
String
taskId
,
String
wxEnterpriseId
)
{
List
<
TabHaobanStaffClerkRelation
>
relationList
=
staffClerkRelationService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
//List<TabHaobanStaffClerkRelation> relationList = staffClerkRelationService.listByWxEnterpriseId(wxEnterpriseId);
List
<
TabHaobanStaff
>
list
=
this
.
staffMapper
.
listByWxEnterpriseId
(
wxEnterpriseId
)
;
List
<
TabHaobanClerkMainStoreRelated
>
mainStoreList
=
clerkMainStoreRelatedService
.
listByWxEnterpriseId
(
wxEnterpriseId
);
Map
<
String
,
TabHaobanClerkMainStoreRelated
>
map
=
mainStoreList
.
stream
().
collect
(
Collectors
.
toMap
(
TabHaobanClerkMainStoreRelated:
:
getStaffId
,
s
->
s
));
List
<
TabHaobanPreDealLog
>
dealLogList
=
relationList
.
stream
().
filter
(
ls
->
map
.
get
(
ls
.
getStaffId
())
!=
null
).
map
(
dto
->
{
List
<
TabHaobanPreDealLog
>
dealLogList
=
list
.
stream
(
).
map
(
dto
->
{
TabHaobanPreDealLog
dealLog
=
new
TabHaobanPreDealLog
();
dealLog
.
setDataId
(
dto
.
getWxUserId
());
dealLog
.
setpDataId
(
dto
.
getStaffId
());
...
...
@@ -685,7 +689,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
}
List
<
TabHaobanPreDealLog
>
dealLogList
=
clerkRelationDTOS
.
stream
().
map
(
dto
->
{
TabHaobanPreDealLog
dealLog
=
new
TabHaobanPreDealLog
();
dealLog
.
setDataId
(
dto
.
get
Wx
UserId
());
dealLog
.
setDataId
(
dto
.
get
Qw
UserId
());
dealLog
.
setpDataId
(
dto
.
getStaffId
());
dealLog
.
setDataType
(
PreDealTypeEnum
.
friend_clerk
.
getVal
());
dealLog
.
setStatusFlag
(
0
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
93eee90a
...
...
@@ -671,7 +671,7 @@ public class StaffApiServiceImpl implements StaffApiService {
}
ClerkDTO
clerkDTO
=
list
.
get
(
0
);
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getByClerkId
(
clerkDTO
.
getClerkId
());
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getByClerkId
ForWxUserId
(
clerkDTO
.
getClerkId
());
if
(
relationDTO
==
null
)
{
logger
.
info
(
"成员没有关联:{}"
,
clerkCode
);
return
null
;
...
...
@@ -688,7 +688,7 @@ public class StaffApiServiceImpl implements StaffApiService {
logger
.
info
(
"没有配置secret:{}"
,
qwDTO
.
getWxEnterpriseId
());
return
null
;
}
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
relationDTO
.
get
Wx
UserId
());
UserDTO
user
=
qywxUserApiService
.
getSelfWorkWxUser
(
qwDTO
.
getDkCorpid
(),
secretSetting
.
getSecretVal
(),
relationDTO
.
get
Qw
UserId
());
if
(
user
!=
null
)
{
RedisUtil
.
setCache
(
key
,
user
.
getQr_code
(),
2L
,
TimeUnit
.
DAYS
);
resp
.
setResult
(
user
.
getQr_code
());
...
...
@@ -718,7 +718,7 @@ public class StaffApiServiceImpl implements StaffApiService {
Set
<
String
>
keySet
=
clerkIdMap
.
keySet
();
for
(
String
clerkId
:
clerkList
)
{
if
(
keySet
.
contains
(
clerkId
))
{
userIdList
.
add
(
clerkIdMap
.
get
(
clerkId
).
get
Wx
UserId
());
userIdList
.
add
(
clerkIdMap
.
get
(
clerkId
).
get
Qw
UserId
());
}
}
return
userIdList
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffClerkRelationApiServiceImpl.java
View file @
93eee90a
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
cn.hutool.core.collection.CollectionUtil
;
import
java.util.ArrayList
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
...
...
@@ -14,35 +27,40 @@ import com.gic.enterprise.api.service.EnterpriseService;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkBindLogDetailDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkBindLogInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkInfoDTO
;
import
com.gic.haoban.manage.api.dto.StaffClerkRelationDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseQwDTO
;
import
com.gic.haoban.manage.api.dto.qdto.ClerkSyncQDTO
;
import
com.gic.haoban.manage.api.enums.AuditType
;
import
com.gic.haoban.manage.api.enums.BindTypeEnum
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.SecretTypeEnum
;
import
com.gic.haoban.manage.api.service.AuditApiService
;
import
com.gic.haoban.manage.api.service.StaffClerkRelationApiService
;
import
com.gic.haoban.manage.api.service.hm.HmClerkRelationApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.entity.MemberClerkChatConfig
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaff
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffClerkBindLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.haoban.manage.service.service.ClerkMainStoreRelatedService
;
import
com.gic.haoban.manage.service.service.ExternalClerkRelatedService
;
import
com.gic.haoban.manage.service.service.SecretSettingService
;
import
com.gic.haoban.manage.service.service.StaffClerkBindLogService
;
import
com.gic.haoban.manage.service.service.StaffClerkRelationService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.haoban.manage.service.service.hm.HmQrcodeService
;
import
com.gic.haoban.manage.service.task.RouterConstant
;
import
com.gic.haoban.task.api.dto.MqMessageQo
;
import
com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactDTO
;
import
com.gic.wechat.api.dto.qywx.welcome.QywxExternalcontactResultDTO
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
cn.hutool.core.collection.CollectionUtil
;
@Service
public
class
StaffClerkRelationApiServiceImpl
implements
StaffClerkRelationApiService
{
...
...
@@ -79,6 +97,8 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
private
HmClerkRelationApiService
hmClerkRelationApiService
;
@Autowired
private
HmQrcodeService
hmQrcodeService
;
@Autowired
private
Config
config
;
@Override
public
void
bindLogMq
(
String
params
)
{
...
...
@@ -251,6 +271,11 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
StaffClerkRelationDTO
staffRelation
=
staffClerkRelationService
.
getByClerkId
(
clerkId
);
return
staffRelation
;
}
@Override
public
StaffClerkRelationDTO
getByClerkIdForWxUserId
(
String
clerkId
)
{
return
staffClerkRelationService
.
getByClerkIdForWxUserId
(
clerkId
);
}
@Override
public
StaffClerkRelationDTO
getOneByStoreIdAndStaffId
(
String
storeId
,
...
...
@@ -377,7 +402,7 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
@Override
public
ServiceResponse
<
String
>
getClerkMemberChatConfig
(
String
clerkId
)
{
ServiceResponse
response
=
new
ServiceResponse
();
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getByClerkId
(
clerkId
);
StaffClerkRelationDTO
relationDTO
=
staffClerkRelationService
.
getByClerkId
ForWxUserId
(
clerkId
);
if
(
null
==
relationDTO
)
{
logger
.
info
(
"导购没有关联企业微信:{}"
,
clerkId
);
response
.
setCode
(
2
);
...
...
@@ -396,20 +421,17 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
send
.
setScene
(
1
);
send
.
setRemark
(
"导购:"
+
relationDTO
.
getClerkCode
());
List
<
String
>
userIds
=
new
ArrayList
<>();
userIds
.
add
(
relationDTO
.
getWxUserId
());
send
.
setUser
(
userIds
);
SecretSettingDTO
secretSetting
=
secretSettingService
.
getSecretSetting
(
relationDTO
.
getWxEnterpriseId
(),
SecretTypeEnum
.
CUSTOMIZED_APP
.
getVal
());
if
(
null
==
secretSetting
||
secretSetting
.
getCheckFlag
()
==
0
)
{
logger
.
info
(
"没有配置secret:{}"
,
relationDTO
.
getWxEnterpriseId
());
response
.
setCode
(
3
);
response
.
setMessage
(
"企业微信配置异常"
);
return
response
;
}
WxEnterpriseQwDTO
qwDTO
=
this
.
wxEnterpriseService
.
getQwInfo
(
relationDTO
.
getWxEnterpriseId
())
;
String
configId
=
qywxUserApiService
.
getSelfExternalcontactByUserId
(
qwDTO
.
getDkCorpid
()
,
secretSetting
.
getSecretVal
(),
send
);
logger
.
info
(
"configId:{}"
,
configId
);
if
(
qwDTO
.
needOpenUserId3th
())
{
userIds
.
add
(
relationDTO
.
getOpenUserId
())
;
}
else
{
userIds
.
add
(
relationDTO
.
getQwUserId
())
;
}
QywxExternalcontactResultDTO
configResp
=
qywxUserApiService
.
addContactWay
(
qwDTO
.
getDkCorpid
()
,
config
.
getWxSuiteid
()
,
send
);
logger
.
info
(
"configId:{}"
,
JSON
.
toJSONString
(
configResp
));
String
configId
=
configResp
.
getConfig_id
()
;
if
(
StringUtils
.
isBlank
(
configId
))
{
logger
.
info
(
"staff:{}"
,
configId
,
JSONObject
.
toJSONString
(
relationDTO
));
response
.
setCode
(
4
);
...
...
@@ -433,11 +455,6 @@ public class StaffClerkRelationApiServiceImpl implements StaffClerkRelationApiSe
}
@Override
public
List
<
StaffClerkRelationDTO
>
listAll
()
{
return
staffClerkRelationService
.
listAll
();
}
@Override
public
List
<
StaffClerkRelationDTO
>
listByStaffId
(
String
wxEnterpriseId
,
String
staffId
)
{
return
staffClerkRelationService
.
listByStaffId
(
wxEnterpriseId
,
staffId
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/hm/HmQrcodeApiServiceImpl.java
View file @
93eee90a
...
...
@@ -551,12 +551,9 @@ public class HmQrcodeApiServiceImpl implements HmQrcodeApiService {
logger
.
error
(
"该导购已经在该多人活码中,clerkId:{}"
,
clerkId
);
continue
;
}
StaffClerkRelationDTO
clerkRelationDTO
=
staffClerkRelationService
.
getByClerkId
(
clerkId
);
HmClerkRelationQDTO
hmClerkRelationQDTO
=
new
HmClerkRelationQDTO
();
hmClerkRelationQDTO
.
setRelationId
(
UniqueIdUtils
.
uniqueLong
());
hmClerkRelationQDTO
.
setHmId
(
hmId
);
hmClerkRelationQDTO
.
setWxUserId
(
clerkRelationDTO
.
getWxUserId
());
hmClerkRelationQDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
hmClerkRelationQDTO
.
setEnterpriseId
(
enterpriseId
);
hmClerkRelationQDTO
.
setClerkId
(
clerkId
);
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
93eee90a
...
...
@@ -5,7 +5,6 @@
<id
column=
"staff_clerk_relation_id"
property=
"staffClerkRelationId"
jdbcType=
"VARCHAR"
/>
<result
column=
"staff_id"
property=
"staffId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_user_id"
property=
"wxUserId"
jdbcType=
"VARCHAR"
/>
<result
column=
"enterprise_id"
property=
"enterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"store_id"
property=
"storeId"
jdbcType=
"VARCHAR"
/>
<result
column=
"clerk_id"
property=
"clerkId"
jdbcType=
"VARCHAR"
/>
...
...
@@ -16,7 +15,7 @@
<result
column=
"open_concat_flag"
property=
"openConcatFlag"
jdbcType=
"INTEGER"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
staff_clerk_relation_id, staff_id, wx_enterprise_id,
wx_user_id,
enterprise_id, store_id,
staff_clerk_relation_id, staff_id, wx_enterprise_id, enterprise_id, store_id,
clerk_id, clerk_code, status_flag, create_time, update_time,open_concat_flag
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
...
...
@@ -25,11 +24,7 @@
from tab_haoban_staff_clerk_relation
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
</select>
<delete
id=
"deleteByPrimaryKey"
parameterType=
"java.lang.String"
>
delete
from tab_haoban_staff_clerk_relation
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation"
>
insert into tab_haoban_staff_clerk_relation (staff_clerk_relation_id, staff_id, wx_enterprise_id,
wx_user_id, enterprise_id, store_id,
...
...
@@ -42,46 +37,6 @@
#{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},#{openConcatFlag})
</insert>
<update
id=
"updateByPrimaryKeySelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation"
>
update tab_haoban_staff_clerk_relation
<set>
<if
test=
"staffId != null"
>
staff_id = #{staffId,jdbcType=VARCHAR},
</if>
<if
test=
"wxEnterpriseId != null"
>
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"wxUserId != null"
>
wx_user_id = #{wxUserId,jdbcType=VARCHAR},
</if>
<if
test=
"enterpriseId != null"
>
enterprise_id = #{enterpriseId,jdbcType=VARCHAR},
</if>
<if
test=
"storeId != null"
>
store_id = #{storeId,jdbcType=VARCHAR},
</if>
<if
test=
"clerkId != null"
>
clerk_id = #{clerkId,jdbcType=VARCHAR},
</if>
<if
test=
"clerkCode != null"
>
clerk_code = #{clerkCode,jdbcType=VARCHAR},
</if>
<if
test=
"statusFlag != null"
>
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if
test=
"openConcatFlag != null"
>
open_concat_flag = #{openConcatFlag},
</if>
</set>
where staff_clerk_relation_id = #{staffClerkRelationId,jdbcType=VARCHAR}
</update>
<select
id=
"listBindCode"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -173,7 +128,8 @@
a.clerk_id clerkId,
a.clerk_code clerkCode,
a.status_flag statusFlag,
b.wx_open_user_id wxOpenUserId
b.wx_open_user_id openUserId ,
b.wx_user_id qwUserId
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.status_flag=1
...
...
@@ -241,6 +197,25 @@
where clerk_id = #{clerkId,jdbcType=VARCHAR}
and status_flag=1
</select>
<select
id=
"getByClerkIdForWxUserId"
resultType=
"com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"
parameterType=
"java.lang.String"
>
select
a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
a.store_id storeId,
a.clerk_id clerkId,
a.clerk_code clerkCode,
a.status_flag statusFlag,
b.wx_user_id qwUserId ,
b.wx_open_user_id openUserId
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.clerk_id = #{clerkId,jdbcType=VARCHAR} and a.status_flag=1
</select>
<select
id=
"getByClerkIdNoStatus"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
...
...
@@ -319,11 +294,21 @@
</select>
<select
id=
"listBindByStoreId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_staff_clerk_relation
where wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and store_id=#{storeId}
and status_flag =1
a.staff_clerk_relation_id staffClerkRelationId,
a.staff_id staffId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
a.store_id storeId,
a.clerk_id clerkId,
a.clerk_code clerkCode,
a.status_flag statusFlag,
b.wx_user_id qwUserId ,
b.wx_open_user_id openUserId
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on b.staff_id = a.staff_id
where a.wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR}
and a.store_id=#{storeId}
and a.status_flag =1
</select>
<select
id=
"listBindByStoreIds"
resultMap=
"BaseResultMap"
>
...
...
@@ -376,20 +361,6 @@
group by store_id
</select>
<select
id=
"listAll"
resultType=
"com.gic.haoban.manage.api.dto.StaffClerkRelationDTO"
>
SELECT a.store_id storeId,
a.wx_enterprise_id wxEnterpriseId,
a.enterprise_id enterpriseId,
a.wx_user_id wxUserId,
a.staff_id staffId,
a.clerk_id clerkId,
b.staff_name staffName,
b.wx_open_user_id wxOpenUserId
FROM tab_haoban_staff_clerk_relation a
LEFT JOIN tab_haoban_staff b ON b.staff_id = a.staff_id
WHERE a.status_flag = 1
GROUP BY a.staff_id
</select>
<select
id=
"listRelationsStaffId"
resultType=
"java.lang.String"
>
select staff_id
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
93eee90a
...
...
@@ -385,7 +385,7 @@ public class StaffController extends WebBaseController {
relationDTO
.
setEnterpriseId
(
clerkDTO
.
getEnterpriseId
());
relationDTO
.
setStoreId
(
clerkDTO
.
getStoreId
());
relationDTO
.
setWxEnterpriseId
(
staffDTO
.
getWxEnterpriseId
());
relationDTO
.
setWxUserId
(
staffDTO
.
getWxUserId
());
//
relationDTO.setWxUserId(staffDTO.getWxUserId());
ServiceResponse
response
=
staffClerkRelationApiService
.
bindStaffClerk
(
relationDTO
,
login
.
getClerkId
(),
ChannelCodeEnum
.
ADMIN_BIND
.
getCode
());
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/AuditController.java
View file @
93eee90a
...
...
@@ -274,7 +274,7 @@ public class AuditController extends WebBaseController {
staffClerkRelation
.
setClerkId
(
clerkId
);
staffClerkRelation
.
setStoreId
(
storeId
);
staffClerkRelation
.
setWxEnterpriseId
(
wxEnterpriseId
);
staffClerkRelation
.
setWxUserId
(
wxUserId
);
//
staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelation
.
setStaffId
(
auditStaffId
);
staffClerkRelationApiService
.
delAndInsert
(
staffClerkRelation
,
staffId
,
ChannelCodeEnum
.
AUDIT_BIND
.
getCode
());
audit
.
setAuditStatus
(
1
);
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
93eee90a
...
...
@@ -832,7 +832,7 @@ public class ClerkController extends WebBaseController {
staffClerkRelation
.
setStoreId
(
clerk
.
getStoreId
());
staffClerkRelation
.
setEnterpriseId
(
clerk
.
getEnterpriseId
());
staffClerkRelation
.
setWxEnterpriseId
(
wxEnterpriseId
);
staffClerkRelation
.
setWxUserId
(
wxUserId
);
//
staffClerkRelation.setWxUserId(wxUserId);
staffClerkRelation
.
setStaffId
(
staffId
);
staffClerkRelationApiService
.
delAndInsert
(
staffClerkRelation
,
staffId
,
ChannelCodeEnum
.
SELF_BIND
.
getCode
());
...
...
@@ -1031,7 +1031,7 @@ public class ClerkController extends WebBaseController {
if
(
staffRelation
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
staffApiService
.
wxGetAdd
(
staffRelation
.
getWxUserId
(),
wxEnterpriseId
);
//
staffApiService.wxGetAdd(staffRelation.getWxUserId(), wxEnterpriseId);
String
staffId
=
staffRelation
.
getStaffId
();
StaffDTO
staff
=
staffApiService
.
selectById
(
staffId
);
if
(
staff
==
null
)
{
...
...
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