1.代客下单退款单打印
This commit is contained in:
@@ -192,7 +192,7 @@ public class CloudPrinterService {
|
||||
OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印",
|
||||
ObjectUtil.isEmpty(orderInfo.getMasterId())||ObjectUtil.isNull(orderInfo.getMasterId())?orderInfo.getTableName():orderInfo.getMasterId(),
|
||||
orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())),
|
||||
"【POS-1】001", orderInfo.getPayAmount() != null ? orderInfo.getPayAmount().toPlainString() : orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0",
|
||||
"【POS-1】001", orderInfo.getOrderAmount().toPlainString(), balance, orderInfo.getPayType(), "0",
|
||||
detailList,orderInfo.getRemark(),null,null);
|
||||
detailPO.setOutNumber(orderInfo.getOutNumber());
|
||||
String printType="退款单";
|
||||
@@ -258,7 +258,7 @@ public class CloudPrinterService {
|
||||
OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印",
|
||||
orderInfo.getOrderType().equals("miniapp")?orderInfo.getTableName():orderInfo.getMasterId(),
|
||||
orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())),
|
||||
"【POS-1】001", orderInfo.getPayAmount() != null ? orderInfo.getPayAmount().toPlainString() : orderInfo.getOrderAmount().toPlainString(),
|
||||
"【POS-1】001", orderInfo.getOrderAmount().toPlainString(),
|
||||
balance, (ObjectUtil.isEmpty(orderInfo.getPayType())||ObjectUtil.isNull(orderInfo.getPayType())?"":orderInfo.getPayType() ), "0",
|
||||
detailList,orderInfo.getRemark(),orderInfo.getDiscountAmount() != null ? orderInfo.getDiscountAmount().toPlainString() : null,orderInfo.getDiscountRatio() != null ? orderInfo.getDiscountRatio().toPlainString() : null);
|
||||
String printType="结算单";
|
||||
@@ -507,7 +507,7 @@ public class CloudPrinterService {
|
||||
OrderDetailPO detailPO = new OrderDetailPO(shopInfo.getShopName(), "普通打印",
|
||||
orderInfo.getOrderType().equals("miniapp")?orderInfo.getTableName():orderInfo.getMasterId(),
|
||||
orderInfo.getOrderNo(), DateUtils.getTime(new Date(orderInfo.getCreatedAt())),
|
||||
"【POS-1】001", orderInfo.getPayAmount() != null ? orderInfo.getPayAmount().toPlainString() : orderInfo.getOrderAmount().toPlainString(),
|
||||
"【POS-1】001", orderInfo.getOrderAmount().toPlainString(),
|
||||
balance,(ObjectUtil.isEmpty(orderInfo.getPayType())||ObjectUtil.isNull(orderInfo.getPayType())?"":orderInfo.getPayType() ),
|
||||
"0", detailList,orderInfo.getRemark(),null,null);
|
||||
String printType="结算单";
|
||||
|
||||
@@ -555,6 +555,7 @@ public class OrderService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result createOrder(OrderVo orderVo, String clientType, String token, Integer oldOrderId, boolean isPrint) {
|
||||
String day = DateUtils.getDay();
|
||||
TbShopTable shopTable = null;
|
||||
|
||||
LambdaQueryWrapper<TbCashierCart> queryWrapper = new LambdaQueryWrapper<TbCashierCart>()
|
||||
.eq(TbCashierCart::getShopId, orderVo.getShopId())
|
||||
@@ -585,6 +586,13 @@ public class OrderService {
|
||||
.eq(TbCashierCart::getMasterId, "");
|
||||
}));
|
||||
});
|
||||
|
||||
shopTable = mpShopTableMapper.selectOne(new LambdaUpdateWrapper<TbShopTable>()
|
||||
.eq(TbShopTable::getQrcode, orderVo.getTableId()));
|
||||
|
||||
if (shopTable == null) {
|
||||
return Result.fail("台桌不存在");
|
||||
}
|
||||
}
|
||||
|
||||
List<TbCashierCart> list = mpCashierCartMapper.selectList(queryWrapper);
|
||||
@@ -607,6 +615,7 @@ public class OrderService {
|
||||
}
|
||||
return Result.fail(CARTEXIST);
|
||||
}
|
||||
|
||||
BigDecimal totalAmount = BigDecimal.ZERO;
|
||||
BigDecimal packAMount = BigDecimal.ZERO;
|
||||
BigDecimal feeAmount = BigDecimal.ZERO;
|
||||
@@ -619,6 +628,7 @@ public class OrderService {
|
||||
if (list.size()<1 || list.isEmpty()){
|
||||
return Result.fail(CARTEXIST);
|
||||
}
|
||||
|
||||
for (TbCashierCart cashierCart : list) {
|
||||
|
||||
TbProductSkuWithBLOBs tbProduct = tbProductSkuMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getSkuId()));
|
||||
@@ -683,6 +693,7 @@ public class OrderService {
|
||||
orderInfo.setRemark(orderVo.getRemark());
|
||||
orderInfo.setUserId(orderVo.getUserId());
|
||||
orderInfo.setUseType(StrUtil.isNotBlank(orderVo.getTableId()) ? "postPay" : "afterPay");
|
||||
orderInfo.setTableName(shopTable != null ? shopTable.getName() : null);
|
||||
|
||||
if (StrUtil.isNotBlank(orderVo.getTableId())) {
|
||||
orderInfo.setTableId(orderVo.getTableId());
|
||||
@@ -718,10 +729,12 @@ public class OrderService {
|
||||
|
||||
|
||||
}
|
||||
|
||||
for (TbOrderDetail orderDetail : orderDetails) {
|
||||
orderDetail.setOrderId(orderId);
|
||||
orderDetailMapper.insert(orderDetail);
|
||||
}
|
||||
|
||||
boolean flag = true;
|
||||
for (TbCashierCart cashierCart : list) {
|
||||
TbProductWithBLOBs product = tbProductMapper.selectByPrimaryKey(Integer.valueOf(cashierCart.getProductId()));
|
||||
|
||||
Reference in New Issue
Block a user