| | |
| | | if (C2cOrder.DIRECTION_BUY.equals(c2cOrder.getDirection())) { |
| | | // 买币 |
| | | // 给用户账户添加相应的币种数量 |
| | | double amountBefore = 0d; |
| | | double amountAfter = 0d; |
| | | double amountBefore; |
| | | double amountAfter; |
| | | if ("usdt".equalsIgnoreCase(c2cOrder.getSymbol())) { |
| | | Wallet wallet = this.walletService.saveWalletByPartyId(c2cOrder.getPartyId()); |
| | | amountBefore = wallet.getMoney().doubleValue(); |
| | |
| | | // 保存资金日志 |
| | | MoneyLog moneyLog = new MoneyLog(); |
| | | moneyLog.setCategory(Constants.MONEYLOG_CATEGORY_C2C); |
| | | moneyLog.setAmount_before(new BigDecimal(amountBefore)); |
| | | moneyLog.setAmountBefore(new BigDecimal(amountBefore)); |
| | | moneyLog.setAmount(new BigDecimal(c2cOrder.getCoinAmount())); |
| | | moneyLog.setAmount_after(new BigDecimal(amountAfter)); |
| | | moneyLog.setAmountAfter(new BigDecimal(amountAfter)); |
| | | moneyLog.setLog("c2c订单购买放行,订单号[" + c2cOrder.getOrderNo() + "]"); |
| | | moneyLog.setUserId(c2cOrder.getPartyId()); |
| | | moneyLog.setWallet_type(c2cOrder.getSymbol()); |
| | |
| | | return baseMapper.pagedC2cQuery(page,status,orderNo,userCode,rolename,c2cUserCode,c2cUserType,c2cUserPartyCode,direction); |
| | | } |
| | | |
| | | |
| | | @Transactional |
| | | public void saveOpen(C2cOrder c2cOrder,String remark) { |
| | | log.error("saveOpen start:"+remark); |
| | | C2cAdvert c2cAdvert = this.c2cAdvertService.getById(c2cOrder.getC2cAdvertId()); |
| | |
| | | throw new YamiShopBindException("承兑商的用户信息不存在"); |
| | | } |
| | | |
| | | |
| | | C2cPaymentMethod method = this.c2cPaymentMethodService.get(c2cOrder.getPaymentMethodId()); |
| | | if (null == method) { |
| | | throw new YamiShopBindException("支付方式不存在"); |
| | | } |
| | | |
| | | if (C2cAdvert.DIRECTION_SELL.equals(c2cAdvert.getDirection())) { |
| | | |
| | | if (null == method) { |
| | | throw new YamiShopBindException("支付方式不存在"); |
| | | } |
| | | if (!party.isWithdrawAuthority()) { |
| | | throw new YamiShopBindException( "无权限"); |
| | | } |
| | |
| | | } |
| | | } else { |
| | | |
| | | if (!method.getPartyId().equals(c2cUser.getC2cUserPartyId())) { |
| | | /*if (!method.getPartyId().equals(c2cUser.getC2cUserPartyId())) { |
| | | throw new YamiShopBindException("支付方式不匹配该承兑商"); |
| | | } |
| | | }*/ |
| | | } |
| | | |
| | | c2cOrder.setC2cUserType(c2cUser.getC2cUserType()); |
| | |
| | | c2cOrder.setPayRate(c2cAdvert.getPayRate()); |
| | | c2cOrder.setSymbolValue(c2cAdvert.getSymbolValue()); |
| | | c2cOrder.setExpireTime(c2cAdvert.getExpireTime()); |
| | | c2cOrder.setMethodType(method.getMethodType()); |
| | | c2cOrder.setMethodName(method.getMethodName()); |
| | | c2cOrder.setMethodImg(method.getMethodImg()); |
| | | c2cOrder.setRealName(method.getRealName()); |
| | | c2cOrder.setParamName1(method.getParamName1()); |
| | | c2cOrder.setParamValue1(method.getParamValue1()); |
| | | c2cOrder.setParamName2(method.getParamName2()); |
| | | c2cOrder.setParamValue2(method.getParamValue2()); |
| | | c2cOrder.setParamName3(method.getParamName3()); |
| | | c2cOrder.setParamValue3(method.getParamValue3()); |
| | | c2cOrder.setParamName4(method.getParamName4()); |
| | | c2cOrder.setParamValue4(method.getParamValue4()); |
| | | c2cOrder.setParamName5(method.getParamName5()); |
| | | c2cOrder.setParamValue5(method.getParamValue5()); |
| | | c2cOrder.setParamName6(method.getParamName6()); |
| | | c2cOrder.setParamValue6(method.getParamValue6()); |
| | | c2cOrder.setParamName7(method.getParamName7()); |
| | | c2cOrder.setParamValue7(method.getParamValue7()); |
| | | c2cOrder.setParamName8(method.getParamName8()); |
| | | c2cOrder.setParamValue8(method.getParamValue8()); |
| | | c2cOrder.setParamName9(method.getParamName9()); |
| | | c2cOrder.setParamValue9(method.getParamValue9()); |
| | | c2cOrder.setParamName10(method.getParamName10()); |
| | | c2cOrder.setParamValue10(method.getParamValue10()); |
| | | c2cOrder.setParamName11(method.getParamName11()); |
| | | c2cOrder.setParamValue11(method.getParamValue11()); |
| | | c2cOrder.setParamName12(method.getParamName12()); |
| | | c2cOrder.setParamValue12(method.getParamValue12()); |
| | | c2cOrder.setParamName13(method.getParamName13()); |
| | | c2cOrder.setParamValue13(method.getParamValue13()); |
| | | c2cOrder.setParamName14(method.getParamName14()); |
| | | c2cOrder.setParamValue14(method.getParamValue14()); |
| | | c2cOrder.setParamName15(method.getParamName15()); |
| | | c2cOrder.setParamValue15(method.getParamValue15()); |
| | | c2cOrder.setQrcode(method.getQrcode()); |
| | | |
| | | |
| | | if (C2cAdvert.DIRECTION_SELL.equals(c2cAdvert.getDirection())) { |
| | | c2cOrder.setMethodType(method.getMethodType()); |
| | | c2cOrder.setMethodName(method.getMethodName()); |
| | | c2cOrder.setMethodImg(method.getMethodImg()); |
| | | c2cOrder.setRealName(method.getRealName()); |
| | | c2cOrder.setParamName1(method.getParamName1()); |
| | | c2cOrder.setParamValue1(method.getParamValue1()); |
| | | c2cOrder.setParamName2(method.getParamName2()); |
| | | c2cOrder.setParamValue2(method.getParamValue2()); |
| | | c2cOrder.setParamName3(method.getParamName3()); |
| | | c2cOrder.setParamValue3(method.getParamValue3()); |
| | | c2cOrder.setParamName4(method.getParamName4()); |
| | | c2cOrder.setParamValue4(method.getParamValue4()); |
| | | c2cOrder.setParamName5(method.getParamName5()); |
| | | c2cOrder.setParamValue5(method.getParamValue5()); |
| | | c2cOrder.setParamName6(method.getParamName6()); |
| | | c2cOrder.setParamValue6(method.getParamValue6()); |
| | | c2cOrder.setParamName7(method.getParamName7()); |
| | | c2cOrder.setParamValue7(method.getParamValue7()); |
| | | c2cOrder.setParamName8(method.getParamName8()); |
| | | c2cOrder.setParamValue8(method.getParamValue8()); |
| | | c2cOrder.setParamName9(method.getParamName9()); |
| | | c2cOrder.setParamValue9(method.getParamValue9()); |
| | | c2cOrder.setParamName10(method.getParamName10()); |
| | | c2cOrder.setParamValue10(method.getParamValue10()); |
| | | c2cOrder.setParamName11(method.getParamName11()); |
| | | c2cOrder.setParamValue11(method.getParamValue11()); |
| | | c2cOrder.setParamName12(method.getParamName12()); |
| | | c2cOrder.setParamValue12(method.getParamValue12()); |
| | | c2cOrder.setParamName13(method.getParamName13()); |
| | | c2cOrder.setParamValue13(method.getParamValue13()); |
| | | c2cOrder.setParamName14(method.getParamName14()); |
| | | c2cOrder.setParamValue14(method.getParamValue14()); |
| | | c2cOrder.setParamName15(method.getParamName15()); |
| | | c2cOrder.setParamValue15(method.getParamValue15()); |
| | | c2cOrder.setQrcode(method.getQrcode()); |
| | | } |
| | | |
| | | c2cOrder.setCreateTime(new Date()); |
| | | c2cOrder.setHandleTime(null); |
| | | c2cOrder.setCloseTime(DateUtils.addMinute(c2cOrder.getCreateTime(), c2cOrder.getExpireTime())); |
| | |
| | | throw new YamiShopBindException("金额不在购买区间"); |
| | | } |
| | | |
| | | double amountBefore = 0d; |
| | | double amountAfter = 0d; |
| | | double amountBefore ; |
| | | double amountAfter ; |
| | | |
| | | if ("usdt".equalsIgnoreCase(c2cAdvert.getSymbol())) { |
| | | |
| | |
| | | // 保存资金日志 |
| | | MoneyLog moneylog = new MoneyLog(); |
| | | moneylog.setCategory(Constants.MONEYLOG_CATEGORY_C2C); |
| | | moneylog.setAmount_before(new BigDecimal(amountBefore)); |
| | | moneylog.setAmountBefore(new BigDecimal(amountBefore)); |
| | | moneylog.setAmount(new BigDecimal(Arith.sub(0, c2cOrder.getCoinAmount()))); |
| | | moneylog.setAmount_after(new BigDecimal(amountAfter)); |
| | | moneylog.setAmountAfter(new BigDecimal(amountAfter)); |
| | | moneylog.setLog("c2c卖币,币种[" + c2cOrder.getSymbol() + "],订单号[" + c2cOrder.getOrderNo() + "]"); |
| | | moneylog.setUserId(c2cOrder.getPartyId()); |
| | | moneylog.setWalletType(c2cOrder.getSymbol()); |