|
@@ -215,7 +215,7 @@ public class BackendTableInfoController extends BaseController {
|
|
|
@ApiOperation("新增餐桌信息接口")
|
|
|
@PostMapping("/create")
|
|
|
@CrossOrigin
|
|
|
- @PreAuthorize("@pms.hasPermission('table:create')")
|
|
|
+// @PreAuthorize("@pms.hasPermission('table:create')")
|
|
|
public ResponseObject createTable(
|
|
|
HttpServletRequest request,
|
|
|
@RequestBody TableInfoDto dto) throws BusinessCheckException {
|
|
@@ -282,7 +282,7 @@ public class BackendTableInfoController extends BaseController {
|
|
|
@ApiOperation("逻辑删除餐桌")
|
|
|
@DeleteMapping("/delete/{id}")
|
|
|
@CrossOrigin
|
|
|
- @PreAuthorize("@pms.hasPermission('table:delete')")
|
|
|
+// @PreAuthorize("@pms.hasPermission('table:delete')")
|
|
|
public ResponseObject logicalDelete(
|
|
|
HttpServletRequest request,
|
|
|
@PathVariable Long id) throws BusinessCheckException {
|
|
@@ -316,10 +316,10 @@ public class BackendTableInfoController extends BaseController {
|
|
|
private void verifyUpdateData(TableInfoDto dto, MtTableInfo existTable, AccountInfo account)
|
|
|
throws BusinessCheckException {
|
|
|
|
|
|
- // 校验分类有效性
|
|
|
+ /* // 校验分类有效性
|
|
|
if (!categoryService.existCategory(dto.getCategoryId())) {
|
|
|
throw new BusinessCheckException("关联分类不存在");
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
// 校验桌号唯一性(排除自身)
|
|
|
LambdaQueryWrapper<MtTableInfo> query = new LambdaQueryWrapper<>();
|
|
@@ -345,4 +345,43 @@ public class BackendTableInfoController extends BaseController {
|
|
|
return entity;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增餐桌信息接口(无关联分类表)
|
|
|
+ * @param request
|
|
|
+ * @param dto
|
|
|
+ * @return
|
|
|
+ * @throws BusinessCheckException
|
|
|
+ */
|
|
|
+ @ApiOperation("新增餐桌信息接口")
|
|
|
+ @PostMapping("/addTableInfo")
|
|
|
+ @CrossOrigin
|
|
|
+// @PreAuthorize("@pms.hasPermission('table:create')")
|
|
|
+ public ResponseObject addTableInfo(
|
|
|
+ HttpServletRequest request,
|
|
|
+ @RequestBody TableInfoDto dto) throws BusinessCheckException {
|
|
|
+ // 身份验证
|
|
|
+ String token = request.getHeader("Access-Token");
|
|
|
+ AccountInfo account = TokenUtil.getAccountInfoByToken(token);
|
|
|
+ if (account == null) {
|
|
|
+ return getFailureResult(1001, I18nUtil.getMessage("notAuthenticated"));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ // 构造实体
|
|
|
+ MtTableInfo entity = new MtTableInfo();
|
|
|
+ BeanUtils.copyProperties(dto, entity);
|
|
|
+ entity.setCreateUserId(account.getAccountName());
|
|
|
+ entity.setUpdateUserId(account.getAccountName());
|
|
|
+ entity.setTableStatus(0); // 默认空闲状态
|
|
|
+ entity.setDeleteFlag(0);
|
|
|
+
|
|
|
+ // 保存数据
|
|
|
+ boolean result = tableInfoService.saveTable(entity);
|
|
|
+ return result ? getSuccessResult(true) : getFailureResult(500, "保存失败");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
}
|