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
168e7272
Commit
168e7272
authored
Apr 16, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0.git
into developer
parents
5027d886
a0f6dd8b
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
75 additions
and
48 deletions
+75
-48
pom.xml
haoban-manage3-service/pom.xml
+7
-0
DealSyncOperationApiServiceImpl.java
...ice/service/out/impl/DealSyncOperationApiServiceImpl.java
+1
-1
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+9
-27
StaffApiServiceImpl.java
.../manage/service/service/out/impl/StaffApiServiceImpl.java
+25
-6
QywxGroupSyncOperation.java
...ic/haoban/manage/service/task/QywxGroupSyncOperation.java
+1
-1
dubbo-haoban-manage-service.xml
...ervice/src/main/resources/dubbo-haoban-manage-service.xml
+5
-2
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+5
-5
ClerkController.java
...com/gic/haoban/manage/web/controller/ClerkController.java
+21
-6
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+1
-0
No files found.
haoban-manage3-service/pom.xml
View file @
168e7272
...
@@ -115,6 +115,13 @@
...
@@ -115,6 +115,13 @@
<version>
3.0-SNAPSHOT
</version>
<version>
3.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.gic
</groupId>
<artifactId>
gic-thirdparty-api
</artifactId>
<version>
${gic-thirdparty-api}
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DealSyncOperationApiServiceImpl.java
View file @
168e7272
...
@@ -479,7 +479,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
...
@@ -479,7 +479,7 @@ public class DealSyncOperationApiServiceImpl implements DealSyncOperationApiServ
TabHaobanPreDealLog
dealLog
=
new
TabHaobanPreDealLog
();
TabHaobanPreDealLog
dealLog
=
new
TabHaobanPreDealLog
();
dealLog
.
setDataId
(
dto
.
getId
().
toString
());
dealLog
.
setDataId
(
dto
.
getId
().
toString
());
dealLog
.
setpDataId
(
dto
.
getParentid
().
toString
());
dealLog
.
setpDataId
(
dto
.
getParentid
().
toString
());
dealLog
.
setDataType
(
1
);
dealLog
.
setDataType
(
0
);
dealLog
.
setStatusFlag
(
0
);
dealLog
.
setStatusFlag
(
0
);
dealLog
.
setTaskId
(
taskId
);
dealLog
.
setTaskId
(
taskId
);
dealLog
.
setDataContent
(
JSONObject
.
toJSONString
(
dto
));
dealLog
.
setDataContent
(
JSONObject
.
toJSONString
(
dto
));
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
168e7272
...
@@ -485,27 +485,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -485,27 +485,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Override
@Override
public
void
initwxDepartment
(
String
corpid
,
String
contactSecret
,
String
wxEnterpriseId
)
{
public
void
initwxDepartment
(
String
corpid
,
String
contactSecret
,
String
wxEnterpriseId
)
{
// List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listDepartment(corpid, suiteid, null);
logger
.
info
(
"【同步企业微信】wxEnterpriseId={}"
,
wxEnterpriseId
);
//
// com.gic.wechat.api.dto.qywx.DepartmentDTO rootDepartment = null;
// for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO : list) {
// if("0".equals(departmentDTO.getParentid())){
// rootDepartment = departmentDTO;
// break;
// }
// }
//
// String parentId = addDepartment(rootDepartment, wxEnterpriseId, null,corpid,suiteid);
// List<com.gic.wechat.api.dto.qywx.DepartmentDTO> subList = new ArrayList<>();
// for (com.gic.wechat.api.dto.qywx.DepartmentDTO departmentDTO : list) {
// if(rootDepartment.getId().equals(departmentDTO.getParentid())){
// subList.add(departmentDTO);
// }
// }
//
// DepartmentDTO parent = EntityUtil.changeEntityByJSON(DepartmentDTO.class,departmentService.selectById(parentId));
// this.addSon(subList, wxEnterpriseId, parent,corpid,suiteid);
logger
.
info
(
"【同步企业微信】wxEnterpriseId={}"
,
"init-enterprise-"
+
wxEnterpriseId
);
logger
.
info
(
"【同步企业微信】wxEnterpriseId={}"
,
"init-enterprise-"
+
wxEnterpriseId
);
String
key
=
"init-enterprise-"
+
wxEnterpriseId
;
String
key
=
"init-enterprise-"
+
wxEnterpriseId
;
if
(
RedisUtil
.
getCache
(
key
)
==
null
){
if
(
RedisUtil
.
getCache
(
key
)
==
null
){
...
@@ -519,9 +498,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -519,9 +498,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
else
{
}
else
{
RedisUtil
.
delCache
(
key
);
RedisUtil
.
delCache
(
key
);
}
}
//RedisUtil.lock("init_enterprise_" + wxEnterpriseId,60 * 60L);
//insertMQ(0,wxEnterpriseId, corpid,contactSecret,taskId);
// String taskId = StringUtil.randomUUID();
//RedisUtil.unlock("init_enterprise_" + wxEnterpriseId);
// List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listSelfDepartment(corpid, contactSecret, null);
// logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
// if(CollectionUtils.isNotEmpty(list)){
// this.addAllDepartment(list, 0, wxEnterpriseId, corpid, contactSecret,taskId);
// }
}
}
...
@@ -628,7 +612,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -628,7 +612,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Override
@Override
public
boolean
isInitLocked
(
String
wxEnterpriseId
){
public
boolean
isInitLocked
(
String
wxEnterpriseId
){
return
RedisUtil
.
isLocked
(
"init
_enterprise_
"
+
wxEnterpriseId
);
return
RedisUtil
.
isLocked
(
"init
-enterprise-
"
+
wxEnterpriseId
);
}
}
...
@@ -765,8 +749,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
...
@@ -765,8 +749,6 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if
(
enterpriseDTO
!=
null
){
if
(
enterpriseDTO
!=
null
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
){
this
.
initwxDepartment
(
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getContactSecret
(),
enterpriseDTO
.
getWxEnterpriseId
());
this
.
initwxDepartment
(
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getContactSecret
(),
enterpriseDTO
.
getWxEnterpriseId
());
enterpriseDTO
.
setContactFlag
(
1
);
this
.
wxEnterpriseService
.
update
(
enterpriseDTO
);
}
}
}
}
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/StaffApiServiceImpl.java
View file @
168e7272
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
package
com
.
gic
.
haoban
.
manage
.
service
.
service
.
out
.
impl
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Collection
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.HashSet
;
import
java.util.HashSet
;
...
@@ -11,15 +12,16 @@ import java.util.Set;
...
@@ -11,15 +12,16 @@ import java.util.Set;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.
ToolUtil
;
import
com.gic.commons.util.
GlobalInfo
;
import
com.gic.
haoban.base.api.common.Constant
;
import
com.gic.
commons.util.GlobalVar
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.service.util.EmojiFilterUtil
;
import
com.gic.thirdparty.api.dto.PicUploadResDTO
;
import
com.gic.thirdparty.api.service.QQCloudPicService
;
import
com.vdurmont.emoji.EmojiParser
;
import
com.vdurmont.emoji.EmojiParser
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.hibernate.hql.internal.CollectionSubqueryFactory
;
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
;
...
@@ -98,6 +100,9 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -98,6 +100,9 @@ public class StaffApiServiceImpl implements StaffApiService {
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
private
WxEnterpriseRelatedApiService
wxEnterpriseRelatedApiService
;
@Autowired
@Autowired
private
SyncErrorLogService
syncErrorLogService
;
private
SyncErrorLogService
syncErrorLogService
;
@Autowired
private
QQCloudPicService
qqCloudPicService
;
@Override
@Override
public
StaffDTO
selectById
(
String
staffId
)
{
public
StaffDTO
selectById
(
String
staffId
)
{
...
@@ -936,7 +941,8 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -936,7 +941,8 @@ public class StaffApiServiceImpl implements StaffApiService {
}
}
//修改
//修改
}
else
{
}
else
{
staff
.
setHeadImg
(
clerkDTO
.
getHeadImgUrl
());
String
url
=
changeHeaderImageUrl
(
clerkDTO
.
getHeadImgUrl
());
staff
.
setHeadImg
(
url
);
staff
.
setSex
(
clerkDTO
.
getClerkGender
());
staff
.
setSex
(
clerkDTO
.
getClerkGender
());
//staff.setPostion(postion);
//staff.setPostion(postion);
// staff.setStaffName(staffName);
// staff.setStaffName(staffName);
...
@@ -978,6 +984,19 @@ public class StaffApiServiceImpl implements StaffApiService {
...
@@ -978,6 +984,19 @@ public class StaffApiServiceImpl implements StaffApiService {
return
response
;
return
response
;
}
}
private
String
changeHeaderImageUrl
(
String
headImgUrl
)
{
try
{
InputStream
in
=
new
URL
(
headImgUrl
).
openStream
();
byte
[]
data
=
IOUtils
.
toByteArray
(
in
);
PicUploadResDTO
uploadPic
=
qqCloudPicService
.
uploadPic
(
GlobalVar
.
ctxPropertiesMap
.
get
(
GlobalInfo
.
QQPIC_KEY_ENTERPRISE
),
data
);
logger
.
info
(
"腾讯云万象优图返回"
+
JSON
.
toJSONString
(
uploadPic
));
return
uploadPic
.
downloadUrl
;
}
catch
(
Exception
e
){
logger
.
info
(
"上传腾讯云万象优图返回失败了:"
,
e
);
return
headImgUrl
;
}
}
/**
/**
* 删除企业微信
* 删除企业微信
*
*
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/task/QywxGroupSyncOperation.java
View file @
168e7272
...
@@ -98,7 +98,7 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
...
@@ -98,7 +98,7 @@ public class QywxGroupSyncOperation implements BaseSyncOperation {
TabHaobanDepartment
department
=
departmentService
.
getByWxId
(
dealParamMqDTO
.
getData
(),
dataPre
.
getWxEnterpriseId
());
TabHaobanDepartment
department
=
departmentService
.
getByWxId
(
dealParamMqDTO
.
getData
(),
dataPre
.
getWxEnterpriseId
());
if
(
department
!=
null
)
{
if
(
department
!=
null
)
{
logger
.
info
(
"已经同步过了:{}"
,
dataPre
.
getDataId
());
logger
.
info
(
"已经同步过了:{}"
,
dataPre
.
getDataId
());
dealException
(
dealParamMqDTO
.
getTaskId
(),
dealParamMqDTO
.
getData
(),
dataPre
.
getEnterpriseId
(),
dealParamMqDTO
.
getData
()
+
":该部门
不
存在"
);
dealException
(
dealParamMqDTO
.
getTaskId
(),
dealParamMqDTO
.
getData
(),
dataPre
.
getEnterpriseId
(),
dealParamMqDTO
.
getData
()
+
":该部门存在"
);
return
;
return
;
}
}
...
...
haoban-manage3-service/src/main/resources/dubbo-haoban-manage-service.xml
View file @
168e7272
...
@@ -56,6 +56,8 @@
...
@@ -56,6 +56,8 @@
<dubbo:reference
interface=
"com.gic.member.api.service.MemberOpenCardBusinessService"
id=
"memberOpenCardBusinessService"
/>
<dubbo:reference
interface=
"com.gic.member.api.service.MemberOpenCardBusinessService"
id=
"memberOpenCardBusinessService"
/>
<dubbo:reference
id=
"eSDataDynamicOperationApiService"
interface=
"com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService"
timeout=
"10000"
/>
<dubbo:reference
id=
"eSDataDynamicOperationApiService"
interface=
"com.gic.search.engine.api.service.dynamic.ESDataDynamicOperationApiService"
timeout=
"10000"
/>
<dubbo:reference
id=
"qqCloudPicService"
interface=
"com.gic.thirdparty.api.service.QQCloudPicService"
timeout=
"10000"
retries=
"0"
check=
"false"
/>
</beans>
</beans>
\ No newline at end of file
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
168e7272
...
@@ -109,7 +109,9 @@ public class ApplicationController extends WebBaseController{
...
@@ -109,7 +109,9 @@ public class ApplicationController extends WebBaseController{
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
enterpriseDTO
!=
null
){
if
(
enterpriseDTO
!=
null
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
&&
enterpriseDTO
.
getContactFlag
()
==
0
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
&&
enterpriseDTO
.
getContactFlag
()
==
0
){
// this.departmentApiService.initwxDepartmentMQ(enterpriseDTO.getWxEnterpriseId());
// enterpriseDTO.setContactFlag(1);
// wxEnterpriseApiService.update(enterpriseDTO);
log
.
info
(
"【初始化部门调用】{},{},{}"
,
RouterConstant
.
INIT_WX_DEPARTMENT_SERVICENAME
,
RouterConstant
.
INIT_WX_DEPARTMENT_METHODNAME
,
wxEnterpriseId
);
log
.
info
(
"【初始化部门调用】{},{},{}"
,
RouterConstant
.
INIT_WX_DEPARTMENT_SERVICENAME
,
RouterConstant
.
INIT_WX_DEPARTMENT_METHODNAME
,
wxEnterpriseId
);
try
{
try
{
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
wxEnterpriseId
,
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
wxEnterpriseId
,
...
@@ -130,7 +132,7 @@ public class ApplicationController extends WebBaseController{
...
@@ -130,7 +132,7 @@ public class ApplicationController extends WebBaseController{
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
enterpriseDTO
!=
null
){
if
(
enterpriseDTO
!=
null
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
){
//
log
.
info
(
"【初始化部门调用】{},{},{}"
,
RouterConstant
.
INIT_WX_DEPARTMENT_SERVICENAME
,
RouterConstant
.
INIT_WX_DEPARTMENT_METHODNAME
,
wxEnterpriseId
);
log
.
info
(
"【初始化部门调用】{},{},{}"
,
RouterConstant
.
INIT_WX_DEPARTMENT_SERVICENAME
,
RouterConstant
.
INIT_WX_DEPARTMENT_METHODNAME
,
wxEnterpriseId
);
try
{
try
{
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
wxEnterpriseId
,
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
wxEnterpriseId
,
...
@@ -138,9 +140,7 @@ public class ApplicationController extends WebBaseController{
...
@@ -138,9 +140,7 @@ public class ApplicationController extends WebBaseController{
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
getMessage
(),
e
);
log
.
info
(
e
.
getMessage
(),
e
);
}
}
//this.departmentApiService.initwxDepartmentMQ(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
// this.departmentApiService.initwxDepartment(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
// enterpriseDTO.setContactFlag(1);
// wxEnterpriseApiService.update(enterpriseDTO);
}
}
}
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/ClerkController.java
View file @
168e7272
...
@@ -16,12 +16,15 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -16,12 +16,15 @@ import org.springframework.web.bind.annotation.RestController;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.csp.sentinel.util.StringUtil
;
import
com.alibaba.csp.sentinel.util.StringUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.dto.ClerkDTO
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.clerk.api.service.ClerkService
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.DateUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.dto.StoreDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.enterprise.api.service.StoreService
;
import
com.gic.haoban.app.customer.service.api.service.DistributeApiService
;
import
com.gic.haoban.app.customer.service.api.service.DistributeApiService
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
...
@@ -30,17 +33,20 @@ import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
...
@@ -30,17 +33,20 @@ import com.gic.haoban.communicate.api.service.SyncHaobanToGicServiceApi;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO
;
import
com.gic.haoban.manage.api.dto.WxEnterpriseDTO
;
import
com.gic.haoban.manage.api.service.BindApiService
;
import
com.gic.haoban.manage.api.service.BindApiService
;
import
com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService
;
import
com.gic.haoban.manage.api.service.ClerkMainStoreRelatedApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.DepartmentApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.StaffDepartmentRelatedApiService
;
import
com.gic.haoban.manage.api.service.WxEnterpriseApiService
;
import
com.gic.haoban.manage.web.anno.HttpLimit
;
import
com.gic.haoban.manage.web.anno.HttpLimit
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.interceptor.WebInterceptor
;
import
com.gic.haoban.manage.web.interceptor.WebInterceptor
;
import
com.gic.haoban.manage.web.vo.ClerkVo
;
import
com.gic.haoban.manage.web.vo.ClerkVo
;
import
com.gic.haoban.manage.web.vo.StoreVO
;
import
com.gic.haoban.manage.web.vo.StoreVO
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.service.qywx.QywxUserApiService
;
@RestController
@RestController
public
class
ClerkController
extends
WebBaseController
{
public
class
ClerkController
extends
WebBaseController
{
...
@@ -64,6 +70,10 @@ public class ClerkController extends WebBaseController{
...
@@ -64,6 +70,10 @@ public class ClerkController extends WebBaseController{
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
private
ClerkMainStoreRelatedApiService
clerkMainStoreRelatedApiService
;
@Autowired
@Autowired
private
DistributeApiService
distributeApiService
;
private
DistributeApiService
distributeApiService
;
@Autowired
private
QywxUserApiService
qywxUserApiService
;
@Autowired
private
WxEnterpriseApiService
wxEnterpriseApiService
;
//导购列表
//导购列表
@RequestMapping
(
"/clerk-list"
)
@RequestMapping
(
"/clerk-list"
)
...
@@ -331,13 +341,18 @@ public class ClerkController extends WebBaseController{
...
@@ -331,13 +341,18 @@ public class ClerkController extends WebBaseController{
if
(
staff
==
null
){
if
(
staff
==
null
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
}
String
key
=
"haoban_set_main_store_"
+
yyyyMM
+
staffId
;
String
key
=
"haoban_fresh_wx_friend"
+
yyyyMM
+
staffId
;
Object
hasSet
=
RedisUtil
.
getCache
(
key
);
Integer
count
=
RedisUtil
.
getCache
(
key
)
==
null
?
0
:
(
Integer
)
RedisUtil
.
getCache
(
key
);
if
(
hasSet
==
null
){
if
(
count
==
null
||
count
<
4
){
RedisUtil
.
setCache
(
key
,
true
,
31
*
24
*
60
*
60
l
);
WxEnterpriseDTO
enterprise
=
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
clerkMainStoreRelatedApiService
.
setMainStore
(
staffId
,
storeId
,
wxEnterpriseId
);
RedisUtil
.
setCache
(
key
,
count
+
1
,
31
*
24
*
60
*
60
l
);
String
res
=
qywxUserApiService
.
listSelfExternalUserid
(
enterprise
.
getCorpid
(),
enterprise
.
getWxSecretKey
(),
staff
.
getWxUserId
());
JSONObject
json
=
JSON
.
parseObject
(
res
);
if
(
"0"
.
equals
(
json
.
getString
(
"errcode"
))){
}
}
else
{
}
else
{
return
resultResponse
(
HaoBanErrCode
.
ERR_100
07
);
return
resultResponse
(
HaoBanErrCode
.
ERR_100
11
);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
168e7272
...
@@ -193,6 +193,7 @@ public enum HaoBanErrCode {
...
@@ -193,6 +193,7 @@ public enum HaoBanErrCode {
ERR_10009
(
10009
,
"门店不存在"
),
ERR_10009
(
10009
,
"门店不存在"
),
ERR_10010
(
10010
,
"gic新增失败"
),
ERR_10010
(
10010
,
"gic新增失败"
),
ERR_10011
(
10011
,
"每月最多可刷新4次"
),
ERR_999
(
999
,
"操作失败"
),
ERR_999
(
999
,
"操作失败"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
...
...
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