| | |
| | | User user = (User) JsonUtil.string2Obj(userJson, User.class); |
| | | // log.info("user:{}",user); |
| | | if (user != null) { |
| | | List<UserPendingorder> userPendingorders = userPendingorderMapper.selectList(new QueryWrapper<UserPendingorder>().eq("user_id", user.getId())); |
| | | List<UserPendingorder> userPendingorders = userPendingorderMapper.selectList(new QueryWrapper<UserPendingorder>().eq("user_id", user.getId()).eq("status",0)); |
| | | |
| | | List UserPendingorderList = new ArrayList(); |
| | | |
| | |
| | | continue; |
| | | } |
| | | |
| | | // 判断价格是否达到目标价格 |
| | | int ret = userPendingorder.getBuyType().intValue() == 0 |
| | | ? userPendingorder.getTargetPrice().compareTo(nowPrice) |
| | | : nowPrice.compareTo(userPendingorder.getTargetPrice()); |
| | | |
| | | if (ret > 0) { |
| | | // 价格未达到目标价格,继续等待 |
| | | // 判断价格是否达到目标价格:当前价格 <= 挂单价就买入 |
| | | if (nowPrice.compareTo(userPendingorder.getTargetPrice()) > 0) { |
| | | // 当前价格大于挂单价,继续等待 |
| | | continue; |
| | | } |
| | | |