Commit c6127b00652885aabf4063042f065c6ba585e362

Authored by 廖磊
1 parent b79f715f

0109

src/main/java/com/bsth/controller/realcontrol/ScheduleRealInfoController.java
... ... @@ -418,4 +418,12 @@ public class ScheduleRealInfoController extends BaseController<ScheduleRealInfo,
418 418 public Map<String, Object> findSvgAttr(@RequestParam String idx){
419 419 return scheduleRealInfoService.findSvgAttr(idx);
420 420 }
  421 +
  422 + @RequestMapping(value = "scheduleDailyQp", method = RequestMethod.GET)
  423 + public List<Map<String, Object>> scheduleDailyQp(@RequestParam String line,@RequestParam String date){
  424 + return scheduleRealInfoService.scheduleDailyQp(line,date);
  425 + }
  426 +
  427 +
  428 +
421 429 }
... ...
src/main/java/com/bsth/repository/realcontrol/ScheduleRealInfoRepository.java
... ... @@ -18,6 +18,9 @@ public interface ScheduleRealInfoRepository extends BaseRepository&lt;ScheduleRealI
18 18 List<ScheduleRealInfo> findByLines(List<String> lines);
19 19  
20 20  
  21 + @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 and bc_type not in ('in','out') order by (lpName+1),clZbh,realExecDate,fcsj")
  22 + List<ScheduleRealInfo> scheduleDailyQp(String line,String date);
  23 +
21 24 @Query(value="select s from ScheduleRealInfo s where s.xlBm = ?1 and DATE_FORMAT(s.scheduleDate,'%Y-%m-%d') = ?2 GROUP BY s.id,s.jGh,s.clZbh,s.lpName order by (lpName+1)")
22 25 List<ScheduleRealInfo> queryUserInfo(String line,String date);
23 26  
... ...
src/main/java/com/bsth/service/realcontrol/ScheduleRealInfoService.java
... ... @@ -140,4 +140,6 @@ public interface ScheduleRealInfoService extends BaseService&lt;ScheduleRealInfo, L
140 140 Map<String,Object> svgAttr(String jsonStr);
141 141  
142 142 Map<String,Object> findSvgAttr(String idx);
  143 +
  144 + List<Map<String, Object>> scheduleDailyQp(String line ,String date);
