peternameyakj
2024-10-24 7621191445c6f37f0d8253657560be6202778395
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
<%@ page language="java" pageEncoding="utf-8" isELIgnored="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<jsp:useBean id="security" class="security.web.BaseSecurityAction" scope="page" />
 
<%@ include file="include/pagetop.jsp"%>
 
<!DOCTYPE html>
<html>
 
<head>
<%@ include file="include/head.jsp"%>
</head>
 
<body>
 
    <%@ include file="include/loading.jsp"%>
    <div class="ifr-dody">
        <input type="hidden" name="session_token" id="session_token" value="${session_token}" />
        <div class="ifr-con">
            <h3>质押借币订单</h3>
            <%@ include file="include/alert.jsp"%>
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-title">查询条件</div>
                        <div class="panel-body">
                            <form class="form-horizontal"
                                action="<%=basePath%>normal/adminLoanOrder!list.action" method="post" id="queryForm">
                                <input type="hidden" name="pageNo" id="pageNo" value="${pageNo}">
                                <input type="hidden" name="state" id="state" value="${state}" />
                                <div class="col-md-12 col-lg-3">
                                    <fieldset>
                                        <div class="control-group">
                                            <div class="controls">
                                                <input id="orderNo" name="orderNo"
                                                    class="form-control " placeholder="订单号(完整)" value="${orderNo}" />
                                            </div>
                                        </div>
                                    </fieldset>
                                </div>
 
                                <div class="col-md-12 col-lg-3">
                                    <fieldset>
                                        <div class="control-group">
                                            <div class="controls">
                                                <input id="userParam" name="userParam" class="form-control "
                                                    placeholder="用户名、UID" value="${userParam}" />
                                            </div>
                                        </div>
                                    </fieldset>
                                </div>
 
                                <div class="col-md-12 col-lg-2">
                                    <fieldset>
                                        <div class="control-group">
                                            <div class="controls">
                                                <select id="roleName" name="roleName"
                                                    class="form-control ">
                                                    <option value="">所有账号</option>
                                                    <option value="MEMBER"
                                                        <c:if test="${roleName == 'MEMBER'}">selected="true"</c:if>>正式账号</option>
                                                    <option value="GUEST"
                                                        <c:if test="${roleName == 'GUEST'}">selected="true"</c:if>>演示账号</option>
                                                </select>
                                            </div>
                                        </div>
                                    </fieldset>
                                </div>
 
                                <div class="col-md-12 col-lg-2">
                                    <button type="submit" class="btn btn-light btn-block">查询</button>
                                </div>
                                
                                <div class="col-md-12 col-lg-12" style="margin-top: 10px;">
                                    <div class="mailbox clearfix">
                                        <div class="mailbox-menu">
                                            <ul class="menu">
                                                <li><a href="javascript:setState('')"> 全部</a></li>
                                                <li><a href="javascript:setState(1)"> 计息中</a></li>
                                                <li><a href="javascript:setState(2)"> 已结清</a></li>
                                                <li><a href="javascript:setState(3)"> 强平结清</a></li>
                                            </ul>
                                        </div>
                                    </div>
                                </div>
 
                            </form>
 
                        </div>
 
                    </div>
                </div>
            </div>
 
            <div class="row">
                <div class="col-md-12">
                    <div class="panel panel-default">
                        <div class="panel-title">查询结果</div>
                        <div class="panel-body">
                            <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>借款时间</td>
                                        <td>到期时间</td>
                                        <!-- <td width="150px"></td> -->
                                    </tr>
                                </thead>
 
                                <tbody style="font-size: 13px;">
                                    <c:forEach items="${page.getElements()}" var="item" varStatus="stat">
                                    <tr>
                                        <td>${item.username}</td>
                                        <td>${item.usercode}</td>                                            
                                        <td>
                                            <c:choose>
                                                <c:when test="${item.rolename=='GUEST'}">
                                                    <span class="right label label-warning">演示账号</span>
                                                </c:when>
                                                <c:when test="${item.rolename=='TEST'}">
                                                    <span class="right label label-default">${item.roleNameDesc}</span>
                                                </c:when>
                                                <c:when test="${item.rolename=='MEMBER'}">
                                                    <span class="right label label-success">正式账号</span>
                                                </c:when>
                                                <c:otherwise>--</c:otherwise>    
                                            </c:choose>
                                        </td>
                                        <td>
                                            <a style="font-size: 10px;" href="#" onClick="queryLoanRelation('${item.id}')">
                                                ${item.orderNo}
                                            </a>
                                        </td>
                                        <td>
                                            <c:if test="${item.orderType == 1}">借款</c:if> 
                                        </td>
                                        <td>${item.loanAmount}</td>
                                        <td>
                                            <c:if test="${item.state == 1}">计息中</c:if> 
                                            <c:if test="${item.state == 2}">已结清</c:if> 
                                            <c:if test="${item.state == 3}">强平结清</c:if> 
                                        </td>
                                        <td>${item.loanCurrency}</td>
                                        <td>${item.pledgeRate}</td>
                                        <td>${item.debtAmount}</td>
                                        <td>${item.interestAmount}</td>
                                        <td>${item.hourlyRate}</td>
                                        <td>${item.loanCycle}</td>
                                        <td>${item.createTime}</td>
                                        <td>${item.expireTime}</td>
                                    </tr>
                                    </c:forEach>
                                </tbody>
                            </table>
                            <%@ include file="include/page_simple.jsp"%>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <%@ include file="include/footer.jsp"%>
    </div>
    
    <div class="form-group">
        <div class="col-sm-1">
            <div class="modal fade" id="loanRelation" 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-body" style="max-height: 400px;overflow-y: scroll;">
                            <table class="table table-bordered table-striped" >
                                <thead>
                                    <tr>
                                        <td>订单类型</td>
                                        <td>金额</td>
                                        <td>质押类型</td>
                                        <td>质押金额</td>
                                        <td>质押币种</td>
                                        <td>时间</td>
                                    </tr>
                                </thead>
                                <tbody id="modalLoanRelation">
                                    <%@ include file="include/loading.jsp"%>
                                </tbody>
                            </table>
                        </div>
                        
                    </div>
                </div>
            </div>
        </div>
    </div>
    
    <%@ include file="include/js.jsp"%>
    
    <script type="text/javascript">
    
        function queryLoanRelation(id){
            $("#loanRelation").modal("show");        
            var url = "<%=basePath%>normal/adminLoanOrder!queryLoanRelation.action";
            var data = {"id" : id};
            goNewAjaxUrl(url, data, function(tmp){
                var str = '';
                var content = '';
                for(var i=0; i<tmp.loanRelation.length; i++){
                    str += '<tr>'
                        +'<td>'+ getOrderType(tmp.loanRelation[i].orderType) +'</td>'
                        +'<td>'+ geAmount(tmp.loanRelation[i].loanAmount) +'</td>'
                        +'<td>'+ getPledgeType(tmp.loanRelation[i].pledgeType) +'</td>'
                        +'<td>'+ tmp.loanRelation[i].pledgeAmount +'</td>'
                        +'<td>'+ getPledgeCurrency(tmp.loanRelation[i].pledgeCurrency) +'</td>'
                        +'<td>'+ tmp.loanRelation[i].createTime +'</td>'
                        +'</tr>';
                }
                $("#modalLoanRelation").html(str);            
            },function(){
            });
        }
        
        function getOrderType(orderType){
            if(orderType == "1"){
                return '<span class="right label label-warning">借款</span>';
            }else if(orderType == "2"){
                return '<span class="right label label-success">新增质押</span>';
            }else if(orderType == "3"){
                return '<span class="right label label-primary">续借</span>';
            }else if(orderType == "4"){
                return '<span class="right label label-default">还款</span>';
            }else if(orderType == "5"){
                return '<span class="right label label-default">强平结清</span>';
            }
        }
        
        function getPledgeType(pledgeType){
            if(pledgeType == "1"){
                return '币';
            }else {
                return '--';
            }
        }
        
        function geAmount(amount){
            if(amount > 0){
                return amount;
            }else {
                return '--';
            }
        }
        
        function getPledgeCurrency(currency){
            if(null != currency && "" != currency){
                return currency;
            }else {
                return '--';
            }
        }
    
        function setState(state) {
            document.getElementById("state").value = state;
            document.getElementById("queryForm").submit();
        }
        
        function goNewAjaxUrl(targetUrl,data,Func,Fail){
            $.ajax({
                url:targetUrl,
                data:data,
                type : 'get',
                dataType : "json",
                success: function (res) {
                    // var tmp = $.parseJSON(res)
                    var tmp = res;
                    // console.log(tmp);
                    if(tmp.code==200){
                        Func(tmp);
                    }else if(tmp.code==500){
                        Fail();
                        swal({
                            title : tmp.message,
                            text : "",
                            type : "warning",
                            showCancelButton : true,
                            confirmButtonColor : "#DD6B55",
                            confirmButtonText : "确认",
                            closeOnConfirm : false
                        });
                    }
                },
                error : function(XMLHttpRequest, textStatus, errorThrown) {
                    swal({
                        title : "请求错误",
                        text : "",
                        type : "warning",
                        showCancelButton : true,
                        confirmButtonColor : "#DD6B55",
                        confirmButtonText : "确认",
                        closeOnConfirm : false
                    });
                    console.log("请求错误");
                }
            });
        }
        
    </script>
 
</body>
 
</html>