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
adf7e102
Commit
adf7e102
authored
Jun 02, 2021
by
fudahua
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' into 'master'
Developer See merge request
!104
parents
e0b33f52
b12b189a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
55 changed files
with
925 additions
and
72 deletions
+925
-72
CheckFriendSettingDTO.java
.../com/gic/haoban/manage/api/dto/CheckFriendSettingDTO.java
+29
-0
ClerkMainStoreRelatedDTO.java
...m/gic/haoban/manage/api/dto/ClerkMainStoreRelatedDTO.java
+10
-0
EnterpriseDetailDTO.java
...va/com/gic/haoban/manage/api/dto/EnterpriseDetailDTO.java
+12
-0
ExternalUserDTO.java
...n/java/com/gic/haoban/manage/api/dto/ExternalUserDTO.java
+13
-0
MaterialDTO.java
.../main/java/com/gic/haoban/manage/api/dto/MaterialDTO.java
+18
-0
StaffClerkInfoDTO.java
...java/com/gic/haoban/manage/api/dto/StaffClerkInfoDTO.java
+12
-0
WxEnterpriseRelationDetailDTO.java
.../haoban/manage/api/dto/WxEnterpriseRelationDetailDTO.java
+9
-0
CheckQywxSettingApiService.java
...haoban/manage/api/service/CheckQywxSettingApiService.java
+33
-0
ClerkMainStoreRelatedApiService.java
...n/manage/api/service/ClerkMainStoreRelatedApiService.java
+8
-0
DealSyncOperationApiService.java
...aoban/manage/api/service/DealSyncOperationApiService.java
+9
-0
ExternalClerkRelatedApiService.java
...an/manage/api/service/ExternalClerkRelatedApiService.java
+24
-6
MaterialApiService.java
...com/gic/haoban/manage/api/service/MaterialApiService.java
+8
-0
MemberUnionidRelatedApiService.java
...an/manage/api/service/MemberUnionidRelatedApiService.java
+35
-3
WxEnterpriseRelatedApiService.java
...ban/manage/api/service/WxEnterpriseRelatedApiService.java
+7
-0
TabHaobanExternalClerkRelatedMapper.java
...rvice/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
+21
-1
TabHaobanMaterialMapper.java
...an/manage/service/dao/mapper/TabHaobanMaterialMapper.java
+2
-0
TabHaobanStoreRelationMapper.java
...nage/service/dao/mapper/TabHaobanStoreRelationMapper.java
+9
-0
TabHaobanClerkMainStoreRelated.java
...manage/service/entity/TabHaobanClerkMainStoreRelated.java
+10
-0
TabHaobanMaterial.java
...m/gic/haoban/manage/service/entity/TabHaobanMaterial.java
+10
-0
TabHaobanWxEnterpriseRelated.java
...n/manage/service/entity/TabHaobanWxEnterpriseRelated.java
+8
-0
ExternalUserPojo.java
.../com/gic/haoban/manage/service/pojo/ExternalUserPojo.java
+13
-0
MaterialService.java
...om/gic/haoban/manage/service/service/MaterialService.java
+12
-0
MiniprogramSettingService.java
...ban/manage/service/service/MiniprogramSettingService.java
+1
-0
WxEnterpriseRelatedService.java
...an/manage/service/service/WxEnterpriseRelatedService.java
+8
-0
WxEnterpriseService.java
...ic/haoban/manage/service/service/WxEnterpriseService.java
+2
-0
ClerkMainStoreRelatedServiceImpl.java
...ervice/service/impl/ClerkMainStoreRelatedServiceImpl.java
+1
-0
MaterialServiceImpl.java
...oban/manage/service/service/impl/MaterialServiceImpl.java
+7
-0
StoreRangeServiceImpl.java
...an/manage/service/service/impl/StoreRangeServiceImpl.java
+58
-12
WxEnterpriseRelatedServiceImpl.java
.../service/service/impl/WxEnterpriseRelatedServiceImpl.java
+11
-0
WxEnterpriseServiceImpl.java
.../manage/service/service/impl/WxEnterpriseServiceImpl.java
+12
-1
CheckQywxSettingApiServiceImpl.java
...vice/service/out/impl/CheckQywxSettingApiServiceImpl.java
+120
-0
ClerkMainStoreRelatedApiServiceImpl.java
...service/out/impl/ClerkMainStoreRelatedApiServiceImpl.java
+9
-0
DealSyncOperationApiServiceImpl.java
...ice/service/out/impl/DealSyncOperationApiServiceImpl.java
+10
-0
ExternalClerkRelatedApiServiceImpl.java
.../service/out/impl/ExternalClerkRelatedApiServiceImpl.java
+38
-12
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+68
-3
MemberUnionidRelatedApiServiceImpl.java
.../service/out/impl/MemberUnionidRelatedApiServiceImpl.java
+0
-0
WxApplicationApiServiceImpl.java
...service/service/out/impl/WxApplicationApiServiceImpl.java
+2
-2
WxEnterpriseApiServiceImpl.java
.../service/service/out/impl/WxEnterpriseApiServiceImpl.java
+1
-0
WxEnterpriseRelatedApiServiceImpl.java
...e/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
+16
-0
FriendSyncNewOperation.java
...an/manage/service/task/friend/FriendSyncNewOperation.java
+4
-1
MemberUnionidRelatedMapper.xml
.../src/main/resources/mapper/MemberUnionidRelatedMapper.xml
+2
-2
TabHaobanClerkMainStoreRelatedMapper.xml
...resources/mapper/TabHaobanClerkMainStoreRelatedMapper.xml
+14
-2
TabHaobanExternalClerkRelatedMapper.xml
.../resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
+22
-0
TabHaobanMaterialMapper.xml
...ice/src/main/resources/mapper/TabHaobanMaterialMapper.xml
+30
-3
TabHaobanStoreRelationMapper.xml
...rc/main/resources/mapper/TabHaobanStoreRelationMapper.xml
+14
-0
WxEnterpriseRelatedMapper.xml
...e/src/main/resources/mapper/WxEnterpriseRelatedMapper.xml
+11
-1
ServiceTest.java
haoban-manage3-service/src/test/java/ServiceTest.java
+36
-15
test.java
haoban-manage3-service/src/test/java/test.java
+8
-3
GicDepartmentController.java
...haoban/manage/web/controller/GicDepartmentController.java
+2
-0
StaffController.java
...com/gic/haoban/manage/web/controller/StaffController.java
+16
-0
WxEnterpriseController.java
.../haoban/manage/web/controller/WxEnterpriseController.java
+20
-0
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+1
-0
dubbo-haoban-manage-web.xml
...3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
+2
-0
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+58
-5
AuditSettingVO.java
...ain/java/com/gic/haoban/manage/web/vo/AuditSettingVO.java
+9
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/CheckFriendSettingDTO.java
0 → 100644
View file @
adf7e102
package
com
.
gic
.
haoban
.
manage
.
api
.
dto
;
import
java.io.Serializable
;
/**
* Created 2021/5/31.
*
* @author hua
*/
public
class
CheckFriendSettingDTO
implements
Serializable
{
private
String
wxEnterpriseId
;
private
String
name
;
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
}
public
void
setWxEnterpriseId
(
String
wxEnterpriseId
)
{
this
.
wxEnterpriseId
=
wxEnterpriseId
;
}
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/ClerkMainStoreRelatedDTO.java
View file @
adf7e102
...
@@ -15,6 +15,8 @@ public class ClerkMainStoreRelatedDTO implements Serializable{
...
@@ -15,6 +15,8 @@ public class ClerkMainStoreRelatedDTO implements Serializable{
private
Integer
mainStoreFlag
;
private
Integer
mainStoreFlag
;
private
Integer
freshFriendFlag
;
private
Integer
statusFlag
;
private
Integer
statusFlag
;
private
Date
createTime
;
private
Date
createTime
;
...
@@ -23,6 +25,14 @@ public class ClerkMainStoreRelatedDTO implements Serializable{
...
@@ -23,6 +25,14 @@ public class ClerkMainStoreRelatedDTO implements Serializable{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
Integer
getFreshFriendFlag
()
{
return
freshFriendFlag
;
}
public
void
setFreshFriendFlag
(
Integer
freshFriendFlag
)
{
this
.
freshFriendFlag
=
freshFriendFlag
;
}
public
String
getClerkMainStoreRelatedId
()
{
public
String
getClerkMainStoreRelatedId
()
{
return
clerkMainStoreRelatedId
;
return
clerkMainStoreRelatedId
;
}
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/EnterpriseDetailDTO.java
View file @
adf7e102
...
@@ -18,6 +18,10 @@ public class EnterpriseDetailDTO implements Serializable{
...
@@ -18,6 +18,10 @@ public class EnterpriseDetailDTO implements Serializable{
private
String
version
;
private
String
version
;
private
int
nodeCount
;
private
int
nodeCount
;
private
String
enterpriseLogo
;
private
String
enterpriseLogo
;
/**
* 导购编辑权限
*/
private
Integer
clerkEditFlag
;
private
String
staffId
;
private
String
staffId
;
private
String
staffName
;
private
String
staffName
;
private
Date
createTime
;
private
Date
createTime
;
...
@@ -25,6 +29,14 @@ public class EnterpriseDetailDTO implements Serializable{
...
@@ -25,6 +29,14 @@ public class EnterpriseDetailDTO implements Serializable{
private
Integer
wxEnterpriseType
;
private
Integer
wxEnterpriseType
;
private
Integer
memberOpenCardFlag
;
private
Integer
memberOpenCardFlag
;
public
Integer
getClerkEditFlag
()
{
return
clerkEditFlag
;
}
public
void
setClerkEditFlag
(
Integer
clerkEditFlag
)
{
this
.
clerkEditFlag
=
clerkEditFlag
;
}
public
Integer
getWxEnterpriseType
()
{
public
Integer
getWxEnterpriseType
()
{
return
wxEnterpriseType
;
return
wxEnterpriseType
;
}
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/ExternalUserDTO.java
View file @
adf7e102
...
@@ -29,6 +29,19 @@ public class ExternalUserDTO implements Serializable{
...
@@ -29,6 +29,19 @@ public class ExternalUserDTO implements Serializable{
private
String
staffId
;
private
String
staffId
;
private
String
selfExternalUserId
;
private
String
selfExternalUserId
;
/**
* 好友类型
* 1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户
*/
private
Integer
friendType
;
public
Integer
getFriendType
()
{
return
friendType
;
}
public
void
setFriendType
(
Integer
friendType
)
{
this
.
friendType
=
friendType
;
}
public
String
getSelfExternalUserId
()
{
public
String
getSelfExternalUserId
()
{
return
selfExternalUserId
;
return
selfExternalUserId
;
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/MaterialDTO.java
View file @
adf7e102
...
@@ -42,9 +42,27 @@ public class MaterialDTO implements Serializable{
...
@@ -42,9 +42,27 @@ public class MaterialDTO implements Serializable{
private
Date
updateTime
;
private
Date
updateTime
;
private
String
fromMaterialId
=
"-1"
;
private
String
fromMaterialId
=
"-1"
;
//appid link路径 img_url 封面图 materialTitle
private
String
appId
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
String
getMediaid
()
{
return
mediaid
;
}
public
void
setMediaid
(
String
mediaid
)
{
this
.
mediaid
=
mediaid
;
}
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getFromMaterialId
()
{
public
String
getFromMaterialId
()
{
return
fromMaterialId
;
return
fromMaterialId
;
}
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/StaffClerkInfoDTO.java
View file @
adf7e102
...
@@ -35,6 +35,18 @@ public class StaffClerkInfoDTO implements Serializable{
...
@@ -35,6 +35,18 @@ public class StaffClerkInfoDTO implements Serializable{
private
Date
updateTime
;
private
Date
updateTime
;
private
String
clerkPhoneNumber
;
private
String
clerkPhoneNumber
;
/**
* 是否主门店
*/
private
Integer
mainStoreFlag
;
public
Integer
getMainStoreFlag
()
{
return
mainStoreFlag
;
}
public
void
setMainStoreFlag
(
Integer
mainStoreFlag
)
{
this
.
mainStoreFlag
=
mainStoreFlag
;
}
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/WxEnterpriseRelationDetailDTO.java
View file @
adf7e102
...
@@ -18,8 +18,17 @@ public class WxEnterpriseRelationDetailDTO implements Serializable {
...
@@ -18,8 +18,17 @@ public class WxEnterpriseRelationDetailDTO implements Serializable {
private
String
staffName
;
private
String
staffName
;
private
int
wxEnterpriseType
;
private
int
wxEnterpriseType
;
private
int
memberOpenCardFlag
;
private
int
memberOpenCardFlag
;
private
Integer
clerkEditFlag
;
private
List
<
StoreOrGroupInfoDTO
>
relations
;
private
List
<
StoreOrGroupInfoDTO
>
relations
;
public
Integer
getClerkEditFlag
()
{
return
clerkEditFlag
;
}
public
void
setClerkEditFlag
(
Integer
clerkEditFlag
)
{
this
.
clerkEditFlag
=
clerkEditFlag
;
}
public
String
getWxEnterpriseRelatedId
()
{
public
String
getWxEnterpriseRelatedId
()
{
return
wxEnterpriseRelatedId
;
return
wxEnterpriseRelatedId
;
}
}
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/CheckQywxSettingApiService.java
0 → 100644
View file @
adf7e102
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
com.gic.haoban.manage.api.dto.CheckFriendSettingDTO
;
import
com.gic.haoban.manage.api.dto.ExternalUserDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
/**
* Created 2021/5/31.
*
* @author hua
*/
public
interface
CheckQywxSettingApiService
{
/**
* 设置好友添加流程
*
* @param wxEnterpriseId
* @param name
*/
public
void
setFriendSetting
(
String
wxEnterpriseId
,
String
name
);
/**
* 获取设置的好友流程
*/
public
CheckFriendSettingDTO
getFriendSetting
();
/**
* 校验保存
*
* @param externalUserDTO
* @param dto
*/
public
void
saveFriendCallback
(
String
wxEnterpriseId
,
ExternalUserDTO
externalUserDTO
,
MemberUnionidRelatedDTO
dto
);
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ClerkMainStoreRelatedApiService.java
View file @
adf7e102
...
@@ -8,4 +8,12 @@ public interface ClerkMainStoreRelatedApiService {
...
@@ -8,4 +8,12 @@ public interface ClerkMainStoreRelatedApiService {
ClerkMainStoreRelatedDTO
getWxEnterpriseIdAndStaffId
(
String
wxEnterpriseId
,
String
staffId
);
ClerkMainStoreRelatedDTO
getWxEnterpriseIdAndStaffId
(
String
wxEnterpriseId
,
String
staffId
);
/**
* 设置刷新好友状态为已刷新
*
* @param wxEnterpriseId
* @param staffId
*/
void
setFreshFriend
(
String
wxEnterpriseId
,
String
staffId
);
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DealSyncOperationApiService.java
View file @
adf7e102
...
@@ -165,4 +165,13 @@ public interface DealSyncOperationApiService {
...
@@ -165,4 +165,13 @@ public interface DealSyncOperationApiService {
public
void
quartWxFriendClerk
(
String
res
);
public
void
quartWxFriendClerk
(
String
res
);
void
test
(
String
wxEnterpriseId
,
String
taskId
);
void
test
(
String
wxEnterpriseId
,
String
taskId
);
/**
* 获取刷新状态
*
* @param wxEnterpriseId
* @param staffId
* @return true 刷新中 false 没刷新或刷新完成
*/
public
boolean
getFreshFriendSyncTask
(
String
wxEnterpriseId
,
String
staffId
);
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/ExternalClerkRelatedApiService.java
View file @
adf7e102
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.AuditDTO
;
import
com.gic.haoban.manage.api.dto.BatchAuditLogDTO
;
import
com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO
;
import
com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* Created by tgs on 2020/2/9.
* Created by tgs on 2020/2/9.
*/
*/
public
interface
ExternalClerkRelatedApiService
{
public
interface
ExternalClerkRelatedApiService
{
/**
* 查询导购好友关联
*
* @param wxUserId : 微信用户id
* @param wxEnterpriseId : 微信企业id
* @param enterpriseId : 企业id
* @return : 返回好友关联
*/
List
<
ExternalClerkRelatedDTO
>
listByWxUserIdAndWxEnterpriseId
(
String
wxUserId
,
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 查询会员在企业下的好友关系
*
* @param memberId : 会员id
* @param wxEnterpriseId : 微信企业id
* @param enterpriseId : 企业id
* @return : 返回会员导购关联关系
*/
List
<
ExternalClerkRelatedDTO
>
listByMemberIdAndWxEnterpriseId
(
String
memberId
,
String
wxEnterpriseId
,
String
enterpriseId
);
List
<
ExternalClerkRelatedDTO
>
listByEnterpriseIdAndDate
(
String
enterpriseId
,
Date
date
);
List
<
ExternalClerkRelatedDTO
>
listByEnterpriseIdAndDate
(
String
enterpriseId
,
Date
date
);
Page
<
ExternalClerkRelatedDTO
>
pageMemberUnionByParams
(
List
<
String
>
userIdList
,
List
<
String
>
sendMemberIds
,
Page
<
ExternalClerkRelatedDTO
>
pageMemberUnionByParams
(
List
<
String
>
userIdList
,
List
<
String
>
sendMemberIds
,
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MaterialApiService.java
View file @
adf7e102
...
@@ -59,4 +59,12 @@ public interface MaterialApiService {
...
@@ -59,4 +59,12 @@ public interface MaterialApiService {
*/
*/
void
delMaterial
(
List
<
String
>
ids
);
void
delMaterial
(
List
<
String
>
ids
);
/**
* 自动刷新madiaid的 获取素材
*
* @param materialId
* @return
*/
MaterialDTO
getHasChangeMadieMaterialById
(
String
materialId
);
}
}
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/MemberUnionidRelatedApiService.java
View file @
adf7e102
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
package
com
.
gic
.
haoban
.
manage
.
api
.
service
;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.JSONResponse
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.Page
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
java.util.Date
;
import
java.util.List
;
public
interface
MemberUnionidRelatedApiService
{
public
interface
MemberUnionidRelatedApiService
{
/**
/**
...
@@ -52,6 +52,38 @@ public interface MemberUnionidRelatedApiService {
...
@@ -52,6 +52,38 @@ public interface MemberUnionidRelatedApiService {
String
sendMessage
(
String
wxEnterpriseId
,
String
userId
,
List
<
String
>
extendUserList
,
String
materialId
);
String
sendMessage
(
String
wxEnterpriseId
,
String
userId
,
List
<
String
>
extendUserList
,
String
materialId
);
/**
* 创建企业群发, 支出素材批量发送
*
* @param wxEnterpriseId : 微信企业id
* @param userId : 用户id
* @param extendUserList : 发送的用户id
* @param materialIdList : 素材id列表
* @return : 返回群发执行结果
*/
JSONResponse
sendMessage
(
String
wxEnterpriseId
,
String
userId
,
List
<
String
>
extendUserList
,
List
<
String
>
materialIdList
);
/**
* 获取群发成员发送任务列表
*
* @param wxEnterpriseId : 微信企业id
* @param wxMessageId : 消息id
* @param cursor : 分页游标
* @return : 返回请求结果
*/
JSONResponse
taskExternalMessage
(
String
wxEnterpriseId
,
String
wxMessageId
,
String
cursor
);
/**
* 获取企业群发成员执行结果
*
* @param wxEnterpriseId : 微信企业id
* @param wxMessageId : 消息id
* @param cursor : 分页游标
* @param userId : 用户id
* @return : 返回请求结果
*/
JSONResponse
resultExternalMessage
(
String
wxEnterpriseId
,
String
wxMessageId
,
String
cursor
,
String
userId
);
JSONResponse
getMessageStatus
(
String
wxEnterpriseId
,
String
wxMessageId
);
JSONResponse
getMessageStatus
(
String
wxEnterpriseId
,
String
wxMessageId
);
List
<
MemberUnionidRelatedDTO
>
getByWxUserIdListAndWxEnterpriseId
(
List
<
String
>
userIdList
,
String
wxEnterpriseId
);
List
<
MemberUnionidRelatedDTO
>
getByWxUserIdListAndWxEnterpriseId
(
List
<
String
>
userIdList
,
String
wxEnterpriseId
);
...
...
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/WxEnterpriseRelatedApiService.java
View file @
adf7e102
...
@@ -134,4 +134,11 @@ public interface WxEnterpriseRelatedApiService {
...
@@ -134,4 +134,11 @@ public interface WxEnterpriseRelatedApiService {
*/
*/
public
boolean
initHistoryEnterprise
(
String
wxEnterpriseId
);
public
boolean
initHistoryEnterprise
(
String
wxEnterpriseId
);
/**
* 初始化历史门店数据
*
* @return
*/
public
boolean
setClerkEditFlag
(
String
wxEnterprieseRelatedId
,
int
clerkEditFlag
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanExternalClerkRelatedMapper.java
View file @
adf7e102
...
@@ -108,6 +108,25 @@ public interface TabHaobanExternalClerkRelatedMapper {
...
@@ -108,6 +108,25 @@ public interface TabHaobanExternalClerkRelatedMapper {
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"wxUserId"
)
String
wxUserId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"wxUserId"
)
String
wxUserId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"externalUserId"
)
String
externalUserId
);
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"externalUserId"
)
String
externalUserId
);
/**
* 查询会员在企业下的好友关系
* @param memberId
* @param wxEnterpriseId
* @param enterpriseId
* @return
*/
List
<
TabHaobanExternalClerkRelated
>
listByMemberIdAndWxEnterpriseId
(
@Param
(
"memberId"
)
String
memberId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
* 查询会员在企业下的好友关系
* @param wxUserId
* @param wxEnterpriseId
* @param enterpriseId
* @return
*/
List
<
TabHaobanExternalClerkRelated
>
listByWxUserIdAndWxEnterpriseId
(
@Param
(
"wxUserId"
)
String
wxUserId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"enterpriseId"
)
String
enterpriseId
);
}
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanMaterialMapper.java
View file @
adf7e102
...
@@ -26,6 +26,8 @@ public interface TabHaobanMaterialMapper {
...
@@ -26,6 +26,8 @@ public interface TabHaobanMaterialMapper {
Page
<
TabHaobanMaterial
>
listMaterial
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"categoryId"
)
String
categoryId
,
@Param
(
"materialType"
)
Integer
materialType
);
Page
<
TabHaobanMaterial
>
listMaterial
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"categoryId"
)
String
categoryId
,
@Param
(
"materialType"
)
Integer
materialType
);
List
<
TabHaobanMaterial
>
listMaterialByCategoryIds
(
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
,
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"categoryIds"
)
List
<
String
>
categoryIds
,
@Param
(
"materialType"
)
Integer
materialType
);
TabHaobanMaterial
selectByfromMaterialId
(
@Param
(
"fromMaterialId"
)
String
fromMaterialId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
TabHaobanMaterial
selectByfromMaterialId
(
@Param
(
"fromMaterialId"
)
String
fromMaterialId
,
@Param
(
"wxEnterpriseId"
)
String
wxEnterpriseId
);
List
<
TabHaobanMaterial
>
listByfromMaterialId
(
@Param
(
"fromMaterialId"
)
String
fromMaterialId
);
List
<
TabHaobanMaterial
>
listByfromMaterialId
(
@Param
(
"fromMaterialId"
)
String
fromMaterialId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/TabHaobanStoreRelationMapper.java
View file @
adf7e102
...
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
@Mapper
@Mapper
public
interface
TabHaobanStoreRelationMapper
{
public
interface
TabHaobanStoreRelationMapper
{
...
@@ -64,6 +65,14 @@ public interface TabHaobanStoreRelationMapper {
...
@@ -64,6 +65,14 @@ public interface TabHaobanStoreRelationMapper {
public
int
deleteAllStoreRalation
(
@Param
(
"enterpriseId"
)
String
enterpriseId
);
public
int
deleteAllStoreRalation
(
@Param
(
"enterpriseId"
)
String
enterpriseId
);
/**
/**
* 删除门店
*
* @param enterpriseId
* @return
*/
public
int
deleteStoreRalationByStoreIds
(
@Param
(
"enterpriseId"
)
String
enterpriseId
,
@Param
(
"storeIds"
)
Set
<
String
>
storeIds
);
/**
* 所有门店id
* 所有门店id
*
*
* @param wxEnterpriseId
* @param wxEnterpriseId
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanClerkMainStoreRelated.java
View file @
adf7e102
...
@@ -14,6 +14,8 @@ public class TabHaobanClerkMainStoreRelated implements Serializable {
...
@@ -14,6 +14,8 @@ public class TabHaobanClerkMainStoreRelated implements Serializable {
private
Integer
mainStoreFlag
;
private
Integer
mainStoreFlag
;
private
Integer
freshFriendFlag
;
private
Integer
statusFlag
;
private
Integer
statusFlag
;
private
Date
createTime
;
private
Date
createTime
;
...
@@ -22,6 +24,14 @@ public class TabHaobanClerkMainStoreRelated implements Serializable {
...
@@ -22,6 +24,14 @@ public class TabHaobanClerkMainStoreRelated implements Serializable {
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
Integer
getFreshFriendFlag
()
{
return
freshFriendFlag
;
}
public
void
setFreshFriendFlag
(
Integer
freshFriendFlag
)
{
this
.
freshFriendFlag
=
freshFriendFlag
;
}
public
String
getClerkMainStoreRelatedId
()
{
public
String
getClerkMainStoreRelatedId
()
{
return
clerkMainStoreRelatedId
;
return
clerkMainStoreRelatedId
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanMaterial.java
View file @
adf7e102
...
@@ -34,12 +34,22 @@ public class TabHaobanMaterial implements Serializable {
...
@@ -34,12 +34,22 @@ public class TabHaobanMaterial implements Serializable {
private
String
link
;
private
String
link
;
private
String
appId
;
private
Date
createTime
;
private
Date
createTime
;
private
Date
updateTime
;
private
Date
updateTime
;
private
String
fromMaterialId
;
private
String
fromMaterialId
;
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getFromMaterialId
()
{
public
String
getFromMaterialId
()
{
return
fromMaterialId
;
return
fromMaterialId
;
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/entity/TabHaobanWxEnterpriseRelated.java
View file @
adf7e102
...
@@ -28,7 +28,15 @@ public class TabHaobanWxEnterpriseRelated implements Serializable {
...
@@ -28,7 +28,15 @@ public class TabHaobanWxEnterpriseRelated implements Serializable {
private
Integer
rangeType
;
private
Integer
rangeType
;
private
Integer
clerkEditFlag
;
public
Integer
getClerkEditFlag
()
{
return
clerkEditFlag
;
}
public
void
setClerkEditFlag
(
Integer
clerkEditFlag
)
{
this
.
clerkEditFlag
=
clerkEditFlag
;
}
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/pojo/ExternalUserPojo.java
View file @
adf7e102
...
@@ -15,6 +15,19 @@ public class ExternalUserPojo implements Serializable{
...
@@ -15,6 +15,19 @@ public class ExternalUserPojo implements Serializable{
private
String
addCreateTime
;
private
String
addCreateTime
;
private
String
externalUserId
;
private
String
externalUserId
;
/**
* 好友类型
* 1表示该外部联系人是微信用户,2表示该外部联系人是企业微信用户
*/
private
Integer
friendType
;
public
Integer
getFriendType
()
{
return
friendType
;
}
public
void
setFriendType
(
Integer
friendType
)
{
this
.
friendType
=
friendType
;
}
public
String
getWxEnterpriseId
()
{
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
return
wxEnterpriseId
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/MaterialService.java
View file @
adf7e102
...
@@ -19,6 +19,18 @@ public interface MaterialService {
...
@@ -19,6 +19,18 @@ public interface MaterialService {
com
.
github
.
pagehelper
.
Page
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
com
.
github
.
pagehelper
.
Page
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
);
Integer
materialType
);
/**
* 查询素材
*
* @param wxEnterpriseId
* @param keyword
* @param categoryId
* @param materialType
* @return
*/
com
.
github
.
pagehelper
.
Page
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
List
<
String
>
categoryId
,
Integer
materialType
);
MaterialDTO
getMaterialByFromMaterialId
(
String
fromMaterialId
,
String
wxEnterpriseId
);
MaterialDTO
getMaterialByFromMaterialId
(
String
fromMaterialId
,
String
wxEnterpriseId
);
/**
/**
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/MiniprogramSettingService.java
View file @
adf7e102
...
@@ -52,4 +52,5 @@ public interface MiniprogramSettingService {
...
@@ -52,4 +52,5 @@ public interface MiniprogramSettingService {
*/
*/
public
boolean
delMiniprogramSetting
(
String
id
);
public
boolean
delMiniprogramSetting
(
String
id
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseRelatedService.java
View file @
adf7e102
...
@@ -27,4 +27,12 @@ public interface WxEnterpriseRelatedService {
...
@@ -27,4 +27,12 @@ public interface WxEnterpriseRelatedService {
* @return
* @return
*/
*/
TabHaobanWxEnterpriseRelated
getByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
);
TabHaobanWxEnterpriseRelated
getByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
);
/**
* 设置导购编辑权限
*
* @param id
* @return
*/
void
setClerkEdit
(
String
id
,
int
clerkEditFlag
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/WxEnterpriseService.java
View file @
adf7e102
...
@@ -27,5 +27,7 @@ public interface WxEnterpriseService {
...
@@ -27,5 +27,7 @@ public interface WxEnterpriseService {
int
delete
(
String
wxEnterpriseId
);
int
delete
(
String
wxEnterpriseId
);
int
unbind
(
String
wxEnterpriseId
);
TabHaobanWxEnterprise
getEnterpriseBycorpIdNoStatus
(
String
corpid
);
TabHaobanWxEnterprise
getEnterpriseBycorpIdNoStatus
(
String
corpid
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/ClerkMainStoreRelatedServiceImpl.java
View file @
adf7e102
...
@@ -39,6 +39,7 @@ public class ClerkMainStoreRelatedServiceImpl implements ClerkMainStoreRelatedSe
...
@@ -39,6 +39,7 @@ public class ClerkMainStoreRelatedServiceImpl implements ClerkMainStoreRelatedSe
t
.
setCreateTime
(
now
);
t
.
setCreateTime
(
now
);
t
.
setUpdateTime
(
now
);
t
.
setUpdateTime
(
now
);
t
.
setStatusFlag
(
1
);
t
.
setStatusFlag
(
1
);
t
.
setFreshFriendFlag
(
0
);
t
.
setClerkMainStoreRelatedId
(
uuId
);
t
.
setClerkMainStoreRelatedId
(
uuId
);
mapper
.
insert
(
t
);
mapper
.
insert
(
t
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/MaterialServiceImpl.java
View file @
adf7e102
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.impl;
...
@@ -3,6 +3,7 @@ package com.gic.haoban.manage.service.service.impl;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -65,6 +66,12 @@ public class MaterialServiceImpl implements MaterialService {
...
@@ -65,6 +66,12 @@ public class MaterialServiceImpl implements MaterialService {
}
}
@Override
@Override
public
Page
<
TabHaobanMaterial
>
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
List
<
String
>
categoryIds
,
Integer
materialType
)
{
List
<
TabHaobanMaterial
>
materials
=
mapper
.
listMaterialByCategoryIds
(
wxEnterpriseId
,
keyword
,
categoryIds
,
materialType
);
return
(
Page
)
materials
;
}
@Override
public
MaterialDTO
getMaterialByFromMaterialId
(
String
fromMaterialId
,
String
wxEnterpriseId
)
{
public
MaterialDTO
getMaterialByFromMaterialId
(
String
fromMaterialId
,
String
wxEnterpriseId
)
{
TabHaobanMaterial
tabHaobanMaterial
=
mapper
.
selectByfromMaterialId
(
fromMaterialId
,
wxEnterpriseId
);
TabHaobanMaterial
tabHaobanMaterial
=
mapper
.
selectByfromMaterialId
(
fromMaterialId
,
wxEnterpriseId
);
return
EntityUtil
.
changeEntityByJSON
(
MaterialDTO
.
class
,
tabHaobanMaterial
);
return
EntityUtil
.
changeEntityByJSON
(
MaterialDTO
.
class
,
tabHaobanMaterial
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/StoreRangeServiceImpl.java
View file @
adf7e102
...
@@ -109,34 +109,80 @@ public class StoreRangeServiceImpl implements StoreRangeService {
...
@@ -109,34 +109,80 @@ public class StoreRangeServiceImpl implements StoreRangeService {
@Override
@Override
public
boolean
saveStoreRelations
(
List
<
TabStoreRelation
>
list
,
String
optStaffId
,
int
channelCode
)
{
public
boolean
saveStoreRelations
(
List
<
TabStoreRelation
>
list
,
String
optStaffId
,
int
channelCode
)
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
if
(
CollectionUtils
.
isEmpty
(
list
))
{
logger
.
info
(
"没有需要保存的"
);
logger
.
info
(
"没有需要保存的
: 有问题的授权
"
);
return
true
;
return
true
;
}
}
String
enterpriseId
=
list
.
get
(
0
).
getEnterpriseId
();
String
enterpriseId
=
list
.
get
(
0
).
getEnterpriseId
();
//更新前绑定门店列表
List
<
TabStoreRelation
>
storeRelations
=
tabHaobanStoreRelationMapper
.
listStoreRange
(
enterpriseId
);
Map
<
String
,
Set
<
String
>>
oldStoreIdByMap
=
storeRelations
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabStoreRelation:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
//根据wxEnterpriseId 分组
//根据wxEnterpriseId 分组
Map
<
String
,
Set
<
String
>>
newStoreIdBywxEnterpriseMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabStoreRelation:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
Map
<
String
,
Set
<
String
>>
newStoreIdBywxEnterpriseMap
=
list
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabStoreRelation:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
//所有就的门店old绑定列表
//所有就的门店old绑定列表
Map
<
String
,
Set
<
String
>>
oldStoreIdBywxEnterpriseMap
=
getOldStoreIdsByWxEnterpriseId
(
enterpriseId
);
Map
<
String
,
Set
<
String
>>
oldStoreIdBywxEnterpriseMap
=
getOldStoreIdsByWxEnterpriseId
(
enterpriseId
,
oldStoreIdByMap
);
//需要解绑门店
Set
<
String
>
needUnBindStoreIds
=
new
HashSet
<>();
Set
<
String
>
needUnBindStoreIds
=
new
HashSet
<>();
//需要新增权限门店
Set
<
String
>
needAddStoreIds
=
new
HashSet
<>();
oldStoreIdBywxEnterpriseMap
.
forEach
((
wxEid
,
oldStoreIds
)
->
{
oldStoreIdBywxEnterpriseMap
.
forEach
((
wxEid
,
oldStoreIds
)
->
{
Set
<
String
>
newStoreIds
=
newStoreIdBywxEnterpriseMap
.
get
(
wxEid
);
Set
<
String
>
newStoreIds
=
newStoreIdBywxEnterpriseMap
.
get
(
wxEid
);
logger
.
info
(
"wxEnterpriseId-difference-"
+
wxEid
+
":{},{}"
,
JSONObject
.
toJSONString
(
oldStoreIds
),
JSONObject
.
toJSONString
(
newStoreIds
));
if
(
CollectionUtils
.
isEmpty
(
newStoreIds
))
{
if
(
CollectionUtils
.
isEmpty
(
newStoreIds
))
{
//没有新的 老的都需要删除
needUnBindStoreIds
.
addAll
(
oldStoreIds
);
return
;
return
;
}
}
Sets
.
SetView
<
String
>
needDelStoreIds
=
Sets
.
difference
(
oldStoreIds
,
newStoreIds
);
Sets
.
SetView
<
String
>
needDelStoreIds
=
Sets
.
difference
(
oldStoreIds
,
newStoreIds
);
logger
.
info
(
"wxEnterpriseId-difference-"
+
wxEid
+
":{},{}"
,
JSONObject
.
toJSONString
(
oldStoreIds
),
JSONObject
.
toJSONString
(
newStoreIds
));
logger
.
info
(
"wxEnterpriseId:{},{}"
,
wxEid
,
JSONObject
.
toJSONString
(
needDelStoreIds
));
logger
.
info
(
"wxEnterpriseId:{},{}"
,
wxEid
,
JSONObject
.
toJSONString
(
needDelStoreIds
));
Set
<
String
>
mid
=
needDelStoreIds
.
stream
().
collect
(
Collectors
.
toSet
());
Set
<
String
>
mid
=
needDelStoreIds
.
stream
().
collect
(
Collectors
.
toSet
());
needUnBindStoreIds
.
addAll
(
mid
);
needUnBindStoreIds
.
addAll
(
mid
);
//需要新增
Set
<
String
>
old
=
oldStoreIdByMap
.
get
(
wxEid
);
if
(
CollectionUtils
.
isEmpty
(
old
))
{
needAddStoreIds
.
addAll
(
newStoreIds
);
return
;
}
Sets
.
SetView
<
String
>
needAdd
=
Sets
.
difference
(
newStoreIds
,
old
);
if
(
CollectionUtils
.
isNotEmpty
(
needAdd
))
{
needAddStoreIds
.
addAll
(
needAdd
);
}
});
});
//这些门店解除绑定
//这些门店解除绑定
staffClerkRelationService
.
delBindByStoreIds
(
null
,
needUnBindStoreIds
,
optStaffId
,
channelCode
);
staffClerkRelationService
.
delBindByStoreIds
(
null
,
needUnBindStoreIds
,
optStaffId
,
channelCode
);
//批量处理关联关系
dealStoreRelation
(
list
,
enterpriseId
,
needUnBindStoreIds
,
needAddStoreIds
);
return
true
;
}
/**
* 批量处理关联关系
*
* @param storeRelations
* @param enterpriseId
* @param delStoreIds
* @param addStoreIds
*/
private
void
dealStoreRelation
(
List
<
TabStoreRelation
>
storeRelations
,
String
enterpriseId
,
Set
<
String
>
delStoreIds
,
Set
<
String
>
addStoreIds
)
{
// //先删除 后新增
// tabHaobanStoreRelationMapper.deleteAllStoreRalation(enterpriseId);
// //批量插入
// insertStoreRelationBatch(storeRelations);
//先删除 后新增
//先删除 后新增
tabHaobanStoreRelationMapper
.
deleteAllStoreRalation
(
enterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
delStoreIds
))
{
logger
.
info
(
"批量删除门店:{}"
,
JSONObject
.
toJSONString
(
delStoreIds
));
tabHaobanStoreRelationMapper
.
deleteStoreRalationByStoreIds
(
enterpriseId
,
delStoreIds
);
}
if
(
CollectionUtils
.
isNotEmpty
(
addStoreIds
))
{
logger
.
info
(
"批量新增门店:{}"
,
JSONObject
.
toJSONString
(
addStoreIds
));
List
<
TabStoreRelation
>
adds
=
storeRelations
.
stream
().
filter
(
dto
->
addStoreIds
.
contains
(
dto
.
getStoreId
())).
collect
(
Collectors
.
toList
());
//批量插入
//批量插入
insertStoreRelationBatch
(
list
);
insertStoreRelationBatch
(
adds
);
return
true
;
}
}
}
/**
/**
...
@@ -163,21 +209,21 @@ public class StoreRangeServiceImpl implements StoreRangeService {
...
@@ -163,21 +209,21 @@ public class StoreRangeServiceImpl implements StoreRangeService {
* @param enterpriseId
* @param enterpriseId
* @return
* @return
*/
*/
private
Map
<
String
,
Set
<
String
>>
getOldStoreIdsByWxEnterpriseId
(
String
enterpriseId
)
{
private
Map
<
String
,
Set
<
String
>>
getOldStoreIdsByWxEnterpriseId
(
String
enterpriseId
,
Map
<
String
,
Set
<
String
>>
oldStoreIdBywxEnterpriseMap
)
{
Map
<
String
,
Set
<
String
>>
ret
=
new
HashMap
<>();
Map
<
String
,
Set
<
String
>>
ret
=
new
HashMap
<>();
Set
<
String
>
wxEnterpriseIds
=
new
HashSet
<>();
Set
<
String
>
wxEnterpriseIds
=
new
HashSet
<>();
//更新前绑定门店列表
//
//更新前绑定门店列表
List
<
TabStoreRelation
>
storeRelations
=
tabHaobanStoreRelationMapper
.
listStoreRange
(
enterpriseId
);
//
List<TabStoreRelation> storeRelations = tabHaobanStoreRelationMapper.listStoreRange(enterpriseId);
Map
<
String
,
Set
<
String
>>
oldStoreIdBywxEnterpriseMap
=
storeRelations
.
stream
().
collect
(
Collectors
.
groupingBy
(
TabStoreRelation:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
//
Map<String, Set<String>> oldStoreIdBywxEnterpriseMap = storeRelations.stream().collect(Collectors.groupingBy(TabStoreRelation::getWxEnterpriseId, Collectors.mapping(dto -> dto.getStoreId(), Collectors.toSet())));
if
(
CollectionUtils
.
isNotEmpty
(
storeRelations
)
)
{
if
(
oldStoreIdBywxEnterpriseMap
!=
null
&&
oldStoreIdBywxEnterpriseMap
.
size
()
>
0
)
{
wxEnterpriseIds
.
addAll
(
oldStoreIdBywxEnterpriseMap
.
keySet
());
wxEnterpriseIds
.
addAll
(
oldStoreIdBywxEnterpriseMap
.
keySet
());
}
}
//导购绑定列表
//导购绑定列表
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listBindStoreIdByEnterpriseId
(
enterpriseId
);
List
<
StaffClerkRelationDTO
>
staffClerkRelationDTOS
=
staffClerkRelationService
.
listBindStoreIdByEnterpriseId
(
enterpriseId
);
Map
<
String
,
Set
<
String
>>
oldStaffStoreIdByWxEidMap
=
staffClerkRelationDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
StaffClerkRelationDTO:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
Map
<
String
,
Set
<
String
>>
oldStaffStoreIdByWxEidMap
=
staffClerkRelationDTOS
.
stream
().
collect
(
Collectors
.
groupingBy
(
StaffClerkRelationDTO:
:
getWxEnterpriseId
,
Collectors
.
mapping
(
dto
->
dto
.
getStoreId
(),
Collectors
.
toSet
())));
if
(
CollectionUtils
.
isNotEmpty
(
staffClerkRelationDTOS
)
)
{
if
(
oldStaffStoreIdByWxEidMap
!=
null
&&
oldStaffStoreIdByWxEidMap
.
size
()
>
0
)
{
wxEnterpriseIds
.
addAll
(
oldStaffStoreIdByWxEidMap
.
keySet
());
wxEnterpriseIds
.
addAll
(
oldStaffStoreIdByWxEidMap
.
keySet
());
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseRelatedServiceImpl.java
View file @
adf7e102
...
@@ -13,6 +13,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
...
@@ -13,6 +13,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanWxEnterpriseRelated;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseRelatedService
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -59,4 +60,14 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
...
@@ -59,4 +60,14 @@ public class WxEnterpriseRelatedServiceImpl implements WxEnterpriseRelatedServic
public
TabHaobanWxEnterpriseRelated
getByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
public
TabHaobanWxEnterpriseRelated
getByEnterpriseId
(
String
wxEnterpriseId
,
String
enterpriseId
)
{
return
mapper
.
findOneByEIdAndWxEid
(
enterpriseId
,
wxEnterpriseId
);
return
mapper
.
findOneByEIdAndWxEid
(
enterpriseId
,
wxEnterpriseId
);
}
}
@Override
public
void
setClerkEdit
(
String
id
,
int
clerkEditFlag
)
{
TabHaobanWxEnterpriseRelated
record
=
new
TabHaobanWxEnterpriseRelated
();
record
.
setClerkEditFlag
(
clerkEditFlag
);
record
.
setWxEnterpriseRelatedId
(
id
);
record
.
setUpdateTime
(
new
Date
());
mapper
.
updateByPrimaryKeySelective
(
record
);
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/WxEnterpriseServiceImpl.java
View file @
adf7e102
...
@@ -27,6 +27,7 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
...
@@ -27,6 +27,7 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
wxDTO
.
setUpdateTime
(
now
);
wxDTO
.
setUpdateTime
(
now
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanWxEnterprise
.
class
,
wxDTO
);
TabHaobanWxEnterprise
tabHaobanWxEnterprise
=
EntityUtil
.
changeEntityByJSON
(
TabHaobanWxEnterprise
.
class
,
wxDTO
);
tabHaobanWxEnterprise
.
setStatusFlag
(
1
);
tabHaobanWxEnterprise
.
setStatusFlag
(
1
);
tabHaobanWxEnterprise
.
setBindFlag
(
1
);
mapper
.
insertSelective
(
tabHaobanWxEnterprise
);
mapper
.
insertSelective
(
tabHaobanWxEnterprise
);
return
wxDTO
.
getWxEnterpriseId
();
return
wxDTO
.
getWxEnterpriseId
();
...
@@ -66,13 +67,23 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
...
@@ -66,13 +67,23 @@ public class WxEnterpriseServiceImpl implements WxEnterpriseService {
TabHaobanWxEnterprise
enterprise
=
new
TabHaobanWxEnterprise
();
TabHaobanWxEnterprise
enterprise
=
new
TabHaobanWxEnterprise
();
enterprise
.
setWxEnterpriseId
(
wxEnterpriseId
);
enterprise
.
setWxEnterpriseId
(
wxEnterpriseId
);
enterprise
.
setStatusFlag
(
0
);
enterprise
.
setStatusFlag
(
0
);
enterprise
.
setUpdateTime
(
new
Date
());
return
this
.
mapper
.
updateByPrimaryKeySelective
(
enterprise
);
}
@Override
public
int
unbind
(
String
wxEnterpriseId
)
{
TabHaobanWxEnterprise
enterprise
=
new
TabHaobanWxEnterprise
();
enterprise
.
setWxEnterpriseId
(
wxEnterpriseId
);
enterprise
.
setBindFlag
(
0
);
enterprise
.
setUpdateTime
(
new
Date
());
return
this
.
mapper
.
updateByPrimaryKeySelective
(
enterprise
);
return
this
.
mapper
.
updateByPrimaryKeySelective
(
enterprise
);
}
}
@Override
@Override
public
TabHaobanWxEnterprise
getEnterpriseBycorpIdNoStatus
(
String
corpId
)
{
public
TabHaobanWxEnterprise
getEnterpriseBycorpIdNoStatus
(
String
corpId
)
{
List
<
TabHaobanWxEnterprise
>
list
=
this
.
mapper
.
getEnterpriseBycorpIdNoStatus
(
corpId
);
List
<
TabHaobanWxEnterprise
>
list
=
this
.
mapper
.
getEnterpriseBycorpIdNoStatus
(
corpId
);
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
if
(
CollectionUtils
.
isNotEmpty
(
list
))
{
return
list
.
get
(
0
);
return
list
.
get
(
0
);
}
}
return
null
;
return
null
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/CheckQywxSettingApiServiceImpl.java
0 → 100644
View file @
adf7e102
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.haoban.manage.api.dto.CheckFriendSettingDTO
;
import
com.gic.haoban.manage.api.dto.ExternalUserDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.CheckQywxSettingApiService
;
import
com.gic.haoban.manage.service.service.WxEnterpriseService
;
import
com.gic.redis.data.util.RedisUtil
;
import
org.apache.commons.lang3.StringUtils
;
import
org.redisson.api.RBucket
;
import
org.redisson.api.RMap
;
import
org.redisson.api.RedissonClient
;
import
org.slf4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.concurrent.TimeUnit
;
import
static
org
.
slf4j
.
LoggerFactory
.
getLogger
;
/**
* Created 2021/5/31.
*
* @author hua
*/
@Service
public
class
CheckQywxSettingApiServiceImpl
implements
CheckQywxSettingApiService
{
private
static
final
Logger
logger
=
getLogger
(
CheckQywxSettingApiServiceImpl
.
class
);
private
static
final
String
FRIEND_SETTING_KEY
=
"haoban-check-friend-setting"
;
private
static
final
String
FRIEND_SETTING_VAL_KEY
=
"haoban-check-friend-setting-val"
;
private
static
final
String
SELF_APP
=
"selfSuiteId"
;
private
static
final
String
THIRD_APP
=
"thirdSuiteId"
;
private
static
final
String
ALERT_KEY
=
"friend-alert:"
;
private
static
final
String
ALERT_URL
=
"https://oapi.dingtalk.com/robot/send?access_token=435c0ddaacda849e145b64cc3a83c37f742105d88cf27b719b2dbef167436ad4"
;
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
@Override
public
void
setFriendSetting
(
String
wxEnterpriseId
,
String
name
)
{
CheckFriendSettingDTO
checkFriendSettingDTO
=
new
CheckFriendSettingDTO
();
checkFriendSettingDTO
.
setName
(
name
);
checkFriendSettingDTO
.
setWxEnterpriseId
(
wxEnterpriseId
);
RedisUtil
.
setCache
(
FRIEND_SETTING_KEY
,
checkFriendSettingDTO
);
RedissonClient
redisClient
=
RedisUtil
.
getRedisClient
();
RMap
<
Object
,
Object
>
map
=
redisClient
.
getMap
(
FRIEND_SETTING_VAL_KEY
);
map
.
delete
();
}
@Override
public
CheckFriendSettingDTO
getFriendSetting
()
{
return
RedisUtil
.
getCache
(
FRIEND_SETTING_KEY
,
CheckFriendSettingDTO
.
class
);
}
@Override
public
void
saveFriendCallback
(
String
wxEnterpriseId
,
ExternalUserDTO
externalUserDTO
,
MemberUnionidRelatedDTO
dto
)
{
if
(
null
==
externalUserDTO
)
{
messageAlert
(
wxEnterpriseId
,
dto
,
null
);
//todo 告警
return
;
}
CheckFriendSettingDTO
friendSetting
=
this
.
getFriendSetting
();
if
(!
wxEnterpriseId
.
equals
(
friendSetting
.
getWxEnterpriseId
()))
{
return
;
}
if
(!
friendSetting
.
getName
().
equals
(
externalUserDTO
.
getName
()))
{
return
;
}
RedissonClient
redisClient
=
RedisUtil
.
getRedisClient
();
RMap
<
Object
,
Object
>
map
=
redisClient
.
getMap
(
FRIEND_SETTING_VAL_KEY
);
if
(
SELF_APP
.
equals
(
dto
.
getSuiteid
()))
{
map
.
put
(
SELF_APP
,
externalUserDTO
);
}
else
{
map
.
put
(
THIRD_APP
,
externalUserDTO
);
}
messageAlert
(
wxEnterpriseId
,
dto
,
"好友提醒:"
+
dto
.
getSuiteid
());
}
/**
* 告警
*
* @param wxEnterpriseId
* @param dto
*/
private
void
messageAlert
(
String
wxEnterpriseId
,
MemberUnionidRelatedDTO
dto
,
String
titleSub
)
{
titleSub
=
StringUtils
.
isBlank
(
titleSub
)
?
"加好友异常"
:
titleSub
;
String
key
=
ALERT_KEY
+
wxEnterpriseId
;
RBucket
<
Object
>
bucket
=
RedisUtil
.
getRedisClient
().
getBucket
(
key
);
boolean
b
=
bucket
.
trySet
(
1
,
60L
,
TimeUnit
.
SECONDS
);
if
(!
b
)
{
return
;
}
WxEnterpriseDTO
wxEnterpriseDTO
=
wxEnterpriseService
.
selectById
(
wxEnterpriseId
);
ProviderLocalTag
providerLocalTag
=
ProviderLocalTag
.
tag
.
get
();
String
traceId
=
providerLocalTag
.
traceId
;
String
traceUrl
=
"http://212.64.4.231:8780/damo-stats/mongodb/getLogMessagesView?trace_id="
+
traceId
;
String
title
=
wxEnterpriseDTO
.
getCorpName
()
+
": "
+
titleSub
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
link
=
new
HashMap
<>();
map
.
put
(
"msgtype"
,
"link"
);
link
.
put
(
"title"
,
title
);
link
.
put
(
"text"
,
JSONObject
.
toJSONString
(
dto
));
link
.
put
(
"messageUrl"
,
traceUrl
);
map
.
put
(
"link"
,
link
);
String
post
=
HttpUtil
.
post
(
ALERT_URL
,
JSONObject
.
toJSONString
(
map
));
logger
.
info
(
"alert:{}"
,
post
);
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ClerkMainStoreRelatedApiServiceImpl.java
View file @
adf7e102
...
@@ -33,4 +33,13 @@ public class ClerkMainStoreRelatedApiServiceImpl implements ClerkMainStoreRelate
...
@@ -33,4 +33,13 @@ public class ClerkMainStoreRelatedApiServiceImpl implements ClerkMainStoreRelate
return
EntityUtil
.
changeEntityByJSON
(
ClerkMainStoreRelatedDTO
.
class
,
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
));
return
EntityUtil
.
changeEntityByJSON
(
ClerkMainStoreRelatedDTO
.
class
,
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
));
}
}
@Override
public
void
setFreshFriend
(
String
wxEnterpriseId
,
String
staffId
)
{
TabHaobanClerkMainStoreRelated
related
=
clerkMainStoreRelatedService
.
getMainStoreByStaffId
(
staffId
,
wxEnterpriseId
);
if
(
related
!=
null
)
{
related
.
setUpdateTime
(
new
Date
());
related
.
setFreshFriendFlag
(
1
);
clerkMainStoreRelatedService
.
update
(
related
);
}
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
View file @
adf7e102
...
@@ -869,4 +869,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
...
@@ -869,4 +869,14 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
@Override
public
boolean
getFreshFriendSyncTask
(
String
wxEnterpriseId
,
String
staffId
)
{
String
staffLockKey
=
FRIEND_LOCK
+
staffId
;
Object
cache
=
RedisUtil
.
getCache
(
staffLockKey
);
if
(
null
==
cache
)
{
return
false
;
}
return
true
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/ExternalClerkRelatedApiServiceImpl.java
View file @
adf7e102
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.common.utils.PageUtil
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.ExternalClerkRelatedDTO
;
import
com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.List
;
import
com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.MemberUnionidRelatedMapper
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.entity.MemberUnionidRelated
;
import
com.gic.haoban.manage.service.entity.MemberUnionidRelated
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.Logger
;
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
com.gic.api.base.commons.Page
;
import
java.util.Collections
;
import
com.gic.commons.util.EntityUtil
;
import
java.util.Date
;
import
com.gic.haoban.manage.api.service.ExternalClerkRelatedApiService
;
import
java.util.List
;
import
com.gic.haoban.manage.service.dao.mapper.TabHaobanExternalClerkRelatedMapper
;
import
com.gic.haoban.manage.service.entity.TabHaobanExternalClerkRelated
;
import
com.github.pagehelper.PageHelper
;
@Service
@Service
public
class
ExternalClerkRelatedApiServiceImpl
implements
ExternalClerkRelatedApiService
{
public
class
ExternalClerkRelatedApiServiceImpl
implements
ExternalClerkRelatedApiService
{
...
@@ -34,6 +32,34 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
...
@@ -34,6 +32,34 @@ public class ExternalClerkRelatedApiServiceImpl implements ExternalClerkRelatedA
@Autowired
@Autowired
private
MemberUnionidRelatedMapper
memberUnionidRelatedMapper
;
private
MemberUnionidRelatedMapper
memberUnionidRelatedMapper
;
/**
* 查询导购好友关联
*
* @param wxUserId : 微信用户id
* @param wxEnterpriseId : 微信企业id
* @param enterpriseId : 企业id
* @return : 返回好友关联
*/
@Override
public
List
<
ExternalClerkRelatedDTO
>
listByWxUserIdAndWxEnterpriseId
(
String
wxUserId
,
String
wxEnterpriseId
,
String
enterpriseId
)
{
List
<
TabHaobanExternalClerkRelated
>
list
=
tabHaobanExternalClerkRelatedMapper
.
listByWxUserIdAndWxEnterpriseId
(
wxUserId
,
wxEnterpriseId
,
enterpriseId
);
return
EntityUtil
.
changeEntityListByJSON
(
ExternalClerkRelatedDTO
.
class
,
list
);
}
/**
* 查询会员在企业下的好友关系
*
* @param memberId : 会员id
* @param wxEnterpriseId : 微信企业id
* @param enterpriseId : 企业id
* @return : 返回会员导购关联关系
*/
@Override
public
List
<
ExternalClerkRelatedDTO
>
listByMemberIdAndWxEnterpriseId
(
String
memberId
,
String
wxEnterpriseId
,
String
enterpriseId
){
List
<
TabHaobanExternalClerkRelated
>
list
=
tabHaobanExternalClerkRelatedMapper
.
listByMemberIdAndWxEnterpriseId
(
memberId
,
wxEnterpriseId
,
enterpriseId
);
return
EntityUtil
.
changeEntityListByJSON
(
ExternalClerkRelatedDTO
.
class
,
list
);
}
@Override
@Override
public
List
<
ExternalClerkRelatedDTO
>
listByEnterpriseIdAndDate
(
public
List
<
ExternalClerkRelatedDTO
>
listByEnterpriseIdAndDate
(
String
enterpriseId
,
Date
date
)
{
String
enterpriseId
,
Date
date
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
adf7e102
...
@@ -2,11 +2,16 @@ package com.gic.haoban.manage.service.service.out.impl;
...
@@ -2,11 +2,16 @@ package com.gic.haoban.manage.service.service.out.impl;
import
java.io.InputStream
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.net.URL
;
import
java.util.
Date
;
import
java.util.
*
;
import
java.util.
List
;
import
java.util.
stream.Collectors
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.service.entity.TabMiniprogramSetting
;
import
com.gic.haoban.manage.service.service.MiniprogramSettingService
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -53,6 +58,9 @@ public class MaterialApiServiceImpl implements MaterialApiService {
...
@@ -53,6 +58,9 @@ public class MaterialApiServiceImpl implements MaterialApiService {
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
@Autowired
private
MiniprogramSettingService
miniprogramSettingService
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MaterialApiServiceImpl
.
class
);
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
MaterialApiServiceImpl
.
class
);
@Override
@Override
...
@@ -123,6 +131,10 @@ public class MaterialApiServiceImpl implements MaterialApiService {
...
@@ -123,6 +131,10 @@ public class MaterialApiServiceImpl implements MaterialApiService {
fileType
=
QywxMediaTypeEnum
.
FILE
;
fileType
=
QywxMediaTypeEnum
.
FILE
;
url
=
materialDTO
.
getLink
();
url
=
materialDTO
.
getLink
();
}
}
if
(
type
==
6
)
{
fileType
=
QywxMediaTypeEnum
.
IMAGE
;
url
=
materialDTO
.
getImgUrl
();
}
if
(
type
==
3
){
if
(
type
==
3
){
String
imgUrl
=
materialDTO
.
getImgUrl
();
String
imgUrl
=
materialDTO
.
getImgUrl
();
logger
.
info
(
"【上传图片】imgUrl={}"
,
imgUrl
);
logger
.
info
(
"【上传图片】imgUrl={}"
,
imgUrl
);
...
@@ -236,6 +248,9 @@ public class MaterialApiServiceImpl implements MaterialApiService {
...
@@ -236,6 +248,9 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if
(
type
==
5
){
if
(
type
==
5
){
fileType
=
QywxMediaTypeEnum
.
FILE
;
fileType
=
QywxMediaTypeEnum
.
FILE
;
url
=
old
.
getLink
();
url
=
old
.
getLink
();
}
else
if
(
type
==
6
)
{
fileType
=
QywxMediaTypeEnum
.
IMAGE
;
url
=
old
.
getImgUrl
();
}
}
String
[]
arr
=
url
.
split
(
"/"
);
String
[]
arr
=
url
.
split
(
"/"
);
int
count
=
arr
.
length
;
int
count
=
arr
.
length
;
...
@@ -248,11 +263,37 @@ public class MaterialApiServiceImpl implements MaterialApiService {
...
@@ -248,11 +263,37 @@ public class MaterialApiServiceImpl implements MaterialApiService {
return
old
.
getMediaId
();
return
old
.
getMediaId
();
}
}
private
List
<
String
>
listSubCategoryIdsByParentId
(
String
categoryId
)
{
List
<
String
>
categoryIds
=
new
ArrayList
<>();
categoryIds
.
add
(
categoryId
);
if
(
StringUtils
.
isBlank
(
categoryId
))
{
return
categoryIds
;
}
List
<
MaterialCategoryDTO
>
categoryDTOList
=
materialCategoryService
.
listByParentCategory
(
categoryId
);
if
(
CollectionUtils
.
isEmpty
(
categoryDTOList
))
{
return
categoryIds
;
}
for
(
MaterialCategoryDTO
categoryDTO
:
categoryDTOList
)
{
categoryIds
.
addAll
(
this
.
listSubCategoryIdsByParentId
(
categoryDTO
.
getCategoryId
()));
}
return
categoryIds
;
}
@Override
@Override
public
Page
<
MaterialDTO
>
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
public
Page
<
MaterialDTO
>
listMaterial
(
String
wxEnterpriseId
,
String
keyword
,
String
categoryId
,
Integer
materialType
,
BasePageInfo
pageInfo
)
{
Integer
materialType
,
BasePageInfo
pageInfo
)
{
List
<
String
>
categoryIds
=
this
.
listSubCategoryIdsByParentId
(
categoryId
);
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
PageHelper
.
startPage
(
pageInfo
.
getPageNum
(),
pageInfo
.
getPageSize
());
com
.
github
.
pagehelper
.
Page
<
TabHaobanMaterial
>
page
=
materialService
.
listMaterial
(
wxEnterpriseId
,
keyword
,
categoryId
,
materialType
);
com
.
github
.
pagehelper
.
Page
<
TabHaobanMaterial
>
page
=
materialService
.
listMaterial
(
wxEnterpriseId
,
keyword
,
categoryIds
,
materialType
);
List
<
TabHaobanMaterial
>
result
=
page
.
getResult
();
List
<
TabMiniprogramSetting
>
settings
=
miniprogramSettingService
.
listMiniprogram
(
wxEnterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
result
)
&&
CollectionUtils
.
isNotEmpty
(
settings
))
{
Map
<
String
,
TabMiniprogramSetting
>
settingMap
=
settings
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getAppId
(),
dto
->
dto
));
result
.
forEach
(
dto
->
{
TabMiniprogramSetting
miniprogramSetting
=
settingMap
.
get
(
dto
.
getAppId
());
dto
.
setMaterialDesc
(
miniprogramSetting
==
null
?
"--"
:
miniprogramSetting
.
getMiniprogramName
());
});
}
return
PageUtil
.
changePageHelperToCurrentPage
(
page
,
MaterialDTO
.
class
);
return
PageUtil
.
changePageHelperToCurrentPage
(
page
,
MaterialDTO
.
class
);
}
}
...
@@ -320,4 +361,28 @@ public class MaterialApiServiceImpl implements MaterialApiService {
...
@@ -320,4 +361,28 @@ public class MaterialApiServiceImpl implements MaterialApiService {
public
void
delMaterial
(
List
<
String
>
ids
)
{
public
void
delMaterial
(
List
<
String
>
ids
)
{
materialService
.
delmaterialByIds
(
ids
);
materialService
.
delmaterialByIds
(
ids
);
}
}
@Override
public
MaterialDTO
getHasChangeMadieMaterialById
(
String
materialId
)
{
MaterialDTO
materialDTO
=
this
.
selectMaterialById
(
materialId
);
if
(
null
==
materialDTO
)
{
return
null
;
}
Date
lastUploadTime
=
materialDTO
.
getWxLastUploadTime
();
Date
date
=
new
Date
();
Date
compareDate
=
DateUtils
.
addDays
(
date
,
-
3
);
if
(
lastUploadTime
!=
null
&&
lastUploadTime
.
after
(
compareDate
)
&&
StringUtils
.
isNotBlank
(
materialDTO
.
getMediaId
()))
{
return
materialDTO
;
}
Integer
materialType
=
materialDTO
.
getMaterialType
();
String
madiaId
=
materialDTO
.
getMediaId
();
//需要上传的类型
List
<
Integer
>
typeList
=
Arrays
.
asList
(
2
,
4
,
5
,
6
);
if
(
typeList
.
contains
(
materialType
))
{
madiaId
=
this
.
reUpdalodMetail
(
materialId
);
}
materialDTO
.
setMediaId
(
madiaId
);
materialDTO
.
setWxLastUploadTime
(
date
);
return
materialDTO
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MemberUnionidRelatedApiServiceImpl.java
View file @
adf7e102
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 @
adf7e102
...
@@ -40,8 +40,8 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
...
@@ -40,8 +40,8 @@ public class WxApplicationApiServiceImpl implements WxApplicationApiService{
int
i
=
this
.
wxApplicationService
.
cancalWxApplication
(
enterprise
.
getWxEnterpriseId
(),
suiteId
);
int
i
=
this
.
wxApplicationService
.
cancalWxApplication
(
enterprise
.
getWxEnterpriseId
(),
suiteId
);
log
.
info
(
"取消授权结果:{}"
,
i
);
log
.
info
(
"取消授权结果:{}"
,
i
);
TabHaobanWxApplication
wxApplication
=
this
.
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
enterprise
.
getWxEnterpriseId
(),
2
);
TabHaobanWxApplication
wxApplication
=
this
.
wxApplicationService
.
selectByWxEnterpriseIdAndApplicationType
(
enterprise
.
getWxEnterpriseId
(),
2
);
if
(
wxApplication
==
null
){
//如果取消好办小程序应用授权,删除企业
if
(
wxApplication
==
null
)
{
//如果取消好办小程序应用授权,临时解除绑定
this
.
wxEnterpriseService
.
delete
(
enterprise
.
getWxEnterpriseId
());
this
.
wxEnterpriseService
.
unbind
(
enterprise
.
getWxEnterpriseId
());
}
}
}
}
log
.
info
(
"企业未绑定过,{}"
,
corpId
);
log
.
info
(
"企业未绑定过,{}"
,
corpId
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseApiServiceImpl.java
View file @
adf7e102
...
@@ -70,6 +70,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
...
@@ -70,6 +70,7 @@ public class WxEnterpriseApiServiceImpl implements WxEnterpriseApiService {
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
();
wxEnterpriseId
=
enterprise
.
getWxEnterpriseId
();
wxDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
());
wxDTO
.
setWxEnterpriseId
(
enterprise
.
getWxEnterpriseId
());
wxDTO
.
setStatusFlag
(
1
);
wxDTO
.
setStatusFlag
(
1
);
wxDTO
.
setBindFlag
(
1
);
wxEnterpriseService
.
update
(
wxDTO
);
wxEnterpriseService
.
update
(
wxDTO
);
}
else
{
}
else
{
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
wxEnterpriseId
=
wxEnterpriseService
.
add
(
wxDTO
);
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/WxEnterpriseRelatedApiServiceImpl.java
View file @
adf7e102
...
@@ -457,6 +457,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
...
@@ -457,6 +457,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
String
midGroupId
=
null
;
String
midGroupId
=
null
;
//如果是1的话 加入对应企业
//如果是1的话 加入对应企业
if
(
midGroupIds
.
size
()
==
1
)
{
if
(
midGroupIds
.
size
()
==
1
)
{
midGroupId
=
midGroupIds
.
iterator
().
next
();
midGroupId
=
midGroupIds
.
iterator
().
next
();
}
else
{
}
else
{
...
@@ -511,6 +512,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
...
@@ -511,6 +512,7 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
detailDTO
.
setMemberOpenCardFlag
(
wxEnterpriseRelated
.
getMemberOpenCardFlag
());
detailDTO
.
setMemberOpenCardFlag
(
wxEnterpriseRelated
.
getMemberOpenCardFlag
());
detailDTO
.
setWxEnterpriseType
(
wxEnterpriseRelated
.
getWxEnterpriseType
());
detailDTO
.
setWxEnterpriseType
(
wxEnterpriseRelated
.
getWxEnterpriseType
());
detailDTO
.
setWxEnterpriseRelatedId
(
wxEnterpriseRelated
.
getWxEnterpriseRelatedId
());
detailDTO
.
setWxEnterpriseRelatedId
(
wxEnterpriseRelated
.
getWxEnterpriseRelatedId
());
detailDTO
.
setClerkEditFlag
(
wxEnterpriseRelated
.
getClerkEditFlag
());
return
detailDTO
;
return
detailDTO
;
}
}
...
@@ -622,4 +624,18 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
...
@@ -622,4 +624,18 @@ public class WxEnterpriseRelatedApiServiceImpl implements WxEnterpriseRelatedApi
}
}
return
true
;
return
true
;
}
}
@Override
public
boolean
setClerkEditFlag
(
String
wxEnterprieseRelatedId
,
int
clerkEditFlag
)
{
TabHaobanWxEnterpriseRelated
tabHaobanWxEnterpriseRelated
=
wxEnterpriseRelatedService
.
getByGicEnterpriseIdByEnterpriseRelatedId
(
wxEnterprieseRelatedId
);
if
(
tabHaobanWxEnterpriseRelated
==
null
)
{
return
false
;
}
if
(
tabHaobanWxEnterpriseRelated
.
getWxEnterpriseType
()
==
1
)
{
logger
.
info
(
"非总部不能设置好友"
);
return
false
;
}
wxEnterpriseRelatedService
.
setClerkEdit
(
wxEnterprieseRelatedId
,
clerkEditFlag
);
return
true
;
}
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/friend/FriendSyncNewOperation.java
View file @
adf7e102
...
@@ -165,6 +165,9 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
...
@@ -165,6 +165,9 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
String
wxUserId
=
dataPre
.
getpDataId
();
String
wxUserId
=
dataPre
.
getpDataId
();
String
taskId
=
dataPre
.
getTaskId
();
String
taskId
=
dataPre
.
getTaskId
();
if
(
externalUserDTO
.
getFriendType
()
==
2
)
{
return
"不是微信好友,是企业微信好友:"
+
externalUserDTO
.
getFriendType
();
}
//staff信息
//staff信息
StaffDTO
staff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
StaffDTO
staff
=
staffApiService
.
selectByUserIdAndEnterpriseId
(
wxUserId
,
wxEnterpriseId
);
if
(
staff
==
null
)
{
if
(
staff
==
null
)
{
...
@@ -219,7 +222,7 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
...
@@ -219,7 +222,7 @@ public class FriendSyncNewOperation implements BaseSyncOperation {
externalUserDTO
.
getUnionId
(),
""
,
externalUserDTO
.
getName
(),
externalUserDTO
.
getAvatar
(),
qrcodeParam
);
externalUserDTO
.
getUnionId
(),
""
,
externalUserDTO
.
getName
(),
externalUserDTO
.
getAvatar
(),
qrcodeParam
);
}
}
if
(
member
==
null
)
{
if
(
member
==
null
)
{
return
"会员不存在:"
+
externalUserDTO
.
getUnionId
();
return
"会员不存在:
unionid:
"
+
externalUserDTO
.
getUnionId
();
}
}
externalUserDTO
.
setMemberId
(
member
.
getMemberId
());
externalUserDTO
.
setMemberId
(
member
.
getMemberId
());
return
memberUnionidRelatedApiService
.
addExternal
(
externalUserDTO
);
return
memberUnionidRelatedApiService
.
addExternal
(
externalUserDTO
);
...
...
haoban-manage3-service/src/main/resources/mapper/MemberUnionidRelatedMapper.xml
View file @
adf7e102
...
@@ -216,14 +216,14 @@
...
@@ -216,14 +216,14 @@
<update
id=
"deleteByUnionidAndUserId"
parameterType=
"com.gic.haoban.manage.service.entity.MemberUnionidRelated"
>
<update
id=
"deleteByUnionidAndUserId"
parameterType=
"com.gic.haoban.manage.service.entity.MemberUnionidRelated"
>
update tab_haoban_member_unionid_related
update tab_haoban_member_unionid_related
set status_flag = 0
set status_flag = 0
,update_time=now()
where external_userid = #{externalUserid,jdbcType=VARCHAR}
where external_userid = #{externalUserid,jdbcType=VARCHAR}
and wx_user_id = #{wxUserId}
and wx_user_id = #{wxUserId}
</update>
</update>
<update
id=
"delMemberUnionidRelatedBatch"
parameterType=
"com.gic.haoban.manage.service.entity.MemberUnionidRelated"
>
<update
id=
"delMemberUnionidRelatedBatch"
parameterType=
"com.gic.haoban.manage.service.entity.MemberUnionidRelated"
>
update tab_haoban_member_unionid_related
update tab_haoban_member_unionid_related
set status_flag = 0
set status_flag = 0
,update_time=now()
where
where
wx_enterprise_id=#{wxEnterpriseId}
wx_enterprise_id=#{wxEnterpriseId}
and wx_user_id = #{wxUserId}
and wx_user_id = #{wxUserId}
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanClerkMainStoreRelatedMapper.xml
View file @
adf7e102
...
@@ -7,12 +7,13 @@
...
@@ -7,12 +7,13 @@
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"wx_enterprise_id"
property=
"wxEnterpriseId"
jdbcType=
"VARCHAR"
/>
<result
column=
"store_id"
property=
"storeId"
jdbcType=
"VARCHAR"
/>
<result
column=
"store_id"
property=
"storeId"
jdbcType=
"VARCHAR"
/>
<result
column=
"main_store_flag"
property=
"mainStoreFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"main_store_flag"
property=
"mainStoreFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"fresh_friend_flag"
property=
"freshFriendFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
clerk_main_store_related_id, staff_id, wx_enterprise_id, store_id, main_store_flag,
clerk_main_store_related_id, staff_id, wx_enterprise_id, store_id, main_store_flag,
fresh_friend_flag,
status_flag, create_time, update_time
status_flag, create_time, update_time
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
...
@@ -27,11 +28,12 @@
...
@@ -27,11 +28,12 @@
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated"
>
<insert
id=
"insert"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanClerkMainStoreRelated"
>
insert into tab_haoban_clerk_main_store_related (clerk_main_store_related_id, staff_id,
insert into tab_haoban_clerk_main_store_related (clerk_main_store_related_id, staff_id,
wx_enterprise_id, store_id, main_store_flag,
wx_enterprise_id, store_id, main_store_flag, fresh_friend_flag,
status_flag, create_time, update_time
status_flag, create_time, update_time
)
)
values (#{clerkMainStoreRelatedId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
values (#{clerkMainStoreRelatedId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{storeId,jdbcType=VARCHAR}, #{mainStoreFlag,jdbcType=INTEGER},
#{wxEnterpriseId,jdbcType=VARCHAR}, #{storeId,jdbcType=VARCHAR}, #{mainStoreFlag,jdbcType=INTEGER},
#{freshFriendFlag},
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
#{statusFlag,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
)
)
</insert>
</insert>
...
@@ -53,6 +55,9 @@
...
@@ -53,6 +55,9 @@
<if
test=
"mainStoreFlag != null"
>
<if
test=
"mainStoreFlag != null"
>
main_store_flag,
main_store_flag,
</if>
</if>
<if
test=
"freshFriendFlag != null"
>
fresh_friend_flag,
</if>
<if
test=
"statusFlag != null"
>
<if
test=
"statusFlag != null"
>
status_flag,
status_flag,
</if>
</if>
...
@@ -79,6 +84,9 @@
...
@@ -79,6 +84,9 @@
<if
test=
"mainStoreFlag != null"
>
<if
test=
"mainStoreFlag != null"
>
#{mainStoreFlag,jdbcType=INTEGER},
#{mainStoreFlag,jdbcType=INTEGER},
</if>
</if>
<if
test=
"freshFriendFlag != null"
>
#{freshFriendFlag},
</if>
<if
test=
"statusFlag != null"
>
<if
test=
"statusFlag != null"
>
#{statusFlag,jdbcType=INTEGER},
#{statusFlag,jdbcType=INTEGER},
</if>
</if>
...
@@ -105,6 +113,9 @@
...
@@ -105,6 +113,9 @@
<if
test=
"mainStoreFlag != null"
>
<if
test=
"mainStoreFlag != null"
>
main_store_flag = #{mainStoreFlag,jdbcType=INTEGER},
main_store_flag = #{mainStoreFlag,jdbcType=INTEGER},
</if>
</if>
<if
test=
"freshFriendFlag != null"
>
fresh_friend_flag = #{freshFriendFlag,jdbcType=INTEGER},
</if>
<if
test=
"statusFlag != null"
>
<if
test=
"statusFlag != null"
>
status_flag = #{statusFlag,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
</if>
</if>
...
@@ -123,6 +134,7 @@
...
@@ -123,6 +134,7 @@
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
wx_enterprise_id = #{wxEnterpriseId,jdbcType=VARCHAR},
store_id = #{storeId,jdbcType=VARCHAR},
store_id = #{storeId,jdbcType=VARCHAR},
main_store_flag = #{mainStoreFlag,jdbcType=INTEGER},
main_store_flag = #{mainStoreFlag,jdbcType=INTEGER},
fresh_friend_flag = #{freshFriendFlag,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
status_flag = #{statusFlag,jdbcType=INTEGER},
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP}
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanExternalClerkRelatedMapper.xml
View file @
adf7e102
...
@@ -481,4 +481,25 @@
...
@@ -481,4 +481,25 @@
and status_flag in(1,3,4)
and status_flag in(1,3,4)
order by update_time desc
order by update_time desc
</select>
</select>
<select
id=
"listByMemberIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and member_id = #{memberId}
and status_flag = 1
</select>
<select
id=
"listByWxUserIdAndWxEnterpriseId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_external_clerk_related
where wx_enterprise_id = #{wxEnterpriseId}
and enterprise_id = #{enterpriseId}
and wx_user_id = #{wxUserId}
and status_flag = 1
</select>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/TabHaobanMaterialMapper.xml
View file @
adf7e102
...
@@ -18,13 +18,14 @@
...
@@ -18,13 +18,14 @@
<result
column=
"material_desc"
property=
"materialDesc"
jdbcType=
"VARCHAR"
/>
<result
column=
"material_desc"
property=
"materialDesc"
jdbcType=
"VARCHAR"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"link"
property=
"link"
jdbcType=
"VARCHAR"
/>
<result
column=
"link"
property=
"link"
jdbcType=
"VARCHAR"
/>
<result
column=
"app_id"
property=
"appId"
jdbcType=
"VARCHAR"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
material_id,from_material_id, material_title, material_type, category_id, material_content, wx_last_upload_time,
material_id,from_material_id, material_title, material_type, category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id, staff_name, img_url, material_desc, status_flag,
media_id, wx_enterprise_id, staff_id, staff_name, img_url, material_desc, status_flag,
link, create_time, update_time,wx_img_url
link,
app_id,
create_time, update_time,wx_img_url
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
...
@@ -52,14 +53,15 @@
...
@@ -52,14 +53,15 @@
category_id, material_content, wx_last_upload_time,
category_id, material_content, wx_last_upload_time,
media_id, wx_enterprise_id, staff_id,
media_id, wx_enterprise_id, staff_id,
staff_name, img_url,wx_img_url, material_desc,
staff_name, img_url,wx_img_url, material_desc,
status_flag, link, create_time,
status_flag, link,app_id, create_time,
update_time)
update_time)
values (#{materialId,jdbcType=VARCHAR},#{fromMaterialId}, #{materialTitle,jdbcType=VARCHAR},
values (#{materialId,jdbcType=VARCHAR},#{fromMaterialId}, #{materialTitle,jdbcType=VARCHAR},
#{materialType,jdbcType=INTEGER},
#{materialType,jdbcType=INTEGER},
#{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=TIMESTAMP},
#{categoryId,jdbcType=VARCHAR}, #{materialContent,jdbcType=VARCHAR}, #{wxLastUploadTime,jdbcType=TIMESTAMP},
#{mediaId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{mediaId,jdbcType=VARCHAR}, #{wxEnterpriseId,jdbcType=VARCHAR}, #{staffId,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},#{wxImgUrl,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR},
#{staffName,jdbcType=VARCHAR}, #{imgUrl,jdbcType=VARCHAR},#{wxImgUrl,jdbcType=VARCHAR}, #{materialDesc,jdbcType=VARCHAR},
#{statusFlag,jdbcType=INTEGER}, #{link,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{statusFlag,jdbcType=INTEGER}, #{link,jdbcType=VARCHAR},#{appId,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{updateTime,jdbcType=TIMESTAMP})
#{updateTime,jdbcType=TIMESTAMP})
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanMaterial"
>
<insert
id=
"insertSelective"
parameterType=
"com.gic.haoban.manage.service.entity.TabHaobanMaterial"
>
...
@@ -216,6 +218,9 @@
...
@@ -216,6 +218,9 @@
<if
test=
"link != null"
>
<if
test=
"link != null"
>
link = #{link,jdbcType=VARCHAR},
link = #{link,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"appId != null"
>
app_id = #{appId,jdbcType=VARCHAR},
</if>
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
create_time = #{createTime,jdbcType=TIMESTAMP},
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -274,6 +279,28 @@
...
@@ -274,6 +279,28 @@
order by update_time desc
order by update_time desc
</select>
</select>
<select
id=
"listMaterialByCategoryIds"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_material
where status_flag = 1
and wx_enterprise_id = #{wxEnterpriseId}
<if
test=
"keyword != null and keyword != ''"
>
and material_title like CONCAT('%',#{keyword},'%')
</if>
<if
test=
"materialType != null"
>
and material_type = #{materialType}
</if>
<if
test=
"categoryIds != null and categoryIds.size>0"
>
and category_id in
<foreach
collection=
"categoryIds"
item=
"item"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
</if>
order by update_time desc
</select>
<select
id=
"selectByfromMaterialId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByfromMaterialId"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
select
<include
refid=
"Base_Column_List"
/>
<include
refid=
"Base_Column_List"
/>
...
...
haoban-manage3-service/src/main/resources/mapper/TabHaobanStoreRelationMapper.xml
View file @
adf7e102
...
@@ -195,4 +195,17 @@
...
@@ -195,4 +195,17 @@
where enterprise_id=#{enterpriseId}
where enterprise_id=#{enterpriseId}
and status_flag=1
and status_flag=1
</update>
</update>
<update
id=
"deleteStoreRalationByStoreIds"
>
update tab_haoban_store_relation
set
status_flag = 0,
update_time = now()
where enterprise_id=#{enterpriseId}
and store_id in
<foreach
collection=
"storeIds"
open=
"("
close=
")"
separator=
","
item=
"item"
>
#{item}
</foreach>
and status_flag=1
</update>
</mapper>
</mapper>
\ No newline at end of file
haoban-manage3-service/src/main/resources/mapper/WxEnterpriseRelatedMapper.xml
View file @
adf7e102
...
@@ -11,12 +11,13 @@
...
@@ -11,12 +11,13 @@
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"status_flag"
property=
"statusFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"wx_enterprise_type"
property=
"wxEnterpriseType"
jdbcType=
"INTEGER"
/>
<result
column=
"wx_enterprise_type"
property=
"wxEnterpriseType"
jdbcType=
"INTEGER"
/>
<result
column=
"member_open_card_flag"
property=
"memberOpenCardFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"member_open_card_flag"
property=
"memberOpenCardFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"clerk_edit_flag"
property=
"clerkEditFlag"
jdbcType=
"INTEGER"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"create_time"
property=
"createTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
<result
column=
"update_time"
property=
"updateTime"
jdbcType=
"TIMESTAMP"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
wx_enterprise_related_id, wx_enterprise_id, enterprise_id, version, status_flag, wx_enterprise_type,
wx_enterprise_related_id, wx_enterprise_id, enterprise_id, version, status_flag, wx_enterprise_type,
member_open_card
_flag,
member_open_card_flag,clerk_edit
_flag,
create_time, update_time,staff_id,staff_name
create_time, update_time,staff_id,staff_name
</sql>
</sql>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
<select
id=
"selectByPrimaryKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
...
@@ -61,6 +62,9 @@
...
@@ -61,6 +62,9 @@
<if
test=
"memberOpenCardFlag != null"
>
<if
test=
"memberOpenCardFlag != null"
>
member_open_card_flag,
member_open_card_flag,
</if>
</if>
<if
test=
"clerkEditFlag != null"
>
clerk_edit_flag,
</if>
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
create_time,
create_time,
</if>
</if>
...
@@ -96,6 +100,9 @@
...
@@ -96,6 +100,9 @@
<if
test=
"memberOpenCardFlag != null"
>
<if
test=
"memberOpenCardFlag != null"
>
#{memberOpenCardFlag,jdbcType=INTEGER},
#{memberOpenCardFlag,jdbcType=INTEGER},
</if>
</if>
<if
test=
"clerkEditFlag != null"
>
#{clerkEditFlag,jdbcType=INTEGER},
</if>
<if
test=
"createTime != null"
>
<if
test=
"createTime != null"
>
#{createTime,jdbcType=TIMESTAMP},
#{createTime,jdbcType=TIMESTAMP},
</if>
</if>
...
@@ -131,6 +138,9 @@
...
@@ -131,6 +138,9 @@
<if
test=
"memberOpenCardFlag != null"
>
<if
test=
"memberOpenCardFlag != null"
>
member_open_card_flag = #{memberOpenCardFlag,jdbcType=INTEGER},
member_open_card_flag = #{memberOpenCardFlag,jdbcType=INTEGER},
</if>
</if>
<if
test=
"clerkEditFlag != null"
>
clerk_edit_flag = #{clerkEditFlag,jdbcType=INTEGER},
</if>
<if
test=
"wxEnterpriseType != null"
>
<if
test=
"wxEnterpriseType != null"
>
wx_enterprise_type = #{wxEnterpriseType,jdbcType=INTEGER},
wx_enterprise_type = #{wxEnterpriseType,jdbcType=INTEGER},
</if>
</if>
...
...
haoban-manage3-service/src/test/java/ServiceTest.java
View file @
adf7e102
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.api.base.commons.Page
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.base.api.common.BasePageInfo
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.FlushStoreMqDTO
;
import
com.gic.haoban.manage.api.dto.FlushStoreMqDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.dto.MaterialDTO
;
import
com.gic.haoban.manage.api.dto.MemberUnionidRelatedDTO
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.enums.ChannelCodeEnum
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.api.service.*
;
import
com.gic.haoban.manage.service.service.MemberUnionRelatedService
;
import
com.gic.haoban.manage.service.service.MemberUnionRelatedService
;
...
@@ -53,24 +56,34 @@ public class ServiceTest {
...
@@ -53,24 +56,34 @@ public class ServiceTest {
@Autowired
@Autowired
private
MaterialApiService
materialApiService
;
private
MaterialApiService
materialApiService
;
@Autowired
private
CheckQywxSettingApiService
checkQywxSettingApiService
;
private
final
ExecutorService
pools
=
Executors
.
newFixedThreadPool
(
50
);
private
final
ExecutorService
pools
=
Executors
.
newFixedThreadPool
(
50
);
@Test
@Test
public
void
test11
()
{
public
void
test11
()
{
FlushStoreMqDTO
flushStoreMqDTO
=
new
FlushStoreMqDTO
();
// FlushStoreMqDTO flushStoreMqDTO = new FlushStoreMqDTO();
flushStoreMqDTO
.
setEnterpriseId
(
"testEnteroriseId"
);
// flushStoreMqDTO.setEnterpriseId("testEnteroriseId");
int
i
=
2
;
// int i = 2;
while
(
i
--
>
0
)
{
// while (i-- > 0) {
try
{
// try {
Thread
.
sleep
(
1000
);
// Thread.sleep(1000);
}
catch
(
InterruptedException
e
)
{
// } catch (InterruptedException e) {
e
.
printStackTrace
();
// e.printStackTrace();
}
// }
wxEnterpriseRelatedApiService
.
flushBindStoreByEnterpriseId
(
"ff8080815dacd3a2015dacd3ef5c0000"
,
// wxEnterpriseRelatedApiService.flushBindStoreByEnterpriseId("ff8080815dacd3a2015dacd3ef5c0000",
"-1"
,
"-1"
,
ChannelCodeEnum
.
SYNC_UNBIND
.
getCode
());
// "-1", "-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
}
// }
checkQywxSettingApiService
.
setFriendSetting
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
"宿命の战"
);
// MemberUnionidRelatedDTO dto = new MemberUnionidRelatedDTO();
// dto.setSuiteid("selfSuiteId");
// checkQywxSettingApiService.saveFriendCallback("ca66a01b79474c40b3e7c7f93daf1a3b", null, dto);
// wxEnterpriseRelatedApiService.flushBindStoreByEnterpriseId("ff808081593917d90159398ec6340012",
// "ca66a01b79474c40b3e7c7f93daf1a3b", "-1", ChannelCodeEnum.SYNC_UNBIND.getCode());
// List<String> ids = new ArrayList<>();
// List<String> ids = new ArrayList<>();
// ids.add("8f5ddb9df0a54332acfa2d5804e90c64");
// ids.add("8f5ddb9df0a54332acfa2d5804e90c64");
...
@@ -82,14 +95,13 @@ public class ServiceTest {
...
@@ -82,14 +95,13 @@ public class ServiceTest {
// System.out.println(JSONObject.toJSONString(response));
// System.out.println(JSONObject.toJSONString(response));
}
}
@Test
@Test
public
void
test
()
{
public
void
sendMessage
()
{
List
<
String
>
staffIds
=
new
ArrayList
<>();
List
<
String
>
staffIds
=
new
ArrayList
<>();
staffIds
.
add
(
"0006ae5de6484cf9b55072d2d967c481"
);
staffIds
.
add
(
"0006ae5de6484cf9b55072d2d967c481"
);
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
GicMQClient
clientInstance
=
GICMQClientUtil
.
getClientInstance
();
try
{
try
{
clientInstance
.
sendMessage
(
"haoban3OrderBackForFaceMq"
,
"11111"
);
clientInstance
.
sendMessage
(
"haoban3OrderBackForFaceMq"
,
"11111"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -107,6 +119,15 @@ public class ServiceTest {
...
@@ -107,6 +119,15 @@ public class ServiceTest {
}
}
@Test
public
void
test
()
{
BasePageInfo
basePageInfo
=
new
BasePageInfo
();
Page
<
MaterialDTO
>
ret
=
materialApiService
.
listMaterial
(
"ca66a01b79474c40b3e7c7f93daf1a3b"
,
null
,
"-1"
,
1
,
basePageInfo
);
System
.
out
.
println
(
ret
);
}
//// @Test
//// @Test
//// public void test1() {
//// public void test1() {
//// String res = qywxUserApiService.leaveClerkExternal("ww9ede832a84b7ae5f"
//// String res = qywxUserApiService.leaveClerkExternal("ww9ede832a84b7ae5f"
...
...
haoban-manage3-service/src/test/java/test.java
View file @
adf7e102
...
@@ -7,10 +7,15 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -7,10 +7,15 @@ import org.apache.commons.lang3.StringUtils;
public
class
test
{
public
class
test
{
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
key
=
"3.2.1"
;
// String key = "3.2.1";
String
[]
split
=
key
.
split
(
"."
);
// String[] split = key.split(".");
//
// System.out.println(split[1]);
System
.
out
.
println
(
split
[
1
]);
Integer
num
=
2
;
int
i
=
2
&
4
;
System
.
out
.
println
(
i
);
//
//
// //插入不存在的我们pre表的企业微信数据
// //插入不存在的我们pre表的企业微信数据
// int pageSize = 500;
// int pageSize = 500;
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/GicDepartmentController.java
View file @
adf7e102
...
@@ -51,6 +51,7 @@ public class GicDepartmentController extends WebBaseController{
...
@@ -51,6 +51,7 @@ public class GicDepartmentController extends WebBaseController{
Map
<
String
,
StoreRangeInfoDTO
>
storeRangeMap
=
new
HashMap
<>();
Map
<
String
,
StoreRangeInfoDTO
>
storeRangeMap
=
new
HashMap
<>();
if
(
CollectionUtils
.
isNotEmpty
(
rangeInfoDTOList
))
{
if
(
CollectionUtils
.
isNotEmpty
(
rangeInfoDTOList
))
{
List
<
WxEnterpriseDTO
>
wxEnterpriseDTOS
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
enterpriseId
);
List
<
WxEnterpriseDTO
>
wxEnterpriseDTOS
=
wxEnterpriseRelatedApiService
.
listWxEnterpriseByEid
(
enterpriseId
);
if
(
CollectionUtils
.
isNotEmpty
(
wxEnterpriseDTOS
))
{
Map
<
String
,
WxEnterpriseDTO
>
wxEnterpriseDTOMap
=
wxEnterpriseDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getWxEnterpriseId
(),
dto
->
dto
));
Map
<
String
,
WxEnterpriseDTO
>
wxEnterpriseDTOMap
=
wxEnterpriseDTOS
.
stream
().
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getWxEnterpriseId
(),
dto
->
dto
));
storeRangeMap
=
rangeInfoDTOList
.
stream
().
filter
(
dto
->
(!
dto
.
getWxEnterpriseId
().
equals
(
wxEnterpriseId
))
&&
dto
.
getRelationType
()
==
1
)
storeRangeMap
=
rangeInfoDTOList
.
stream
().
filter
(
dto
->
(!
dto
.
getWxEnterpriseId
().
equals
(
wxEnterpriseId
))
&&
dto
.
getRelationType
()
==
1
)
...
@@ -59,6 +60,7 @@ public class GicDepartmentController extends WebBaseController{
...
@@ -59,6 +60,7 @@ public class GicDepartmentController extends WebBaseController{
return
dto
;
return
dto
;
}).
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getRelationId
(),
dto
->
dto
));
}).
collect
(
Collectors
.
toMap
(
dto
->
dto
.
getRelationId
(),
dto
->
dto
));
}
}
}
Map
<
String
,
StoreRangeInfoDTO
>
finalStoreRangeMap
=
storeRangeMap
;
Map
<
String
,
StoreRangeInfoDTO
>
finalStoreRangeMap
=
storeRangeMap
;
List
<
StoreGroupVo
>
ret
=
departmentList
.
stream
().
map
(
dto
->
{
List
<
StoreGroupVo
>
ret
=
departmentList
.
stream
().
map
(
dto
->
{
StoreRangeInfoDTO
mid
=
finalStoreRangeMap
.
get
(
dto
.
getStoreGroupId
());
StoreRangeInfoDTO
mid
=
finalStoreRangeMap
.
get
(
dto
.
getStoreGroupId
());
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/StaffController.java
View file @
adf7e102
...
@@ -84,6 +84,9 @@ public class StaffController extends WebBaseController{
...
@@ -84,6 +84,9 @@ public class StaffController extends WebBaseController{
@Autowired
@Autowired
private
EnterpriseService
enterpriseService
;
private
EnterpriseService
enterpriseService
;
@Autowired
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
@RequestMapping
(
"staff-add"
)
@RequestMapping
(
"staff-add"
)
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
){
public
HaobanResponse
staffAdd
(
StaffDTO
staffDTO
,
String
departmentIds
){
...
@@ -293,6 +296,19 @@ public class StaffController extends WebBaseController{
...
@@ -293,6 +296,19 @@ public class StaffController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10007
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10007
);
}
}
List
<
StaffClerkInfoDTO
>
retList
=
staffClerkRelationApiService
.
listBindDetailByStaffId
(
staffId
);
List
<
StaffClerkInfoDTO
>
retList
=
staffClerkRelationApiService
.
listBindDetailByStaffId
(
staffId
);
if
(
CollectionUtils
.
isEmpty
(
retList
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
ClerkMainStoreRelatedDTO
mainStoreRelatedDTO
=
clerkMainStoreRelatedApiService
.
getWxEnterpriseIdAndStaffId
(
staff
.
getWxEnterpriseId
(),
staffId
);
if
(
null
!=
mainStoreRelatedDTO
)
{
retList
.
forEach
(
dto
->
{
if
(
dto
.
getStoreId
().
equals
(
mainStoreRelatedDTO
.
getStoreId
()))
{
dto
.
setMainStoreFlag
(
1
);
}
else
{
dto
.
setMainStoreFlag
(
0
);
}
});
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
retList
);
}
}
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/WxEnterpriseController.java
View file @
adf7e102
...
@@ -838,4 +838,24 @@ public class WxEnterpriseController extends WebBaseController{
...
@@ -838,4 +838,24 @@ public class WxEnterpriseController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
* 授权绑定-设置导购编辑权限
*
* @return
*/
@IgnoreLogin
@RequestMapping
(
"set-clerk-edit"
)
public
HaobanResponse
setClerkEdit
(
String
wxEnterprieseRelatedId
,
int
clerkEditFlag
)
{
if
(
StringUtils
.
isBlank
(
wxEnterprieseRelatedId
))
{
logger
.
info
(
"缺少参数"
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
boolean
b
=
wxEnterpriseRelatedApiService
.
setClerkEditFlag
(
wxEnterprieseRelatedId
,
clerkEditFlag
);
if
(
b
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
else
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100032
);
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
adf7e102
...
@@ -117,6 +117,7 @@ public enum HaoBanErrCode {
...
@@ -117,6 +117,7 @@ public enum HaoBanErrCode {
ERR_100021
(
100021
,
"创建任务失败"
),
ERR_100021
(
100021
,
"创建任务失败"
),
ERR_100031
(
100031
,
"该小程序已经绑定过,不能重复绑定"
),
ERR_100031
(
100031
,
"该小程序已经绑定过,不能重复绑定"
),
ERR_100032
(
100032
,
"代理不能设置导购编辑权限"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_OTHER
(-
999
,
"未知错误code"
);
ERR_OTHER
(-
999
,
"未知错误code"
);
...
...
haoban-manage3-web/src/main/webapp/WEB-INF/dubbo-haoban-manage-web.xml
View file @
adf7e102
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService"
id=
"wxEnterpriseRelatedApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseRelatedApiService"
id=
"wxEnterpriseRelatedApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.ApplicationApiService"
id=
"applicationApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.ApplicationApiService"
id=
"applicationApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
id=
"wxEnterpriseApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.WxEnterpriseApiService"
id=
"wxEnterpriseApiService"
/>
<dubbo:reference
interface=
"com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService"
id=
"clerkMainStoreRelatedApiService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.EnterpriseService"
id=
"enterpriseService"
/>
<dubbo:reference
interface=
"com.gic.enterprise.api.service.EnterpriseService"
id=
"enterpriseService"
/>
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
adf7e102
...
@@ -113,7 +113,7 @@ public class ClerkController extends WebBaseController{
...
@@ -113,7 +113,7 @@ public class ClerkController extends WebBaseController{
//门店成员列表
//门店成员列表
@RequestMapping
(
"/store-clerks"
)
@RequestMapping
(
"/store-clerks"
)
public
HaobanResponse
storeClerks
(
String
storeId
)
{
public
HaobanResponse
storeClerks
(
String
wxEnterpriseId
,
String
storeId
,
String
version
)
{
if
(
StringUtils
.
isAnyBlank
(
storeId
)){
if
(
StringUtils
.
isAnyBlank
(
storeId
)){
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
return
resultResponse
(
HaoBanErrCode
.
ERR_2
);
}
}
...
@@ -143,9 +143,19 @@ public class ClerkController extends WebBaseController{
...
@@ -143,9 +143,19 @@ public class ClerkController extends WebBaseController{
}
}
resultList
.
add
(
vo
);
resultList
.
add
(
vo
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultList
);
if
(
StringUtils
.
isBlank
(
version
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
resultList
);
}
else
{
WxEnterpriseRelationDetailDTO
enterpriseBindInfo
=
wxEnterpriseRelatedApiService
.
getEnterpriseBindInfo
(
wxEnterpriseId
,
storeDTO
.
getEnterpriseId
());
Map
<
String
,
Object
>
ret
=
new
HashMap
<>();
ret
.
put
(
"clerkEditFlag"
,
enterpriseBindInfo
.
getClerkEditFlag
());
ret
.
put
(
"clerkList"
,
resultList
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
ret
);
}
}
}
//获取后台认证配置
//获取后台认证配置
@RequestMapping
(
"/get-audit-setting"
)
@RequestMapping
(
"/get-audit-setting"
)
public
HaobanResponse
getAuditSetting
(
String
wxEnterpriseId
)
{
public
HaobanResponse
getAuditSetting
(
String
wxEnterpriseId
)
{
...
@@ -186,7 +196,7 @@ public class ClerkController extends WebBaseController{
...
@@ -186,7 +196,7 @@ public class ClerkController extends WebBaseController{
}
}
auditSettingVO
.
setMemberOpenCardFlag
(
enterpriseBindInfo
.
getMemberOpenCardFlag
());
auditSettingVO
.
setMemberOpenCardFlag
(
enterpriseBindInfo
.
getMemberOpenCardFlag
());
auditSettingVO
.
setWxEnterpriseType
(
enterpriseBindInfo
.
getWxEnterpriseType
());
auditSettingVO
.
setWxEnterpriseType
(
enterpriseBindInfo
.
getWxEnterpriseType
());
auditSettingVO
.
setFreshFriendFlag
(
mainStore
.
getFreshFriendFlag
());
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
auditSettingVO
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
auditSettingVO
);
}
}
...
@@ -399,6 +409,33 @@ public class ClerkController extends WebBaseController{
...
@@ -399,6 +409,33 @@ public class ClerkController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
* 删除设置主门店和刷新微信好友的缓存限制
*
* @param staffId : 关联标识
* @param dateTime : 时间, 13位时间戳
* @param type : 类型, 1 : 主门店, 2 : 刷新微信好友
*/
@RequestMapping
(
"/delCache"
)
public
void
deleteCache
(
String
staffId
,
Long
dateTime
,
Integer
type
)
{
if
(
StringUtils
.
isBlank
(
staffId
)
||
dateTime
==
null
||
type
==
null
)
{
return
;
}
String
yyyyMM
=
DateUtil
.
dateToStr
(
new
Date
(
dateTime
),
"yyyyMM"
);
String
key
=
null
;
//设置主门店缓存
if
(
Objects
.
equals
(
type
,
1
))
{
key
=
"haoban_set_main_store_"
+
yyyyMM
+
staffId
;
}
if
(
Objects
.
equals
(
type
,
2
))
{
key
=
"haoban_fresh_wx_friend"
+
yyyyMM
+
staffId
;
}
if
(
StringUtils
.
isBlank
(
key
))
{
return
;
}
RedisUtil
.
delCache
(
key
);
}
//设置主导购
//设置主导购
@HttpLimit
@HttpLimit
...
@@ -435,8 +472,6 @@ public class ClerkController extends WebBaseController{
...
@@ -435,8 +472,6 @@ public class ClerkController extends WebBaseController{
logger
.
info
(
"次数超出限制:{}"
,
staffId
);
logger
.
info
(
"次数超出限制:{}"
,
staffId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10011
);
}
}
RedisUtil
.
setCache
(
key
,
count
+
1
,
31
*
24
*
60
*
60L
);
if
(
flushType
==
0
)
{
if
(
flushType
==
0
)
{
String
taskName
=
"刷新企业微信好友("
+
staff
.
getStaffName
()+
")"
;
String
taskName
=
"刷新企业微信好友("
+
staff
.
getStaffName
()+
")"
;
String
taskId
=
dealSyncOperationApiService
.
createWxFriendTaskSingle
(
wxEnterpriseId
,
taskName
,
staffId
,
staff
.
getStaffName
(),
SyncTaskTypeEnum
.
FRIEND_SINGLE
.
getType
());
String
taskId
=
dealSyncOperationApiService
.
createWxFriendTaskSingle
(
wxEnterpriseId
,
taskName
,
staffId
,
staff
.
getStaffName
(),
SyncTaskTypeEnum
.
FRIEND_SINGLE
.
getType
());
...
@@ -454,9 +489,27 @@ public class ClerkController extends WebBaseController{
...
@@ -454,9 +489,27 @@ public class ClerkController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_10022
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10022
);
}
}
}
}
RedisUtil
.
setCache
(
key
,
count
+
1
,
31
*
24
*
60
*
60L
);
//刷新状态变更
clerkMainStoreRelatedApiService
.
setFreshFriend
(
wxEnterpriseId
,
staffId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
/**
* 刷新好友状态
*
* @param staffId
* @param storeId
* @param wxEnterpriseId
* @return
*/
@HttpLimit
@RequestMapping
(
"/check-fresh-friend"
)
public
HaobanResponse
checkFreshFriend
(
String
staffId
,
String
storeId
,
String
wxEnterpriseId
)
{
boolean
freshFriendSyncTask
=
dealSyncOperationApiService
.
getFreshFriendSyncTask
(
wxEnterpriseId
,
staffId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
freshFriendSyncTask
);
}
//获取门店详情
//获取门店详情
public
boolean
isEnterpriseOver
(
String
eid
)
{
public
boolean
isEnterpriseOver
(
String
eid
)
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/vo/AuditSettingVO.java
View file @
adf7e102
...
@@ -20,9 +20,18 @@ public class AuditSettingVO implements Serializable {
...
@@ -20,9 +20,18 @@ public class AuditSettingVO implements Serializable {
private
int
wxEnterpriseType
;
private
int
wxEnterpriseType
;
private
int
memberOpenCardFlag
;
private
int
memberOpenCardFlag
;
private
int
freshFriendFlag
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
public
int
getFreshFriendFlag
()
{
return
freshFriendFlag
;
}
public
void
setFreshFriendFlag
(
int
freshFriendFlag
)
{
this
.
freshFriendFlag
=
freshFriendFlag
;
}
public
int
getWxEnterpriseType
()
{
public
int
getWxEnterpriseType
()
{
return
wxEnterpriseType
;
return
wxEnterpriseType
;
}
}
...
...
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