Merge branch 'refs/heads/dev' into test
# Conflicts: # src/main/java/com/chaozhanggui/system/cashierservice/service/CartService.java # src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java
This commit is contained in:
@@ -5,6 +5,7 @@ import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
public class TbShopTable implements Serializable {
|
||||
@@ -53,6 +54,12 @@ public class TbShopTable implements Serializable {
|
||||
private Integer seatNum;
|
||||
|
||||
private Integer autoClear;
|
||||
private Date useTime;
|
||||
private Date endTime;
|
||||
private Integer productNum;
|
||||
private BigDecimal totalAmount;
|
||||
private BigDecimal realAmount;
|
||||
private Integer useNum;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,4 +17,10 @@ public interface MpShopTableService extends IService<TbShopTable> {
|
||||
* @param tableId qrcode
|
||||
*/
|
||||
TbShopTable selectByQrcode(String tableId);
|
||||
|
||||
/**
|
||||
* 清除台桌状态
|
||||
* @param tableId 台桌id
|
||||
*/
|
||||
boolean clearTableState(String tableId);
|
||||
}
|
||||
|
||||
@@ -25,4 +25,21 @@ public class MpShopTableServiceImpl extends ServiceImpl<MpShopTableMapper, TbSho
|
||||
return getOne(new LambdaQueryWrapper<TbShopTable>()
|
||||
.eq(TbShopTable::getQrcode, tableId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean clearTableState(String tableId) {
|
||||
TbShopTable shopTable = selectByQrcode(tableId);
|
||||
if (shopTable.getAutoClear() != null && shopTable.getAutoClear() == 1) {
|
||||
return update(new LambdaUpdateWrapper<TbShopTable>()
|
||||
.eq(TbShopTable::getQrcode, tableId)
|
||||
.set(TbShopTable::getUseTime, null)
|
||||
.set(TbShopTable::getProductNum, 0)
|
||||
.set(TbShopTable::getTotalAmount, 0)
|
||||
.set(TbShopTable::getRealAmount, 0)
|
||||
.set(TbShopTable::getUseNum, 0)
|
||||
.set(TbShopTable::getStatus, TableConstant.ShopTable.State.CLEANING.getValue()));
|
||||
}else {
|
||||
return updateStateByQrcode(tableId, TableConstant.ShopTable.State.CLEANING);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -967,6 +967,9 @@ public class CartService {
|
||||
orderInfo.setFreightAmount(BigDecimal.ZERO);
|
||||
orderInfo.setProductAmount(saleAmount);
|
||||
orderInfo.setRemark(remark);
|
||||
if (StrUtil.isNotBlank(remark)) {
|
||||
orderInfo.setRemark(remark);
|
||||
}
|
||||
orderInfo.setUserId(userId);
|
||||
if (hasNewInfo) {
|
||||
orderInfo.setPlaceNum(currentPlaceNum);
|
||||
@@ -982,7 +985,9 @@ public class CartService {
|
||||
orderInfo.setUserCouponId(couponId);
|
||||
orderInfo.setOriginAmount(originAmount);
|
||||
orderInfo.setUserCouponAmount(couponAmount);
|
||||
orderInfo.setRemark(remark);
|
||||
if (StrUtil.isNotBlank(remark)) {
|
||||
orderInfo.setRemark(remark);
|
||||
}
|
||||
orderInfo.setUserId(userId);
|
||||
orderInfo.setPlaceNum(currentPlaceNum);
|
||||
orderInfo.setUseType(shopEatTypeInfoDTO.getUseType());
|
||||
@@ -1041,7 +1046,6 @@ public class CartService {
|
||||
// cashierCartMapper.deleteByPrimaryKey(seatCartInfo.getId());
|
||||
// }
|
||||
|
||||
|
||||
// 打印票据
|
||||
if (!addOrderDetail.isEmpty() && shopEatTypeInfoDTO.isDineInAfter()) {
|
||||
log.info("待打印菜品信息: {}", addOrderDetail);
|
||||
|
||||
@@ -256,8 +256,8 @@ public class OrderService {
|
||||
return Result.fail("订单不存在");
|
||||
}
|
||||
|
||||
TbShopInfo tbShopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
||||
if (tbShopInfo == null) {
|
||||
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
||||
if (shopInfo == null) {
|
||||
return Result.fail("店铺不存在");
|
||||
}
|
||||
|
||||
@@ -296,10 +296,10 @@ public class OrderService {
|
||||
TbShopTable tbShopTable = shopTableMapper.selectQRcode(orderInfo.getTableId());
|
||||
|
||||
OrderVo orderVo = new OrderVo();
|
||||
orderVo.setName(tbShopInfo.getShopName());
|
||||
orderVo.setName(shopInfo.getShopName());
|
||||
orderVo.setStatus(orderInfo.getStatus());
|
||||
//TODO 增加商家二维码
|
||||
orderVo.setShopQrcode(tbShopInfo.getShopQrcode());
|
||||
orderVo.setShopQrcode(shopInfo.getShopQrcode());
|
||||
orderVo.setDetails(list);
|
||||
orderVo.setOrderNo(orderInfo.getOrderNo());
|
||||
orderVo.setTime(orderInfo.getCreatedAt());
|
||||
@@ -318,8 +318,7 @@ public class OrderService {
|
||||
orderVo.setOutNumber(orderInfo.getOutNumber());
|
||||
orderVo.setUseType(orderInfo.getUseType());
|
||||
orderVo.setShopId(Integer.valueOf(orderInfo.getShopId()));
|
||||
TbShopInfo shopInfo = mpShopInfoMapper.selectById(orderInfo.getShopId());
|
||||
orderVo.setQrcode(shopInfo == null ? null : shopInfo.getShopQrcode());
|
||||
orderVo.setQrcode(shopInfo.getShopQrcode());
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
// 餐位费
|
||||
map.put("seatFee", mealCashierCart);
|
||||
@@ -328,6 +327,7 @@ public class OrderService {
|
||||
map.putAll(BeanUtil.beanToMap(orderVo, false, false));
|
||||
map.put("createdAt", DateUtil.formatDateTime(DateUtil.date(orderInfo.getCreatedAt())));
|
||||
map.put("paidTime", orderInfo.getPaidTime() == null ? null : DateUtil.formatDateTime(DateUtil.date(orderInfo.getPaidTime())));
|
||||
map.put("registerType", shopInfo.getRegisterType());
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user