记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
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
董敬伟
liquidnet-bus-v1
Commits
2d6f06c7
Commit
2d6f06c7
authored
Jul 12, 2021
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev' into dev
parents
be775535
ef4d2d6a
Changes
67
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
67 changed files
with
1942 additions
and
612 deletions
+1942
-612
AdamRedisConst.java
...a/com/liquidnet/service/adam/constant/AdamRedisConst.java
+5
-1
DragonPayBaseReqDto.java
...com/liquidnet/service/dragon/dto/DragonPayBaseReqDto.java
+3
-2
DragonPayBaseRespDto.java
...om/liquidnet/service/dragon/dto/DragonPayBaseRespDto.java
+6
-103
KylinRedisConst.java
...com/liquidnet/service/kylin/constant/KylinRedisConst.java
+3
-0
ZhengzaiAppVersionsParam.java
...net/service/kylin/dto/param/ZhengzaiAppVersionsParam.java
+46
-0
ZhengzaiAppVersionsSearchParam.java
...kylin/dto/param/admin/ZhengzaiAppVersionsSearchParam.java
+31
-0
ZhengzaiAppVersionsVo.java
...net/service/kylin/dto/vo/admin/ZhengzaiAppVersionsVo.java
+48
-0
UploadVo.java
...iquidnet/service/kylin/dto/vo/basicServices/UploadVo.java
+27
-0
db_liquidnet_admin_data.sql
...quidnet-client-admin-web/docu/db_liquidnet_admin_data.sql
+6
-0
KylinBannersAdminController.java
...ontroller/zhengzai/kylin/KylinBannersAdminController.java
+6
-80
ZhengzaiAppVersionController.java
...ntroller/zhengzai/kylin/ZhengzaiAppVersionController.java
+110
-0
create.html
...in/resources/templates/zhengzai/kylin/banners/create.html
+10
-3
update.html
...in/resources/templates/zhengzai/kylin/banners/update.html
+10
-3
create.html
...s/templates/zhengzai/kylin/zhengzaiAppVersion/create.html
+128
-0
update.html
...s/templates/zhengzai/kylin/zhengzaiAppVersion/update.html
+140
-0
zhengzaiAppVersion.html
...zhengzai/kylin/zhengzaiAppVersion/zhengzaiAppVersion.html
+127
-0
KylinBannersServiceImpl.java
.../zhengzai/kylin/service/impl/KylinBannersServiceImpl.java
+0
-1
KylinZhengzaiAppVersionsServiceImpl.java
...lin/service/impl/KylinZhengzaiAppVersionsServiceImpl.java
+123
-0
pom.xml
liquidnet-bus-client/liquidnet-client-admin/pom.xml
+0
-4
pom.xml
liquidnet-bus-client/pom.xml
+0
-5
FilesUtils.java
...main/java/com/liquidnet/commons/lang/util/FilesUtils.java
+37
-6
IdentityUtils.java
...n/java/com/liquidnet/commons/lang/util/IdentityUtils.java
+3
-3
SmsMessage.java
.../src/main/java/com/liquidnet/service/base/SmsMessage.java
+16
-1
liquidnet-client-admin-web.yml
...us-config/liquidnet-config/liquidnet-client-admin-web.yml
+1
-3
liquidnet-service-dragon-dev.yml
...-config/liquidnet-config/liquidnet-service-dragon-dev.yml
+2
-2
liquidnet-service-dragon-test.yml
...config/liquidnet-config/liquidnet-service-dragon-test.yml
+2
-2
liquidnet-service-dragon.yml
...-bus-config/liquidnet-config/liquidnet-service-dragon.yml
+1
-4
liquidnet-service-kylin-dev.yml
...s-config/liquidnet-config/liquidnet-service-kylin-dev.yml
+0
-2
liquidnet-service-kylin-test.yml
...-config/liquidnet-config/liquidnet-service-kylin-test.yml
+0
-2
liquidnet-service-order-dev.yml
...s-config/liquidnet-config/liquidnet-service-order-dev.yml
+0
-2
liquidnet-service-order-test.yml
...-config/liquidnet-config/liquidnet-service-order-test.yml
+0
-2
liquidnet-service-order.yml
...t-bus-config/liquidnet-config/liquidnet-service-order.yml
+1
-4
liquidnet-service-platform.yml
...us-config/liquidnet-config/liquidnet-service-platform.yml
+15
-2
ZhengzaiAppVersionsListDao.java
...quidnet/service/kylin/dao/ZhengzaiAppVersionsListDao.java
+35
-0
KylinZhengzaiAppVersions.java
...uidnet/service/kylin/entity/KylinZhengzaiAppVersions.java
+54
-0
PlatformOssFiles.java
.../com/liquidnet/service/kylin/entity/PlatformOssFiles.java
+47
-0
KylinZhengzaiAppVersionsMapper.java
.../service/kylin/mapper/KylinZhengzaiAppVersionsMapper.java
+22
-0
PlatformOssFilesMapper.java
...iquidnet/service/kylin/mapper/PlatformOssFilesMapper.java
+16
-0
KylinZhengzaiAppVersionsMapper.xml
...t.service.kylin.mapper/KylinZhengzaiAppVersionsMapper.xml
+16
-0
AdamLoginController.java
...iquidnet/service/adam/controller/AdamLoginController.java
+122
-117
AdamUserController.java
...liquidnet/service/adam/controller/AdamUserController.java
+24
-22
AdamRdmService.java
...va/com/liquidnet/service/adam/service/AdamRdmService.java
+10
-0
AdamEntersServiceImpl.java
...dnet/service/adam/service/impl/AdamEntersServiceImpl.java
+26
-18
AdamUserServiceImpl.java
...uidnet/service/adam/service/impl/AdamUserServiceImpl.java
+26
-21
errors.properties
...et-service-adam-impl/src/main/resources/errors.properties
+2
-2
ConsumerAdamUCenterProcessor.java
.../adam/service/processor/ConsumerAdamUCenterProcessor.java
+2
-2
pom.xml
...dnet-service-dragon/liquidnet-service-dragon-impl/pom.xml
+1
-1
AlipayTradePayReq.java
.../service/dragon/channel/alipay/req/AlipayTradePayReq.java
+2
-0
AbstractAlipayStrategy.java
.../channel/alipay/strategy/impl/AbstractAlipayStrategy.java
+57
-27
AlipayStrategyAppImpl.java
...n/channel/alipay/strategy/impl/AlipayStrategyAppImpl.java
+26
-32
AlipayStrategyWapImpl.java
...n/channel/alipay/strategy/impl/AlipayStrategyWapImpl.java
+25
-32
AlipayUtil.java
...uidnet/service/dragon/channel/alipay/util/AlipayUtil.java
+49
-19
PayChannelStrategyWepayImpl.java
...on/channel/strategy/impl/PayChannelStrategyWepayImpl.java
+0
-4
AbstractWepayStrategy.java
...on/channel/wepay/strategy/impl/AbstractWepayStrategy.java
+60
-5
WepayStrategyAppImpl.java
...gon/channel/wepay/strategy/impl/WepayStrategyAppImpl.java
+7
-8
WepayStrategyAppletImpl.java
.../channel/wepay/strategy/impl/WepayStrategyAppletImpl.java
+6
-23
WepayStrategyJsImpl.java
...agon/channel/wepay/strategy/impl/WepayStrategyJsImpl.java
+7
-8
WepayStrategyWapImpl.java
...gon/channel/wepay/strategy/impl/WepayStrategyWapImpl.java
+6
-23
PayController.java
...om/liquidnet/service/dragon/controller/PayController.java
+19
-8
DragonOrdersServiceImpl.java
.../service/dragon/service/impl/DragonOrdersServiceImpl.java
+3
-0
XmlUtil.java
...main/java/com/liquidnet/service/dragon/utils/XmlUtil.java
+7
-1
db_kylin_structure.sql
.../liquidnet-service-kylin-impl/docu/db_kylin_structure.sql
+42
-0
BannersServiceImpl.java
...uidnet/service/kylin/service/impl/BannersServiceImpl.java
+0
-1
AlOssController.java
...ce/platform/controller/basicServices/AlOssController.java
+113
-0
WechatShareController.java
...tform/controller/basicServices/WechatShareController.java
+192
-0
pom.xml
liquidnet-bus-service/liquidnet-service-platform/pom.xml
+5
-1
pom.xml
liquidnet-bus-service/pom.xml
+6
-0
No files found.
liquidnet-bus-api/liquidnet-service-adam-api/src/main/java/com/liquidnet/service/adam/constant/AdamRedisConst.java
View file @
2d6f06c7
...
@@ -3,6 +3,10 @@ package com.liquidnet.service.adam.constant;
...
@@ -3,6 +3,10 @@ package com.liquidnet.service.adam.constant;
public
class
AdamRedisConst
{
public
class
AdamRedisConst
{
public
static
final
String
ADAM
=
"adam:"
;
public
static
final
String
ADAM
=
"adam:"
;
public
static
final
String
VALID
=
ADAM
.
concat
(
"valid:"
);
public
static
final
String
VALID_SMS_CODE_MOBILE
=
VALID
.
concat
(
"sms:code:mobile"
);
public
static
final
String
IDENTITY
=
ADAM
.
concat
(
"identity:"
);
public
static
final
String
IDENTITY
=
ADAM
.
concat
(
"identity:"
);
public
static
final
String
IDENTITY_MOBILE
=
IDENTITY
.
concat
(
"mobile:"
);
public
static
final
String
IDENTITY_MOBILE
=
IDENTITY
.
concat
(
"mobile:"
);
...
@@ -44,7 +48,7 @@ public class AdamRedisConst {
...
@@ -44,7 +48,7 @@ public class AdamRedisConst {
public
static
final
String
LOCK_KEY_UMEMBER_NO
=
"adam:lk:member:no"
;
public
static
final
String
LOCK_KEY_UMEMBER_NO
=
"adam:lk:member:no"
;
// // // // // // // // // //
// // // // // // // // // //
public
static
final
String
LOCK_KEY_
USMS_MOBILE
=
"adam:lk:sms
:mobile:"
;
public
static
final
String
LOCK_KEY_
SMS_CODE_MOBILE
=
"adam:lk:sms:code
:mobile:"
;
public
static
final
String
LOCK_KEY_UREGISTER
=
"adam:lk:register:"
;
public
static
final
String
LOCK_KEY_UREGISTER
=
"adam:lk:register:"
;
public
static
final
String
LOCK_KEY_UIDENTITY
=
"adam:lk:identity:"
;
public
static
final
String
LOCK_KEY_UIDENTITY
=
"adam:lk:identity:"
;
public
static
final
String
LOCK_KEY_UMEMBER_CODE
=
"adam:lk:member:code:"
;
public
static
final
String
LOCK_KEY_UMEMBER_CODE
=
"adam:lk:member:code:"
;
...
...
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/DragonPayBaseReqDto.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
dto
;
package
com
.
liquidnet
.
service
.
dragon
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
/**
/**
...
@@ -30,4 +28,7 @@ public class DragonPayBaseReqDto {
...
@@ -30,4 +28,7 @@ public class DragonPayBaseReqDto {
private
String
code
;
private
String
code
;
private
String
createDate
;
private
String
createDate
;
private
String
expireTime
;
private
String
expireTime
;
private
String
quitUrl
;
private
String
showUrl
;
private
String
returnUrl
;
}
}
liquidnet-bus-api/liquidnet-service-dragon-api/src/main/java/com/liquidnet/service/dragon/dto/DragonPayBaseRespDto.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
dto
;
package
com
.
liquidnet
.
service
.
dragon
.
dto
;
import
com.fasterxml.jackson.annotation.Json
Property
;
import
com.fasterxml.jackson.annotation.Json
Include
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -15,14 +15,15 @@ import java.math.BigDecimal;
...
@@ -15,14 +15,15 @@ import java.math.BigDecimal;
* @date 2021/7/9 10:56
* @date 2021/7/9 10:56
*/
*/
@Data
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
DragonPayBaseRespDto
{
public
class
DragonPayBaseRespDto
{
private
String
code
;
private
String
code
;
private
String
order
_c
ode
;
private
String
order
C
ode
;
private
Integer
status
;
private
Integer
status
;
private
String
order
_i
d
;
private
String
order
I
d
;
private
String
showUrl
;
private
String
showUrl
;
...
@@ -32,17 +33,15 @@ public class DragonPayBaseRespDto {
...
@@ -32,17 +33,15 @@ public class DragonPayBaseRespDto {
private
PayData
payData
;
private
PayData
payData
;
@Data
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
static
class
PayData
{
public
static
class
PayData
{
@JsonProperty
(
"appId"
)
private
String
appId
;
private
String
appId
;
@JsonProperty
(
"nonceStr"
)
private
String
nonceStr
;
private
String
nonceStr
;
@JsonProperty
(
"timeStamp"
)
private
String
timeStamp
;
private
String
timeStamp
;
@JsonProperty
(
"package"
)
private
String
packages
;
private
String
packages
;
private
String
partnerId
;
private
String
partnerId
;
...
@@ -60,101 +59,5 @@ public class DragonPayBaseRespDto {
...
@@ -60,101 +59,5 @@ public class DragonPayBaseRespDto {
private
String
redirectUrl
;
private
String
redirectUrl
;
private
String
orderStr
;
private
String
orderStr
;
public
String
getAppId
()
{
return
appId
;
}
public
void
setAppId
(
String
appId
)
{
this
.
appId
=
appId
;
}
public
String
getNonceStr
()
{
return
nonceStr
;
}
public
void
setNonceStr
(
String
nonceStr
)
{
this
.
nonceStr
=
nonceStr
;
}
public
String
getTimeStamp
()
{
return
timeStamp
;
}
public
void
setTimeStamp
(
String
timeStamp
)
{
this
.
timeStamp
=
timeStamp
;
}
public
String
getPackages
()
{
return
packages
;
}
public
void
setPackages
(
String
packages
)
{
this
.
packages
=
packages
;
}
public
String
getPartnerId
()
{
return
partnerId
;
}
public
void
setPartnerId
(
String
partnerId
)
{
this
.
partnerId
=
partnerId
;
}
public
String
getPrepayId
()
{
return
prepayId
;
}
public
void
setPrepayId
(
String
prepayId
)
{
this
.
prepayId
=
prepayId
;
}
public
String
getSign
()
{
return
sign
;
}
public
void
setSign
(
String
sign
)
{
this
.
sign
=
sign
;
}
public
String
getMwebUrl
()
{
return
mwebUrl
;
}
public
void
setMwebUrl
(
String
mwebUrl
)
{
this
.
mwebUrl
=
mwebUrl
;
}
public
String
getPaySign
()
{
return
paySign
;
}
public
void
setPaySign
(
String
paySign
)
{
this
.
paySign
=
paySign
;
}
public
String
getSignType
()
{
return
signType
;
}
public
void
setSignType
(
String
signType
)
{
this
.
signType
=
signType
;
}
public
String
getRedirectUrl
()
{
return
redirectUrl
;
}
public
void
setRedirectUrl
(
String
redirectUrl
)
{
this
.
redirectUrl
=
redirectUrl
;
}
public
String
getOrderStr
()
{
return
orderStr
;
}
public
void
setOrderStr
(
String
orderStr
)
{
this
.
orderStr
=
orderStr
;
}
}
}
}
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/constant/KylinRedisConst.java
View file @
2d6f06c7
...
@@ -36,4 +36,7 @@ public class KylinRedisConst {
...
@@ -36,4 +36,7 @@ public class KylinRedisConst {
public
static
final
String
CHECK_USER
=
"kylin:checkUser:id:"
;
public
static
final
String
CHECK_USER
=
"kylin:checkUser:id:"
;
public
static
final
String
CHECK_USER_RELATION
=
"kylin:checkUser:relation:id:"
;
public
static
final
String
CHECK_USER_RELATION
=
"kylin:checkUser:relation:id:"
;
public
static
final
String
WECHAT_SHARE_ACCESSTOKEN
=
"basicServices:accessToken:appid:"
;
public
static
final
String
WECHAT_SHARE_JSAPI_TICKET
=
"basicServices:jsapiTicket:appid:"
;
}
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/param/ZhengzaiAppVersionsParam.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
dto
.
param
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* <p>
* 正在现场app版本控制 需要的参数
* </p>
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
public
class
ZhengzaiAppVersionsParam
implements
Serializable
{
// @ApiModelProperty(value = "zhengzaiAppVersionsId", example = "9822346783245")
private
String
zhengzaiAppVersionsId
;
private
String
name
;
private
String
filePath
;
private
String
version
;
private
String
minVersion
;
private
Integer
type
;
private
Integer
isProduction
;
private
Integer
isForce
;
private
String
content
;
/**
* 创建时间
*/
private
String
createdAt
;
/**
* 修改时间
*/
private
String
updatedAt
;
private
List
<
String
>
ids
;
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/param/admin/ZhengzaiAppVersionsSearchParam.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
dto
.
param
.
admin
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
import
java.io.Serializable
;
/**
* <p>
* 正在现场app版本控制 需要的参数
* </p>
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
public
class
ZhengzaiAppVersionsSearchParam
implements
Serializable
{
// @ApiModelProperty(value = "Banner主键ID", example = "9822346783245")
private
Integer
type
;
@ApiModelProperty
(
value
=
"页数"
,
example
=
"0"
)
@NotNull
(
message
=
"页数不能为空"
)
private
Integer
pageSize
;
@ApiModelProperty
(
value
=
"数量"
,
example
=
"20"
)
@NotNull
(
message
=
"数量不能为空"
)
private
Integer
pageNum
;
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/admin/ZhengzaiAppVersionsVo.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
.
admin
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 正在现场app版本控制 返回给前端的数据字段
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
@ApiModel
public
class
ZhengzaiAppVersionsVo
implements
Serializable
{
// @ApiModelProperty(value = "Banner主键ID")
private
String
zhengzaiAppVersionsId
;
private
String
name
;
private
String
filePath
;
private
String
version
;
private
String
minVersion
;
private
Integer
type
;
private
Integer
isProduction
;
private
Integer
isForce
;
private
Integer
isDeleted
;
private
String
content
;
/**
* 创建时间
*/
private
String
createdAt
;
/**
* 修改时间
*/
private
String
updatedAt
;
}
liquidnet-bus-api/liquidnet-service-kylin-api/src/main/java/com/liquidnet/service/kylin/dto/vo/basicServices/UploadVo.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
dto
.
vo
.
basicServices
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* <p>
* 阿里上传
* </p>
*
* @author jiangxiulong
* @since 2021-05-03 11:19 上午
*/
@Data
@ApiModel
public
class
UploadVo
implements
Serializable
{
@ApiModelProperty
(
value
=
"上传后的地址"
)
private
String
ossPath
;
private
String
contentType
;
private
Integer
size
;
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/docu/db_liquidnet_admin_data.sql
View file @
2d6f06c7
...
@@ -43,6 +43,12 @@ INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, ur
...
@@ -43,6 +43,12 @@ INSERT INTO test_ln_scene.sys_menu (menu_id, menu_name, parent_id, order_num, ur
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2039
,
'路由信息主动查询'
,
2034
,
5
,
'#'
,
'menuItem'
,
'F'
,
'0'
,
'1'
,
'kylin:performancesExpress:listOrderRoute'
,
'#'
,
'admin'
,
'2021-06-30 20:07:07'
,
''
,
null
,
''
);
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2039
,
'路由信息主动查询'
,
2034
,
5
,
'#'
,
'menuItem'
,
'F'
,
'0'
,
'1'
,
'kylin:performancesExpress:listOrderRoute'
,
'#'
,
'admin'
,
'2021-06-30 20:07:07'
,
''
,
null
,
''
);
#
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2040
,
'实际运费主动查询'
,
2034
,
6
,
'#'
,
'menuItem'
,
'F'
,
'0'
,
'1'
,
'kylin:performancesExpress:getListFreight'
,
'#'
,
'admin'
,
'2021-06-30 20:07:07'
,
''
,
null
,
''
);
#
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2040
,
'实际运费主动查询'
,
2034
,
6
,
'#'
,
'menuItem'
,
'F'
,
'0'
,
'1'
,
'kylin:performancesExpress:getListFreight'
,
'#'
,
'admin'
,
'2021-06-30 20:07:07'
,
''
,
null
,
''
);
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2041
,
'版本控制'
,
2000
,
5
,
'#'
,
'menuItem'
,
'C'
,
'0'
,
'1'
,
'kylin:versionControl:view'
,
'#'
,
'admin'
,
'2021-06-30 20:01:36'
,
''
,
null
,
''
);
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2042
,
'正在现场App'
,
2041
,
0
,
'/kylin/zhengzaiAppVersion'
,
'menuItem'
,
'C'
,
'0'
,
'1'
,
'kylin:zhengzaiAppVersion:list'
,
'#'
,
'admin'
,
'2021-06-30 20:03:59'
,
''
,
null
,
''
);
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2043
,
'添加'
,
2042
,
1
,
'#'
,
'menuItem'
,
'F'
,
'0'
,
'1'
,
'kylin:zhengzaiAppVersion:create'
,
'#'
,
'admin'
,
'2021-06-30 20:05:58'
,
''
,
null
,
''
);
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2044
,
'编辑'
,
2042
,
2
,
'#'
,
'menuItem'
,
'F'
,
'0'
,
'1'
,
'kylin:zhengzaiAppVersion:update'
,
'#'
,
'admin'
,
'2021-06-30 20:07:07'
,
''
,
null
,
''
);
INSERT
INTO
test_ln_scene
.
sys_menu
(
menu_id
,
menu_name
,
parent_id
,
order_num
,
url
,
target
,
menu_type
,
visible
,
is_refresh
,
perms
,
icon
,
create_by
,
create_time
,
update_by
,
update_time
,
remark
)
VALUES
(
2045
,
'删除'
,
2042
,
3
,
'#'
,
'menuItem'
,
'F'
,
'0'
,
'1'
,
'kylin:zhengzaiAppVersion:delete'
,
'#'
,
'admin'
,
'2021-06-30 20:07:07'
,
''
,
null
,
''
);
-- sys_role_menu
-- sys_role_menu
INSERT
INTO
test_ln_scene
.
sys_role_menu
(
role_id
,
menu_id
)
VALUES
(
2
,
2000
);
INSERT
INTO
test_ln_scene
.
sys_role_menu
(
role_id
,
menu_id
)
VALUES
(
2
,
2000
);
INSERT
INTO
test_ln_scene
.
sys_role_menu
(
role_id
,
menu_id
)
VALUES
(
2
,
2001
);
INSERT
INTO
test_ln_scene
.
sys_role_menu
(
role_id
,
menu_id
)
VALUES
(
2
,
2001
);
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/KylinBannersAdminController.java
View file @
2d6f06c7
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
kylin
;
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
kylin
;
import
com.aliyun.oss.OSS
;
import
com.aliyun.oss.OSSClientBuilder
;
import
com.aliyun.oss.model.PutObjectRequest
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.common.config.RuoYiConfig
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.common.enums.BannersDisplayLocation
;
import
com.liquidnet.client.admin.common.enums.BannersDisplayLocation
;
import
com.liquidnet.client.admin.common.enums.BannersTargetType
;
import
com.liquidnet.client.admin.common.enums.BannersTargetType
;
import
com.liquidnet.client.admin.common.utils.file.FileUploadUtils
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinBannersServiceImpl
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinBannersServiceImpl
;
import
com.liquidnet.commons.lang.util.FilesUtils
;
import
com.liquidnet.service.kylin.dao.BannerDetailsListDao
;
import
com.liquidnet.service.kylin.dao.BannerDetailsListDao
;
import
com.liquidnet.service.kylin.dto.param.BannersParam
;
import
com.liquidnet.service.kylin.dto.param.BannersParam
;
import
com.liquidnet.service.kylin.dto.param.BannersSearchParam
;
import
com.liquidnet.service.kylin.dto.param.BannersSearchParam
;
...
@@ -23,13 +17,8 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -23,13 +17,8 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.UUID
;
/**
/**
* <p>
* <p>
...
@@ -77,12 +66,8 @@ public class KylinBannersAdminController extends BaseController {
...
@@ -77,12 +66,8 @@ public class KylinBannersAdminController extends BaseController {
@Value
(
"${liquidnet.url-banner.url26}"
)
@Value
(
"${liquidnet.url-banner.url26}"
)
private
String
url26
;
private
String
url26
;
@Value
(
"${liquidnet.al-oss.endpoint}"
)
@Value
(
"${liquidnet.client.admin.platformUrl}"
)
private
String
endpoint
;
private
String
platformUrl
;
@Value
(
"${liquidnet.al-oss.accessKeyId}"
)
private
String
accessKeyId
;
@Value
(
"${liquidnet.al-oss.accessKeySecret}"
)
private
String
accessKeySecret
;
@Autowired
@Autowired
private
KylinBannersServiceImpl
kylinBannersServiceImpl
;
private
KylinBannersServiceImpl
kylinBannersServiceImpl
;
...
@@ -94,6 +79,8 @@ public class KylinBannersAdminController extends BaseController {
...
@@ -94,6 +79,8 @@ public class KylinBannersAdminController extends BaseController {
mmap
.
put
(
"BannersTargetType"
,
bannersTargetType
);
mmap
.
put
(
"BannersTargetType"
,
bannersTargetType
);
mmap
.
put
(
"BannersDisplayLocation"
,
bannersDisplayLocation
);
mmap
.
put
(
"BannersDisplayLocation"
,
bannersDisplayLocation
);
mmap
.
put
(
"platformUrl"
,
platformUrl
);
mmap
.
put
(
"provinces"
,
provinces
);
mmap
.
put
(
"provinces"
,
provinces
);
mmap
.
put
(
"url1"
,
url1
);
mmap
.
put
(
"url1"
,
url1
);
mmap
.
put
(
"url2"
,
url2
);
mmap
.
put
(
"url2"
,
url2
);
...
@@ -138,6 +125,8 @@ public class KylinBannersAdminController extends BaseController {
...
@@ -138,6 +125,8 @@ public class KylinBannersAdminController extends BaseController {
mmap
.
put
(
"BannersTargetType"
,
bannersTargetType
);
mmap
.
put
(
"BannersTargetType"
,
bannersTargetType
);
mmap
.
put
(
"BannersDisplayLocation"
,
bannersDisplayLocation
);
mmap
.
put
(
"BannersDisplayLocation"
,
bannersDisplayLocation
);
mmap
.
put
(
"platformUrl"
,
platformUrl
);
mmap
.
put
(
"provinces"
,
provinces
);
mmap
.
put
(
"provinces"
,
provinces
);
mmap
.
put
(
"url1"
,
url1
);
mmap
.
put
(
"url1"
,
url1
);
mmap
.
put
(
"url2"
,
url2
);
mmap
.
put
(
"url2"
,
url2
);
...
@@ -205,67 +194,4 @@ public class KylinBannersAdminController extends BaseController {
...
@@ -205,67 +194,4 @@ public class KylinBannersAdminController extends BaseController {
}
}
}
}
/**
* 文件上传
*/
@PostMapping
(
"/upload1"
)
@ResponseBody
public
String
upload1
(
@RequestParam
MultipartFile
coverImg
)
{
try
{
if
(!
coverImg
.
isEmpty
())
{
String
avatar
=
FileUploadUtils
.
upload
(
RuoYiConfig
.
getAvatarPath
(),
coverImg
);
return
avatar
;
}
return
"error"
;
}
catch
(
Exception
e
)
{
return
"success"
;
}
}
@PostMapping
(
"/upload2"
)
@ResponseBody
public
String
upload2
(
@RequestParam
MultipartFile
coverImg
)
{
if
(
coverImg
.
isEmpty
())
{
return
"上传失败,请选择文件"
;
}
String
fileName
=
coverImg
.
getOriginalFilename
();
String
filePath
=
RuoYiConfig
.
getAvatarPath
();
File
dest
=
new
File
(
filePath
+
fileName
);
try
{
coverImg
.
transferTo
(
dest
);
return
dest
.
getName
();
}
catch
(
IOException
e
)
{
return
"上传失败!"
;
}
}
@PostMapping
(
"/upload3"
)
@ResponseBody
public
HashMap
upload3
(
@RequestParam
MultipartFile
coverImgFile
)
{
OSS
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
File
file
=
null
;
try
{
file
=
FilesUtils
.
multipartFileToFile
(
coverImgFile
);
}
catch
(
Exception
e
)
{
return
new
HashMap
<>();
}
String
filename
=
coverImgFile
.
getResource
().
getFilename
();
// time.jpeg
//这里文件名用了uuid 防止重复,可以根据自己的需要来写
String
uploadName
=
UUID
.
randomUUID
()
+
filename
.
substring
(
filename
.
lastIndexOf
(
"."
));
// 078a77e0-cf80-481b-824c-5935247cff15.jpeg
uploadName
=
uploadName
.
replace
(
"-"
,
""
);
// 078a77e0cf80481b824c5935247cff15.jpeg
String
uploadpath
=
"banner/"
+
uploadName
;
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
"img-zhengzai-tv"
,
uploadpath
,
file
);
ossClient
.
putObject
(
putObjectRequest
);
ossClient
.
shutdown
();
file
.
delete
();
HashMap
<
Object
,
Object
>
objectObjectHashMap
=
new
HashMap
<>();
objectObjectHashMap
.
put
(
"uploadpath"
,
uploadpath
);
return
objectObjectHashMap
;
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/java/com/liquidnet/client/admin/web/controller/zhengzai/kylin/ZhengzaiAppVersionController.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
client
.
admin
.
web
.
controller
.
zhengzai
.
kylin
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.client.admin.common.core.controller.BaseController
;
import
com.liquidnet.client.admin.common.core.domain.AjaxResult
;
import
com.liquidnet.client.admin.common.core.page.TableDataInfo
;
import
com.liquidnet.client.admin.zhengzai.kylin.service.impl.KylinZhengzaiAppVersionsServiceImpl
;
import
com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao
;
import
com.liquidnet.service.kylin.dto.param.ZhengzaiAppVersionsParam
;
import
com.liquidnet.service.kylin.dto.param.admin.ZhengzaiAppVersionsSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.admin.ZhengzaiAppVersionsVo
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
/**
* <p>
* 正在现场app版本控制
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Controller
@RequestMapping
(
"/kylin/zhengzaiAppVersion"
)
public
class
ZhengzaiAppVersionController
extends
BaseController
{
@Value
(
"${liquidnet.client.admin.platformUrl}"
)
private
String
platformUrl
;
private
String
prefix
=
"zhengzai/kylin/zhengzaiAppVersion"
;
@Autowired
private
KylinZhengzaiAppVersionsServiceImpl
kylinZhengzaiAppVersionsServiceImpl
;
@GetMapping
(
"/create"
)
public
String
create
(
ModelMap
mmap
)
{
mmap
.
put
(
"platformUrl"
,
platformUrl
);
return
prefix
+
"/create"
;
}
@RequiresPermissions
(
"kylin:zhengzaiAppVersion:create"
)
@PostMapping
(
"create"
)
@ResponseBody
public
AjaxResult
createSave
(
ZhengzaiAppVersionsParam
zhengzaiAppVersionsParam
)
{
Boolean
res
=
kylinZhengzaiAppVersionsServiceImpl
.
create
(
zhengzaiAppVersionsParam
);
if
(
res
)
{
return
success
();
}
else
{
return
error
(
"添加失败"
);
}
}
@GetMapping
(
"/update/{zhengzaiAppVersionsId}"
)
public
String
update
(
@PathVariable
(
"zhengzaiAppVersionsId"
)
String
zhengzaiAppVersionsId
,
ModelMap
mmap
)
{
ZhengzaiAppVersionsVo
result
=
null
;
result
=
kylinZhengzaiAppVersionsServiceImpl
.
detail
(
zhengzaiAppVersionsId
);
mmap
.
put
(
"ZhengzaiAppVersionsVo"
,
result
);
mmap
.
put
(
"platformUrl"
,
platformUrl
);
return
prefix
+
"/update"
;
}
@RequiresPermissions
(
"kylin:zhengzaiAppVersion:update"
)
@PostMapping
(
"update"
)
@ResponseBody
public
AjaxResult
updateSave
(
ZhengzaiAppVersionsParam
zhengzaiAppVersionsParam
)
{
boolean
res
=
kylinZhengzaiAppVersionsServiceImpl
.
update
(
zhengzaiAppVersionsParam
);
if
(
res
)
{
return
success
();
}
else
{
return
error
(
"修改失败"
);
}
}
@RequiresPermissions
(
"kylin:zhengzaiAppVersion:view"
)
@GetMapping
()
public
String
zhengzaiAppVersions
()
{
return
prefix
+
"/zhengzaiAppVersion"
;
}
@RequiresPermissions
(
"kylin:zhengzaiAppVersion:list"
)
@PostMapping
(
"list"
)
@ResponseBody
public
TableDataInfo
allList
(
ZhengzaiAppVersionsSearchParam
zhengzaiAppVersionsSearchParam
)
{
PageInfo
<
ZhengzaiAppVersionsListDao
>
result
=
kylinZhengzaiAppVersionsServiceImpl
.
listInfo
(
zhengzaiAppVersionsSearchParam
);
return
getDataTable
(
result
.
getList
());
}
@RequiresPermissions
(
"kylin:zhengzaiAppVersion:delete"
)
@PostMapping
(
"delete"
)
@ResponseBody
public
AjaxResult
delete
(
ZhengzaiAppVersionsParam
zhengzaiAppVersionsParam
)
{
List
<
String
>
bannersId
=
zhengzaiAppVersionsParam
.
getIds
();
boolean
result
=
kylinZhengzaiAppVersionsServiceImpl
.
delete
(
bannersId
);
if
(
result
)
{
return
success
(
"删除成功"
);
}
else
{
return
error
(
"删除失败"
);
}
}
}
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/banners/create.html
View file @
2d6f06c7
...
@@ -118,7 +118,7 @@
...
@@ -118,7 +118,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"font-noraml"
>
请上传封面图
</label>
<label
class=
"font-noraml"
>
请上传封面图
</label>
<div
class=
"file-loading"
>
<div
class=
"file-loading"
>
<input
id=
"fileinput-demo-1"
type=
"file"
name=
"
coverImgFile
"
data-browse-on-zone-click=
"true"
<input
id=
"fileinput-demo-1"
type=
"file"
name=
"
files
"
data-browse-on-zone-click=
"true"
data-msg-placeholder=
"Select {files} for upload..."
>
data-msg-placeholder=
"Select {files} for upload..."
>
</div>
</div>
</div>
</div>
...
@@ -132,6 +132,7 @@
...
@@ -132,6 +132,7 @@
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
prefix
=
ctx
+
"kylin/banners"
;
var
prefix
=
ctx
+
"kylin/banners"
;
var
platformUrl
=
"[[${platformUrl}]]"
;
var
provinces
=
"[[${provinces}]]"
;
var
provinces
=
"[[${provinces}]]"
;
var
url1
=
"[[${url1}]]"
;
var
url1
=
"[[${url1}]]"
;
var
url2
=
"[[${url2}]]"
;
var
url2
=
"[[${url2}]]"
;
...
@@ -469,7 +470,13 @@
...
@@ -469,7 +470,13 @@
});
});
$
(
"#fileinput-demo-1"
).
fileinput
({
$
(
"#fileinput-demo-1"
).
fileinput
({
'theme'
:
'explorer-fas'
,
'theme'
:
'explorer-fas'
,
'uploadUrl'
:
"/kylin/banners/upload3"
,
// 'uploadUrl': "/kylin/banners/upload3",
// 'uploadUrl': "http://127.0.0.1:9003" + "/platform/basicServices/alOss/upload",
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
"uploadExtraData"
:
{
"pathName"
:
"banner"
,
"buckType"
:
1
},
// overwriteInitial: false,
// overwriteInitial: false,
// initialPreviewAsData: true,
// initialPreviewAsData: true,
autoReplace
:
true
,
autoReplace
:
true
,
...
@@ -477,7 +484,7 @@
...
@@ -477,7 +484,7 @@
maxFileCount
:
1
maxFileCount
:
1
});
});
$
(
"#fileinput-demo-1"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
$
(
"#fileinput-demo-1"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
$
(
"#coverImg"
).
val
(
data
.
response
.
uploadp
ath
)
$
(
"#coverImg"
).
val
(
data
.
response
.
ossP
ath
)
});
});
})
})
</script>
</script>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/banners/update.html
View file @
2d6f06c7
...
@@ -142,7 +142,7 @@
...
@@ -142,7 +142,7 @@
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<label
class=
"font-noraml"
>
请上传封面图
</label>
<label
class=
"font-noraml"
>
请上传封面图
</label>
<div
class=
"file-loading"
>
<div
class=
"file-loading"
>
<input
id=
"fileinput-demo-1"
type=
"file"
name=
"
coverImgFile
"
th:value=
"${KylinBannersVo.coverImg}"
data-browse-on-zone-click=
"true"
<input
id=
"fileinput-demo-1"
type=
"file"
name=
"
files
"
th:value=
"${KylinBannersVo.coverImg}"
data-browse-on-zone-click=
"true"
data-msg-placeholder=
"Select {files} for upload..."
>
data-msg-placeholder=
"Select {files} for upload..."
>
</div>
</div>
</div>
</div>
...
@@ -156,6 +156,7 @@
...
@@ -156,6 +156,7 @@
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
prefix
=
ctx
+
"kylin/banners"
;
var
prefix
=
ctx
+
"kylin/banners"
;
var
platformUrl
=
"[[${platformUrl}]]"
;
var
provinces
=
"[[${provinces}]]"
;
var
provinces
=
"[[${provinces}]]"
;
var
url1
=
"[[${url1}]]"
;
var
url1
=
"[[${url1}]]"
;
var
url2
=
"[[${url2}]]"
;
var
url2
=
"[[${url2}]]"
;
...
@@ -519,8 +520,14 @@
...
@@ -519,8 +520,14 @@
$
(
"#fileinput-demo-1"
).
fileinput
({
$
(
"#fileinput-demo-1"
).
fileinput
({
'theme'
:
'explorer-fas'
,
'theme'
:
'explorer-fas'
,
'uploadUrl'
:
"/kylin/banners/upload3"
,
//
'uploadUrl': "/kylin/banners/upload3",
// 'uploadUrl': ctx + "system/user/profile/updateAvatar",
// 'uploadUrl': ctx + "system/user/profile/updateAvatar",
// 'uploadUrl': "http://127.0.0.1:9003" + "/platform/basicServices/alOss/upload",
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
"uploadExtraData"
:
{
"pathName"
:
"banner"
,
"buckType"
:
1
},
overwriteInitial
:
false
,
overwriteInitial
:
false
,
initialPreviewAsData
:
true
,
initialPreviewAsData
:
true
,
dropZoneTitle
:
"请上传文件"
,
dropZoneTitle
:
"请上传文件"
,
...
@@ -532,7 +539,7 @@
...
@@ -532,7 +539,7 @@
});
});
$
(
"#fileinput-demo-1"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
$
(
"#fileinput-demo-1"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
$
(
"#coverImg"
).
val
(
data
.
response
.
uploadp
ath
)
$
(
"#coverImg"
).
val
(
data
.
response
.
ossP
ath
)
});
});
})
})
</script>
</script>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/zhengzaiAppVersion/create.html
0 → 100644
View file @
2d6f06c7
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<th:block
th:include=
"include :: header('添加正在现场App版本')"
/>
<th:block
th:include=
"include :: select2-css"
/>
<th:block
th:include=
"include :: datetimepicker-css"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-css"
/>
</head>
<body
class=
"white-bg"
>
<div
class=
"wrapper wrapper-content animated fadeInRight ibox-content"
>
<form
class=
"form-horizontal m"
id=
"form-post-add"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label is-required"
>
名称:
</label>
<div
class=
"col-sm-10"
>
<input
class=
"form-control"
type=
"text"
name=
"name"
id=
"name"
required
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label is-required"
>
版本号:
</label>
<div
class=
"col-sm-10"
>
<input
class=
"form-control"
type=
"text"
name=
"version"
id=
"version"
required
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label is-required"
>
最小版本号:
</label>
<div
class=
"col-sm-10"
>
<input
class=
"form-control"
type=
"text"
name=
"minVersion"
id=
"minVersion"
required
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
类型
</label>
<div
class=
"col-sm-10"
>
<div
class=
"radio check-box"
>
<label>
<input
type=
"radio"
value=
"1"
name=
"type"
checked=
""
>
IOS
</label>
</div>
<div
class=
"radio check-box"
>
<label>
<input
type=
"radio"
value=
"2"
name=
"type"
>
Android
</label>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
是否生产环境
</label>
<div
class=
"col-sm-10"
>
<div
class=
"radio check-box"
>
<label>
<input
type=
"radio"
value=
"1"
name=
"isProduction"
checked=
""
>
是
</label>
</div>
<div
class=
"radio check-box"
>
<label>
<input
type=
"radio"
value=
"2"
name=
"isProduction"
>
否
</label>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
是否强制升级
</label>
<div
class=
"col-sm-10"
>
<div
class=
"radio check-box"
>
<label>
<input
type=
"radio"
value=
"1"
name=
"isForce"
>
是
</label>
</div>
<div
class=
"radio check-box"
>
<label>
<input
type=
"radio"
value=
"2"
name=
"isForce"
checked=
""
>
否
</label>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-xs-2 control-label"
>
升级描述:
</label>
<div
class=
"col-xs-10"
>
<textarea
name=
"content"
maxlength=
"500"
class=
"form-control"
rows=
"3"
></textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"font-noraml"
>
Android请上传apk文件
</label>
<div
class=
"file-loading"
>
<input
id=
"fileinput-demo-1"
type=
"file"
name=
"files"
data-browse-on-zone-click=
"true"
data-msg-placeholder=
"Select {files} for upload..."
>
</div>
</div>
<input
hidden
id=
"filePath"
name=
"filePath"
>
</form>
</div>
<th:block
th:include=
"include :: footer"
/>
<th:block
th:include=
"include :: select2-js"
/>
<th:block
th:include=
"include :: datetimepicker-js"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-js"
/>
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
<script
type=
"text/javascript"
>
var
prefix
=
ctx
+
"kylin/zhengzaiAppVersion"
;
var
platformUrl
=
"[[${platformUrl}]]"
;
function
submitHandler
()
{
if
(
$
.
validate
.
form
())
{
var
data
=
$
(
'#form-post-add'
).
serializeArray
();
$
.
operate
.
save
(
prefix
+
"/create"
,
data
);
}
}
$
(
function
()
{
$
(
"#fileinput-demo-1"
).
fileinput
({
'theme'
:
'explorer-fas'
,
// 'uploadUrl': "http://127.0.0.1:9003" + "/platform/basicServices/alOss/upload",
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
"uploadExtraData"
:
{
"pathName"
:
"zhengzaiAppVersion"
,
"buckType"
:
2
},
autoReplace
:
true
,
dropZoneTitle
:
"请上传文件"
,
maxFileCount
:
1
});
$
(
"#fileinput-demo-1"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
$
(
"#filePath"
).
val
(
data
.
response
.
ossPath
)
});
})
</script>
</body>
</html>
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/zhengzaiAppVersion/update.html
0 → 100644
View file @
2d6f06c7
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
>
<head>
<th:block
th:include=
"include :: header('修改banner')"
/>
<th:block
th:include=
"include :: select2-css"
/>
<th:block
th:include=
"include :: datetimepicker-css"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-css"
/>
</head>
<body
class=
"white-bg"
>
<div
class=
"wrapper wrapper-content animated fadeInRight ibox-content"
>
<form
class=
"form-horizontal m"
id=
"form-post-add"
>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label is-required"
>
名称:
</label>
<div
class=
"col-sm-10"
>
<input
class=
"form-control"
type=
"text"
name=
"name"
id=
"name"
required
th:value=
"${ZhengzaiAppVersionsVo.name}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label is-required"
>
版本号:
</label>
<div
class=
"col-sm-10"
>
<input
class=
"form-control"
type=
"text"
name=
"version"
id=
"version"
required
th:value=
"${ZhengzaiAppVersionsVo.version}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label is-required"
>
最小版本号:
</label>
<div
class=
"col-sm-10"
>
<input
class=
"form-control"
type=
"text"
name=
"minVersion"
id=
"minVersion"
required
th:value=
"${ZhengzaiAppVersionsVo.minVersion}"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
类型
</label>
<div
class=
"col-sm-10"
>
<div
class=
"radio check-box"
>
<label>
<input
th:checked=
"${ZhengzaiAppVersionsVo.type==1 ? true : false}"
type=
"radio"
value=
"1"
name=
"type"
checked=
""
>
IOS
</label>
</div>
<div
class=
"radio check-box"
>
<label>
<input
th:checked=
"${ZhengzaiAppVersionsVo.type==2 ? true : false}"
type=
"radio"
value=
"2"
name=
"type"
>
Android
</label>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
是否生产环境
</label>
<div
class=
"col-sm-10"
>
<div
class=
"radio check-box"
>
<label>
<input
th:checked=
"${ZhengzaiAppVersionsVo.isProduction==1 ? true : false}"
type=
"radio"
value=
"1"
name=
"isProduction"
checked=
""
>
是
</label>
</div>
<div
class=
"radio check-box"
>
<label>
<input
th:checked=
"${ZhengzaiAppVersionsVo.isProduction==2 ? true : false}"
type=
"radio"
value=
"2"
name=
"isProduction"
>
否
</label>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
是否强制升级
</label>
<div
class=
"col-sm-10"
>
<div
class=
"radio check-box"
>
<label>
<input
th:checked=
"${ZhengzaiAppVersionsVo.isForce==1 ? true : false}"
type=
"radio"
value=
"1"
name=
"isForce"
>
是
</label>
</div>
<div
class=
"radio check-box"
>
<label>
<input
th:checked=
"${ZhengzaiAppVersionsVo.isForce==2 ? true : false}"
type=
"radio"
value=
"2"
name=
"isForce"
checked=
""
>
否
</label>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-xs-2 control-label"
>
升级描述:
</label>
<div
class=
"col-xs-10"
>
<textarea
name=
"content"
maxlength=
"500"
class=
"form-control"
rows=
"3"
th:text=
"${ZhengzaiAppVersionsVo.content}"
></textarea>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"font-noraml"
>
Android请上传apk文件
</label>
<div
class=
"file-loading"
>
<input
id=
"fileinput-demo-1"
type=
"file"
name=
"files"
th:value=
"${ZhengzaiAppVersionsVo.filePath}"
data-browse-on-zone-click=
"true"
data-msg-placeholder=
"Select {files} for upload..."
>
</div>
</div>
<input
hidden
id=
"filePath"
name=
"filePath"
th:value=
"${ZhengzaiAppVersionsVo.filePath}"
>
</form>
</div>
<th:block
th:include=
"include :: footer"
/>
<th:block
th:include=
"include :: select2-js"
/>
<th:block
th:include=
"include :: datetimepicker-js"
/>
<th:block
th:include=
"include :: bootstrap-fileinput-js"
/>
<th:block
th:include=
"include :: bootstrap-suggest-js"
/>
<script
type=
"text/javascript"
>
var
prefix
=
ctx
+
"kylin/zhengzaiAppVersion"
;
var
platformUrl
=
"[[${platformUrl}]]"
;
var
filePath
=
"[[${ZhengzaiAppVersionsVo.filePath}]]"
;
var
zhengzaiAppVersionsId
=
"[[${ZhengzaiAppVersionsVo.zhengzaiAppVersionsId}]]"
;
function
submitHandler
()
{
if
(
$
.
validate
.
form
())
{
var
data
=
$
(
'#form-post-add'
).
serializeArray
();
data
.
push
({
"name"
:
"zhengzaiAppVersionsId"
,
"value"
:
zhengzaiAppVersionsId
});
$
.
operate
.
save
(
prefix
+
"/update"
,
data
);
}
}
$
(
function
()
{
$
(
"#fileinput-demo-1"
).
fileinput
({
'theme'
:
'explorer-fas'
,
// 'uploadUrl': "http://127.0.0.1:9003" + "/platform/basicServices/alOss/upload",
'uploadUrl'
:
platformUrl
+
"/platform/basicServices/alOss/upload"
,
// 'uploadUrl': ctx + "system/user/profile/updateAvatar",
"uploadExtraData"
:
{
"pathName"
:
"zhengzaiAppVersion"
,
"buckType"
:
2
},
overwriteInitial
:
false
,
initialPreviewAsData
:
true
,
dropZoneTitle
:
"请上传文件"
,
autoReplace
:
true
,
maxFileCount
:
1
,
initialPreview
:
[
"https://app.zhengzai.tv/"
+
filePath
],
initialPreviewFileType
:
"apk"
,
initialPreviewConfig
:[{
"caption"
:
filePath
,
"downloadUrl"
:
"https://app.zhengzai.tv/"
+
filePath
,
"size"
:
""
,
"key"
:
0
}]
});
$
(
"#fileinput-demo-1"
).
on
(
"fileuploaded"
,
function
(
event
,
data
,
previewId
,
index
)
{
$
(
"#filePath"
).
val
(
data
.
response
.
ossPath
)
});
})
</script>
</body>
</html>
\ No newline at end of file
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-web/src/main/resources/templates/zhengzai/kylin/zhengzaiAppVersion/zhengzaiAppVersion.html
0 → 100644
View file @
2d6f06c7
<!DOCTYPE html>
<html
lang=
"zh"
xmlns:th=
"http://www.thymeleaf.org"
xmlns:shiro=
"http://www.pollix.at/thymeleaf/shiro"
>
<head>
<th:block
th:include=
"include :: header('Banner列表')"
/>
</head>
<body
class=
"gray-bg"
>
<div
class=
"container-div"
>
<div
class=
"row"
>
<div
class=
"col-sm-12 search-collapse"
>
<form
id=
"formId"
>
<div
class=
"select-list"
>
<ul>
<li>
<label>
类型:
</label>
<select
name=
"type"
>
<option
value=
""
>
全部
</option>
<option
value=
"1"
>
IOS
</option>
<option
value=
"2"
>
Android
</option>
</select>
</li>
<li>
<a
class=
"btn btn-primary btn-rounded btn-sm"
onclick=
"$.table.search()"
><i
class=
"fa fa-search"
></i>
搜索
</a>
<a
class=
"btn btn-warning btn-rounded btn-sm"
onclick=
"$.form.reset()"
><i
class=
"fa fa-refresh"
></i>
重置
</a>
</li>
</ul>
</div>
</form>
</div>
<div
class=
"btn-group-sm"
id=
"toolbar"
role=
"group"
>
<a
class=
"btn btn-success"
onclick=
"$.operate.add()"
shiro:hasPermission=
"kylin:zhengzaiAppVersion:create"
>
<i
class=
"fa fa-plus"
></i>
添加
</a>
<a
class=
"btn btn-danger multiple disabled"
onclick=
"$.operate.removeAll()"
shiro:hasPermission=
"kylin:zhengzaiAppVersion:delete"
>
删除
</a>
</div>
<div
class=
"col-sm-12 select-table table-bordered"
>
<table
id=
"bootstrap-table"
></table>
</div>
</div>
</div>
<th:block
th:include=
"include :: footer"
/>
<script
th:inline=
"javascript"
>
var
updateFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:zhengzaiAppVersion:update'
)}]];
var
removeFlag
=
[[
$
{@
permission
.
hasPermi
(
'kylin:zhengzaiAppVersion:delete'
)}]];
var
prefix
=
ctx
+
"kylin/zhengzaiAppVersion"
;
$
(
function
()
{
var
options
=
{
url
:
prefix
+
"/list"
,
updateUrl
:
prefix
+
"/update/{id}"
,
createUrl
:
prefix
+
"/create"
,
removeUrl
:
prefix
+
"/delete"
,
modalName
:
"版本"
,
columns
:
[{
checkbox
:
true
},
{
field
:
'zhengzaiAppVersionsId'
,
title
:
'ID'
},
{
field
:
'name'
,
title
:
'名称'
},
{
field
:
'version'
,
title
:
'版本号'
},
{
field
:
'minVersion'
,
title
:
'最小版本号'
},
{
field
:
''
,
title
:
'类型'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.
type
==
1
)
{
return
"IOS"
;
}
else
{
return
"Android"
;
}
}
},
{
field
:
''
,
title
:
'是否生产环境'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.
isProduction
==
1
)
{
return
"是"
;
}
else
{
return
"否"
;
}
}
},
{
field
:
''
,
title
:
'是否强制升级'
,
formatter
:
function
(
value
,
row
,
index
)
{
if
(
row
.
isForce
==
1
)
{
return
"是"
;
}
else
{
return
"否"
;
}
}
},
{
title
:
'操作'
,
align
:
'center'
,
formatter
:
function
(
value
,
row
,
index
)
{
var
actions
=
[];
actions
.
push
(
'<a class="btn btn-success btn-xs '
+
updateFlag
+
'" href="javascript:void(0)" onclick="$.operate.edit(
\'
'
+
row
.
zhengzaiAppVersionsId
+
'
\'
)"></i>编辑</a> '
);
actions
.
push
(
'<a class="btn btn-danger btn-xs '
+
removeFlag
+
'" href="javascript:void(0)" onclick="$.operate.remove(
\'
'
+
row
.
zhengzaiAppVersionsId
+
'
\'
)"></i>删除</a> '
);
return
actions
.
join
(
''
);
}
}]
};
$
.
table
.
init
(
options
);
});
</script>
</body>
</html>
\ No newline at end of file
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinBannersServiceImpl.java
View file @
2d6f06c7
...
@@ -38,7 +38,6 @@ import org.springframework.util.StringUtils;
...
@@ -38,7 +38,6 @@ import org.springframework.util.StringUtils;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* <p>
* <p>
...
...
liquidnet-bus-client/liquidnet-client-admin/liquidnet-client-admin-zhengzai/src/main/java/com/liquidnet/client/admin/zhengzai/kylin/service/impl/KylinZhengzaiAppVersionsServiceImpl.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
client
.
admin
.
zhengzai
.
kylin
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.commons.lang.util.BeanUtil
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao
;
import
com.liquidnet.service.kylin.dto.param.ZhengzaiAppVersionsParam
;
import
com.liquidnet.service.kylin.dto.param.admin.ZhengzaiAppVersionsSearchParam
;
import
com.liquidnet.service.kylin.dto.vo.admin.ZhengzaiAppVersionsVo
;
import
com.liquidnet.service.kylin.entity.KylinBanners
;
import
com.liquidnet.service.kylin.entity.KylinZhengzaiAppVersions
;
import
com.liquidnet.service.kylin.mapper.KylinBannersMapper
;
import
com.liquidnet.service.kylin.mapper.KylinZhengzaiAppVersionsMapper
;
import
com.liquidnet.service.kylin.service.admin.IKylinBannersService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.mongodb.core.MongoTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* <p>
* 正在现场app版本控制 服务实现类
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Service
public
class
KylinZhengzaiAppVersionsServiceImpl
extends
ServiceImpl
<
KylinBannersMapper
,
KylinBanners
>
implements
IKylinBannersService
{
@Value
(
"${liquidnet.al-oss.appUrl}"
)
private
String
appUrl
;
@Autowired
private
KylinZhengzaiAppVersionsMapper
kylinZhengzaiAppVersionsMapper
;
@Autowired
RedisUtil
redisUtil
;
public
boolean
create
(
ZhengzaiAppVersionsParam
zhengzaiAppVersionsParam
)
{
try
{
// 入数据库
String
zhengzaiAppVersionsId
=
IDGenerator
.
nextSnowId
();
zhengzaiAppVersionsParam
.
setZhengzaiAppVersionsId
(
zhengzaiAppVersionsId
);
zhengzaiAppVersionsParam
.
setCreatedAt
(
DateUtil
.
getNowTime
());
KylinZhengzaiAppVersions
kylinZhengzaiAppVersions
=
new
KylinZhengzaiAppVersions
();
BeanUtils
.
copyProperties
(
zhengzaiAppVersionsParam
,
kylinZhengzaiAppVersions
);
kylinZhengzaiAppVersionsMapper
.
insert
(
kylinZhengzaiAppVersions
);
return
true
;
}
catch
(
Exception
e
)
{
return
false
;
}
}
public
boolean
update
(
ZhengzaiAppVersionsParam
zhengzaiAppVersionsParam
)
{
try
{
// 入数据库
String
zhengzaiAppVersionsId
=
zhengzaiAppVersionsParam
.
getZhengzaiAppVersionsId
();
zhengzaiAppVersionsParam
.
setUpdatedAt
(
DateUtil
.
getNowTime
());
KylinZhengzaiAppVersions
kylinZhengzaiAppVersions
=
new
KylinZhengzaiAppVersions
();
BeanUtils
.
copyProperties
(
zhengzaiAppVersionsParam
,
kylinZhengzaiAppVersions
);
kylinZhengzaiAppVersionsMapper
.
update
(
kylinZhengzaiAppVersions
,
new
UpdateWrapper
<
KylinZhengzaiAppVersions
>().
eq
(
"zhengzai_app_versions_id"
,
zhengzaiAppVersionsId
));
return
true
;
}
catch
(
Exception
e
)
{
return
false
;
}
}
public
ZhengzaiAppVersionsVo
detail
(
String
zhengzaiAppVersionsId
)
{
KylinZhengzaiAppVersions
data
=
kylinZhengzaiAppVersionsMapper
.
selectOne
(
new
UpdateWrapper
<
KylinZhengzaiAppVersions
>().
eq
(
"zhengzai_app_versions_id"
,
zhengzaiAppVersionsId
).
eq
(
"is_deleted"
,
1
)
);
ZhengzaiAppVersionsVo
zhengzaiAppVersionsVo
=
new
ZhengzaiAppVersionsVo
();
if
(
null
!=
data
)
{
BeanUtils
.
copyProperties
(
data
,
zhengzaiAppVersionsVo
);
}
else
{
return
null
;
}
return
zhengzaiAppVersionsVo
;
}
public
PageInfo
<
ZhengzaiAppVersionsListDao
>
listInfo
(
ZhengzaiAppVersionsSearchParam
zhengzaiAppVersionsSearchParam
)
{
try
{
PageHelper
.
startPage
(
zhengzaiAppVersionsSearchParam
.
getPageNum
(),
zhengzaiAppVersionsSearchParam
.
getPageSize
());
List
<
ZhengzaiAppVersionsListDao
>
voList
=
kylinZhengzaiAppVersionsMapper
.
searchList
(
BeanUtil
.
convertBeanToMap
(
zhengzaiAppVersionsSearchParam
));
for
(
ZhengzaiAppVersionsListDao
item
:
voList
)
{
// item.setCoverImg(imgUrl + item.getCoverImg());
}
return
new
PageInfo
(
voList
);
}
catch
(
Exception
e
)
{
return
new
PageInfo
(
new
ArrayList
());
}
}
public
Boolean
delete
(
List
<
String
>
zhengzaiAppVersionsIds
)
{
try
{
KylinZhengzaiAppVersions
kylinZhengzaiAppVersions
=
new
KylinZhengzaiAppVersions
();
kylinZhengzaiAppVersions
.
setUpdatedAt
(
DateUtil
.
getNowTime
());
kylinZhengzaiAppVersions
.
setIsDeleted
(
2
);
kylinZhengzaiAppVersionsMapper
.
update
(
kylinZhengzaiAppVersions
,
new
UpdateWrapper
<
KylinZhengzaiAppVersions
>().
in
(
"zhengzai_app_versions_id"
,
zhengzaiAppVersionsIds
)
);
return
true
;
}
catch
(
Exception
e
)
{
return
false
;
}
}
}
liquidnet-bus-client/liquidnet-client-admin/pom.xml
View file @
2d6f06c7
...
@@ -256,10 +256,6 @@
...
@@ -256,10 +256,6 @@
<dependencies>
<dependencies>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
</dependency>
<dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-core
</artifactId>
<artifactId>
hutool-core
</artifactId>
...
...
liquidnet-bus-client/pom.xml
View file @
2d6f06c7
...
@@ -48,11 +48,6 @@
...
@@ -48,11 +48,6 @@
<type>
pom
</type>
<type>
pom
</type>
<scope>
import
</scope>
<scope>
import
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
<version>
3.10.2
</version>
</dependency>
<dependency>
<dependency>
<groupId>
cn.hutool
</groupId>
<groupId>
cn.hutool
</groupId>
<artifactId>
hutool-all
</artifactId>
<artifactId>
hutool-all
</artifactId>
...
...
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/FilesUtils.java
View file @
2d6f06c7
...
@@ -2,10 +2,9 @@ package com.liquidnet.commons.lang.util;
...
@@ -2,10 +2,9 @@ package com.liquidnet.commons.lang.util;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.FileOutputStream
;
import
java.io.*
;
import
java.io.InputStream
;
import
java.math.BigInteger
;
import
java.io.OutputStream
;
import
java.security.MessageDigest
;
import
java.io.File
;
/**
/**
* aloss 上传MultipartFile to File
* aloss 上传MultipartFile to File
...
@@ -56,8 +55,40 @@ public class FilesUtils {
...
@@ -56,8 +55,40 @@ public class FilesUtils {
*/
*/
public
static
void
delteTempFile
(
File
file
)
{
public
static
void
delteTempFile
(
File
file
)
{
if
(
file
!=
null
)
{
if
(
file
!=
null
)
{
File
del
=
new
File
(
file
.
toURI
());
file
.
delete
();
del
.
delete
();
}
}
/**
* 获取文件的md5值
* @param file 文件
* @return 返回文件的md5值字符串
*/
public
static
String
getFileMD5
(
File
file
)
{
if
(!
file
.
isFile
())
{
return
null
;
}
MessageDigest
digest
=
null
;
FileInputStream
in
=
null
;
byte
buffer
[]
=
new
byte
[
8192
];
int
len
;
try
{
digest
=
MessageDigest
.
getInstance
(
"MD5"
);
in
=
new
FileInputStream
(
file
);
while
((
len
=
in
.
read
(
buffer
))
!=
-
1
)
{
digest
.
update
(
buffer
,
0
,
len
);
}
BigInteger
bigInt
=
new
BigInteger
(
1
,
digest
.
digest
());
return
bigInt
.
toString
(
16
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
finally
{
try
{
in
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
}
...
...
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/IdentityUtils.java
View file @
2d6f06c7
...
@@ -4,10 +4,10 @@ import org.springframework.util.LinkedMultiValueMap;
...
@@ -4,10 +4,10 @@ import org.springframework.util.LinkedMultiValueMap;
import
org.springframework.util.MultiValueMap
;
import
org.springframework.util.MultiValueMap
;
public
class
IdentityUtils
{
public
class
IdentityUtils
{
private
String
aliThirdUrl
=
"https://1.api.apistore.cn/idcard3"
;
private
static
String
aliThirdUrl
=
"https://1.api.apistore.cn/idcard3"
;
private
String
aliThirdAppCode
=
"cc29fa8cb494468289dec09df46922b5"
;
private
static
String
aliThirdAppCode
=
"cc29fa8cb494468289dec09df46922b5"
;
public
String
aliThird
(
String
realName
,
String
cardNo
){
public
static
String
aliThird
(
String
realName
,
String
cardNo
){
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>();
MultiValueMap
<
String
,
String
>
params
=
new
LinkedMultiValueMap
<>();
params
.
add
(
"realName"
,
realName
);
params
.
add
(
"realName"
,
realName
);
params
.
add
(
"cardNo"
,
cardNo
);
params
.
add
(
"cardNo"
,
cardNo
);
...
...
liquidnet-bus-common/liquidnet-common-service-base/src/main/java/com/liquidnet/service/base/SmsMessage.java
View file @
2d6f06c7
...
@@ -12,6 +12,17 @@ public class SmsMessage implements Serializable, Cloneable {
...
@@ -12,6 +12,17 @@ public class SmsMessage implements Serializable, Cloneable {
private
String
templateCode
;
private
String
templateCode
;
private
ObjectNode
templateParam
;
private
ObjectNode
templateParam
;
public
SmsMessage
()
{
}
public
SmsMessage
(
String
json
)
{
SmsMessage
smsMessage
=
JsonUtils
.
fromJson
(
json
,
SmsMessage
.
class
);
this
.
phone
=
smsMessage
.
getPhone
();
this
.
signName
=
smsMessage
.
getSignName
();
this
.
templateCode
=
smsMessage
.
getTemplateCode
();
this
.
templateParam
=
smsMessage
.
getTemplateParam
();
}
public
String
getPhone
()
{
public
String
getPhone
()
{
return
phone
;
return
phone
;
}
}
...
@@ -30,7 +41,7 @@ public class SmsMessage implements Serializable, Cloneable {
...
@@ -30,7 +41,7 @@ public class SmsMessage implements Serializable, Cloneable {
private
final
static
SmsMessage
instance
=
new
SmsMessage
();
private
final
static
SmsMessage
instance
=
new
SmsMessage
();
public
static
SmsMessage
getNew
()
{
public
static
SmsMessage
builder
()
{
try
{
try
{
return
(
SmsMessage
)
instance
.
clone
();
return
(
SmsMessage
)
instance
.
clone
();
}
catch
(
CloneNotSupportedException
e
)
{
}
catch
(
CloneNotSupportedException
e
)
{
...
@@ -60,4 +71,8 @@ public class SmsMessage implements Serializable, Cloneable {
...
@@ -60,4 +71,8 @@ public class SmsMessage implements Serializable, Cloneable {
this
.
templateParam
.
put
(
key
,
val
);
this
.
templateParam
.
put
(
key
,
val
);
return
this
;
return
this
;
}
}
public
String
toJson
()
{
return
JsonUtils
.
toJson
(
this
);
}
}
}
liquidnet-bus-config/liquidnet-config/liquidnet-client-admin-web.yml
View file @
2d6f06c7
...
@@ -36,9 +36,7 @@ liquidnet:
...
@@ -36,9 +36,7 @@ liquidnet:
url26
:
"
${liquidnet.client.admin.phpPassportUrl}/admin/vip/card/list?page=1&per_page=50&status=1"
#摩登会员
url26
:
"
${liquidnet.client.admin.phpPassportUrl}/admin/vip/card/list?page=1&per_page=50&status=1"
#摩登会员
al-oss
:
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
imgUrl
:
"
https://img.zhengzai.tv/"
endpoint
:
http://oss-cn-hangzhou.aliyuncs.com
appUrl
:
"
https://app.zhengzai.tv/"
accessKeyId
:
LTAI4FxrURzMvvu9reFgwY5o
accessKeySecret
:
Ym5tfAxOf2zX20MgjikLI3Wz3tlwVV
shunfeng
:
shunfeng
:
url
:
${liquidnet.client.admin.shunfeng.url}
url
:
${liquidnet.client.admin.shunfeng.url}
sk
:
${liquidnet.client.admin.shunfeng.sk}
sk
:
${liquidnet.client.admin.shunfeng.sk}
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-dragon-dev.yml
View file @
2d6f06c7
...
@@ -25,10 +25,10 @@ liquidnet:
...
@@ -25,10 +25,10 @@ liquidnet:
dragon
:
dragon
:
alipay
:
alipay
:
gataway-url
:
https://openapi.alipay.com/gateway.do
gataway-url
:
https://openapi.alipay.com/gateway.do
notify-url
:
https://test
pay.zhengzai.tv
/alipay
notify-url
:
https://test
dragon.zhengzai.tv/dragon/notify
/alipay
wepay
:
wepay
:
gataway-url
:
https://openapi.alipay.com/gateway.do
gataway-url
:
https://openapi.alipay.com/gateway.do
notify-url
:
https://test
pay.zhengzai.tv
/wepay
notify-url
:
https://test
dragon.zhengzai.tv/dragon/notify
/wepay
merchantId
:
1551961491
merchantId
:
1551961491
appId
:
wx3498304dda39c5a1
appId
:
wx3498304dda39c5a1
parentKey
:
itIuO65O9yKmemOu3S8g1S4orqvCGwXK
parentKey
:
itIuO65O9yKmemOu3S8g1S4orqvCGwXK
...
...
liquidnet-bus-config/liquidnet-config/liquidnet-service-dragon-test.yml
View file @
2d6f06c7
...
@@ -25,10 +25,10 @@ liquidnet:
...
@@ -25,10 +25,10 @@ liquidnet:
dragon
:
dragon
:
alipay
:
alipay
:
gataway-url
:
https://openapi.alipay.com/gateway.do
gataway-url
:
https://openapi.alipay.com/gateway.do
notify-url
:
https://test
pay.zhengzai.tv
/alipay
notify-url
:
https://test
dragon.zhengzai.tv/dragon/notify
/alipay
wepay
:
wepay
:
gataway-url
:
https://openapi.alipay.com/gateway.do
gataway-url
:
https://openapi.alipay.com/gateway.do
notify-url
:
https://test
pay.zhengzai.tv
/wepay
notify-url
:
https://test
dragon.zhengzai.tv/dragon/notify
/wepay
merchantId
:
1551961491
merchantId
:
1551961491
appId
:
wx3498304dda39c5a1
appId
:
wx3498304dda39c5a1
parentKey
:
itIuO65O9yKmemOu3S8g1S4orqvCGwXK
parentKey
:
itIuO65O9yKmemOu3S8g1S4orqvCGwXK
\ No newline at end of file
liquidnet-bus-config/liquidnet-config/liquidnet-service-dragon.yml
View file @
2d6f06c7
...
@@ -174,7 +174,4 @@ global-auth:
...
@@ -174,7 +174,4 @@ global-auth:
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
liquidnet
:
\ No newline at end of file
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
\ No newline at end of file
liquidnet-bus-config/liquidnet-config/liquidnet-service-kylin-dev.yml
View file @
2d6f06c7
...
@@ -28,5 +28,3 @@ liquidnet:
...
@@ -28,5 +28,3 @@ liquidnet:
localUrl
:
${liquidnet.service.kylin.url-pay.localUrl}
localUrl
:
${liquidnet.service.kylin.url-pay.localUrl}
url-service
:
url-service
:
url
:
${liquidnet.service.kylin.url-service.url}
url
:
${liquidnet.service.kylin.url-service.url}
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
liquidnet-bus-config/liquidnet-config/liquidnet-service-kylin-test.yml
View file @
2d6f06c7
...
@@ -28,5 +28,3 @@ liquidnet:
...
@@ -28,5 +28,3 @@ liquidnet:
localUrl
:
${liquidnet.service.kylin.url-pay.localUrl}
localUrl
:
${liquidnet.service.kylin.url-pay.localUrl}
url-service
:
url-service
:
url
:
${liquidnet.service.kylin.url-service.url}
url
:
${liquidnet.service.kylin.url-service.url}
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
liquidnet-bus-config/liquidnet-config/liquidnet-service-order-dev.yml
View file @
2d6f06c7
...
@@ -28,5 +28,3 @@ liquidnet:
...
@@ -28,5 +28,3 @@ liquidnet:
localUrl
:
${liquidnet.service.order.url-pay.localUrl}
localUrl
:
${liquidnet.service.order.url-pay.localUrl}
url-service
:
url-service
:
url
:
${liquidnet.service.order.url-service.url}
url
:
${liquidnet.service.order.url-service.url}
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
liquidnet-bus-config/liquidnet-config/liquidnet-service-order-test.yml
View file @
2d6f06c7
...
@@ -28,5 +28,3 @@ liquidnet:
...
@@ -28,5 +28,3 @@ liquidnet:
localUrl
:
${liquidnet.service.order.url-pay.localUrl}
localUrl
:
${liquidnet.service.order.url-pay.localUrl}
url-service
:
url-service
:
url
:
${liquidnet.service.order.url-service.url}
url
:
${liquidnet.service.order.url-service.url}
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
liquidnet-bus-config/liquidnet-config/liquidnet-service-order.yml
View file @
2d6f06c7
...
@@ -174,7 +174,4 @@ global-auth:
...
@@ -174,7 +174,4 @@ global-auth:
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
liquidnet
:
\ No newline at end of file
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
\ No newline at end of file
liquidnet-bus-config/liquidnet-config/liquidnet-service-platform.yml
View file @
2d6f06c7
...
@@ -64,8 +64,8 @@ spring:
...
@@ -64,8 +64,8 @@ spring:
name
:
${liquidnet.info.name}
name
:
${liquidnet.info.name}
servlet
:
servlet
:
multipart
:
multipart
:
max-file-size
:
5MB
max-file-size
:
5
0
MB
max-request-size
:
10MB
max-request-size
:
10
0
MB
profiles
:
profiles
:
include
:
common-service
#这里加载management相关公共配置
include
:
common-service
#这里加载management相关公共配置
rabbitmq
:
rabbitmq
:
...
@@ -148,3 +148,16 @@ global-auth:
...
@@ -148,3 +148,16 @@ global-auth:
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
# -----------------------------------------------------------
liquidnet
:
al-oss
:
imgUrl
:
"
https://img.zhengzai.tv/"
appUrl
:
"
https://app.zhengzai.tv/"
endpoint
:
http://oss-cn-hangzhou.aliyuncs.com
accessKeyId
:
LTAI4FxrURzMvvu9reFgwY5o
accessKeySecret
:
Ym5tfAxOf2zX20MgjikLI3Wz3tlwVV
zhengzai-wechat
:
appid
:
wx3498304dda39c5a1
secret
:
a1307fab0a5f2380086a7c636f7339ea
modernsky-wechat
:
appid
:
wx769aa9167bef9ce2
secret
:
bebccc204b9472ba41661372b197eb81
\ No newline at end of file
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/dao/ZhengzaiAppVersionsListDao.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
dao
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
ZhengzaiAppVersionsListDao
implements
Serializable
{
private
String
zhengzaiAppVersionsId
;
private
String
name
;
private
String
filePath
;
private
String
version
;
private
String
minVersion
;
private
Integer
type
;
private
Integer
isProduction
;
private
Integer
isForce
;
private
Integer
status
;
private
String
content
;
/**
* 创建时间
*/
private
String
createdAt
;
/**
* 修改时间
*/
private
String
updatedAt
;
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/entity/KylinZhengzaiAppVersions.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
/**
* <p>
* 正在现场app版本控制
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
KylinZhengzaiAppVersions
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
private
Integer
mid
;
private
String
zhengzaiAppVersionsId
;
private
String
name
;
private
String
filePath
;
private
String
version
;
private
String
minVersion
;
private
Integer
type
;
private
Integer
isProduction
;
private
Integer
isForce
;
private
Integer
isDeleted
;
private
String
content
;
/**
* 创建时间
*/
private
String
createdAt
;
/**
* 修改时间
*/
private
String
updatedAt
;
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/entity/PlatformOssFiles.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.io.Serializable
;
/**
* <p>
* OSS上传 模型
* </p>
*
* @author jiangxiulong
* @since 2021-07-12
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
public
class
PlatformOssFiles
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@TableId
(
value
=
"mid"
,
type
=
IdType
.
AUTO
)
private
Integer
mid
;
private
String
ossFilesId
;
private
String
fileName
;
private
String
ossPath
;
private
String
contentType
;
private
Integer
size
;
private
String
md5str
;
private
String
uploaderUid
;
private
String
uploaderName
;
/**
* 创建时间
*/
private
String
createdAt
;
/**
* 修改时间
*/
private
String
updatedAt
;
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/mapper/KylinZhengzaiAppVersionsMapper.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao
;
import
com.liquidnet.service.kylin.entity.KylinZhengzaiAppVersions
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 正在现场app版本控制 Mapper 接口 处理数据库
* </p>
*
* @author jiangxiulong
* @since 2021-07-11
*/
public
interface
KylinZhengzaiAppVersionsMapper
extends
BaseMapper
<
KylinZhengzaiAppVersions
>
{
List
<
ZhengzaiAppVersionsListDao
>
searchList
(
Map
<
String
,
Object
>
convertBeanToMap
);
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/java/com/liquidnet/service/kylin/mapper/PlatformOssFilesMapper.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
kylin
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.liquidnet.service.kylin.entity.PlatformOssFiles
;
/**
* <p>
* OSS上传 Mapper 接口 处理数据库
* </p>
*
* @author jiangxiulong
* @since 2021-07-12
*/
public
interface
PlatformOssFilesMapper
extends
BaseMapper
<
PlatformOssFiles
>
{
}
liquidnet-bus-do/liquidnet-service-kylin-do/src/main/resources/com.liquidnet.service.kylin.mapper/KylinZhengzaiAppVersionsMapper.xml
0 → 100644
View file @
2d6f06c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.liquidnet.service.kylin.mapper.KylinZhengzaiAppVersionsMapper"
>
<select
id=
"searchList"
parameterType=
"java.util.Map"
resultType=
"com.liquidnet.service.kylin.dao.ZhengzaiAppVersionsListDao"
>
SELECT *
FROM kylin_zhengzai_app_versions
<where>
is_deleted = 1
<if
test=
"type != ''"
>
AND type = ${type}
</if>
</where>
ORDER BY mid DESC
</select>
</mapper>
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamLoginController.java
View file @
2d6f06c7
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/controller/AdamUserController.java
View file @
2d6f06c7
...
@@ -190,7 +190,8 @@ public class AdamUserController {
...
@@ -190,7 +190,8 @@ public class AdamUserController {
@RequestParam
String
code
)
{
@RequestParam
String
code
)
{
log
.
debug
(
"mobile:{},code:{}"
,
mobile
,
code
);
log
.
debug
(
"mobile:{},code:{}"
,
mobile
,
code
);
if
(!
this
.
checkSmsCode
(
mobile
,
code
))
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10004"
));
ResponseDto
checkSmsCodeDto
=
this
.
checkSmsCode
(
mobile
,
code
);
if
(!
checkSmsCodeDto
.
isSuccess
())
return
checkSmsCodeDto
;
return
ResponseDto
.
success
(
adamUserInfoService
.
editMobile
(
CurrentUtil
.
getCurrentUid
(),
mobile
));
return
ResponseDto
.
success
(
adamUserInfoService
.
editMobile
(
CurrentUtil
.
getCurrentUid
(),
mobile
));
}
}
...
@@ -241,10 +242,6 @@ public class AdamUserController {
...
@@ -241,10 +242,6 @@ public class AdamUserController {
public
ResponseDto
<
List
<
AdamThirdPartInfoVo
>>
bindTpa
(
@Valid
@RequestBody
AdamThirdPartParam
parameter
)
{
public
ResponseDto
<
List
<
AdamThirdPartInfoVo
>>
bindTpa
(
@Valid
@RequestBody
AdamThirdPartParam
parameter
)
{
log
.
debug
(
"login by tpa:{}"
,
JsonUtils
.
toJson
(
parameter
));
log
.
debug
(
"login by tpa:{}"
,
JsonUtils
.
toJson
(
parameter
));
if
(
StringUtils
.
isBlank
(
parameter
.
getOpenId
()))
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10009"
));
}
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
currentUid
=
CurrentUtil
.
getCurrentUid
();
String
existUid
=
adamRdmService
.
getUidByPlatformOpenId
(
parameter
.
getPlatform
(),
parameter
.
getOpenId
());
String
existUid
=
adamRdmService
.
getUidByPlatformOpenId
(
parameter
.
getPlatform
(),
parameter
.
getOpenId
());
...
@@ -307,27 +304,32 @@ public class AdamUserController {
...
@@ -307,27 +304,32 @@ public class AdamUserController {
private
static
final
String
PHP_API_SMS_CODE_VALID
=
"/smsValidation"
;
private
static
final
String
PHP_API_SMS_CODE_VALID
=
"/smsValidation"
;
private
boolean
checkSmsCode
(
String
mobile
,
String
code
)
{
private
ResponseDto
checkSmsCode
(
String
mobile
,
String
code
)
{
if
(
Arrays
.
asList
(
LnsEnum
.
ENV
.
dev
.
name
(),
LnsEnum
.
ENV
.
test
.
name
()).
contains
(
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
))
if
(
Arrays
.
asList
(
LnsEnum
.
ENV
.
dev
.
name
(),
LnsEnum
.
ENV
.
test
.
name
()).
contains
(
env
.
getProperty
(
CurrentUtil
.
CK_ENV_ACTIVE
))
&&
CurrentUtil
.
GRAY_LOGIN_SMS_CODE
.
equals
(
code
))
{
&&
CurrentUtil
.
GRAY_LOGIN_SMS_CODE
.
equals
(
code
))
{
return
true
;
return
ResponseDto
.
success
()
;
}
}
LinkedMultiValueMap
<
String
,
String
>
paramsMap
=
new
LinkedMultiValueMap
<>();
// LinkedMultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap
.
add
(
"mobile"
,
mobile
);
// paramsMap.add("mobile", mobile);
paramsMap
.
add
(
"code"
,
code
);
// paramsMap.add("code", code);
LinkedMultiValueMap
<
String
,
String
>
headersMap
=
new
LinkedMultiValueMap
<>();
// LinkedMultiValueMap<String, String> headersMap = new LinkedMultiValueMap<>();
headersMap
.
add
(
"token"
,
null
);
// headersMap.add("token", null);
try
{
// try {
String
respStr
=
HttpUtil
.
get
(
env
.
getProperty
(
"liquidnet.url-service.url"
)
+
PHP_API_SMS_CODE_VALID
,
paramsMap
,
headersMap
);
// String respStr = HttpUtil.get(env.getProperty("liquidnet.url-service.url") + PHP_API_SMS_CODE_VALID, paramsMap, headersMap);
log
.
debug
(
"###PHP.API.RESP:{}"
,
respStr
);
// log.debug("###PHP.API.RESP:{}", respStr);
//
Map
respMap
=
JsonUtils
.
fromJson
(
respStr
,
Map
.
class
);
// Map respMap = JsonUtils.fromJson(respStr, Map.class);
//
return
StringUtils
.
equalsIgnoreCase
(
"OK"
,
(
String
)
respMap
.
get
(
"message"
));
// return StringUtils.equalsIgnoreCase("OK", (String) respMap.get("message"));
}
catch
(
Exception
e
)
{
// } catch (Exception e) {
log
.
error
(
"验证码验证异常[mobile:{},code:{}]"
,
mobile
,
code
,
e
);
// log.error("验证码验证异常[mobile:{},code:{}]", mobile, code, e);
return
false
;
// return false;
// }
String
smsCodeByMobile
=
adamRdmService
.
getSmsCodeByMobile
(
mobile
);
if
(
null
==
smsCodeByMobile
)
{
return
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10003"
));
}
}
return
smsCodeByMobile
.
equals
(
code
)
?
ResponseDto
.
success
()
:
ResponseDto
.
failure
(
ErrorMapping
.
get
(
"10004"
));
}
}
}
}
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/AdamRdmService.java
View file @
2d6f06c7
...
@@ -35,6 +35,16 @@ public class AdamRdmService {
...
@@ -35,6 +35,16 @@ public class AdamRdmService {
return
null
==
i
?
1
:
i
;
return
null
==
i
?
1
:
i
;
}
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <Mobile, SMS CODE> */
public
boolean
setSmsCodeByMobile
(
String
mobile
,
String
smsCode
)
{
return
redisUtil
.
set
(
AdamRedisConst
.
VALID_SMS_CODE_MOBILE
+
mobile
,
smsCode
,
15
*
60
);
}
public
String
getSmsCodeByMobile
(
String
mobile
)
{
return
(
String
)
redisUtil
.
get
(
AdamRedisConst
.
VALID_SMS_CODE_MOBILE
+
mobile
);
}
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <Mobile|OPENID, UID> */
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | <Mobile|OPENID, UID> */
public
boolean
setUidByMobile
(
String
mobile
,
String
uid
)
{
public
boolean
setUidByMobile
(
String
mobile
,
String
uid
)
{
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamEntersServiceImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
adam
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
adam
.
service
.
impl
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.mq.constant.MQConst
;
import
com.liquidnet.common.mq.constant.MQConst
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.commons.lang.util.*
;
...
@@ -270,24 +271,31 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
...
@@ -270,24 +271,31 @@ public class AdamEntersServiceImpl implements IAdamEntersService {
}
}
private
void
identityHandler
(
String
currentUid
,
String
name
,
String
idCard
)
{
private
void
identityHandler
(
String
currentUid
,
String
name
,
String
idCard
)
{
String
respStr
=
null
;
// String respStr = null;
try
{
// try {
LinkedMultiValueMap
<
String
,
String
>
paramsMap
=
new
LinkedMultiValueMap
<>();
// LinkedMultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap
.
add
(
"realName"
,
name
);
// paramsMap.add("realName", name);
paramsMap
.
add
(
"cardNo"
,
idCard
);
// paramsMap.add("cardNo", idCard);
//
long
s
=
System
.
currentTimeMillis
();
// long s = System.currentTimeMillis();
respStr
=
HttpUtil
.
postToPhpApi
(
env
.
getProperty
(
"liquidnet.url-service.url"
)
+
PHP_API_REAL_NAME
,
paramsMap
);
// respStr = HttpUtil.postToPhpApi(env.getProperty("liquidnet.url-service.url") + PHP_API_REAL_NAME, paramsMap);
log
.
debug
(
"#PHP.API耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
// log.debug("#PHP.API耗时:{}ms", System.currentTimeMillis() - s);
log
.
debug
(
"###PHP.API[{}].RESP:{}"
,
PHP_API_REAL_NAME
,
respStr
);
// log.debug("###PHP.API[{}].RESP:{}", PHP_API_REAL_NAME, respStr);
Map
respMap
=
JsonUtils
.
fromJson
(
respStr
,
Map
.
class
);
// Map respMap = JsonUtils.fromJson(respStr, Map.class);
if
(
CollectionUtils
.
isEmpty
(
respMap
)
||
!
StringUtils
.
equalsIgnoreCase
(
"OK"
,
(
String
)
respMap
.
get
(
"message"
)))
{
// if (CollectionUtils.isEmpty(respMap) || !StringUtils.equalsIgnoreCase("OK", (String) respMap.get("message"))) {
log
.
warn
(
"PHP.API实名认证失败[uid:{},name:{},idCard:{},respStr:{}]"
,
currentUid
,
name
,
idCard
,
respStr
);
// log.warn("PHP.API实名认证失败[uid:{},name:{},idCard:{},respStr:{}]", currentUid, name, idCard, respStr);
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"10102"
);
// ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
// throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
// }
}
catch
(
Exception
e
)
{
// } catch (Exception e) {
log
.
error
(
"PHP.API实名认证异常[uid:{},name:{},idCard:{},respStr:{}]"
,
currentUid
,
name
,
idCard
,
respStr
,
e
);
// log.error("PHP.API实名认证异常[uid:{},name:{},idCard:{},respStr:{}]", currentUid, name, idCard, respStr, e);
// ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
// throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
// }
String
respStr
=
IdentityUtils
.
aliThird
(
name
,
idCard
);
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respStr
,
JsonNode
.
class
);
if
(
null
==
respJNode
||
!
"0"
.
equals
(
respJNode
.
get
(
"error_code"
).
asText
()))
{
log
.
info
(
"###实名认证失败[{}]"
,
respStr
);
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"10102"
);
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"10102"
);
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
}
}
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/java/com/liquidnet/service/adam/service/impl/AdamUserServiceImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
adam
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
adam
.
service
.
impl
;
import
com.fasterxml.jackson.databind.JsonNode
;
import
com.liquidnet.common.cache.redisson.util.RedisLockUtil
;
import
com.liquidnet.common.cache.redisson.util.RedisLockUtil
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.common.mq.constant.MQConst
;
import
com.liquidnet.common.mq.constant.MQConst
;
import
com.liquidnet.commons.lang.util.HttpUtil
;
import
com.liquidnet.commons.lang.util.*
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.commons.lang.util.JsonUtils
;
import
com.liquidnet.commons.lang.util.SensitizeUtil
;
import
com.liquidnet.service.adam.constant.AdamRedisConst
;
import
com.liquidnet.service.adam.constant.AdamRedisConst
;
import
com.liquidnet.service.adam.dto.AdamThirdPartParam
;
import
com.liquidnet.service.adam.dto.AdamThirdPartParam
;
import
com.liquidnet.service.adam.dto.vo.*
;
import
com.liquidnet.service.adam.dto.vo.*
;
...
@@ -367,23 +365,30 @@ public class AdamUserServiceImpl implements IAdamUserService {
...
@@ -367,23 +365,30 @@ public class AdamUserServiceImpl implements IAdamUserService {
vo
=
adamRdmService
.
getRealInfoVoByUid
(
uid
);
vo
=
adamRdmService
.
getRealInfoVoByUid
(
uid
);
if
(
null
==
vo
)
{
if
(
null
==
vo
)
{
if
(!
adamRdmService
.
isCertification
(
1
,
idCard
,
name
))
{
if
(!
adamRdmService
.
isCertification
(
1
,
idCard
,
name
))
{
String
respStr
=
null
;
// String respStr = null;
try
{
// try {
LinkedMultiValueMap
<
String
,
String
>
paramsMap
=
new
LinkedMultiValueMap
<>();
// LinkedMultiValueMap<String, String> paramsMap = new LinkedMultiValueMap<>();
paramsMap
.
add
(
"realName"
,
name
);
// paramsMap.add("realName", name);
paramsMap
.
add
(
"cardNo"
,
idCard
);
// paramsMap.add("cardNo", idCard);
long
s
=
System
.
currentTimeMillis
();
// long s = System.currentTimeMillis();
respStr
=
HttpUtil
.
postToPhpApi
(
env
.
getProperty
(
"liquidnet.url-service.url"
)
+
PHP_API_REAL_NAME
,
paramsMap
);
// respStr = HttpUtil.postToPhpApi(env.getProperty("liquidnet.url-service.url") + PHP_API_REAL_NAME, paramsMap);
log
.
debug
(
"#PHP.API耗时:{}ms"
,
System
.
currentTimeMillis
()
-
s
);
// log.debug("#PHP.API耗时:{}ms", System.currentTimeMillis() - s);
log
.
debug
(
"###PHP.API[{}].RESP:{}"
,
PHP_API_REAL_NAME
,
respStr
);
// log.debug("###PHP.API[{}].RESP:{}", PHP_API_REAL_NAME, respStr);
Map
respMap
=
JsonUtils
.
fromJson
(
respStr
,
Map
.
class
);
// Map respMap = JsonUtils.fromJson(respStr, Map.class);
if
(
CollectionUtils
.
isEmpty
(
respMap
)
||
!
StringUtils
.
equalsIgnoreCase
(
"OK"
,
(
String
)
respMap
.
get
(
"message"
)))
{
// if (CollectionUtils.isEmpty(respMap) || !StringUtils.equalsIgnoreCase("OK", (String) respMap.get("message"))) {
log
.
warn
(
"PHP.API实名认证失败[uid:{},name:{},idCard:{},respStr:{}]"
,
uid
,
name
,
idCard
,
respStr
);
// log.warn("PHP.API实名认证失败[uid:{},name:{},idCard:{},respStr:{}]", uid, name, idCard, respStr);
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"10102"
);
// ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
// throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
}
// }
}
catch
(
Exception
e
)
{
// } catch (Exception e) {
log
.
error
(
"PHP.API实名认证异常[uid:{},name:{},idCard:{},respStr:{}]"
,
uid
,
name
,
idCard
,
respStr
,
e
);
// log.error("PHP.API实名认证异常[uid:{},name:{},idCard:{},respStr:{}]", uid, name, idCard, respStr, e);
// ErrorMapping.ErrorMessage errorMessage = ErrorMapping.get("10102");
// throw new LiquidnetServiceException(errorMessage.getCode(), errorMessage.getMessage());
// }
String
respStr
=
IdentityUtils
.
aliThird
(
name
,
idCard
);
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respStr
,
JsonNode
.
class
);
if
(
null
==
respJNode
||
!
"0"
.
equals
(
respJNode
.
get
(
"error_code"
).
asText
()))
{
log
.
info
(
"###实名认证失败[{}]"
,
respStr
);
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"10102"
);
ErrorMapping
.
ErrorMessage
errorMessage
=
ErrorMapping
.
get
(
"10102"
);
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
throw
new
LiquidnetServiceException
(
errorMessage
.
getCode
(),
errorMessage
.
getMessage
());
}
}
...
...
liquidnet-bus-service/liquidnet-service-adam/liquidnet-service-adam-impl/src/main/resources/errors.properties
View file @
2d6f06c7
...
@@ -5,8 +5,8 @@
...
@@ -5,8 +5,8 @@
10000
=
请求频繁,稍后再试
10000
=
请求频繁,稍后再试
10001
=
10001
=
10002
=
10002
=
验证码发送失败
10003
=
验证码发送失败
10003
=
已超时,请重新获取验证码
10004
=
手机验证码错误
10004
=
手机验证码错误
10005
=
手机号获取失败,请更换登录方式
10005
=
手机号获取失败,请更换登录方式
10006
=
第三方账号未注册
10006
=
第三方账号未注册
...
...
liquidnet-bus-service/liquidnet-service-consumer-all/liquidnet-service-consumer-adam/src/main/java/com/liquidnet/service/consumer/adam/service/processor/ConsumerAdamUCenterProcessor.java
View file @
2d6f06c7
...
@@ -68,8 +68,8 @@ public class ConsumerAdamUCenterProcessor {
...
@@ -68,8 +68,8 @@ public class ConsumerAdamUCenterProcessor {
log
.
info
(
"CONSUMER SQL ==> [consumerQueue:{},deliveryTag:{}]"
,
consumerQueue
,
deliveryTag
);
log
.
info
(
"CONSUMER SQL ==> [consumerQueue:{},deliveryTag:{}]"
,
consumerQueue
,
deliveryTag
);
String
msgBody
=
new
String
(
msg
.
getBody
());
String
msgBody
=
new
String
(
msg
.
getBody
());
log
.
debug
(
"CONSUMER SQL ==> Preparing:{}"
,
msgBody
);
log
.
debug
(
"CONSUMER SQL ==> Preparing:{}"
,
msgBody
);
SqlMapping
.
SqlMessage
sqlMessage
=
JsonUtils
.
fromJson
(
msgBody
,
SqlMapping
.
SqlMessage
.
class
);
try
{
try
{
SqlMapping
.
SqlMessage
sqlMessage
=
JsonUtils
.
fromJson
(
msgBody
,
SqlMapping
.
SqlMessage
.
class
);
Boolean
rstBatchSqls
=
baseDao
.
batchSqls
(
sqlMessage
.
getSqls
(),
sqlMessage
.
getArgs
());
Boolean
rstBatchSqls
=
baseDao
.
batchSqls
(
sqlMessage
.
getSqls
(),
sqlMessage
.
getArgs
());
log
.
debug
(
"CONSUMER SQL result of execution:{}"
,
rstBatchSqls
);
log
.
debug
(
"CONSUMER SQL result of execution:{}"
,
rstBatchSqls
);
if
(
rstBatchSqls
)
{
if
(
rstBatchSqls
)
{
...
@@ -90,8 +90,8 @@ public class ConsumerAdamUCenterProcessor {
...
@@ -90,8 +90,8 @@ public class ConsumerAdamUCenterProcessor {
log
.
info
(
"CONSUMER SMS ==> [consumerQueue:{},deliveryTag:{}]"
,
consumerQueue
,
deliveryTag
);
log
.
info
(
"CONSUMER SMS ==> [consumerQueue:{},deliveryTag:{}]"
,
consumerQueue
,
deliveryTag
);
String
msgBody
=
new
String
(
msg
.
getBody
());
String
msgBody
=
new
String
(
msg
.
getBody
());
log
.
debug
(
"CONSUMER SMS ==> Preparing:{}"
,
msgBody
);
log
.
debug
(
"CONSUMER SMS ==> Preparing:{}"
,
msgBody
);
SmsMessage
smsMessage
=
JsonUtils
.
fromJson
(
msgBody
,
SmsMessage
.
class
);
try
{
try
{
SmsMessage
smsMessage
=
JsonUtils
.
fromJson
(
msgBody
,
SmsMessage
.
class
);
boolean
result
=
smsProcessor
.
aliyunDysmsSend
(
smsMessage
.
getPhone
(),
smsMessage
.
getSignName
(),
smsMessage
.
getTemplateCode
(),
smsMessage
.
getTemplateParam
().
toString
());
boolean
result
=
smsProcessor
.
aliyunDysmsSend
(
smsMessage
.
getPhone
(),
smsMessage
.
getSignName
(),
smsMessage
.
getTemplateCode
(),
smsMessage
.
getTemplateParam
().
toString
());
log
.
debug
(
"CONSUMER SMS result of execution:{}"
,
result
);
log
.
debug
(
"CONSUMER SMS result of execution:{}"
,
result
);
if
(
result
)
{
if
(
result
)
{
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/pom.xml
View file @
2d6f06c7
...
@@ -38,7 +38,7 @@
...
@@ -38,7 +38,7 @@
<dependency>
<dependency>
<groupId>
com.thoughtworks.xstream
</groupId>
<groupId>
com.thoughtworks.xstream
</groupId>
<artifactId>
xstream
</artifactId>
<artifactId>
xstream
</artifactId>
<version>
1.4.
9
</version>
<version>
1.4.
17
</version>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/alipay/req/AlipayTradePayReq.java
View file @
2d6f06c7
...
@@ -22,6 +22,8 @@ public class AlipayTradePayReq {
...
@@ -22,6 +22,8 @@ public class AlipayTradePayReq {
private
String
body
;
private
String
body
;
private
String
outTradeNo
;
private
String
outTradeNo
;
private
String
timeExpire
;
private
String
timeExpire
;
private
String
notifyUrl
;
private
String
timestamp
;
@Override
@Override
public
String
toString
(){
public
String
toString
(){
return
JSON
.
toJSONString
(
this
);
return
JSON
.
toJSONString
(
this
);
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/alipay/strategy/impl/A
lipayStrategyWebImpl
.java
→
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/alipay/strategy/impl/A
bstractAlipayStrategy
.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
alipay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
alipay
.
strategy
.
impl
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.channel.alipay.biz.AlipayBiz
;
import
com.liquidnet.service.dragon.channel.alipay.biz.AlipayBiz
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.IAlipayStrategy
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.IAlipayStrategy
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.annotation.StrategyAlipayHandler
;
import
com.liquidnet.service.dragon.channel.alipay.util.AlipayUtil
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -21,44 +15,80 @@ import java.util.Map;
...
@@ -21,44 +15,80 @@ import java.util.Map;
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
* @version V1.0
* @version V1.0
* @Description: TODO
* @Description: TODO
* @class: A
lipayStrategyWapImpl
* @class: A
bstractAlipayStrategy
* @Package com.liquidnet.service.dragon.channel.alipay.strategy.impl
* @Package com.liquidnet.service.dragon.channel.alipay.strategy.impl
* @Copyright: LightNet @ Copyright (c) 2021
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/1
0 14:34
* @date 2021/7/1
2 12:36
*/
*/
@Component
@Slf4j
@StrategyAlipayHandler
(
DragonConstant
.
DeviceFromEnum
.
WEB
)
public
abstract
class
AbstractAlipayStrategy
implements
IAlipayStrategy
{
public
class
AlipayStrategyWebImpl
implements
IAlipayStrategy
{
@Autowired
StringRedisTemplate
stringRedisTemplate
;
@Value
(
"liquidnet.dragon.alipay.gataway-url"
)
private
String
alipayGatewayUrl
;
@Autowired
@Autowired
private
AlipayBiz
alipayBiz
;
private
AlipayBiz
alipayBiz
;
protected
String
productCode
=
"QUICK_WAP_PAY"
;
@Override
@Override
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
//设置productCode
setProductCode
();
AlipayTradePayReq
alipayTradePayReq
=
new
AlipayTradePayReq
();
AlipayTradePayReq
alipayTradePayReq
=
new
AlipayTradePayReq
();
alipayTradePayReq
.
setProductCode
(
"QUICK_WAP_PAY"
);
log
.
info
(
"子类 productCode:{}"
,
this
.
productCode
);
alipayTradePayReq
.
setProductCode
(
this
.
productCode
);
alipayTradePayReq
.
setTotalAmount
(
dragonPayBaseReqDto
.
getPrice
());
alipayTradePayReq
.
setTotalAmount
(
dragonPayBaseReqDto
.
getPrice
());
alipayTradePayReq
.
setSubject
(
dragonPayBaseReqDto
.
getName
());
alipayTradePayReq
.
setSubject
(
dragonPayBaseReqDto
.
getName
());
alipayTradePayReq
.
setBody
(
dragonPayBaseReqDto
.
getDetail
());
alipayTradePayReq
.
setBody
(
dragonPayBaseReqDto
.
getDetail
());
//dragon中支付编号
//dragon中支付编号
alipayTradePayReq
.
setOutTradeNo
(
IDGenerator
.
pay
Code
());
alipayTradePayReq
.
setOutTradeNo
(
dragonPayBaseReqDto
.
get
Code
());
alipayTradePayReq
.
setTimeExpire
(
dragonPayBaseReqDto
.
getExpireTime
());
alipayTradePayReq
.
setTimeExpire
(
dragonPayBaseReqDto
.
getExpireTime
());
alipayTradePayReq
.
setNotifyUrl
(
this
.
getNotifyUrl
());
alipayTradePayReq
.
setTimestamp
(
dragonPayBaseReqDto
.
getCreateDate
());
//调用支付
//调用支付
Map
<
String
,
Object
>
result
=
AlipayUtil
.
tradeWapPay
(
alipayTradePayReq
);
Map
<
String
,
Object
>
result
=
this
.
executePay
(
alipayTradePayReq
);
//拼接返回参数
//拼接返回参数
DragonPayBaseRespDto
respDto
=
new
DragonPayBaseRespDto
();
DragonPayBaseRespDto
respDto
=
buildCommonRespDto
(
dragonPayBaseReqDto
);
respDto
.
setCode
(
alipayTradePayReq
.
getOutTradeNo
());
respDto
=
this
.
buildResponseDto
(
respDto
,
result
);
respDto
.
setOrder_code
(
dragonPayBaseReqDto
.
getOrderCode
());
DragonPayBaseRespDto
.
PayData
payData
=
new
DragonPayBaseRespDto
.
PayData
();
payData
.
setRedirectUrl
(
alipayGatewayUrl
+
result
.
get
(
"body"
));
respDto
.
setPayData
(
payData
);
//支付订单持久化
//支付订单持久化
alipayBiz
.
buildPayOrders
(
dragonPayBaseReqDto
,
respDto
);
alipayBiz
.
buildPayOrders
(
dragonPayBaseReqDto
,
respDto
);
return
ResponseDto
.
success
(
respDto
);
return
ResponseDto
.
success
(
respDto
);
}
}
/**
* 支付请求
* @param alipayTradePayReq
* @return
*/
protected
abstract
Map
<
String
,
Object
>
executePay
(
AlipayTradePayReq
alipayTradePayReq
);
/**
* 设置productCode
*/
protected
abstract
void
setProductCode
();
/**
* 设置notifyUrl
*/
protected
abstract
String
getNotifyUrl
();
/**
* 构造公共返回参数
* @param dragonPayBaseReqDto
* @return
*/
protected
DragonPayBaseRespDto
buildCommonRespDto
(
DragonPayBaseReqDto
dragonPayBaseReqDto
){
DragonPayBaseRespDto
respDto
=
new
DragonPayBaseRespDto
();
respDto
.
setCode
(
dragonPayBaseReqDto
.
getCode
());
respDto
.
setOrderCode
(
dragonPayBaseReqDto
.
getOrderCode
());
DragonPayBaseRespDto
.
PayData
payData
=
new
DragonPayBaseRespDto
.
PayData
();
respDto
.
setPayData
(
payData
);
return
respDto
;
}
/**
* 构造返回参数
*/
abstract
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
Map
<
String
,
Object
>
respResult
);
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/alipay/strategy/impl/AlipayStrategyAppImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
alipay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
alipay
.
strategy
.
impl
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.channel.alipay.biz.AlipayBiz
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.IAlipayStrategy
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.annotation.StrategyAlipayHandler
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.annotation.StrategyAlipayHandler
;
import
com.liquidnet.service.dragon.channel.alipay.util.AlipayUtil
;
import
com.liquidnet.service.dragon.channel.alipay.util.AlipayUtil
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
lombok.extern.slf4j.Slf4j
;
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.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
@@ -26,39 +22,37 @@ import java.util.Map;
...
@@ -26,39 +22,37 @@ import java.util.Map;
* @Copyright: LightNet @ Copyright (c) 2021
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/10 14:34
* @date 2021/7/10 14:34
*/
*/
@Slf4j
@Component
@Component
@StrategyAlipayHandler
(
DragonConstant
.
DeviceFromEnum
.
APP
)
@StrategyAlipayHandler
(
DragonConstant
.
DeviceFromEnum
.
APP
)
public
class
AlipayStrategyAppImpl
implements
IAlipayStrategy
{
public
class
AlipayStrategyAppImpl
extends
AbstractAlipayStrategy
{
@Value
(
"${liquidnet.dragon.alipay.gataway-url}"
)
private
String
alipayGatewayUrl
;
@Value
(
"${liquidnet.dragon.alipay.notify-url}"
)
private
String
notifyUrl
;
@Autowired
@Autowired
StringRedisTemplate
stringRedisTemplate
;
StringRedisTemplate
stringRedisTemplate
;
@Value
(
"liquidnet.dragon.alipay.gataway-url"
)
@Override
private
String
alipayGatewayUrl
;
protected
Map
<
String
,
Object
>
executePay
(
AlipayTradePayReq
alipayTradePayReq
)
{
return
AlipayUtil
.
tradeWapPay
(
alipayTradePayReq
);
}
@Autowired
protected
void
setProductCode
()
{
private
AlipayBiz
alipayBiz
;
this
.
productCode
=
"QUICK_MSECURITY_PAY"
;
}
@Override
protected
String
getNotifyUrl
()
{
// notifyUrl = "/notify/app/alipay/1";
return
notifyUrl
+
"/app"
;
}
@Override
@Override
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
Map
<
String
,
Object
>
respResult
)
{
AlipayTradePayReq
alipayTradePayReq
=
new
AlipayTradePayReq
();
payBaseRespDto
.
getPayData
().
setOrderStr
(
alipayGatewayUrl
+
"?"
+
respResult
.
get
(
"order_string"
));
alipayTradePayReq
.
setProductCode
(
"QUICK_WAP_PAY"
);
return
payBaseRespDto
;
alipayTradePayReq
.
setTotalAmount
(
dragonPayBaseReqDto
.
getPrice
());
alipayTradePayReq
.
setSubject
(
dragonPayBaseReqDto
.
getName
());
alipayTradePayReq
.
setBody
(
dragonPayBaseReqDto
.
getDetail
());
//dragon中支付编号
alipayTradePayReq
.
setOutTradeNo
(
IDGenerator
.
payCode
());
alipayTradePayReq
.
setTimeExpire
(
dragonPayBaseReqDto
.
getExpireTime
());
//调用支付
Map
<
String
,
Object
>
result
=
AlipayUtil
.
tradeWapPay
(
alipayTradePayReq
);
//拼接返回参数
DragonPayBaseRespDto
respDto
=
new
DragonPayBaseRespDto
();
respDto
.
setCode
(
alipayTradePayReq
.
getOutTradeNo
());
respDto
.
setOrder_code
(
dragonPayBaseReqDto
.
getOrderCode
());
DragonPayBaseRespDto
.
PayData
payData
=
new
DragonPayBaseRespDto
.
PayData
();
payData
.
setRedirectUrl
(
alipayGatewayUrl
+
result
.
get
(
"body"
));
respDto
.
setPayData
(
payData
);
//支付订单持久化
alipayBiz
.
buildPayOrders
(
dragonPayBaseReqDto
,
respDto
);
return
ResponseDto
.
success
(
respDto
);
}
}
}
}
\ No newline at end of file
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/alipay/strategy/impl/AlipayStrategyWapImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
alipay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
alipay
.
strategy
.
impl
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.channel.alipay.biz.AlipayBiz
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.IAlipayStrategy
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.annotation.StrategyAlipayHandler
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.annotation.StrategyAlipayHandler
;
import
com.liquidnet.service.dragon.channel.alipay.util.AlipayUtil
;
import
com.liquidnet.service.dragon.channel.alipay.util.AlipayUtil
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
lombok.extern.slf4j.Slf4j
;
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.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -27,39 +22,37 @@ import java.util.Map;
...
@@ -27,39 +22,37 @@ import java.util.Map;
* @Copyright: LightNet @ Copyright (c) 2021
* @Copyright: LightNet @ Copyright (c) 2021
* @date 2021/7/10 14:34
* @date 2021/7/10 14:34
*/
*/
@Slf4j
@Service
@Service
@StrategyAlipayHandler
(
DragonConstant
.
DeviceFromEnum
.
WAP
)
@StrategyAlipayHandler
(
DragonConstant
.
DeviceFromEnum
.
WAP
)
public
class
AlipayStrategyWapImpl
implements
IAlipayStrategy
{
public
class
AlipayStrategyWapImpl
extends
AbstractAlipayStrategy
{
@Autowired
StringRedisTemplate
stringRedisTemplate
;
@Value
(
"${liquidnet.dragon.alipay.gataway-url}"
)
@Value
(
"${liquidnet.dragon.alipay.gataway-url}"
)
private
String
alipayGatewayUrl
;
private
String
alipayGatewayUrl
;
@Value
(
"${liquidnet.dragon.alipay.notify-url}"
)
private
String
notifyUrl
;
@Autowired
@Autowired
private
AlipayBiz
alipayBiz
;
StringRedisTemplate
stringRedisTemplate
;
@Override
protected
Map
<
String
,
Object
>
executePay
(
AlipayTradePayReq
alipayTradePayReq
)
{
return
AlipayUtil
.
tradeAppPay
(
alipayTradePayReq
);
}
protected
void
setProductCode
()
{
this
.
productCode
=
"QUICK_WAP_PAY"
;
}
@Override
protected
String
getNotifyUrl
()
{
// notifyUrl = "/notify/wap/alipay/1";
return
notifyUrl
+
"/wap"
;
}
@Override
@Override
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
Map
<
String
,
Object
>
respResult
)
{
AlipayTradePayReq
alipayTradePayReq
=
new
AlipayTradePayReq
();
payBaseRespDto
.
getPayData
().
setRedirectUrl
(
alipayGatewayUrl
+
"?"
+
respResult
.
get
(
"body"
));
alipayTradePayReq
.
setProductCode
(
"QUICK_WAP_PAY"
);
return
payBaseRespDto
;
alipayTradePayReq
.
setTotalAmount
(
dragonPayBaseReqDto
.
getPrice
());
alipayTradePayReq
.
setSubject
(
dragonPayBaseReqDto
.
getName
());
alipayTradePayReq
.
setBody
(
dragonPayBaseReqDto
.
getDetail
());
//dragon中支付编号
alipayTradePayReq
.
setOutTradeNo
(
IDGenerator
.
payCode
());
alipayTradePayReq
.
setTimeExpire
(
dragonPayBaseReqDto
.
getExpireTime
());
//调用支付
Map
<
String
,
Object
>
result
=
AlipayUtil
.
tradeWapPay
(
alipayTradePayReq
);
//拼接返回参数
DragonPayBaseRespDto
respDto
=
new
DragonPayBaseRespDto
();
respDto
.
setCode
(
alipayTradePayReq
.
getOutTradeNo
());
respDto
.
setOrder_code
(
dragonPayBaseReqDto
.
getOrderCode
());
DragonPayBaseRespDto
.
PayData
payData
=
new
DragonPayBaseRespDto
.
PayData
();
payData
.
setRedirectUrl
(
alipayGatewayUrl
+
"?"
+
result
.
get
(
"body"
));
respDto
.
setPayData
(
payData
);
//支付订单持久化
alipayBiz
.
buildPayOrders
(
dragonPayBaseReqDto
,
respDto
);
return
ResponseDto
.
success
(
respDto
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/alipay/util/AlipayUtil.java
View file @
2d6f06c7
...
@@ -14,34 +14,64 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -14,34 +14,64 @@ import com.alibaba.fastjson.JSONObject;
import
com.alipay.api.AlipayApiException
;
import
com.alipay.api.AlipayApiException
;
import
com.alipay.api.AlipayClient
;
import
com.alipay.api.AlipayClient
;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.request.AlipayTradePagePayRequest
;
import
com.alipay.api.request.AlipayTradePayRequest
;
import
com.alipay.api.request.AlipayTradeQueryRequest
;
import
com.alipay.api.request.AlipayTradeQueryRequest
;
import
com.alipay.api.request.AlipayTradeWapPayRequest
;
import
com.alipay.api.request.AlipayTradeWapPayRequest
;
import
com.alipay.api.response.AlipayTradePagePayResponse
;
import
com.alipay.api.response.AlipayTradePayResponse
;
import
com.alipay.api.response.AlipayTradeQueryResponse
;
import
com.alipay.api.response.AlipayTradeQueryResponse
;
import
com.alipay.api.response.AlipayTradeWapPayResponse
;
import
com.alipay.api.response.AlipayTradeWapPayResponse
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.dragon.channel.alipay.config.AlipayConfigUtil
;
import
com.liquidnet.service.dragon.channel.alipay.config.AlipayConfigUtil
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.req.AlipayTradePayReq
;
import
com.liquidnet.service.dragon.channel.alipay.sign.MD5
;
import
com.liquidnet.service.dragon.channel.alipay.sign.MD5
;
import
com.liquidnet.service.dragon.utils.PayAlipayUtils
;
import
com.liquidnet.service.dragon.utils.PayAlipayUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.math.BigDecimal
;
import
java.util.Map
;
import
java.util.*
;
import
java.util.SortedMap
;
import
java.util.TreeMap
;
@Slf4j
@Slf4j
public
class
AlipayUtil
{
public
class
AlipayUtil
{
/**
* 支付宝支付
* @param alipayTradePayReq
* @return
*/
public
static
Map
<
String
,
Object
>
tradeWapPay
(
AlipayTradePayReq
alipayTradePayReq
)
{
log
.
info
(
"AlipayUtil.tradePay-->> req : {}"
,
alipayTradePayReq
.
toString
());
String
timeExpress
=
"5m"
;
// 支付超时,线下扫码交易定义为5分钟
AlipayClient
alipayClient
=
PayAlipayUtils
.
getInstance
().
getHttpClient
();
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AlipayUtil
.
class
);
SortedMap
<
String
,
Object
>
paramMap
=
new
TreeMap
<>();
paramMap
.
put
(
"product_code"
,
alipayTradePayReq
.
getProductCode
());
paramMap
.
put
(
"total_amount"
,
alipayTradePayReq
.
getTotalAmount
().
toString
());
paramMap
.
put
(
"subject"
,
alipayTradePayReq
.
getSubject
());
paramMap
.
put
(
"body"
,
alipayTradePayReq
.
getBody
());
paramMap
.
put
(
"out_trade_no"
,
alipayTradePayReq
.
getOutTradeNo
());
paramMap
.
put
(
"timeout_express"
,
timeExpress
);
private
AlipayUtil
()
{
AlipayTradeWapPayRequest
request
=
new
AlipayTradeWapPayRequest
();
request
.
setNotifyUrl
(
"https://testpay.zhengzai.tv"
);
// request.setTimestamp(DateUtil.now());
log
.
info
(
"bizContent :{}"
,
JSONObject
.
toJSONString
(
paramMap
));
request
.
setBizContent
(
JSONObject
.
toJSONString
(
paramMap
));
try
{
AlipayTradeWapPayResponse
response
=
alipayClient
.
sdkExecute
(
request
);
if
(
response
.
isSuccess
()){
}
JSONObject
responseJSON
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
));
log
.
info
(
"支付宝返回结果:{}"
,
responseJSON
);
return
responseJSON
;
}
catch
(
AlipayApiException
e
)
{
log
.
error
(
"支付宝支付异常:{}"
,
e
);
JSONObject
resultJSON
=
new
JSONObject
();
resultJSON
.
put
(
"outTradeNo"
,
alipayTradePayReq
.
getOutTradeNo
());
resultJSON
.
put
(
"totalAmount"
,
alipayTradePayReq
.
getTotalAmount
().
toString
());
resultJSON
.
put
(
"errorCode"
,
"9999"
);
return
resultJSON
;
}
}
}
/**
/**
...
@@ -49,8 +79,8 @@ public class AlipayUtil {
...
@@ -49,8 +79,8 @@ public class AlipayUtil {
* @param alipayTradePayReq
* @param alipayTradePayReq
* @return
* @return
*/
*/
public
static
Map
<
String
,
Object
>
trade
Wa
pPay
(
AlipayTradePayReq
alipayTradePayReq
)
{
public
static
Map
<
String
,
Object
>
trade
Ap
pPay
(
AlipayTradePayReq
alipayTradePayReq
)
{
log
ger
.
info
(
"AlipayUtil.tradePay-->> req : {}"
,
alipayTradePayReq
.
toString
());
log
.
info
(
"AlipayUtil.tradePay-->> req : {}"
,
alipayTradePayReq
.
toString
());
String
timeExpress
=
"5m"
;
// 支付超时,线下扫码交易定义为5分钟
String
timeExpress
=
"5m"
;
// 支付超时,线下扫码交易定义为5分钟
AlipayClient
alipayClient
=
PayAlipayUtils
.
getInstance
().
getHttpClient
();
AlipayClient
alipayClient
=
PayAlipayUtils
.
getInstance
().
getHttpClient
();
...
@@ -67,7 +97,7 @@ public class AlipayUtil {
...
@@ -67,7 +97,7 @@ public class AlipayUtil {
AlipayTradeWapPayRequest
request
=
new
AlipayTradeWapPayRequest
();
AlipayTradeWapPayRequest
request
=
new
AlipayTradeWapPayRequest
();
request
.
setNotifyUrl
(
"https://testpay.zhengzai.tv"
);
request
.
setNotifyUrl
(
"https://testpay.zhengzai.tv"
);
// request.setTimestamp(DateUtil.now());
// request.setTimestamp(DateUtil.now());
log
ger
.
info
(
"bizContent :{}"
,
JSONObject
.
toJSONString
(
paramMap
));
log
.
info
(
"bizContent :{}"
,
JSONObject
.
toJSONString
(
paramMap
));
request
.
setBizContent
(
JSONObject
.
toJSONString
(
paramMap
));
request
.
setBizContent
(
JSONObject
.
toJSONString
(
paramMap
));
try
{
try
{
AlipayTradeWapPayResponse
response
=
alipayClient
.
sdkExecute
(
request
);
AlipayTradeWapPayResponse
response
=
alipayClient
.
sdkExecute
(
request
);
...
@@ -75,10 +105,10 @@ public class AlipayUtil {
...
@@ -75,10 +105,10 @@ public class AlipayUtil {
}
}
JSONObject
responseJSON
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
));
JSONObject
responseJSON
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
));
log
ger
.
info
(
"支付宝返回结果:{}"
,
responseJSON
);
log
.
info
(
"支付宝返回结果:{}"
,
responseJSON
);
return
responseJSON
;
return
responseJSON
;
}
catch
(
AlipayApiException
e
)
{
}
catch
(
AlipayApiException
e
)
{
log
ger
.
error
(
"支付宝支付异常:{}"
,
e
);
log
.
error
(
"支付宝支付异常:{}"
,
e
);
JSONObject
resultJSON
=
new
JSONObject
();
JSONObject
resultJSON
=
new
JSONObject
();
resultJSON
.
put
(
"outTradeNo"
,
alipayTradePayReq
.
getOutTradeNo
());
resultJSON
.
put
(
"outTradeNo"
,
alipayTradePayReq
.
getOutTradeNo
());
resultJSON
.
put
(
"totalAmount"
,
alipayTradePayReq
.
getTotalAmount
().
toString
());
resultJSON
.
put
(
"totalAmount"
,
alipayTradePayReq
.
getTotalAmount
().
toString
());
...
@@ -94,7 +124,7 @@ public class AlipayUtil {
...
@@ -94,7 +124,7 @@ public class AlipayUtil {
* @return
* @return
*/
*/
public
static
Map
<
String
,
Object
>
tradeQuery
(
String
outTradeNo
)
{
public
static
Map
<
String
,
Object
>
tradeQuery
(
String
outTradeNo
)
{
log
ger
.
info
(
"======>支付宝交易查询"
);
log
.
info
(
"======>支付宝交易查询"
);
String
charset
=
"UTF-8"
;
String
charset
=
"UTF-8"
;
String
format
=
"json"
;
String
format
=
"json"
;
String
signType
=
"RSA2"
;
String
signType
=
"RSA2"
;
...
@@ -107,10 +137,10 @@ public class AlipayUtil {
...
@@ -107,10 +137,10 @@ public class AlipayUtil {
try
{
try
{
AlipayTradeQueryResponse
response
=
alipayClient
.
execute
(
request
);
AlipayTradeQueryResponse
response
=
alipayClient
.
execute
(
request
);
JSONObject
responseJSON
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
));
JSONObject
responseJSON
=
JSONObject
.
parseObject
(
JSONObject
.
toJSONString
(
response
));
log
ger
.
info
(
"支付宝订单查询返回结果:{}"
,
responseJSON
);
log
.
info
(
"支付宝订单查询返回结果:{}"
,
responseJSON
);
return
responseJSON
;
return
responseJSON
;
}
catch
(
AlipayApiException
e
)
{
}
catch
(
AlipayApiException
e
)
{
log
ger
.
error
(
"支付宝交易查询异常:{}"
,
e
);
log
.
error
(
"支付宝交易查询异常:{}"
,
e
);
return
null
;
return
null
;
}
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/strategy/impl/PayChannelStrategyWepayImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
strategy
.
impl
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.channel.alipay.strategy.AlipayStrategyContext
;
import
com.liquidnet.service.dragon.channel.strategy.IPayChannelStrategy
;
import
com.liquidnet.service.dragon.channel.strategy.IPayChannelStrategy
;
import
com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler
;
import
com.liquidnet.service.dragon.channel.strategy.annotation.StrategyPayChannelHandler
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.WepayStrategyContext
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.WepayStrategyContext
;
...
@@ -11,9 +10,6 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
...
@@ -11,9 +10,6 @@ import com.liquidnet.service.dragon.dto.DragonPayBaseRespDto;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* @author AnJiabin <jiabin.an@lightnet.io>
* @author AnJiabin <jiabin.an@lightnet.io>
* @version V1.0
* @version V1.0
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/AbstractWepayStrategy.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WepayPayRespDto
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.IWepayStrategy
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.IWepayStrategy
;
import
com.liquidnet.service.dragon.channel.wepay.util.WepayUtil
;
import
com.liquidnet.service.dragon.channel.wepay.util.WepayUtil
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.utils.PayWepayUtils
;
import
com.liquidnet.service.dragon.utils.PayWepayUtils
;
import
com.liquidnet.service.dragon.utils.XmlUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
import
org.apache.http.client.methods.CloseableHttpResponse
;
...
@@ -14,7 +17,9 @@ import org.apache.http.entity.StringEntity;
...
@@ -14,7 +17,9 @@ import org.apache.http.entity.StringEntity;
import
org.apache.http.util.EntityUtils
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
java.math.BigDecimal
;
import
java.util.SortedMap
;
import
java.util.SortedMap
;
import
java.util.TreeMap
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
...
@@ -35,7 +40,9 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
...
@@ -35,7 +40,9 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
try
{
try
{
//构造请求参数
//构造请求参数
SortedMap
<
String
,
Object
>
parameters
=
this
.
buildRequestParamMap
(
dragonPayBaseReqDto
);
SortedMap
<
String
,
Object
>
commonParams
=
this
.
buildRequestParamMap
(
dragonPayBaseReqDto
);
//追加请求参数
SortedMap
<
String
,
Object
>
parameters
=
appendRequestParam
(
commonParams
);
//生成签名
//生成签名
String
sign
=
WepayUtil
.
getSign
(
parameters
,
parentKey
);
String
sign
=
WepayUtil
.
getSign
(
parameters
,
parentKey
);
parameters
.
put
(
"sign"
,
sign
);
parameters
.
put
(
"sign"
,
sign
);
...
@@ -47,25 +54,73 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
...
@@ -47,25 +54,73 @@ public abstract class AbstractWepayStrategy implements IWepayStrategy {
CloseableHttpResponse
response
=
PayWepayUtils
.
getInstance
().
getHttpClient
().
execute
(
httpost
);
CloseableHttpResponse
response
=
PayWepayUtils
.
getInstance
().
getHttpClient
().
execute
(
httpost
);
HttpEntity
entity
=
response
.
getEntity
();
HttpEntity
entity
=
response
.
getEntity
();
//接受到返回信息
//接受到返回信息
String
json
Str
=
EntityUtils
.
toString
(
response
.
getEntity
(),
"UTF-8"
);
String
xml
Str
=
EntityUtils
.
toString
(
response
.
getEntity
(),
"UTF-8"
);
EntityUtils
.
consume
(
entity
);
EntityUtils
.
consume
(
entity
);
log
.
info
(
"dragonPay:wepay:wap response json: {} "
,
jsonStr
);
log
.
info
(
"dragonPay:wepay:wap response xmlStr: {} "
,
xmlStr
);
WepayPayRespDto
respWepayDto
=
XmlUtil
.
toBean
(
xmlStr
,
WepayPayRespDto
.
class
);
//构造公共返回参数
DragonPayBaseRespDto
respPayDto
=
this
.
buildCommonRespDto
(
dragonPayBaseReqDto
);
//构造自定义返回参数
this
.
buildResponseDto
(
respPayDto
,
respWepayDto
);
return
ResponseDto
.
success
(
respPayDto
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
return
null
;
return
null
;
}
}
/**
* 构造公共返回参数
* @param dragonPayBaseReqDto
* @return
*/
protected
DragonPayBaseRespDto
buildCommonRespDto
(
DragonPayBaseReqDto
dragonPayBaseReqDto
){
DragonPayBaseRespDto
respDto
=
new
DragonPayBaseRespDto
();
respDto
.
setCode
(
dragonPayBaseReqDto
.
getCode
());
respDto
.
setOrderCode
(
dragonPayBaseReqDto
.
getOrderCode
());
DragonPayBaseRespDto
.
PayData
payData
=
new
DragonPayBaseRespDto
.
PayData
();
respDto
.
setPayData
(
payData
);
return
respDto
;
}
/**
/**
* 构造请求参数
* 构造请求参数
* @return
* @return
*/
*/
abstract
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
);
protected
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
){
String
nonceStr
=
PayWepayUtils
.
getInstance
().
getNonceStr
();
SortedMap
<
String
,
Object
>
parameters
=
new
TreeMap
<>();
parameters
.
put
(
"mch_id"
,
PayWepayUtils
.
getInstance
().
getMerchantId
());
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAppId
());
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"spbill_create_ip"
,
dragonPayBaseReqDto
.
getClientIp
());
parameters
.
put
(
"total_fee"
,
dragonPayBaseReqDto
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
100L
)).
intValue
());
parameters
.
put
(
"body"
,
dragonPayBaseReqDto
.
getName
());
parameters
.
put
(
"detail"
,
dragonPayBaseReqDto
.
getDetail
());
parameters
.
put
(
"out_trade_no"
,
IDGenerator
.
payCode
());
parameters
.
put
(
"time_expire"
,
"20210908103456"
);
parameters
.
put
(
"notify_url"
,
dragonPayBaseReqDto
.
getNotifyUrl
());
parameters
.
put
(
"trade_type"
,
"MWEB"
);
return
parameters
;
};
/**
* 追加请求参数
* @param requestMap
* @return
*/
abstract
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
);
/**
/**
* 构造返回参数
* 构造返回参数
*/
*/
abstract
DragonPayBaseRespDto
buildResponseDto
();
abstract
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
WepayPayRespDto
respDto
);
/**
* 获取请求url
* @return
*/
protected
abstract
String
getRequestUrl
();
protected
abstract
String
getRequestUrl
();
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/WepayStrategyAppImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WepayPayRespDto
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -22,20 +22,19 @@ import java.util.SortedMap;
...
@@ -22,20 +22,19 @@ import java.util.SortedMap;
@Component
@Component
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
APP
)
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
APP
)
public
class
WepayStrategyAppImpl
extends
AbstractWepayStrategy
{
public
class
WepayStrategyAppImpl
extends
AbstractWepayStrategy
{
@Override
@Override
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
)
{
return
null
;
return
requestMap
;
}
}
@Override
@Override
DragonPayBaseRespDto
buildResponseDto
()
{
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
WepayPayRespDto
respDto
)
{
return
null
;
payBaseRespDto
.
getPayData
().
setMwebUrl
(
respDto
.
getMwebUrl
());
return
payBaseRespDto
;
}
}
@Override
@Override
protected
String
getRequestUrl
()
{
protected
String
getRequestUrl
()
{
return
null
;
return
"https://api.mch.weixin.qq.com/pay/unifiedorder"
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/WepayStrategyAppletImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
import
com.liquidnet.
commons.lang.util.IDGenerator
;
import
com.liquidnet.
service.dragon.channel.wepay.resp.WepayPayRespDto
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.utils.PayWepayUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.SortedMap
;
import
java.util.SortedMap
;
import
java.util.TreeMap
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
...
@@ -26,28 +22,15 @@ import java.util.TreeMap;
...
@@ -26,28 +22,15 @@ import java.util.TreeMap;
@Component
@Component
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
APPLET
)
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
APPLET
)
public
class
WepayStrategyAppletImpl
extends
AbstractWepayStrategy
{
public
class
WepayStrategyAppletImpl
extends
AbstractWepayStrategy
{
@Override
@Override
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
)
{
String
nonceStr
=
PayWepayUtils
.
getInstance
().
getNonceStr
();
return
requestMap
;
SortedMap
<
String
,
Object
>
parameters
=
new
TreeMap
<>();
parameters
.
put
(
"mch_id"
,
PayWepayUtils
.
getInstance
().
getMerchantId
());
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAppId
());
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"spbill_create_ip"
,
dragonPayBaseReqDto
.
getClientIp
());
parameters
.
put
(
"total_fee"
,
dragonPayBaseReqDto
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
100L
)).
intValue
());
parameters
.
put
(
"body"
,
dragonPayBaseReqDto
.
getName
());
parameters
.
put
(
"detail"
,
dragonPayBaseReqDto
.
getDetail
());
parameters
.
put
(
"out_trade_no"
,
IDGenerator
.
payCode
());
parameters
.
put
(
"time_expire"
,
"20210908103456"
);
parameters
.
put
(
"notify_url"
,
"https://www.baidu.com"
);
parameters
.
put
(
"trade_type"
,
"MWEB"
);
return
parameters
;
}
}
@Override
@Override
DragonPayBaseRespDto
buildResponseDto
()
{
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
WepayPayRespDto
respDto
)
{
return
null
;
payBaseRespDto
.
getPayData
().
setMwebUrl
(
respDto
.
getMwebUrl
());
return
payBaseRespDto
;
}
}
@Override
@Override
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/WepayStrategyJsImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
import
com.liquidnet.service.dragon.channel.wepay.resp.WepayPayRespDto
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
...
@@ -22,20 +22,19 @@ import java.util.SortedMap;
...
@@ -22,20 +22,19 @@ import java.util.SortedMap;
@Component
@Component
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
JS
)
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
JS
)
public
class
WepayStrategyJsImpl
extends
AbstractWepayStrategy
{
public
class
WepayStrategyJsImpl
extends
AbstractWepayStrategy
{
@Override
@Override
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
)
{
return
null
;
return
requestMap
;
}
}
@Override
@Override
DragonPayBaseRespDto
buildResponseDto
()
{
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
WepayPayRespDto
respDto
)
{
return
null
;
payBaseRespDto
.
getPayData
().
setMwebUrl
(
respDto
.
getMwebUrl
());
return
payBaseRespDto
;
}
}
@Override
@Override
protected
String
getRequestUrl
()
{
protected
String
getRequestUrl
()
{
return
null
;
return
"https://api.mch.weixin.qq.com/pay/unifiedorder"
;
}
}
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/channel/wepay/strategy/impl/WepayStrategyWapImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
channel
.
wepay
.
strategy
.
impl
;
import
com.liquidnet.
commons.lang.util.IDGenerator
;
import
com.liquidnet.
service.dragon.channel.wepay.resp.WepayPayRespDto
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.channel.wepay.strategy.annotation.StrategyWepayHandler
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.utils.PayWepayUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.math.BigDecimal
;
import
java.util.SortedMap
;
import
java.util.SortedMap
;
import
java.util.TreeMap
;
/**
/**
* @author AnJiabin <anjiabin@zhengzai.tv>
* @author AnJiabin <anjiabin@zhengzai.tv>
...
@@ -26,28 +22,15 @@ import java.util.TreeMap;
...
@@ -26,28 +22,15 @@ import java.util.TreeMap;
@Component
@Component
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
WAP
)
@StrategyWepayHandler
(
DragonConstant
.
DeviceFromEnum
.
WAP
)
public
class
WepayStrategyWapImpl
extends
AbstractWepayStrategy
{
public
class
WepayStrategyWapImpl
extends
AbstractWepayStrategy
{
@Override
@Override
SortedMap
<
String
,
Object
>
buildRequestParamMap
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
SortedMap
<
String
,
Object
>
appendRequestParam
(
SortedMap
<
String
,
Object
>
requestMap
)
{
String
nonceStr
=
PayWepayUtils
.
getInstance
().
getNonceStr
();
return
requestMap
;
SortedMap
<
String
,
Object
>
parameters
=
new
TreeMap
<>();
parameters
.
put
(
"mch_id"
,
PayWepayUtils
.
getInstance
().
getMerchantId
());
parameters
.
put
(
"appid"
,
PayWepayUtils
.
getInstance
().
getAppId
());
parameters
.
put
(
"nonce_str"
,
nonceStr
);
parameters
.
put
(
"spbill_create_ip"
,
dragonPayBaseReqDto
.
getClientIp
());
parameters
.
put
(
"total_fee"
,
dragonPayBaseReqDto
.
getPrice
().
multiply
(
BigDecimal
.
valueOf
(
100L
)).
intValue
());
parameters
.
put
(
"body"
,
dragonPayBaseReqDto
.
getName
());
parameters
.
put
(
"detail"
,
dragonPayBaseReqDto
.
getDetail
());
parameters
.
put
(
"out_trade_no"
,
IDGenerator
.
payCode
());
parameters
.
put
(
"time_expire"
,
"20210908103456"
);
parameters
.
put
(
"notify_url"
,
"https://www.baidu.com"
);
parameters
.
put
(
"trade_type"
,
"MWEB"
);
return
parameters
;
}
}
@Override
@Override
DragonPayBaseRespDto
buildResponseDto
()
{
DragonPayBaseRespDto
buildResponseDto
(
DragonPayBaseRespDto
payBaseRespDto
,
WepayPayRespDto
respDto
)
{
return
null
;
payBaseRespDto
.
getPayData
().
setMwebUrl
(
respDto
.
getMwebUrl
());
return
payBaseRespDto
;
}
}
@Override
@Override
...
...
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/controller/PayController.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
controller
;
package
com
.
liquidnet
.
service
.
dragon
.
controller
;
import
com.liquidnet.commons.lang.util.StringUtil
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.constant.DragonConstant
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseRespDto
;
import
com.liquidnet.service.dragon.service.IDragonOrdersService
;
import
com.liquidnet.service.dragon.service.IDragonOrdersService
;
...
@@ -9,10 +11,7 @@ import io.swagger.annotations.ApiImplicitParams;
...
@@ -9,10 +11,7 @@ import io.swagger.annotations.ApiImplicitParams;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiResponse
;
import
io.swagger.annotations.ApiResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
...
@@ -50,10 +49,11 @@ public class PayController {
...
@@ -50,10 +49,11 @@ public class PayController {
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"clientIp"
,
value
=
"客户端ip"
,
example
=
"127.0.0.1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"clientIp"
,
value
=
"客户端ip"
,
example
=
"127.0.0.1"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"notifyUrl"
,
value
=
"通知url"
,
example
=
"pay.zhengzai.tv"
),
@ApiImplicitParam
(
type
=
"form"
,
required
=
true
,
dataType
=
"String"
,
name
=
"notifyUrl"
,
value
=
"通知url"
,
example
=
"pay.zhengzai.tv"
),
})
})
@ResponseBody
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
@RequestParam
(
value
=
"payType"
)
@NotNull
(
message
=
"支付类型不能为空"
)
String
payType
,
@RequestParam
(
value
=
"payType"
)
@NotNull
(
message
=
"支付类型不能为空"
)
String
payType
,
@RequestParam
(
value
=
"deviceFrom"
)
@NotNull
(
message
=
"设备来源不能为空"
)
String
deviceFrom
,
@RequestParam
(
value
=
"deviceFrom"
)
@NotNull
(
message
=
"设备来源不能为空"
)
String
deviceFrom
,
@RequestParam
(
value
=
"openId"
)
@NotNull
(
message
=
"微信支付openId不能为空"
)
String
openId
,
@RequestParam
(
value
=
"openId"
)
String
openId
,
@RequestParam
(
value
=
"type"
)
@NotNull
(
message
=
"业务类型不能为空"
)
String
type
,
@RequestParam
(
value
=
"type"
)
@NotNull
(
message
=
"业务类型不能为空"
)
String
type
,
@RequestParam
(
value
=
"price"
)
@NotNull
(
message
=
"支付金额不能为空"
)
BigDecimal
price
,
@RequestParam
(
value
=
"price"
)
@NotNull
(
message
=
"支付金额不能为空"
)
BigDecimal
price
,
@RequestParam
(
value
=
"name"
)
@NotNull
(
message
=
"订单名称不能为空"
)
String
name
,
@RequestParam
(
value
=
"name"
)
@NotNull
(
message
=
"订单名称不能为空"
)
String
name
,
...
@@ -62,11 +62,16 @@ public class PayController {
...
@@ -62,11 +62,16 @@ public class PayController {
@RequestParam
(
value
=
"clientIp"
)
@NotNull
(
message
=
"客户端ip不能为空"
)
String
clientIp
,
@RequestParam
(
value
=
"clientIp"
)
@NotNull
(
message
=
"客户端ip不能为空"
)
String
clientIp
,
@RequestParam
(
value
=
"notifyUrl"
)
@NotNull
(
message
=
"通知Url不能为空"
)
String
notifyUrl
,
@RequestParam
(
value
=
"notifyUrl"
)
@NotNull
(
message
=
"通知Url不能为空"
)
String
notifyUrl
,
@RequestParam
(
value
=
"returnUrl"
,
required
=
false
)
String
returnUrl
,
@RequestParam
(
value
=
"returnUrl"
,
required
=
false
)
String
returnUrl
,
@RequestParam
(
value
=
"quitUrl"
,
required
=
false
)
String
quitUrl
,
//
@RequestParam(value = "quitUrl",required = false) String quitUrl,
@RequestParam
(
value
=
"showUrl"
,
required
=
false
)
String
showUrl
,
//
@RequestParam(value = "showUrl",required = false) String showUrl,
@RequestParam
(
value
=
"code"
,
required
=
false
)
String
code
,
//
@RequestParam(value = "code",required = false) String code,
@RequestParam
(
value
=
"createDate"
,
required
=
false
)
String
createDate
,
@RequestParam
(
value
=
"createDate"
,
required
=
false
)
String
createDate
,
@RequestParam
(
value
=
"expireTime"
,
required
=
false
)
String
expireTime
){
@RequestParam
(
value
=
"expireTime"
,
required
=
false
)
String
expireTime
){
if
(
payType
.
equalsIgnoreCase
(
DragonConstant
.
PayChannelEnum
.
WEPAY
.
getCode
())){
if
(
StringUtil
.
isEmpty
(
openId
)){
return
ResponseDto
.
failure
(
"微信支付openId不能为空!"
);
}
}
DragonPayBaseReqDto
dragonPayBaseReqDto
=
new
DragonPayBaseReqDto
();
DragonPayBaseReqDto
dragonPayBaseReqDto
=
new
DragonPayBaseReqDto
();
dragonPayBaseReqDto
.
setPayType
(
payType
);
dragonPayBaseReqDto
.
setPayType
(
payType
);
dragonPayBaseReqDto
.
setDeviceFrom
(
deviceFrom
);
dragonPayBaseReqDto
.
setDeviceFrom
(
deviceFrom
);
...
@@ -78,6 +83,12 @@ public class PayController {
...
@@ -78,6 +83,12 @@ public class PayController {
dragonPayBaseReqDto
.
setOrderCode
(
orderCode
);
dragonPayBaseReqDto
.
setOrderCode
(
orderCode
);
dragonPayBaseReqDto
.
setClientIp
(
clientIp
);
dragonPayBaseReqDto
.
setClientIp
(
clientIp
);
dragonPayBaseReqDto
.
setNotifyUrl
(
notifyUrl
);
dragonPayBaseReqDto
.
setNotifyUrl
(
notifyUrl
);
dragonPayBaseReqDto
.
setReturnUrl
(
returnUrl
);
// dragonPayBaseReqDto.setQuitUrl(quitUrl);
// dragonPayBaseReqDto.setShowUrl(showUrl);
// dragonPayBaseReqDto.setCode(code);
dragonPayBaseReqDto
.
setCreateDate
(
createDate
);
dragonPayBaseReqDto
.
setExpireTime
(
expireTime
);
return
dragonOrdersService
.
dragonPay
(
dragonPayBaseReqDto
);
return
dragonOrdersService
.
dragonPay
(
dragonPayBaseReqDto
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/service/impl/DragonOrdersServiceImpl.java
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
dragon
.
service
.
impl
;
package
com
.
liquidnet
.
service
.
dragon
.
service
.
impl
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.dragon.channel.strategy.PayChannelStrategyContext
;
import
com.liquidnet.service.dragon.channel.strategy.PayChannelStrategyContext
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
import
com.liquidnet.service.dragon.dto.DragonPayBaseReqDto
;
...
@@ -37,6 +38,8 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
...
@@ -37,6 +38,8 @@ public class DragonOrdersServiceImpl implements IDragonOrdersService {
@Override
@Override
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
public
ResponseDto
<
DragonPayBaseRespDto
>
dragonPay
(
DragonPayBaseReqDto
dragonPayBaseReqDto
)
{
//设置支付编号
dragonPayBaseReqDto
.
setCode
(
IDGenerator
.
payCode
());
return
payChannelStrategyContext
.
getStrategy
(
dragonPayBaseReqDto
.
getPayType
()).
dragonPay
(
dragonPayBaseReqDto
);
return
payChannelStrategyContext
.
getStrategy
(
dragonPayBaseReqDto
.
getPayType
()).
dragonPay
(
dragonPayBaseReqDto
);
}
}
}
}
liquidnet-bus-service/liquidnet-service-dragon/liquidnet-service-dragon-impl/src/main/java/com/liquidnet/service/dragon/utils/XmlUtil.java
View file @
2d6f06c7
...
@@ -41,9 +41,15 @@ public class XmlUtil{
...
@@ -41,9 +41,15 @@ public class XmlUtil{
XStream
xstream
=
new
XStream
();
XStream
xstream
=
new
XStream
();
// XStream xstream=new XStream(new DomDriver()); //直接用jaxp dom来解释
// XStream xstream=new XStream(new DomDriver()); //直接用jaxp dom来解释
// XStream xstream=new XStream(new DomDriver("utf-8")); //指定编码解析器,直接用jaxp dom来解释
// XStream xstream=new XStream(new DomDriver("utf-8")); //指定编码解析器,直接用jaxp dom来解释
XStream
.
setupDefaultSecurity
(
xstream
);
////如果没有这句,xml中的根元素会是<包.类名>;或者说:注解根本就没生效,所以的元素名就是类的属性
////如果没有这句,xml中的根元素会是<包.类名>;或者说:注解根本就没生效,所以的元素名就是类的属性
xstream
.
processAnnotations
(
obj
.
getClass
());
//通过注解方式的,一定要有这句话
xstream
.
processAnnotations
(
obj
.
getClass
());
//通过注解方式的,一定要有这句话
xstream
.
allowTypesByRegExp
(
new
String
[]
{
".*"
});
// xstream.allowTypes(new Class[]{XmlUtil.class});
// xstream.allowTypesByWildcard(new String[] {
// "com.liquidnet.**"
// });
return
xstream
.
toXML
(
obj
);
return
xstream
.
toXML
(
obj
);
}
}
...
...
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/docu/db_kylin_structure.sql
View file @
2d6f06c7
...
@@ -938,3 +938,45 @@ CREATE TABLE `kylin_order_refund_pic`
...
@@ -938,3 +938,45 @@ CREATE TABLE `kylin_order_refund_pic`
)
ENGINE
=
InnoDB
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
utf8mb4
DEFAULT
CHARSET
utf8mb4
COLLATE
utf8mb4_unicode_ci
COMMENT
'订单退款图片表'
;
COLLATE
utf8mb4_unicode_ci
COMMENT
'订单退款图片表'
;
drop
TABLE
if
exists
`kylin_zhengzai_app_versions`
;
CREATE
TABLE
`kylin_zhengzai_app_versions`
(
`mid`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`zhengzai_app_versions_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'zhengzai_app_versions_id'
,
`name`
varchar
(
128
)
NOT
NULL
DEFAULT
''
COMMENT
'名称'
,
`file_path`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'文件路径'
,
`version`
varchar
(
50
)
NOT
NULL
DEFAULT
''
COMMENT
'版本号'
,
`min_version`
varchar
(
10
)
NOT
NULL
DEFAULT
''
COMMENT
'最近版本号'
,
`type`
tinyint
NOT
NULL
DEFAULT
'0'
COMMENT
'上传类型 1-IOS 2-Android'
,
`is_production`
tinyint
NOT
NULL
DEFAULT
'0'
COMMENT
'是否是生产环境,2否 1是'
,
`is_force`
tinyint
NOT
NULL
DEFAULT
'0'
COMMENT
'强制更新 2否 1是'
,
`content`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'升级描述'
,
`is_deleted`
tinyint
NOT
NULL
DEFAULT
'1'
COMMENT
'1正常 2已删除'
,
`created_at`
timestamp
NULL
DEFAULT
NULL
,
`updated_at`
timestamp
NULL
DEFAULT
NULL
,
KEY
`kylin_zhengzai_app_versions_id_index`
(
`zhengzai_app_versions_id`
),
PRIMARY
KEY
(
`mid`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
utf8mb4
COLLATE
utf8mb4_unicode_ci
COMMENT
'正在现场app版本控制'
;
drop
TABLE
if
exists
`platform_oss_files`
;
create
table
platform_oss_files
(
`mid`
int
(
11
)
unsigned
NOT
NULL
AUTO_INCREMENT
,
`oss_files_id`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'oss_files_id'
,
`file_name`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'源文件名称'
,
`content_type`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'文件类型'
,
`size`
int
NOT
NULL
DEFAULT
0
COMMENT
'文件大小'
,
`md5str`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'md5值判断文件是否相同'
,
`oss_path`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'文件地址(阿里oss)'
,
`uploader_uid`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'上传人id'
,
`uploader_name`
varchar
(
255
)
NOT
NULL
DEFAULT
''
COMMENT
'上传人姓名'
,
`created_at`
timestamp
NULL
DEFAULT
NULL
,
`updated_at`
timestamp
NULL
DEFAULT
NULL
,
KEY
`kylin_oss_files_id_index`
(
`oss_files_id`
),
PRIMARY
KEY
(
`mid`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
utf8mb4
COLLATE
utf8mb4_unicode_ci
COMMENT
'阿里云OSS上传记录'
;
liquidnet-bus-service/liquidnet-service-kylin/liquidnet-service-kylin-impl/src/main/java/com/liquidnet/service/kylin/service/impl/BannersServiceImpl.java
View file @
2d6f06c7
...
@@ -12,7 +12,6 @@ import org.springframework.data.mongodb.core.query.Query;
...
@@ -12,7 +12,6 @@ import org.springframework.data.mongodb.core.query.Query;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.List
;
import
java.util.List
;
/**
/**
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/basicServices/AlOssController.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
platform
.
controller
.
basicServices
;
import
com.aliyun.oss.OSS
;
import
com.aliyun.oss.OSSClientBuilder
;
import
com.aliyun.oss.model.PutObjectRequest
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.liquidnet.commons.lang.util.DateUtil
;
import
com.liquidnet.commons.lang.util.FilesUtils
;
import
com.liquidnet.commons.lang.util.IDGenerator
;
import
com.liquidnet.service.kylin.dto.vo.basicServices.UploadVo
;
import
com.liquidnet.service.kylin.entity.PlatformOssFiles
;
import
com.liquidnet.service.kylin.mapper.PlatformOssFilesMapper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.File
;
import
java.time.LocalDateTime
;
import
java.util.UUID
;
/**
* <p>
* 阿里云上传
* </p>
*
* @author jiangxiulong
* @since 2021-07-09
*/
@Api
(
tags
=
"basicServices"
)
@RestController
@RequestMapping
(
"basicServices/alOss"
)
public
class
AlOssController
{
@Value
(
"${liquidnet.al-oss.endpoint}"
)
private
String
endpoint
;
@Value
(
"${liquidnet.al-oss.accessKeyId}"
)
private
String
accessKeyId
;
@Value
(
"${liquidnet.al-oss.accessKeySecret}"
)
private
String
accessKeySecret
;
@Autowired
private
PlatformOssFilesMapper
platformOssFilesMapper
;
@PostMapping
(
"/upload"
)
@ApiOperation
(
"阿里云上传"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"form"
,
dataType
=
"MultipartFile"
,
name
=
"files"
,
value
=
"文件"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"pathName"
,
value
=
"归类的文件夹名称 比如banner上传就传 banner 返回的地址就会是bnanner/XXX"
,
required
=
true
),
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"Integer"
,
name
=
"buckType"
,
value
=
"buckType 1正常的任何文件上传 2apk上传"
,
required
=
true
),
})
public
UploadVo
upload
(
@RequestParam
MultipartFile
files
,
@RequestParam
String
pathName
,
@RequestParam
Integer
buckType
)
{
OSS
ossClient
=
new
OSSClientBuilder
().
build
(
endpoint
,
accessKeyId
,
accessKeySecret
);
File
file
=
null
;
try
{
file
=
FilesUtils
.
multipartFileToFile
(
files
);
}
catch
(
Exception
e
)
{
return
null
;
}
// file md5
String
fileMD5
=
FilesUtils
.
getFileMD5
(
file
);
PlatformOssFiles
platformOssFiles
=
platformOssFilesMapper
.
selectOne
(
Wrappers
.
lambdaQuery
(
PlatformOssFiles
.
class
).
eq
(
PlatformOssFiles:
:
getMd5str
,
fileMD5
));
if
(
null
!=
platformOssFiles
)
{
UploadVo
uploadVo
=
new
UploadVo
();
uploadVo
.
setOssPath
(
platformOssFiles
.
getOssPath
());
uploadVo
.
setSize
(
platformOssFiles
.
getSize
());
uploadVo
.
setContentType
(
platformOssFiles
.
getContentType
());
return
uploadVo
;
}
String
filename
=
files
.
getResource
().
getFilename
();
// time.jpeg
//这里文件名用了uuid 防止重复,可以根据自己的需要来写
String
uploadName
=
UUID
.
randomUUID
()
+
filename
.
substring
(
filename
.
lastIndexOf
(
"."
));
// 078a77e0-cf80-481b-824c-5935247cff15.jpeg
uploadName
=
uploadName
.
replace
(
"-"
,
""
);
// 078a77e0cf80481b824c5935247cff15.jpeg
String
uploadpath
=
pathName
+
"/"
+
DateUtil
.
format
(
LocalDateTime
.
now
(),
DateUtil
.
Formatter
.
yyyy_MM_dd2
)
+
"/"
+
uploadName
;
String
buckName
=
"img-zhengzai-tv"
;
if
(
2
==
buckType
)
{
buckName
=
"app-zhengzai-tv"
;
}
PutObjectRequest
putObjectRequest
=
new
PutObjectRequest
(
buckName
,
uploadpath
,
file
);
ossClient
.
putObject
(
putObjectRequest
);
ossClient
.
shutdown
();
FilesUtils
.
delteTempFile
(
file
);
// 删除临时文件
// 入库
PlatformOssFiles
platformOssFilesDate
=
new
PlatformOssFiles
();
String
ossFilesId
=
IDGenerator
.
nextSnowId
();
platformOssFilesDate
.
setOssFilesId
(
ossFilesId
);
platformOssFilesDate
.
setOssPath
(
uploadpath
);
platformOssFilesDate
.
setFileName
(
filename
);
platformOssFilesDate
.
setContentType
(
files
.
getContentType
());
platformOssFilesDate
.
setSize
((
int
)
files
.
getSize
());
platformOssFilesDate
.
setMd5str
(
fileMD5
);
platformOssFilesDate
.
setCreatedAt
(
DateUtil
.
getNowTime
());
platformOssFilesMapper
.
insert
(
platformOssFilesDate
);
// 返回值
UploadVo
uploadVo
=
new
UploadVo
();
uploadVo
.
setOssPath
(
platformOssFilesDate
.
getOssPath
());
uploadVo
.
setSize
(
platformOssFilesDate
.
getSize
());
uploadVo
.
setContentType
(
platformOssFilesDate
.
getContentType
());
return
uploadVo
;
}
}
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/basicServices/WechatShareController.java
0 → 100644
View file @
2d6f06c7
package
com
.
liquidnet
.
service
.
platform
.
controller
.
basicServices
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonObject
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.service.kylin.constant.KylinRedisConst
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpResponse
;
import
org.apache.http.client.methods.HttpGet
;
import
org.apache.http.impl.client.CloseableHttpClient
;
import
org.apache.http.impl.client.HttpClients
;
import
org.apache.http.util.EntityUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.web.bind.annotation.*
;
import
java.io.UnsupportedEncodingException
;
import
java.security.MessageDigest
;
import
java.security.NoSuchAlgorithmException
;
import
java.util.Formatter
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.UUID
;
/**
* <p>
* 阿里云上传
* </p>
*
* @author jiangxiulong
* @since 2021-07-09
*/
@Api
(
tags
=
"basicServices"
)
@RestController
@RequestMapping
(
"basicServices/wechatShareSign"
)
public
class
WechatShareController
{
@Value
(
"${liquidnet.zhengzai-wechat.appid}"
)
private
String
zhengzaiAppid
;
@Value
(
"${liquidnet.zhengzai-wechat.secret}"
)
private
String
zhengzaiSecret
;
@Value
(
"${liquidnet.modernsky-wechat.appid}"
)
private
String
modernskyAppid
;
@Value
(
"${liquidnet.modernsky-wechat.secret}"
)
private
String
modernskySecret
;
@Autowired
private
RedisUtil
redisUtil
;
@GetMapping
(
"/zhengzai"
)
@ApiOperation
(
"正在微信分享sign"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"url"
,
value
=
"url地址 注意 URL 一定要动态获取,不能 hardcode"
,
required
=
true
),
})
public
Map
<
String
,
String
>
zhengzai
(
@RequestParam
String
url
)
{
String
accessToken
=
accessToken
(
zhengzaiAppid
,
zhengzaiSecret
);
String
jsapiTicket
=
jsapiTicket
(
zhengzaiAppid
,
accessToken
);
Map
<
String
,
String
>
ret
=
sign
(
jsapiTicket
,
url
);
return
ret
;
}
@GetMapping
(
"/modernsky"
)
@ApiOperation
(
"摩登微信分享sign"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
type
=
"query"
,
dataType
=
"String"
,
name
=
"url"
,
value
=
"url地址 注意 URL 一定要动态获取,不能 hardcode"
,
required
=
true
),
})
public
Map
<
String
,
String
>
modernsky
(
@RequestParam
String
url
)
{
String
accessToken
=
accessToken
(
modernskyAppid
,
modernskySecret
);
String
jsapiTicket
=
jsapiTicket
(
modernskyAppid
,
accessToken
);
Map
<
String
,
String
>
ret
=
sign
(
jsapiTicket
,
url
);
return
ret
;
}
public
static
Map
<
String
,
String
>
sign
(
String
jsapi_ticket
,
String
url
)
{
Map
<
String
,
String
>
ret
=
new
HashMap
();
String
nonce_str
=
create_nonce_str
();
String
timestamp
=
create_timestamp
();
String
string1
;
String
signature
=
""
;
//注意这里参数名必须全部小写,且必须有序
string1
=
"jsapi_ticket="
+
jsapi_ticket
+
"&noncestr="
+
nonce_str
+
"×tamp="
+
timestamp
+
"&url="
+
url
;
// System.out.println(string1);
try
{
MessageDigest
crypt
=
MessageDigest
.
getInstance
(
"SHA-1"
);
crypt
.
reset
();
crypt
.
update
(
string1
.
getBytes
(
"UTF-8"
));
signature
=
byteToHex
(
crypt
.
digest
());
}
catch
(
NoSuchAlgorithmException
e
)
{
e
.
printStackTrace
();
}
catch
(
UnsupportedEncodingException
e
)
{
e
.
printStackTrace
();
}
ret
.
put
(
"url"
,
url
);
// ret.put("jsapi_ticket", jsapi_ticket);
ret
.
put
(
"nonceStr"
,
nonce_str
);
ret
.
put
(
"timestamp"
,
timestamp
);
ret
.
put
(
"signature"
,
signature
);
return
ret
;
}
private
static
String
byteToHex
(
final
byte
[]
hash
)
{
Formatter
formatter
=
new
Formatter
();
for
(
byte
b
:
hash
)
{
formatter
.
format
(
"%02x"
,
b
);
}
String
result
=
formatter
.
toString
();
formatter
.
close
();
return
result
;
}
private
static
String
create_nonce_str
()
{
return
UUID
.
randomUUID
().
toString
();
}
private
static
String
create_timestamp
()
{
return
Long
.
toString
(
System
.
currentTimeMillis
()
/
1000
);
}
private
String
accessToken
(
String
appid
,
String
secret
)
{
String
accessTokenRedisKey
=
KylinRedisConst
.
WECHAT_SHARE_ACCESSTOKEN
.
concat
(
appid
);
String
accessToken
=
""
;
if
(!
redisUtil
.
hasKey
(
accessTokenRedisKey
))
{
// 请求微信获取 access_token
String
accessTokenUrl
=
String
.
format
(
"https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s"
,
appid
,
secret
);
JsonObject
object
=
null
;
try
{
CloseableHttpClient
client
=
HttpClients
.
createDefault
();
HttpGet
httpGet
=
new
HttpGet
(
accessTokenUrl
);
HttpResponse
httpResponse
=
client
.
execute
(
httpGet
);
HttpEntity
httpEntity
=
httpResponse
.
getEntity
();
String
tokens
=
EntityUtils
.
toString
(
httpEntity
,
"utf-8"
);
Gson
token_gson
=
new
Gson
();
object
=
token_gson
.
fromJson
(
tokens
,
JsonObject
.
class
);
accessToken
=
object
.
get
(
"access_token"
).
toString
().
replaceAll
(
"\""
,
""
);
redisUtil
.
set
(
accessTokenRedisKey
,
accessToken
,
7200
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
accessToken
=
(
String
)
redisUtil
.
get
(
accessTokenRedisKey
);
}
return
accessToken
;
}
private
String
jsapiTicket
(
String
appid
,
String
accessToken
)
{
String
jsapiTicketRedisKey
=
KylinRedisConst
.
WECHAT_SHARE_JSAPI_TICKET
.
concat
(
appid
);
String
jsapiTicket
=
""
;
if
(!
redisUtil
.
hasKey
(
jsapiTicketRedisKey
))
{
// 获取 jsapi_ticket
String
ticketUrl
=
String
.
format
(
"https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=%s&type=jsapi"
,
accessToken
);
JsonObject
object
=
null
;
try
{
CloseableHttpClient
client
=
HttpClients
.
createDefault
();
HttpGet
httpGet
=
new
HttpGet
(
ticketUrl
);
HttpResponse
httpResponse
=
client
.
execute
(
httpGet
);
HttpEntity
httpEntity
=
httpResponse
.
getEntity
();
String
tokens
=
EntityUtils
.
toString
(
httpEntity
,
"utf-8"
);
Gson
token_gson
=
new
Gson
();
object
=
token_gson
.
fromJson
(
tokens
,
JsonObject
.
class
);
jsapiTicket
=
object
.
get
(
"ticket"
).
toString
().
replaceAll
(
"\""
,
""
);
redisUtil
.
set
(
jsapiTicketRedisKey
,
jsapiTicket
,
7200
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
else
{
jsapiTicket
=
(
String
)
redisUtil
.
get
(
jsapiTicketRedisKey
);
}
return
jsapiTicket
;
}
}
liquidnet-bus-service/liquidnet-service-platform/pom.xml
View file @
2d6f06c7
...
@@ -15,7 +15,11 @@
...
@@ -15,7 +15,11 @@
</modules>
</modules>
<dependencies>
<dependencies>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
<version>
3.10.2
</version>
</dependency>
</dependencies>
</dependencies>
...
...
liquidnet-bus-service/pom.xml
View file @
2d6f06c7
...
@@ -124,6 +124,12 @@
...
@@ -124,6 +124,12 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
com.aliyun.oss
</groupId>
<artifactId>
aliyun-sdk-oss
</artifactId>
<version>
3.10.2
</version>
</dependency>
</dependencies>
</dependencies>
</dependencyManagement>
</dependencyManagement>
...
...
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