记得上下班打卡 | git大法好,push需谨慎

Commit bc9408c4 authored by 胡佳晨's avatar 胡佳晨

提交 退款资金纪录

parent 65fdd36c
......@@ -913,9 +913,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
sqls.add(SqlMapping.get("goblin_order.store.refundBackOrder"));
String orderId = backOrderVo.getOrderId();
List<GoblinBackOrderSkuVo> backOrderSkuVos = backOrderVo.getBackOrderSkuVos();
BigDecimal price = refundCallbackParam.getRefundPrice();
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId);
orderVo.setPriceRefund(orderVo.getPriceRefund().add(price));
orderVo.setPriceRefund(orderVo.getPriceRefund().add(refundCallbackParam.getRefundPrice()));
if (orderVo.getPriceRefund().compareTo(orderVo.getPriceActual()) >= 0) {
//整单退款 退券
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue());
......@@ -936,7 +935,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
backOrderVo.setRefundAt(nowStr);
for (GoblinBackOrderSkuVo backOrderSkuVo : backOrderSkuVos) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(backOrderSkuVo.getOrderSkuId());
orderSkuVo.setPriceRefund(orderSkuVo.getPriceRefund() == null ? price : orderSkuVo.getPriceRefund().add(price));
BigDecimal refundSkuPrice = backOrderSkuVo.getRefundPrice();
orderSkuVo.setPriceRefund(orderSkuVo.getPriceRefund() == null ? refundSkuPrice : orderSkuVo.getPriceRefund().add(refundSkuPrice));
if (orderSkuVo.getPriceRefund().compareTo(orderSkuVo.getSkuPriceActual()) >= 0) {
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue());
String pre = GoblinStatusConst.MarketPreStatus.getPre(orderSkuVo.getSkuId());
......@@ -964,9 +964,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
logVo.setSpuName(backOrderSkuVo.getSpuName());
logVo.setSkuId(backOrderSkuVo.getSkuId());
if (orderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_6.getValue())) {
price = price.subtract(orderVo.getPriceExpress());
refundSkuPrice = refundSkuPrice.subtract(orderVo.getPriceExpress());
}
logVo.setSkuPriceActual(price.multiply(BigDecimal.valueOf(100)).negate().longValue());
logVo.setSkuPriceActual(refundSkuPrice.multiply(BigDecimal.valueOf(100)).negate().longValue());
logVo.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue());
logVo.setRemark("订单退款");
logVo.setOperationId(backOrderVo.getUserId());
......
......@@ -54,11 +54,11 @@ public class GoblinOrderUtils {
//判断 数量限购
public String judgeOrderLimit(String uid, String skuId, int number, int limitCount) {
int buyCount = redisUtils.getSkuCountByUid(uid, skuId);
if (buyCount + number > limitCount) {
int buyCount = redisUtils.incrSkuCountByUid(uid, skuId, number);
if (buyCount > limitCount) {
redisUtils.decrSkuCountByUid(uid, skuId, number);
return "已超出限购数量";
} else {
int a = redisUtils.incrSkuCountByUid(uid, skuId, number);
return "";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment