|
|
|
|
@@ -284,7 +284,7 @@ public class PayService {
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
//更新子单状态
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("token", token);
|
|
|
|
|
@@ -363,8 +363,11 @@ public class PayService {
|
|
|
|
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
//更新子单状态
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
}else {
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("token", token);
|
|
|
|
|
@@ -479,8 +482,11 @@ public class PayService {
|
|
|
|
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
}else {
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
|
|
|
|
}
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("token", token);
|
|
|
|
|
jsonObject.put("type", "create");
|
|
|
|
|
@@ -614,10 +620,11 @@ public class PayService {
|
|
|
|
|
//更新购物车状态
|
|
|
|
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed");
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
}else {
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
@@ -743,9 +750,13 @@ public class PayService {
|
|
|
|
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed");
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
}else {
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
@@ -849,7 +860,13 @@ public class PayService {
|
|
|
|
|
//更新购物车状态
|
|
|
|
|
int cartCount = tbCashierCartMapper.updateByOrderId(String.valueOf(orderId), "final");
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
}else {
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
@@ -926,11 +943,17 @@ public class PayService {
|
|
|
|
|
orderInfo.setPayType("cash");
|
|
|
|
|
orderInfo.setStatus("closed");
|
|
|
|
|
orderInfo.setPayOrderNo("cash".concat(SnowFlakeUtil.generateOrderNo()));
|
|
|
|
|
|
|
|
|
|
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
|
|
|
|
//更新购物车状态
|
|
|
|
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
}else {
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
|
|
|
|
}
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
@@ -1017,10 +1040,14 @@ public class PayService {
|
|
|
|
|
tbOrderInfoMapper.updateByPrimaryKeySelective(orderInfo);
|
|
|
|
|
//更新购物车状态
|
|
|
|
|
int cartCount = tbCashierCartMapper.updateByOrderId(orderId, "final");
|
|
|
|
|
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderIdAndStatus(Integer.valueOf(orderId), "closed");
|
|
|
|
|
log.info("更新购物车:{}", cartCount);
|
|
|
|
|
|
|
|
|
|
if(ObjectUtil.isNotNull(orderInfo.getDiscountRatio())&&ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio())){
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",orderInfo.getDiscountRatio());
|
|
|
|
|
}else {
|
|
|
|
|
tbOrderDetailMapper.updateStatusByOrderId(Integer.valueOf(orderId), "closed",null);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
JSONObject jsonObject = new JSONObject();
|
|
|
|
|
jsonObject.put("token", token);
|
|
|
|
|
jsonObject.put("type", "create");
|
|
|
|
|
@@ -1065,7 +1092,7 @@ public class PayService {
|
|
|
|
|
TbShopInfo shopInfo = tbShopInfoMapper.selectByPrimaryKey(Integer.valueOf(orderInfo.getShopId()));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ("1".equals(shopInfo.getIsReturn())) {
|
|
|
|
|
if ("0".equals(shopInfo.getIsReturn())) {
|
|
|
|
|
if (ObjectUtil.isEmpty(pwd)) {
|
|
|
|
|
return Result.fail(CodeEnum.PARAM);
|
|
|
|
|
}
|
|
|
|
|
@@ -1141,11 +1168,10 @@ public class PayService {
|
|
|
|
|
// totalAmount = totalAmount.add(it.getPriceAmount());
|
|
|
|
|
totalAmount = totalAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
saleAmount = saleAmount.add(it.getPrice());
|
|
|
|
|
|
|
|
|
|
payAmount = payAmount.add(it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN)
|
|
|
|
|
.multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
if (ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio()) && ObjectUtil.isNotNull(orderInfo.getDiscountRatio())) {
|
|
|
|
|
payAmount = payAmount.multiply(orderInfo.getDiscountRatio()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
}
|
|
|
|
|
//
|
|
|
|
|
// payAmount=payAmount.add(it.getPriceAmount());
|
|
|
|
|
packAMount = packAMount.add(it.getPackAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId()))));
|
|
|
|
|
|
|
|
|
|
@@ -1158,10 +1184,6 @@ public class PayService {
|
|
|
|
|
}
|
|
|
|
|
BigDecimal returnAmount = it.getPriceAmount().divide(new BigDecimal(it.getNum()), 2, RoundingMode.DOWN).multiply(new BigDecimal(map1.get(it.getId())));;
|
|
|
|
|
|
|
|
|
|
if (ObjectUtil.isNotEmpty(orderInfo.getDiscountRatio()) && ObjectUtil.isNotNull(orderInfo.getDiscountRatio())) {
|
|
|
|
|
returnAmount = returnAmount.multiply(orderInfo.getDiscountRatio()).setScale(2, BigDecimal.ROUND_DOWN);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
detailPo.setReturnNum(map1.get(it.getId()));
|
|
|
|
|
detailPos.add(detailPo);
|
|
|
|
|
it.setNum(map1.get(it.getId()));
|
|
|
|
|
@@ -1255,7 +1277,7 @@ public class PayService {
|
|
|
|
|
flow.setBizCode("accountReturnPay");
|
|
|
|
|
flow.setBizName("会员储值卡退款");
|
|
|
|
|
flow.setType("+");
|
|
|
|
|
flow.setAmount(newOrderInfo.getOrderAmount());
|
|
|
|
|
flow.setAmount(newOrderInfo.getPayAmount());
|
|
|
|
|
flow.setBalance(user.getAmount());
|
|
|
|
|
flow.setCreateTime(new Date());
|
|
|
|
|
flow.setIsReturn("0");
|
|
|
|
|
|