From f0632942d53f236b45565dd6bc39210530438427 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Fri, 25 Oct 2024 15:02:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E5=9C=B0=E5=9D=80=20=E4=BF=AE=E5=A4=8D=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=8F=B0=E6=A1=8C=E5=8F=96=E9=A4=90=E7=A0=81=E6=9C=AA=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/shopimpl/TbShopTableServiceImpl.java | 8 +++++--- .../src/main/resources/config/application-dev.yml | 3 ++- .../src/main/resources/config/application-pre.yml | 4 ++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java index 7dd769e3..2da13fda 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopTableServiceImpl.java @@ -49,7 +49,6 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; import org.springframework.amqp.rabbit.connection.CorrelationData; import org.springframework.amqp.rabbit.core.RabbitTemplate; -import org.springframework.beans.factory.annotation.Value; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.redis.core.StringRedisTemplate; @@ -632,7 +631,7 @@ public class TbShopTableServiceImpl implements TbShopTableService { if (cashierCart.getTableId() != null && removeCartDTO.getTableId() != null) { // 清空购物车 出票 - long carCount = countCar(Long.valueOf(cashierCart.getTableId()), cashierCart.getShopId(), cashierCart.getMasterId()); + long carCount = countCar(Long.valueOf(cashierCart.getTableId()), cashierCart.getShopId()); log.info("购物车数量: {}", carCount); setRedisTableCartInfo(removeCartDTO.getTableId(), removeCartDTO.getShopId().toString(), Collections.singletonList(cashierCart), false); } @@ -768,7 +767,7 @@ public class TbShopTableServiceImpl implements TbShopTableService { cashierCartMapper.delete(query); } - private long countCar(Long tableId, String shopId, String masterId) { + private long countCar(Long tableId, String shopId) { String orderId = redisTemplate.opsForValue().get(RedisConstant.getCurrentOrderKey(tableId.toString(), shopId)); return tbOrderDetailMapper.selectCount(new LambdaQueryWrapper() .eq(TbOrderDetail::getShopId, shopId) @@ -1791,11 +1790,14 @@ public class TbShopTableServiceImpl implements TbShopTableService { mpCashierCartService.clearCartByTableIdAndUseType(choseTableDTO.getTableId(), shopEatTypeInfoDTO.getUseType(), choseTableDTO.getShopId()); } + String masterId = getMasterId(choseTableDTO.getShopId(), choseTableDTO.getTableId(), shopEatTypeInfoDTO.getUseType(), null).getString("masterId"); + ArrayList cartIds = new ArrayList<>(); Integer orderId = null; for (TbCashierCart item : tbCashierCarts) { item.setTableId(choseTableDTO.getTableId()); item.setUseType(shopEatTypeInfoDTO.getUseType()); + item.setMasterId(masterId); cartIds.add(item.getId()); if (item.getOrderId() != null) { orderId = item.getOrderId(); diff --git a/eladmin-system/src/main/resources/config/application-dev.yml b/eladmin-system/src/main/resources/config/application-dev.yml index a91875f9..86fd03fa 100644 --- a/eladmin-system/src/main/resources/config/application-dev.yml +++ b/eladmin-system/src/main/resources/config/application-dev.yml @@ -4,8 +4,9 @@ spring: druid: db-type: com.alibaba.druid.pool.DruidDataSource # driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy - url: jdbc:p6spy:mysql://rm-bp1kn7h89nz62cno1ro.mysql.rds.aliyuncs.com:3306/fycashier_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true +# url: jdbc:p6spy:mysql://rm-bp1kn7h89nz62cno1ro.mysql.rds.aliyuncs.com:3306/fycashier_test?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true # url: jdbc:mysql://127.0.0.1:3306/fycashier?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true + url: jdbc:p6spy:mysql://rm-bp1kn7h89nz62cno1ro.mysql.rds.aliyuncs.com:3306/fycashier_pre?useUnicode=true&characterEncoding=utf8&characterSetResults=utf8&useJDBCCompliantTimezoneShift=true&serverTimezone=Asia/Shanghai&useSSL=false&allowMultiQueries=true username: cashier password: Cashier@1@ # driver-class-name: com.mysql.cj.jdbc.Driver diff --git a/eladmin-system/src/main/resources/config/application-pre.yml b/eladmin-system/src/main/resources/config/application-pre.yml index d6c6f898..4122b44a 100644 --- a/eladmin-system/src/main/resources/config/application-pre.yml +++ b/eladmin-system/src/main/resources/config/application-pre.yml @@ -141,5 +141,5 @@ cashier: thirdPay: notify: - fstPay: https://pre-cashiernewadmin.sxczgkj.cn/notify/fstPay - fstReturn: https://pre-cashiernewadmin.sxczgkj.cn/notify/fstReturn + fstPay: https://pre-cashieradmin.sxczgkj.cn/notify/fstPay + fstReturn: https://pre-cashieradmin.sxczgkj.cn/notify/fstReturn