获取清台配置信息
This commit is contained in:
@@ -20,6 +20,8 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 台桌管理
|
* 台桌管理
|
||||||
@@ -99,8 +101,8 @@ public class ShopTableController {
|
|||||||
@PutMapping("/batch")
|
@PutMapping("/batch")
|
||||||
public CzgResult<Boolean> editBatch(@RequestBody @Validated ShopTableEditBatchDTO shopTableDTO) {
|
public CzgResult<Boolean> editBatch(@RequestBody @Validated ShopTableEditBatchDTO shopTableDTO) {
|
||||||
UpdateChain<ShopTable> query = shopTableService.updateChain().eq(ShopTable::getShopId, StpKit.USER.getShopId());
|
UpdateChain<ShopTable> query = shopTableService.updateChain().eq(ShopTable::getShopId, StpKit.USER.getShopId());
|
||||||
if (shopTableDTO.getClearTime() != null) {
|
if (shopTableDTO.getAutoClearTime() != null) {
|
||||||
query.eq(ShopTable::getClearTime, shopTableDTO.getClearTime());
|
query.eq(ShopTable::getAutoClearTime, shopTableDTO.getAutoClearTime());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shopTableDTO.getAutoClear() != null) {
|
if (shopTableDTO.getAutoClear() != null) {
|
||||||
@@ -109,6 +111,26 @@ public class ShopTableController {
|
|||||||
return CzgResult.success(query.update());
|
return CzgResult.success(query.update());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取清台配置信息
|
||||||
|
* 权限标识: shopTable:edit
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
@GetMapping("/currentState")
|
||||||
|
public CzgResult<Map<String, Serializable>> currentState() {
|
||||||
|
ShopTable one = shopTableService.queryChain().eq(ShopTable::getShopId, StpKit.USER.getShopId()).limit(1).one();
|
||||||
|
if (one == null) {
|
||||||
|
one = new ShopTable();
|
||||||
|
one.setAutoClear(0);
|
||||||
|
one.setAutoClearTime(0);
|
||||||
|
}
|
||||||
|
return CzgResult.success(Map.of(
|
||||||
|
"autoClear", one.getAutoClear(),
|
||||||
|
"autoClearTime", one.getAutoClearTime()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 台桌清台
|
* 台桌清台
|
||||||
* 权限标识: shopTable:clear
|
* 权限标识: shopTable:clear
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class ShopTableEditBatchDTO implements Serializable {
|
|||||||
/**
|
/**
|
||||||
* 自动清台时间 单位分钟 默认10
|
* 自动清台时间 单位分钟 默认10
|
||||||
*/
|
*/
|
||||||
private Integer clearTime;
|
private Integer autoClearTime;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ public class ShopTable implements Serializable {
|
|||||||
private Integer useNum;
|
private Integer useNum;
|
||||||
|
|
||||||
private Integer autoClear;
|
private Integer autoClear;
|
||||||
|
private Integer autoClearTime;
|
||||||
|
|
||||||
public boolean canUseByStatus() {
|
public boolean canUseByStatus() {
|
||||||
return !ShopTableStatusEnum.UNBOUND.equalsVal(status)
|
return !ShopTableStatusEnum.UNBOUND.equalsVal(status)
|
||||||
|
|||||||
Reference in New Issue
Block a user