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
8347bd55
Commit
8347bd55
authored
Oct 30, 2024
by
王祖波
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature-chat-activity' into 'developer'
Feature chat activity See merge request
!2279
parents
fd0d2d9f
4187408e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
62 additions
and
27 deletions
+62
-27
CombinedQDTO.java
...com/gic/haoban/manage/api/qdto/combined/CombinedQDTO.java
+25
-1
MaterialApiServiceImpl.java
...nage/service/service/out/impl/MaterialApiServiceImpl.java
+5
-2
QWmediaTest.java
haoban-manage3-service/src/test/java/QWmediaTest.java
+7
-7
QwMessageController.java
...an/manage/web/controller/content/QwMessageController.java
+0
-17
CombinedQO.java
...ava/com/gic/haoban/manage/web/qo/combined/CombinedQO.java
+25
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/qdto/combined/CombinedQDTO.java
View file @
8347bd55
...
...
@@ -29,7 +29,17 @@ public class CombinedQDTO implements Serializable {
/**
* 1群发 2朋友圈
*/
private
Integer
mediaType
;
private
Integer
mediaType
;
/**
* 导购id(作标识)
*/
private
String
clerkId
;
/**
* 业务id(作标识)
*/
private
String
businessId
;
public
String
getImageUrl
()
{
return
imageUrl
;
...
...
@@ -83,6 +93,20 @@ public class CombinedQDTO implements Serializable {
return
this
.
getImageUrl
()
+
this
.
getQrCodeUrl
()
+
this
.
getShowStyle
()
+
this
.
getLineOne
()
+
this
.
getLineTwo
()
+
this
.
getMediaType
();
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getBusinessId
()
{
return
businessId
;
}
public
void
setBusinessId
(
String
businessId
)
{
this
.
businessId
=
businessId
;
}
}
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/MaterialApiServiceImpl.java
View file @
8347bd55
...
...
@@ -9,6 +9,7 @@ import java.util.function.Function;
import
java.util.stream.Collectors
;
import
com.gic.commons.util.TraceIdUtil
;
import
com.gic.dubbo.entity.ProviderLocalTag
;
import
com.gic.haoban.manage.api.qdto.combined.CombinedQDTO
;
import
com.gic.haoban.manage.service.context.combined.ImageCombined
;
import
com.gic.redis.data.util.RedisUtil
;
...
...
@@ -530,13 +531,15 @@ public class MaterialApiServiceImpl implements MaterialApiService {
if
(
StringUtils
.
isNotBlank
(
cache
))
{
return
com
.
gic
.
api
.
base
.
commons
.
ServiceResponse
.
success
(
cache
);
}
logger
.
info
(
"请求合成图片并上传企微"
);
logger
.
info
(
"请求合成图片并上传企微clerkId:{},businessId:{}"
,
combinedQDTO
.
getClerkId
(),
combinedQDTO
.
getBusinessId
());
ProviderLocalTag
localTag
=
ProviderLocalTag
.
tag
.
get
();
String
traceId
=
localTag
.
traceId
;
Future
<
JSONResponse
>
future
=
null
;
JSONResponse
json
=
null
;
try
{
future
=
ImageCombined
.
EXECUTOR
.
submit
(()
->
{
TraceIdUtil
.
traceBegin
(
TraceIdUtil
.
EntranceType
.
THREAD_POOL
);
logger
.
info
(
"线程池合成图片
"
);
logger
.
info
(
"线程池合成图片
clerkId:{},businessId:{},traceId:{}"
,
combinedQDTO
.
getClerkId
(),
combinedQDTO
.
getBusinessId
(),
traceId
);
JSONResponse
jr
=
materialService
.
getMaterialIdByCombined
(
wxEnterpriseId
,
combinedQDTO
);
TraceIdUtil
.
traceEnd
();
return
jr
;
...
...
haoban-manage3-service/src/test/java/QWmediaTest.java
View file @
8347bd55
...
...
@@ -58,13 +58,6 @@ public class QWmediaTest {
int
TOTAL_REQUESTS
=
1800
;
// 总请求数
List
<
String
>
list
=
FileUtil
.
readLines
(
"/Users/wang/Downloads/image.txt"
,
"UTF-8"
);
List
<
String
>
qrList
=
FileUtil
.
readLines
(
"/Users/wang/Downloads/qrcode.txt"
,
"UTF-8"
);
JSONObject
jo
=
new
JSONObject
();
jo
.
put
(
"wxEnterpriseId"
,
"b18ffdc9d0644912865a248859914d80"
);
jo
.
put
(
"qrCodeUrl"
,
"https://gicinner-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-4ffc77073ca1476fb264bf1be9f11383.png"
);
jo
.
put
(
"showStyle"
,
"0"
);
jo
.
put
(
"lineOne"
,
"门店CCA"
);
jo
.
put
(
"lineTwo"
,
"宇智222为您推荐"
);
jo
.
put
(
"mediaType"
,
1
);
ExecutorService
executorService
=
Executors
.
newFixedThreadPool
(
30
);
// 创建线程池
Semaphore
semaphore
=
new
Semaphore
(
30
);
// 限制并发请求数为30
...
...
@@ -81,6 +74,13 @@ public class QWmediaTest {
long
startTime
=
System
.
currentTimeMillis
();
try
{
semaphore
.
acquire
();
// 获取许可,控制并发请求
JSONObject
jo
=
new
JSONObject
();
jo
.
put
(
"wxEnterpriseId"
,
"b18ffdc9d0644912865a248859914d80"
);
jo
.
put
(
"qrCodeUrl"
,
"https://gicinner-1251519181.cos.ap-shanghai.myqcloud.com/image/material_content-4ffc77073ca1476fb264bf1be9f11383.png"
);
jo
.
put
(
"showStyle"
,
"0"
);
jo
.
put
(
"lineOne"
,
"门店CCA"
);
jo
.
put
(
"lineTwo"
,
"宇智222为您推荐"
);
jo
.
put
(
"mediaType"
,
1
);
jo
.
put
(
"imageUrl"
,
list
.
get
(
imageId
));
jo
.
put
(
"qrCodeUrl"
,
qrList
.
get
(
qrId
));
HttpResponse
execute
=
HttpRequest
.
post
(
"https://www.gicdev.com/haoban-manage3-wx/combined-qw-materialid.json"
).
timeout
(-
1
).
body
(
jo
.
toJSONString
()).
execute
();
...
...
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/controller/content/QwMessageController.java
View file @
8347bd55
...
...
@@ -187,21 +187,4 @@ public class QwMessageController extends WebBaseController {
return
RestResponse
.
failure
(
"-1"
,
resp
.
getMessage
())
;
}
@RequestMapping
(
"combined-qw-materialids"
)
public
RestResponse
<
Object
>
combinedMaterialIds
(
@RequestBody
CombinedsQO
combinedQO
)
{
String
wxEnterpriseId
=
combinedQO
.
getWxEnterpriseId
();
CombinedQDTO
combinedQDTO
=
com
.
gic
.
commons
.
util
.
EntityUtil
.
changeEntityNew
(
CombinedQDTO
.
class
,
combinedQO
);
List
<
String
>
imageUrlList
=
combinedQO
.
getImageUrlList
();
List
<
String
>
resultList
=
new
ArrayList
<>();
for
(
String
imageUrl
:
imageUrlList
)
{
combinedQDTO
.
setImageUrl
(
imageUrl
);
ServiceResponse
<
String
>
resp
=
this
.
materialApiService
.
getMaterialIdByCombined
(
wxEnterpriseId
,
combinedQDTO
)
;
if
(!
resp
.
isSuccess
()
||
StringUtils
.
isBlank
(
resp
.
getResult
()))
{
return
RestResponse
.
failure
(
"-1"
,
resp
.
getMessage
())
;
}
String
result
=
resp
.
getResult
();
resultList
.
add
(
result
);
}
return
RestResponse
.
successResult
(
resultList
)
;
}
}
haoban-manage3-wx/src/main/java/com/gic/haoban/manage/web/qo/combined/CombinedQO.java
View file @
8347bd55
...
...
@@ -30,6 +30,15 @@ public class CombinedQO implements Serializable {
* 1群发 2朋友圈
*/
private
Integer
mediaType
;
/**
* 导购id(作标识)
*/
private
String
clerkId
;
/**
* 业务id(作标识)
*/
private
String
businessId
;
public
String
getWxEnterpriseId
()
{
return
wxEnterpriseId
;
...
...
@@ -86,5 +95,21 @@ public class CombinedQO implements Serializable {
public
void
setMediaType
(
Integer
mediaType
)
{
this
.
mediaType
=
mediaType
;
}
public
String
getClerkId
()
{
return
clerkId
;
}
public
void
setClerkId
(
String
clerkId
)
{
this
.
clerkId
=
clerkId
;
}
public
String
getBusinessId
()
{
return
businessId
;
}
public
void
setBusinessId
(
String
businessId
)
{
this
.
businessId
=
businessId
;
}
}
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