143 145 }
... ...
src/main/java/com/bsth/service/realcontrol/impl/ScheduleRealInfoServiceImpl.java
... ... @@ -2373,4 +2373,140 @@ public class ScheduleRealInfoServiceImpl extends BaseServiceImpl&lt;ScheduleRealInf
2373 2373 return map;
2374 2374 }
2375 2375  
  2376 + @Override
  2377 + public List<Map<String, Object>> scheduleDailyQp(String line, String date) {
  2378 + // TODO Auto-generated method stub
  2379 + List<Map<String, Object>> list=new ArrayList<Map<String, Object>>();
  2380 + List<ScheduleRealInfo> scheduleRealInfos=scheduleRealInfoRepository.scheduleDailyQp(line, date);
  2381 + Map<String, Object> map=null;
  2382 + String lp="lp";
  2383 + String jgh="jgh";
  2384 + String clzbh="clzbh";
  2385 + int bcs=0;
  2386 + String thclzbh="";
  2387 + String sgh="sgh";
  2388 + for(int i=0;i<scheduleRealInfos.size();i++){
  2389 + ScheduleRealInfo scheduleRealInfo=scheduleRealInfos.get(i);
  2390 + if(scheduleRealInfo.getLpName().equals(lp)){
  2391 + bcs++;
  2392 + String fcsj=scheduleRealInfo.getFcsj();
  2393 +
  2394 + if(!clzbh.equals(scheduleRealInfo.getClZbh())){
  2395 + clzbh=scheduleRealInfo.getClZbh();
  2396 + if(thclzbh==""){
  2397 + thclzbh +=scheduleRealInfo.getClZbh()+",";
  2398 + }else{
  2399 + thclzbh +=scheduleRealInfo.getClZbh();
  2400 + }
  2401 + map.put("thclzbh", thclzbh);
  2402 + }
  2403 +
  2404 + if(!jgh.equals(scheduleRealInfo.getjGh())){
  2405 + jgh=scheduleRealInfo.getjGh();
  2406 + if(map.get("jjb2")!=null){
  2407 + map.put("jjb3", scheduleRealInfo.getjGh()+"/"+
  2408 + scheduleRealInfo.getFcsjActual());
  2409 +
  2410 + }else{
  2411 + map.put("jjb2", scheduleRealInfo.getjGh()+"/"+
  2412 + scheduleRealInfo.getFcsjActual());
  2413 + }
  2414 +
  2415 + }
  2416 +
  2417 + if(scheduleRealInfo.getsGh()!=null){
  2418 + if(!scheduleRealInfo.getsGh().equals(sgh)){
  2419 + sgh=scheduleRealInfo.getsGh();
  2420 + if(map.get("sjb1")!=null){
  2421 + if(map.get("sjb2")!=null){
  2422 + map.put("sjb3", scheduleRealInfo.getsGh()+"/"+
  2423 + scheduleRealInfo.getFcsjActual());
  2424 + }else{
  2425 + map.put("sjb2", scheduleRealInfo.getsGh()+"/"+
  2426 + scheduleRealInfo.getFcsjActual());
  2427 + }
  2428 + }else{
  2429 + map.put("sjb1", scheduleRealInfo.getsGh()+"/"+
  2430 + scheduleRealInfo.getFcsjActual());
  2431 + }
  2432 + }
  2433 + }
  2434 + if(scheduleRealInfo.getFcsjActual()!=null){
  2435 + String fcsjs[]=fcsj.split(":");
  2436 + String fcsjActuals[]=scheduleRealInfo.getFcsjActual().split(":");
  2437 + int a=Integer.parseInt(fcsjActuals[0])*60+Integer.parseInt(fcsjActuals[1]);
  2438 + int b=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]);
  2439 + map.put("cz"+bcs, b-a);
  2440 + }else{
  2441 + map.put("cz"+bcs, "无");
  2442 + }
  2443 + map.put("lp", scheduleRealInfo.getLpName());
  2444 + map.put("dd"+bcs, scheduleRealInfo.getZdsjActual());
  2445 + map.put("kc"+bcs, scheduleRealInfo.getFcsjActual());
  2446 +
  2447 + if(i<scheduleRealInfos.size()-1){
  2448 + if(!scheduleRealInfos.get(i+1).getLpName().equals
  2449 + (scheduleRealInfos.get(i).getLpName())){
  2450 + list.add(map);
  2451 + lp="lp";
  2452 + jgh="jgh";
  2453 + clzbh="clzbh";
  2454 + bcs=0;
  2455 + thclzbh="";
  2456 + sgh="sgh";
  2457 + }
  2458 + }else{
  2459 + list.add(map);
  2460 + }
  2461 + }else{
  2462 + bcs=1;
  2463 + map=new HashMap<String,Object>();
  2464 + lp=scheduleRealInfo.getLpName();
  2465 + jgh=scheduleRealInfo.getjGh();
  2466 + clzbh=scheduleRealInfo.getClZbh();
  2467 + if(scheduleRealInfo.getsGh()!=null){
  2468 + sgh=scheduleRealInfo.getsGh();
  2469 + map.put("sjb1",scheduleRealInfo.getsGh()+"/"+
  2470 + scheduleRealInfo.getFcsjActual());
  2471 + }
  2472 + String fcsj=scheduleRealInfo.getFcsj();
  2473 + scheduleRealInfo.getFcsjActual();
  2474 + map.put("jjb1", jgh+"/"+scheduleRealInfo.getFcsjActual());
  2475 + map.put("cccl", clzbh);
  2476 +
  2477 + if(scheduleRealInfo.getFcsjActual()!=null){
  2478 + String fcsjs[]=fcsj.split(":");
  2479 + String fcsjActuals[]=scheduleRealInfo.getFcsjActual().split(":");
  2480 + int a=Integer.parseInt(fcsjActuals[0])*60+Integer.parseInt(fcsjActuals[1]);
  2481 + int b=Integer.parseInt(fcsjs[0])*60+Integer.parseInt(fcsjs[1]);
  2482 + map.put("cz"+bcs, b-a);
  2483 + }else{
  2484 + map.put("cz"+bcs, "无");
  2485 + }
  2486 +
  2487 +
  2488 + map.put("lp", scheduleRealInfo.getLpName());
  2489 + map.put("dd"+bcs, scheduleRealInfo.getZdsjActual());
  2490 + map.put("kc"+bcs, scheduleRealInfo.getFcsjActual());
  2491 +
  2492 + if(i<scheduleRealInfos.size()-1){
  2493 + if(!scheduleRealInfos.get(i+1).getLpName().equals
  2494 + (scheduleRealInfos.get(i).getLpName())){
  2495 + list.add(map);
  2496 + lp="lp";
  2497 + jgh="jgh";
  2498 + clzbh="clzbh";
  2499 + bcs=0;
  2500 + thclzbh="";
  2501 + sgh="sgh";
  2502 + }
  2503 + }else{
  2504 + list.add(map);
  2505 + }
  2506 + }
  2507 +
  2508 + }
  2509 + return list;
  2510 + }
  2511 +
