| | |
| | | data.put("fee", item.getUnitFee()); |
| | | |
| | | List<ItemLeverageDTO> lLeverageDTO = itemLeverageService.findByItemId(item.getUuid()); |
| | | // 对list进行排序,按照lever_rate字段升序排列 |
| | | Collections.sort(lLeverageDTO, new Comparator<ItemLeverageDTO>() { |
| | | @Override |
| | | public int compare(ItemLeverageDTO o1, ItemLeverageDTO o2) { |
| | | try { |
| | | Double rate1 = Double.valueOf(o1.getLeverRate()); |
| | | Double rate2 = Double.valueOf(o2.getLeverRate()); |
| | | return rate1.compareTo(rate2); |
| | | } catch (NumberFormatException e) { |
| | | return 0; |
| | | } |
| | | } |
| | | }); |
| | | data.put("lever", lLeverageDTO); |
| | | |
| | | String partyId = SecurityUtils.getCurrentUserId(); |
| | |
| | | private void checkUserStatus(String partyId) { |
| | | User user = userService.getById(partyId); |
| | | if (!user.isEnabled()) { |
| | | throw new YamiShopBindException("用户已锁定"); |
| | | throw new YamiShopBindException("User is locked"); |
| | | } |
| | | } |
| | | |
| | |
| | | order.setOrderPriceType(openAction.getPrice_type()); |
| | | order.setState(ContractApplyOrder.STATE_SUBMITTED); |
| | | order.setMoney(openAction.getAmount()); |
| | | order.setLocationType(openAction.getLocationType()); |
| | | |
| | | contractApplyOrderService.saveCreate(order); |
| | | } |
| | |
| | | try { |
| | | User user = userService.getById(partyId); |
| | | if (!user.isEnabled()) { |
| | | throw new YamiShopBindException("用户已锁定"); |
| | | throw new YamiShopBindException("User is locked"); |
| | | } |
| | | |
| | | Syspara syspara = sysparaService.find("stop_user_internet"); |