代客下单就餐模式切换接口
This commit is contained in:
parent
2f6bbd4dec
commit
a262f6f6b5
|
|
@ -61,6 +61,14 @@ public class TbPlaceController {
|
|||
return ResponseEntity.ok(tbShopTableService.addCartForUser(addCartDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/choseModel")
|
||||
@Log("代客下单:#addCartDTO.tableId")
|
||||
@ApiOperation("代客下单/shop/table")
|
||||
public ResponseEntity<?> choseModel(@Valid @RequestBody ChoseModelDTO choseModelDTO) {
|
||||
return ResponseEntity.ok(tbShopTableService.choseModel(choseModelDTO));
|
||||
}
|
||||
|
||||
@AnonymousAccess
|
||||
@PutMapping("/updateCart")
|
||||
@Log("代客下单")
|
||||
|
|
|
|||
|
|
@ -389,7 +389,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
if (tbCashierCart == null) {
|
||||
tbCashierCart = new TbCashierCart();
|
||||
tbCashierCart.setUseType(addCartDTO.getUseType());
|
||||
tbCashierCart.setUserId(addCartDTO.getVipUserId());
|
||||
tbCashierCart.setCoverImg(product.getCoverImg());
|
||||
tbCashierCart.setCreatedAt(System.currentTimeMillis());
|
||||
tbCashierCart.setIsSku(product.getTypeEnum());
|
||||
|
|
@ -1709,4 +1708,18 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||
rabbitMsgUtils.printDishesTicket(currentOrder.getId(), false, detailIds);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object choseModel(ChoseModelDTO choseModelDTO) {
|
||||
cashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
|
||||
.eq(TbCashierCart::getShopId, choseModelDTO.getShopId())
|
||||
.in(TbCashierCart::getId, choseModelDTO.getCartIds())
|
||||
.set(TbCashierCart::getUseType, choseModelDTO.getUseType()));
|
||||
|
||||
return orderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>()
|
||||
.in(TbOrderDetail::getCartId, choseModelDTO.getCartIds())
|
||||
.set(TbOrderDetail::getUseType, choseModelDTO.getUseType()));
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -135,4 +135,6 @@ public interface TbShopTableService {
|
|||
Object generate(TableGenerateDTO generateDTO);
|
||||
|
||||
Object printDishes(BaseTableDTO baseTableDTO);
|
||||
|
||||
Object choseModel(ChoseModelDTO choseModelDTO);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue