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
70e036a0
Commit
70e036a0
authored
Mar 11, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优惠卷领取记录增加作废和恢复功能
parent
387a6edf
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
42 additions
and
18 deletions
+42
-18
SConsumerCouponController.java
...hare/web/controller/system/SConsumerCouponController.java
+20
-16
ISConsumerCouponService.java
...in/java/share/system/service/ISConsumerCouponService.java
+4
-0
SConsumerCouponServiceImpl.java
...share/system/service/impl/SConsumerCouponServiceImpl.java
+16
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+1
-1
SConsumerCouponMapper.xml
...rc/main/resources/mapper/system/SConsumerCouponMapper.xml
+1
-1
No files found.
share-admin/src/main/java/share/web/controller/system/SConsumerCouponController.java
View file @
70e036a0
package
share
.
web
.
controller
.
system
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
share.common.annotation.Log
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.common.enums.BusinessType
;
import
share.common.enums.RoomType
;
import
share.common.enums.StoreType
;
import
share.common.utils.poi.ExcelUtil
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SConsumerCoupon
;
import
share.system.service.ISConsumerCouponService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.system.service.SConsumerService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* 优惠券领取记录Controller
*
...
...
@@ -151,4 +143,16 @@ public class SConsumerCouponController extends BaseController
public
AjaxResult
give
(
@RequestBody
SConsumerCoupon
sConsumerCoupon
)
{
return
toAjax
(
sConsumerCouponService
.
give
(
sConsumerCoupon
));
}
@GetMapping
(
"/cancelCoupon"
)
public
AjaxResult
cancelCoupon
(
Long
id
)
{
return
toAjax
(
sConsumerCouponService
.
cancelCoupon
(
id
));
}
@GetMapping
(
"/restoreCoupon"
)
public
AjaxResult
restoreCoupon
(
Long
id
)
{
return
toAjax
(
sConsumerCouponService
.
restoreCoupon
(
id
));
}
}
share-system/src/main/java/share/system/service/ISConsumerCouponService.java
View file @
70e036a0
...
...
@@ -80,4 +80,8 @@ public interface ISConsumerCouponService extends IService<SConsumerCoupon>
List
<
SConsumerCoupon
>
queryByIds
(
List
<
Long
>
couponIds
);
List
<
SConsumerCoupon
>
queryList
();
int
cancelCoupon
(
Long
id
);
int
restoreCoupon
(
Long
id
);
}
share-system/src/main/java/share/system/service/impl/SConsumerCouponServiceImpl.java
View file @
70e036a0
...
...
@@ -430,6 +430,22 @@ public class SConsumerCouponServiceImpl extends ServiceImpl<SConsumerCouponMappe
return
baseMapper
.
queryList
();
}
@Override
public
int
cancelCoupon
(
Long
id
)
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setId
(
id
);
sConsumerCoupon
.
setIsDelete
(
YesNoEnum
.
yes
.
getIndex
());
return
baseMapper
.
updateSConsumerCoupon
(
sConsumerCoupon
);
}
@Override
public
int
restoreCoupon
(
Long
id
)
{
SConsumerCoupon
sConsumerCoupon
=
new
SConsumerCoupon
();
sConsumerCoupon
.
setId
(
id
);
sConsumerCoupon
.
setIsDelete
(
YesNoEnum
.
no
.
getIndex
());
return
baseMapper
.
updateSConsumerCoupon
(
sConsumerCoupon
);
}
private
void
extracted
(
SConsumerCoupon
item
,
BigDecimal
bigDecimal
,
SRoom
byId
,
BigDecimal
subtract
,
SStore
sStore
)
{
//计算价格
BigDecimal
multiply
=
bigDecimal
.
multiply
(
byId
.
getPrice
());
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
70e036a0
...
...
@@ -470,7 +470,7 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
}
else
{
// 使用中订单断电, 延时3分钟断电
deviceOpService
.
openOrCloseDevice
(
sOrder
.
getRoomId
(),
sOrder
.
getConsumerPhone
(),
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
1
8
0
);
OpTypeEnum
.
CUT_ELECTRIC
.
getCode
(),
true
,
10
);
}
}
else
if
(
one
.
getStatus
().
equals
(
OrderStatusEnum
.
INUSE
.
getCode
()))
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
...
...
share-system/src/main/resources/mapper/system/SConsumerCouponMapper.xml
View file @
70e036a0
...
...
@@ -91,7 +91,7 @@
<include
refid=
"selectSConsumerCouponVo"
/>
where
1=1
and is_delete = '0'
<if
test=
"isDelete != null "
>
and is_delete = #{isDelete}
</if>
<if
test=
"consumerId != null "
>
and consumer_id = #{consumerId}
</if>
<if
test=
"couponId != null "
>
and coupon_id = #{couponId}
</if>
<if
test=
"storeId !=null"
>
and store_id = #{storeId}
</if>
...
...
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