|
@@ -139,6 +139,7 @@ public class TOrderController {
|
|
// altRefInfo.add(refInfo);
|
|
// altRefInfo.add(refInfo);
|
|
// }
|
|
// }
|
|
// }
|
|
// }
|
|
|
|
+ BigDecimal p8_MarketRefAmount = BigDecimal.ZERO;
|
|
for (int i = 0; i < altInfoArray.size(); i++) {
|
|
for (int i = 0; i < altInfoArray.size(); i++) {
|
|
JSONObject altInfoObject = altInfoArray.getJSONObject(i);
|
|
JSONObject altInfoObject = altInfoArray.getJSONObject(i);
|
|
|
|
|
|
@@ -160,6 +161,9 @@ public class TOrderController {
|
|
altAmountPrice = refusePrice.multiply(altAmountPrice.divide(sumPrice,2,BigDecimal.ROUND_HALF_UP)).setScale(2, RoundingMode.HALF_DOWN);
|
|
altAmountPrice = refusePrice.multiply(altAmountPrice.divide(sumPrice,2,BigDecimal.ROUND_HALF_UP)).setScale(2, RoundingMode.HALF_DOWN);
|
|
p = p.add(altAmountPrice);
|
|
p = p.add(altAmountPrice);
|
|
refInfo.put("altRefAmount", altAmountPrice.toString());
|
|
refInfo.put("altRefAmount", altAmountPrice.toString());
|
|
|
|
+ if(order.getMarketingAmount()!=null){
|
|
|
|
+ p8_MarketRefAmount = order.getMarketingAmount().multiply(refusePrice.divide(sumPrice,2,BigDecimal.ROUND_HALF_UP)).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
|
+ }
|
|
}else {
|
|
}else {
|
|
//退全部的钱
|
|
//退全部的钱
|
|
// if(order.getRefundAmount()!=null){
|
|
// if(order.getRefundAmount()!=null){
|
|
@@ -176,6 +180,9 @@ public class TOrderController {
|
|
altAmountPrice = refusePrice.multiply(divide).setScale(2, RoundingMode.HALF_DOWN);
|
|
altAmountPrice = refusePrice.multiply(divide).setScale(2, RoundingMode.HALF_DOWN);
|
|
p = p.add(altAmountPrice);
|
|
p = p.add(altAmountPrice);
|
|
refInfo.put("altRefAmount", altAmountPrice.toString());
|
|
refInfo.put("altRefAmount", altAmountPrice.toString());
|
|
|
|
+ if(order.getMarketingAmount()!=null){
|
|
|
|
+ p8_MarketRefAmount = order.getMarketingAmount().multiply(refusePrice.divide(sumPrice,2,BigDecimal.ROUND_HALF_UP)).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -197,7 +204,7 @@ public class TOrderController {
|
|
altRefInfo.add(refInfo);
|
|
altRefInfo.add(refInfo);
|
|
}
|
|
}
|
|
String text = "";
|
|
String text = "";
|
|
- BigDecimal p8_MarketRefAmount = order.getMarketingAmount().multiply(refusePrice.divide(sumPrice,2,BigDecimal.ROUND_HALF_UP)).setScale(2, RoundingMode.HALF_DOWN);
|
|
|
|
|
|
+
|
|
//需要知道订单是哪一个平台的,不能以账号的为标准 0或null为汇聚,1为杉德支付
|
|
//需要知道订单是哪一个平台的,不能以账号的为标准 0或null为汇聚,1为杉德支付
|
|
String payPlatform = order.getPayPlatform();
|
|
String payPlatform = order.getPayPlatform();
|
|
if (StringUtils.isNotEmpty(payPlatform) && payPlatform.equals("1")) {
|
|
if (StringUtils.isNotEmpty(payPlatform) && payPlatform.equals("1")) {
|
|
@@ -358,9 +365,18 @@ public class TOrderController {
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
- String result = orderService.refund(order.getSn(), orderService.initRefundSn(equipmentId), refusePrice, p8_MarketRefAmount,"", notifyUrl, altRefInfo.toString());
|
|
|
|
|
|
+ String result = orderService.refund(order.getSn(), orderService.initRefundSn(equipmentId), refusePrice.subtract(p8_MarketRefAmount), p8_MarketRefAmount,"", notifyUrl, altRefInfo.toString());
|
|
if ("退款申请成功".equals(result)) {
|
|
if ("退款申请成功".equals(result)) {
|
|
order.setStatus(2);
|
|
order.setStatus(2);
|
|
|
|
+ if(StringUtils.isNotEmpty(order.getCoupons())){
|
|
|
|
+ //设置退款营销金额
|
|
|
|
+ if(order.getRefundMarketingAmount()!=null){
|
|
|
|
+ //累加
|
|
|
|
+ order.setRefundMarketingAmount(order.getRefundMarketingAmount().add(p8_MarketRefAmount));
|
|
|
|
+ }else {
|
|
|
|
+ order.setRefundMarketingAmount(p8_MarketRefAmount);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
order.setRefundTrxNo(String.valueOf(torder.getRefundAmount()));
|
|
order.setRefundTrxNo(String.valueOf(torder.getRefundAmount()));
|
|
payFeign.updateOrder(order);
|
|
payFeign.updateOrder(order);
|
|
return ResponseEntity
|
|
return ResponseEntity
|