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
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
<%@ 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" %>
<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">
 
        <div class="ifr-con">
            <h3>行情管理</h3>
            <%@ include file="include/alert.jsp"%>
            
            <div class="modal fade" id="myModal3" tabindex="-1"
                                        role="dialog" aria-hidden="true" style="display: none;">
                <div class="modal-dialog modal-sm">
                    <div class="modal-content">
                        <div class="modal-header">
                            <button type="button" class="close" data-dismiss="modal"
                                aria-label="Close">
                                <span aria-hidden="true">×</span>
                            </button>
                            <h4 class="modal-title" id="item_name">调整</h4>
                        </div>
                        <form class="form-horizontal"
                            action="<%=basePath%>normal/adminMarketQuotationsManageAction!adjust.action"
                            method="post" id="mainForm">
                            <input type="hidden" id="adjust_symbol" name="symbol" />
                            <%-- <input type="hidden" name="pageNo" id="pageNo" value="${pageNo}"> --%>
                            <input type="hidden" name="status_para">
                            <input type="hidden" name="start_time">
                            <input type="hidden" name="end_time">
                            <input type="hidden" name="rolename_para">
                            
                            <div class="modal-body">
                                <div class="form-area">
                                    请输入正负调整值 <input type="text" id="adjust" name="value"
                                        class="form-control" placeholder="正负调整值"
                                        onchange="getValue(2);">
                                    <button type="button"
                                        class="btn btn-default btn-icon btn-sm"
                                        style="margin-top: 6px;" id="adjust_add_button"
                                        onclick="getValue(0);"></button>
                                    &nbsp;
                                    <button type="button"
                                        class="btn btn-default btn-icon btn-sm"
                                        style="margin-top: 6px;" id="adjust_sub_button"
                                        onclick="getValue(1);"></button>
                                    <div class="form-area">
                                        生效趋势(秒,0秒为即时生效) <input type="text" id="second"
                                            name="second" class="form-control" value="0">
                                    </div>
                                </div>
                                <div class="form-area">
                                    调整值
                                    <table class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
                                                <td>原值</td>
                                                <td>调整后</td>
                                                <td>累计修正值</td>
                                            </tr>
                                        </thead>
                                        <tbody>
                                             <tr>
                                                <td id="adjust_value_before"><span
                                                    class="label label-danger" id="adjust_value_before"></span></td>
                                                <td><span class="label label-danger"
                                                    id="adjust_value_after"></span></td>
                                                <td id="adjust_value"></td>
                                            </tr> 
                                    </table>
                                </div>
                                <div class="form-area">
                                    生效趋势
                                    <table class="table table-bordered table-striped">
                                        <thead>
                                            <tr>
                                                <td>待生效值</td>
                                                <td>时间(秒)</td>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td id="adjust_delay"></td>
                                                <td id="adjust_second"></td>
                                            </tr>
                                    </table>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
                                
                                <c:if test="${security.isRolesAccessible('ROLE_ROOT,ROLE_ADMIN')
                                             || security.isResourceAccessible('OP_MARKET_OPERATE')}">
                                
                                    <button type="submit" class="btn btn-danger">确定</button>
                                    
                                </c:if>
                                
                            </div>
                        </form>
                    </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>原值</td>
                                        <td>调整后</td>
                                        <!-- <td>行情链接</td> -->
                                        <td width="130px"></td>
                                    </tr>
                                </thead>
                                <tbody>
                                    <c:forEach items="${page.getElements()}" var="item" varStatus="stat">
                                        <tr>
                                            <td>${item.name}</td>
                                            <td>${item.new_price}</td>
                                            <td>${item.after_value}</td>
                                            <%-- <td><a href="${item.url}" target="_blank">查看K线图</a></td> --%>
                                            <td>
                                            <a href="#" class="btn btn-light" data-toggle="modal" data-target="#myModal3" 
                                                    onclick="showModal('${item.symbol}','${item.name}');" id='${item.symbol}'> 
                                                    调整</a>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                </tbody>
                            </table>
                            <%-- <%@ include file="include/page_simple.jsp"%> --%>
                            <nav>
                        </div>
 
                    </div>
                    <!-- End Panel -->
 
                </div>
            </div>
 
        </div>
        <!-- END CONTAINER -->
        <!-- //////////////////////////////////////////////////////////////////////////// -->
 
            <form class="form-horizontal" action="<%=basePath%>normal/adminMarketQuotationsManageAction!list.action"
                method="post" id="queryForm">
                <input type="hidden" name="pageNo" id="pageNo" value="${pageNo}" />
                <%@ include file="include/page_simple.jsp"%>
            </form>
            
        <%@ include file="include/footer.jsp"%>
 
 
    </div>
    <!-- End Content -->
    <!-- //////////////////////////////////////////////////////////////////////////// -->
 
 
 
    <%@ include file="include/js.jsp"%>
 
    <script type="text/javascript">
        $.fn.datetimepicker.dates['zh'] = {
            days : [ "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六", "星期日" ],
            daysShort : [ "日", "一", "二", "三", "四", "五", "六", "日" ],
            daysMin : [ "日", "一", "二", "三", "四", "五", "六", "日" ],
            months : [ "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月",
                    "十月", "十一月", "十二月" ],
            monthsShort : [ "一", "二", "三", "四", "五", "六", "七", "八", "九", "十",
                    "十一", "十二" ],
            meridiem : [ "上午", "下午" ],
            //suffix:      ["st", "nd", "rd", "th"],  
            today : "今天",
            clear : "清空"
        };
 
        $(function() {
            $('#start_time').datetimepicker({
                format : 'yyyy-mm-dd',
                language : 'zh',
                weekStart : 1,
                todayBtn : 1,
                autoclose : 1,
                todayHighlight : 1,
                startView : 2,
                clearBtn : true,
                minView : 2
            })
 
            $('#end_time').datetimepicker({
                format : 'yyyy-mm-dd',
                language : 'zh',
                weekStart : 1,
                todayBtn : 1,
                autoclose : 1,
                todayHighlight : 1,
                startView : 2,
                clearBtn : true,
                minView : 2
            })
 
        });
    </script>
 
    <script type="text/javascript">
        function setState(state){
            document.getElementById("status_para").value=state;
            document.getElementById("queryForm").submit();
        }
    </script>
 
    <script type="text/javascript">
    function showModal(symbol,name){
        
        $("#adjust_symbol").val(symbol);
        $("#adjust").val(0);
        $("#item_name").html("调整"+name);
       $("#adjust_delay").html('');
       $("#adjust_second").html('');
        $.ajax({
            type: "get",
            url: "<%=basePath%>normal/adminMarketQuotationsManageAction!showModal.action?random=" + Math.random(),
            dataType: "json",
            data: {"symbol":symbol}, 
            success: function(data) {
            var temp = data;
            $("#adjust_add_button").html("加" +temp.pips);
              $("#adjust_sub_button").html("减" +temp.pips);
             $("#adjust_value_before").html(temp.new_price);
              $("#adjust_value_after").html(temp.totalPrice);
             $("#adjust_value").html(temp.adjust_value);
             if (temp.delay_value && temp.delay_value) {
                 $("#adjust_delay").html(temp.delay_value);
                 $("#adjust_second").html(temp.delay_second);
             }
            },
            error: function(XMLHttpRequest, textStatus, errorThrown) {
                console.log("请求错误");
            }
        });
   }
   </script>
   <script type="text/javascript">
    
    function getValue(type){
        var value = $("#adjust").val(); 
        var symbol = $("#adjust_symbol").val(); 
      $.ajax({
          type: "get",
          url: "<%=basePath%>normal/adminMarketQuotationsManageAction!getValue.action?random=" + Math.random(),
                        dataType : "json",
                        data : {
                            "symbol" : symbol,
                            "type" : type,
                            "value" : value
                        },
                        success : function(data) {
                            var temp = data;
                            $("#adjust").val(temp.adjust_current_value);
                            $("#adjust_value_before").html(temp.new_price);
                            $("#adjust_value_after").html(temp.adjust_value_after);
                            $("#adjust_value").html(temp.adjust_value);
                            $("#adjust_delay").html(temp.delay_value);
                            $("#adjust_second").html(temp.delay_second);
                        },
                        error : function(XMLHttpRequest, textStatus, errorThrown) {
                            console.log("请求错误");
                        }
                    });
        }
    </script>
</body>
</html>