Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cms-ci-test
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
test-ci
cms-ci-test
Commits
a68572c1
提交
a68572c1
authored
8月 31, 2023
作者:
zhenjie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
小猪算账配置修改及公众号模板消息发送修改
上级
ce573ec4
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
40 行增加
和
89 行删除
+40
-89
WxMsgVO.java
...del/src/main/java/com/mmc/iuav/user/model/vo/WxMsgVO.java
+17
-38
WxServiceImpl.java
...in/java/com/mmc/iuav/user/service/impl/WxServiceImpl.java
+1
-43
XzServiceImpl.java
...va/com/mmc/iuav/user/service/xzsz/impl/XzServiceImpl.java
+4
-4
application-dev.yml
...e/cms-service-user/src/main/resources/application-dev.yml
+9
-4
application-prod.yml
.../cms-service-user/src/main/resources/application-prod.yml
+9
-0
没有找到文件。
cms-common/cms-common-model/src/main/java/com/mmc/iuav/user/model/vo/WxMsgVO.java
浏览文件 @
a68572c1
...
@@ -7,11 +7,9 @@ import lombok.Builder;
...
@@ -7,11 +7,9 @@ import lombok.Builder;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.util.CollectionUtils
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
/**
/**
* @author: zj
* @author: zj
...
@@ -26,60 +24,41 @@ public class WxMsgVO implements Serializable {
...
@@ -26,60 +24,41 @@ public class WxMsgVO implements Serializable {
@ApiModelProperty
(
value
=
"用户id-仅适用云享飞客户端"
)
@ApiModelProperty
(
value
=
"用户id-仅适用云享飞客户端"
)
private
Integer
userAccountId
;
private
Integer
userAccountId
;
@ApiModelProperty
(
value
=
"公众号的openId"
)
@ApiModelProperty
(
value
=
"公众号的openId"
)
private
String
openId
;
private
String
touser
;
@ApiModelProperty
(
value
=
"unionId-全局通用"
)
@ApiModelProperty
(
value
=
"unionId-全局通用"
)
private
String
unionId
;
private
String
unionId
;
@ApiModelProperty
(
value
=
"模板id"
)
@ApiModelProperty
(
value
=
"模板id"
)
@NotNull
(
message
=
"模板id不能为空"
)
@NotNull
(
message
=
"模板id不能为空"
)
private
String
templ
em
teId
;
private
String
templ
a
teId
;
@ApiModelProperty
(
value
=
"网页跳转连接"
)
@ApiModelProperty
(
value
=
"网页跳转连接"
)
private
String
url
;
private
String
url
;
@ApiModelProperty
(
value
=
"小程序APPID"
)
@ApiModelProperty
(
value
=
"小程序APPID"
)
private
String
wxAppltAppId
;
private
String
wxAppl
e
tAppId
;
@ApiModelProperty
(
value
=
"小程序跳转连接"
)
@ApiModelProperty
(
value
=
"小程序跳转连接"
)
private
String
appletPath
;
private
String
appletPath
;
@ApiModelProperty
(
value
=
"标题"
)
@ApiModelProperty
(
value
=
"标题"
)
private
MsgData
title
;
private
MsgData
title
;
@ApiModelProperty
(
value
=
"消息数组"
)
private
List
<
MsgData
>
data
;
@ApiModelProperty
(
value
=
"消息备注"
)
@ApiModelProperty
(
value
=
"消息备注"
)
private
MsgData
remark
;
private
MsgData
remark
;
@ApiModelProperty
(
value
=
"按照接口文档传数据"
)
private
JSONObject
dataObject
;
public
String
buildMsgJson
()
{
public
String
buildTemplateMsg
()
{
JSONObject
obj
=
new
JSONObject
();
JSONObject
msg
=
new
JSONObject
();
obj
.
put
(
"touser"
,
this
.
openId
);
msg
.
put
(
"touser"
,
this
.
touser
);
obj
.
put
(
"template_id"
,
this
.
templemteId
);
msg
.
put
(
"template_id"
,
this
.
templateId
);
// 跳转页面
if
(!
StringUtils
.
isBlank
(
this
.
url
))
{
if
(!
StringUtils
.
isBlank
(
this
.
url
))
{
obj
.
put
(
"url"
,
this
.
url
);
msg
.
put
(
"url"
,
this
.
url
);
}
}
// 跳转小程序页面设置
if
(!
StringUtils
.
isBlank
(
this
.
wxAppltAppId
)
&&
!
StringUtils
.
isBlank
(
this
.
appletPath
))
{
if
(!
StringUtils
.
isBlank
(
this
.
wxAppl
e
tAppId
)
&&
!
StringUtils
.
isBlank
(
this
.
appletPath
))
{
JSONObject
mini
=
new
JSONObject
();
JSONObject
mini
=
new
JSONObject
();
mini
.
put
(
"appid"
,
this
.
wxAppltAppId
);
mini
.
put
(
"appid"
,
this
.
wxAppl
e
tAppId
);
mini
.
put
(
"pagepath"
,
this
.
appletPath
);
mini
.
put
(
"pagepath"
,
this
.
appletPath
);
obj
.
put
(
"miniprogram"
,
mini
);
msg
.
put
(
"miniprogram"
,
mini
);
}
JSONObject
jd
=
new
JSONObject
();
jd
.
put
(
"first"
,
this
.
convertMsg
(
title
));
if
(!
CollectionUtils
.
isEmpty
(
this
.
data
))
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
String
key
=
"keyword"
+
(
i
+
1
);
jd
.
put
(
key
,
this
.
convertMsg
(
data
.
get
(
i
)));
}
}
if
(
this
.
remark
!=
null
&&
!
StringUtils
.
isBlank
(
this
.
remark
.
getValue
()))
{
jd
.
put
(
"remark"
,
this
.
convertMsg
(
this
.
remark
));
}
}
msg
.
put
(
"data"
,
this
.
dataObject
);
obj
.
put
(
"data"
,
jd
);
return
msg
.
toString
();
return
obj
.
toJSONString
();
}
public
JSONObject
convertMsg
(
MsgData
msg
)
{
JSONObject
jb
=
new
JSONObject
();
jb
.
put
(
"value"
,
msg
.
getValue
());
jb
.
put
(
"color"
,
msg
.
getColor
());
return
jb
;
}
}
}
}
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/impl/WxServiceImpl.java
浏览文件 @
a68572c1
...
@@ -10,7 +10,6 @@ import com.mmc.iuav.user.constant.WxConstant;
...
@@ -10,7 +10,6 @@ import com.mmc.iuav.user.constant.WxConstant;
import
com.mmc.iuav.user.dao.UserSubInfoDao
;
import
com.mmc.iuav.user.dao.UserSubInfoDao
;
import
com.mmc.iuav.user.entity.UserSubInfoDO
;
import
com.mmc.iuav.user.entity.UserSubInfoDO
;
import
com.mmc.iuav.user.model.vo.AppletMsgVO
;
import
com.mmc.iuav.user.model.vo.AppletMsgVO
;
import
com.mmc.iuav.user.model.vo.MsgData
;
import
com.mmc.iuav.user.model.vo.WxLoginVO
;
import
com.mmc.iuav.user.model.vo.WxLoginVO
;
import
com.mmc.iuav.user.model.vo.WxMsgVO
;
import
com.mmc.iuav.user.model.vo.WxMsgVO
;
import
com.mmc.iuav.user.service.WxService
;
import
com.mmc.iuav.user.service.WxService
;
...
@@ -219,7 +218,7 @@ public class WxServiceImpl implements WxService {
...
@@ -219,7 +218,7 @@ public class WxServiceImpl implements WxService {
try
{
try
{
accessToken
=
this
.
getSubAccessToken
();
accessToken
=
this
.
getSubAccessToken
();
String
url
=
"https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="
+
accessToken
;
String
url
=
"https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="
+
accessToken
;
String
param
=
ws
.
build
MsgJson
();
String
param
=
ws
.
build
TemplateMsg
();
String
result
=
HttpHelper
.
httpPost
(
url
,
param
);
String
result
=
HttpHelper
.
httpPost
(
url
,
param
);
log
.
info
(
"模板消息发送结果:{}"
,
result
);
log
.
info
(
"模板消息发送结果:{}"
,
result
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -230,47 +229,6 @@ public class WxServiceImpl implements WxService {
...
@@ -230,47 +229,6 @@ public class WxServiceImpl implements WxService {
return
ResultBody
.
success
();
return
ResultBody
.
success
();
}
}
/**
* 模板消息请求参数-例子
*
* @param ws
* @return
*/
public
JSONObject
buildTemplateMsg
(
WxMsgVO
ws
)
{
JSONObject
msg
=
new
JSONObject
();
msg
.
put
(
"touser"
,
ws
.
getOpenId
());
msg
.
put
(
"template_id"
,
"IYtNq2t8lqdwEUbMyFWhlI-1M9KyDw_UT-ycZksJPVs"
);
// 跳转页面
if
(!
StringUtils
.
isBlank
(
ws
.
getUrl
()))
{
msg
.
put
(
"url"
,
ws
.
getUrl
());
}
// 跳转小程序页面设置
if
(!
StringUtils
.
isBlank
(
ws
.
getWxAppltAppId
())
&&
!
StringUtils
.
isBlank
(
ws
.
getAppletPath
()))
{
JSONObject
mini
=
new
JSONObject
();
mini
.
put
(
"appid"
,
ws
.
getWxAppltAppId
());
mini
.
put
(
"pagepath"
,
ws
.
getAppletPath
());
msg
.
put
(
"miniprogram"
,
mini
);
}
JSONObject
data
=
new
JSONObject
();
data
.
put
(
"first"
,
ws
.
getTitle
());
MsgData
amount2
=
new
MsgData
();
amount2
.
setValue
(
"100"
);
data
.
put
(
"amount2"
,
amount2
);
MsgData
amount3
=
new
MsgData
();
amount3
.
setValue
(
"100"
);
data
.
put
(
"amount3"
,
amount3
);
MsgData
thing6
=
new
MsgData
();
thing6
.
setValue
(
"云享金充值"
);
data
.
put
(
"thing6"
,
thing6
);
msg
.
put
(
"data"
,
data
);
return
msg
;
}
@Override
@Override
public
ResultBody
getUnLimitedQRCode
(
String
path
,
String
scene
)
{
public
ResultBody
getUnLimitedQRCode
(
String
path
,
String
scene
)
{
String
base64
=
""
;
String
base64
=
""
;
...
...
csm-service/cms-service-user/src/main/java/com/mmc/iuav/user/service/xzsz/impl/XzServiceImpl.java
浏览文件 @
a68572c1
...
@@ -90,7 +90,7 @@ public class XzServiceImpl implements XzService {
...
@@ -90,7 +90,7 @@ public class XzServiceImpl implements XzService {
PiggyOpenBasicsClient
piggyOpenBasicsClient
=
PiggyOpenBasicsClient
.
getInstanse
(
userSystemConstant
.
getXzAppSecret
(),
userSystemConstant
.
getXzDomain
());
PiggyOpenBasicsClient
piggyOpenBasicsClient
=
PiggyOpenBasicsClient
.
getInstanse
(
userSystemConstant
.
getXzAppSecret
(),
userSystemConstant
.
getXzDomain
());
JSONObject
jsonObject
=
piggyOpenBasicsClient
.
getTaxFundCashPooling
(
PiggyBasicsVo
.
builder
()
JSONObject
jsonObject
=
piggyOpenBasicsClient
.
getTaxFundCashPooling
(
PiggyBasicsVo
.
builder
()
.
appKey
(
userSystemConstant
.
getXzAppKey
())
.
appKey
(
userSystemConstant
.
getXzAppKey
())
.
taxFundID
(
"8ae605f565884a1f9a5e91d5a661ce58"
)
.
taxFundID
(
userSystemConstant
.
getTaxFundId
()
)
.
build
());
.
build
());
System
.
out
.
println
(
jsonObject
.
toString
());
System
.
out
.
println
(
jsonObject
.
toString
());
return
jsonObject
.
get
(
"data"
,
UsableCashPoolingDTO
.
class
);
return
jsonObject
.
get
(
"data"
,
UsableCashPoolingDTO
.
class
);
...
@@ -197,7 +197,7 @@ public class XzServiceImpl implements XzService {
...
@@ -197,7 +197,7 @@ public class XzServiceImpl implements XzService {
PiggySingleWithdrawalApiV2Client
v2Client
=
PiggySingleWithdrawalApiV2Client
.
getInstanse
(
userSystemConstant
.
getXzAppSecret
(),
userSystemConstant
.
getXzDomain
());
PiggySingleWithdrawalApiV2Client
v2Client
=
PiggySingleWithdrawalApiV2Client
.
getInstanse
(
userSystemConstant
.
getXzAppSecret
(),
userSystemConstant
.
getXzDomain
());
JSONObject
jsonObject
=
v2Client
.
singleSubmit
(
PiggySingleWithdrawV2Vo
.
builder
()
JSONObject
jsonObject
=
v2Client
.
singleSubmit
(
PiggySingleWithdrawV2Vo
.
builder
()
.
appKey
(
userSystemConstant
.
getXzAppKey
())
.
appKey
(
userSystemConstant
.
getXzAppKey
())
.
bizAESContent
(
PiggyOpenBasicsAesUtil
.
produceAesData
(
userSystemConstant
.
getXzAppSecret
(),
"0000000000000000"
,
PiggySingleWithdrawV2Vo
.
SingleWithdrawV2Vo
.
builder
()
.
bizAESContent
(
PiggyOpenBasicsAesUtil
.
produceAesData
(
userSystemConstant
.
getXzAppSecret
(),
userSystemConstant
.
getXzAes
()
,
PiggySingleWithdrawV2Vo
.
SingleWithdrawV2Vo
.
builder
()
.
notifyUrl
(
userSystemConstant
.
getWithdrawNotify
())
.
notifyUrl
(
userSystemConstant
.
getWithdrawNotify
())
.
taxFundId
(
userSystemConstant
.
getTaxFundId
())
.
taxFundId
(
userSystemConstant
.
getTaxFundId
())
.
month
(
xzWithdrawalVO
.
getMonth
())
.
month
(
xzWithdrawalVO
.
getMonth
())
...
@@ -224,7 +224,7 @@ public class XzServiceImpl implements XzService {
...
@@ -224,7 +224,7 @@ public class XzServiceImpl implements XzService {
PiggySingleWithdrawalApiV2Client
v2Client
=
PiggySingleWithdrawalApiV2Client
.
getInstanse
(
userSystemConstant
.
getXzAppSecret
(),
userSystemConstant
.
getXzDomain
());
PiggySingleWithdrawalApiV2Client
v2Client
=
PiggySingleWithdrawalApiV2Client
.
getInstanse
(
userSystemConstant
.
getXzAppSecret
(),
userSystemConstant
.
getXzDomain
());
JSONObject
jsonObject
=
v2Client
.
singleSubmitLimit
(
PiggySingleWithdrawV2Vo
.
builder
()
JSONObject
jsonObject
=
v2Client
.
singleSubmitLimit
(
PiggySingleWithdrawV2Vo
.
builder
()
.
appKey
(
userSystemConstant
.
getXzAppKey
())
.
appKey
(
userSystemConstant
.
getXzAppKey
())
.
bizAESContent
(
PiggyOpenBasicsAesUtil
.
produceAesData
(
userSystemConstant
.
getXzAppKey
(),
"0000000000000000"
,
PiggySingleWithdrawV2Vo
.
SingleWithdrawV2Vo
.
builder
()
.
bizAESContent
(
PiggyOpenBasicsAesUtil
.
produceAesData
(
userSystemConstant
.
getXzAppKey
(),
userSystemConstant
.
getXzAes
()
,
PiggySingleWithdrawV2Vo
.
SingleWithdrawV2Vo
.
builder
()
.
notifyUrl
(
xzWithdrawalVO
.
getNotifyUrl
())
.
notifyUrl
(
xzWithdrawalVO
.
getNotifyUrl
())
.
taxFundId
(
xzWithdrawalVO
.
getTaxFundId
())
.
taxFundId
(
xzWithdrawalVO
.
getTaxFundId
())
.
month
(
xzWithdrawalVO
.
getMonth
())
.
month
(
xzWithdrawalVO
.
getMonth
())
...
@@ -350,7 +350,7 @@ public class XzServiceImpl implements XzService {
...
@@ -350,7 +350,7 @@ public class XzServiceImpl implements XzService {
byte
[]
raw
=
userSystemConstant
.
getXzAppSecret
().
getBytes
(
"ASCII"
);
byte
[]
raw
=
userSystemConstant
.
getXzAppSecret
().
getBytes
(
"ASCII"
);
SecretKeySpec
skeySpec
=
new
SecretKeySpec
(
raw
,
"AES"
);
SecretKeySpec
skeySpec
=
new
SecretKeySpec
(
raw
,
"AES"
);
Cipher
cipher
=
Cipher
.
getInstance
(
"AES/CBC/PKCS5Padding"
);
Cipher
cipher
=
Cipher
.
getInstance
(
"AES/CBC/PKCS5Padding"
);
IvParameterSpec
iv
=
new
IvParameterSpec
(
"0000000000000000"
.
getBytes
());
IvParameterSpec
iv
=
new
IvParameterSpec
(
userSystemConstant
.
getXzAes
()
.
getBytes
());
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
skeySpec
,
iv
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
skeySpec
,
iv
);
Charset
charset
=
Charset
.
forName
(
"UTF-8"
);
Charset
charset
=
Charset
.
forName
(
"UTF-8"
);
String
tempStr
=
URLDecoder
.
decode
(
aesData
,
charset
);
String
tempStr
=
URLDecoder
.
decode
(
aesData
,
charset
);
...
...
csm-service/cms-service-user/src/main/resources/application-dev.yml
浏览文件 @
a68572c1
...
@@ -70,11 +70,16 @@ third-party:
...
@@ -70,11 +70,16 @@ third-party:
app-key
:
5015e664848d406ab1ca4b505c3da803
app-key
:
5015e664848d406ab1ca4b505c3da803
secret-key
:
7C4DB8CCECC148175E46392CC0A1B410
secret-key
:
7C4DB8CCECC148175E46392CC0A1B410
xzsz
:
xzsz
:
appKey
:
1e8e59e056be41f8a05c090964d7ce37
# appKey: 1e8e59e056be41f8a05c090964d7ce37
appSecret
:
ceshihuanjingyanshizhanghao00000
# appSecret: ceshihuanjingyanshizhanghao00000
# aes: 0000000000000000
# domain: https://uat.xzsz.ltd/
# position: 销售推广
appKey
:
37f76305f1864339adc8d6d03fbf918d
appSecret
:
hangzhouyunxiangfeikeji000000000
aes
:
0000000000000000
aes
:
0000000000000000
domain
:
https://
uat.xzsz.ltd/
domain
:
https://
saas.xzsz.ltd
position
:
销售
推广
position
:
市场
推广
taxFundId
:
xxxxxxxxxxxxxxxxxxxxxxx
taxFundId
:
xxxxxxxxxxxxxxxxxxxxxxx
authNotify
:
https://test.iuav.shop/userapp/xz/xzAuthNotify
authNotify
:
https://test.iuav.shop/userapp/xz/xzAuthNotify
withdrawNotify
:
https://test.iuav.shop/userapp/xz/xzWithdrawNotify
withdrawNotify
:
https://test.iuav.shop/userapp/xz/xzWithdrawNotify
...
...
csm-service/cms-service-user/src/main/resources/application-prod.yml
浏览文件 @
a68572c1
...
@@ -67,6 +67,15 @@ third-party:
...
@@ -67,6 +67,15 @@ third-party:
qcc
:
qcc
:
app-key
:
5015e664848d406ab1ca4b505c3da803
app-key
:
5015e664848d406ab1ca4b505c3da803
secret-key
:
7C4DB8CCECC148175E46392CC0A1B410
secret-key
:
7C4DB8CCECC148175E46392CC0A1B410
xzsz
:
appKey
:
37f76305f1864339adc8d6d03fbf918d
appSecret
:
hangzhouyunxiangfeikeji000000000
aes
:
0000000000000000
domain
:
https://saas.xzsz.ltd
position
:
市场推广
taxFundId
:
xxxxxxxxxxxxxxxxxxxxxxx
authNotify
:
https://www.iuav.shop/userapp/xz/xzAuthNotify
withdrawNotify
:
https://www.iuav.shop/userapp/xz/xzWithdrawNotify
iuav
:
iuav
:
pay
:
pay
:
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论