Commit c80087ef authored by shiyu's avatar shiyu

保证金明细

parent 0985556d
......@@ -80,7 +80,7 @@ public class AuctionEarnestServiceImpl implements AuctionEarnestService {
DistributionOrderRequestDto prePayDto = new DistributionOrderRequestDto();
prePayDto.setDistributionOrderId(orderId);
String itemName = "拍卖保证金";
prePayDto.setBuyerOpenid(dto.getUserOpenId());
prePayDto.setBuyerOpenid(earnestOrder.getUserOpenId());
prePayDto.setAmount(PriceUtil.convertPriceFenToYuan(earnestOrder.getAmount()));
prePayDto.setItemName(itemName);
Result prePayResult = wxPayServiceApi.createPrepareOrder(prePayDto);
......
......@@ -89,13 +89,20 @@ public class EarnestRecordServiceImpl implements EarnestRecordService {
long occupyAmount = earnestRecordDao.sumForOccupy(earnestRecordRequestDto);
//已用保证金
map.put("usedEarnestAmount", PriceUtil.convertPriceFenToYuan(occupyAmount));
//已用出价
//已用出价,需要在保证金:出价额度 = 1:20
map.put("usedAuctionAmount", PriceUtil.convertPriceFenToYuan(occupyAmount * 20));
//查询用户的保证金账户
UserAccount userAccount = userAccountDao.findByUserId(dto.getUserId());
long earnestAmount = userAccount.getEarnestAmount();
long giftAmount = userAccount.getGiftEarnestAmount();
if (giftAmount >= occupyAmount) {
map.put("usedGiftAmount", PriceUtil.convertPriceFenToYuan(occupyAmount));
map.put("usedPayAmount", null);
} else {
map.put("usedGiftAmount", PriceUtil.convertPriceFenToYuan(giftAmount));
map.put("usedPayAmount", PriceUtil.convertPriceFenToYuan(earnestAmount - giftAmount));
}
return Result.success(map);
} catch (Exception e) {
logger.error("查询保证金使用明细失败 error : {}", e);
......
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