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
1c981dc1
Commit
1c981dc1
authored
Mar 21, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信
parent
08abc82f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
32 deletions
+110
-32
ch-core/src/main/java/com/wwdz/ch/core/notify/AliSmsSender.java
...e/src/main/java/com/wwdz/ch/core/notify/AliSmsSender.java
+1
-1
ch-wx-api/pom.xml
ch-wx-api/pom.xml
+27
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/WxAppletApi.java
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/WxAppletApi.java
+44
-17
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
...wdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
+12
-4
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
...ch/wx/impl/distribution/DistributionOrderServiceImpl.java
+16
-6
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/AutoSendMsgJob.java
...-api/src/main/java/com/wwdz/ch/wx/job/AutoSendMsgJob.java
+10
-3
No files found.
ch-core/src/main/java/com/wwdz/ch/core/notify/AliSmsSender.java
View file @
1c981dc1
...
@@ -113,7 +113,7 @@ public class AliSmsSender implements SmsSender {
...
@@ -113,7 +113,7 @@ public class AliSmsSender implements SmsSender {
.
setPhoneNumbers
(
phone
)
.
setPhoneNumbers
(
phone
)
.
setTemplateCode
(
templateCode
)
.
setTemplateCode
(
templateCode
)
.
setTemplateParam
(
JsonUtils
.
fromMap
(
map
))
.
setTemplateParam
(
JsonUtils
.
fromMap
(
map
))
.
setSignName
(
"
玩物得志
"
);
.
setSignName
(
"
换藏小程序
"
);
SendSmsResponse
sendSmsResponse
=
client
.
sendSmsWithOptions
(
sendSmsRequest
,
new
com
.
aliyun
.
teautil
.
models
.
RuntimeOptions
());
SendSmsResponse
sendSmsResponse
=
client
.
sendSmsWithOptions
(
sendSmsRequest
,
new
com
.
aliyun
.
teautil
.
models
.
RuntimeOptions
());
logger
.
info
(
"拍卖通知发送结果 : {} "
,
JsonUtils
.
from
(
sendSmsResponse
));
logger
.
info
(
"拍卖通知发送结果 : {} "
,
JsonUtils
.
from
(
sendSmsResponse
));
if
(
"OK"
.
equals
(
sendSmsResponse
.
getBody
().
code
))
{
if
(
"OK"
.
equals
(
sendSmsResponse
.
getBody
().
code
))
{
...
...
ch-wx-api/pom.xml
View file @
1c981dc1
...
@@ -37,7 +37,33 @@
...
@@ -37,7 +37,33 @@
<version>
${project.version}
</version>
<version>
${project.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.wwdz.mall
</groupId>
<artifactId>
notify-api
</artifactId>
<version>
1.9.5-RELEASE
</version>
<exclusions>
<exclusion>
<artifactId>
kunlun-common
</artifactId>
<groupId>
com.wwdz.kunlun
</groupId>
</exclusion>
<exclusion>
<artifactId>
kunlun-sdk
</artifactId>
<groupId>
com.wwdz.kunlun
</groupId>
</exclusion>
<exclusion>
<artifactId>
kunlunmanager-api
</artifactId>
<groupId>
com.wwdz.kunlun
</groupId>
</exclusion>
<exclusion>
<artifactId>
live-api
</artifactId>
<groupId>
com.wwdz.mall
</groupId>
</exclusion>
<exclusion>
<artifactId>
ons-client-ext
</artifactId>
<groupId>
com.aliyun.openservices
</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<dependency>
<groupId>
com.github.binarywang
</groupId>
<groupId>
com.github.binarywang
</groupId>
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/api/WxAppletApi.java
View file @
1c981dc1
...
@@ -3,12 +3,16 @@ package com.wwdz.ch.wx.api;
...
@@ -3,12 +3,16 @@ package com.wwdz.ch.wx.api;
import
com.wwdz.ch.core.util.OkHttpUtil
;
import
com.wwdz.ch.core.util.OkHttpUtil
;
import
com.wwdz.ch.wx.entity.request.WxCheckMediaRequestDto
;
import
com.wwdz.ch.wx.entity.request.WxCheckMediaRequestDto
;
import
com.wwdz.ch.wx.manager.WxLoginManager
;
import
com.wwdz.ch.wx.manager.WxLoginManager
;
import
com.wwdz.mall.api.notify.server.ItemShortUrlServer
;
import
com.wwdz.mall.common.vo.response.CloudServerResponse
;
import
com.xxdxxs.utils.JsonUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.Resource
;
import
javax.xml.ws.soap.Addressing
;
import
javax.xml.ws.soap.Addressing
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -24,15 +28,21 @@ public class WxAppletApi {
...
@@ -24,15 +28,21 @@ public class WxAppletApi {
@Value
(
"${dts.wx.app-secret}"
)
@Value
(
"${dts.wx.app-secret}"
)
private
String
APPLET_APP_SECRET
;
private
String
APPLET_APP_SECRET
;
@Value
(
"${dts.wx.auction-msg-url}"
)
private
String
AUCTION_MSG_URL
;
@Autowired
@Autowired
WxLoginManager
wxLoginManager
;
WxLoginManager
wxLoginManager
;
/* @Autowired
@Resource
ItemShortUrlServer itemShortUrlServer;
*/
ItemShortUrlServer
itemShortUrlServer
;
// 微信小程序音视频内容安全识别地址
// 微信小程序音视频内容安全识别地址
private
static
final
String
MEDIA_CHECK_URL
=
"https://api.weixin.qq.com/wxa/media_check_async?access_token=%s"
;
private
static
final
String
MEDIA_CHECK_URL
=
"https://api.weixin.qq.com/wxa/media_check_async?access_token=%s"
;
//获取urllink
private
static
final
String
URL_LINK
=
"https://api.weixin.qq.com/wxa/generate_urllink?access_token=%s"
;
public
String
checkMedia
(
WxCheckMediaRequestDto
dto
)
{
public
String
checkMedia
(
WxCheckMediaRequestDto
dto
)
{
String
accessToken
=
wxLoginManager
.
getAccessToken
();
String
accessToken
=
wxLoginManager
.
getAccessToken
();
...
@@ -53,21 +63,38 @@ public class WxAppletApi {
...
@@ -53,21 +63,38 @@ public class WxAppletApi {
public
String
getUrlLink
(
WxCheckMediaRequestDto
dto
)
{
public
String
getUrlLink
(
String
query
)
{
String
shortUrl
=
""
;
try
{
String
accessToken
=
wxLoginManager
.
getAccessToken
();
String
accessToken
=
wxLoginManager
.
getAccessToken
();
String
url
=
String
.
format
(
MEDIA_CHECK_URL
,
accessToken
);
String
url
=
String
.
format
(
URL_LINK
,
accessToken
);
StringBuffer
stringBuffer
=
new
StringBuffer
(
AUCTION_MSG_URL
);
OkHttpUtil
okHttpUtil
=
OkHttpUtil
.
builder
().
url
(
url
);
OkHttpUtil
okHttpUtil
=
OkHttpUtil
.
builder
().
url
(
url
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"media_url"
,
dto
.
getMediaUrl
());
map
.
put
(
"path"
,
stringBuffer
.
toString
());
map
.
put
(
"media_type"
,
dto
.
getMediaType
());
map
.
put
(
"query"
,
query
);
map
.
put
(
"version"
,
2
);
map
.
put
(
"is_expire"
,
true
);
map
.
put
(
"scene"
,
4
);
map
.
put
(
"expire_type"
,
1
);
map
.
put
(
"openid"
,
dto
.
getWxOpenId
());
map
.
put
(
"expire_interval"
,
1
);
logger
.
info
(
"获取加密URLLink 参数:{}"
,
JsonUtils
.
from
(
map
));
okHttpUtil
.
addParams
(
map
);
okHttpUtil
.
addParams
(
map
);
okHttpUtil
.
post
(
true
);
okHttpUtil
.
post
(
true
);
String
responseStr
=
okHttpUtil
.
async
();
String
responseStr
=
okHttpUtil
.
async
();
logger
.
info
(
"[checkMedia] response :{}"
,
responseStr
);
logger
.
info
(
"获取加密URLLink response :{}"
,
responseStr
);
return
responseStr
;
String
msg
=
JsonUtils
.
getValueByPath
(
responseStr
,
"errMsg"
);
String
urlLink
=
""
;
if
(
"ok"
.
equals
(
msg
))
{
urlLink
=
JsonUtils
.
getValueByPath
(
responseStr
,
"urlLink"
);
}
CloudServerResponse
<
String
>
cloudServerResponse
=
itemShortUrlServer
.
getShortUrlForAppName
(
urlLink
,
"quanku-applet"
);
logger
.
info
(
"获取加密URLLink ——> 转换短链接口返回: {}"
,
cloudServerResponse
);
if
(
cloudServerResponse
.
isSuccess
())
{
shortUrl
=
cloudServerResponse
.
getResult
();
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"获取小程序urlLink失败:{}"
,
e
);
}
return
shortUrl
;
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/AuctionRecordServiceImpl.java
View file @
1c981dc1
...
@@ -17,6 +17,7 @@ import com.wwdz.ch.db.domain.OfficialAccountSubscribeRecord;
...
@@ -17,6 +17,7 @@ import com.wwdz.ch.db.domain.OfficialAccountSubscribeRecord;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.AuctionRecordRequestDto
;
import
com.wwdz.ch.wx.api.WxAppletApi
;
import
com.wwdz.ch.wx.entity.AuctionOfferNoticeMsg
;
import
com.wwdz.ch.wx.entity.AuctionOfferNoticeMsg
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordVo
;
...
@@ -82,6 +83,9 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
...
@@ -82,6 +83,9 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
@Autowired
@Autowired
AliSmsSender
aliSmsSender
;
AliSmsSender
aliSmsSender
;
@Autowired
WxAppletApi
wxAppletApi
;
@Override
@Override
@Transactional
@Transactional
...
@@ -129,13 +133,15 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
...
@@ -129,13 +133,15 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
auctionOfferNoticeMsg
.
setOpenId
(
openId
);
auctionOfferNoticeMsg
.
setOpenId
(
openId
);
Result
result
=
sendMsgService
.
sendAuctionOfferOutMsg
(
auctionOfferNoticeMsg
);
Result
result
=
sendMsgService
.
sendAuctionOfferOutMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
if
(!
result
.
getSuccess
())
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您出价过的拍品"
+
supplierItem
.
getName
()
+
"的价格被其他人超越了, 当前价是"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
String
msg
=
"您出价过的拍品"
+
supplierItem
.
getName
()
+
"的价格被其他人超越了, 当前价是"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
"元,竞拍截止时间是"
+
DateUtils
.
toString
(
endTime
)
+
", 请前往
\"换藏小程序\
"查看"
;
"元,竞拍截止时间是"
+
DateUtils
.
toString
(
endTime
)
+
", 请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
}
}
}
else
{
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您出价过的拍品"
+
supplierItem
.
getName
()
+
"的价格被其他人超越了, 当前价是"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
String
msg
=
"您出价过的拍品"
+
supplierItem
.
getName
()
+
"的价格被其他人超越了, 当前价是"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
"元,竞拍截止时间是"
+
DateUtils
.
toString
(
endTime
)
+
", 请前往
\"换藏小程序\
"查看"
;
"元,竞拍截止时间是"
+
DateUtils
.
toString
(
endTime
)
+
", 请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
}
}
}
}
...
@@ -170,13 +176,15 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
...
@@ -170,13 +176,15 @@ public class AuctionRecordServiceImpl implements AuctionRecordService {
auctionOfferNoticeMsg
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
price
));
auctionOfferNoticeMsg
.
setCurrentPrice
(
PriceUtil
.
convertPriceFenToYuan
(
price
));
Result
result
=
sendMsgService
.
offerNoticeToDistributorMsg
(
auctionOfferNoticeMsg
);
Result
result
=
sendMsgService
.
offerNoticeToDistributorMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
if
(!
result
.
getSuccess
())
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"有人成出价"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"有人成出价"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
"元,请前往
\"换藏小程序\
"查看"
;
"元,请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
distributorShareRecord
.
getDistributorId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
distributorShareRecord
.
getDistributorId
(),
msg
);
}
}
}
else
{
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"有人成出价"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"有人成出价"
+
PriceUtil
.
convertPriceFenToYuan
(
price
)
+
"元,请前往
\"换藏小程序\
"查看"
;
"元,请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
distributorShareRecord
.
getDistributorId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
distributorShareRecord
.
getDistributorId
(),
msg
);
}
}
return
Result
.
success
();
return
Result
.
success
();
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/DistributionOrderServiceImpl.java
View file @
1c981dc1
...
@@ -17,6 +17,7 @@ import com.wwdz.ch.db.domain.User;
...
@@ -17,6 +17,7 @@ import com.wwdz.ch.db.domain.User;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.wx.api.WxAppletApi
;
import
com.wwdz.ch.wx.entity.AuctionOfferNoticeMsg
;
import
com.wwdz.ch.wx.entity.AuctionOfferNoticeMsg
;
import
com.wwdz.ch.wx.entity.DeliveryNoticeMsg
;
import
com.wwdz.ch.wx.entity.DeliveryNoticeMsg
;
import
com.wwdz.ch.wx.entity.SignedNoticeMsg
;
import
com.wwdz.ch.wx.entity.SignedNoticeMsg
;
...
@@ -96,6 +97,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -96,6 +97,9 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
@Autowired
@Autowired
AliSmsSender
aliSmsSender
;
AliSmsSender
aliSmsSender
;
@Autowired
WxAppletApi
wxAppletApi
;
@Transactional
@Transactional
@Override
@Override
public
Result
createDistributionOrder
(
DistributionOrderRequestDto
dto
)
{
public
Result
createDistributionOrder
(
DistributionOrderRequestDto
dto
)
{
...
@@ -281,13 +285,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -281,13 +285,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
auctionOfferNoticeMsg
.
setProfit
(
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
averageProfit
)));
auctionOfferNoticeMsg
.
setProfit
(
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
averageProfit
)));
Result
result
=
sendMsgService
.
auctionSuccessForDistributorsMsg
(
auctionOfferNoticeMsg
);
Result
result
=
sendMsgService
.
auctionSuccessForDistributorsMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
if
(!
result
.
getSuccess
())
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
averageProfit
))
+
"元。请前往
\"换藏小程序\
"查看"
;
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
averageProfit
))
+
"元。请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
record
.
getDistributorId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
record
.
getDistributorId
(),
msg
);
}
}
}
else
{
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
averageProfit
))
+
"元。请前往
\"换藏小程序\
"查看"
;
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
averageProfit
))
+
"元。请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
record
.
getDistributorId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
record
.
getDistributorId
(),
msg
);
}
}
}
}
...
@@ -307,13 +313,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -307,13 +313,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
auctionOfferNoticeMsg
.
setPayEndTime
(
payEndTime
);
auctionOfferNoticeMsg
.
setPayEndTime
(
payEndTime
);
Result
result
=
sendMsgService
.
auctionSuccessMsg
(
auctionOfferNoticeMsg
);
Result
result
=
sendMsgService
.
auctionSuccessMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
if
(!
result
.
getSuccess
())
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
\"换藏小程序\"查看。
"
;
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
"
+
url
+
"查看
"
;
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
}
}
}
else
{
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
\"换藏小程序\"查看。
"
;
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
"
+
url
+
"查看
"
;
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
auctionRecord
.
getUserId
(),
msg
);
}
}
//给中拍用户对应分销商发消息
//给中拍用户对应分销商发消息
...
@@ -329,13 +337,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
...
@@ -329,13 +337,15 @@ public class DistributionOrderServiceImpl implements DistributionOrderService {
auctionOfferNoticeMsg
.
setProfit
(
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
profit
)));
auctionOfferNoticeMsg
.
setProfit
(
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
profit
)));
Result
result
=
sendMsgService
.
auctionSuccessForDistributorsMsg
(
auctionOfferNoticeMsg
);
Result
result
=
sendMsgService
.
auctionSuccessForDistributorsMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
if
(!
result
.
getSuccess
())
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
profit
))
+
"元。请前往
\"换藏小程序\
"查看"
;
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
profit
))
+
"元。请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
distributionOrder
.
getSellerId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
distributionOrder
.
getSellerId
(),
msg
);
}
}
}
else
{
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
String
msg
=
"您分销的拍品"
+
supplierItem
.
getName
()
+
"已成拍,成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
profit
))
+
"元。请前往
\"换藏小程序\
"查看"
;
"元,您预计获得利润"
+
PriceUtil
.
convertDoubleToString
(
Math
.
floor
(
profit
))
+
"元。请前往
"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
distributionOrder
.
getSellerId
(),
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
distributionOrder
.
getSellerId
(),
msg
);
}
}
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/job/AutoSendMsgJob.java
View file @
1c981dc1
...
@@ -14,6 +14,7 @@ import com.wwdz.ch.db.domain.distribution.AuctionRecord;
...
@@ -14,6 +14,7 @@ import com.wwdz.ch.db.domain.distribution.AuctionRecord;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.DistributionOrder
;
import
com.wwdz.ch.db.domain.distribution.SupplierItem
;
import
com.wwdz.ch.db.domain.distribution.SupplierItem
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.DistributionOrderRequestDto
;
import
com.wwdz.ch.wx.api.WxAppletApi
;
import
com.wwdz.ch.wx.entity.AuctionOfferNoticeMsg
;
import
com.wwdz.ch.wx.entity.AuctionOfferNoticeMsg
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.SendMsgService
;
import
com.wwdz.ch.wx.service.distribution.SendMsgService
;
...
@@ -81,6 +82,9 @@ public class AutoSendMsgJob {
...
@@ -81,6 +82,9 @@ public class AutoSendMsgJob {
@Autowired
@Autowired
RedisUtils
redisUtils
;
RedisUtils
redisUtils
;
@Autowired
WxAppletApi
wxAppletApi
;
/**
/**
* 隔5分钟运行一次
* 隔5分钟运行一次
*/
*/
...
@@ -130,7 +134,8 @@ public class AutoSendMsgJob {
...
@@ -130,7 +134,8 @@ public class AutoSendMsgJob {
aliSmsSender.sendAuctionWithTemplate(userId, msg);
aliSmsSender.sendAuctionWithTemplate(userId, msg);
logger.info("================商品id:{}, 将在1小时内结束,提醒短信发送成功 ==============", supplierItem.getId());
logger.info("================商品id:{}, 将在1小时内结束,提醒短信发送成功 ==============", supplierItem.getId());
}*/
}*/
String
msg
=
"您出过价的拍品"
+
supplierItem
.
getName
()
+
",将在1小时内结束,请前往\"换藏小程序\"查看。"
;
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
itemId
+
"&shareRecordId="
);
String
msg
=
"您出过价的拍品"
+
supplierItem
.
getName
()
+
",将在1小时内结束,请前往"
+
url
+
"查看"
;
aliSmsSender
.
sendAuctionWithTemplate
(
userId
,
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
userId
,
msg
);
logger
.
info
(
"================商品id:{}, 将在1小时内结束,提醒短信发送成功 =============="
,
supplierItem
.
getId
());
logger
.
info
(
"================商品id:{}, 将在1小时内结束,提醒短信发送成功 =============="
,
supplierItem
.
getId
());
redisUtils
.
set
(
abortEndKey
,
itemId
,
3600
);
redisUtils
.
set
(
abortEndKey
,
itemId
,
3600
);
...
@@ -194,14 +199,16 @@ public class AutoSendMsgJob {
...
@@ -194,14 +199,16 @@ public class AutoSendMsgJob {
auctionOfferNoticeMsg
.
setPayEndTime
(
payEndTime
);
auctionOfferNoticeMsg
.
setPayEndTime
(
payEndTime
);
Result
result
=
sendMsgService
.
prePayMsg
(
auctionOfferNoticeMsg
);
Result
result
=
sendMsgService
.
prePayMsg
(
auctionOfferNoticeMsg
);
if
(!
result
.
getSuccess
())
{
if
(!
result
.
getSuccess
())
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
//发短信
//发短信
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
\"换藏小程序\"查看。
"
;
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
"
+
url
+
"查看
"
;
aliSmsSender
.
sendAuctionWithTemplate
(
userId
,
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
userId
,
msg
);
}
}
}
else
{
}
else
{
String
url
=
wxAppletApi
.
getUrlLink
(
"itemId="
+
supplierItem
.
getId
()
+
"&shareRecordId="
);
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
String
msg
=
"您已中拍"
+
supplierItem
.
getName
()
+
",成交价是"
+
PriceUtil
.
convertPriceFenToYuan
(
distributionOrder
.
getAmount
())
+
"元,请在"
+
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
\"换藏小程序\"查看。
"
;
DateUtils
.
toString
(
payEndTime
)
+
"前完成付款,请前往
"
+
url
+
"查看
"
;
aliSmsSender
.
sendAuctionWithTemplate
(
userId
,
msg
);
aliSmsSender
.
sendAuctionWithTemplate
(
userId
,
msg
);
logger
.
info
(
"================订单号:{}, 催付款短信通知发送成功 =============="
,
distributionOrder
.
getDistributionOrderId
());
logger
.
info
(
"================订单号:{}, 催付款短信通知发送成功 =============="
,
distributionOrder
.
getDistributionOrderId
());
}
}
...
...
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