| | |
| | | import com.nq.dao.UserMapper; |
| | | import com.nq.pojo.*; |
| | | import com.nq.service.*; |
| | | import com.nq.utils.TradingDayUtil; |
| | | import com.nq.utils.DateTimeUtil; |
| | | import com.nq.utils.KeyUtils; |
| | | import com.nq.utils.stock.BuyAndSellUtils; |
| | |
| | | if (siteProduct.getRealNameDisplay() && (StringUtils.isBlank(user.getRealName()) || StringUtils.isBlank(user.getIdCard()))) { |
| | | return ServerResponse.createByErrorMsg("下单失败,请先实名认证"); |
| | | } |
| | | if(siteProduct.getHolidayDisplay()){ |
| | | if(TradingDayUtil.shouldBlockTradingToday(siteProduct)){ |
| | | return ServerResponse.createByErrorMsg("周末或节假日不能交易!"); |
| | | } |
| | | BigDecimal user_enable_amt = user.getEnableAmt(); |
| | |
| | | userPosition.setIsLock(Integer.valueOf(0)); |
| | | userPosition.setOrderLever(lever); |
| | | userPosition.setOrderTotalPrice(buy_amt); |
| | | BigDecimal buy_fee_amt = buy_amt.multiply(siteSetting.getBuyFee()).setScale(2, 4); |
| | | BigDecimal buy_fee_amt = com.nq.utils.TradeFeeUtil.calcBuyFee(buy_amt, siteSetting.getBuyFee()); |
| | | log.info("用户购买手续费(配资后总资金 * 百分比) = {}", buy_fee_amt); |
| | | userPosition.setOrderFee(buy_fee_amt); |
| | | |
| | |
| | | if (siteProduct.getRealNameDisplay() && user.getIsLock().intValue() == 1) { |
| | | return ServerResponse.createByErrorMsg("平仓失败,用户已被锁定"); |
| | | } |
| | | if(siteProduct.getHolidayDisplay()){ |
| | | if(TradingDayUtil.shouldBlockTradingToday(siteProduct)){ |
| | | return ServerResponse.createByErrorMsg("周末或节假日不能交易!"); |
| | | } |
| | | |