| | |
| | | import com.nq.common.ServerResponse; |
| | | import com.nq.utils.CurrencyUtils; |
| | | import com.nq.utils.timeutil.DateTimeUtil; |
| | | import com.nq.utils.KeyUtils; |
| | | import com.nq.utils.redis.JsonUtil; |
| | | import com.nq.utils.stock.BuyAndSellUtils; |
| | | import com.nq.vo.agent.AgentIncomeVO; |
| | |
| | | |
| | | @Resource |
| | | UserMapper userMapper; |
| | | @Resource |
| | | UserCashDetailMapper userCashDetailMapper; |
| | | @Autowired |
| | | IAgentUserService iAgentUserService; |
| | | @Resource |
| | |
| | | @Autowired |
| | | CurrencyUtils currencyUtils; |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ServerResponse buyIndex(Integer indexId, Integer buyNum, Integer buyType, Integer lever,BigDecimal profitTarget,BigDecimal stopTarget, HttpServletRequest request) throws Exception { |
| | | |
| | | |
| | |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ServerResponse buyIndexOrder(Integer indexId, Integer buyNum, Integer buyType, Integer lever,BigDecimal profitTarget,BigDecimal stopTarget,Integer userId) throws Exception { |
| | | if (indexId == null || buyNum == null || buyType == null) { |
| | | return ServerResponse.createByErrorMsg("参数不能为空"); |
| | |
| | | return ServerResponse.createByErrorMsg("删除失败"); |
| | | } |
| | | |
| | | @Transactional |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public ServerResponse sellIndex(String positionSn, int doType) throws Exception { |
| | | log.info("【用户交易平仓指数】 positionSn = {} , dotype = {}", positionSn, Integer.valueOf(doType)); |
| | | return ServerResponse.createBySuccessMsg("Closed position successfully!"); |