Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
dbcad992e5
|
|
@ -6,6 +6,7 @@ import com.czg.account.service.PermissionService;
|
|||
import com.czg.account.vo.LoginVO;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.annotation.SaStaffCheckPermission;
|
||||
import com.czg.config.RabbitPublisher;
|
||||
import com.czg.mq.PrintMqListener;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
|
|
@ -54,9 +55,12 @@ public class AuthorizationController {
|
|||
|
||||
@Resource
|
||||
PrintMqListener printMqListener;
|
||||
@Resource
|
||||
RabbitPublisher rabbitPublisher;
|
||||
@GetMapping("test")
|
||||
public CzgResult<?> login() {
|
||||
printMqListener.orderPrint("1");
|
||||
rabbitPublisher.sendOrderPrintMsg("1");
|
||||
// printMqListener.orderPrint("1");
|
||||
// return CzgResult.success(Map.of("token", StpKit.USER.getShopId()));
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.czg.account.dto.ad.ShopAdDTO;
|
||||
import com.czg.account.entity.ShopAd;
|
||||
import com.czg.account.service.ShopAdService;
|
||||
import com.czg.annotation.SaAdminCheckPermission;
|
||||
import com.czg.exception.ApiNotPrintException;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 小程序广告管理
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/shopAd")
|
||||
public class ShopAdController {
|
||||
@Resource
|
||||
private ShopAdService shopAdService;
|
||||
|
||||
/**
|
||||
* 小程序广告列表
|
||||
* @param showPosition 展示位置 home首页,make_order点餐页
|
||||
* @param status 状态 0未启用,1已启用
|
||||
* @return 列表
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "shopAd:list", name = "小程序广告列表")
|
||||
@GetMapping
|
||||
public CzgResult<List<ShopAd>> list(String showPosition, Integer status) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper().eq(ShopAd::getShopId, StpKit.USER.getShopId());
|
||||
if (StrUtil.isNotBlank(showPosition)) {
|
||||
queryWrapper.eq(ShopAd::getShowPosition, showPosition);
|
||||
}
|
||||
|
||||
queryWrapper.eq(ShopAd::getStatus, status);
|
||||
return CzgResult.success(shopAdService.list(queryWrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序广告详情
|
||||
* @param id adId
|
||||
* @return 详情
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "shopAd:detail", name = "小程序广告详情")
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<ShopAd> detail(@RequestParam Integer id) {
|
||||
return CzgResult.success(shopAdService.getOne(new QueryWrapper().eq(ShopAd::getId, id).eq(ShopAd::getShopId, StpKit.USER.getShopId())));
|
||||
}
|
||||
|
||||
/**
|
||||
* 小程序广告编辑
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "shopAd:list", name = "小程序广告编辑")
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit(@RequestBody @Validated(UpdateGroup.class) ShopAdDTO shopAdEditDTO) {
|
||||
ShopAd shopAd = BeanUtil.copyProperties(shopAdEditDTO, ShopAd.class);
|
||||
long count = shopAdService.count(new QueryWrapper().eq(ShopAd::getShopId, StpKit.USER.getShopId()).like(ShopAd::getShowPosition, shopAdEditDTO.getShowPosition()).ne(ShopAd::getId, shopAdEditDTO.getId()));
|
||||
if (count > 0) {
|
||||
return CzgResult.failure("小程序此位置已存在广告");
|
||||
}
|
||||
return CzgResult.success(shopAdService.update(shopAd, new QueryWrapper().eq(ShopAd::getId, shopAdEditDTO.getId()).eq(ShopAd::getShopId, StpKit.USER.getShopId())));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 小程序广告添加
|
||||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "shopAd:add", name = "小程序广告添加")
|
||||
@PostMapping
|
||||
public CzgResult<Boolean> add(@RequestBody @Validated(InsertGroup.class) ShopAdDTO shopAdEditDTO) {
|
||||
long count = shopAdService.count(new QueryWrapper().eq(ShopAd::getShopId, StpKit.USER.getShopId()).like(ShopAd::getShowPosition, shopAdEditDTO.getShowPosition()));
|
||||
if (count > 0) {
|
||||
return CzgResult.failure("小程序此位置已存在广告");
|
||||
}
|
||||
ShopAd shopAd = BeanUtil.copyProperties(shopAdEditDTO, ShopAd.class);
|
||||
shopAd.setShopId(StpKit.USER.getShopId());
|
||||
return CzgResult.success(shopAdService.save(shopAd));
|
||||
}
|
||||
}
|
||||
|
|
@ -15,7 +15,9 @@ import com.mybatisflex.core.query.QueryWrapper;
|
|||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
|
@ -40,7 +42,7 @@ public class PrintMqListener {
|
|||
@Resource
|
||||
private PrinterHandler printerHandler;
|
||||
|
||||
// @RabbitListener(queues = {RabbitConstants.Queue.ORDER_PRINT_QUEUE})
|
||||
@RabbitListener(queues = {"${spring.profiles.active}-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE})
|
||||
public void orderPrint(String orderId) {
|
||||
long startTime = DateUtil.date().getTime();
|
||||
log.info("接收到订单打印消息:{}", orderId);
|
||||
|
|
@ -52,18 +54,17 @@ public class PrintMqListener {
|
|||
throw new RuntimeException("订单信息不存在");
|
||||
}
|
||||
|
||||
getPrintMachine(1L, "cash", "one", "order").forEach(machine -> {
|
||||
getPrintMachine(orderInfo.getShopId(), "cash", "all", "order").forEach(machine -> {
|
||||
printerHandler.handleRequest(machine, orderInfo, null);
|
||||
// printPlaceTicket(isReturn, machine, orderInfo, shopInfo);
|
||||
});
|
||||
|
||||
|
||||
}catch (Exception e) {
|
||||
log.error("订单打印失败", e);
|
||||
mqLog.setErrInfo(JSONObject.toJSONString(e));
|
||||
mqLog.setDuration(DateUtil.date().getTime() - startTime);
|
||||
mqLog.setFailTime(DateUtil.date().toLocalDateTime());
|
||||
// mqLogService.save(mqLog);
|
||||
mqLogService.save(mqLog);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
package com.czg.config;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.czg.order.entity.OrderInfo;
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import com.czg.service.order.enums.OrderStatusEnums;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 订单定时任务
|
||||
*
|
||||
* @author ww
|
||||
* @description
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class OTimeTask {
|
||||
@Resource
|
||||
private OrderInfoService orderInfoService;
|
||||
|
||||
/**
|
||||
* order 过期
|
||||
*/
|
||||
@Scheduled(cron = "0 0 1 * * ? ")
|
||||
public void run() {
|
||||
orderInfoService.updateChain()
|
||||
.set(OrderInfo::getStatus, OrderStatusEnums.CANCELLED.getCode())
|
||||
.eq(OrderInfo::getStatus, OrderStatusEnums.UNPAID.getCode())
|
||||
.lt(OrderInfo::getTradeDay, DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd"))
|
||||
.update();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
package com.czg.config;
|
||||
|
||||
import com.czg.order.service.OrderInfoService;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.data.redis.connection.Message;
|
||||
import org.springframework.data.redis.connection.MessageListener;
|
||||
import org.springframework.data.redis.connection.RedisConnectionFactory;
|
||||
import org.springframework.data.redis.listener.PatternTopic;
|
||||
import org.springframework.data.redis.listener.RedisMessageListenerContainer;
|
||||
|
||||
/**
|
||||
* redis key过期监听
|
||||
*
|
||||
* @author ww
|
||||
*/
|
||||
@Slf4j
|
||||
@Configuration
|
||||
public class RedisKeyExpirationListener implements MessageListener {
|
||||
|
||||
@Value("${spring.data.redis.database}")
|
||||
private String database;
|
||||
@Resource
|
||||
private OrderInfoService tbOrderInfoService;
|
||||
|
||||
|
||||
//redis key失效监听
|
||||
@Bean
|
||||
public RedisMessageListenerContainer redisMessageListenerContainer(RedisConnectionFactory connectionFactory) {
|
||||
RedisMessageListenerContainer container = new RedisMessageListenerContainer();
|
||||
container.setConnectionFactory(connectionFactory);
|
||||
// 监听特定键的过期事件
|
||||
container.addMessageListener(this, new PatternTopic("__keyevent@" + database + "__:expired"));
|
||||
return container;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMessage(Message message, byte[] pattern) {
|
||||
String expiredKey = new String(message.getBody());
|
||||
|
||||
// 检查过期的键是否以特定前缀开头
|
||||
if (expiredKey.startsWith(RedisCst.classKeyExpired.EXPIRED_ORDER)) {
|
||||
log.info("监听到订单过期,订单Id: {}", expiredKey);
|
||||
String orderId = expiredKey.substring(RedisCst.classKeyExpired.EXPIRED_ORDER.length());
|
||||
tbOrderInfoService.expired(Long.parseLong(orderId));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -42,8 +42,10 @@ public class AdminOrderController {
|
|||
}
|
||||
|
||||
@GetMapping("/historyOrder")
|
||||
public CzgResult<HistoryOrderVo> historyOrder(Long orderId) {
|
||||
return CzgResult.success(orderInfoService.historyOrder(orderId));
|
||||
public CzgResult<HistoryOrderVo> historyOrder(
|
||||
@RequestParam(required = false) Long orderId,
|
||||
@RequestParam(required = false) String tableCode) {
|
||||
return CzgResult.success(orderInfoService.historyOrder(orderId, tableCode));
|
||||
}
|
||||
|
||||
@PostMapping("/createOrder")
|
||||
|
|
@ -58,7 +60,6 @@ public class AdminOrderController {
|
|||
/**
|
||||
* 订单全额退款 只传订单id
|
||||
* 部分退款 传参refundDetailMap {"详情id":"数量","详情id":"数量"}
|
||||
*
|
||||
*/
|
||||
@PostMapping("/refundOrder")
|
||||
public CzgResult<Object> refundOrder(@Validated @RequestBody OrderInfoRefundDTO refundDTO) {
|
||||
|
|
|
|||
|
|
@ -39,8 +39,10 @@ public class UserOrderController {
|
|||
}
|
||||
|
||||
@GetMapping("/historyOrder")
|
||||
public CzgResult<HistoryOrderVo> historyOrder(Long orderId) {
|
||||
return CzgResult.success(orderInfoService.historyOrder(orderId));
|
||||
public CzgResult<HistoryOrderVo> historyOrder(
|
||||
@RequestParam(required = false) Long orderId,
|
||||
@RequestParam(required = false) String tableCode) {
|
||||
return CzgResult.success(orderInfoService.historyOrder(orderId, tableCode));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -26,9 +26,14 @@ public class RabbitConfig {
|
|||
// 设置消息过期时间为 180000 毫秒(即 180 秒)
|
||||
args.put("x-message-ttl", 180000);
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE, true, false, false, args);
|
||||
// return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_PRINT_QUEUE, true, false, false, null);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue orderCancelQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_CANCEL_QUEUE, true);
|
||||
}
|
||||
|
||||
|
||||
@Bean
|
||||
public Queue orderStockQueue() {
|
||||
return new Queue(activeProfile + "-" + RabbitConstants.Queue.ORDER_STOCK_QUEUE, true);
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ public interface RabbitConstants {
|
|||
|
||||
class Queue {
|
||||
public static final String ORDER_STOCK_QUEUE = "order.stock.queue";
|
||||
public static final String ORDER_CANCEL_QUEUE = "order.cancel.queue";
|
||||
public static final String ORDER_PRINT_QUEUE = "order.print.queue";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,24 +17,35 @@ public class RabbitPublisher {
|
|||
@Resource
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
/**
|
||||
* 订单取消消息
|
||||
* 目前 用来回滚库存
|
||||
* @param orderId 订单id
|
||||
*/
|
||||
public void sendOrderCancelMsg(String orderId) {
|
||||
sendMsg(RabbitConstants.Queue.ORDER_STOCK_QUEUE, orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 库存损耗消息
|
||||
* @param orderId 订单id
|
||||
*/
|
||||
public void sendOrderStockMsg(String orderId) {
|
||||
sendMsg(RabbitConstants.Exchange.CASH_EXCHANGE, RabbitConstants.Queue.ORDER_STOCK_QUEUE, orderId);
|
||||
sendMsg(RabbitConstants.Queue.ORDER_STOCK_QUEUE, orderId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单打印消息
|
||||
* @param orderId
|
||||
* @param orderId 订单id
|
||||
*/
|
||||
public void sendOrderPrintMsg(String orderId) {
|
||||
sendMsg(RabbitConstants.Exchange.CASH_EXCHANGE, RabbitConstants.Queue.ORDER_PRINT_QUEUE, orderId);
|
||||
sendMsg(RabbitConstants.Queue.ORDER_PRINT_QUEUE, orderId);
|
||||
}
|
||||
|
||||
private void sendMsg(String exchange, String queue, String msg) {
|
||||
rabbitTemplate.convertAndSend(activeProfile + "-" + exchange, activeProfile + "-" + queue, msg);
|
||||
|
||||
|
||||
private void sendMsg(String queue, String msg) {
|
||||
rabbitTemplate.convertAndSend(activeProfile + "-" + RabbitConstants.Exchange.CASH_EXCHANGE, activeProfile + "-" + queue, msg);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,35 +40,9 @@ public class RedisConfig {
|
|||
RedisTemplate<String, Object> redisTemplate = new RedisTemplate<>();
|
||||
redisTemplate.setKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashKeySerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashValueSerializer(new StringRedisSerializer());
|
||||
redisTemplate.setValueSerializer(new StringRedisSerializer());
|
||||
redisTemplate.setHashValueSerializer(new GenericJackson2JsonRedisSerializer());
|
||||
redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer());
|
||||
redisTemplate.setConnectionFactory(factory);
|
||||
return redisTemplate;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public HashOperations<String, String, Object> hashOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForHash();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ValueOperations<String, String> valueOperations(RedisTemplate<String, String> redisTemplate) {
|
||||
return redisTemplate.opsForValue();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ListOperations<String, Object> listOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForList();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SetOperations<String, Object> setOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForSet();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ZSetOperations<String, Object> zSetOperations(RedisTemplate<String, Object> redisTemplate) {
|
||||
return redisTemplate.opsForZSet();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,13 @@ public interface RedisCst {
|
|||
String LOGIN_CODE = "login:code:";
|
||||
String SYS_LOG_KEY = "sys:log:";
|
||||
|
||||
/**
|
||||
* key过期监听
|
||||
*/
|
||||
class classKeyExpired {
|
||||
//订单key过期
|
||||
public static final String EXPIRED_ORDER = "expired.order:";
|
||||
}
|
||||
|
||||
|
||||
String SMS_CODE = "sms:code:";
|
||||
|
|
@ -41,7 +48,7 @@ public interface RedisCst {
|
|||
}
|
||||
|
||||
|
||||
static String getPrintOrderDetailKey(Long orderId) {
|
||||
return PRINT_ORDER_DETAIL + orderId;
|
||||
static String getPrintOrderDetailKey(Long orderId, Long detailId) {
|
||||
return PRINT_ORDER_DETAIL + orderId + ":" + detailId;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
package com.czg.service;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.RedisTemplate;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -17,6 +19,8 @@ import java.util.concurrent.TimeUnit;
|
|||
@Component
|
||||
public class RedisService {
|
||||
|
||||
Logger log = LoggerFactory.getLogger(RedisService.class);
|
||||
|
||||
/**
|
||||
* 默认过期时长为24小时,单位:秒
|
||||
*/
|
||||
|
|
@ -59,6 +63,7 @@ public class RedisService {
|
|||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -83,6 +88,7 @@ public class RedisService {
|
|||
try {
|
||||
return redisTemplate.hasKey(key);
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -127,6 +133,7 @@ public class RedisService {
|
|||
redisTemplate.opsForValue().set(key, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -148,6 +155,7 @@ public class RedisService {
|
|||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -215,6 +223,7 @@ public class RedisService {
|
|||
redisTemplate.opsForHash().putAll(key, map);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -235,6 +244,7 @@ public class RedisService {
|
|||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -252,6 +262,7 @@ public class RedisService {
|
|||
redisTemplate.opsForHash().put(key, item, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -273,6 +284,7 @@ public class RedisService {
|
|||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -346,6 +358,7 @@ public class RedisService {
|
|||
try {
|
||||
return Boolean.TRUE.equals(redisTemplate.opsForSet().isMember(key, value));
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -471,6 +484,7 @@ public class RedisService {
|
|||
redisTemplate.opsForList().rightPush(key, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -491,6 +505,7 @@ public class RedisService {
|
|||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -507,6 +522,7 @@ public class RedisService {
|
|||
redisTemplate.opsForList().rightPushAll(key, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -527,6 +543,7 @@ public class RedisService {
|
|||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -544,6 +561,7 @@ public class RedisService {
|
|||
redisTemplate.opsForList().set(key, index, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
log.error("redis error:{}", e + "");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,74 @@
|
|||
|
||||
package com.czg.account.dto.ad;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import java.io.Serial;
|
||||
|
||||
import com.czg.validator.group.InsertGroup;
|
||||
import com.czg.validator.group.UpdateGroup;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 店铺广告 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ShopAdDTO implements Serializable {
|
||||
|
||||
/**
|
||||
* 自增id
|
||||
*/
|
||||
@NotNull(message = "id不为空", groups = {UpdateGroup.class})
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 广告图片地址
|
||||
*/
|
||||
private String imgUrl;
|
||||
|
||||
/**
|
||||
* 跳转页面路径
|
||||
*/
|
||||
private String linkPath;
|
||||
|
||||
/**
|
||||
* 广告展示圆角
|
||||
*/
|
||||
private Integer borderRadius;
|
||||
|
||||
/**
|
||||
* 弹窗展示位置:home首页,make_order点餐页
|
||||
*/
|
||||
@NotBlank(message = "展示位置不为空", groups = InsertGroup.class)
|
||||
private String showPosition;
|
||||
|
||||
/**
|
||||
* 显示频率:only_one 仅首次展示, every_show 每次打开都展示,every_day 每天展示一次,three_day 每三天展示一次, seven_day 每七天展示一次, thirty_day 没30天展示一次
|
||||
*/
|
||||
@NotBlank(message = "显示频率不为空", groups = InsertGroup.class)
|
||||
private String frequency;
|
||||
|
||||
/**
|
||||
* 广告状态:0未启用,1已启用
|
||||
*/
|
||||
@NotNull(message = "广告状态不为空", groups = InsertGroup.class)
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,91 @@
|
|||
package com.czg.account.entity;
|
||||
|
||||
import com.mybatisflex.annotation.Column;
|
||||
import com.mybatisflex.annotation.Id;
|
||||
import com.mybatisflex.annotation.KeyType;
|
||||
import com.mybatisflex.annotation.Table;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 店铺广告 实体类。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-26
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@Table("tb_shop_ad")
|
||||
public class ShopAd implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 自增id
|
||||
*/
|
||||
@Id(keyType = KeyType.Auto)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 店铺id,如果是通用广告则为0
|
||||
*/
|
||||
private Long shopId;
|
||||
|
||||
/**
|
||||
* 广告图片地址
|
||||
*/
|
||||
private String imgUrl;
|
||||
|
||||
/**
|
||||
* 跳转页面路径
|
||||
*/
|
||||
private String linkPath;
|
||||
|
||||
/**
|
||||
* 广告展示圆角
|
||||
*/
|
||||
private Integer borderRadius;
|
||||
|
||||
/**
|
||||
* 弹窗展示位置:home首页,make_order点餐页
|
||||
*/
|
||||
private String showPosition;
|
||||
|
||||
/**
|
||||
* 显示频率:only_one 仅首次展示, every_show 每次打开都展示,every_day 每天展示一次,three_day 每三天展示一次, seven_day 每七天展示一次, thirty_day 没30天展示一次
|
||||
*/
|
||||
private String frequency;
|
||||
|
||||
/**
|
||||
* 广告状态:0未启用,1已启用
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@Column(onInsertValue = "now()", onUpdateValue = "now()")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.account.service;
|
||||
|
||||
import com.mybatisflex.core.service.IService;
|
||||
import com.czg.account.entity.ShopAd;
|
||||
|
||||
/**
|
||||
* 店铺广告 服务层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-26
|
||||
*/
|
||||
public interface ShopAdService extends IService<ShopAd> {
|
||||
|
||||
}
|
||||
|
|
@ -25,7 +25,7 @@ import java.time.LocalDateTime;
|
|||
public interface OrderInfoService extends IService<OrderInfo> {
|
||||
|
||||
Page<OrderInfoVo> getOrderByPage(OrderInfoQueryDTO param);
|
||||
HistoryOrderVo historyOrder(Long orderId);
|
||||
HistoryOrderVo historyOrder(Long orderId,String tableCode);
|
||||
OrderInfo createOrder(OrderInfoAddDTO param);
|
||||
|
||||
OrderInfo checkOrderPay(CheckOrderPay param);
|
||||
|
|
@ -35,4 +35,6 @@ public interface OrderInfoService extends IService<OrderInfo> {
|
|||
void refundCallBackOrder(@NotBlank String orderNo, @NotNull JSONObject resultJson);
|
||||
|
||||
void upOrderInfo(OrderInfo orderInfo, BigDecimal payAmount, LocalDateTime payTime, Long payOrderId, PayEnums payType);
|
||||
|
||||
void expired(Long orderId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
package com.czg.service.account.mapper;
|
||||
|
||||
import com.mybatisflex.core.BaseMapper;
|
||||
import com.czg.account.entity.ShopAd;
|
||||
|
||||
/**
|
||||
* 店铺广告 映射层。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-26
|
||||
*/
|
||||
public interface ShopAdMapper extends BaseMapper<ShopAd> {
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
package com.czg.service.account.print;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
|
|
@ -78,7 +79,7 @@ public abstract class PrinterHandler {
|
|||
@Accessors(chain = true)
|
||||
public static class PrintDetailInfo {
|
||||
private boolean isPrint;
|
||||
// private boolean isReturn;
|
||||
// private boolean isReturn;
|
||||
private long orderId;
|
||||
private long detailId;
|
||||
private BigDecimal printNum;
|
||||
|
|
@ -145,31 +146,37 @@ public abstract class PrinterHandler {
|
|||
}
|
||||
|
||||
protected List<OrderDetail> getCanPrintOrderDetails(boolean partPrint, Long orderId, List<OrderDetail> tbOrderDetailList, List<?> categoryIds) {
|
||||
List<Object> detailList = redisService.lGet(RedisCst.getPrintOrderDetailKey(orderId), 0, -1);
|
||||
Map<Long, PrintDetailInfo> detailMap = detailList.stream().collect(Collectors.toMap(i -> {
|
||||
if (i instanceof PrintDetailInfo i2) {
|
||||
return i2.getDetailId();
|
||||
}
|
||||
throw new RuntimeException("转换orderDetail失败");
|
||||
}, i -> (PrintDetailInfo) i));
|
||||
|
||||
List<Long> productIds = tbOrderDetailList.stream().map(OrderDetail::getProductId).collect(Collectors.toList());
|
||||
|
||||
Map<Long, Boolean> canPrintProMap = partPrint || categoryIds.isEmpty() ? new HashMap<>() :
|
||||
productService.list(new QueryWrapper().in(Product::getCategoryId, categoryIds).in(Product::getId, productIds))
|
||||
.stream().collect(Collectors.toMap(com.czg.product.entity.Product::getId, i -> true));
|
||||
.stream().collect(Collectors.toMap(com.czg.product.entity.Product::getId, i -> true));
|
||||
|
||||
ArrayList<OrderDetail> orderDetails = new ArrayList<>();
|
||||
tbOrderDetailList.forEach(item -> {
|
||||
PrintDetailInfo printDetailInfo = detailMap.get(item.getId());
|
||||
if (item.getIsPrint() != null && item.getIsPrint() == 1 && (canPrintProMap.get(item.getProductId()) != null || !partPrint) &&
|
||||
(printDetailInfo == null || item.getNum().subtract(printDetailInfo.getPrintNum()).compareTo(BigDecimal.ZERO) > 0)) {
|
||||
Object o = redisService.get(RedisCst.getPrintOrderDetailKey(orderId, item.getId()));
|
||||
|
||||
if (item.getIsPrint() != null && item.getIsPrint() == 1 && (canPrintProMap.get(item.getProductId()) != null || !partPrint)) {
|
||||
item.setReturnNum(item.getReturnNum() == null ? BigDecimal.ZERO : item.getReturnNum());
|
||||
PrintDetailInfo printDetailInfo = o != null ? JSONObject.parseObject((String) o, PrintDetailInfo.class) : null;
|
||||
if (printDetailInfo != null) {
|
||||
if (item.getNum().compareTo(printDetailInfo.getPrintNum()) <= 0) {
|
||||
log.info("此菜品已打印, {} {} {}", item.getProductName(), item.getSkuName(), printDetailInfo);
|
||||
}
|
||||
|
||||
if (item.getReturnNum().compareTo(printDetailInfo.getPrintReturnNum()) <= 0) {
|
||||
log.info("此退菜菜品已打印, {} {} {}", item.getProductName(), item.getSkuName(), printDetailInfo);
|
||||
}
|
||||
item.setNum(item.getNum().subtract(printDetailInfo.getPrintNum()));
|
||||
item.setReturnNum(item.getReturnNum().subtract(printDetailInfo.getPrintNum()));
|
||||
item.setReturnNum(item.getReturnNum().subtract(printDetailInfo.getPrintReturnNum()));
|
||||
orderDetails.add(item);
|
||||
}else {
|
||||
orderDetails.add(item);
|
||||
}
|
||||
orderDetails.add(item);
|
||||
|
||||
|
||||
} else {
|
||||
log.info("此菜品不在打印分类或属于免打, {} {} {}", item.getProductName(), item.getSkuName(), item.getId());
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -200,7 +207,7 @@ public abstract class PrinterHandler {
|
|||
}
|
||||
default -> log.warn("未知打印类型: {}", printMethod);
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
log.info("准备开始打印叫号单");
|
||||
if (StrUtil.isBlank(machine.getPrintType())) {
|
||||
return;
|
||||
|
|
@ -241,10 +248,8 @@ public abstract class PrinterHandler {
|
|||
}
|
||||
|
||||
// 已打印详情信息
|
||||
ArrayList<PrintDetailInfo> printDetailInfos = new ArrayList<>();
|
||||
Map<Long, OrderDetail> detailMap = tbOrderDetailList.stream().collect(Collectors.toMap(OrderDetail::getId, i -> i));
|
||||
Map<Long, OrderDetail> detailMap = tbOrderDetailList.stream().map(item -> BeanUtil.copyProperties(item, OrderDetail.class)).collect(Collectors.toMap(OrderDetail::getId, i -> i));
|
||||
tbOrderDetailList = getCanPrintOrderDetails("1".equals(machine.getClassifyPrint()), orderInfo.getId(), tbOrderDetailList, categoryIds);
|
||||
String printKey = RedisCst.getPrintOrderDetailKey(orderInfo.getId());
|
||||
tbOrderDetailList.parallelStream().filter(o -> ObjectUtil.defaultIfNull(o.getIsPrint(), 0) == 1).forEach(item -> {
|
||||
log.info("开始打印菜品,商品名:{}", item.getProductName());
|
||||
Integer isWaitCall = ObjectUtil.defaultIfNull(item.getIsWaitCall(), 0);
|
||||
|
|
@ -291,8 +296,8 @@ public abstract class PrinterHandler {
|
|||
|
||||
// 保存已打印信息
|
||||
OrderDetail orderDetail = detailMap.get(item.getId());
|
||||
redisService.leftPush(printKey, new PrintDetailInfo().setPrint(item.getIsPrint() == 1).setDetailId(item.getId())
|
||||
.setPrintNum(orderDetail.getNum()).setPrintReturnNum(orderDetail.getReturnNum()));
|
||||
redisService.set(RedisCst.getPrintOrderDetailKey(orderInfo.getId(), item.getId()), JSONObject.toJSONString(new PrintDetailInfo().setPrint(item.getIsPrint() == 1).setDetailId(item.getId())
|
||||
.setPrintNum(orderDetail.getNum()).setPrintReturnNum(orderDetail.getReturnNum())), 3600 * 24);
|
||||
|
||||
});
|
||||
|
||||
|
|
@ -383,10 +388,10 @@ public abstract class PrinterHandler {
|
|||
CallTable tbCallTable = callTableService.getById(queue.getCallTableId());
|
||||
ShopInfo shopInfo = shopInfoService.getById(queue.getShopId());
|
||||
callNumPrint(machine, queue.getCallNum(), shopInfo.getShopName(), tbCallTable.getName(), tbCallTable.getNote(), String.valueOf(callQueueService.count(new QueryWrapper()
|
||||
.eq(CallQueue::getShopId, queue.getShopId())
|
||||
.eq(CallQueue::getCallTableId, queue.getCallTableId())
|
||||
.lt(CallQueue::getId, queue.getId())
|
||||
.in(CallQueue::getState, 0, 1))), callUrl == null ? "未配置页面" : StrUtil.format(callUrl, queue.getShopId(), queue.getId()), queue.getCreateTime(),
|
||||
.eq(CallQueue::getShopId, queue.getShopId())
|
||||
.eq(CallQueue::getCallTableId, queue.getCallTableId())
|
||||
.lt(CallQueue::getId, queue.getId())
|
||||
.in(CallQueue::getState, 0, 1))), callUrl == null ? "未配置页面" : StrUtil.format(callUrl, queue.getShopId(), queue.getId()), queue.getCreateTime(),
|
||||
StrUtil.format("过号顺延{}桌 {}桌后需重新排号 谢谢理解!", tbCallTable.getPostponeNum(), tbCallTable.getPostponeNum()));
|
||||
}
|
||||
|
||||
|
|
@ -399,6 +404,7 @@ public abstract class PrinterHandler {
|
|||
|
||||
/**
|
||||
* 根据订单信息判断是否是退单
|
||||
*
|
||||
* @param orderInfo 顶动感信息
|
||||
* @return 是否退款
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,18 @@
|
|||
package com.czg.service.account.service.impl;
|
||||
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import com.czg.account.entity.ShopAd;
|
||||
import com.czg.account.service.ShopAdService;
|
||||
import com.czg.service.account.mapper.ShopAdMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 店铺广告 服务层实现。
|
||||
*
|
||||
* @author zs
|
||||
* @since 2025-02-26
|
||||
*/
|
||||
@Service
|
||||
public class ShopAdServiceImpl extends ServiceImpl<ShopAdMapper, ShopAd> implements ShopAdService{
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.czg.service.account.mapper.ShopAdMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -35,7 +35,6 @@ import com.czg.service.RedisService;
|
|||
import com.czg.service.order.dto.BigDecimalDTO;
|
||||
import com.czg.service.order.enums.OrderStatusEnums;
|
||||
import com.czg.service.order.mapper.OrderInfoMapper;
|
||||
import com.czg.system.entity.SysParams;
|
||||
import com.czg.utils.AssertUtil;
|
||||
import com.czg.utils.CzgStrUtils;
|
||||
import com.czg.utils.PageUtil;
|
||||
|
|
@ -131,13 +130,24 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
}
|
||||
|
||||
@Override
|
||||
public HistoryOrderVo historyOrder(Long orderId) {
|
||||
public HistoryOrderVo historyOrder(Long orderId, String tableCode) {
|
||||
if (orderId == null && StrUtil.isBlank(tableCode)) {
|
||||
throw new ValidateException("订单id或台桌码不可为空");
|
||||
}
|
||||
HistoryOrderVo historyOrderVo = new HistoryOrderVo();
|
||||
OrderInfo orderInfo = getById(orderId);
|
||||
OrderInfo orderInfo;
|
||||
if (orderId == null) {
|
||||
orderInfo = queryChain()
|
||||
.select()
|
||||
.eq(OrderInfo::getTableCode, tableCode)
|
||||
.one();
|
||||
} else {
|
||||
orderInfo = getById(orderId);
|
||||
}
|
||||
AssertUtil.isNull(orderInfo, "订单不存在");
|
||||
historyOrderVo.setInfo(orderInfo);
|
||||
List<OrderDetail> orderDetails = orderDetailService.queryChain().select()
|
||||
.eq(OrderDetail::getOrderId, orderId).list();
|
||||
.eq(OrderDetail::getOrderId, orderInfo.getId()).list();
|
||||
Map<Integer, List<OrderDetail>> resultMap = new HashMap<>();
|
||||
// 遍历订单详情列表
|
||||
for (OrderDetail orderDetail : orderDetails) {
|
||||
|
|
@ -208,6 +218,8 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
if ("after-pay".equals(orderInfo.getPayMode())) {
|
||||
//发送打票信息
|
||||
rabbitPublisher.sendOrderPrintMsg(orderInfo.getId().toString());
|
||||
} else {
|
||||
redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId(), "", 60 * 15);
|
||||
}
|
||||
rabbitPublisher.sendOrderStockMsg(orderInfo.getId().toString());
|
||||
return orderInfo;
|
||||
|
|
@ -216,6 +228,13 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
@Override
|
||||
public OrderInfo checkOrderPay(CheckOrderPay param) {
|
||||
OrderInfo orderInfo = getById(param.getOrderId());
|
||||
if (!"after-pay".equals(orderInfo.getPayMode())) {
|
||||
if (redisService.hasKey(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId())) {
|
||||
redisService.set(RedisCst.classKeyExpired.EXPIRED_ORDER + param.getOrderId(), "", 60 * 15);
|
||||
} else {
|
||||
throw new ValidateException("订单已过期,请重新下单");
|
||||
}
|
||||
}
|
||||
log.info("订单信息:{},优惠信息:{}", JSONObject.toJSONString(orderInfo), JSONObject.toJSONString(param));
|
||||
if (!orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
|
||||
throw new ValidateException("生成支付订单失败,订单不可支付");
|
||||
|
|
@ -433,6 +452,7 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
}
|
||||
upOrderInfo(orderInfo, new BigDecimal(czgCallBackDto.getAmount() / 100L),
|
||||
DateUtil.parseLocalDateTime(czgCallBackDto.getPayTime()), payment.getId(), null);
|
||||
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
|
||||
} else if ("memberIn".equals(payment.getPayType())) {
|
||||
ShopUser shopUser = shopUserService.getById(payment.getSourceId());
|
||||
if (shopUser == null) {
|
||||
|
|
@ -525,6 +545,23 @@ public class OrderInfoServiceImpl extends ServiceImpl<OrderInfoMapper, OrderInfo
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单到期
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void expired(Long orderId) {
|
||||
OrderInfo orderInfo = getById(orderId);
|
||||
if (orderInfo.getStatus().equals(OrderStatusEnums.UNPAID.getCode())) {
|
||||
updateChain().set(OrderInfo::getStatus, OrderStatusEnums.CANCELLED.getCode())
|
||||
.where(OrderInfo::getId).eq(orderId)
|
||||
.update();
|
||||
rabbitPublisher.sendOrderCancelMsg(orderId.toString());
|
||||
} else {
|
||||
log.info("订单取消失败,订单Id:{},订状态:{}", orderInfo.getId(), orderInfo.getStatus());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 初始化订单信息
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ public class PayServiceImpl implements PayService {
|
|||
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||
LocalDateTime.now(), null, PayEnums.CREDIT_PAY);
|
||||
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
|
||||
//TODO 挂账后续逻辑
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
|
@ -104,6 +105,7 @@ public class PayServiceImpl implements PayService {
|
|||
OrderInfo orderInfo = checkPay(payParam.getCheckOrderPay());
|
||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||
LocalDateTime.now(), null, PayEnums.CASH_PAY);
|
||||
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
|
@ -152,6 +154,7 @@ public class PayServiceImpl implements PayService {
|
|||
Long flowId = shopUserService.updateMoney(shopUser.getShopId(), shopUserMoneyEditDTO);
|
||||
orderInfoService.upOrderInfo(orderInfo, orderInfo.getOrderAmount(),
|
||||
LocalDateTime.now(), flowId, PayEnums.VIP_PAY);
|
||||
redisService.del(RedisCst.classKeyExpired.EXPIRED_ORDER + orderInfo.getId());
|
||||
return CzgResult.success();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#{entity.couponNum}, #{entity.returnNum}, #{entity.refundNum}, #{entity.refundNo},
|
||||
#{entity.discountSaleNote}, #{entity.status}, #{entity.placeNum}, #{entity.isTemporary}, #{entity.isPrint},
|
||||
#{entity.isWaitCall}, #{entity.proGroupInfo}, #{entity.remark}, #{entity.refundRemark},
|
||||
#{entity.createTime}, #{entity.updateTime})
|
||||
now(), now())
|
||||
</foreach>
|
||||
</insert>
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue