Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
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
hooloo
ms
soss
Commits
f40a0752
Commit
f40a0752
authored
Mar 16, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增后台退款接口
parent
1fe2fc95
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
3 deletions
+54
-3
soss-admin/src/main/java/com/soss/web/controller/coffee/ShopController.java
+24
-0
soss-system/src/main/java/com/soss/system/service/IShopService.java
+4
-0
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
+26
-3
No files found.
soss-admin/src/main/java/com/soss/web/controller/coffee/ShopController.java
View file @
f40a0752
...
@@ -99,6 +99,30 @@ public class ShopController extends BaseController {
...
@@ -99,6 +99,30 @@ public class ShopController extends BaseController {
}
}
/**
/**
* 恢复营业
*/
@PreAuthorize
(
"@ss.hasPermi('system:shop:restart')"
)
@Log
(
title
=
"店铺"
,
businessType
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/restore/{shopId}"
)
@ApiOperation
(
"恢复营业"
)
public
AjaxResult
restore
(
@PathVariable
Long
shopId
)
{
shopService
.
restore
(
shopId
);
return
AjaxResult
.
success
();
}
/**
* 设置默认店铺
*/
@PreAuthorize
(
"@ss.hasPermi('system:shop:default')"
)
@Log
(
title
=
"店铺"
,
businessType
=
BusinessType
.
UPDATE
)
@GetMapping
(
"/default/{shopId}"
)
@ApiOperation
(
"设置默认店铺"
)
public
AjaxResult
setDefault
(
@PathVariable
Long
shopId
)
{
shopService
.
setDefault
(
shopId
);
return
AjaxResult
.
success
();
}
/**
* 开始营业
* 开始营业
*/
*/
@PreAuthorize
(
"@ss.hasPermi('system:shop:start')"
)
@PreAuthorize
(
"@ss.hasPermi('system:shop:start')"
)
...
...
soss-system/src/main/java/com/soss/system/service/IShopService.java
View file @
f40a0752
...
@@ -37,10 +37,14 @@ public interface IShopService
...
@@ -37,10 +37,14 @@ public interface IShopService
void
testStart
(
Long
shopId
);
void
testStart
(
Long
shopId
);
void
setDefault
(
Long
shopId
);
void
open
(
Long
shopId
);
void
open
(
Long
shopId
);
void
close
(
Long
shopId
);
void
close
(
Long
shopId
);
void
restore
(
Long
shopId
);
/**
/**
* 新增店铺
* 新增店铺
*
*
...
...
soss-system/src/main/java/com/soss/system/service/impl/ShopServiceImpl.java
View file @
f40a0752
...
@@ -131,6 +131,19 @@ public class ShopServiceImpl implements IShopService {
...
@@ -131,6 +131,19 @@ public class ShopServiceImpl implements IShopService {
}
}
@Override
@Override
public
void
setDefault
(
Long
shopId
)
{
Shop
shop
=
shopMapper
.
selectShopById
(
shopId
);
Assert
.
notNull
(
shop
,
"未查询到匹配的店铺信息[id="
+
shopId
+
"]"
);
shopMapper
.
updateNoDefault
();
shop
.
setUpdatedAt
(
new
Date
());
shop
.
setIsDefault
(
1L
);
shopMapper
.
updateShop
(
shop
);
}
@Override
public
void
open
(
Long
shopId
)
{
public
void
open
(
Long
shopId
)
{
Shop
shop
=
shopMapper
.
selectShopById
(
shopId
);
Shop
shop
=
shopMapper
.
selectShopById
(
shopId
);
Assert
.
notNull
(
shop
,
"未查询到匹配的店铺信息[id="
+
shopId
+
"]"
);
Assert
.
notNull
(
shop
,
"未查询到匹配的店铺信息[id="
+
shopId
+
"]"
);
...
@@ -150,6 +163,16 @@ public class ShopServiceImpl implements IShopService {
...
@@ -150,6 +163,16 @@ public class ShopServiceImpl implements IShopService {
shopMapper
.
updateShop
(
new
Shop
(
shopId
,
ShopState
.
CLOSE
.
getState
()));
shopMapper
.
updateShop
(
new
Shop
(
shopId
,
ShopState
.
CLOSE
.
getState
()));
}
}
@Override
public
void
restore
(
Long
shopId
)
{
Shop
shop
=
shopMapper
.
selectShopById
(
shopId
);
Assert
.
notNull
(
shop
,
"未查询到匹配的店铺信息[id="
+
shopId
+
"]"
);
if
(!
Objects
.
equals
(
shop
.
getState
(),
ShopState
.
DELETE
.
getState
()))
{
throw
new
ServiceException
(
"店铺暂停营业状态下才能正常营业"
);
}
shopMapper
.
updateShop
(
new
Shop
(
shopId
,
ShopState
.
OPEN
.
getState
()));
}
/**
/**
* 新增店铺
* 新增店铺
*
*
...
@@ -175,9 +198,9 @@ public class ShopServiceImpl implements IShopService {
...
@@ -175,9 +198,9 @@ public class ShopServiceImpl implements IShopService {
@Override
@Override
public
int
updateShop
(
Shop
shop
)
{
public
int
updateShop
(
Shop
shop
)
{
shop
.
setUpdatedAt
(
new
Date
());
shop
.
setUpdatedAt
(
new
Date
());
if
(
1
==
shop
.
getIsDefault
())
{
//
if (1 == shop.getIsDefault()) {
shopMapper
.
updateNoDefault
();
//
shopMapper.updateNoDefault();
}
//
}
if
(
shop
.
getDistanceLimit
()
==
null
)
{
if
(
shop
.
getDistanceLimit
()
==
null
)
{
shop
.
setDistanceLimit
(
0.0
);
shop
.
setDistanceLimit
(
0.0
);
}
}
...
...
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