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
f694f3b6
Commit
f694f3b6
authored
Dec 10, 2022
by
徐高华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传
parent
f29cb2ab
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
3 deletions
+22
-3
ContentMaterialDTO.java
...ava/com/gic/haoban/manage/api/dto/ContentMaterialDTO.java
+11
-0
MaterialServiceImpl.java
...oban/manage/service/service/impl/MaterialServiceImpl.java
+5
-1
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+2
-1
QwMessageController.java
...an/manage/web/controller/content/QwMessageController.java
+4
-1
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/dto/ContentMaterialDTO.java
View file @
f694f3b6
...
...
@@ -10,6 +10,17 @@ public class ContentMaterialDTO implements Serializable {
private
int
materialType
;
private
String
imgUrl
;
// 1群发 2朋友圈
private
int
mediaType
;
public
int
getMediaType
()
{
return
mediaType
;
}
public
void
setMediaType
(
int
mediaType
)
{
this
.
mediaType
=
mediaType
;
}
public
String
getImgUrl
()
{
return
imgUrl
;
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/MaterialServiceImpl.java
View file @
f694f3b6
...
...
@@ -169,6 +169,8 @@ public class MaterialServiceImpl implements MaterialService {
if
(
null
!=
entity
)
{
old
=
EntityUtil
.
changeEntityByJSON
(
MaterialDTO
.
class
,
entity
)
;
}
// 1群发 2朋友圈
from
=
entity
.
getMediaType
()
;
}
Integer
type
=
old
.
getMaterialType
();
if
(
type
==
null
)
{
...
...
@@ -206,12 +208,14 @@ public class MaterialServiceImpl implements MaterialService {
}
String
[]
arr
=
url
.
split
(
"/"
);
int
count
=
arr
.
length
;
if
(
from
==
2
&&
entity
.
getMediaType
()==
2
)
{
if
(
from
==
2
)
{
// 朋友圈上传接口
if
(
type
==
2
)
{
url
+=
"?imageView2/2/w/1440/h/1080"
;
}
jp
=
qywxSuiteApiService
.
uploadAttachment
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
CommonUtil
.
getFileByte
(
url
),
arr
[
count
-
1
],
fileType
.
getCode
());
}
else
{
// 群发上传
jp
=
qywxSuiteApiService
.
uploadMedia
(
qwDTO
.
getThirdCorpid
(),
config
.
getWxSuiteid
(),
CommonUtil
.
getFileByte
(
url
),
arr
[
count
-
1
],
fileType
.
getCode
());
}
if
(
jp
.
getErrorCode
()
==
0
)
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
f694f3b6
...
...
@@ -453,7 +453,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
public
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
<
String
>
getMaterialId
(
String
wxEnterpriseId
,
ContentMaterialDTO
dto
)
{
List
<
ContentMaterialDTO
>
imageList
=
Arrays
.
asList
(
dto
)
;
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
dto
.
getM
aterial
Type
());
List
<
String
>
materialIdList
=
this
.
materialService
.
getImageMediaId
(
wxEnterpriseId
,
imageList
,
dto
.
getM
edia
Type
());
if
(
CollectionUtils
.
isEmpty
(
materialIdList
))
{
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
failure
(
"9999"
,
"素材记录不存"
)
;
}
...
...
@@ -469,6 +469,7 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if
(
lastUploadTime
!=
null
&&
lastUploadTime
.
after
(
compareDate
)
&&
StringUtils
.
isNotBlank
(
madiaId
))
{
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
madiaId
)
;
}
JSONResponse
json
=
this
.
materialService
.
reUpdalodMetailJson
(
materialId
,
2
)
;
if
(
json
.
getErrorCode
()
==
0
)
{
madiaId
=
json
.
getResult
().
toString
()
;
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/QwMessageController.java
View file @
f694f3b6
...
...
@@ -9,6 +9,7 @@ import org.apache.logging.log4j.LogManager;
import
org.apache.logging.log4j.Logger
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.alibaba.fastjson.JSONObject
;
...
...
@@ -155,10 +156,12 @@ public class QwMessageController extends WebBaseController {
return
RestResponse
.
successResult
();
}
// 1群发 2朋友圈
@RequestMapping
(
"get-qw-materialid"
)
public
RestResponse
<
Object
>
getMaterialId
(
String
wxEnterpriseId
,
String
imgUrl
,
int
materialType
)
{
public
RestResponse
<
Object
>
getMaterialId
(
String
wxEnterpriseId
,
String
imgUrl
,
int
materialType
,
@RequestParam
(
defaultValue
=
"2"
)
int
mediaType
)
{
ContentMaterialDTO
dto
=
new
ContentMaterialDTO
();
dto
.
setImgUrl
(
imgUrl
);
dto
.
setMediaType
(
mediaType
);
dto
.
setMaterialType
(
materialType
);
ServiceResponse
<
String
>
resp
=
this
.
materialApiService
.
getMaterialId
(
wxEnterpriseId
,
dto
)
;
if
(
resp
.
isSuccess
())
{
...
...
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