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