店铺管理-店铺配置:打印机设置相关接口
This commit is contained in:
@@ -44,6 +44,7 @@ public class NotifyController {
|
||||
String payOrderId = bizData.getString("payOrderId");
|
||||
String payType = bizData.getString("payType");
|
||||
String payTime = bizData.getString("payTime");
|
||||
long amount = bizData.getLongValue("amount");
|
||||
long paidTime = DateUtil.parseDateTime(payTime).getTime();
|
||||
if (!"TRADE_SUCCESS".equals(state)) {
|
||||
log.error("支付失败:{},{}", state, note);
|
||||
@@ -51,10 +52,11 @@ public class NotifyController {
|
||||
}
|
||||
TbOrderInfo entity = orderService.selectByPayOrderNo(payOrderId);
|
||||
if (entity == null) {
|
||||
log.error("订单不存在:{}", payOrderId);
|
||||
return Result.fail("订单不存在");
|
||||
}
|
||||
entity.setPaidTime(paidTime);
|
||||
orderService.payCallbackCloseOrder(entity, payType);
|
||||
orderService.payCallbackCloseOrder(entity, payType, amount);
|
||||
return Result.success(CodeEnum.SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.chaozhanggui.system.cashierservice.service;
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.thread.ThreadUtil;
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
@@ -462,7 +463,7 @@ public class OrderService {
|
||||
if (product.getStockNumber() == null) {
|
||||
product.setStockNumber(0);
|
||||
}
|
||||
if ( product.getStockNumber() - num <= product.getWarnLine()) {
|
||||
if (product.getStockNumber() - num <= product.getWarnLine()) {
|
||||
List<TbShopOpenId> shopOpenIds = shopOpenIdMapper.selectStateByShopIdAndType(product.getShopId(), ShopWxMsgTypeEnum.STOCK_MSG.getType());
|
||||
shopOpenIds.forEach(item -> {
|
||||
wxAccountUtil.sendStockWarnMsg("商品库存不足", product.getName(),
|
||||
@@ -1859,11 +1860,13 @@ public class OrderService {
|
||||
}
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void payCallbackCloseOrder(TbOrderInfo entity, String payType) {
|
||||
public void payCallbackCloseOrder(TbOrderInfo entity, String payType, long actualPayAmount) {
|
||||
mPOrderInfoMapper.update(null, new LambdaUpdateWrapper<TbOrderInfo>()
|
||||
.eq(TbOrderInfo::getId, entity.getId())
|
||||
.eq(TbOrderInfo::getStatus, "paying")
|
||||
.set(TbOrderInfo::getStatus, "closed")
|
||||
.set(TbOrderInfo::getPayType, payType)
|
||||
.set(TbOrderInfo::getPayAmount, NumberUtil.div(actualPayAmount, 100))
|
||||
.set(TbOrderInfo::getPaidTime, entity.getPaidTime())
|
||||
.set(TbOrderInfo::getUpdatedAt, System.currentTimeMillis())
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user