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
932d41f0
Commit
932d41f0
authored
Nov 08, 2023
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加根据订单编号查询订单
parent
88cb6cf1
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
38 additions
and
3 deletions
+38
-3
SOrderController.java
...in/java/share/web/controller/system/SOrderController.java
+8
-0
SOrder.java
share-system/src/main/java/share/system/domain/SOrder.java
+4
-0
SConsumerCouponMapper.java
.../main/java/share/system/mapper/SConsumerCouponMapper.java
+2
-0
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+2
-0
QPServiceImpl.java
...rc/main/java/share/system/service/impl/QPServiceImpl.java
+1
-1
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+1
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+10
-1
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+10
-0
No files found.
share-front/src/main/java/share/web/controller/system/SOrderController.java
View file @
932d41f0
...
@@ -63,6 +63,14 @@ public class SOrderController extends BaseController
...
@@ -63,6 +63,14 @@ public class SOrderController extends BaseController
}
}
/**
/**
* 获取订单详细信息
*/
@GetMapping
(
value
=
"/orderNo"
)
public
AjaxResult
queryByOrderNo
(
@RequestParam
(
"orderNo"
)
String
orderNo
)
{
return
success
(
sOrderService
.
selectSOrderByOrderNo
(
orderNo
));
}
/**
* 开门
* 开门
*/
*/
@ApiOperation
(
value
=
"开门"
)
@ApiOperation
(
value
=
"开门"
)
...
...
share-system/src/main/java/share/system/domain/SOrder.java
View file @
932d41f0
...
@@ -134,4 +134,8 @@ public class SOrder extends BaseEntity
...
@@ -134,4 +134,8 @@ public class SOrder extends BaseEntity
@TableField
(
select
=
false
)
@TableField
(
select
=
false
)
private
Integer
isDelete
;
private
Integer
isDelete
;
@TableField
(
exist
=
false
)
private
Integer
buyType
;
}
}
share-system/src/main/java/share/system/mapper/SConsumerCouponMapper.java
View file @
932d41f0
...
@@ -61,4 +61,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
...
@@ -61,4 +61,6 @@ public interface SConsumerCouponMapper extends BaseMapper<SConsumerCoupon>
public
int
deleteSConsumerCouponByIds
(
Long
[]
ids
);
public
int
deleteSConsumerCouponByIds
(
Long
[]
ids
);
int
selectSConsumerCouponConut
(
SConsumerCoupon
sConsumerCoupon
);
int
selectSConsumerCouponConut
(
SConsumerCoupon
sConsumerCoupon
);
List
<
SConsumerCoupon
>
querySConsumerCouponList
(
SConsumerCoupon
sConsumerCoupon
);
}
}
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
932d41f0
...
@@ -122,4 +122,6 @@ public interface ISOrderService extends IService<SOrder>
...
@@ -122,4 +122,6 @@ public interface ISOrderService extends IService<SOrder>
* @return
* @return
*/
*/
boolean
cancel
(
String
orderNo
);
boolean
cancel
(
String
orderNo
);
SOrder
selectSOrderByOrderNo
(
String
orderNo
);
}
}
share-system/src/main/java/share/system/service/impl/QPServiceImpl.java
View file @
932d41f0
...
@@ -99,7 +99,7 @@ public class QPServiceImpl implements QPService {
...
@@ -99,7 +99,7 @@ public class QPServiceImpl implements QPService {
if
(
byId
==
null
)
{
if
(
byId
==
null
)
{
throw
new
RuntimeException
(
"未找到对应的券码"
);
throw
new
RuntimeException
(
"未找到对应的券码"
);
}
}
if
(
StringUtils
.
isBlank
(
byId
.
getCouponCode
()))
{
if
(
StringUtils
.
isBlank
(
byId
.
getCouponCode
()))
{
throw
new
RuntimeException
(
"未找到对应的券码"
);
throw
new
RuntimeException
(
"未找到对应的券码"
);
}
}
TuangouReceiptGetConsumedReponseEntity
getconsumed
=
getconsumed
(
byId
.
getCouponCode
());
TuangouReceiptGetConsumedReponseEntity
getconsumed
=
getconsumed
(
byId
.
getCouponCode
());
...
...
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
932d41f0
...
@@ -130,7 +130,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
...
@@ -130,7 +130,7 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
sConsumerCoupon
.
setUseStatus
(
ConsumerCouponUseStatusEnum
.
WAIT_USE
.
getCode
());
sConsumerCoupon
.
setUseStatus
(
ConsumerCouponUseStatusEnum
.
WAIT_USE
.
getCode
());
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
//查询用户未使用的优惠券
//查询用户未使用的优惠券
List
<
SConsumerCoupon
>
sConsumerCoupons
=
sConsumerCouponMapper
.
select
SConsumerCouponList
(
sConsumerCoupon
);
List
<
SConsumerCoupon
>
sConsumerCoupons
=
sConsumerCouponMapper
.
query
SConsumerCouponList
(
sConsumerCoupon
);
//计算时长
//计算时长
BigDecimal
bigDecimal
=
DateUtils
.
differentHour
(
couponRequest
.
getPreStartDate
(),
couponRequest
.
getPreEndDate
());
BigDecimal
bigDecimal
=
DateUtils
.
differentHour
(
couponRequest
.
getPreStartDate
(),
couponRequest
.
getPreEndDate
());
if
(
CollectionUtils
.
isEmpty
(
sConsumerCoupons
))
{
if
(
CollectionUtils
.
isEmpty
(
sConsumerCoupons
))
{
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
932d41f0
...
@@ -233,6 +233,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -233,6 +233,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
sOrder
.
setTotalPrice
(
request
.
getTotalFee
());
sOrder
.
setTotalPrice
(
request
.
getTotalFee
());
sOrder
.
setCouponPrice
(
request
.
getCouponFee
());
sOrder
.
setCouponPrice
(
request
.
getCouponFee
());
sOrder
.
setPayPrice
(
request
.
getPayFee
());
sOrder
.
setPayPrice
(
request
.
getPayFee
());
sOrder
.
setBuyType
(
request
.
getBuyType
());
//设置订单号
//设置订单号
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
());
...
@@ -241,6 +242,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -241,6 +242,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
sOrder
.
setPayStatus
(
YesNoEnum
.
no
.
getIndex
());
sOrder
.
setPayStatus
(
YesNoEnum
.
no
.
getIndex
());
sOrder
.
setStatus
(
OrderStatusEnum
.
UNUSED
.
getCode
());
sOrder
.
setStatus
(
OrderStatusEnum
.
UNUSED
.
getCode
());
sOrder
.
setRefundStatus
(
RefundStatusEnum
.
UNREFUND
.
getCode
());
sOrder
.
setRefundStatus
(
RefundStatusEnum
.
UNREFUND
.
getCode
());
sOrder
.
setPackId
(
request
.
getPackId
());
//计算订单时长
//计算订单时长
sOrder
.
setTimeLong
(
DateUtils
.
differentHour
(
sOrder
.
getPreStartDate
(),
sOrder
.
getPreEndDate
()).
toString
());
sOrder
.
setTimeLong
(
DateUtils
.
differentHour
(
sOrder
.
getPreStartDate
(),
sOrder
.
getPreEndDate
()).
toString
());
if
(
Objects
.
nonNull
(
sOrder
.
getPackId
())&&
sOrder
.
getPackId
()
!=
0
){
if
(
Objects
.
nonNull
(
sOrder
.
getPackId
())&&
sOrder
.
getPackId
()
!=
0
){
...
@@ -380,6 +382,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -380,6 +382,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
}
}
@Override
@Override
public
SOrder
selectSOrderByOrderNo
(
String
orderNo
)
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SOrder:
:
getOrderNo
,
orderNo
);
return
getOne
(
queryWrapper
);
}
@Override
public
String
openDoor
(
Long
id
)
{
public
String
openDoor
(
Long
id
)
{
SOrder
sOrder
=
sOrderMapper
.
selectSOrderById
(
id
);
SOrder
sOrder
=
sOrderMapper
.
selectSOrderById
(
id
);
if
(
Objects
.
isNull
(
sOrder
))
{
if
(
Objects
.
isNull
(
sOrder
))
{
...
@@ -455,7 +464,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -455,7 +464,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
* 计算使用优惠券后的订单金额
* 计算使用优惠券后的订单金额
*/
*/
private
void
computedCouponPrice
(
ComputedOrderPriceResponse
priceResponse
,
SConsumer
user
,
SConsumerCoupon
consumerCoupon
){
private
void
computedCouponPrice
(
ComputedOrderPriceResponse
priceResponse
,
SConsumer
user
,
SConsumerCoupon
consumerCoupon
){
if
(
ObjectUtil
.
isNull
(
consumerCoupon
)
||
!
consumerCoupon
.
getCo
upon
Id
().
equals
(
user
.
getId
()))
{
if
(
ObjectUtil
.
isNull
(
consumerCoupon
)
||
!
consumerCoupon
.
getCo
nsumer
Id
().
equals
(
user
.
getId
()))
{
throw
new
BaseException
(
"优惠券领取记录不存在!"
);
throw
new
BaseException
(
"优惠券领取记录不存在!"
);
}
}
if
(
CouponStatusEnum
.
USED
.
getValue
().
compareTo
(
consumerCoupon
.
getUseStatus
())
==
0
)
{
if
(
CouponStatusEnum
.
USED
.
getValue
().
compareTo
(
consumerCoupon
.
getUseStatus
())
==
0
)
{
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
932d41f0
...
@@ -74,6 +74,16 @@
...
@@ -74,6 +74,16 @@
<select
id=
"selectSConsumerCouponConut"
resultType=
"java.lang.Integer"
>
<select
id=
"selectSConsumerCouponConut"
resultType=
"java.lang.Integer"
>
select count(1) from s_consumer_coupon where consumer_id = #{consumerId} and use_status = 0
select count(1) from s_consumer_coupon where consumer_id = #{consumerId} and use_status = 0
</select>
</select>
<select
id=
"querySConsumerCouponList"
parameterType=
"SConsumerCoupon"
resultMap=
"SConsumerCouponResult"
>
<include
refid=
"selectSConsumerCouponVo"
/>
<where>
1=1
and is_delete = '0'
and end_date >= NOW()
and use_status = '0'
<if
test=
"consumerId != null "
>
and consumer_id = #{consumerId}
</if>
</where>
</select>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
<insert
id=
"insertSConsumerCoupon"
parameterType=
"SConsumerCoupon"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_consumer_coupon
insert into s_consumer_coupon
...
...
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