Merge remote-tracking branch 'origin/dev' into test

# Conflicts:
#	src/main/java/com/chaozhanggui/system/cashierservice/service/PayService.java
#	src/main/resources/mapper/TbProductMapper.xml
This commit is contained in:
Tankaikai
2024-11-18 11:24:29 +08:00
2 changed files with 12 additions and 8 deletions

View File

@@ -37,7 +37,7 @@ public class MpShopTableServiceImpl extends ServiceImpl<MpShopTableMapper, TbSho
.set(TbShopTable::getTotalAmount, 0)
.set(TbShopTable::getRealAmount, 0)
.set(TbShopTable::getUseNum, 0)
.set(TbShopTable::getStatus, TableConstant.ShopTable.State.CLEANING.getValue()));
.set(TbShopTable::getStatus, TableConstant.ShopTable.State.IDLE.getValue()));
}else {
return updateStateByQrcode(tableId, TableConstant.ShopTable.State.CLEANING);
}

View File

@@ -8,7 +8,6 @@ import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.chaozhanggui.system.cashierservice.constant.TableConstant;
import com.chaozhanggui.system.cashierservice.dao.*;
import com.chaozhanggui.system.cashierservice.entity.Enum.OrderUseTypeEnum;
import com.chaozhanggui.system.cashierservice.entity.*;
@@ -627,11 +626,13 @@ public class PayService {
// .in(TbCashierCart::getStatus, "create", "closed")
.set(TbCashierCart::getStatus, "final"));
mpOrderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>().eq(TbOrderDetail::getOrderId, orderId)
mpOrderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>()
.eq(TbOrderDetail::getOrderId, orderId)
// .eq(TbOrderDetail::getUseType, orderInfo.getUseType())
.eq(TbOrderDetail::getStatus, "unpaid")
// .eq(TbOrderDetail::getStatus, "unpaid")
.set(TbOrderDetail::getStatus, "closed"));
outRecordMapper.updateByOrderIdAndStatus(orderInfo.getId(), "closed");
log.info("更新购物车:{}", cartCount);
JSONObject jsonObject = new JSONObject();
@@ -709,6 +710,9 @@ public class PayService {
if (ObjectUtil.isEmpty(userInfo)) {
return Result.fail("未获取到用户信息");
}
if (StrUtil.isEmpty(userInfo.getPwd())) {
return Result.fail("未设置支付密码");
}
if (!userInfo.getPwd().equals(MD5Utils.md5(pwd))) {
return Result.fail("支付密码错误");
}
@@ -1262,16 +1266,16 @@ public class PayService {
private void orderSuccessPay(TbOrderInfo orderInfo, String payType, String payOrderNO) {
int cartCount = mpCashierCartMapper.update(null, new LambdaUpdateWrapper<TbCashierCart>()
.eq(TbCashierCart::getOrderId, orderInfo.getId())
.eq(TbCashierCart::getUseType, orderInfo.getUseType())
.in(TbCashierCart::getStatus, "create", "closed")
// .eq(TbCashierCart::getUseType, orderInfo.getUseType())
// .in(TbCashierCart::getStatus, "create", "closed")
.set(TbCashierCart::getStatus, "final"));
log.info("更新购物车:{}", cartCount);
//更新子单状态
mpOrderDetailMapper.update(null, new LambdaUpdateWrapper<TbOrderDetail>()
.eq(TbOrderDetail::getOrderId, orderInfo.getId())
.eq(TbOrderDetail::getUseType, orderInfo.getUseType())
.in(TbOrderDetail::getStatus, "unpaid")
// .eq(TbOrderDetail::getUseType, orderInfo.getUseType())
// .in(TbOrderDetail::getStatus, "unpaid")
.set(TbOrderDetail::getStatus, "closed"));
//修改主单状态