Authored by chenchao

Merge branch 'master' into test6.8.5

... ... @@ -290,10 +290,19 @@ public class BuyerOrderCancelService {
BillLogEvent.BillLogEventBuilder blebOfBuyer = BillLogEvent.builder()
.buyerUid(buyerUid).sellerUid(sellerUid).orderCode(orderCode)
.payType(buyerOrder.getPayment()).refundCase(RefundCase.BUYER_GOODS_MONEY)
.amount(leftBuyerMoney)
.skup(skup);
logger.info("in BuyerCancelAfterProcessTask call begin payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundReqOfSeller {}",
buyerUid, orderCode, skup, rprOfBuyer );
payRefundService.refund(rprOfBuyer, blebOfBuyer);
try {
payRefundService.refund(rprOfBuyer, blebOfBuyer);
}catch (Exception ex){
BillLogEvent buyerBillLogEvent = blebOfBuyer.tradeStatus(BillTradeStatus.FAIL.getCode()).build();
EventBusPublisher.publishEvent(buyerBillLogEvent);
String content = "用户" + buyerUid + "订单"+ orderCode +"退货款失败";
SmsAlarmEvent smsAlarmEvent = new SmsAlarmEvent("buyerPaidOrder.selfCancel", "cancel", content);
EventBusPublisher.publishEvent(smsAlarmEvent);
}
logger.info("in BuyerCancelAfterProcessTask call after payRefundService.refund buyer, buyerUid {}, orderCode {}, skup {} refundReqOfSeller {}",
buyerUid, orderCode, skup, rprOfBuyer );
... ...
... ... @@ -55,8 +55,8 @@ public class TradeBillsService {
record.setTradeType(1);//1:保证金;2:货款;3:补偿款
record.setIncomeOutcome(1);// 1:用户收入; 2:用户支出
BigDecimal earnestMoney;
BigDecimal amount;
BigDecimal earnestMoney = BigDecimal.ZERO;
BigDecimal amount = BigDecimal.ZERO;
try {
JSONObject metavalue = JSON.parseObject(meta.getMetaValue());
BigDecimal rate = metavalue.getJSONObject("serviceFeeRate").getBigDecimal("payChannelRate");
... ... @@ -64,7 +64,7 @@ public class TradeBillsService {
amount = earnestMoney.multiply(BigDecimal.ONE.subtract(rate)).multiply(new BigDecimal("-1")).setScale(2, BigDecimal.ROUND_HALF_UP);
} catch (Exception e) {
logger.error("PayRecordErr计费信息不完整, uid is {}, skup is {}, err is {}", uid, skup, e.getMessage());
return;
// return;
}
record.setAmount(earnestMoney);
record.setSystemAmount(amount);// 有货收入
... ... @@ -108,12 +108,13 @@ public class TradeBillsService {
try {
JSONObject metavalue = JSON.parseObject(meta.getMetaValue());
BigDecimal rate = metavalue.getJSONObject("serviceFeeRate").getBigDecimal("payChannelRate");
amount = amount.multiply(BigDecimal.ONE.subtract(rate)).multiply(new BigDecimal("-1")).setScale(2, BigDecimal.ROUND_HALF_UP);
BigDecimal samount = amount.multiply(BigDecimal.ONE.subtract(rate)).multiply(new BigDecimal("-1")).setScale(2, BigDecimal.ROUND_HALF_UP);
record.setSystemAmount(samount);// 有货收入
} catch (Exception e) {
logger.error("PayRecordErr计费信息不完整, uid is {}, skup is {}, err is {}", uid, skup, e.getMessage());
return;
// return;
}
record.setSystemAmount(amount);// 有货收入
record.setTradeStatus(tradeStatus);//0:订单未完结;1:订单完结
record.setCreateTime((int) (System.currentTimeMillis() / 1000));
addTradeBills(record);
... ...