Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
A
Afrishop refactored project
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Whispa
Afrishop refactored project
Commits
db789a14
提交
db789a14
authored
3月 18, 2021
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改订单时间
上级
3b7873a0
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
81 行增加
和
31 行删除
+81
-31
AuthController.java
...a/com/example/afrishop_v3/controllers/AuthController.java
+4
-0
BraintreeController.java
.../example/afrishop_v3/controllers/BraintreeController.java
+3
-2
DpoPayController.java
...com/example/afrishop_v3/controllers/DpoPayController.java
+3
-2
FlutterWaveController.java
...xample/afrishop_v3/controllers/FlutterWaveController.java
+3
-2
PaypalContoller.java
.../com/example/afrishop_v3/controllers/PaypalContoller.java
+3
-2
StripeController.java
...com/example/afrishop_v3/controllers/StripeController.java
+3
-2
TbCfOrder.java
src/main/java/com/example/afrishop_v3/models/TbCfOrder.java
+2
-1
TbCfUserInfo.java
...ain/java/com/example/afrishop_v3/models/TbCfUserInfo.java
+23
-20
DateUtil.java
src/main/java/com/example/afrishop_v3/util/DateUtil.java
+37
-0
没有找到文件。
src/main/java/com/example/afrishop_v3/controllers/AuthController.java
浏览文件 @
db789a14
...
...
@@ -250,6 +250,10 @@ public class AuthController extends Controller {
@PostMapping
(
"/signup"
)
public
Result
<?>
registerUser
(
@RequestBody
TbCfUserInfo
signUpRequest
,
HttpServletRequest
request
)
{
try
{
// String source = signUpRequest.getSource().toString();
// boolean byAccount = userRepository.existsByAccount(signUpRequest.getEmail());
// if ( byAccount ) {
// return new Result(ResultCodeEnum.VALIDATE_ERROR.getCode(),"Error: Username is already taken!");
...
...
src/main/java/com/example/afrishop_v3/controllers/BraintreeController.java
浏览文件 @
db789a14
...
...
@@ -6,6 +6,7 @@ import com.example.afrishop_v3.enums.DeliveryStatusEnum;
import
com.example.afrishop_v3.enums.OrderStatusEnum
;
import
com.example.afrishop_v3.models.*
;
import
com.example.afrishop_v3.repository.*
;
import
com.example.afrishop_v3.util.DateUtil
;
import
com.example.afrishop_v3.util.GatewayFactory
;
import
com.example.afrishop_v3.util.IdUtil
;
import
net.sf.json.JSONObject
;
...
...
@@ -187,8 +188,8 @@ public class BraintreeController extends Controller {
*/
private
TbCfOrder
changeOrderState
(
String
transToken
,
TbCfOrder
order
)
{
//更改订单状态
order
.
setUpdateTime
(
new
Date
());
order
.
setDealTime
(
new
Date
());
order
.
setUpdateTime
(
DateUtil
.
getNow
());
order
.
setDealTime
(
DateUtil
.
getNow
());
order
.
setPayId
(
transToken
);
order
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
order
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
...
...
src/main/java/com/example/afrishop_v3/controllers/DpoPayController.java
浏览文件 @
db789a14
...
...
@@ -10,6 +10,7 @@ import com.example.afrishop_v3.models.*;
import
com.example.afrishop_v3.repository.*
;
import
com.example.afrishop_v3.security.services.AuthenticationUser
;
import
com.example.afrishop_v3.util.DataUtils
;
import
com.example.afrishop_v3.util.DateUtil
;
import
com.example.afrishop_v3.util.HttpsUtil
;
import
com.example.afrishop_v3.util.IdUtil
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -234,8 +235,8 @@ public class DpoPayController extends Controller {
private
void
changeOrderState
(
String
transToken
,
TbCfOrder
order
)
{
//更改订单状态
order
.
setUpdateTime
(
new
Date
());
order
.
setDealTime
(
new
Date
());
order
.
setUpdateTime
(
DateUtil
.
getNow
());
order
.
setDealTime
(
DateUtil
.
getNow
());
order
.
setPayId
(
transToken
);
order
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
order
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
...
...
src/main/java/com/example/afrishop_v3/controllers/FlutterWaveController.java
浏览文件 @
db789a14
...
...
@@ -11,6 +11,7 @@ import com.example.afrishop_v3.enums.ResultCodeEnum;
import
com.example.afrishop_v3.models.*
;
import
com.example.afrishop_v3.repository.*
;
import
com.example.afrishop_v3.security.services.AuthenticationUser
;
import
com.example.afrishop_v3.util.DateUtil
;
import
com.example.afrishop_v3.util.HttpClientUtil
;
import
com.example.afrishop_v3.util.IdUtil
;
import
org.apache.commons.lang3.StringUtils
;
...
...
@@ -274,8 +275,8 @@ public class FlutterWaveController extends Controller {
private
void
changeOrderState
(
String
payId
,
TbCfOrder
order
)
{
//更改订单状态
order
.
setUpdateTime
(
new
Date
());
order
.
setDealTime
(
new
Date
());
order
.
setUpdateTime
(
DateUtil
.
getNow
());
order
.
setDealTime
(
DateUtil
.
getNow
());
order
.
setPayId
(
payId
);
order
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
order
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
...
...
src/main/java/com/example/afrishop_v3/controllers/PaypalContoller.java
浏览文件 @
db789a14
...
...
@@ -9,6 +9,7 @@ import com.example.afrishop_v3.enums.OrderStatusEnum;
import
com.example.afrishop_v3.enums.ResultCodeEnum
;
import
com.example.afrishop_v3.models.*
;
import
com.example.afrishop_v3.repository.*
;
import
com.example.afrishop_v3.util.DateUtil
;
import
com.example.afrishop_v3.util.IdUtil
;
import
com.example.afrishop_v3.util.PayPalUtil
;
import
com.paypal.api.payments.*
;
...
...
@@ -280,8 +281,8 @@ public class PaypalContoller extends Controller {
*/
private
TbCfOrder
changeOrderState
(
String
transToken
,
TbCfOrder
order
)
{
//更改订单状态
order
.
setUpdateTime
(
new
Date
());
order
.
setDealTime
(
new
Date
());
order
.
setUpdateTime
(
DateUtil
.
getNow
());
order
.
setDealTime
(
DateUtil
.
getNow
());
order
.
setPayId
(
transToken
);
order
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
order
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
...
...
src/main/java/com/example/afrishop_v3/controllers/StripeController.java
浏览文件 @
db789a14
...
...
@@ -6,6 +6,7 @@ import com.example.afrishop_v3.enums.OrderStatusEnum;
import
com.example.afrishop_v3.enums.ResultCodeEnum
;
import
com.example.afrishop_v3.models.*
;
import
com.example.afrishop_v3.repository.*
;
import
com.example.afrishop_v3.util.DateUtil
;
import
com.example.afrishop_v3.util.IdUtil
;
import
com.example.afrishop_v3.util.StripePay
;
import
com.stripe.exception.StripeException
;
...
...
@@ -134,8 +135,8 @@ public class StripeController extends Controller {
*/
private
TbCfOrder
changeOrderState
(
String
transToken
,
TbCfOrder
order
)
{
//更改订单状态
order
.
setUpdateTime
(
new
Date
());
order
.
setDealTime
(
new
Date
());
order
.
setUpdateTime
(
DateUtil
.
getNow
());
order
.
setDealTime
(
DateUtil
.
getNow
());
order
.
setPayId
(
transToken
);
order
.
setOrderStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
order
.
setPayStatus
(
OrderStatusEnum
.
PAID
.
getValue
());
...
...
src/main/java/com/example/afrishop_v3/models/TbCfOrder.java
浏览文件 @
db789a14
...
...
@@ -7,6 +7,7 @@ import com.example.afrishop_v3.enums.OrderStatusEnum;
import
com.example.afrishop_v3.enums.ResultCodeEnum
;
import
com.example.afrishop_v3.repository.ActivityRepository
;
import
com.example.afrishop_v3.repository.TbCfStationItemRepository
;
import
com.example.afrishop_v3.util.DateUtil
;
import
com.example.afrishop_v3.util.IdUtil
;
import
com.example.afrishop_v3.vo.Condition
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
...
...
@@ -212,7 +213,7 @@ public class TbCfOrder {
this
.
orderStatus
=
OrderStatusEnum
.
PENDING_PAY
.
getValue
();
this
.
enableFlag
=
StateConstant
.
VALID
;
this
.
payStatus
=
OrderStatusEnum
.
PENDING_PAY
.
getValue
();
this
.
orderTime
=
new
Date
();
this
.
orderTime
=
DateUtil
.
getNow
();
}
public
BigDecimal
getReduceAmount
()
{
...
...
src/main/java/com/example/afrishop_v3/models/TbCfUserInfo.java
浏览文件 @
db789a14
...
...
@@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
org.apache.commons.lang3.StringUtils
;
import
org.hibernate.annotations.Formula
;
import
org.hibernate.annotations.NotFound
;
import
org.hibernate.annotations.NotFoundAction
;
...
...
@@ -101,8 +102,9 @@ public class TbCfUserInfo {
/**
* 默认地址id
*/
@ManyToOne
@JsonIgnore
@JoinColumn
(
columnDefinition
=
"default_address_id"
,
name
=
"default_address_id"
)
@ManyToOne
@JsonIgnore
@JoinColumn
(
columnDefinition
=
"default_address_id"
,
name
=
"default_address_id"
)
@NotFound
(
action
=
NotFoundAction
.
IGNORE
)
private
TbCfAddress
address
;
/**
...
...
@@ -210,7 +212,7 @@ public class TbCfUserInfo {
}
@JsonProperty
public
boolean
invited
(){
public
boolean
invited
()
{
return
invitation
>
0
;
}
...
...
@@ -247,16 +249,16 @@ public class TbCfUserInfo {
}
@JsonIgnore
public
Map
<
String
,
Object
>
smallMap
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"username"
,
display
());
map
.
put
(
"userId"
,
getUserId
());
map
.
put
(
"avatar"
,
getAvatar
());
map
.
put
(
"code"
,
getCode
());
map
.
put
(
"phone"
,
getPhone
());
map
.
put
(
"email"
,
getEmail
());
map
.
put
(
"bio"
,
getSlogan
());
map
.
put
(
"lastLoginTime"
,
getLastLoginTime
());
public
Map
<
String
,
Object
>
smallMap
()
{
Map
<
String
,
Object
>
map
=
new
LinkedHashMap
<>();
map
.
put
(
"username"
,
display
());
map
.
put
(
"userId"
,
getUserId
());
map
.
put
(
"avatar"
,
getAvatar
());
map
.
put
(
"code"
,
getCode
());
map
.
put
(
"phone"
,
getPhone
());
map
.
put
(
"email"
,
getEmail
());
map
.
put
(
"bio"
,
getSlogan
());
map
.
put
(
"lastLoginTime"
,
getLastLoginTime
());
return
map
;
}
...
...
@@ -265,15 +267,15 @@ public class TbCfUserInfo {
this
.
fcm
=
fcm
;
}
public
boolean
hasFcm
(){
return
fcm
!=
null
;
public
boolean
hasFcm
()
{
return
!
StringUtils
.
isBlank
(
fcm
)
;
}
public
String
getFcm
(){
public
String
getFcm
()
{
return
fcm
;
}
public
String
getSlogan
(){
public
String
getSlogan
()
{
return
slogan
;
}
...
...
@@ -303,7 +305,7 @@ public class TbCfUserInfo {
return
userId
;
}
public
void
setInvitation
(
int
inv
){
public
void
setInvitation
(
int
inv
)
{
this
.
invitation
=
inv
;
}
...
...
@@ -313,7 +315,7 @@ public class TbCfUserInfo {
return
BigDecimal
.
valueOf
(
ogWallet
()).
setScale
(
3
,
RoundingMode
.
HALF_UP
);
}
public
double
ogWallet
(){
public
double
ogWallet
()
{
return
bonus
+
withdraw
;
}
...
...
@@ -387,9 +389,10 @@ public class TbCfUserInfo {
return
nick
;
}
public
String
display
(){
public
String
display
()
{
return
getNick
()
!=
null
&&
!
getNick
().
isEmpty
()
?
getNick
()
:
getEmail
()
!=
null
&&
!
getEmail
().
isEmpty
()
?
getEmail
()
:
getPhone
();
}
/**
* 设置:电话号码
*/
...
...
src/main/java/com/example/afrishop_v3/util/DateUtil.java
0 → 100644
浏览文件 @
db789a14
package
com
.
example
.
afrishop_v3
.
util
;
import
java.text.ParseException
;
import
java.time.LocalDateTime
;
import
java.time.ZoneId
;
import
java.time.ZonedDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.temporal.TemporalAccessor
;
import
java.util.Date
;
/**
* @Auther: wudepeng
* @Date: 2021/03/18
* @Description:日期处理
*/
public
class
DateUtil
{
/**
* 获取南非时区
*
* @return
* @throws ParseException
*/
public
static
Date
getNow
()
{
ZonedDateTime
zonedDatetimeFromZone
=
ZonedDateTime
.
now
(
ZoneId
.
of
(
"Africa/Johannesburg"
));
DateTimeFormatter
dateToStrFormatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
);
String
dateStr
=
dateToStrFormatter
.
format
(
zonedDatetimeFromZone
);
TemporalAccessor
parse
=
dateToStrFormatter
.
parse
(
dateStr
);
LocalDateTime
date
=
LocalDateTime
.
from
(
parse
);
Date
now
=
asDate
(
date
);
return
now
;
}
public
static
Date
asDate
(
LocalDateTime
localDateTime
)
{
return
Date
.
from
(
localDateTime
.
atZone
(
ZoneId
.
systemDefault
()).
toInstant
());
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论