2376 2512 }
2377 2513 \ No newline at end of file
... ...
src/main/resources/static/pages/forms/statement/scheduleDailyQp.html
... ... @@ -52,7 +52,7 @@
52 52 <div class="portlet-body" >
53 53 <div class="table-container" style="margin-top: 10px;overflow:auto;min-width: 506px;height: 400px">
54 54 <table class="table table-bordered table-hover table-checkable" id="forms">
55   - <thead>
  55 + <thead >
56 56 <tr >
57 57 <th style="text-align:center;vertical-align:middle;" rowspan="3">路牌</th>
58 58 <th style="text-align:center;vertical-align:middle;"
... ... @@ -62,90 +62,126 @@
62 62 <th colspan="3" style="text-align:center;vertical-align:middle;">售票员</th>
63 63 <th rowspan="3" style="text-align:center;vertical-align:middle;">路牌</th>
64 64 <th rowspan="4" style="text-align:center;vertical-align:middle;">记录项目</th>
65   - <th colspan="4" style="text-align:center;vertical-align:middle;">1</th>
66   - <th colspan="4" style="text-align:center;vertical-align:middle;">2</th>
67   - <th colspan="4" style="text-align:center;vertical-align:middle;">3</th>
68   - <th colspan="4" style="text-align:center;vertical-align:middle;">4</th>
69   - <th colspan="4" style="text-align:center;vertical-align:middle;">5</th>
70   - <th colspan="4" style="text-align:center;vertical-align:middle;">6</th>
71   - <th colspan="4" style="text-align:center;vertical-align:middle;">7</th>
72   - <th colspan="4" style="text-align:center;vertical-align:middle;">8</th>
73   - <th colspan="4" style="text-align:center;vertical-align:middle;">9</th>
74   - <th colspan="4" style="text-align:center;vertical-align:middle;">10</th>
75   - <th colspan="4" style="text-align:center;vertical-align:middle;">11</th>
76   - <th colspan="4" style="text-align:center;vertical-align:middle;">12</th>
77   - <th colspan="4" style="text-align:center;vertical-align:middle;">13</th>
  65 + <th colspan="3" style="text-align:center;vertical-align:middle;">1</th>
  66 + <th colspan="3" style="text-align:center;vertical-align:middle;">2</th>
  67 + <th colspan="3" style="text-align:center;vertical-align:middle;">3</th>
  68 + <th colspan="3" style="text-align:center;vertical-align:middle;">4</th>
  69 + <th colspan="3" style="text-align:center;vertical-align:middle;">5</th>
  70 + <th colspan="3" style="text-align:center;vertical-align:middle;">6</th>
  71 + <th colspan="3" style="text-align:center;vertical-align:middle;">7</th>
  72 + <th colspan="3" style="text-align:center;vertical-align:middle;">8</th>
  73 + <th colspan="3" style="text-align:center;vertical-align:middle;">9</th>
  74 + <th colspan="3" style="text-align:center;vertical-align:middle;">10</th>
  75 + <th colspan="3" style="text-align:center;vertical-align:middle;">11</th>
  76 + <th colspan="3" style="text-align:center;vertical-align:middle;">12</th>
  77 + <th colspan="3" style="text-align:center;vertical-align:middle;">13</th>
  78 + <th colspan="3" style="text-align:center;vertical-align:middle;">14</th>
  79 + <th colspan="3" style="text-align:center;vertical-align:middle;">15</th>
  80 + <th colspan="3" style="text-align:center;vertical-align:middle;">16</th>
  81 + <th colspan="3" style="text-align:center;vertical-align:middle;">17</th>
  82 + <th colspan="3" style="text-align:center;vertical-align:middle;">18</th>
  83 + <th colspan="3" style="text-align:center;vertical-align:middle;">19</th>
  84 + <th colspan="3" style="text-align:center;vertical-align:middle;">20</th>
