feat: 订单详情增加是否会员价字段标识

This commit is contained in:
张松 2024-11-18 13:53:34 +08:00
parent b208a0ad92
commit ca82c8a59f
5 changed files with 49 additions and 0 deletions

View File

@ -76,6 +76,12 @@ public class TbPlaceController {
return ResponseEntity.ok(tbShopTableService.addCartForUser(addCartDTO));
}
@PostMapping("/temporaryDishes")
@ApiOperation("代客下单/shop/table")
public ResponseEntity<TbCashierCart> addTemporaryDishes(@Valid @RequestBody AddTemporaryDishesDTO temporaryDishesDTO) {
return ResponseEntity.ok(tbShopTableService.addTemporaryDishes(temporaryDishesDTO));
}
@PutMapping("/choseModel")
@ApiOperation("代客下单/shop/table")
public ResponseEntity<?> choseModel(@Valid @RequestBody ChoseModelDTO choseModelDTO) {

View File

@ -0,0 +1,27 @@
package cn.ysk.cashier.dto.shoptable;
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
@Data
public class AddTemporaryDishesDTO {
@NotEmpty
private String masterId;
@NotNull
private Integer shopId;
private String tableId;
@NotNull
@Min(1)
private Integer num;
private boolean isPack;
private boolean isGift;
private String note;
// 用餐类型
@NotBlank
private String useType;
private Integer vipUserId;
}

View File

@ -130,6 +130,7 @@ public class TbOrderDetail implements Serializable {
private BigDecimal memberPrice;
private Integer userCouponId;
private Integer isMember;
public void copy(TbOrderDetail source){
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));

View File

@ -614,6 +614,12 @@ public class TbShopTableServiceImpl implements TbShopTableService {
return tbCashierCart;
}
@Override
public TbCashierCart addTemporaryDishes(AddTemporaryDishesDTO temporaryDishesDTO) {
return null;
}
private void setRedisTableCartInfo(String tableId, String shopId, List<TbCashierCart> tbCashierCartList, boolean isAdd) {
String tableCartKey = RedisConstant.getTableCartKey(tableId, shopId);
String tableCart = redisTemplate.opsForValue().get(tableCartKey);
@ -1518,6 +1524,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
orderDetail.setUseType(cashierCart.getUseType());
orderDetail.setProductImg(cashierCart.getCoverImg());
orderDetail.setCartId(cashierCart.getId());
orderDetail.setIsMember(cashierCart.getIsMember());
orderDetail.setOrderId(orderInfo == null ? null : orderInfo.getId());
priceDTO.getOrderDetailList().add(orderDetail);
}

View File

@ -98,6 +98,13 @@ public interface TbShopTableService {
TbCashierCart addCartForUser(AddCartDTO addCartDTO);
/**
* 添加临时菜
* @param temporaryDishesDTO 临时菜信息
*/
TbCashierCart addTemporaryDishes(AddTemporaryDishesDTO temporaryDishesDTO);
void removeCart(RemoveCartDTO removeCartDTO);
void returnCart(ReturnCartDTO returnCartDTO);
@ -149,4 +156,5 @@ public interface TbShopTableService {
Object getShopState(Integer shopId, String tableId);
Object bindQrcode(BindTableQrCodeDTO bindTableQrCodeDTO);
}