Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
@@ -0,0 +1,117 @@
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.dto.calltable.*;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.service.app.TbCallService;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* 叫号
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/callTable")
|
||||
@AllArgsConstructor
|
||||
public class TbCallTableController {
|
||||
|
||||
private final TbCallService tbCallService;
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping
|
||||
public ResponseEntity<?> get(
|
||||
@RequestParam(required = false) Integer callTableId,
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size,
|
||||
@RequestParam(required = false) Integer state
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.get(page, size, shopId, callTableId, state));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping
|
||||
public ResponseEntity<?> add(
|
||||
@Validated @RequestBody CallTableDTO addCallTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.add(addCallTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping
|
||||
public ResponseEntity<?> update(
|
||||
@Validated @RequestBody UpdateCallTableDTO callTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.update(callTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@DeleteMapping
|
||||
public ResponseEntity<?> delete(
|
||||
@Validated @RequestBody BaseCallTableDTO baseCallTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.delete(baseCallTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("takeNumber")
|
||||
public ResponseEntity<?> takeNumber(
|
||||
@Validated @RequestBody TakeNumberDTO takeNumberDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.takeNumber(takeNumberDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping("takeNumberCode")
|
||||
public ResponseEntity<?> takeNumberCode(
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam Integer callTableId
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.takeNumberCode(shopId, callTableId));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("call")
|
||||
public ResponseEntity<?> call(
|
||||
@Validated @RequestBody CallQueueDTO callQueueDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.call(callQueueDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("updateState")
|
||||
public ResponseEntity<?> confirm(
|
||||
@Validated @RequestBody UpdateCallQueueDTO updateCallQueueDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.updateInfo(updateCallQueueDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping("queue")
|
||||
public ResponseEntity<?> getQueue(
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) Integer callTableId,
|
||||
@RequestParam(required = false) Integer state,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.getQueue(shopId, callTableId, state, page, size));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@GetMapping("callRecord")
|
||||
public ResponseEntity<?> getCallRecord(
|
||||
@RequestParam Integer shopId,
|
||||
@RequestParam(required = false) Integer callTableId,
|
||||
@RequestParam(defaultValue = "1") Integer page,
|
||||
@RequestParam(defaultValue = "10") Integer size
|
||||
) {
|
||||
return ResponseEntity.ok(tbCallService.getCallRecord(shopId, callTableId, page, size));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -86,6 +86,15 @@ public class TbPlaceController {
|
||||
tbShopTableService.removeCart(removeCartDTO);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/returnCart")
|
||||
@Log("代客下单 退单")
|
||||
@ApiOperation("代客下单 清空购物车 /shop/table")
|
||||
public ResponseEntity<Object> returnOrder(@Validated @RequestBody RemoveCartDTO removeCartDTO) {
|
||||
tbShopTableService.returnCart(removeCartDTO);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@DeleteMapping("/clearCart")
|
||||
@@ -154,7 +163,6 @@ public class TbPlaceController {
|
||||
public ResponseEntity<Object> pending(
|
||||
@RequestBody PendingDTO pendingDTO
|
||||
) {
|
||||
pendingDTO.setIsPending(true);
|
||||
return ResponseEntity.ok(tbShopTableService.pending(pendingDTO));
|
||||
}
|
||||
|
||||
@@ -192,6 +200,31 @@ public class TbPlaceController {
|
||||
return ResponseEntity.ok(tbShopTableService.pay(payDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/choseTable")
|
||||
@Log("代客下单 选择台桌")
|
||||
@ApiOperation("代客下单 选择台桌 /shop/table")
|
||||
public ResponseEntity<Object> choseTable(
|
||||
@Validated @RequestBody ChoseTableDTO choseTableDTO
|
||||
) {
|
||||
|
||||
return ResponseEntity.ok(tbShopTableService.choseTable(choseTableDTO));
|
||||
}
|
||||
@AnonymousAccess
|
||||
|
||||
@PutMapping("/choseCount")
|
||||
@Log("代客下单 选择用餐人数")
|
||||
@ApiOperation("代客下单 选择台桌 /shop/table")
|
||||
public ResponseEntity<Object> choseCount(
|
||||
@Validated @RequestBody ChoseCountDTO choseCountDTO
|
||||
) {
|
||||
|
||||
return ResponseEntity.ok(tbShopTableService.choseCount(choseCountDTO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/updateVip")
|
||||
@Log("代客下单 查询购物车")
|
||||
@@ -202,6 +235,26 @@ public class TbPlaceController {
|
||||
return ResponseEntity.ok(tbShopTableService.updateVip(updateVipDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("/printOrder")
|
||||
@Log("代客下单 打印订单")
|
||||
@ApiOperation("代客下单 查询购物车 /shop/table")
|
||||
public ResponseEntity<Object> printOrder(
|
||||
@Validated @RequestBody BaseTableDTO baseTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.printOrder(baseTableDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PostMapping("/printDishes")
|
||||
@Log("代客下单 打印菜品单")
|
||||
@ApiOperation("代客下单 打印菜品单 /shop/table")
|
||||
public ResponseEntity<Object> printDishes(
|
||||
@Validated @RequestBody BaseTableDTO baseTableDTO
|
||||
) {
|
||||
return ResponseEntity.ok(tbShopTableService.printDishes(baseTableDTO));
|
||||
}
|
||||
|
||||
private final RabbitTemplate rabbitTemplate;
|
||||
@AnonymousAccess
|
||||
@GetMapping("/test")
|
||||
|
||||
@@ -2,6 +2,7 @@ package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousGetMapping;
|
||||
import cn.ysk.cashier.annotation.rest.AnonymousPostMapping;
|
||||
import cn.ysk.cashier.dto.BaseQueryDto;
|
||||
import cn.ysk.cashier.dto.shop.ShopTableSaleInfoDto;
|
||||
import cn.ysk.cashier.service.SummaryService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -23,11 +24,20 @@ public class SummaryController {
|
||||
@Resource
|
||||
private SummaryService summaryService;
|
||||
|
||||
@GetMapping
|
||||
private Object shopSummary(@RequestParam Integer shopId) {
|
||||
return summaryService.selectSummary(shopId);
|
||||
|
||||
@PostMapping("/trade")
|
||||
@AnonymousPostMapping
|
||||
private Object shopSummaryDate(@RequestBody BaseQueryDto param) {
|
||||
return summaryService.trade(param);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// @GetMapping
|
||||
// private Object shopSummary(@RequestParam Integer shopId) {
|
||||
// return summaryService.selectSummary(shopId);
|
||||
// }
|
||||
|
||||
@GetMapping("/date")
|
||||
private Object shopSummaryDate(@RequestParam Integer shopId, @RequestParam Integer day) {
|
||||
return summaryService.selectSummaryDate(shopId, day);
|
||||
|
||||
@@ -15,10 +15,12 @@
|
||||
*/
|
||||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.AnonymousAccess;
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.dto.shoptable.AddCartDTO;
|
||||
import cn.ysk.cashier.dto.shoptable.ClearCartDTO;
|
||||
import cn.ysk.cashier.dto.shoptable.RemoveCartDTO;
|
||||
import cn.ysk.cashier.dto.shoptable.TableGenerateDTO;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopTable;
|
||||
import cn.ysk.cashier.service.shop.TbShopTableService;
|
||||
import cn.ysk.cashier.dto.shop.TbShopTableQueryCriteria;
|
||||
@@ -87,6 +89,15 @@ public class TbShopTableController {
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/generate")
|
||||
@ApiOperation("查询/shop/table")
|
||||
public ResponseEntity<Object> generate(@Validated @RequestBody TableGenerateDTO generateDTO){
|
||||
if (generateDTO.getStart() >= generateDTO.getEnd()){
|
||||
return ResponseEntity.badRequest().body("起始数不能大于结束数");
|
||||
}
|
||||
return new ResponseEntity<>(tbShopTableService.generate(generateDTO),HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user