Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
efbfe6f7
提交
efbfe6f7
authored
3月 03, 2021
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
提交
上级
aeb76397
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
39 行增加
和
15 行删除
+39
-15
BraintreeController.java
.../example/afrishop_v3/controllers/BraintreeController.java
+13
-11
FlutterWaveController.java
...xample/afrishop_v3/controllers/FlutterWaveController.java
+2
-2
TbCfHomePageEntityController.java
...afrishop_v3/controllers/TbCfHomePageEntityController.java
+15
-1
TbCfClassification.java
...va/com/example/afrishop_v3/models/TbCfClassification.java
+3
-0
TbCfDescripitonRepository.java
...ple/afrishop_v3/repository/TbCfDescripitonRepository.java
+2
-0
TbCfGoodstwotypeRepository.java
...le/afrishop_v3/repository/TbCfGoodstwotypeRepository.java
+4
-1
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/BraintreeController.java
浏览文件 @
efbfe6f7
...
...
@@ -22,6 +22,8 @@ import java.math.BigDecimal;
import
java.math.RoundingMode
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Optional
;
/**
...
...
@@ -58,13 +60,13 @@ public class BraintreeController extends Controller {
}
@GetMapping
(
"/getToken"
)
public
com
.
example
.
afrishop_v3
.
base
.
Result
getToken
()
{
com
.
example
.
afrishop_v3
.
base
.
Result
result
=
new
com
.
example
.
afrishop_v3
.
base
.
Result
();
public
Map
<
String
,
String
>
getToken
()
{
Map
<
String
,
String
>
map
=
new
HashMap
<>
();
//官方写new ClientTokenRequest().customerId("customerId")可以不要。
ClientTokenRequest
clientTokenRequest
=
new
ClientTokenRequest
();
String
clientToken
=
gateway
.
clientToken
().
generate
(
clientTokenRequest
);
result
.
setData
(
clientToken
);
return
result
;
map
.
put
(
"token"
,
clientToken
);
return
map
;
}
@PostMapping
(
"/pay"
)
...
...
@@ -90,9 +92,9 @@ public class BraintreeController extends Controller {
.
done
();
Result
<
Transaction
>
result
=
gateway
.
transaction
().
sale
(
request
);
System
.
err
.
println
(
JSONObject
.
fromObject
(
result
));
System
.
out
.
println
(
"============================================="
);
System
.
out
.
println
(
"支付状态:"
+
result
.
isSuccess
());
logger
.
info
((
JSONObject
.
fromObject
(
result
).
toString
()
));
logger
.
info
(
"============================================="
);
logger
.
info
(
"支付状态:"
+
result
.
isSuccess
());
String
orderId1
=
result
.
getTarget
().
getOrderId
();
String
id
=
result
.
getTarget
().
getId
();
if
(
result
.
isSuccess
())
{
...
...
@@ -115,7 +117,7 @@ public class BraintreeController extends Controller {
bonus
.
setOrderId
(
orderId
);
bonus
.
setAmount
(
order1
.
getItemsPrice
());
System
.
out
.
println
(
"佣金-----》》》订单号:"
+
orderId
+
"=user="
+
order1
.
getUserId
()
+
"=price="
+
order1
.
getItemsPrice
());
logger
.
info
(
"佣金-----》》》订单号:"
+
orderId
+
"=user="
+
order1
.
getUserId
()
+
"=price="
+
order1
.
getItemsPrice
());
saveNetworkMarketing
(
bonus
,
order1
.
getUserId
());
}
resp
.
sendRedirect
(
PAYPAL_SUCCESS_PAGE
);
...
...
@@ -148,8 +150,8 @@ public class BraintreeController extends Controller {
Result
<
CreditCard
>
result
=
gateway
.
creditCard
().
create
(
request
);
if
(
result
.
isSuccess
())
{
logger
.
info
(
"paypal支付,订单["
+
order
.
getOrderNo
()
+
"]支付成功"
);
System
.
out
.
println
(
"============================================="
);
System
.
out
.
println
(
"支付状态:"
+
result
.
isSuccess
());
logger
.
info
(
"============================================="
);
logger
.
info
(
"支付状态:"
+
result
.
isSuccess
());
String
customerId
=
result
.
getTarget
().
getCustomerId
();
String
id
=
result
.
getTarget
().
getToken
();
String
imageUrl
=
result
.
getTarget
().
getImageUrl
();
...
...
@@ -170,7 +172,7 @@ public class BraintreeController extends Controller {
bonus
.
setOrderId
(
orderId
);
bonus
.
setAmount
(
order1
.
getItemsPrice
());
System
.
out
.
println
(
"佣金-----》》》订单号:"
+
orderId
+
"=user="
+
order1
.
getUserId
()
+
"=price="
+
order1
.
getItemsPrice
());
logger
.
info
(
"佣金-----》》》订单号:"
+
orderId
+
"=user="
+
order1
.
getUserId
()
+
"=price="
+
order1
.
getItemsPrice
());
saveNetworkMarketing
(
bonus
,
order1
.
getUserId
());
}
resp
.
sendRedirect
(
PAYPAL_SUCCESS_PAGE
);
...
...
src/main/java/com/example/afrishop_v3/controllers/FlutterWaveController.java
浏览文件 @
efbfe6f7
...
...
@@ -81,7 +81,7 @@ public class FlutterWaveController extends Controller {
public
ResponseEntity
<
String
>
payForOrderByCard
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestBody
FlutterWaveCard
flutterWaveCard
)
{
RaveConstant
.
PUBLIC_KEY
=
PUBLIC_KEY
;
RaveConstant
.
SECRET_KEY
=
SECRET_KEY
;
RaveConstant
.
ENVIRONMENT
=
Environment
.
STAGING
;
//or STAGING
RaveConstant
.
ENVIRONMENT
=
Environment
.
LIVE
;
//or LIVE
// Result result = new Result();
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
...
...
@@ -135,7 +135,7 @@ public class FlutterWaveController extends Controller {
public
ResponseEntity
<
String
>
payForOrderByPhone
(
@RequestParam
(
"orderId"
)
String
orderId
,
@RequestBody
FlutterWaveCard
flutterWaveCard
)
{
RaveConstant
.
PUBLIC_KEY
=
PUBLIC_KEY
;
RaveConstant
.
SECRET_KEY
=
SECRET_KEY
;
RaveConstant
.
ENVIRONMENT
=
Environment
.
STAGING
;
//or STAGING
RaveConstant
.
ENVIRONMENT
=
Environment
.
LIVE
;
//or LIVE
// Result result = new Result();
Optional
<
TbCfOrder
>
byId
=
repository
.
findById
(
orderId
);
...
...
src/main/java/com/example/afrishop_v3/controllers/TbCfHomePageEntityController.java
浏览文件 @
efbfe6f7
...
...
@@ -27,9 +27,11 @@ public class TbCfHomePageEntityController extends Controller {
private
final
UserRepository
userRepository
;
private
final
VisitRepository
visitRepository
;
private
final
PostRepository
postRepository
;
private
final
TbCfGoodstwotypeRepository
goodstwotypeRepository
;
private
final
TbCfDescripitonRepository
descripitonRepository
;
private
static
Logger
logger
=
LoggerFactory
.
getLogger
(
UploadController
.
class
);
public
TbCfHomePageEntityController
(
TbCfHomePageRepository
repository
,
TbCfSortRepository
sortRepository
,
TbCfClassificationRepository
classificationRepository
,
TbCfStoreRepository
storeRepository
,
TbCfPosterRepository
posterRepository
,
TbCfColumnRepository
columnRepository
,
UserRepository
userRepository
,
VisitRepository
visitRepository
,
PostRepository
postRepository
)
{
public
TbCfHomePageEntityController
(
TbCfHomePageRepository
repository
,
TbCfSortRepository
sortRepository
,
TbCfClassificationRepository
classificationRepository
,
TbCfStoreRepository
storeRepository
,
TbCfPosterRepository
posterRepository
,
TbCfColumnRepository
columnRepository
,
UserRepository
userRepository
,
VisitRepository
visitRepository
,
PostRepository
postRepository
,
TbCfGoodstwotypeRepository
goodstwotypeRepository
,
TbCfDescripitonRepository
descripitonRepository
)
{
this
.
repository
=
repository
;
this
.
sortRepository
=
sortRepository
;
this
.
classificationRepository
=
classificationRepository
;
...
...
@@ -39,6 +41,9 @@ public class TbCfHomePageEntityController extends Controller {
this
.
userRepository
=
userRepository
;
this
.
visitRepository
=
visitRepository
;
this
.
postRepository
=
postRepository
;
this
.
goodstwotypeRepository
=
goodstwotypeRepository
;
this
.
descripitonRepository
=
descripitonRepository
;
}
@GetMapping
(
"/startPage/img"
)
...
...
@@ -126,6 +131,15 @@ public class TbCfHomePageEntityController extends Controller {
classificationList
.
forEach
(
c
->
{
String
[]
ids
=
c
.
getCategoryId
().
split
(
","
);
int
length
=
ids
.
length
;
int
count
=
0
;
if
(
length
==
1
)
{
count
=
goodstwotypeRepository
.
countByGoodstypeId
(
ids
[
0
]);
}
else
if
(
length
==
2
)
{
count
=
descripitonRepository
.
countByGoodstwotypeId
(
ids
[
1
]);
}
if
(
count
>
0
)
{
c
.
setParent
(
true
);
}
c
.
setNum
(
length
);
c
.
setCategoryId
(
ids
[
length
-
1
]);
});
...
...
src/main/java/com/example/afrishop_v3/models/TbCfClassification.java
浏览文件 @
efbfe6f7
...
...
@@ -54,6 +54,9 @@ public class TbCfClassification {
@Transient
private
Integer
num
;
@Transient
private
boolean
isParent
;
/**
* 设置:首页分类导航ID
*/
...
...
src/main/java/com/example/afrishop_v3/repository/TbCfDescripitonRepository.java
浏览文件 @
efbfe6f7
...
...
@@ -8,4 +8,6 @@ import java.util.List;
public
interface
TbCfDescripitonRepository
extends
PagingAndSortingRepository
<
TbCfDescripiton
,
String
>
{
List
<
TbCfDescripiton
>
findAllByGoodstwotypeIdOrderBySort
(
String
categoryTwo
);
int
countByGoodstwotypeId
(
String
id
);
}
src/main/java/com/example/afrishop_v3/repository/TbCfGoodstwotypeRepository.java
浏览文件 @
efbfe6f7
...
...
@@ -5,6 +5,9 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import
java.util.List
;
public
interface
TbCfGoodstwotypeRepository
extends
PagingAndSortingRepository
<
TbCfGoodstwotype
,
String
>
{
public
interface
TbCfGoodstwotypeRepository
extends
PagingAndSortingRepository
<
TbCfGoodstwotype
,
String
>
{
List
<
TbCfGoodstwotype
>
findAllByGoodstypeIdOrderBySort
(
String
id
);
int
countByGoodstypeId
(
String
id
);
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论