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
1a46a4e5
Commit
1a46a4e5
authored
Apr 14, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
2e1f6cab
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
1 deletions
+78
-1
DepartmentApiService.java
...m/gic/haoban/manage/api/service/DepartmentApiService.java
+2
-0
DepartmentApiServiceImpl.java
...ge/service/service/out/impl/DepartmentApiServiceImpl.java
+18
-1
ApplicationController.java
...c/haoban/manage/web/controller/ApplicationController.java
+27
-0
RouterConstant.java
.../java/com/gic/haoban/manage/web/utils/RouterConstant.java
+31
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DepartmentApiService.java
View file @
1a46a4e5
...
...
@@ -159,4 +159,6 @@ public interface DepartmentApiService {
*/
ServiceResponse
<
List
<
DepartmentDTO
>>
listStoreListByStaffId
(
String
wxUserId
);
void
initwxDepartmentMQ
(
String
res
);
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DepartmentApiServiceImpl.java
View file @
1a46a4e5
...
...
@@ -523,6 +523,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
}
for
(
com
.
gic
.
wechat
.
api
.
dto
.
qywx
.
DepartmentDTO
departmentDTO
:
list
){
try
{
if
(
parentId
.
equals
(
departmentDTO
.
getParentid
()))
{
TabHaobanDepartment
exist
=
this
.
departmentService
.
getByWxId
(
departmentDTO
.
getId
()
+
""
,
wxEnterpriseId
);
logger
.
info
(
"分组是否存在:{}"
,
JSON
.
toJSONString
(
exist
));
...
...
@@ -539,11 +540,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
dto
.
setIsStore
(
0
);
this
.
departmentService
.
add
(
dto
);
}
}
}
catch
(
Exception
e
)
{
}
this
.
addAllDepartment
(
list
,
departmentDTO
.
getId
(),
wxEnterpriseId
,
corpid
,
contactSecret
);
this
.
staffApiService
.
initWxUser
(
corpid
,
contactSecret
,
wxEnterpriseId
,
departmentDTO
.
getId
());
}
}
}
@Override
public
Integer
departmentRecycleCount
(
String
wxEnterpriseId
)
{
...
...
@@ -620,4 +624,17 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
rer
.
setResult
(
departmentList
);
return
rer
;
}
@Override
public
void
initwxDepartmentMQ
(
String
res
)
{
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseService
.
selectById
(
res
);
if
(
enterpriseDTO
!=
null
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
&&
enterpriseDTO
.
getContactFlag
()
==
0
){
this
.
initwxDepartment
(
enterpriseDTO
.
getCorpid
(),
enterpriseDTO
.
getContactSecret
(),
enterpriseDTO
.
getWxEnterpriseId
());
enterpriseDTO
.
setContactFlag
(
1
);
this
.
wxEnterpriseService
.
update
(
enterpriseDTO
);
}
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/ApplicationController.java
View file @
1a46a4e5
...
...
@@ -11,6 +11,7 @@ import cn.hutool.core.collection.CollectionUtil;
import
com.alibaba.fastjson.JSON
;
import
com.ctrip.framework.apollo.spring.annotation.ApolloConfig
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.haoban.common.utils.GlobalVar
;
import
com.gic.haoban.manage.api.dto.*
;
import
com.gic.haoban.manage.api.service.ApplicationSettingApiService
;
...
...
@@ -35,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import
com.gic.haoban.common.utils.HaobanResponse
;
import
com.gic.haoban.manage.api.service.ApplicationApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.utils.RouterConstant
;
import
javax.servlet.http.HttpServletResponse
;
...
...
@@ -116,6 +118,31 @@ public class ApplicationController extends WebBaseController{
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
@RequestMapping
(
"init-wx-department"
)
public
HaobanResponse
initWxDepartment
(){
LoginVO
login
=
(
LoginVO
)
AuthRequestUtil
.
getLoginUser
();
String
wxEnterpriseId
=
login
.
getWxEnterpriseId
();
WxEnterpriseDTO
enterpriseDTO
=
this
.
wxEnterpriseApiService
.
getOne
(
wxEnterpriseId
);
if
(
enterpriseDTO
!=
null
){
if
(
StringUtils
.
isNotBlank
(
enterpriseDTO
.
getContactSecret
())
&&
enterpriseDTO
.
getContactFlag
()
!=
null
){
log
.
info
(
"【初始化部门调用】{},{},{}"
,
RouterConstant
.
INIT_WX_DEPARTMENT_SERVICENAME
,
RouterConstant
.
INIT_WX_DEPARTMENT_METHODNAME
,
wxEnterpriseId
);
try
{
GICMQClientUtil
.
getClientInstance
().
sendCommonMessage
(
RouterConstant
.
ROUTERTYPE
,
wxEnterpriseId
,
RouterConstant
.
INIT_WX_DEPARTMENT_SERVICENAME
,
RouterConstant
.
INIT_WX_DEPARTMENT_METHODNAME
);
}
catch
(
Exception
e
)
{
log
.
info
(
e
.
getMessage
(),
e
);
}
//this.departmentApiService.initwxDepartmentMQ(enterpriseDTO.getCorpid(), enterpriseDTO.getContactSecret(), enterpriseDTO.getWxEnterpriseId());
// enterpriseDTO.setContactFlag(1);
// wxEnterpriseApiService.update(enterpriseDTO);
}
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
,
true
);
}
@RequestMapping
(
"get-auth-url"
)
public
HaobanResponse
getAuthUrl
(){
String
suiteId
=
config
.
getSuiteId
();
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/utils/RouterConstant.java
0 → 100644
View file @
1a46a4e5
package
com
.
gic
.
haoban
.
manage
.
web
.
utils
;
/**
* @author
*/
public
class
RouterConstant
{
/**
* 分配_服务名
*/
public
final
static
String
INIT_WX_DEPARTMENT_SERVICENAME
=
"com.gic.haoban.manage.api.service.DepartmentApiService"
;
/**
*
*/
public
final
static
String
INIT_WX_DEPARTMENT_METHODNAME
=
"initwxDepartmentMQ"
;
/**
* 路由类型(通用)
*/
public
final
static
String
ROUTERTYPE
=
"commonRouter"
;
public
final
static
String
INIT_WX_DEPARTMENT_APP_CODE
=
"INIT_WX_DEPARTMENT"
;
/**
* 默认的数据状态
*/
public
final
static
int
DEFAULT_STATUS
=
1
;
}
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