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

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

提交 退款资金纪录

parent 65fdd36c
...@@ -913,9 +913,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -913,9 +913,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
sqls.add(SqlMapping.get("goblin_order.store.refundBackOrder")); sqls.add(SqlMapping.get("goblin_order.store.refundBackOrder"));
String orderId = backOrderVo.getOrderId(); String orderId = backOrderVo.getOrderId();
List<GoblinBackOrderSkuVo> backOrderSkuVos = backOrderVo.getBackOrderSkuVos(); List<GoblinBackOrderSkuVo> backOrderSkuVos = backOrderVo.getBackOrderSkuVos();
BigDecimal price = refundCallbackParam.getRefundPrice();
GoblinStoreOrderVo orderVo = redisUtils.getGoblinOrder(orderId); 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) { if (orderVo.getPriceRefund().compareTo(orderVo.getPriceActual()) >= 0) {
//整单退款 退券 //整单退款 退券
orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue()); orderVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue());
...@@ -936,7 +935,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -936,7 +935,8 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
backOrderVo.setRefundAt(nowStr); backOrderVo.setRefundAt(nowStr);
for (GoblinBackOrderSkuVo backOrderSkuVo : backOrderSkuVos) { for (GoblinBackOrderSkuVo backOrderSkuVo : backOrderSkuVos) {
GoblinOrderSkuVo orderSkuVo = redisUtils.getGoblinOrderSkuVo(backOrderSkuVo.getOrderSkuId()); 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) { if (orderSkuVo.getPriceRefund().compareTo(orderSkuVo.getSkuPriceActual()) >= 0) {
orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue()); orderSkuVo.setStatus(GoblinStatusConst.Status.ORDER_STATUS_6.getValue());
String pre = GoblinStatusConst.MarketPreStatus.getPre(orderSkuVo.getSkuId()); String pre = GoblinStatusConst.MarketPreStatus.getPre(orderSkuVo.getSkuId());
...@@ -964,9 +964,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService { ...@@ -964,9 +964,9 @@ public class GoblinOrderServiceImpl implements IGoblinOrderService {
logVo.setSpuName(backOrderSkuVo.getSpuName()); logVo.setSpuName(backOrderSkuVo.getSpuName());
logVo.setSkuId(backOrderSkuVo.getSkuId()); logVo.setSkuId(backOrderSkuVo.getSkuId());
if (orderVo.getStatus().equals(GoblinStatusConst.Status.ORDER_STATUS_6.getValue())) { 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.setStatus(GoblinStatusConst.Status.ORDER_LOG_STATUS_22.getValue());
logVo.setRemark("订单退款"); logVo.setRemark("订单退款");
logVo.setOperationId(backOrderVo.getUserId()); logVo.setOperationId(backOrderVo.getUserId());
......
...@@ -54,11 +54,11 @@ public class GoblinOrderUtils { ...@@ -54,11 +54,11 @@ public class GoblinOrderUtils {
//判断 数量限购 //判断 数量限购
public String judgeOrderLimit(String uid, String skuId, int number, int limitCount) { public String judgeOrderLimit(String uid, String skuId, int number, int limitCount) {
int buyCount = redisUtils.getSkuCountByUid(uid, skuId); int buyCount = redisUtils.incrSkuCountByUid(uid, skuId, number);
if (buyCount + number > limitCount) { if (buyCount > limitCount) {
redisUtils.decrSkuCountByUid(uid, skuId, number);
return "已超出限购数量"; return "已超出限购数量";
} else { } else {
int a = redisUtils.incrSkuCountByUid(uid, skuId, number);
return ""; 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