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
QianQiXiang
haoban-manage3.0
Commits
20b9d546
Commit
20b9d546
authored
Apr 21, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
009049c2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
1 deletions
+27
-1
MessageApiServiceImpl.java
...anage/service/service/out/impl/MessageApiServiceImpl.java
+27
-1
No files found.
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MessageApiServiceImpl.java
View file @
20b9d546
...
...
@@ -3,6 +3,8 @@ package com.gic.haoban.manage.service.service.out.impl;
import
com.alibaba.fastjson.JSON
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.GICMQClientUtil
;
import
com.gic.commons.util.GlobalInfo
;
import
com.gic.commons.util.GlobalVar
;
import
com.gic.haoban.base.api.common.Constant
;
import
com.gic.haoban.base.api.common.ServiceResponse
;
import
com.gic.haoban.manage.api.dto.DepartmentDTO
;
...
...
@@ -22,10 +24,15 @@ import com.gic.haoban.manage.service.config.Config;
import
com.gic.haoban.manage.service.entity.*
;
import
com.gic.haoban.manage.service.service.*
;
import
com.gic.mq.sdk.GicMQClient
;
import
com.gic.thirdparty.api.dto.PicUploadResDTO
;
import
com.gic.thirdparty.api.service.QQCloudPicService
;
import
com.gic.wechat.api.service.qywx.QywxDepartmentApiService
;
import
java.io.InputStream
;
import
java.net.URL
;
import
java.util.List
;
import
org.apache.commons.io.IOUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
...
...
@@ -61,6 +68,9 @@ public class MessageApiServiceImpl implements MessageApiService {
@Autowired
private
QywxDepartmentApiService
qywxDepartmentApiService
;
@Autowired
private
QQCloudPicService
qqCloudPicService
;
private
final
String
CONTACT_APP
=
"contactSuiteId"
;
@Override
...
...
@@ -254,7 +264,9 @@ public class MessageApiServiceImpl implements MessageApiService {
staff
.
setStaffName
(
qywxCallBackDTO
.
getUserName
());
staff
.
setWxUserId
(
qywxCallBackDTO
.
getUserid
());
staff
.
setPostion
(
qywxCallBackDTO
.
getPosition
());
staff
.
setHeadImg
(
qywxCallBackDTO
.
getAvatar
());
if
(
StringUtils
.
isNotBlank
(
qywxCallBackDTO
.
getAvatar
())){
staff
.
setHeadImg
(
changeHeaderImageUrl
(
qywxCallBackDTO
.
getAvatar
()));
}
staff
.
setNationCode
(
"86"
);
//激活状态
if
(
qywxCallBackDTO
.
getStatus
()
!=
null
&&
qywxCallBackDTO
.
getStatus
()
==
1
){
...
...
@@ -405,6 +417,20 @@ public class MessageApiServiceImpl implements MessageApiService {
}
}
}
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
);
log
.
info
(
"腾讯云万象优图返回"
+
JSON
.
toJSONString
(
uploadPic
));
return
uploadPic
.
downloadUrl
;
}
catch
(
Exception
e
){
log
.
info
(
"上传腾讯云万象优图返回失败了:"
,
e
);
return
headImgUrl
;
}
}
/**
* 通过关联的父级ID链查询父级部门
* @param parentChain
...
...
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