78 85  
79 86 </tr>
80 87 <tr>
81 88  
82   - <th rowspan="2">职号</th>
83   - <th colspan="2">接班时间</th>
84   - <th rowspan="2">职号</th>
85   - <th colspan="2">接班时间</th>
  89 +
  90 + <th colspan="3">职号/接班时间</th>
  91 + <th colspan="3">职号/接班时间</th>
  92 + <th rowspan="2">到达</th>
  93 + <th rowspan="2">早/迟</th>
  94 + <th rowspan="2">开出</th>
  95 +
  96 + <th rowspan="2">到达</th>
  97 + <th rowspan="2">早/迟</th>
  98 + <th rowspan="2">开出</th>
  99 +
  100 + <th rowspan="2">到达</th>
  101 + <th rowspan="2">早/迟</th>
  102 + <th rowspan="2">开出</th>
  103 +
  104 + <th rowspan="2">到达</th>
  105 + <th rowspan="2">早/迟</th>
  106 + <th rowspan="2">开出</th>
  107 +
  108 + <th rowspan="2">到达</th>
  109 + <th rowspan="2">早/迟</th>
  110 + <th rowspan="2">开出</th>
  111 +
  112 + <th rowspan="2">到达</th>
  113 + <th rowspan="2">早/迟</th>
  114 + <th rowspan="2">开出</th>
  115 +
  116 + <th rowspan="2">到达</th>
  117 + <th rowspan="2">早/迟</th>
  118 + <th rowspan="2">开出</th>
  119 +
86 120 <th rowspan="2">到达</th>
87 121 <th rowspan="2">早/迟</th>
88 122 <th rowspan="2">开出</th>
89   - <th rowspan="2">备注</th>
  123 +
90 124 <th rowspan="2">到达</th>
91 125 <th rowspan="2">早/迟</th>
92 126 <th rowspan="2">开出</th>
93   - <th rowspan="2">备注</th>
  127 +
94 128 <th rowspan="2">到达</th>
95 129 <th rowspan="2">早/迟</th>
96 130 <th rowspan="2">开出</th>
97   - <th rowspan="2">备注</th>
  131 +
98 132 <th rowspan="2">到达</th>
99 133 <th rowspan="2">早/迟</th>
100 134 <th rowspan="2">开出</th>
101   - <th rowspan="2">备注</th>
  135 +
102 136 <th rowspan="2">到达</th>
103 137 <th rowspan="2">早/迟</th>
104 138 <th rowspan="2">开出</th>
105   - <th rowspan="2">备注</th>
  139 +
106 140 <th rowspan="2">到达</th>
107 141 <th rowspan="2">早/迟</th>
108 142 <th rowspan="2">开出</th>
109   - <th rowspan="2">备注</th>
  143 +
110 144 <th rowspan="2">到达</th>
111 145 <th rowspan="2">早/迟</th>
112 146 <th rowspan="2">开出</th>
113   - <th rowspan="2">备注</th>
  147 +
114 148 <th rowspan="2">到达</th>
115 149 <th rowspan="2">早/迟</th>
116 150 <th rowspan="2">开出</th>
117   - <th rowspan="2">备注</th>
  151 +
118 152 <th rowspan="2">到达</th>
119 153 <th rowspan="2">早/迟</th>
120 154 <th rowspan="2">开出</th>
121   - <th rowspan="2">备注</th>
  155 +
122 156 <th rowspan="2">到达</th>
123 157 <th rowspan="2">早/迟</th>
124 158 <th rowspan="2">开出</th>
125   - <th rowspan="2">备注</th>
  159 +
126 160 <th rowspan="2">到达</th>
127 161 <th rowspan="2">早/迟</th>
128 162 <th rowspan="2">开出</th>
129   - <th rowspan="2">备注</th>
  163 +
130 164 <th rowspan="2">到达</th>
131 165 <th rowspan="2">早/迟</th>
132 166 <th rowspan="2">开出</th>
133   - <th rowspan="2">备注</th>
  167 +
134 168 <th rowspan="2">到达</th>
135 169 <th rowspan="2">早/迟</th>
136 170 <th rowspan="2">开出</th>
137   - <th rowspan="2">备注</th>
  171 +
138 172 </tr>
139 173 <tr>
140 174 <th>出场</th>
141 175 <th>调换</th>
142 176 <th>1</th>
143 177 <th>2</th>
  178 + <th>3</th>
144 179 <th>1</th>
145 180 <th>2</th>
  181 + <th>3</th>
