Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
66d7ef69
Commit
66d7ef69
authored
Dec 27, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
公众号发送模板消息跳转小程序页面-寄售单详情页面
parent
1dd93102
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
6 deletions
+16
-6
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/ConsignSaleServiceImpl.java
...n/java/com/wwdz/ch/admin/impl/ConsignSaleServiceImpl.java
+2
-0
ch-core/src/main/java/com/wwdz/ch/core/api/OfficialAccountApi.java
...rc/main/java/com/wwdz/ch/core/api/OfficialAccountApi.java
+7
-4
ch-core/src/main/java/com/wwdz/ch/core/entity/ConsignSaleSubscribeMsg.java
...java/com/wwdz/ch/core/entity/ConsignSaleSubscribeMsg.java
+5
-0
ch-core/src/main/resources/application-dev.yml
ch-core/src/main/resources/application-dev.yml
+1
-1
ch-core/src/main/resources/application-prod.yml
ch-core/src/main/resources/application-prod.yml
+1
-1
No files found.
ch-admin-api/src/main/java/com/wwdz/ch/admin/impl/ConsignSaleServiceImpl.java
View file @
66d7ef69
...
@@ -302,6 +302,7 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
...
@@ -302,6 +302,7 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
String
itemName
=
item
.
getName
();
String
itemName
=
item
.
getName
();
String
content
=
itemName
.
length
()
>
5
?
itemName
.
substring
(
0
,
5
)
:
itemName
+
","
+
price
;
String
content
=
itemName
.
length
()
>
5
?
itemName
.
substring
(
0
,
5
)
:
itemName
+
","
+
price
;
ConsignSaleSubscribeMsg
consignSaleSubscribeMsg
=
ConsignSaleSubscribeMsg
.
of
(
saleId
,
content
,
new
Date
());
ConsignSaleSubscribeMsg
consignSaleSubscribeMsg
=
ConsignSaleSubscribeMsg
.
of
(
saleId
,
content
,
new
Date
());
consignSaleSubscribeMsg
.
setCustomStateName
(
ConsignSaleEnum
.
SaleForUserStateEnum
.
getNameByCode
(
userConsignSale
.
getCustomState
()));
officialAccountApi
.
sendModelMsg
(
openId
,
consignSaleSubscribeMsg
);
officialAccountApi
.
sendModelMsg
(
openId
,
consignSaleSubscribeMsg
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -360,6 +361,7 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
...
@@ -360,6 +361,7 @@ public class ConsignSaleServiceImpl implements ConsignSaleService {
//发送公众号消息
//发送公众号消息
sendTempletMsg
(
dto
.
getSaleId
(),
consignSaleRecord
.
getContent
().
replaceAll
(
" "
,
""
));
sendTempletMsg
(
dto
.
getSaleId
(),
consignSaleRecord
.
getContent
().
replaceAll
(
" "
,
""
));
return
Result
.
success
();
return
Result
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"实物鉴定 error:{}"
,
e
);
logger
.
error
(
"实物鉴定 error:{}"
,
e
);
...
...
ch-core/src/main/java/com/wwdz/ch/core/api/OfficialAccountApi.java
View file @
66d7ef69
package
com.wwdz.ch.core.api
;
package
com.wwdz.ch.core.api
;
import
com.wwdz.ch.core.entity.AbstractSubscribeMsg
;
import
com.wwdz.ch.core.entity.AbstractSubscribeMsg
;
import
com.wwdz.ch.core.entity.ConsignSaleSubscribeMsg
;
import
com.wwdz.ch.core.util.OkHttpUtil
;
import
com.wwdz.ch.core.util.OkHttpUtil
;
import
com.wwdz.ch.core.util.RedisUtils
;
import
com.wwdz.ch.core.util.RedisUtils
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.JsonUtils
;
...
@@ -143,7 +144,7 @@ public class OfficialAccountApi {
...
@@ -143,7 +144,7 @@ public class OfficialAccountApi {
* @param openId
* @param openId
* @return
* @return
*/
*/
public
boolean
sendModelMsg
(
String
openId
,
AbstractSubscribeMsg
abstract
SubscribeMsg
)
{
public
boolean
sendModelMsg
(
String
openId
,
ConsignSaleSubscribeMsg
consignSale
SubscribeMsg
)
{
String
token
=
getAccessToken
();
String
token
=
getAccessToken
();
String
url
=
SEND_MSG_URL
+
"?access_token="
+
token
;
String
url
=
SEND_MSG_URL
+
"?access_token="
+
token
;
OkHttpUtil
okHttpUtil
=
OkHttpUtil
.
builder
().
url
(
url
);
OkHttpUtil
okHttpUtil
=
OkHttpUtil
.
builder
().
url
(
url
);
...
@@ -151,11 +152,13 @@ public class OfficialAccountApi {
...
@@ -151,11 +152,13 @@ public class OfficialAccountApi {
map
.
put
(
"touser"
,
openId
);
map
.
put
(
"touser"
,
openId
);
map
.
put
(
"template_id"
,
OFFICIALACCOUNT_TEMPLETID
);
map
.
put
(
"template_id"
,
OFFICIALACCOUNT_TEMPLETID
);
Map
<
String
,
Object
>
miniprogramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
miniprogramMap
=
new
HashMap
<>();
// String link = wxLoginManager.getLink(MSG_URL);
miniprogramMap
.
put
(
"appid"
,
APPLET_APPID
);
miniprogramMap
.
put
(
"appid"
,
APPLET_APPID
);
miniprogramMap
.
put
(
"pagepath"
,
MSG_URL
);
StringBuffer
stringBuffer
=
new
StringBuffer
(
MSG_URL
);
stringBuffer
.
append
(
"?saleId="
+
consignSaleSubscribeMsg
.
getSaleId
());
stringBuffer
.
append
(
"&customStateName="
+
consignSaleSubscribeMsg
.
getCustomStateName
());
miniprogramMap
.
put
(
"pagepath"
,
stringBuffer
.
toString
());
map
.
put
(
"miniprogram"
,
miniprogramMap
);
map
.
put
(
"miniprogram"
,
miniprogramMap
);
map
.
put
(
"data"
,
abstract
SubscribeMsg
.
getTempletParam
());
map
.
put
(
"data"
,
consignSale
SubscribeMsg
.
getTempletParam
());
logger
.
info
(
"============ 公众号模板消息内容 : {}"
,
JsonUtils
.
fromMap
(
map
));
logger
.
info
(
"============ 公众号模板消息内容 : {}"
,
JsonUtils
.
fromMap
(
map
));
okHttpUtil
.
addParams
(
map
);
okHttpUtil
.
addParams
(
map
);
okHttpUtil
.
post
(
true
);
okHttpUtil
.
post
(
true
);
...
...
ch-core/src/main/java/com/wwdz/ch/core/entity/ConsignSaleSubscribeMsg.java
View file @
66d7ef69
...
@@ -2,6 +2,7 @@ package com.wwdz.ch.core.entity;
...
@@ -2,6 +2,7 @@ package com.wwdz.ch.core.entity;
import
com.xxdxxs.entity.Entity
;
import
com.xxdxxs.entity.Entity
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.web.SpringServletContainerInitializer
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
...
@@ -11,6 +12,10 @@ public class ConsignSaleSubscribeMsg implements Entity, AbstractSubscribeMsg{
...
@@ -11,6 +12,10 @@ public class ConsignSaleSubscribeMsg implements Entity, AbstractSubscribeMsg{
private
String
templetId
;
private
String
templetId
;
/**
* 寄售单状态
*/
private
String
customStateName
;
/**
/**
* 寄售单号
* 寄售单号
...
...
ch-core/src/main/resources/application-dev.yml
View file @
66d7ef69
...
@@ -11,7 +11,7 @@ dts:
...
@@ -11,7 +11,7 @@ dts:
#公众号消息点击后跳转到小程序页面的链接
#公众号消息点击后跳转到小程序页面的链接
msg-url
:
pages/consign
List
/index
msg-url
:
pages/consign
Detail
/index
# 商户证书文件路径
# 商户证书文件路径
# 请参考“商户证书”一节 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=4_3
# 请参考“商户证书”一节 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=4_3
key-path
:
xxxxx
key-path
:
xxxxx
...
...
ch-core/src/main/resources/application-prod.yml
View file @
66d7ef69
...
@@ -10,7 +10,7 @@ dts:
...
@@ -10,7 +10,7 @@ dts:
#公众号消息点击后跳转到小程序页面的链接
#公众号消息点击后跳转到小程序页面的链接
msg-url
:
pages/consign
List
/index
msg-url
:
pages/consign
Detail
/index
# 商户证书文件路径
# 商户证书文件路径
# 请参考“商户证书”一节 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=4_3
# 请参考“商户证书”一节 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=4_3
key-path
:
xxxxx
key-path
:
xxxxx
...
...
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