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
c7415249
Commit
c7415249
authored
Dec 23, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into feature-daiban-12-14
parents
8b12680e
f20ceb5f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
28 changed files
with
549 additions
and
87 deletions
+549
-87
ExternalClerkRelatedApiService.java
...an/manage/api/service/ExternalClerkRelatedApiService.java
+9
-7
WxApplicationApiService.java
...ic/haoban/manage/api/service/WxApplicationApiService.java
+12
-3
ExternalUseridLogMapper.java
...an/manage/service/dao/mapper/ExternalUseridLogMapper.java
+44
-0
TabHaobanExternalClerkRelatedMapper.java
...rvice/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
+2
-2
TabHaobanStaffClerkRelationMapper.java
...service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
+17
-0
TabExternalUseridLog.java
...ic/haoban/manage/service/entity/TabExternalUseridLog.java
+119
-0
WxApplicationService.java
...c/haoban/manage/service/service/WxApplicationService.java
+2
-0
StaffServiceImpl.java
.../haoban/manage/service/service/impl/StaffServiceImpl.java
+1
-1
WxApplicationServiceImpl.java
...manage/service/service/impl/WxApplicationServiceImpl.java
+14
-9
AuditApiServiceImpl.java
.../manage/service/service/out/impl/AuditApiServiceImpl.java
+3
-7
ExternalClerkRelatedApiServiceImpl.java
.../service/out/impl/ExternalClerkRelatedApiServiceImpl.java
+36
-15
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+3
-3
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+22
-5
QywxTagApiServiceImpl.java
...anage/service/service/out/impl/QywxTagApiServiceImpl.java
+14
-3
StaffDepartmentRelatedApiServiceImpl.java
...ervice/out/impl/StaffDepartmentRelatedApiServiceImpl.java
+0
-0
WxApplicationApiServiceImpl.java
...service/service/out/impl/WxApplicationApiServiceImpl.java
+9
-4
BaseSyncOperation.java
...com/gic/haoban/manage/service/task/BaseSyncOperation.java
+11
-4
QywxClerkSyncOperation.java
...ic/haoban/manage/service/task/QywxClerkSyncOperation.java
+33
-5
FriendClerkSyncNewOperation.java
...nage/service/task/friend/FriendClerkSyncNewOperation.java
+3
-2
FriendSyncNewOperation.java
...an/manage/service/task/friend/FriendSyncNewOperation.java
+3
-0
ExternalUseridLogMapper.xml
...ice/src/main/resources/mapper/ExternalUseridLogMapper.xml
+107
-0
TabHaobanExternalClerkRelatedMapper.xml
.../resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
+1
-1
TabHaobanStaffClerkRelationMapper.xml
...in/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
+27
-0
TestController.java
.../com/gic/haoban/manage/web/controller/TestController.java
+25
-1
NotifyController.java
...om/gic/haoban/manage/web/controller/NotifyController.java
+3
-0
WxEnterpriseInfoController.java
...ban/manage/web/controller/WxEnterpriseInfoController.java
+14
-11
MobileWebInterceptor.java
...c/haoban/manage/web/interceptor/MobileWebInterceptor.java
+6
-0
dubbo-haoban-manage-wx.xml
...ge3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
+9
-4
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ExternalClerkRelatedApiService.java
View file @
c7415249
...
...
@@ -151,7 +151,7 @@ public interface ExternalClerkRelatedApiService {
void
delByMemberIdAndEnterpriseId
(
String
memberId
,
String
enterpriseId
,
String
mergeMemberId
);
/**
* 导购和会员是否
是
好友关系,true是好友
* 导购和会员是否好友关系,true是好友
*
* @param memberId 会员id
* @param clerkId 导购id
...
...
@@ -165,13 +165,15 @@ public interface ExternalClerkRelatedApiService {
/**
* 批量查询会员与导购好友关系
*
* @param memberIdList 会员id列表
* @param clerkIdList 导购id列表
* @param enterpriseId 企业id
* @return map:key-会员id value-导购的wxUserId
* @author: YongEn
* @param memberIdList 会员id列表
* @param clerkIdList 导购id列表
* @param enterpriseId 企业id
* @param wxEnterpriseId wx企业标识
* @return {@link Map<String, List<ClerkStaffWxUserDTO>> }
* @author mozhu
* @date 2021-12-23 15:43:03
*/
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
);
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
,
String
wxEnterpriseId
);
/**
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxApplicationApiService.java
View file @
c7415249
...
...
@@ -18,12 +18,21 @@ public interface WxApplicationApiService {
* @param suiteId
*/
void
cancelSuite
(
String
corpId
,
String
suiteId
);
/**
*
* @param wxEnterpriseId
* @param type
* @return
*/
WxApplicationDTO
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
type
);
WxApplicationDTO
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
type
);
/**
* 根据corpid进行查询
*
* @param corpId 公司标识
* @return {@link WxApplicationDTO }
* @author mozhu
* @date 2021-12-22 19:39:32
*/
WxApplicationDTO
selectByCorpid
(
String
corpId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/ExternalUseridLogMapper.java
0 → 100644
View file @
c7415249
package
com
.
gic
.
haoban
.
manage
.
service
.
dao
.
mapper
;
import
com.gic.haoban.manage.service.entity.TabExternalUseridLog
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
/**
* @author mozhu
* @date 2021/12/23 13:49
*/
public
interface
ExternalUseridLogMapper
{
/**
* 插入
*
* @param tabExternalUseridLog 外部用户id日志选项卡
* @return int
* @author mozhu
* @date 2021-12-23 13:55:22
*/
int
insert
(
TabExternalUseridLog
tabExternalUseridLog
);
/**
* 插入批
*
* @param tabExternalUseridLogList 外部用户id日志列表选项卡
* @return int
* @author mozhu
* @date 2021-12-23 14:04:22
*/
int
insertBatch
(
@Param
(
"list"
)
List
<
TabExternalUseridLog
>
tabExternalUseridLogList
);
/**
* 选择wx企业id
*
* @param wxEnterpriseId wx企业标识
* @return {@link List<TabExternalUseridLog> }
* @author mozhu
* @date 2021-12-23 13:55:09
*/
List
<
TabExternalUseridLog
>
selectByWxEnterpriseId
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
View file @
c7415249
...
...
@@ -242,14 +242,14 @@ public interface TabHaobanExternalClerkRelatedMapper {
/**
* 更新外部用户id的老外部用户id
*
* @param
externalUserId
外部用户id
* @param
newExternalUserId
外部用户id
* @param oldExternalUserId 旧的外部用户id
* @param wxEnterpriseId wx企业标识
* @return int
* @author mozhu
* @date 2021-12-13 15:33:41
*/
int
updateExternalUserIdByOldExternalUserId
(
@Param
(
"
externalUserId"
)
String
e
xternalUserId
,
int
updateExternalUserIdByOldExternalUserId
(
@Param
(
"
newExternalUserId"
)
String
newE
xternalUserId
,
@Param
(
"oldExternalUserId"
)
String
oldExternalUserId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStaffClerkRelationMapper.java
View file @
c7415249
...
...
@@ -154,4 +154,20 @@ public interface TabHaobanStaffClerkRelationMapper {
@Param
(
"memberIdList"
)
List
<
String
>
memberIdList
,
@Param
(
"clerkIdList"
)
List
<
String
>
clerkIdList
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 批量查询会员与导购关系并且返回关联信息(新企业)
*
* @param memberIdList 会员id列表
* @param clerkIdList 职员id列表
* @param enterpriseId 企业标识
* @return {@link List<MemberStaffRelExtDO> }
* @author mozhu
* @date 2021-12-23 15:45:48
*/
List
<
MemberStaffRelExtDO
>
listMemberStaffRelNew
(
@Param
(
"memberIdList"
)
List
<
String
>
memberIdList
,
@Param
(
"clerkIdList"
)
List
<
String
>
clerkIdList
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabExternalUseridLog.java
0 → 100644
View file @
c7415249
package
com
.
gic
.
haoban
.
manage
.
service
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* @author mozhu
* @date 2021/12/23 13:48
*/
public
class
TabExternalUseridLog
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7378125418509843606L
;
/**
* id
*/
private
Long
id
;
/**
* 旧外部联系人id
*/
private
String
oldExternalUserId
;
/**
* 新外部联系人id
*/
private
String
newExternalUserId
;
/**
* 微信企业id
*/
private
String
wxEnterpriseId
;
/**
* creator_id
*/
private
String
creatorId
;
/**
* creator_name
*/
private
String
creatorName
;
/**
* create_time
*/
private
Date
createTime
;
/**
* update_time
*/
private
Date
updateTime
;
public
TabExternalUseridLog
()
{
}
public
Long
getId
()
{
return
id
;
}
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
public
String
getOldExternalUserId
()
{
return
oldExternalUserId
;
}
public
void
setOldExternalUserId
(
String
oldExternalUserId
)
{
this
.
oldExternalUserId
=
oldExternalUserId
;
}
public
String
getNewExternalUserId
()
{
return
newExternalUserId
;
}
public
void
setNewExternalUserId
(
String
newExternalUserId
)
{
this
.
newExternalUserId
=
newExternalUserId
;
}
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getCreatorId
()
{
return
creatorId
;
}
public
void
setCreatorId
(
String
creatorId
)
{
this
.
creatorId
=
creatorId
;
}
public
String
getCreatorName
()
{
return
creatorName
;
}
public
void
setCreatorName
(
String
creatorName
)
{
this
.
creatorName
=
creatorName
;
}
public
Date
getCreateTime
()
{
return
createTime
;
}
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
public
Date
getUpdateTime
()
{
return
updateTime
;
}
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxApplicationService.java
View file @
c7415249
...
...
@@ -13,4 +13,6 @@ public interface WxApplicationService {
TabHaobanWxApplication
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
applicationType
);
int
cancalWxApplication
(
String
wxEnterpriseId
,
String
suiteId
);
TabHaobanWxApplication
selectByCorpId
(
String
corpid
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StaffServiceImpl.java
View file @
c7415249
...
...
@@ -74,7 +74,7 @@ public class StaffServiceImpl implements StaffService {
}
String
corpid
=
tabHaobanWxEnterprise
.
getCorpid
();
log
.
info
(
"corpid:{}"
,
corpid
);
if
(
corpid
.
length
()
>
20
)
{
if
(
corpid
.
length
()
>
20
&&
userId
.
length
()
==
32
)
{
return
mapper
.
selectByOpenUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
);
}
else
{
return
mapper
.
selectByUserIdAndEnterpriseId
(
userId
,
wxEnterpriseId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxApplicationServiceImpl.java
View file @
c7415249
...
...
@@ -39,15 +39,20 @@ public class WxApplicationServiceImpl implements WxApplicationService {
}
@Override
public
TabHaobanWxApplication
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
applicationType
)
{
return
mapper
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
applicationType
);
}
@Override
public
int
cancalWxApplication
(
String
wxEnterpriseId
,
String
suiteId
)
{
return
this
.
mapper
.
cancelWxApplication
(
wxEnterpriseId
,
suiteId
);
}
@Override
public
TabHaobanWxApplication
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
applicationType
)
{
return
mapper
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
applicationType
);
}
@Override
public
int
cancalWxApplication
(
String
wxEnterpriseId
,
String
suiteId
)
{
return
this
.
mapper
.
cancelWxApplication
(
wxEnterpriseId
,
suiteId
);
}
@Override
public
TabHaobanWxApplication
selectByCorpId
(
String
corpid
)
{
return
mapper
.
selectByCorpId
(
corpid
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/AuditApiServiceImpl.java
View file @
c7415249
...
...
@@ -62,7 +62,7 @@ import com.github.pagehelper.PageHelper;
*/
@Service
public
class
AuditApiServiceImpl
implements
AuditApiService
{
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
AuditApiServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AuditApiServiceImpl
.
class
);
@Autowired
private
TabHaobanAuditMapper
auditMapper
;
...
...
@@ -390,7 +390,7 @@ public class AuditApiServiceImpl implements AuditApiService{
String
areaId
=
obj
.
getAreaId
();
String
storeAddress
=
obj
.
getStoreAddress
();
logger
.
info
(
"==========================>areaId={},storeAddress={},newValue={}"
,
areaId
,
storeAddress
,
newValue
);
String
arr
[]
=
storeAddress
.
split
(
" "
);
String
[]
arr
=
storeAddress
.
split
(
" "
);
store
.
setAreaId
(
areaId
);
store
.
setFullArea
(
arr
[
0
]);
//避免多个空格造成数据混乱
...
...
@@ -551,11 +551,7 @@ public class AuditApiServiceImpl implements AuditApiService{
public
boolean
judgeHavePhoneNumberOrCode
(
String
enterpriseId
,
String
clerkCode
,
String
phoneNumber
)
{
List
<
TabHaobanAudit
>
list
=
auditMapper
.
judgeHavePhoneNumberOrCode
(
enterpriseId
,
clerkCode
,
phoneNumber
);
if
(
CollectionUtil
.
isEmpty
(
list
)){
return
false
;
}
else
{
return
true
;
}
return
!
CollectionUtil
.
isEmpty
(
list
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ExternalClerkRelatedApiServiceImpl.java
View file @
c7415249
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.UniqueIdUtils
;
import
com.gic.haoban.app.customer.enums.GicQywxSyncTypeEnum
;
import
com.gic.haoban.app.customer.enums.QywxSyncTaskTypeEnum
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
...
...
@@ -15,14 +15,8 @@ import com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO;
import
com.gic.haoban.manage.api.dto.ExternalClerkRelatedShortInfoDTO
;
import
com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService
;
import
com.gic.haoban.manage.service.config.Config
;
import
com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanStaffClerkRelationMapper
;
import
com.gic.haoban.manage.service.dao.mapper.WxEnterpriseMapper
;
import
com.gic.haoban.manage.service.entity.MemberUnionidRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanStaffClerkRelation
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxEnterprise
;
import
com.gic.haoban.manage.service.dao.mapper.*
;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO
;
import
com.gic.haoban.manage.service.pojo.QywxTagSyncInfoPojo
;
import
com.gic.mq.sdk.GicMQClient
;
...
...
@@ -40,6 +34,7 @@ import org.redisson.api.RateIntervalUnit;
import
org.redisson.api.RateType
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
import
java.util.stream.Collectors
;
...
...
@@ -61,6 +56,8 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
Config
config
;
@Autowired
private
ExternalUseridLogMapper
externalUseridLogMapper
;
/**
* 查询导购好友关联
...
...
@@ -111,9 +108,8 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
}
@Override
public
List
<
ExternalClerkRelatedDTO
>
listByWxEnterpriseIdAndWxUserIds
(
List
<
String
>
userIdList
,
String
wxEnterpriseId
)
{
if
(
userIdList
==
null
||
userIdList
.
isEmpty
())
{
public
List
<
ExternalClerkRelatedDTO
>
listByWxEnterpriseIdAndWxUserIds
(
List
<
String
>
userIdList
,
String
wxEnterpriseId
)
{
if
(
CollectionUtils
.
isEmpty
(
userIdList
))
{
return
Collections
.
EMPTY_LIST
;
}
return
EntityUtil
.
changeEntityListByJSON
(
ExternalClerkRelatedDTO
.
class
,
tabHaobanExternalClerkRelatedMapper
.
listByWxEnterpriseIdAndWxUserIds
(
userIdList
,
wxEnterpriseId
));
...
...
@@ -275,12 +271,23 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
}
@Override
public
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
)
{
public
Map
<
String
,
List
<
ClerkStaffWxUserDTO
>>
listMemberStaffRel
(
List
<
String
>
memberIdList
,
List
<
String
>
clerkIdList
,
String
enterpriseId
,
String
wxEnterpriseId
)
{
if
(
CollectionUtils
.
isEmpty
(
memberIdList
)
||
CollectionUtils
.
isEmpty
(
clerkIdList
))
{
// 2个列表都为空查不了关系
return
Collections
.
emptyMap
();
}
List
<
MemberStaffRelExtDO
>
res
=
staffClerkRelationMapper
.
listMemberStaffRel
(
memberIdList
,
clerkIdList
,
enterpriseId
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterriseMapper
.
selectByPrimaryKey
(
wxEnterpriseId
);
if
(
tabHaobanWxEnterprise
==
null
)
{
return
Collections
.
emptyMap
();
}
//新老企业兼容
String
corpid
=
tabHaobanWxEnterprise
.
getCorpid
();
List
<
MemberStaffRelExtDO
>
res
=
new
ArrayList
<>();
if
(
corpid
.
length
()
>
20
)
{
res
=
staffClerkRelationMapper
.
listMemberStaffRelNew
(
memberIdList
,
clerkIdList
,
enterpriseId
);
}
else
{
res
=
staffClerkRelationMapper
.
listMemberStaffRel
(
memberIdList
,
clerkIdList
,
enterpriseId
);
}
if
(
CollectionUtils
.
isEmpty
(
res
))
{
return
Collections
.
emptyMap
();
}
...
...
@@ -297,6 +304,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
updateNewExternalUserid
()
{
log
.
info
(
"全量更新企业外部联系人id start"
);
try
{
...
...
@@ -317,6 +325,7 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
boolean
updateNewExternalUserid
(
String
wxEnterpriseId
)
{
log
.
info
(
"企业外部联系人id start,wxEnterpriseId:{}"
,
wxEnterpriseId
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
wxEnterriseMapper
.
selectByPrimaryKey
(
wxEnterpriseId
);
...
...
@@ -368,9 +377,21 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
log
.
info
(
"更新新的外部联系人id,查询企业微信接口报错"
);
break
;
}
List
<
TabExternalUseridLog
>
tabExternalUseridLogList
=
new
ArrayList
<>();
for
(
QywxNewExternalUseridDTO
qywxNewExternalUseridDTO
:
newExternalUseridList
)
{
tabHaobanExternalClerkRelatedMapper
.
updateExternalUserIdByOldExternalUserId
(
qywxNewExternalUseridDTO
.
getNewExternalUserid
(),
qywxNewExternalUseridDTO
.
getExternalUserid
(),
wxEnterpriseId
);
String
new_external_userid
=
qywxNewExternalUseridDTO
.
getNew_external_userid
();
String
external_userid
=
qywxNewExternalUseridDTO
.
getExternal_userid
();
tabHaobanExternalClerkRelatedMapper
.
updateExternalUserIdByOldExternalUserId
(
new_external_userid
,
external_userid
,
wxEnterpriseId
);
TabExternalUseridLog
tabExternalUseridLog
=
new
TabExternalUseridLog
();
tabExternalUseridLog
.
setId
(
UniqueIdUtils
.
uniqueLong
());
tabExternalUseridLog
.
setOldExternalUserId
(
external_userid
);
tabExternalUseridLog
.
setNewExternalUserId
(
new_external_userid
);
tabExternalUseridLog
.
setWxEnterpriseId
(
wxEnterpriseId
);
tabExternalUseridLog
.
setCreatorId
(
"admin"
);
tabExternalUseridLog
.
setCreatorName
(
"系统管理员"
);
tabExternalUseridLogList
.
add
(
tabExternalUseridLog
);
}
externalUseridLogMapper
.
insertBatch
(
tabExternalUseridLogList
);
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
c7415249
...
...
@@ -85,10 +85,8 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
private
WxEnterpriseRelatedService
wxEnterpriseRelatedService
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
private
MemberOpenCardBusinessService
memberOpenCardBusinessService
;
@Autowired
private
ClerkService
clerkService
;
@Autowired
...
...
@@ -181,7 +179,6 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
params
.
setEnterpriseId
(
tab
.
getEnterpriseId
());
params
.
setStoreManagerFlag
(
isManager
(
tab
.
getClerkId
()));
MemberInfoListParamsDTO
memberInfoListParamsDTO
=
new
MemberInfoListParamsDTO
();
memberInfoListParamsDTO
.
setMemberId
(
tab
.
getMemberId
());
...
...
@@ -381,6 +378,9 @@ public class MemberUnionidRelatedApiServiceImpl implements MemberUnionidRelatedA
return
;
}
String
staffId
=
staff
.
getStaffId
();
String
staffWxUserId
=
staff
.
getWxUserId
();
log
.
info
(
"新增外部联系人,staff.getWxUserId():{}"
,
staffWxUserId
);
dto
.
setWxUserId
(
staffWxUserId
);
TabHaobanClerkMainStoreRelated
mainStoreRelated
=
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
);
if
(
mainStoreRelated
==
null
)
{
log
.
info
(
"【新增外部联系人】主门店为空:{}"
,
staffId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
c7415249
...
...
@@ -430,7 +430,14 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"企业为空"
);
return
false
;
}
String
userId
=
relation
.
getWxUserId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
relation
.
getStaffId
());
String
corpid
=
wxEnterprise
.
getCorpid
();
String
wxUserId
=
""
;
if
(
corpid
.
length
()
>
20
)
{
wxUserId
=
staffDTO
.
getWxOpenUseId
();
}
else
{
wxUserId
=
staffDTO
.
getWxUserId
();
}
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"事件"
,
"人脸匹配"
);
...
...
@@ -438,13 +445,13 @@ public class MessageApiServiceImpl implements MessageApiService {
map
.
put
(
"到店时间"
,
arrivalTime
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
u
serId
);
list
.
add
(
wxU
serId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
messageDTO
.
setTitle
(
"我的顾客通知"
);
messageDTO
.
setItems
(
items
);
return
qywxSuiteApiService
.
sendMessage
(
wxEnterprise
.
getCorpid
()
,
config
.
getWxSuiteid
(),
messageDTO
);
return
qywxSuiteApiService
.
sendMessage
(
corpid
,
config
.
getWxSuiteid
(),
messageDTO
);
}
private
List
<
ItemDTO
>
getItemsList
(
Map
<
String
,
String
>
map
)
{
...
...
@@ -477,7 +484,17 @@ public class MessageApiServiceImpl implements MessageApiService {
log
.
info
(
"企业为空"
);
return
false
;
}
String
userId
=
relation
.
getWxUserId
();
StaffDTO
staffDTO
=
staffApiService
.
selectById
(
relation
.
getStaffId
());
if
(
staffDTO
==
null
)
{
return
false
;
}
String
corpId
=
wxEnterprise
.
getCorpid
();
String
wxUserId
=
""
;
if
(
corpId
.
length
()
>
20
)
{
wxUserId
=
staffDTO
.
getWxOpenUseId
();
}
else
{
wxUserId
=
staffDTO
.
getWxUserId
();
}
QywxXcxSendMessageDTO
messageDTO
=
new
QywxXcxSendMessageDTO
();
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"事件"
,
"会员完善标签"
);
...
...
@@ -486,7 +503,7 @@ public class MessageApiServiceImpl implements MessageApiService {
map
.
put
(
"消费时间"
,
customerTime
);
List
<
ItemDTO
>
items
=
getItemsList
(
map
);
ArrayList
<
String
>
list
=
new
ArrayList
<>();
list
.
add
(
u
serId
);
list
.
add
(
wxU
serId
);
messageDTO
.
setAppid
(
config
.
getAppid
());
messageDTO
.
setUserIds
(
list
);
messageDTO
.
setPage
(
pageUrl
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/QywxTagApiServiceImpl.java
View file @
c7415249
...
...
@@ -19,6 +19,7 @@ import com.gic.haoban.manage.service.entity.*;
import
com.gic.haoban.manage.service.pojo.QywxSyncTagFormatPojo
;
import
com.gic.haoban.manage.service.service.ExternalClerkRelatedService
;
import
com.gic.haoban.manage.service.service.QywxTagService
;
import
com.gic.haoban.manage.service.service.StaffService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.member.api.dto.MemberTagDTO
;
import
com.gic.member.api.service.MemberTagService
;
...
...
@@ -80,6 +81,8 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
@Autowired
private
MemberTagItemApiService
memberTagItemApiService
;
@Autowired
private
StaffService
staffService
;
@Override
public
void
pullQywxTag
(
String
wxEnterpriseId
)
{
...
...
@@ -520,7 +523,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
resp
.
setMessage
(
"getExternalUseridInfo接口次数限制"
);
return
resp
;
}
Map
<
String
,
Set
<
String
>>
externalTagMap
=
getExternalTagMap
(
externalUseridInfo
);
Map
<
String
,
Set
<
String
>>
externalTagMap
=
getExternalTagMap
(
externalUseridInfo
,
wxEnterpriseId
);
if
(
null
==
externalTagMap
)
{
logger
.
info
(
"没有好友需要同步"
);
resp
.
setCode
(
5
);
...
...
@@ -629,7 +632,7 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
resp
.
setMessage
(
"限制次数"
);
return
resp
;
}
Map
<
String
,
Set
<
String
>>
externalTagMap
=
getExternalTagMap
(
externalUseridInfo
);
Map
<
String
,
Set
<
String
>>
externalTagMap
=
getExternalTagMap
(
externalUseridInfo
,
wxEnterpriseId
);
//当前操作用户企业打的标签
Set
<
String
>
staffChangeTagKeys
=
externalTagMap
.
get
(
wxUserId
);
...
...
@@ -719,7 +722,8 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
* @param externalUseridInfo
* @return
*/
private
Map
<
String
,
Set
<
String
>>
getExternalTagMap
(
String
externalUseridInfo
)
{
private
Map
<
String
,
Set
<
String
>>
getExternalTagMap
(
String
externalUseridInfo
,
String
wxEnterpriseId
)
{
logger
.
info
(
"externalUseridInfo:{}"
,
externalUseridInfo
);
Map
<
String
,
Set
<
String
>>
ret
=
new
HashMap
<>();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
externalUseridInfo
);
...
...
@@ -732,6 +736,13 @@ public class QywxTagApiServiceImpl implements QywxTagApiService {
for
(
int
i
=
0
;
i
<
followUser
.
size
();
i
++)
{
JSONObject
midUser
=
followUser
.
getJSONObject
(
i
);
String
wxUserId
=
midUser
.
getString
(
"userid"
);
//做兼容
TabHaobanStaff
staff
=
staffService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
if
(
staff
!=
null
)
{
logger
.
info
(
"旧wxUserId:{}"
,
wxUserId
);
wxUserId
=
staff
.
getWxUserId
();
logger
.
info
(
"新wxUserId:{}"
,
wxUserId
);
}
Set
<
String
>
midTagIds
=
new
HashSet
<>();
if
(!
midUser
.
containsKey
(
"tags"
))
{
ret
.
put
(
wxUserId
,
midTagIds
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffDepartmentRelatedApiServiceImpl.java
View file @
c7415249
This diff is collapsed.
Click to expand it.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxApplicationApiServiceImpl.java
View file @
c7415249
...
...
@@ -47,8 +47,13 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
log
.
info
(
"企业未绑定过,{}"
,
corpId
);
}
@Override
public
WxApplicationDTO
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
type
)
{
return
EntityUtil
.
changeEntityByJSON
(
WxApplicationDTO
.
class
,
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
type
));
}
@Override
public
WxApplicationDTO
selectByWxEnterpriseIdAndApplicationType
(
String
wxEnterpriseId
,
int
type
)
{
return
EntityUtil
.
changeEntityByJSON
(
WxApplicationDTO
.
class
,
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
wxEnterpriseId
,
type
));
}
@Override
public
WxApplicationDTO
selectByCorpid
(
String
corpId
)
{
return
EntityUtil
.
changeEntityByJSON
(
WxApplicationDTO
.
class
,
wxApplicationService
.
selectByCorpId
(
corpId
));
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/BaseSyncOperation.java
View file @
c7415249
...
...
@@ -14,7 +14,7 @@ public interface BaseSyncOperation {
*
* @param dealParamMqDTO
*/
public
abstract
void
dealSingleByMq
(
DealParamMqDTO
dealParamMqDTO
,
TabHaobanPreDealLog
dataPre
);
void
dealSingleByMq
(
DealParamMqDTO
dealParamMqDTO
,
TabHaobanPreDealLog
dataPre
);
/**
* 单条处理异常
...
...
@@ -24,7 +24,7 @@ public interface BaseSyncOperation {
* @param enterpriseId
* @param reason
*/
public
abstract
void
dealException
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
reason
);
void
dealException
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
reason
);
/**
* 单条处理成功
...
...
@@ -33,8 +33,15 @@ public interface BaseSyncOperation {
* @param dataId
* @param wxEnterpriseId
*/
public
abstract
void
dealSuccess
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
wxEnterpriseId
);
void
dealSuccess
(
String
taskId
,
String
dataId
,
String
enterpriseId
,
String
wxEnterpriseId
);
public
void
checkDepartmentTask
(
String
taskId
);
/**
* 检查是否成功
*
* @param taskId 任务id
* @author mozhu
* @date 2021-12-22 11:28:47
*/
void
checkDepartmentTask
(
String
taskId
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/QywxClerkSyncOperation.java
View file @
c7415249
...
...
@@ -3,22 +3,34 @@ package com.gic.haoban.manage.service.task;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.DealParamMqDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.enums.PreDealStatusEnum
;
import
com.gic.haoban.manage.api.enums.PreDealTypeEnum
;
import
com.gic.haoban.manage.api.enums.SyncTaskStatusEnum
;
import
com.gic.haoban.manage.api.service.DealSyncOperationApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.service.dao.mapper.WxApplicationMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanPreDealLog
;
import
com.gic.haoban.manage.service.entity.TabHaobanSyncTask
;
import
com.gic.haoban.manage.service.entity.TabHaobanWxApplication
;
import
com.gic.haoban.manage.service.service.PreDealService
;
import
com.gic.haoban.manage.service.service.SyncTaskService
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.QywxNewUseridDTO
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 通讯录同步
* Created 2020/4/13.
*
* @author hua
...
...
@@ -29,15 +41,18 @@ public class QywxClerkSyncOperation implements BaseSyncOperation {
@Autowired
private
PreDealService
preDealService
;
@Autowired
private
SyncTaskService
syncTaskService
;
@Autowired
private
StaffApiService
staffApiService
;
@Autowired
private
DealSyncOperationApiService
dealSyncOperationApiService
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
@Autowired
private
WxApplicationMapper
wxApplicationMapper
;
@Override
public
void
dealSingleByMq
(
DealParamMqDTO
dealParamMqDTO
,
TabHaobanPreDealLog
dataPre
)
{
...
...
@@ -63,8 +78,6 @@ public class QywxClerkSyncOperation implements BaseSyncOperation {
dealSuccess
(
dealParamMqDTO
.
getTaskId
(),
dealParamMqDTO
.
getData
(),
dataPre
.
getEnterpriseId
(),
dataPre
.
getWxEnterpriseId
());
}
}
}
@Override
...
...
@@ -111,6 +124,21 @@ public class QywxClerkSyncOperation implements BaseSyncOperation {
syncTaskService
.
updateTaskStatus
(
taskId
,
SyncTaskStatusEnum
.
compute
.
getVal
());
dealSyncOperationApiService
.
unlockTask
(
wxEnterpriseId
);
dealSyncOperationApiService
.
cleanDiffrence
(
wxEnterpriseId
,
taskId
);
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
String
corpid
=
wxEnterpriseDTO
.
getCorpid
();
TabHaobanWxApplication
tabHaobanWxApplication
=
wxApplicationMapper
.
selectByCorpId
(
corpid
);
logger
.
info
(
"同步通讯录完成,批量处理wx_user_id,corpid:{}"
,
corpid
);
if
(
corpid
.
length
()
>
20
)
{
//批量处理wx_user_id to wx_open_user_id
List
<
StaffDTO
>
staffDTOS
=
staffApiService
.
listUserIdByWxEnterpriseId
(
wxEnterpriseId
);
logger
.
info
(
"useridToOpenuserid请求:corpid:{}"
,
corpid
);
List
<
QywxNewUseridDTO
>
qywxNewUseridDTOS
=
qywxUserApiService
.
useridToOpenuserid
(
corpid
,
tabHaobanWxApplication
.
getSiteId
(),
staffDTOS
.
stream
().
map
(
StaffDTO:
:
getWxUserId
).
collect
(
Collectors
.
toList
()));
if
(
CollectionUtils
.
isNotEmpty
(
qywxNewUseridDTOS
))
{
for
(
QywxNewUseridDTO
qywxNewUseridDTO
:
qywxNewUseridDTOS
)
{
staffApiService
.
updateOpenUserIdsByUserId
(
wxEnterpriseId
,
qywxNewUseridDTO
.
getUserid
(),
qywxNewUseridDTO
.
getOpen_userid
());
}
}
}
}
}
RedisUtil
.
unlock
(
key
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/friend/FriendClerkSyncNewOperation.java
View file @
c7415249
...
...
@@ -27,6 +27,9 @@ import java.util.Set;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
/**
* 微信好友
*/
@Service
public
class
FriendClerkSyncNewOperation
implements
BaseSyncOperation
{
...
...
@@ -160,7 +163,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
logger
.
info
(
"{}:处理的数据:{}"
,
dataId
,
JSONObject
.
toJSONString
(
dataIds
));
dealDepartmentToMq
(
taskId
,
new
HashSet
<>(
dataIds
),
SyncTaskStatusEnum
.
self_friend_sync
);
checkDepartmentTask
(
taskId
);
}
@Override
...
...
@@ -187,7 +189,6 @@ public class FriendClerkSyncNewOperation implements BaseSyncOperation {
String
staffLockKey
=
FRIEND_LOCK
+
syncTask
.
getAddUser
();
RedisUtil
.
delCache
(
staffLockKey
);
RedisUtil
.
unlock
(
key
);
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/friend/FriendSyncNewOperation.java
View file @
c7415249
...
...
@@ -38,6 +38,9 @@ import java.util.Set;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
/**
* 导购和客户好友关系
*/
@Service
public
class
FriendSyncNewOperation
implements
BaseSyncOperation
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
FriendSyncNewOperation
.
class
);
...
...
haoban-manage3-service/src/main/resources/mapper/ExternalUseridLogMapper.xml
0 → 100644
View file @
c7415249
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.gic.haoban.manage.service.dao.mapper.ExternalUseridLogMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.gic.haoban.manage.service.entity.TabExternalUseridLog"
>
<result
column=
"id"
property=
"id"
/>
<result
column=
"old_external_user_id"
property=
"oldExternalUserId"
/>
<result
column=
"new_external_user_id"
property=
"newExternalUserId"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
/>
<result
column=
"creator_id"
property=
"creatorId"
/>
<result
column=
"creator_name"
property=
"creatorName"
/>
<result
column=
"create_time"
property=
"createTime"
/>
<result
column=
"update_time"
property=
"updateTime"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
id,
old_external_user_id,
new_external_user_id,
wx_enterprise_id,
creator_id,
creator_name,
create_time,
update_time
</sql>
<insert
id=
"insert"
useGeneratedKeys=
"true"
keyColumn=
"id"
keyProperty=
"id"
parameterType=
"com.gic.haoban.manage.service.entity.TabExternalUseridLog"
>
INSERT INTO tab_external_userid_log
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"null != id"
>
id,
</if>
<if
test=
"null != oldExternalUserId and '' != oldExternalUserId"
>
old_external_user_id,
</if>
<if
test=
"null != newExternalUserId and '' != newExternalUserId"
>
new_external_user_id,
</if>
<if
test=
"null != wxEnterpriseId and '' != wxEnterpriseId"
>
wx_enterprise_id,
</if>
<if
test=
"null != creatorId and '' != creatorId"
>
creator_id,
</if>
<if
test=
"null != creatorName and '' != creatorName"
>
creator_name,
</if>
<if
test=
"null != createTime"
>
create_time,
</if>
<if
test=
"null != updateTime"
>
update_time
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"null != id"
>
#{id},
</if>
<if
test=
"null != oldExternalUserId and '' != oldExternalUserId"
>
#{oldExternalUserId},
</if>
<if
test=
"null != newExternalUserId and '' != newExternalUserId"
>
#{newExternalUserId},
</if>
<if
test=
"null != wxEnterpriseId and '' != wxEnterpriseId"
>
#{wxEnterpriseId},
</if>
<if
test=
"null != creatorId and '' != creatorId"
>
#{creatorId},
</if>
<if
test=
"null != creatorName and '' != creatorName"
>
#{creatorName},
</if>
<if
test=
"null != createTime"
>
#{createTime},
</if>
<if
test=
"null != updateTime"
>
#{updateTime}
</if>
</trim>
</insert>
<insert
id=
"insertBatch"
>
insert into tab_external_userid_log (id,
old_external_user_id,
new_external_user_id,
wx_enterprise_id,
creator_id,
creator_name,
create_time,
update_time)
values
<foreach
collection=
"list"
separator=
","
item=
"item"
>
(#{item.id}, #{item.oldExternalUserId},#{item.newExternalUserId}, #{item.wxEnterpriseId}, #{item.creatorId},
#{item.creatorName},now(),now())
</foreach>
</insert>
<select
id=
"selectByWxEnterpriseId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_external_userid_log
where wx_enterprise_id = #{wxEnterpriseId}
</select>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
View file @
c7415249
...
...
@@ -585,7 +585,7 @@
<update
id=
"updateExternalUserIdByOldExternalUserId"
>
UPDATE
tab_haoban_external_clerk_related
SET external_user_id = #{
e
xternalUserId},
SET external_user_id = #{
newE
xternalUserId},
update_time = now()
where external_user_id = #{oldExternalUserId}
and wx_enterprise_id = #{wxEnterpriseId}
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStaffClerkRelationMapper.xml
View file @
c7415249
...
...
@@ -400,4 +400,30 @@
</foreach>
;
</select>
<select
id=
"listMemberStaffRelNew"
resultType=
"com.gic.haoban.manage.service.entity.ext.MemberStaffRelExtDO"
>
select ecr.member_id as memberId,
scr.wx_open_user_id as staffWxUserId,
scr.clerk_id as staffClerkId
from (select a.staff_id,
b.wx_open_user_id,
a.wx_user_id,
a.clerk_id
from tab_haoban_staff_clerk_relation a
left join tab_haoban_staff b on a.staff_id = b.staff_id
where a.clerk_id in
<foreach
collection=
"clerkIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
and a.status_flag = 1
group by a.staff_id, a.wx_user_id, a.clerk_id) as scr
left join tab_haoban_external_clerk_related as ecr on scr.staff_id = ecr.staff_id
where ecr.status_flag = 1
and ecr.enterprise_id = #{enterpriseId,jdbcType=VARCHAR}
and ecr.member_id in
<foreach
collection=
"memberIdList"
item=
"item"
separator=
","
open=
"("
close=
")"
>
#{item}
</foreach>
;
</select>
</mapper>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
View file @
c7415249
...
...
@@ -227,6 +227,23 @@ public class TestController extends WebBaseController {
}
/**
* 设置迁移完成
*
* @param corpid
* @param serviceCorpid
* @return
*/
@RequestMapping
(
"/finishExternalUseridMigration"
)
public
HaobanResponse
finishExternalUseridMigration
(
String
corpid
,
String
serviceCorpid
)
{
boolean
flag
=
qywxUserApiService
.
finishExternalUseridMigration
(
corpid
,
serviceCorpid
);
if
(
flag
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
else
{
return
resultResponse
(
HaoBanErrCode
.
ERR_0
);
}
}
/**
* 测试授权回调
*
* @param param
...
...
@@ -239,7 +256,14 @@ public class TestController extends WebBaseController {
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
/**
* 后台预留批量处理wx_user_id to wx_open_user_id
*
* @param corpid
* @param suiteId
* @param wxEnterpriseId
* @return
*/
@RequestMapping
(
"/useridToOpenuserid"
)
public
HaobanResponse
useridToOpenuserid
(
String
corpid
,
String
suiteId
,
String
wxEnterpriseId
)
{
//批量处理wx_user_id to wx_open_user_id
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/NotifyController.java
View file @
c7415249
...
...
@@ -131,6 +131,9 @@ public class NotifyController extends WebBaseController {
*/
@RequestMapping
(
"/message/read"
)
public
HaobanResponse
readSingle
(
Long
noticeMessageId
)
{
if
(
noticeMessageId
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
noticeMessageService
.
updateReadFlagById
(
noticeMessageId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseInfoController.java
View file @
c7415249
...
...
@@ -88,6 +88,8 @@ public class WxEnterpriseInfoController extends WebBaseController {
private
EnterpriseService
enterpriseService
;
@Autowired
private
Config
config
;
@Autowired
private
WxApplicationApiService
wxApplicationApiService
;
/**
...
...
@@ -256,26 +258,30 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
enterpriseDetailDTO
=
wxEnterpriseDTOS
.
get
(
0
);
}
WxEnterpriseDTO
enterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
enterpriseDetailDTO
.
getWxEnterpriseId
());
if
(
enterpriseDTO
==
null
)
{
logger
.
info
(
"
改
企业不存在:{}"
,
qo
.
getGicEnterpriseId
());
logger
.
info
(
"
该
企业不存在:{}"
,
qo
.
getGicEnterpriseId
());
return
resultResponse
(
HaoBanErrCode
.
ERR_400002
);
}
MemberLoginQo
user
=
new
MemberLoginQo
();
if
(
StringUtils
.
isBlank
(
qo
.
getUserId
()))
{
user
=
getUserByCode
(
enterpriseDTO
,
qo
.
getCode
(),
qo
.
getGicEnterpriseId
());
if
(
user
!=
null
&&
(!
user
.
getCorpId
().
equals
(
enterpriseDTO
.
getCorpid
())))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_500003
,
user
.
getCorpId
());
}
if
(
user
==
null
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_6
);
}
if
(!
user
.
getCorpId
().
equals
(
enterpriseDTO
.
getCorpid
()))
{
WxApplicationDTO
wxApplicationDTO
=
wxApplicationApiService
.
selectByCorpid
(
user
.
getCorpId
());
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseApiService
.
getOne
(
wxApplicationDTO
.
getWxEnterpriseId
());
if
(
wxEnterpriseDTO
==
null
)
{
logger
.
info
(
"该企业不存在:{}"
,
qo
.
getGicEnterpriseId
());
return
resultResponse
(
HaoBanErrCode
.
ERR_400002
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_500003
,
wxEnterpriseDTO
.
getCorpid
());
}
}
else
{
user
.
setUserId
(
qo
.
getUserId
());
}
StaffDTO
staffDTO
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
user
.
getUserId
(),
enterpriseDTO
.
getWxEnterpriseId
());
if
(
staffDTO
==
null
)
{
logger
.
info
(
"成员不存在"
);
...
...
@@ -298,7 +304,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
user
.
setNationCode
(
staffDTO
.
getNationCode
());
user
.
setWxUserId
(
staffDTO
.
getWxUserId
());
List
<
StaffClerkInfoDTO
>
result
=
staffClerkRelationApiService
.
listBindDetailByStaffId
(
staffDTO
.
getStaffId
());
List
<
StoreMemberVO
>
retList
=
new
ArrayList
<>();
...
...
@@ -321,7 +326,6 @@ public class WxEnterpriseInfoController extends WebBaseController {
VO
.
setClerkType
(
clerkDTO
.
getClerkType
());
VO
.
setStaffId
(
staffDTO
.
getStaffId
());
VO
.
setClerkId
(
clerkDTO
.
getClerkId
());
retList
.
add
(
VO
);
}
...
...
@@ -339,8 +343,7 @@ public class WxEnterpriseInfoController extends WebBaseController {
}
String
userDTOJson
=
qywxUserApiService
.
getUserByCode
(
enterpriseDTO
.
getCorpid
(),
secretSetting
.
getSecretVal
(),
code
);
logger
.
info
(
"会员微信登录信息=============>{}"
,
userDTOJson
);
MemberLoginQo
user
=
JSON
.
parseObject
(
userDTOJson
,
MemberLoginQo
.
class
);
return
user
;
return
JSON
.
parseObject
(
userDTOJson
,
MemberLoginQo
.
class
);
}
/**
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/interceptor/MobileWebInterceptor.java
View file @
c7415249
...
...
@@ -17,6 +17,7 @@ import javax.servlet.http.HttpServletRequest;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
import
java.io.PrintWriter
;
import
java.util.Map
;
/**
* Created 2018/7/20.
...
...
@@ -48,6 +49,11 @@ public class MobileWebInterceptor extends HandlerInterceptorAdapter {
public
boolean
preHandle
(
HttpServletRequest
httpServletRequest
,
HttpServletResponse
httpServletResponse
,
Object
o
)
throws
Exception
{
String
requestURI
=
httpServletRequest
.
getRequestURI
();
logger
.
info
(
"post-url:{}"
,
requestURI
);
Map
<
String
,
String
[]>
parameterMap
=
httpServletRequest
.
getParameterMap
();
logger
.
info
(
"post-params:{}"
,
JSONObject
.
toJSONString
(
parameterMap
));
if
(
true
)
{
return
true
;
}
HandlerMethod
handler
=
(
HandlerMethod
)
o
;
IgnoreLogin
ignoreLogin
=
handler
.
getMethodAnnotation
(
IgnoreLogin
.
class
);
if
(
null
!=
ignoreLogin
)
{
...
...
haoban-manage3-wx/src/main/webapp/WEB-INF/dubbo-haoban-manage-wx.xml
View file @
c7415249
...
...
@@ -64,14 +64,16 @@
id=
"memberOpenCardBusinessService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.StaffClerkRelationApiService"
id=
"staffClerkRelationApiService"
/>
<dubbo:reference
interface=
"com.gic.clerk.api.service.ClerkNewService"
id=
"clerkNewService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.DealSyncOperationApiService"
id=
"dealSyncOperationApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.DealSyncOperationApiService"
id=
"dealSyncOperationApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService"
id=
"externalClerkRelatedApiService"
/>
<dubbo:reference
id=
"operationSettingApiServiceImpl"
interface=
"com.gic.haoban.manage.api.service.OperationSettingApiService"
timeout=
"10000"
<dubbo:reference
id=
"operationSettingApiServiceImpl"
interface=
"com.gic.haoban.manage.api.service.OperationSettingApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
id=
"pendingTaskApiService"
...
...
@@ -82,4 +84,7 @@
interface=
"com.gic.haoban.manage.api.service.notify.NoticeMessageApiService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxApplicationApiService"
id=
"wxApplicationApiService"
/>
</beans>
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