| | |
| | | |
| | | |
| | | // 存放uid以及对应uid用户的佣金 |
| | | Map<String, BigDecimal> map = new HashMap<>(); |
| | | Map<String, Map<String, BigDecimal>> map = new HashMap<>(); |
| | | Iterator<Map.Entry<Integer, NeedMoneyMemberVo>> it = treeMap.entrySet().iterator(); |
| | | BigDecimal lastRate = BigDecimal.ZERO; |
| | | BigDecimal lastYj = BigDecimal.ZERO; |
| | | while (it.hasNext()) { |
| | | Map.Entry<Integer, NeedMoneyMemberVo> entry = it.next(); |
| | | NeedMoneyMemberVo member1 = entry.getValue(); |
| | | Map<String, BigDecimal> returnValue = new HashMap<>(); |
| | | returnValue.put("ratio", member1.getReturnRatio()); |
| | | returnValue.put("lastRate", lastRate); |
| | | // 上下级佣金比率相减后乘以手续费 -- 即用户所得佣金 |
| | | lastYj = (member1.getReturnRatio().subtract(lastRate)).multiply(money); |
| | | lastRate = member1.getReturnRatio(); |
| | | map.put(member1.getInviteId(), lastYj); |
| | | returnValue.put("returnMoney", lastYj); |
| | | map.put(member1.getInviteId(), returnValue); |
| | | } |
| | | |
| | | // 输出对应佣金是否正确 |
| | | Iterator<Map.Entry<String, BigDecimal>> it1 = map.entrySet().iterator(); |
| | | Iterator<Map.Entry<String, Map<String, BigDecimal>>> it1 = map.entrySet().iterator(); |
| | | List<AgentReturnEntity> agentList = new ArrayList<AgentReturnEntity>(); |
| | | while (it1.hasNext()) { |
| | | Map.Entry<String, BigDecimal> entry = it1.next(); |
| | | Map.Entry<String, Map<String, BigDecimal>> entry = it1.next(); |
| | | // System.out.println(entry.getKey() + "-----" + entry.getValue()); |
| | | MemberEntity agentMember = memberService.selectMemberInfoByInviteId(entry.getKey()); |
| | | AgentReturnEntity agent = new AgentReturnEntity(); |
| | |
| | | agent.setOrderType(order.getOrderType()); |
| | | agent.setReturnSymbol(order.getSymbol()); |
| | | agent.setIsReturn(0); |
| | | agent.setReturnAmount(entry.getValue()); |
| | | agent.setReturnAmount(entry.getValue().get("returnMoney")); |
| | | agent.setChildReturnRatio(entry.getValue().get("lastRate")); |
| | | agent.setReturnRatio(entry.getValue().get("ratio")); |
| | | agent.setClosingType(order.getClosingType()); |
| | | if (type == 1) {//开仓 |
| | | agent.setOpeningFeeAmount(order.getOpeningFeeAmount()); |