Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
Details
Activity
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
pseer
gxpt_ht
Commits
e560e5ab
Commit
e560e5ab
authored
Oct 24, 2023
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
create order otp;
user login opt;
parent
538f83d0
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
34 additions
and
29 deletions
+34
-29
LoginController.java
...ain/java/share/web/controller/system/LoginController.java
+1
-1
FrontTokenInterceptor.java
...ain/java/share/web/interceptor/FrontTokenInterceptor.java
+7
-6
CreateOrderRequest.java
...rc/main/java/share/system/request/CreateOrderRequest.java
+19
-12
LoginMobileRequest.java
...rc/main/java/share/system/request/LoginMobileRequest.java
+0
-7
SConsumerService.java
.../src/main/java/share/system/service/SConsumerService.java
+1
-1
LoginServiceImpl.java
...main/java/share/system/service/impl/LoginServiceImpl.java
+1
-1
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+1
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+4
-0
No files found.
share-front/src/main/java/share/web/controller/system/LoginController.java
View file @
e560e5ab
...
@@ -77,7 +77,7 @@ public class LoginController {
...
@@ -77,7 +77,7 @@ public class LoginController {
/**
/**
* 退出登录
* 退出登录
*/
*/
//
@ApiOperation(value = "退出")
@ApiOperation
(
value
=
"退出"
)
@RequestMapping
(
value
=
"/logout"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/logout"
,
method
=
RequestMethod
.
GET
)
public
R
<
String
>
loginOut
(
HttpServletRequest
request
){
public
R
<
String
>
loginOut
(
HttpServletRequest
request
){
loginService
.
loginOut
(
request
);
loginService
.
loginOut
(
request
);
...
...
share-front/src/main/java/share/web/interceptor/FrontTokenInterceptor.java
View file @
e560e5ab
...
@@ -62,13 +62,14 @@ public class FrontTokenInterceptor implements HandlerInterceptor {
...
@@ -62,13 +62,14 @@ public class FrontTokenInterceptor implements HandlerInterceptor {
SConsumer
userEntry
=
frontTokenComponent
.
getLoginSConsumerEntry
(
request
);
SConsumer
userEntry
=
frontTokenComponent
.
getLoginSConsumerEntry
(
request
);
if
(
userEntry
!=
null
){
if
(
userEntry
!=
null
){
FrontTokenComponent
.
loginSConsumerEntryThreadLocal
.
set
(
userEntry
);
FrontTokenComponent
.
loginSConsumerEntryThreadLocal
.
set
(
userEntry
);
}
else
{
token
=
"f788beab1ea14f0ab3a369e4c66ee627"
;
userEntry
=
new
SConsumer
();
userEntry
.
setId
(
1714160213741535234L
);
userEntry
.
setAccount
(
"15527462530"
);
userEntry
.
setPhone
(
"15527462530"
);
FrontTokenComponent
.
loginSConsumerEntryThreadLocal
.
set
(
userEntry
);
}
}
/* SConsumer userEntry = new SConsumer();
userEntry.setUid(1520);
userEntry.setAccount("aaa");
userEntry.setNickname("nizbh");
userEntry.setRealName("relxiaohuige");
FrontTokenComponent.loginUserEntryThreadLocal.set(userEntry);*/
if
(
token
==
null
||
token
.
isEmpty
()
||
userEntry
==
null
){
if
(
token
==
null
||
token
.
isEmpty
()
||
userEntry
==
null
){
//判断路由,部分路由不管用户是否登录都可以访问
//判断路由,部分路由不管用户是否登录都可以访问
boolean
result
=
frontTokenComponent
.
checkRouter
(
RequestUtil
.
getUri
(
request
));
boolean
result
=
frontTokenComponent
.
checkRouter
(
RequestUtil
.
getUri
(
request
));
...
...
share-system/src/main/java/share/system/request/CreateOrderRequest.java
View file @
e560e5ab
package
share
.
system
.
request
;
package
share
.
system
.
request
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -21,11 +24,11 @@ import java.util.Date;
...
@@ -21,11 +24,11 @@ import java.util.Date;
public
class
CreateOrderRequest
{
public
class
CreateOrderRequest
{
@ApiModelProperty
(
value
=
"门店ID"
,
required
=
true
)
@ApiModelProperty
(
value
=
"门店ID"
,
required
=
true
)
@Not
Blank
(
message
=
"门店ID不能为空"
)
@Not
Null
(
message
=
"门店ID不能为空"
)
private
Long
storeId
;
private
Long
storeId
;
@ApiModelProperty
(
value
=
"房间ID"
,
required
=
true
)
@ApiModelProperty
(
value
=
"房间ID"
,
required
=
true
)
@Not
Blank
(
message
=
"房间ID不能为空"
)
@Not
Null
(
message
=
"房间ID不能为空"
)
private
Long
roomId
;
private
Long
roomId
;
@ApiModelProperty
(
value
=
"优惠券id"
)
@ApiModelProperty
(
value
=
"优惠券id"
)
...
@@ -34,39 +37,43 @@ public class CreateOrderRequest {
...
@@ -34,39 +37,43 @@ public class CreateOrderRequest {
@ApiModelProperty
(
value
=
"套餐ID"
)
@ApiModelProperty
(
value
=
"套餐ID"
)
private
Long
packId
;
private
Long
packId
;
@ApiModelProperty
(
value
=
"订单类型(
0:订房订单,1:续房订单,2
:充值订单)"
,
required
=
true
)
@ApiModelProperty
(
value
=
"订单类型(
1:订房订单,2:续房订单,3
:充值订单)"
,
required
=
true
)
@Not
Blank
(
message
=
"订单类型不能为空"
)
@Not
Null
(
message
=
"订单类型不能为空"
)
private
Integer
orderType
;
private
Integer
orderType
;
@ApiModelProperty
(
value
=
"续房订单的上一笔订单编号"
,
required
=
true
)
@ApiModelProperty
(
value
=
"续房订单的上一笔订单编号"
,
required
=
true
)
private
String
preOrderNo
;
private
String
preOrderNo
;
@ApiModelProperty
(
value
=
"购买方式(1:小时,2:套餐)"
,
required
=
true
)
@ApiModelProperty
(
value
=
"购买方式(1:小时,2:套餐)"
,
required
=
true
)
@Not
Blank
(
message
=
"购买方式不能为空"
)
@Not
Null
(
message
=
"购买方式不能为空"
)
private
Integer
buyType
;
private
Integer
buyType
;
@ApiModelProperty
(
value
=
"支付类型(1:微信,2:支付宝)"
,
required
=
true
)
@ApiModelProperty
(
value
=
"支付类型(1:微信,2:支付宝)"
,
required
=
true
)
@Not
Blank
(
message
=
"支付类型不能为空"
)
@Not
Null
(
message
=
"支付类型不能为空"
)
private
Integer
payType
;
private
Integer
payType
;
/** 预约开始时间 */
/** 预约开始时间 */
@ApiModelProperty
(
value
=
"预约开始时间 yyyy-MM-dd HH:mm"
,
required
=
true
)
@ApiModelProperty
(
value
=
"预约开始时间 yyyy-MM-dd HH:mm:ss"
,
required
=
true
)
@NotBlank
(
message
=
"预约开始时间不能为空"
)
@NotNull
(
message
=
"预约开始时间不能为空"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
preStartDate
;
private
Date
preStartDate
;
/** 预约结束时间 */
/** 预约结束时间 */
@ApiModelProperty
(
value
=
"预约结束时间 yyyy-MM-dd HH:mm"
,
required
=
true
)
@ApiModelProperty
(
value
=
"预约结束时间 yyyy-MM-dd HH:mm:ss"
,
required
=
true
)
@NotBlank
(
message
=
"预约结束时间不能为空"
)
@NotNull
(
message
=
"预约结束时间不能为空"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
preEndDate
;
private
Date
preEndDate
;
@ApiModelProperty
(
value
=
"总金额"
)
@ApiModelProperty
(
value
=
"总金额"
)
@Not
Blank
(
message
=
"总金额不能为空"
)
@Not
Null
(
message
=
"总金额不能为空"
)
private
BigDecimal
totalFee
;
private
BigDecimal
totalFee
;
@ApiModelProperty
(
value
=
"优惠券优惠金额"
)
@ApiModelProperty
(
value
=
"优惠券优惠金额"
)
private
BigDecimal
couponFee
;
private
BigDecimal
couponFee
;
@ApiModelProperty
(
value
=
"实际支付金额"
)
@ApiModelProperty
(
value
=
"实际支付金额"
)
@Not
Blank
(
message
=
"实际支付金额不能为空"
)
@Not
Null
(
message
=
"实际支付金额不能为空"
)
private
BigDecimal
payFee
;
private
BigDecimal
payFee
;
}
}
share-system/src/main/java/share/system/request/LoginMobileRequest.java
View file @
e560e5ab
...
@@ -32,11 +32,4 @@ public class LoginMobileRequest implements Serializable {
...
@@ -32,11 +32,4 @@ public class LoginMobileRequest implements Serializable {
@Pattern
(
regexp
=
RegularConstants
.
VALIDATE_CODE_NUM_SIX
,
message
=
"验证码格式错误,验证码必须为6位数字"
)
@Pattern
(
regexp
=
RegularConstants
.
VALIDATE_CODE_NUM_SIX
,
message
=
"验证码格式错误,验证码必须为6位数字"
)
private
String
captcha
;
private
String
captcha
;
@ApiModelProperty
(
value
=
"推广人id"
)
@JsonProperty
(
value
=
"spread_spid"
)
private
Integer
spreadPid
;
@ApiModelProperty
(
value
=
"拓客渠道"
)
private
String
channel
;
}
}
share-system/src/main/java/share/system/service/SConsumerService.java
View file @
e560e5ab
...
@@ -79,7 +79,7 @@ public interface SConsumerService extends IService<SConsumer>
...
@@ -79,7 +79,7 @@ public interface SConsumerService extends IService<SConsumer>
* @param channel 渠道
* @param channel 渠道
* @return
* @return
*/
*/
SConsumer
registerPhone
(
String
phone
,
String
channel
);
SConsumer
registerPhone
(
String
phone
);
SConsumer
getByPhone
(
String
phone
);
SConsumer
getByPhone
(
String
phone
);
...
...
share-system/src/main/java/share/system/service/impl/LoginServiceImpl.java
View file @
e560e5ab
...
@@ -86,7 +86,7 @@ public class LoginServiceImpl implements LoginService {
...
@@ -86,7 +86,7 @@ public class LoginServiceImpl implements LoginService {
//查询手机号信息
//查询手机号信息
SConsumer
user
=
sConsumerService
.
getByPhone
(
loginRequest
.
getPhone
());
SConsumer
user
=
sConsumerService
.
getByPhone
(
loginRequest
.
getPhone
());
if
(
ObjectUtil
.
isNull
(
user
))
{
// 此用户不存在,走新用户注册流程
if
(
ObjectUtil
.
isNull
(
user
))
{
// 此用户不存在,走新用户注册流程
user
=
sConsumerService
.
registerPhone
(
loginRequest
.
getPhone
()
,
loginRequest
.
getChannel
()
);
user
=
sConsumerService
.
registerPhone
(
loginRequest
.
getPhone
());
}
else
{
}
else
{
if
(
Objects
.
isNull
(
user
)||
YesNoEnum
.
no
.
getIndex
().
equals
(
user
.
getStatus
()))
{
if
(
Objects
.
isNull
(
user
)||
YesNoEnum
.
no
.
getIndex
().
equals
(
user
.
getStatus
()))
{
throw
new
BaseException
(
"当前账户已禁用,请联系管理员!"
);
throw
new
BaseException
(
"当前账户已禁用,请联系管理员!"
);
...
...
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
e560e5ab
...
@@ -121,7 +121,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
...
@@ -121,7 +121,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
}
}
@Override
@Override
public
SConsumer
registerPhone
(
String
phone
,
String
channel
)
{
public
SConsumer
registerPhone
(
String
phone
)
{
return
null
;
return
null
;
}
}
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
e560e5ab
...
@@ -230,6 +230,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -230,6 +230,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
private
SOrder
generatSOrder
(
CreateOrderRequest
request
,
SConsumer
user
){
private
SOrder
generatSOrder
(
CreateOrderRequest
request
,
SConsumer
user
){
SOrder
sOrder
=
new
SOrder
();
SOrder
sOrder
=
new
SOrder
();
BeanUtils
.
copyProperties
(
request
,
sOrder
);
BeanUtils
.
copyProperties
(
request
,
sOrder
);
sOrder
.
setTotalPrice
(
request
.
getTotalFee
());
sOrder
.
setCouponPrice
(
request
.
getCouponFee
());
sOrder
.
setPayPrice
(
request
.
getPayFee
());
//设置订单号
//设置订单号
sOrder
.
setOrderNo
(
BaseUtil
.
getOrderNo
(
PayTypeEnum
.
getEnumByCode
(
request
.
getPayType
()).
getValue
()));
sOrder
.
setOrderNo
(
BaseUtil
.
getOrderNo
(
PayTypeEnum
.
getEnumByCode
(
request
.
getPayType
()).
getValue
()));
sOrder
.
setConsumerId
(
user
.
getId
());
sOrder
.
setConsumerId
(
user
.
getId
());
...
@@ -271,6 +274,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -271,6 +274,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
// 计算优惠券金额
// 计算优惠券金额
if
(
ObjectUtil
.
isNull
(
request
.
getCouponId
())
||
request
.
getCouponId
()
<=
0
)
{
if
(
ObjectUtil
.
isNull
(
request
.
getCouponId
())
||
request
.
getCouponId
()
<=
0
)
{
priceResponse
.
setCouponFee
(
BigDecimal
.
ZERO
);
priceResponse
.
setCouponFee
(
BigDecimal
.
ZERO
);
priceResponse
.
setPayFee
(
totalPrice
);
}
else
{
}
else
{
// 判断优惠券是否可以使用
// 判断优惠券是否可以使用
SConsumerCoupon
consumerCoupon
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
SConsumerCoupon
consumerCoupon
=
consumerCouponService
.
getById
(
request
.
getCouponId
());
...
...
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