1.点歌支付防抖
2.点歌记录倒序 3.下单同步保存库存记录
This commit is contained in:
@@ -147,6 +147,8 @@ public class PayService {
|
||||
TbActivateMapper tbActivateMapper;
|
||||
|
||||
private final TbShopSongOrderService shopSongOrderService;
|
||||
@Autowired
|
||||
private MQUtils mQUtils;
|
||||
|
||||
public PayService(@Qualifier("tbShopSongOrderServiceImpl") TbShopSongOrderService shopSongOrderService) {
|
||||
this.shopSongOrderService = shopSongOrderService;
|
||||
@@ -268,7 +270,9 @@ public class PayService {
|
||||
}
|
||||
|
||||
PublicResp<WxScanPayResp> publicResp = thirdPayService.scanpay(thirdUrl, thirdApply.getAppId(),
|
||||
reqbody, reqbody, payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(), "WECHAT", thirdApply.getSmallAppid(), openId, ip, DateUtils.getsdfTimesSS(), thirdApply.getStoreId(), callFSTBack, null, thirdApply.getAppToken());
|
||||
reqbody, reqbody,
|
||||
payment.getAmount().setScale(2, BigDecimal.ROUND_DOWN).multiply(new BigDecimal(100)).longValue(),
|
||||
"WECHAT", thirdApply.getSmallAppid(), openId, ip, DateUtils.getsdfTimesSS(), thirdApply.getStoreId(), callFSTBack, null, thirdApply.getAppToken());
|
||||
if (ObjectUtil.isNotNull(publicResp) && ObjectUtil.isNotEmpty(publicResp)) {
|
||||
if ("000000".equals(publicResp.getCode())) {
|
||||
WxScanPayResp wxScanPayResp = publicResp.getObjData();
|
||||
@@ -878,6 +882,12 @@ public class PayService {
|
||||
producer.printMechine(orderInfo.getId() + "");
|
||||
sendOrderToClient(orderInfo);
|
||||
redisUtil.deleteByKey(RedisCst.ORDER_EXPIRED.concat(orderInfo.getId().toString()));
|
||||
|
||||
// 发送mq消息并保存库存记录
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("orderId", orderInfo.getId());
|
||||
data.put("plat", "miniApp");
|
||||
mQUtils.sendStockSaleMsg(data);
|
||||
return "SUCCESS";
|
||||
|
||||
}
|
||||
@@ -923,6 +933,12 @@ public class PayService {
|
||||
producer.printCoupons(coupons.toJSONString());
|
||||
sendOrderToClient(orderInfo);
|
||||
redisUtil.deleteByKey(RedisCst.ORDER_EXPIRED.concat(orderInfo.getId().toString()));
|
||||
|
||||
// 发送mq消息并保存库存记录
|
||||
JSONObject data = new JSONObject();
|
||||
data.put("orderId", orderInfo.getId());
|
||||
data.put("plat", "miniApp");
|
||||
mQUtils.sendStockSaleMsg(data);
|
||||
return "SUCCESS";
|
||||
|
||||
}
|
||||
|
||||
@@ -138,7 +138,8 @@ public class ProductService {
|
||||
|
||||
|
||||
if (ObjectUtil.isNotEmpty(in) && ObjectUtil.isNotNull(in)) {
|
||||
List<TbProduct> products = tbProductMapper.selectByIdIn(in);
|
||||
// List<TbProduct> products = tbProductMapper.selectByIdIn(in);
|
||||
List<TbProduct> products = tbProductMapper.selectByIdInAndCheck(in);
|
||||
if (ObjectUtil.isNotEmpty(products) && products.size() > 0) {
|
||||
products.parallelStream().forEach(it -> {
|
||||
Integer sum = tbProductMapper.selectByQcode(code, it.getId(), it.getShopId());
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.chaozhanggui.system.cashierservice.entity.TbShopSong;
|
||||
import com.chaozhanggui.system.cashierservice.entity.TbShopSongOrder;
|
||||
import com.chaozhanggui.system.cashierservice.entity.dto.SongOrderDTO;
|
||||
import com.chaozhanggui.system.cashierservice.exception.MsgException;
|
||||
import com.chaozhanggui.system.cashierservice.redis.RedisCst;
|
||||
import com.chaozhanggui.system.cashierservice.service.PayService;
|
||||
import com.chaozhanggui.system.cashierservice.service.TbShopSongOrderService;
|
||||
import com.chaozhanggui.system.cashierservice.service.TbShopSongService;
|
||||
|
||||
Reference in New Issue
Block a user