Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
package cn.ysk.cashier.service.impl.shopimpl;
|
package cn.ysk.cashier.service.impl.shopimpl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.thread.ThreadUtil;
|
import cn.hutool.core.thread.ThreadUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
@@ -55,7 +56,6 @@ import org.springframework.data.redis.core.StringRedisTemplate;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.persistence.criteria.Order;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
@@ -661,7 +661,6 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (cashierCart.getOrderId() == null) {
|
if (cashierCart.getOrderId() == null) {
|
||||||
throw new BadRequestException("此商品还未下单,无需退单");
|
throw new BadRequestException("此商品还未下单,无需退单");
|
||||||
}
|
}
|
||||||
@@ -1381,7 +1380,8 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shopEatTypeInfoDTO.isIncrMaterId() && "pending".equals(orderInfo.getStatus())) {
|
if (shopEatTypeInfoDTO.isIncrMaterId() && "pending".equals(orderInfo.getStatus())) {
|
||||||
String key = RedisConstant.getMasterIdKey(createOrderDTO.getShopId(), cn.ysk.cashier.utils.DateUtils.getDay(), orderInfo.getTableId());;
|
String key = RedisConstant.getMasterIdKey(createOrderDTO.getShopId(), cn.ysk.cashier.utils.DateUtils.getDay(), orderInfo.getTableId());
|
||||||
|
;
|
||||||
redisTemplate.delete(key);
|
redisTemplate.delete(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1636,6 +1636,9 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
orderInfo.setDiscountRatio(BigDecimal.valueOf(payDTO.getDiscount()));
|
orderInfo.setDiscountRatio(BigDecimal.valueOf(payDTO.getDiscount()));
|
||||||
orderInfo.setDiscountAmount(orderInfo.getAmount().subtract(finalAmount));
|
orderInfo.setDiscountAmount(orderInfo.getAmount().subtract(finalAmount));
|
||||||
}
|
}
|
||||||
|
if (StrUtil.isEmpty(orderInfo.getMemberId())) {
|
||||||
|
orderInfo.setMemberId(Convert.toStr(payDTO.getVipUserId()));
|
||||||
|
}
|
||||||
orderInfoMapper.updateById(orderInfo);
|
orderInfoMapper.updateById(orderInfo);
|
||||||
|
|
||||||
//更新购物车状态
|
//更新购物车状态
|
||||||
@@ -1652,7 +1655,7 @@ public class TbShopTableServiceImpl implements TbShopTableService {
|
|||||||
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
|
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
|
||||||
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
|
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
|
||||||
.eq(TbOrderDetail::getStatus, "unpaid")
|
.eq(TbOrderDetail::getStatus, "unpaid")
|
||||||
.setSql(StrUtil.format("price_amount=price*num*{}", payDTO.getDiscount() == null ? 1: payDTO.getDiscount()))
|
.setSql(StrUtil.format("price_amount=price*num*{}", payDTO.getDiscount() == null ? 1 : payDTO.getDiscount()))
|
||||||
.set(TbOrderDetail::getStatus, "closed"));
|
.set(TbOrderDetail::getStatus, "closed"));
|
||||||
|
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
|||||||
Reference in New Issue
Block a user