146 182 </tr>
147 183 </thead>
148   - <tbody>
  184 + <tbody >
149 185 <tr >
150 186 <td>1</td>
151 187 <td>
... ... @@ -221,6 +257,14 @@
221 257 <td></td>
222 258 <td></td>
223 259 <td></td>
  260 + <td></td>
  261 + <td></td>
  262 + <td></td>
  263 + <td></td>
  264 + <td></td>
  265 + <td></td>
  266 + <td></td>
  267 + <td></td>
224 268 </tr>
225 269  
226 270 </tbody>
... ... @@ -297,34 +341,16 @@
297 341 }
298 342  
299 343  
300   - $("#query").on("click",jsDoQuery);
301   -
302   - var line = $("#line").val();
303   - var date = $("#date").val();
304   - var company = $("#company").val();
305   - var subCompany = $("#subCompany").val();
306   - function jsDoQuery(pagination){
307   - var params = {};
308   - line = $("#line").val();
309   - date = $("#date").val();
310   - company = $("#company").val();
311   - subCompany = $("#subCompany").val();
312   - if(line == " ")
313   - line = "";
314   - params['line'] = line;
315   - params['date'] = date;
316   - params['type'] = "query";
317   - params['company'] = company;
318   - params['subCompany'] = subCompany;
319   - $(".hidden").removeClass("hidden");
320   - /* $get('/pcpc/workDaily', params, function(result){
321   - // 把数据填充到模版中
322   - var tbodyHtml = template('list_workDaily',{list:result});
323   - // 把渲染好的模版html文本追加到表格中
324   - $('#forms tbody').html(tbodyHtml);
325   -
326   - }); */
327   - }
  344 + //查询
  345 + $("#query").on('click',function(){
  346 + var line = $("#line").val();
  347 + var date = $("#date").val();
  348 + $get('/realSchedule/scheduleDailyQp',{line:line,date:date},function(result){
  349 + var mycars = new Array(20);
  350 + var scheduleDaily_qp = template('scheduleDaily_qp',{list:result,lists:mycars});
  351 + $('#forms tbody').html(scheduleDaily_qp);
  352 + });
  353 + });
328 354  
329 355 $("#export").on("click",function(){
330 356 $get('/pcpc/workDaily',{line:line,date:date,type:'export'},function(result){
... ... @@ -336,27 +362,28 @@
336 362 });
337 363  
338 364 </script>
339   -<script type="text/html" id="list_workDaily">
  365 +<script type="text/html" id="scheduleDaily_qp">
340 366 {{each list as obj i}}
341 367 <tr>
342   - <td>{{obj.date}}</td>
343   - <td>{{obj.line}}</td>
344   - <td>{{obj.jhbc}}</td>
345   - <td>{{obj.dftz}}</td>
346   - <td>{{obj.dftzl}}</td>
347   - <td>{{obj.ccl}}</td>
348   - <td>{{obj.upfk}}</td>
349   - <td>{{obj.updk}}</td>
350   - <td>{{obj.dnfk}}</td>
351   - <td>{{obj.dndk}}</td>
352   - <td>{{obj.upfm}}</td>
353   - <td>{{obj.updm}}</td>
354   - <td>{{obj.dnfm}}</td>
355   - <td>{{obj.dndm}}</td>
356   - <td>{{obj.wdzs}}</td>
357   - <td>{{obj.smbzdl}}</td>
358   - <td>{{obj.gfbczxl}}</td>
359   - </tr>
  368 + <td>{{obj.lp}}</td>
  369 + <td>{{obj.cccl}}</td>
  370 + <td>{{obj.thclzbh}}</td>
  371 + <td>&nbsp;</td>
  372 + <td>{{obj.jjb1}}</td>
  373 + <td>{{obj.jjb2}}</td>
  374 + <td>{{obj.jjb3}}</td>
  375 + <td>{{obj.sjb1}}</td>
  376 + <td>{{obj.sjb2}}</td>
  377 + <td>{{obj.sjb3}}</td>
  378 + <td>{{obj.lp}}</td>
  379 + <td>&nbsp;</td>
  380 + {{each lists as o j}}
  381 + <td>{{obj['dd'+(j+1)]}}</td>
  382 + <td>{{obj['cz'+(j+1)]}}</td>
  383 + <td>{{obj['kc'+(j+1)]}}</td>
  384 + {{/each}}
  385 +
  386 +
360 387 {{/each}}
361 388 {{if list.length == 0}}
362 389 <tr>
... ...