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
416a2f35
Commit
416a2f35
authored
Jan 03, 2025
by
王祖波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
画布合成图片
parent
fb5799e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
60 additions
and
2 deletions
+60
-2
CombinedQDTO.java
...com/gic/haoban/manage/api/qdto/combined/CombinedQDTO.java
+27
-2
MaterialServiceImpl.java
...oban/manage/service/service/impl/MaterialServiceImpl.java
+23
-0
CombinedQO.java
...ava/com/gic/haoban/manage/web/qo/combined/CombinedQO.java
+10
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/combined/CombinedQDTO.java
View file @
416a2f35
...
@@ -6,6 +6,10 @@ public class CombinedQDTO implements Serializable {
...
@@ -6,6 +6,10 @@ public class CombinedQDTO implements Serializable {
private
static
final
long
serialVersionUID
=
-
28454620622119889L
;
private
static
final
long
serialVersionUID
=
-
28454620622119889L
;
/**
/**
* 企业id
*/
private
String
enterpriseId
;
/**
* 主图url
* 主图url
*/
*/
private
String
imageUrl
;
private
String
imageUrl
;
...
@@ -27,11 +31,16 @@ public class CombinedQDTO implements Serializable {
...
@@ -27,11 +31,16 @@ public class CombinedQDTO implements Serializable {
private
String
lineTwo
;
private
String
lineTwo
;
/**
/**
* 1群发 2朋友圈
* 1群发 2朋友圈
3合成图片
*/
*/
private
Integer
mediaType
;
private
Integer
mediaType
;
/**
/**
* 额外参数
*/
private
String
extend
=
""
;
/**
* 导购id(作标识)
* 导购id(作标识)
*/
*/
private
String
clerkId
;
private
String
clerkId
;
...
@@ -41,6 +50,14 @@ public class CombinedQDTO implements Serializable {
...
@@ -41,6 +50,14 @@ public class CombinedQDTO implements Serializable {
*/
*/
private
String
businessId
;
private
String
businessId
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getImageUrl
()
{
public
String
getImageUrl
()
{
return
imageUrl
;
return
imageUrl
;
}
}
...
@@ -89,8 +106,16 @@ public class CombinedQDTO implements Serializable {
...
@@ -89,8 +106,16 @@ public class CombinedQDTO implements Serializable {
this
.
mediaType
=
mediaType
;
this
.
mediaType
=
mediaType
;
}
}
public
String
getExtend
()
{
return
extend
;
}
public
void
setExtend
(
String
extend
)
{
this
.
extend
=
extend
;
}
public
String
getUnionString
()
{
public
String
getUnionString
()
{
return
this
.
getImageUrl
()
+
this
.
getQrCodeUrl
()
+
this
.
getShowStyle
()
+
this
.
getLineOne
()
+
this
.
getLineTwo
()
+
this
.
getMediaType
();
return
this
.
getImageUrl
()
+
this
.
getQrCodeUrl
()
+
this
.
getShowStyle
()
+
this
.
getLineOne
()
+
this
.
getLineTwo
()
+
this
.
getMediaType
()
+
this
.
getExtend
()
;
}
}
public
String
getClerkId
()
{
public
String
getClerkId
()
{
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/impl/MaterialServiceImpl.java
View file @
416a2f35
...
@@ -8,10 +8,16 @@ import java.util.stream.Collectors;
...
@@ -8,10 +8,16 @@ import java.util.stream.Collectors;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.gic.commons.util.HttpClient
;
import
com.gic.commons.util.HttpClient
;
import
com.gic.enterprise.api.dto.EnterpriseDTO
;
import
com.gic.enterprise.api.service.EnterpriseService
;
import
com.gic.haoban.manage.service.util.ApolloUtils
;
import
com.gic.haoban.manage.service.util.ApolloUtils
;
import
com.gic.haoban.manage.api.qdto.combined.CombinedQDTO
;
import
com.gic.haoban.manage.api.qdto.combined.CombinedQDTO
;
import
com.gic.haoban.manage.service.context.combined.ImageCombined
;
import
com.gic.haoban.manage.service.context.combined.ImageCombined
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.thirdparty.cloudfile.CloudFileUtil
;
import
com.gic.thirdparty.cloudfile.enums.CloudFileBusinessOptEnum
;
import
com.gic.thirdparty.cloudfile.enums.CloudFileTypeEnum
;
import
com.gic.thirdparty.cloudfile.pojo.CloudFileInfo
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.apache.commons.lang3.time.DateUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -48,6 +54,8 @@ public class MaterialServiceImpl implements MaterialService {
...
@@ -48,6 +54,8 @@ public class MaterialServiceImpl implements MaterialService {
@Autowired
@Autowired
private
WxEnterpriseService
wxEnterpriseService
;
private
WxEnterpriseService
wxEnterpriseService
;
@Autowired
@Autowired
private
EnterpriseService
enterpriseService
;
@Autowired
private
QywxSuiteApiService
qywxSuiteApiService
;
private
QywxSuiteApiService
qywxSuiteApiService
;
@Autowired
@Autowired
private
Config
config
;
private
Config
config
;
...
@@ -375,11 +383,26 @@ public class MaterialServiceImpl implements MaterialService {
...
@@ -375,11 +383,26 @@ public class MaterialServiceImpl implements MaterialService {
arr
=
imageUrl
.
split
(
"/"
);
arr
=
imageUrl
.
split
(
"/"
);
}
}
JSONResponse
json
=
null
;
JSONResponse
json
=
null
;
Integer
mediaType
=
combinedQDTO
.
getMediaType
();
Integer
mediaType
=
combinedQDTO
.
getMediaType
();
if
(
Objects
.
equals
(
1
,
mediaType
))
{
if
(
Objects
.
equals
(
1
,
mediaType
))
{
json
=
qywxSuiteApiService
.
uploadMedia
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
combinedImageData
,
arr
[
arr
.
length
-
1
],
QywxMediaTypeEnum
.
IMAGE
.
getCode
(),
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
json
=
qywxSuiteApiService
.
uploadMedia
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
combinedImageData
,
arr
[
arr
.
length
-
1
],
QywxMediaTypeEnum
.
IMAGE
.
getCode
(),
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
}
else
if
(
Objects
.
equals
(
2
,
mediaType
))
{
}
else
if
(
Objects
.
equals
(
2
,
mediaType
))
{
json
=
qywxSuiteApiService
.
uploadAttachment
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
combinedImageData
,
arr
[
arr
.
length
-
1
],
QywxMediaTypeEnum
.
IMAGE
.
getCode
(),
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
json
=
qywxSuiteApiService
.
uploadAttachment
(
qwDTO
.
getThirdCorpid
(),
qwDTO
.
getSelf3thSecret
(),
combinedImageData
,
arr
[
arr
.
length
-
1
],
QywxMediaTypeEnum
.
IMAGE
.
getCode
(),
qwDTO
.
isSelf
(),
qwDTO
.
getUrlHost
());
}
else
if
(
Objects
.
equals
(
3
,
mediaType
))
{
EnterpriseDTO
enterprise
=
enterpriseService
.
getEnterpriseById
(
combinedQDTO
.
getEnterpriseId
());
if
(
enterprise
==
null
)
{
return
jsonResponse
;
}
CloudFileInfo
uploadInfo
=
CloudFileUtil
.
uploadFile
(
combinedImageData
,
"jpg"
,
CloudFileTypeEnum
.
IMAGE
,
enterprise
.
getFactoryCode
(),
CloudFileBusinessOptEnum
.
COMMON
)
;
String
orgFileUrl
=
uploadInfo
.
getOrgFileUrl
();
if
(
StringUtils
.
isBlank
(
orgFileUrl
))
{
return
jsonResponse
;
}
json
=
new
JSONResponse
();
json
.
setErrorCode
(
0
);
json
.
setSuccess
(
true
);
json
.
setResult
(
orgFileUrl
);
}
}
return
json
;
return
json
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/combined/CombinedQO.java
View file @
416a2f35
...
@@ -5,6 +5,8 @@ import java.io.Serializable;
...
@@ -5,6 +5,8 @@ import java.io.Serializable;
public
class
CombinedQO
implements
Serializable
{
public
class
CombinedQO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
28454620622119889L
;
private
static
final
long
serialVersionUID
=
-
28454620622119889L
;
private
String
enterpriseId
;
private
String
wxEnterpriseId
;
private
String
wxEnterpriseId
;
/**
/**
* 主图url
* 主图url
...
@@ -40,6 +42,14 @@ public class CombinedQO implements Serializable {
...
@@ -40,6 +42,14 @@ public class CombinedQO implements Serializable {
*/
*/
private
String
businessId
;
private
String
businessId
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
String
getWxEnterpriseId
()
{
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
return
wxEnterpriseId
;
}
}
...
...
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