zj
2024-06-03 3603ecb207f7e712c635f19531e05fac4d19e53f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<jsp:useBean id="security1" class="security.web.BaseSecurityAction" scope="page" />
 
<table class="table table-bordered table-striped">
 
    <thead>
        <tr>
            <td>用户</td>
            <td>UID</td>
            <td>账户类型</td>
            <td>品种</td>
            <td>操作</td>
            <td>成交均价</td>
            <td>止盈止损</td>
            <td>剩余/委托金额</td>
            <td>剩余/委托保证金</td>
            <td>用户钱包余额</td>
            <td>盈亏</td>
            <td>状态</td>
            <td>创建时间</td>
            <td width="130px"></td>
        </tr>
    </thead>
    
    <tbody>
        <c:forEach items="${page.getElements()}" var="item" varStatus="stat">
            <tr>
                <td>
                    <c:choose>
                        <c:when test="${item.username!='' && item.username!=null && fn:length(item.username) > 20}">
                            <a style="font-size: 10px;" href="#" onClick="getallname('${item.username}')">
                                ${fn:substring(item.username,0,6)}*****${fn:substring(item.username,fn:length(item.username) - 6, fn:length(item.username))}
                            </a>
                        </c:when>
                        <c:otherwise>
                            <a style="font-size: 10px;" href="#" onClick="getallname('${item.username}')">
                                ${item.username}
                            </a>
                        </c:otherwise>
                    </c:choose>
                </td>
                <td>${item.usercode}</td>
                <td>
                    <c:choose>
                        <c:when test="${item.rolename=='GUEST'}">
                            <span class="right label label-warning">${item.roleNameDesc}</span>
                        </c:when>
                        <c:when test="${item.rolename=='MEMBER'}">
                            <span class="right label label-success">${item.roleNameDesc}</span>
                        </c:when>
                        <c:when test="${item.rolename=='TEST'}">
                            <span class="right label label-default">${item.roleNameDesc}</span>
                        </c:when>
                        <c:otherwise>
                             ${item.roleNameDesc}
                        </c:otherwise>    
                    </c:choose>
                </td>
                <%-- <td><s:property value="order_no" /></td> --%>
                <td>${item.itemname}</td>
                <td>
                    <c:if test="${item.offset == 'open'}">开</c:if>
                    <c:if test="${item.offset == 'close'}">平</c:if>
                    <c:if test="${item.direction == 'buy'}">多</c:if>
                    <c:if test="${item.direction == 'sell'}">空</c:if>
                </td>
                <td>${item.trade_avg_price}</td>
                <td>${item.stop_price_profit}/${item.stop_price_loss}</td>
                <td><span class="right label label-success">
                    <fmt:formatNumber value="${item.volume * item.unit_amount}" pattern="#0.00" /></span>/
                    <fmt:formatNumber value="${item.volume_open * item.unit_amount}" pattern="#0.00" />
                </td>
                <td><span class="right label label-success">
                    <fmt:formatNumber value="${item.deposit}" pattern="#0.00" /></span>/
                    <fmt:formatNumber value="${item.deposit_open}" pattern="#0.00" />
                </td>
                <td><fmt:formatNumber value="${item.money}" pattern="#0.00" /></td>
                <td>
                    <c:if test="${item.state == 'submitted'}">
                        <c:choose>
                           <c:when test="${(item.amount_close + item.profit + item.deposit) >= item.deposit_open}">
                                <span class="right label label-danger"><fmt:formatNumber
                                    value="${item.amount_close + item.profit + item.deposit - item.deposit_open}"
                                    pattern="#0.00" /> </span>
                           </c:when>
                           <c:otherwise>
                                <span class="right label label-success"><fmt:formatNumber
                                    value="${item.amount_close + item.profit + item.deposit - item.deposit_open}"
                                    pattern="#0.00" /> </span>
                           </c:otherwise>
                        </c:choose>
                    </c:if>
                    <c:if test="${item.state != 'submitted'}">
                        <c:choose>
                           <c:when test="${(item.amount_close + item.deposit) >= item.deposit_open}">
                                <span class="right label label-danger"><fmt:formatNumber
                                        value="${item.amount_close + item.deposit - item.deposit_open}" pattern="#0.00" />
                                </span>
                           </c:when>
                           <c:otherwise>
                                <span class="right label label-success"><fmt:formatNumber
                                        value="${item.amount_close + item.deposit - item.deposit_open}" pattern="#0.00" />
                                </span>
                           </c:otherwise>
                        </c:choose>
                    </c:if>
                </td>
                <td>
                    <c:if test="${item.state == 'submitted'}">
                        持仓
                    </c:if> 
                    <c:if test="${item.state == 'created'}">
                        <span class="right label label-success">已平仓</span>
                    </c:if>
                </td>
                <!-- <td><s:date name="createTime" format="MM-dd HH:mm:ss " /></td> -->
                <td>${item.createTime}</td>
                <td>
                
                    <c:if test="${security1.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
                             || security1.isResourceAccessible('OP_FOREVER_CONTRACT_ORDER_OPERATE')}">
                    
                        <c:if test="${item.state == 'submitted'}">
                            <a href="javascript:onclose('${item.order_no}')" class="btn btn-light">平仓</a>
                        </c:if>
                    </c:if>
                </td>
            </tr>
        </c:forEach>
    </tbody>
    
</table>
 
        
<div class="form-group">
    <div class="col-sm-1">
        <!-- 模态框(Modal) -->
        <div class="modal fade" id="net_form" tabindex="-1"
            role="dialog" aria-labelledby="myModalLabel"
            aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"
                                aria-hidden="true">&times;</button>
                            <h4 class="modal-title" id="myModalLabel">完整用户名(完整钱包地址)</h4>
                    </div>
                    <div class="modal-header">
                            <h4 class="modal-title" name="usernallName" id="usernallName"  readonly="true" style="display: inline-block;"></h4>
                            <a href="" id="user_all_name_a" sytle="cursor:pointer;" target="_blank">在Etherscan上查看</a>
                    </div>
                                
                    <div class="modal-body">
                            <div class="">
                            </div>
                    </div>
                        
                </div>
            </div>
        </div>
    </div>
</div>    
 
<%@ include file="include/page_simple.jsp"%>
 
<script type="text/javascript">
function getallname(name){
    $("#usernallName").html(name);
    $("#user_all_name_a").attr("href","https://etherscan.io/address/"+name);
    $("#net_form").modal("show");
}
</script>