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
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
58 additions
and
23 deletions
+58
-23
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
+21
-21
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
...
@@ -60,29 +60,29 @@ public class QPServiceImpl implements QPService {
...
@@ -60,29 +60,29 @@ public class QPServiceImpl implements QPService {
//执行验券
//执行验券
// List<TuangouReceiptConsumeResponseEntity> consume = consume(code, count);
// List<TuangouReceiptConsumeResponseEntity> consume = consume(code, count);
// consume.forEach(item -> {
// consume.forEach(item -> {
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
sConsumerCoupon
.
setConsumerId
(
user
.
getId
());
//取订单ID,如果为空,则取套餐ID
//取订单ID,如果为空,则取套餐ID
sConsumerCoupon
.
setCouponId
(
prepare
.
getDeal_id
());
sConsumerCoupon
.
setCouponId
(
prepare
.
getDeal_id
());
sConsumerCoupon
.
setCouponCode
(
code
);
sConsumerCoupon
.
setCouponCode
(
code
);
sConsumerCoupon
.
setName
(
prepare
.
getDeal_title
());
sConsumerCoupon
.
setName
(
prepare
.
getDeal_title
());
sConsumerCoupon
.
setCouponType
(
sCoupon
.
getCouponType
());
sConsumerCoupon
.
setCouponType
(
sCoupon
.
getCouponType
());
sConsumerCoupon
.
setStoreType
(
sCoupon
.
getStoreType
());
sConsumerCoupon
.
setStoreType
(
sCoupon
.
getStoreType
());
sConsumerCoupon
.
setRoomType
(
sCoupon
.
getRoomType
());
sConsumerCoupon
.
setRoomType
(
sCoupon
.
getRoomType
());
sConsumerCoupon
.
setMinDuration
(
sCoupon
.
getMinDuration
());
sConsumerCoupon
.
setMinDuration
(
sCoupon
.
getMinDuration
());
sConsumerCoupon
.
setMaxDuration
(
sCoupon
.
getMaxDuration
());
sConsumerCoupon
.
setMaxDuration
(
sCoupon
.
getMaxDuration
());
sConsumerCoupon
.
setDuration
(
sCoupon
.
getDuration
());
sConsumerCoupon
.
setDuration
(
sCoupon
.
getDuration
());
sConsumerCoupon
.
setMinPrice
(
sCoupon
.
getMinPrice
());
sConsumerCoupon
.
setMinPrice
(
sCoupon
.
getMinPrice
());
sConsumerCoupon
.
setSubPrice
(
sCoupon
.
getSubPrice
());
sConsumerCoupon
.
setSubPrice
(
sCoupon
.
getSubPrice
());
sConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
CHECK
.
getCode
());
sConsumerCoupon
.
setSourceType
(
SourceTypeEnum
.
CHECK
.
getCode
());
sConsumerCoupon
.
setPlatformType
(
PlatformTypeEnum
.
MEITUAN
.
getCode
());
sConsumerCoupon
.
setPlatformType
(
PlatformTypeEnum
.
MEITUAN
.
getCode
());
sConsumerCoupon
.
setStartDate
(
sCoupon
.
getStartDate
());
sConsumerCoupon
.
setStartDate
(
sCoupon
.
getStartDate
());
sConsumerCoupon
.
setEndDate
(
prepare
.
getReceiptEndDate
());
sConsumerCoupon
.
setEndDate
(
prepare
.
getReceiptEndDate
());
sConsumerCoupon
.
setCouponTimeStart
(
sCoupon
.
getValidStartTime
());
sConsumerCoupon
.
setCouponTimeStart
(
sCoupon
.
getValidStartTime
());
sConsumerCoupon
.
setCouponTimeEnd
(
sCoupon
.
getValidEndTime
());
sConsumerCoupon
.
setCouponTimeEnd
(
sCoupon
.
getValidEndTime
());
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
sConsumerCoupon
.
setCreateBy
(
String
.
valueOf
(
user
.
getId
()));
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
isConsumerCouponService
.
insertSConsumerCoupon
(
sConsumerCoupon
);
// });
// });
SimpleDateFormat
format2
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
SimpleDateFormat
format2
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
...
@@ -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